drivers/fsl-mc: Autoload AOIP image from NOR flash
authorJ. German Rivera <German.Rivera@freescale.com>
Thu, 2 Jul 2015 05:58:58 +0000 (11:28 +0530)
committerYork Sun <yorksun@freescale.com>
Mon, 20 Jul 2015 18:44:36 +0000 (11:44 -0700)
Load AIOP image from NOR flash into DDR so that the MC firmware
the MC fw can start it at boot time

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
drivers/net/fsl-mc/mc.c
include/configs/ls2085a_common.h
include/configs/ls2085aqds.h
include/configs/ls2085ardb.h

index d02da9d171b60659b9535399ae4bb98fdde48420..2b38b50a9d5b52d6cb6a8bb71088ccb0192c1e17 100644 (file)
@@ -321,6 +321,23 @@ static unsigned long get_mc_boot_timeout_ms(void)
        return timeout_ms;
 }
 
+#ifdef CONFIG_SYS_LS_MC_AIOP_IMG_IN_NOR
+static int load_mc_aiop_img(u64 mc_ram_addr, size_t mc_ram_size)
+{
+       void *aiop_img;
+
+       /*
+        * Load the MC AIOP image in the MC private DRAM block:
+        */
+
+       aiop_img = (void *)CONFIG_SYS_LS_MC_AIOP_IMG_ADDR;
+       mc_copy_image("MC AIOP image",
+                     (u64)aiop_img, CONFIG_SYS_LS_MC_AIOP_IMG_MAX_LENGTH,
+                     mc_ram_addr + CONFIG_SYS_LS_MC_DRAM_AIOP_IMG_OFFSET);
+
+       return 0;
+}
+#endif
 static int wait_for_mc(bool booting_mc, u32 *final_reg_gsr)
 {
        u32 reg_gsr;
@@ -440,6 +457,12 @@ int mc_init(void)
        if (error != 0)
                goto out;
 
+#ifdef CONFIG_SYS_LS_MC_AIOP_IMG_IN_NOR
+       error = load_mc_aiop_img(mc_ram_addr, mc_ram_size);
+       if (error != 0)
+               goto out;
+#endif
+
        debug("mc_ccsr_regs %p\n", mc_ccsr_regs);
        dump_mc_ccsr_regs(mc_ccsr_regs);
 
index 4ee69ffe2b6c24f74bd998607c220117e9676fff..951410df23f4d5ccd2ad22594f6d29a7ed990c19 100644 (file)
@@ -174,6 +174,8 @@ unsigned long long get_qixis_addr(void);
 #define CONFIG_SYS_LS_MC_DRAM_DPC_OFFSET    0x00F00000
 #define CONFIG_SYS_LS_MC_DPL_MAX_LENGTH            0x20000
 #define CONFIG_SYS_LS_MC_DRAM_DPL_OFFSET    0x00F20000
+#define CONFIG_SYS_LS_MC_AIOP_IMG_MAX_LENGTH   0x200000
+#define CONFIG_SYS_LS_MC_DRAM_AIOP_IMG_OFFSET  0x07000000
 
 /*
  * Carve out a DDR region which will not be used by u-boot/Linux
index da730671a0c1fc3b8ffd6ca4d39e8db6a8b2a1a7..dcdd316bc6bfe89533763680642c238b8c07668e 100644 (file)
@@ -260,6 +260,8 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_LS_MC_DPC_ADDR      0x580800000ULL
 
 #define CONFIG_SYS_LS_MC_BOOT_TIMEOUT_MS 5000
+#define CONFIG_SYS_LS_MC_AIOP_IMG_IN_NOR
+#define CONFIG_SYS_LS_MC_AIOP_IMG_ADDR 0x580900000ULL
 
 /*
  * I2C
index ec103935a280b8ac43477bccecb1a67a136a745b..891fabe78e348fae400d6cc6ca9ae6f8ae0fd876 100644 (file)
@@ -233,6 +233,8 @@ unsigned long get_board_sys_clk(void);
 #define CONFIG_SYS_LS_MC_DPC_ADDR      0x580800000ULL
 
 #define CONFIG_SYS_LS_MC_BOOT_TIMEOUT_MS 5000
+#define CONFIG_SYS_LS_MC_AIOP_IMG_IN_NOR
+#define CONFIG_SYS_LS_MC_AIOP_IMG_ADDR 0x580900000ULL
 
 /*
  * I2C