]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/arm926ejs/at91/at91sam9263_devices.c
at91sam9263ek: add mmc support
[karo-tx-uboot.git] / arch / arm / cpu / arm926ejs / at91 / at91sam9263_devices.c
index 6eb0f305b7238d534657ce39fa125f4d5b397437..6b51d5f355f93c929657d494cab362c125dfd212 100644 (file)
@@ -1,29 +1,13 @@
 /*
  * (C) Copyright 2007-2008
- * Stelian Pop <stelian.pop@leadtechdesign.com>
+ * Stelian Pop <stelian@popies.net>
  * Lead Tech Design <www.leadtechdesign.com>
  *
  * (C) Copyright 2009-2011
  * Daniel Gorsulowski <daniel.gorsulowski@esd.eu>
  * esd electronic system design gmbh <www.esd.eu>
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -159,6 +143,31 @@ void at91_spi1_hw_init(unsigned long cs_mask)
 }
 #endif
 
+#if defined(CONFIG_GENERIC_ATMEL_MCI)
+void at91_mci_hw_init(void)
+{
+       /* Enable mci clock */
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+       writel(1 << ATMEL_ID_MCI1, &pmc->pcer);
+
+       at91_set_a_periph(AT91_PIO_PORTA, 6, PUP);      /* MCI1_CK */
+
+#if defined(CONFIG_ATMEL_MCI_PORTB)
+       at91_set_a_periph(AT91_PIO_PORTA, 21, PUP);     /* MCI1_CDB */
+       at91_set_a_periph(AT91_PIO_PORTA, 22, PUP);     /* MCI1_DB0 */
+       at91_set_a_periph(AT91_PIO_PORTA, 23, PUP);     /* MCI1_DB1 */
+       at91_set_a_periph(AT91_PIO_PORTA, 24, PUP);     /* MCI1_DB2 */
+       at91_set_a_periph(AT91_PIO_PORTA, 25, PUP);     /* MCI1_DB3 */
+#else
+       at91_set_a_periph(AT91_PIO_PORTA, 7, PUP);      /* MCI1_CDA */
+       at91_set_a_periph(AT91_PIO_PORTA, 8, PUP);      /* MCI1_DA0 */
+       at91_set_a_periph(AT91_PIO_PORTA, 9, PUP);      /* MCI1_DA1 */
+       at91_set_a_periph(AT91_PIO_PORTA, 10, PUP);     /* MCI1_DA2 */
+       at91_set_a_periph(AT91_PIO_PORTA, 11, PUP);     /* MCI1_DA3 */
+#endif
+}
+#endif
+
 #ifdef CONFIG_MACB
 void at91_macb_hw_init(void)
 {