arm, i.mx27: add support for magnesium board from LogicPD
Subsystems (2)
PATCH 2/2 arm, i.mx27: add support for magnesium board from LogicPD
This patch adds support for the magnesium board from LogicPD. This board uses i.MX27 SoC and has 8MB NOR flash, 128MB NAND flash, FEC ethernet controller integrated into i.MX27.
---
against current git://git.denx.de/u-boot-imx.git
MAINTAINERS | 4 + MAKEALL | 1 + Makefile | 3 + board/logicpd/imx27lite/imx27lite.c | 19 +++ include/configs/magnesium.h | 260 +++++++++++++++++++++++++++++++++++ 5 files changed, 287 insertions(+), 0 deletions(-) create mode 100644 include/configs/magnesium.h
MAINTAINERS +4 -0
@@ -724,6 +724,10 @@ Jens Scharsig <[email protected]> eb_cpux9k2 ARM920T (AT91RM9200 SoC) +Heiko Schocher <[email protected]> + + magnesium i.MX27 + Robert Schwebel <[email protected]> csb226 xscale
MAKEALL +1 -0
@@ -565,6 +565,7 @@ LIST_ARM9=" \ edb9315a \ imx27lite \ lpd7a400 \ + magnesium \ mv88f6281gtw_ge \ mx1ads \ mx1fs2 \
Makefile +3 -0
@@ -2966,6 +2966,9 @@ lpd7a400_config \ lpd7a404_config: unconfig @$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x +magnesium_config: unconfig + @$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27 + mv88f6281gtw_ge_config: unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs $(@:_config=) Marvell kirkwood
board/logicpd/imx27lite/imx27lite.c +19 -0
@@ -29,6 +29,10 @@ DECLARE_GLOBAL_DATA_PTR;int board_init (void ) {struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE ; +#if defined(CONFIG_MAGNESIUM ) +struct system_control_regs *sc_regs = + (struct system_control_regs *)IMX_SYSTEM_CTL_BASE ; +#endif gd->bd->bi_arch_number =MACH_TYPE_IMX27LITE ; gd->bd->bi_boot_params =PHYS_SDRAM_1 +0x100 ;
@@ -43,9 +47,20 @@ int board_init (void) ®s->port[PORTC].dr);#endif #ifdef CONFIG_MXC_MMC +#if defined(CONFIG_MAGNESIUM ) +mx27_sd1_init_pins (); +#else mx27_sd2_init_pins ();#endif +#endif +#if defined(CONFIG_MAGNESIUM ) +/* +* set in FMCR NF_FMS Bit(5) to 1 +* (NAND Flash with 2 Kbyte page size) +*/ +writel (readl (&sc_regs->fmcr) | (1 <<5 ), &sc_regs->fmcr); +#endif return 0 ; }
@@ -68,6 +83,10 @@ int dram_init (void)int checkboard (void ) { +#if defined(CONFIG_MAGNESIUM ) +printf ("LogicPD magnesium\n" ); +#else printf ("LogicPD imx27lite\n" ); +#endif return 0 ; }
include/configs/magnesium.h new file +260 -0
260 lines not on this page · raw message
Signature · 5 lines
1.6.2.5 -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 2/2 arm, i.mx27: add support for magnesium board from LogicPD
Quoted 4 lines · Heiko Schocher
This patch adds support for the magnesium board from LogicPD. This board uses i.MX27 SoC and has 8MB NOR flash, 128MB NAND flash, FEC ethernet controller integrated into i.MX27.
Heiko,
I have only a little comment.
board/logicpd/imx27lite/imx27lite.c int dram_init (void) · line 87
Quoted 4 lines
int checkboard(void)
{board/logicpd/imx27lite/imx27lite.c +2
-0+#if defined(CONFIG_MAGNESIUM ) +printf ("LogicPD magnesium\n" );
I think we can use puts here instead printf.
board/logicpd/imx27lite/imx27lite.c int dram_init (void) · line 92
Quoted 5 lines
board/logicpd/imx27lite/imx27lite.c +2
-0+#else printf ("LogicPD imx27lite\n" ); +#endif return 0 ; }
It is a pity to add a nasty ifdef only to print out the name of the board. What do you think if we put the board name in the config file with a CONFIG_ option (the same for imx27lite.h, of course), removing the #ifdef ?
Best regards,
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================
PATCH 2/2 arm, i.mx27: add support for magnesium board from LogicPD
In reply to Heiko SchocherDear Heiko Schocher,
Quoted 3 lines · In message <[email protected]> you wrote:
This patch adds support for the magnesium board from LogicPD. This board uses i.MX27 SoC and has 8MB NOR flash, 128MB NAND flash, FEC ethernet controller integrated into i.MX27.
The magnesium board is NOT developed by nor manufactured by LogicPD.
Makefile lpd7a400_config \ · line 2970
Quoted 3 lines
Makefile +2
-0+magnesium_config: unconfig + @$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27
Do we need a separate make target? Can we not add this to the imx27lite target, as you share the code anyway?
board/logicpd/imx27lite/imx27lite.c DECLARE_GLOBAL_DATA_PTR; · line 35
Quoted 12 lines
board/logicpd/imx27lite/imx27lite.c +4
-0@@ -29,6 +29,10 @@ DECLARE_GLOBAL_DATA_PTR;int board_init (void ) {struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE ; +#if defined(CONFIG_MAGNESIUM ) +struct system_control_regs *sc_regs = + (struct system_control_regs *)IMX_SYSTEM_CTL_BASE ; +#endif
See below.
board/logicpd/imx27lite/imx27lite.c int board_init (void) · line 55
Quoted 12 lines
board/logicpd/imx27lite/imx27lite.c +4
-0gd->bd->bi_arch_number =MACH_TYPE_IMX27LITE ; gd->bd->bi_boot_params =PHYS_SDRAM_1 +0x100 ;@@ -43,9 +47,20 @@ int board_init (void) ®s->port[PORTC].dr);#endif #ifdef CONFIG_MXC_MMC +#if defined(CONFIG_MAGNESIUM ) +mx27_sd1_init_pins (); +#else mx27_sd2_init_pins ();#endif +#endif
This is actually note a feature that depends on the board name, right? See below.
board/logicpd/imx27lite/imx27lite.c int board_init (void) · line 63
Quoted 7 lines
board/logicpd/imx27lite/imx27lite.c +7
-0+#if defined(CONFIG_MAGNESIUM ) +/* +* set in FMCR NF_FMS Bit(5) to 1 +* (NAND Flash with 2 Kbyte page size) +*/ +writel (readl (&sc_regs->fmcr) | (1 <<5 ), &sc_regs->fmcr); +#endif
Same here. Other boards that might reuse this code might or might not wan this,too. To avoid long listes of "#if defined(BOARD_THIS) || defined(BOARD_THAT) || defined(BOARD_OTHER) || .." we should introduce a feature specific #define here - if it's really needed.
In this specific case, CONFIG_SYS_NAND_LARGEPAGE might do the job?
board/logicpd/imx27lite/imx27lite.c int dram_init (void) · line 91
Quoted 10 lines
board/logicpd/imx27lite/imx27lite.c +4
-0@@ -68,6 +83,10 @@ int dram_init (void)int checkboard (void ) { +#if defined(CONFIG_MAGNESIUM ) +printf ("LogicPD magnesium\n" ); +#else printf ("LogicPD imx27lite\n" ); +#endif return 0 ;
As Stefano already mentioned: don't add sich an #ifdef here. Define the board name in the board config file instead (and switch to using a puts()).
include/configs/magnesium.h line 4
Quoted 10 lines
include/configs/magnesium.h new file +4
-0@@ -0,0 +1,260 @@ +/* +* Copyright (C) 2010 Heiko Schocher <[email protected]> +* +* based from:
"based on" or "derived from".
Best regards,
Wolfgang Denk
Signature · 5 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
The only person who always got his work done by Friday
was Robinson Crusoe.PATCH v2 2/2 arm, i.mx27: add support for magnesium board from projectiondesign
In reply to Heiko SchocherThis patch adds support for the magnesium board from projectiondesign. This board uses i.MX27 SoC and has 8MB NOR flash, 128MB NAND flash, FEC ethernet controller integrated into i.MX27. As this port is based on the imx27lite port, common config options are collected in include/configs/imx27lite-common.h
---
against current git://git.denx.de/u-boot-imx.git
changes since v1:
- added comment from Stefano Babic
- use puts instead printf in checkboard()
- added comments from Wolfgang Denk
- just one single make target
- use CONFIG_SYS_NAND_LARGEPAGE for setting
FMCR NF_FMS Bit, and not the board name.
- spelling check
- collected common config options in
include/configs/imx27lite-common.h
- added CONFIG_DISPLAY_BOARDINFO
- deleted CONFIG_BOOTFILE, because
bootfile is also defined in
CONFIG_EXTRA_ENV_SETTINGS
MAINTAINERS | 4 + MAKEALL | 1 + Makefile | 1 + board/logicpd/imx27lite/imx27lite.c | 18 +++- include/configs/imx27lite-common.h | 237 +++++++++++++++++++++++++++++++++++ include/configs/imx27lite.h | 200 +----------------------------- include/configs/magnesium.h | 71 +++++++++++ 7 files changed, 335 insertions(+), 197 deletions(-) create mode 100644 include/configs/imx27lite-common.h create mode 100644 include/configs/magnesium.h
MAINTAINERS +4 -0
@@ -724,6 +724,10 @@ Jens Scharsig <[email protected]> eb_cpux9k2 ARM920T (AT91RM9200 SoC) +Heiko Schocher <[email protected]> + + magnesium i.MX27 + Robert Schwebel <[email protected]> csb226 xscale
MAKEALL +1 -0
@@ -565,6 +565,7 @@ LIST_ARM9=" \ edb9315a \ imx27lite \ lpd7a400 \ + magnesium \ mv88f6281gtw_ge \ mx1ads \ mx1fs2 \
Makefile +1 -0
@@ -2959,6 +2959,7 @@ davinci_dm365evm_config : unconfig davinci_dm6467evm_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs dm6467evm davinci davinci +magnesium_config \ imx27lite_config: unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27
board/logicpd/imx27lite/imx27lite.c +17 -1
@@ -29,6 +29,10 @@ DECLARE_GLOBAL_DATA_PTR;int board_init (void ) {struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE ; +#if defined(CONFIG_SYS_NAND_LARGEPAGE ) +struct system_control_regs *sc_regs = + (struct system_control_regs *)IMX_SYSTEM_CTL_BASE ; +#endif gd->bd->bi_arch_number =MACH_TYPE_IMX27LITE ; gd->bd->bi_boot_params =PHYS_SDRAM_1 +0x100 ;
@@ -43,9 +47,20 @@ int board_init (void) ®s->port[PORTC].dr);#endif #ifdef CONFIG_MXC_MMC +#if defined(CONFIG_MAGNESIUM ) +mx27_sd1_init_pins (); +#else mx27_sd2_init_pins ();#endif +#endif +#if defined(CONFIG_SYS_NAND_LARGEPAGE ) +/* +* set in FMCR NF_FMS Bit(5) to 1 +* (NAND Flash with 2 Kbyte page size) +*/ +writel (readl (&sc_regs->fmcr) | (1 <<5 ), &sc_regs->fmcr); +#endif return 0 ; }
@@ -68,6 +83,7 @@ int dram_init (void)int checkboard (void ) { -printf ("LogicPD imx27lite\n" ); +puts ("Board: " ); +puts (CONFIG_BOARDNAME );return 0 ; }
include/configs/imx27lite-common.h new file +237 -0
237 lines not on this page · raw message
include/configs/imx27lite.h +4 -196
231 lines not on this page · raw message
include/configs/magnesium.h new file +71 -0
71 lines not on this page · raw message
Signature · 4 lines
1.6.2.5 -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH v2 2/2 arm, i.mx27: add support for magnesium board from projectiondesign
Quoted 28 lines · Heiko Schocher
This patch adds support for the magnesium board from projectiondesign. This board uses i.MX27 SoC and has 8MB NOR flash, 128MB NAND flash, FEC ethernet controller integrated into i.MX27. As this port is based on the imx27lite port, common config options are collected in
include/configs/imx27lite-common.hSigned-off-by Heiko Schocher <[email protected]>---
against current
git://git.denx.de/u-boot-imx.gitchanges since v1:
- added comment from Stefano Babic
- use puts instead printf incheckboard()
- added comments from Wolfgang Denk
- just one single make target
- useCONFIG_SYS_NAND_LARGEPAGEfor setting FMCRNF_FMSBit, and not the board name.
- spelling check
- collected common config options ininclude/configs/imx27lite-common.h
- addedCONFIG_DISPLAY_BOARDINFO
- deletedCONFIG_BOOTFILE, because
bootfile is also defined inCONFIG_EXTRA_ENV_SETTINGS
Quoted 11 lines
MAINTAINERS | 4 + MAKEALL | 1 + Makefile | 1 + board/logicpd/imx27lite/imx27lite.c | 18 +++- include/configs/imx27lite-common.h | 237 +++++++++++++++++++++++++++++++++++ include/configs/imx27lite.h | 200 +----------------------------- include/configs/magnesium.h | 71 +++++++++++ 7 files changed, 335 insertions(+), 197 deletions(-) create mode 100644 include/configs/imx27lite-common.h create mode 100644 include/configs/magnesium.h
Applied to u-boot-imx, thanks.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================