]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/atmel/at91sam9x5ek/at91sam9x5ek.c
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / board / atmel / at91sam9x5ek / at91sam9x5ek.c
index 17db0fd513b22300538c640d0c969024bbb5d74d..17a2a40b4b3dc398c75e9ebee820f398c40db918 100644 (file)
@@ -1,23 +1,7 @@
 /*
  * Copyright (C) 2012 Atmel Corporation
  *
- * 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>
@@ -31,6 +15,7 @@
 #include <asm/arch/clk.h>
 #include <lcd.h>
 #include <atmel_hlcdc.h>
+#include <atmel_mci.h>
 #ifdef CONFIG_MACB
 #include <net.h>
 #endif
@@ -60,16 +45,22 @@ static void at91sam9x5ek_nand_hw_init(void)
        /* Enable CS3 */
        csa = readl(&matrix->ebicsa);
        csa |= AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA;
+       /* NAND flash on D16 */
+       csa |= AT91_MATRIX_NFD0_ON_D16;
+
+       /* Configure IO drive */
+       csa &= ~AT91_MATRIX_EBI_EBI_IOSR_NORMAL;
+
        writel(csa, &matrix->ebicsa);
 
        /* Configure SMC CS3 for NAND/SmartMedia */
-       writel(AT91_SMC_SETUP_NWE(2) | AT91_SMC_SETUP_NCS_WR(0) |
-               AT91_SMC_SETUP_NRD(2) | AT91_SMC_SETUP_NCS_RD(0),
+       writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
+               AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
                &smc->cs[3].setup);
-       writel(AT91_SMC_PULSE_NWE(4) | AT91_SMC_PULSE_NCS_WR(4) |
-               AT91_SMC_PULSE_NRD(4) | AT91_SMC_PULSE_NCS_RD(4),
+       writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(5) |
+               AT91_SMC_PULSE_NRD(4) | AT91_SMC_PULSE_NCS_RD(6),
                &smc->cs[3].pulse);
-       writel(AT91_SMC_CYCLE_NWE(7) | AT91_SMC_CYCLE_NRD(7),
+       writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(6),
                &smc->cs[3].cycle);
        writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
                AT91_SMC_MODE_EXNW_DISABLE |
@@ -78,7 +69,7 @@ static void at91sam9x5ek_nand_hw_init(void)
 #else /* CONFIG_SYS_NAND_DBW_8 */
                AT91_SMC_MODE_DBW_8 |
 #endif
-               AT91_SMC_MODE_TDF_CYCLE(3),
+               AT91_SMC_MODE_TDF_CYCLE(1),
                &smc->cs[3].mode);
 
        writel(1 << ATMEL_ID_PIOCD, &pmc->pcer);
@@ -252,6 +243,15 @@ void spi_cs_deactivate(struct spi_slave *slave)
 }
 #endif /* CONFIG_ATMEL_SPI */
 
+#ifdef CONFIG_GENERIC_ATMEL_MCI
+int board_mmc_init(bd_t *bd)
+{
+       at91_mci_hw_init();
+
+       return atmel_mci_init((void *)ATMEL_BASE_HSMCI0);
+}
+#endif
+
 int board_early_init_f(void)
 {
        at91_seriald_hw_init();
@@ -271,7 +271,6 @@ int board_init(void)
 #endif
 
 #ifdef CONFIG_ATMEL_SPI
-       at91_spi0_hw_init(1 << 0);
        at91_spi0_hw_init(1 << 4);
 #endif
 
@@ -279,6 +278,9 @@ int board_init(void)
        at91_macb_hw_init();
 #endif
 
+#if defined(CONFIG_USB_OHCI_NEW) || defined(CONFIG_USB_EHCI)
+       at91_uhp_hw_init();
+#endif
 #ifdef CONFIG_LCD
        at91sam9x5ek_lcd_hw_init();
 #endif