86xx: Report which "bank" of NOR flash we are booting from on MPC8641HPCN
authorKumar Gala <galak@kernel.crashing.org>
Wed, 15 Jul 2009 18:45:00 +0000 (13:45 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Wed, 22 Jul 2009 14:08:50 +0000 (09:08 -0500)
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).

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
board/freescale/mpc8641hpcn/mpc8641hpcn.c
include/configs/MPC8641HPCN.h

index 7422e6b..441127b 100644 (file)
@@ -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 & PIXIS_VBOOT_FMAP)
+               printf ("vBank: %d\n", ((vboot & PIXIS_VBOOT_FBANK) >> 6));
+       else
+               puts ("Promjet\n");
+
 #ifdef CONFIG_PHYS_64BIT
        printf ("       36-bit physical address map\n");
 #endif
index 955ac3d..bf2e359 100644 (file)
@@ -224,6 +224,8 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define PIXIS_VCFGEN0          0x12    /* VELA Config Enable 0 */
 #define PIXIS_VCFGEN1          0x13    /* VELA Config Enable 1 */
 #define PIXIS_VBOOT            0x16    /* VELA VBOOT Register */
+#define PIXIS_VBOOT_FMAP       0x80    /* VBOOT - CFG_FLASHMAP */
+#define PIXIS_VBOOT_FBANK      0x40    /* VBOOT - CFG_FLASHBANK */
 #define PIXIS_VSPEED0          0x17    /* VELA VSpeed 0 */
 #define PIXIS_VSPEED1          0x18    /* VELA VSpeed 1 */
 #define PIXIS_VCLKH            0x19    /* VELA VCLKH register */