]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/atmel/at91sam9263ek/at91sam9263ek.c
flash: complete CONFIG_SYS_NO_FLASH move with renaming
[people/ms/u-boot.git] / board / atmel / at91sam9263ek / at91sam9263ek.c
index 7784cd7f0ac4e9d8a7c3db5a0f5e88e90f676d7e..e4e32f60aef89e2a990af408b470835c8d5ceefe 100644 (file)
@@ -11,7 +11,6 @@
 #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_matrix.h>
 #include <asm/arch/at91_pio.h>
 #include <asm/arch/clk.h>
@@ -24,6 +23,7 @@
 #include <net.h>
 #endif
 #include <netdev.h>
+#include <atmel_mci.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -38,7 +38,6 @@ static void at91sam9263ek_nand_hw_init(void)
        unsigned long csa;
        at91_smc_t    *smc    = (at91_smc_t *) ATMEL_BASE_SMC0;
        at91_matrix_t *matrix = (at91_matrix_t *) ATMEL_BASE_MATRIX;
-       at91_pmc_t    *pmc    = (at91_pmc_t *) ATMEL_BASE_PMC;
 
        /* Enable CS3 */
        csa = readl(&matrix->csa[0]) | AT91_MATRIX_CSA_EBI_CS3A;
@@ -67,8 +66,8 @@ static void at91sam9263ek_nand_hw_init(void)
                       AT91_SMC_MODE_TDF_CYCLE(2),
                &smc->cs[3].mode);
 
-       writel(1 << ATMEL_ID_PIOA | 1 << ATMEL_ID_PIOCDE,
-               &pmc->pcer);
+       at91_periph_clk_enable(ATMEL_ID_PIOA);
+       at91_periph_clk_enable(ATMEL_ID_PIOCDE);
 
        /* Configure RDY/BSY */
        at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
@@ -81,11 +80,9 @@ static void at91sam9263ek_nand_hw_init(void)
 #ifdef CONFIG_MACB
 static void at91sam9263ek_macb_hw_init(void)
 {
-       at91_pmc_t      *pmc    = (at91_pmc_t *) ATMEL_BASE_PMC;
        at91_pio_t      *pio    = (at91_pio_t *) ATMEL_BASE_PIO;
 
-       /* Enable clock */
-       writel(1 << ATMEL_ID_EMAC, &pmc->pcer);
+       at91_periph_clk_enable(ATMEL_ID_EMAC);
 
        /*
         * Disable pull-up on:
@@ -110,20 +107,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)
@@ -138,8 +135,6 @@ void lcd_disable(void)
 
 static void at91sam9263ek_lcd_hw_init(void)
 {
-       at91_pmc_t      *pmc    = (at91_pmc_t *) ATMEL_BASE_PMC;
-
        at91_set_a_periph(AT91_PIO_PORTC, 1, 0);        /* LCDHSYNC */
        at91_set_a_periph(AT91_PIO_PORTC, 2, 0);        /* LCDDOTCK */
        at91_set_a_periph(AT91_PIO_PORTC, 3, 0);        /* LCDDEN */
@@ -163,7 +158,7 @@ static void at91sam9263ek_lcd_hw_init(void)
        at91_set_a_periph(AT91_PIO_PORTC, 26, 0);       /* LCDD22 */
        at91_set_a_periph(AT91_PIO_PORTC, 27, 0);       /* LCDD23 */
 
-       writel(1 << ATMEL_ID_LCDC, &pmc->pcer);
+       at91_periph_clk_enable(ATMEL_ID_LCDC);
        gd->fb_base = ATMEL_BASE_SRAM0;
 }
 
@@ -171,14 +166,14 @@ static void at91sam9263ek_lcd_hw_init(void)
 #include <nand.h>
 #include <version.h>
 
-#ifndef CONFIG_SYS_NO_FLASH
+#ifdef CONFIG_MTD_NOR_FLASH
 extern flash_info_t flash_info[];
 #endif
 
 void lcd_show_board_info(void)
 {
        ulong dram_size, nand_size;
-#ifndef CONFIG_SYS_NO_FLASH
+#ifdef CONFIG_MTD_NOR_FLASH
        ulong flash_size;
 #endif
        int i;
@@ -196,8 +191,8 @@ void lcd_show_board_info(void)
                dram_size += gd->bd->bi_dram[i].size;
        nand_size = 0;
        for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
-               nand_size += nand_info[i].size;
-#ifndef CONFIG_SYS_NO_FLASH
+               nand_size += nand_info[i]->size;
+#ifdef CONFIG_MTD_NOR_FLASH
        flash_size = 0;
        for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++)
                flash_size += flash_info[i].size;
@@ -205,7 +200,7 @@ void lcd_show_board_info(void)
        lcd_printf ("  %ld MB SDRAM, %ld MB NAND",
                dram_size >> 20,
                nand_size >> 20 );
-#ifndef CONFIG_SYS_NO_FLASH
+#ifdef CONFIG_MTD_NOR_FLASH
        lcd_printf (",\n  %ld MB NOR",
                flash_size >> 20);
 #endif
@@ -214,14 +209,20 @@ void lcd_show_board_info(void)
 #endif /* CONFIG_LCD_INFO */
 #endif
 
-int board_early_init_f(void)
+#ifdef CONFIG_GENERIC_ATMEL_MCI
+int board_mmc_init(bd_t *bd)
 {
-       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+       at91_mci_hw_init();
 
-       /* Enable clocks for all PIOs */
-       writel((1 << ATMEL_ID_PIOA) | (1 << ATMEL_ID_PIOB) |
-               (1 << ATMEL_ID_PIOCDE),
-               &pmc->pcer);
+       return atmel_mci_init((void *)ATMEL_BASE_MCI1);
+}
+#endif
+
+int board_early_init_f(void)
+{
+       at91_periph_clk_enable(ATMEL_ID_PIOA);
+       at91_periph_clk_enable(ATMEL_ID_PIOB);
+       at91_periph_clk_enable(ATMEL_ID_PIOCDE);
 
        at91_seriald_hw_init();
        return 0;