[U-Boot] [PATCH v2 3/3] MX31: Add NAND SPL boot support to i.MX31 PDK board.
Magnus Lilja
lilja.magnus at gmail.com
Sun May 10 21:33:32 CEST 2009
2009/5/9 Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>:
> On 21:56 Sun 03 May , Magnus Lilja wrote:
>> Signed-off-by: Magnus Lilja <lilja.magnus at gmail.com>
>> ---
>> MAKEALL | 3 +-
>> Makefile | 9 ++-
>> board/freescale/mx31pdk/config.mk | 4 +
>> board/freescale/mx31pdk/lowlevel_init.S | 93 +++++++++++++++++++++++++++
>> board/freescale/mx31pdk/u-boot-nand.lds | 33 ++++++++++
>> include/configs/mx31pdk.h | 19 +++++-
>> nand_spl/board/freescale/mx31pdk/Makefile | 54 +++++++++++++++
>> nand_spl/board/freescale/mx31pdk/config.mk | 5 ++
>> nand_spl/board/freescale/mx31pdk/u-boot.lds | 36 ++++++++++
>> 9 files changed, 251 insertions(+), 5 deletions(-)
>> create mode 100644 board/freescale/mx31pdk/u-boot-nand.lds
>> create mode 100644 nand_spl/board/freescale/mx31pdk/Makefile
>> create mode 100644 nand_spl/board/freescale/mx31pdk/config.mk
>> create mode 100644 nand_spl/board/freescale/mx31pdk/u-boot.lds
>>
>> diff --git a/MAKEALL b/MAKEALL
>> index aaa6dea..615acbb 100755
>> --- a/MAKEALL
>> +++ b/MAKEALL
>> @@ -548,7 +548,8 @@ LIST_ARM11=" \
>> imx31_phycore \
>> imx31_phycore_eet \
>> mx31ads \
>> - mx31pdk \
>> + mx31pdk \
>> + mx31pdk_nand \
>> qong \
>> smdk6400 \
>> "
>> diff --git a/Makefile b/Makefile
>> index 99ebcc5..c377313 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -369,7 +369,7 @@ $(LDSCRIPT): depend
>> $(NAND_SPL): $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
>> $(MAKE) -C nand_spl/board/$(BOARDDIR) all
>>
>> -$(U_BOOT_NAND): $(NAND_SPL) $(obj)u-boot.bin
>> +$(U_BOOT_NAND): $(NAND_SPL) $(obj)u-boot.bin $(obj)include/autoconf.mk
> why?
Maxim added this, I haven't investigated if the dependency is needed or not.
>> cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
>>
>> $(ONENAND_IPL): $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
>> @@ -3087,6 +3087,13 @@ mx31ads_config : unconfig
>> mx31pdk_config : unconfig
>> @$(MKCONFIG) $(@:_config=) arm arm1136 mx31pdk freescale mx31
>>
>> +mx31pdk_nand_config : unconfig
>> + @mkdir -p $(obj)include $(obj)board/freescale/mx31pdk
>> + @mkdir -p $(obj)nand_spl/board/freescale/mx31pdk
>> + @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
>> + @$(MKCONFIG) -n $@ -a mx31pdk arm arm1136 mx31pdk freescale mx31
>> + @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
> IIRC no need it will generate from the config.h
I don't understand the comment. What will generate what from config.h?
>> +
>> omap2420h4_config : unconfig
>> @$(MKCONFIG) $(@:_config=) arm arm1136 omap2420h4 NULL omap24xx
>>
>> diff --git a/board/freescale/mx31pdk/config.mk b/board/freescale/mx31pdk/config.mk
>> index d34dc02..dcaa09f 100644
>> --- a/board/freescale/mx31pdk/config.mk
>> +++ b/board/freescale/mx31pdk/config.mk
>> @@ -1 +1,5 @@
>> +ifdef CONFIG_NAND_SPL
>> +TEXT_BASE = 0x87ec0000
>> +else
>> TEXT_BASE = 0x87f00000
>> +endif
>> diff --git a/board/freescale/mx31pdk/lowlevel_init.S b/board/freescale/mx31pdk/lowlevel_init.S
>> index ec5eedb..602eb53 100644
>> --- a/board/freescale/mx31pdk/lowlevel_init.S
>> +++ b/board/freescale/mx31pdk/lowlevel_init.S
>> @@ -26,5 +26,98 @@
>>
>> .globl lowlevel_init
>>
>> +#ifdef CONFIG_NAND_SPL
>> +#include <asm/arch/mx31-regs.h>
>> +
>> +.macro REG reg, val
>> + ldr r2, =\reg
>> + ldr r3, =\val
>> + str r3, [r2]
>> +.endm
>> +
>> +.macro REG8 reg, val
>> + ldr r2, =\reg
>> + ldr r3, =\val
>> + strb r3, [r2]
>> +.endm
>> +
>> +.macro DELAY loops
>> + ldr r2, =\loops
>> +1:
>> + subs r2, r2, #1
>> + nop
>> + bcs 1b
>> +.endm
> NACK
> as already reply to the kirwood patch we must have common macro
> please use the attached file as based work
I don't see any file attached to you e-mail, so which attached file?
Can you point to the relevant kirkwood patch? Is the patch in some
git-tree?
>> +
>> +.globl lowlevel_init
>> +lowlevel_init:
>> + /* Also setup the Peripheral Port Remap register inside the core */
>> + ldr r0, =ARM_PPMRR /* start from AIPS 2GB region */
>> + mcr p15, 0, r0, c15, c2, 4
>> +
> for all hard code value please use macro
> and if possible macro to generate them
Hmm. You want me to create a macro that expands to the above code?
>> + REG IPU_CONF, IPU_CONF_DI_EN
>> + REG CCM_CCMR, 0x074B0BF5
>> +
>> + REG 0xB8001010, 0x0000000c
>> +
> <snip>
>> + mov pc, lr
>> +#else
>> lowlevel_init:
>> mov pc, lr
> why?
See my answer in patch 2.
>> +#endif
>> diff --git a/board/freescale/mx31pdk/u-boot-nand.lds b/board/freescale/mx31pdk/u-boot-nand.lds
>> new file mode 100644
>> index 0000000..b604480
>> --- /dev/null
>> +++ b/board/freescale/mx31pdk/u-boot-nand.lds
> no need anymore
I'll try with your lds cleanup patch.
Thanks, Magnus
More information about the U-Boot
mailing list