[U-Boot] [PATCH 1/2] net/fm: check the old and new Fman microcode locations in NOR flash
Timur Tabi
timur at freescale.com
Wed Dec 14 23:34:05 CET 2011
On some Freescale reference boards for SOCs with Fman devices, the Fman
microcode is located at address 0xEF000000 in NOR flash. Unfortunately,
this address is in the "middle of nowhere" and makes it difficult to
partition flash space for other images.
So we change the expected address to 0xEFF40000, which is the flash
sector adjacent to the environment. To support older boards, we use macro
CONFIG_SYS_QE_FMAN_FW_ADDR_OLD to look for the microcode in the old location
if it cannot be found in the new one.
The code which uploads the microcode checks the new default location, and
if the microcode is not found, then it checks the old location. This allows
newer U-Boots to work on older boards. However, during boot, the error
messages are a bit confusing:
Net: Fman1: Data at eff40000 is not a firmware
Fman1: Uploading microcode version 101.8.0
Fman2: Data at eff40000 is not a firmware
Fman2: Uploading microcode version 101.8.0
Signed-off-by: Timur Tabi <timur at freescale.com>
---
drivers/net/fm/fm.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/net/fm/fm.c b/drivers/net/fm/fm.c
index 0b8c33f..f148608 100644
--- a/drivers/net/fm/fm.c
+++ b/drivers/net/fm/fm.c
@@ -412,6 +412,13 @@ int fm_init_common(int index, struct ccsr_fman *reg)
/* Upload the Fman microcode if it's present */
rc = fman_upload_firmware(index, ®->fm_imem, addr);
+#ifdef CONFIG_SYS_QE_FMAN_FW_ADDR_OLD
+ /* Check the old location in NOR flash */
+ if (rc) {
+ addr = (void *)CONFIG_SYS_QE_FMAN_FW_ADDR_OLD;
+ rc = fman_upload_firmware(index, ®->fm_imem, addr);
+ }
+#endif
if (rc)
return rc;
sprintf(env_addr, "0x%lx", (long unsigned int)addr);
--
1.7.3.4
More information about the U-Boot
mailing list