All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] net/fm: check the old and new Fman microcode locations in NOR flash
@ 2011-12-14 22:34 Timur Tabi
  2011-12-14 22:34 ` [U-Boot] [PATCH 2/2] powerpc/85xx: move the Fman microcode from ef000000 to eff40000 Timur Tabi
  2011-12-15 20:03 ` [U-Boot] [PATCH 1/2] net/fm: check the old and new Fman microcode locations in NOR flash Kumar Gala
  0 siblings, 2 replies; 5+ messages in thread
From: Timur Tabi @ 2011-12-14 22:34 UTC (permalink / raw)
  To: u-boot

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@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, &reg->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, &reg->fm_imem, addr);
+	}
+#endif
 	if (rc)
 		return rc;
 	sprintf(env_addr, "0x%lx", (long unsigned int)addr);
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH 2/2] powerpc/85xx: move the Fman microcode from ef000000 to eff40000
  2011-12-14 22:34 [U-Boot] [PATCH 1/2] net/fm: check the old and new Fman microcode locations in NOR flash Timur Tabi
@ 2011-12-14 22:34 ` Timur Tabi
  2011-12-15 20:03 ` [U-Boot] [PATCH 1/2] net/fm: check the old and new Fman microcode locations in NOR flash Kumar Gala
  1 sibling, 0 replies; 5+ messages in thread
From: Timur Tabi @ 2011-12-14 22:34 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Timur Tabi <timur@freescale.com>
---
 include/configs/P1023RDS.h   |    4 +++-
 include/configs/P2041RDB.h   |    4 +++-
 include/configs/corenet_ds.h |    4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/configs/P1023RDS.h b/include/configs/P1023RDS.h
index e057b1f..734dc89 100644
--- a/include/configs/P1023RDS.h
+++ b/include/configs/P1023RDS.h
@@ -527,7 +527,9 @@ extern unsigned long get_clock_freq(void);
 /* Default address of microcode for the Linux Fman driver */
 /* QE microcode/firmware address */
 #define CONFIG_SYS_QE_FMAN_FW_IN_NOR
-#define CONFIG_SYS_QE_FMAN_FW_ADDR	0xEF000000
+#define CONFIG_SYS_QE_FMAN_FW_ADDR	0xEFF40000
+/* We may need to check the old location in NOR flash as well */
+#define CONFIG_SYS_QE_FMAN_FW_ADDR_OLD		0xEF000000
 #else
 #define CONFIG_SYS_QE_FMAN_FW_IN_NAND
 #define CONFIG_SYS_QE_FMAN_FW_ADDR	0x1f00000
diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
index a48055e..e6b70fc 100644
--- a/include/configs/P2041RDB.h
+++ b/include/configs/P2041RDB.h
@@ -429,7 +429,9 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_QE_FMAN_FW_ADDR	(6 * CONFIG_SYS_NAND_BLOCK_SIZE)
 #else
 #define CONFIG_SYS_QE_FMAN_FW_IN_NOR
-#define CONFIG_SYS_QE_FMAN_FW_ADDR	0xEF000000
+#define CONFIG_SYS_QE_FMAN_FW_ADDR	0xEFF40000
+/* We may need to check the old location in NOR flash as well */
+#define CONFIG_SYS_QE_FMAN_FW_ADDR_OLD		0xEF000000
 #endif
 #define CONFIG_SYS_QE_FMAN_FW_LENGTH	0x10000
 #define CONFIG_SYS_FDT_PAD		(0x3000 + CONFIG_SYS_QE_FMAN_FW_LENGTH)
diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h
index 7925b95..9d1aea7 100644
--- a/include/configs/corenet_ds.h
+++ b/include/configs/corenet_ds.h
@@ -493,7 +493,9 @@
 #define CONFIG_SYS_QE_FMAN_FW_ADDR	(6 * CONFIG_SYS_NAND_BLOCK_SIZE)
 #else
 #define CONFIG_SYS_QE_FMAN_FW_IN_NOR
