]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/atmel/sama5d3xek/sama5d3xek.c
flash: complete CONFIG_SYS_NO_FLASH move with renaming
[people/ms/u-boot.git] / board / atmel / sama5d3xek / sama5d3xek.c
index 0d824fc0ba16e3c62c79d0a564083df4a3999917..ce67478f0be84c99aa63c7f2c45a5e6434077d1c 100644 (file)
@@ -10,7 +10,6 @@
 #include <asm/io.h>
 #include <asm/arch/sama5d3_smc.h>
 #include <asm/arch/at91_common.h>
-#include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_rstc.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/clk.h>
@@ -69,7 +68,7 @@ void sama5d3xek_nand_hw_init(void)
 }
 #endif
 
-#ifndef CONFIG_SYS_NO_FLASH
+#ifdef CONFIG_MTD_NOR_FLASH
 static void sama5d3xek_nor_hw_init(void)
 {
        struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
@@ -208,7 +207,7 @@ void lcd_show_board_info(void)
        nand_size = 0;
 #ifdef CONFIG_NAND_ATMEL
        for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
-               nand_size += nand_info[i].size;
+               nand_size += nand_info[i]->size;
 #endif
        lcd_printf("%ld MB SDRAM, %lld MB NAND\n",
                   dram_size >> 20, nand_size >> 20);
@@ -237,7 +236,7 @@ int board_init(void)
 #ifdef CONFIG_NAND_ATMEL
        sama5d3xek_nand_hw_init();
 #endif
-#ifndef CONFIG_SYS_NO_FLASH
+#ifdef CONFIG_MTD_NOR_FLASH
        sama5d3xek_nor_hw_init();
 #endif
 #ifdef CONFIG_CMD_USB
@@ -443,14 +442,13 @@ static void ddr2_conf(struct atmel_mpddrc_config *ddr2)
 
 void mem_init(void)
 {
-       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
        struct atmel_mpddrc_config ddr2;
 
        ddr2_conf(&ddr2);
 
-       /* enable MPDDR clock */
+       /* Enable MPDDR clock */
        at91_periph_clk_enable(ATMEL_ID_MPDDRC);
-       writel(AT91_PMC_DDR, &pmc->scer);
+       at91_system_clk_enable(AT91_PMC_DDR);
 
        /* DDRAM2 Controller initialize */
        ddr2_init(ATMEL_BASE_MPDDRC, ATMEL_BASE_DDRCS, &ddr2);
@@ -458,7 +456,6 @@ void mem_init(void)
 
 void at91_pmc_init(void)
 {
-       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
        u32 tmp;
 
        tmp = AT91_PMC_PLLAR_29 |
@@ -467,7 +464,7 @@ void at91_pmc_init(void)
              AT91_PMC_PLLXR_DIV(1);
        at91_plla_init(tmp);
 
-       writel(0x3 << 8, &pmc->pllicpr);
+       at91_pllicpr_init(AT91_PMC_IPLL_PLLA(0x3));
 
        tmp = AT91_PMC_MCKR_MDIV_4 |
              AT91_PMC_MCKR_CSS_PLLA;