Skip to contentSkip to conversation

86xx: Report which "bank" of NOR flash we are booting from on MPC8641HPCN

PATCH Superseded Kumar Gala 2 participants 2 messages Jul 21, 2009

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH v2 1/1 86xx: Report which "bank" of NOR flash we are booting from on MPC8641HPCN

The MPC8641HPCN board is capable of swizzling the upper address bit of the NOR flash we boot out of which creates the concept of "virtual" banks. This is useful in that we can flash a test of image of u-boot and reset to one of the virtual banks while still maintaining a working image in "bank 0".

The PIXIS FPGA exposes registers on LBC which we can use to determine which "bank" we are booting out of (as well as setting which bank to boot out of).

---
* Moved from in8 -> in_8
* used PIXIS_VBOOT instead of magic 0x16
* simplified if() test

- k

 board/freescale/mpc8641hpcn/mpc8641hpcn.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)
board/freescale/mpc8641hpcn/mpc8641hpcn.c +14 -4
index 7422e6b..ab7a04c 100644
@@ -42,10 +42,20 @@ int board_early_init_f(void)
 
 int checkboard(void)
 {
-	printf ("Board: MPC8641HPCN, System ID: 0x%02x, "
-		"System Version: 0x%02x, FPGA Version: 0x%02x\n",
-		in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER),
-		in8(PIXIS_BASE + PIXIS_PVER));
+	u8 vboot;
+	u8 *pixis_base = (u8 *)PIXIS_BASE;
+
+	printf ("Board: MPC8641HPCN, Sys ID: 0x%02x, "
+		"Sys Ver: 0x%02x, FPGA Ver: 0x%02x, ",
+		in_8(pixis_base + PIXIS_ID), in_8(pixis_base + PIXIS_VER),
+		in_8(pixis_base + PIXIS_PVER));
+
+	vboot = in_8(pixis_base + PIXIS_VBOOT);
+	if (vboot & 0x80)
+		printf ("vBank: %d\n", ((vboot >> 6) & 0x1));
+	else
+		puts ("Promjet\n");
+
 #ifdef CONFIG_PHYS_64BIT
 	printf ("       36-bit physical address map\n");
 #endif
Signature · 1 line
1.6.0.6
#1 lore raw

PATCH v2 1/1 86xx: Report which "bank" of NOR flash we are booting from on MPC8641HPCN

Dear Kumar Gala,

Quoted 14 lines · In message <[email protected]> you…

The MPC8641HPCN board is capable of swizzling the upper address bit of the NOR flash we boot out of which creates the concept of "virtual" banks. This is useful in that we can flash a test of image of u-boot and reset to one of the virtual banks while still maintaining a working image in "bank 0".

The PIXIS FPGA exposes registers on LBC which we can use to determine which "bank" we are booting out of (as well as setting which bank to boot out of).

---
* Moved from in8 -> in_8
* used PIXIS_VBOOT instead of magic 0x16

...

board/freescale/mpc8641hpcn/mpc8641hpcn.c int board_early_init_f(void) · line 55

Quoted 2 lines
board/freescale/mpc8641hpcn/mpc8641hpcn.c +2 -0
+	if (vboot & 0x80)
+		printf ("vBank: %d\n", ((vboot >> 6) & 0x1));

Any reasons for not using some named constants instead of the magix values 0x80 and 0x40 ?

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"No matter where you go, there you are..."          - Buckaroo Banzai