-#define CONFIG_SYS_QE_FMAN_FW_ADDR		0xEF000000
+#define CONFIG_SYS_QE_FMAN_FW_ADDR		0xEFF40000
+/* We may need to check the old location in NOR flash as well */
+#define CONFIG_SYS_QE_FMAN_FW_ADDR_OLD		0xEF000000
 #endif
 #define CONFIG_SYS_QE_FMAN_FW_LENGTH	0x10000
 #define CONFIG_SYS_FDT_PAD		(0x3000 + CONFIG_SYS_QE_FMAN_FW_LENGTH)
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH 1/2] net/fm: check the old and new Fman microcode locations in NOR flash
  2011-12-14 22:34 [U-Boot] [PATCH 1/2] net/fm: check the old and new Fman microcode locations in NOR flash Timur Tabi
  2011-12-14 22:34 ` [U-Boot] [PATCH 2/2] powerpc/85xx: move the Fman microcode from ef000000 to eff40000 Timur Tabi
@ 2011-12-15 20:03 ` Kumar Gala
  2011-12-15 20:09   ` Timur Tabi
  1 sibling, 1 reply; 5+ messages in thread
From: Kumar Gala @ 2011-12-15 20:03 UTC (permalink / raw)
  To: u-boot


On Dec 14, 2011, at 4:34 PM, Timur Tabi wrote:

> 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@freescale.com>
> ---
> drivers/net/fm/fm.c |    7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)

I see no reason for this patch, if you're flashing a new u-boot flash the microcode to the new address as well.  Don't we already have a warning if we don't find the ucode at the expected address.

- k

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH 1/2] net/fm: check the old and new Fman microcode locations in NOR flash
  2011-12-15 20:03 ` [U-Boot] [PATCH 1/2] net/fm: check the old and new Fman microcode locations in NOR flash Kumar Gala
@ 2011-12-15 20:09   ` Timur Tabi
  2011-12-15 20:15     ` Kumar Gala
  0 siblings, 1 reply; 5+ messages in thread
From: Timur Tabi @ 2011-12-15 20:09 UTC (permalink / raw)
  To: u-boot

Kumar Gala wrote:

> I see no reason for this patch, if you're flashing a new u-boot flash
> the microcode to the new address as well.  

This is useful for people who have not moved the microcode.  Are we going to ensure that everyone who updates U-Boot will also move their microcode to the new location?  We can always revert this patch after everyone has migrated, if that's really necessary.

You know as well as I do that if don't provide backwards compatibility, someone is going to break and won't know why.

> Don't we already have a
> warning if we don't find the ucode at the expected address.

No.  The warning just says that microcode is invalid, not that that it's at the wrong address.  

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH 1/2] net/fm: check the old and new Fman microcode locations in NOR flash
  2011-12-15 20:09   ` Timur Tabi
@ 2011-12-15 20:15     ` Kumar Gala
  0 siblings, 0 replies; 5+ messages in thread
From: Kumar Gala @ 2011-12-15 20:15 UTC (permalink / raw)
  To: u-boot


On Dec 15, 2011, at 2:09 PM, Timur Tabi wrote:

> Kumar Gala wrote:
> 
>> I see no reason for this patch, if you're flashing a new u-boot flash
>> the microcode to the new address as well.  
> 
> This is useful for people who have not moved the microcode.  Are we going to ensure that everyone who updates U-Boot will also move their microcode to the new location?  We can always revert this patch after everyone has migrated, if that's really necessary.
> 
> You know as well as I do that if don't provide backwards compatibility, someone is going to break and won't know why.

Sure, but they'll get the message about invalid ucode.  It will be easy to debug.  At some point they're going to have to flash ucode to the new address.  I see no reason to delay that.

>> Don't we already have a
>> warning if we don't find the ucode at the expected address.
> 
> No.  The warning just says that microcode is invalid, not that that it's at the wrong address.  

Invalid is sufficient to say you need to check the ucode at the address its being attempted to be loaded from.

- k

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-15 20:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-14 22:34 [U-Boot] [PATCH 1/2] net/fm: check the old and new Fman microcode locations in NOR flash Timur Tabi
2011-12-14 22:34 ` [U-Boot] [PATCH 2/2] powerpc/85xx: move the Fman microcode from ef000000 to eff40000 Timur Tabi
2011-12-15 20:03 ` [U-Boot] [PATCH 1/2] net/fm: check the old and new Fman microcode locations in NOR flash Kumar Gala
2011-12-15 20:09   ` Timur Tabi
2011-12-15 20:15     ` Kumar Gala

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.