Message ID | 1433932787-31640-3-git-send-email-prabhakar@freescale.com |
---|---|
State | Superseded |
Headers | show |
On 06/10/2015 03:39 AM, Prabhakar Kushwaha wrote: > From: "J. German Rivera" <German.Rivera@freescale.com> > > 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> Prabhakar, Do we need this feature? It was written for bring-up. AIOP image should be loaded by Linux later for normal use. York
> -----Original Message----- > From: Sun York-R58495 > Sent: Wednesday, June 10, 2015 8:06 PM > To: Kushwaha Prabhakar-B32579; u-boot@lists.denx.de > Cc: Rivera Jose-B46482 > Subject: Re: [PATCH 03/13] drivers/fsl-mc: Autoload AOIP image from NOR > flash > > > > On 06/10/2015 03:39 AM, Prabhakar Kushwaha wrote: > > From: "J. German Rivera" <German.Rivera@freescale.com> > > > > 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> > > Prabhakar, > > Do we need this feature? It was written for bring-up. AIOP image should be > loaded by Linux later for normal use. > I have no visibility when AIOP loader will be available in Linux. I am not seeing any plan of completing in next 1month or so. This is the reason I am having this feature. It is under #ifdef. If required it can be disabled.. --prabhakar
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index d02da9d..2b38b50 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -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); diff --git a/include/configs/ls2085a_common.h b/include/configs/ls2085a_common.h index cf51909..d095151 100644 --- a/include/configs/ls2085a_common.h +++ b/include/configs/ls2085a_common.h @@ -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 diff --git a/include/configs/ls2085aqds.h b/include/configs/ls2085aqds.h index 731eca2..3d9655d 100644 --- a/include/configs/ls2085aqds.h +++ b/include/configs/ls2085aqds.h @@ -261,6 +261,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 diff --git a/include/configs/ls2085ardb.h b/include/configs/ls2085ardb.h index a0f0f6c..9f0a96f 100644 --- a/include/configs/ls2085ardb.h +++ b/include/configs/ls2085ardb.h @@ -234,6 +234,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