p2020ds: add alternate boot bank support using the ngPIXIS FPGA
PATCH 1/1 p2020ds: add alternate boot bank support using the ngPIXIS FPGA
The Freescale P2020DS board uses a new type of PIXIS FPGA, called the ngPIXIS. The ngPIXIS has one distinct new feature: the values of the on-board switches can be selectively overridden with shadow registers. This feature is used to boot from a different NOR flash bank, instead of having a register dedicated for this purpose. Because the ngPIXIS is so different from the previous PIXIS, a new file is introduced: ngpixis.c.
Also update the P2020DS checkboard() function to use the new macros defined in the header file.
--- board/freescale/common/Makefile | 1 + board/freescale/common/ngpixis.c | 136 +++++++++++++++++++++++++++++++++++++ board/freescale/p2020ds/p2020ds.c | 19 ++--- include/configs/P2020DS.h | 52 +++----------- 4 files changed, 155 insertions(+), 53 deletions(-) create mode 100644 board/freescale/common/ngpixis.c
board/freescale/common/Makefile +1 -0
@@ -33,6 +33,7 @@ COBJS-${CONFIG_FSL_CADMUS} += cadmus.o COBJS-${CONFIG_FSL_VIA} += cds_via.o COBJS-${CONFIG_FSL_DIU_FB} += fsl_diu_fb.o fsl_logo_bmp.o COBJS-${CONFIG_FSL_PIXIS} += pixis.o +COBJS-${CONFIG_FSL_NGPIXIS} += ngpixis.o COBJS-${CONFIG_PQ_MDS_PIB} += pq-mds-pib.o COBJS-${CONFIG_ID_EEPROM} += sys_eeprom.o COBJS-${CONFIG_FSL_SGMII_RISER} += sgmii_riser.o
board/freescale/common/ngpixis.c new file +136 -0
136 lines not on this page · raw message
board/freescale/p2020ds/p2020ds.c +8 -11
@@ -59,17 +59,14 @@ int checkboard(void)in_8 (pixis_base +PIXIS_ID ),in_8 (pixis_base +PIXIS_VER ), in_8(pixis_base + PIXIS_PVER)); - sw7 =in_8 (pixis_base +PIXIS_SW (7 )); -switch ((sw7 &PIXIS_SW7_LBMAP ) >>6 ) { -case 0 : -case 1 : -printf ("vBank: %d\n" , ((sw7 &PIXIS_SW7_VBANK ) >>4 )); -break ; -case 2 : -case 3 : -puts ("Promjet\n" ); -break ; - } + sw7 =in_8 (pixis_base +PIXIS_SW (PIXIS_LBMAP_SWITCH )); + sw7 = (sw7 &PIXIS_LBMAP_MASK ) >>PIXIS_LBMAP_SHIFT ; + +if (sw7 <0x8 ) +/* The lower two bits are the actual vbank number */ +printf ("vBank: %d\n" , sw7 &3 ); +else +puts ("Promjet\n" );return 0 ; }
include/configs/P2020DS.h +10 -42
72 lines not on this page · raw message
Signature · 1 line
1.6.5
PATCH 1/1 p2020ds: add alternate boot bank support using the ngPIXIS FPGA
Dear Timur Tabi,
Quoted 6 lines · In message <[email protected]> you wrote:
The Freescale P2020DS board uses a new type of PIXIS FPGA, called the ngPIXIS. The ngPIXIS has one distinct new feature: the values of the on-board switches can be selectively overridden with shadow registers. This feature is used to boot from a different NOR flash bank, instead of having a register dedicated for this purpose. Because the ngPIXIS is so different from the previous PIXIS, a new file is introduced:
ngpixis.c.
...
board/freescale/common/ngpixis.c line 7
Quoted 10 lines
board/freescale/common/ngpixis.c new file +7
-0@@ -0,0 +1,136 @@ +/** +* Copyright 2010 Freescale Semiconductor +* Author: Timur Tabi <[email protected]> +* +* This file is licensed under the terms of the GNU General Public License +* version 2. This program is licensed "as is" without any warranty of any +* kind, whether express or implied.
Please make this "either version 2 of the License, or (at your option) any later version'.
board/freescale/common/ngpixis.c line 20
Quoted 1 line
board/freescale/common/ngpixis.c new file +1
-0+* PIXIS_BASE - The virtual address of the base of the PIXIS register map
Please use a C struct to desctibe the register map.
board/freescale/common/ngpixis.c line 55
Quoted 12 lines
board/freescale/common/ngpixis.c new file +12
-0+void pixis_reset (void ) +{ +out8 (PIXIS_BASE +PIXIS_RST ,0 ); +} + +/* +* Reset the board. Like pixis_reset(), but it honors the ENx registers. +*/ +void pixis_bank_reset (void ) +{ +out8 (PIXIS_BASE +PIXIS_VCTL ,0 ); +out8 (PIXIS_BASE +PIXIS_VCTL ,1 );
NAK. We don't accept base + offset. Please use a C struct. Please fix globally.
board/freescale/common/ngpixis.c line 66
Quoted 4 lines
board/freescale/common/ngpixis.c new file +4
-0+/* Tell the ngPIXIS to use this the bits in the physical switch for the +* boot bank value, instead of the SWx register. We need to be careful +* only to set the bits in SWx that correspond to the boot bank. +*/
Incorrect multiline comment style. Please fix globally.
board/freescale/common/ngpixis.c line 101
Quoted 6 lines
board/freescale/common/ngpixis.c new file +6
-0+/* +* No args is a simple reset request. +*/ +if (argc <=1 ) +pixis_reset (); +/* not reached */
Braces needed here.
board/freescale/common/ngpixis.c line 135
Quoted 5 lines
board/freescale/common/ngpixis.c new file +5
-0+U_BOOT_CMD ( + pixis_reset,CONFIG_SYS_MAXARGS ,1 , pixis_reset_cmd, +"Reset the board using the FPGA sequencer" , +" pixis_reset\n" + " pixis_reset [altbank]\n"
Please check the message format. I think there is one too many newline here.
board/freescale/common/ngpixis.c
Quoted 2 lines
board/freescale/common/ngpixis.c new file +1
-1-#define CONFIG_FSL_PIXIS 1/* use common PIXIS code */ +#define CONFIG_FSL_NGPIXIS /* use common ngPIXIS code */
Please use TABs for vertical alignment. Please fix globally.
Best regards,
Wolfgang Denk
Signature · 6 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 "Though a program be but three lines long, someday it will have to be maintained." - The Tao of Programming
PATCH 1/1 p2020ds: add alternate boot bank support using the ngPIXIS FPGA
Quoted 6 lines · Wolfgang Denk
Quoted 3 lines
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. ?This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.Please make this "either version 2 of the License, or (at your option) any later version'.
I'd rather not, actually. I don't like the "at your option any later version" clause, and I intentionally don't include it in any new code.
This is Freescale's (unofficial) policy.
Quoted 3 lines
Quoted 1 line
+ *
PIXIS_BASE- The virtual address of the base of the PIXIS register mapPlease use a C struct to desctibe the register map.
The PIXIS is not something that fits into a register map cleanly. It's been mostly stable over time, but the hardware team reserves the right to change any and all registers whenever they want. The current PIXIS code uses hard-coded offsets, and you've been accepting that. I don't see why the ngPIXIS should be different.
Quoted 2 lines
NAK. We don't accept base + offset. Please use a C struct. Please fix globally.
Sure you do. Just look at all the existing PIXIS code in board/freescale/.
Quoted 6 lines
Quoted 4 lines
+ ? ? /* Tell the ngPIXIS to use this the bits in the physical switch for the
+ ? ? ?* boot bank value, instead of the SWx register. ?We need to be careful
+ ? ? ?* only to set the bits in SWx that correspond to the boot bank.
+ ? ? ?*/Incorrect multiline comment style. Please fix globally.
What's wrong with it? It matches the Kernel multi-line comment style.
Quoted 8 lines
Quoted 6 lines
+ ? ? /*
+ ? ? ?* No args is a simple reset request.
+ ? ? ?*/
+ ? ? if (argc <= 1)
+ ? ? ? ? ? ?pixis_reset();
+ ? ? ? ? ? ? /* not reached */Braces needed here.
Really? I'm conforming the kernel guideline here as well.
Quoted 8 lines
Quoted 5 lines
+U_BOOT_CMD(
+ ? ?pixis_reset,CONFIG_SYS_MAXARGS, 1,pixis_reset_cmd,
+ ? ? "Reset the board using the FPGA sequencer",
+ ? ? " ? ?pixis_reset\n"
+ ? ? " ? ?pixis_reset [altbank]\n"Please check the message format. I think there is one too many newline here.
I used the exact same message format of the original PIXIS code.
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +1
-1-#define CONFIG_FSL_PIXIS ? ? 1 ? ? ? /* use common PIXIS code */ +#define CONFIG_FSL_NGPIXIS ? ? ? ? ? ? /* use common ngPIXIS code */Please use TABs for vertical alignment. Please fix globally.
Ok.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 p2020ds: add alternate boot bank support using the ngPIXIS FPGA
Dear Timur Tabi,
Quoted 7 lines · In message <[email protected]> you…
Quoted 3 lines
Please make this "either version 2 of the License, or (at your option) any later version'.
I'd rather not, actually. I don't like the "at your option any later version" clause, and I intentionally don't include it in any new code.
This is Freescale's (unofficial) policy.
You want that code go into mainline?
It is U-Boot's (official) policy not to accept such code. See the "Note:" at http://www.denx.de/wiki/U-Boot/Patches
Best regards,
Wolfgang Denk
Signature · 6 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
Good manners are the settled medium of social, as specie is of
commercial, life; returns are equally expected for both.
- Lord Chesterfield _Letters to his Son_, 25 December 1753