]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/atmel/at91sam9263ek/at91sam9263ek.c
Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / board / atmel / at91sam9263ek / at91sam9263ek.c
index 60ff1c0cd3988543a46b3e010efee0ac44dcb1cc..927adb0d3808e8db45edf515ffd114e600a6913d 100644 (file)
@@ -3,32 +3,15 @@
  * Stelian Pop <stelian@popies.net>
  * Lead Tech Design <www.leadtechdesign.com>
  *
- * 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>
-#include <asm/sizes.h>
+#include <linux/sizes.h>
 #include <asm/arch/at91sam9263.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91_rstc.h>
 #include <asm/arch/at91_matrix.h>
 #include <asm/arch/at91_pio.h>
 #include <asm/arch/clk.h>
@@ -41,6 +24,7 @@
 #include <net.h>
 #endif
 #include <netdev.h>
+#include <atmel_mci.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -98,10 +82,9 @@ static void at91sam9263ek_nand_hw_init(void)
 #ifdef CONFIG_MACB
 static void at91sam9263ek_macb_hw_init(void)
 {
-       unsigned long   erstl;
        at91_pmc_t      *pmc    = (at91_pmc_t *) ATMEL_BASE_PMC;
        at91_pio_t      *pio    = (at91_pio_t *) ATMEL_BASE_PIO;
-       at91_rstc_t     *rstc   = (at91_rstc_t *) ATMEL_BASE_RSTC;
+
        /* Enable clock */
        writel(1 << ATMEL_ID_EMAC, &pmc->pcer);
 
@@ -113,23 +96,10 @@ static void at91sam9263ek_macb_hw_init(void)
         *
         * PHY has internal pull-down
         */
-
        writel(1 << 25, &pio->pioc.pudr);
        writel((1 << 25) | (1 <<26), &pio->pioe.pudr);
 
-       erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
-
-       /* Need to reset PHY -> 500ms reset */
-       writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(0x0D) |
-               AT91_RSTC_MR_URSTEN, &rstc->mr);
-
-       writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
-       /* Wait for end hardware reset */
-       while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
-               ;
-
-       /* Restore NRST value */
-       writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN, &rstc->mr);
+       at91_phy_reset();
 
        /* Re-enable pull-up */
        writel(1 << 25, &pio->pioc.puer);
@@ -141,20 +111,20 @@ static void at91sam9263ek_macb_hw_init(void)
 
 #ifdef CONFIG_LCD
 vidinfo_t panel_info = {
-       vl_col:         240,
-       vl_row:         320,
-       vl_clk:         4965000,
-       vl_sync:        ATMEL_LCDC_INVLINE_INVERTED |
-                       ATMEL_LCDC_INVFRAME_INVERTED,
-       vl_bpix:        3,
-       vl_tft:         1,
-       vl_hsync_len:   5,
-       vl_left_margin: 1,
-       vl_right_margin:33,
-       vl_vsync_len:   1,
-       vl_upper_margin:1,
-       vl_lower_margin:0,
-       mmio:           ATMEL_BASE_LCDC,
+       .vl_col =               240,
+       .vl_row =               320,
+       .vl_clk =               4965000,
+       .vl_sync =              ATMEL_LCDC_INVLINE_INVERTED |
+                               ATMEL_LCDC_INVFRAME_INVERTED,
+       .vl_bpix =              3,
+       .vl_tft =               1,
+       .vl_hsync_len =         5,
+       .vl_left_margin =       1,
+       .vl_right_margin =      33,
+       .vl_vsync_len =         1,
+       .vl_upper_margin =      1,
+       .vl_lower_margin =      0,
+       .mmio =                 ATMEL_BASE_LCDC,
 };
 
 void lcd_enable(void)
@@ -245,6 +215,15 @@ void lcd_show_board_info(void)
 #endif /* CONFIG_LCD_INFO */
 #endif
 
+#ifdef CONFIG_GENERIC_ATMEL_MCI
+int board_mmc_init(bd_t *bd)
+{
+       at91_mci_hw_init();
+
+       return atmel_mci_init((void *)ATMEL_BASE_MCI1);
+}
+#endif
+
 int board_early_init_f(void)
 {
        struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
@@ -260,9 +239,6 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
-       /* Enable Ctrlc */
-       console_init_f();
-
        /* arch number of AT91SAM9263EK-Board */
        gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9263EK;
        /* adress of boot parameters */