From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/3] MX31: Add NAND SPL boot support to i.MX31 PDK board.
Date: Sat, 9 May 2009 23:28:10 +0200 [thread overview]
Message-ID: <20090509212810.GH13502@game.jcrosoft.org> (raw)
In-Reply-To: <d88166fe8149e57c8df1ab7325f3e9c12d33fbca.1241379803.git.lilja.magnus@gmail.com>
On 21:56 Sun 03 May , Magnus Lilja wrote:
> Signed-off-by: Magnus Lilja <lilja.magnus@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?
> 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
> +
> 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
> +
> +.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
> + 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?
> +#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
>
> /*
> * Size of malloc() pool
> @@ -158,5 +158,18 @@
>
> #define CONFIG_ENV_SIZE (128 * 1024)
>
> +#define CFG_NAND_U_BOOT_OFFS 0x800
please use CONFIG_ or CONFIG_SYS_
> +#define CFG_NAND_U_BOOT_SIZE 0x30000
<snip>
> +
> +SRCS := $(SRCTREE)/nand_spl/nand_boot_mx31.c
> +SRCS += $(SRCTREE)/cpu/arm1136/start.S
> +SRCS += $(SRCTREE)/board/freescale/mx31pdk/lowlevel_init.S
> +OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
> +__OBJS := $(SOBJS) $(COBJS)
> +LNDIR := $(OBJTREE)/nand_spl/board/$(BOARDDIR)
> +
> +nandobj := $(OBJTREE)/nand_spl/
> +
> +ALL = $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
> +
> +all: $(obj).depend $(ALL)
> +
> +$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
> + $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
> +
> +$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
> + $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
> +
> +$(nandobj)u-boot-spl: $(OBJS)
> + cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
> + -Map $(nandobj)u-boot-spl.map \
> + -o $(nandobj)u-boot-spl
please use $@ and $<
> +
> +#########################################################################
> +
> +$(obj)%.o: $(SRCTREE)/cpu/arm1136/%.S
> + $(CC) $(AFLAGS) -c -o $@ $<
> +
> new file mode 100644
> index 0000000..2780e11
> --- /dev/null
> +++ b/nand_spl/board/freescale/mx31pdk/u-boot.lds
> @@ -0,0 +1,36 @@
> +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
> +OUTPUT_ARCH(arm)
> +ENTRY(_start)
> +SECTIONS
> +{
> + . = 0x00000000;
> +
> + . = ALIGN(4);
> + .text :
^^^
whitespace please fix
and so on
Best Regards,
J.
next prev parent reply other threads:[~2009-05-09 21:28 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-03 19:56 [U-Boot] [PATCH v2 0/3] MX31: NAND boot for phyCORE and PDK boards Magnus Lilja
2009-05-03 19:56 ` [U-Boot] [PATCH v2 1/3] MX31: Add NAND SPL for i.MX31 Magnus Lilja
2009-05-03 19:56 ` [U-Boot] [PATCH v2 2/3] MX31: Add basic support for Freescale i.MX31 PDK board Magnus Lilja
2009-05-03 19:56 ` [U-Boot] [PATCH v2 3/3] MX31: Add NAND SPL boot support to " Magnus Lilja
2009-05-09 21:28 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2009-05-10 19:33 ` Magnus Lilja
2009-05-10 20:39 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-10 21:33 ` Wolfgang Denk
2009-05-10 22:18 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 6:52 ` Wolfgang Denk
2009-05-12 0:27 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 6:53 ` Magnus Lilja
2009-05-12 0:25 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-12 20:49 ` Magnus Lilja
2009-05-12 21:02 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-09 21:17 ` [U-Boot] [PATCH v2 2/3] MX31: Add basic support for Freescale " Jean-Christophe PLAGNIOL-VILLARD
2009-05-10 19:32 ` Magnus Lilja
2009-05-10 20:32 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 6:47 ` Magnus Lilja
2009-05-09 21:04 ` [U-Boot] [PATCH v2 1/3] MX31: Add NAND SPL for i.MX31 Jean-Christophe PLAGNIOL-VILLARD
2009-05-10 19:31 ` Magnus Lilja
2009-05-10 20:34 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 16:48 ` Magnus Lilja
2009-05-11 19:03 ` Magnus Lilja
2009-05-12 0:22 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-12 4:03 ` Magnus Lilja
2009-05-12 16:52 ` Scott Wood
2009-05-29 21:34 ` Scott Wood
2009-05-30 7:54 ` Magnus Lilja
2009-06-01 17:06 ` Scott Wood
2009-06-01 20:18 ` Magnus Lilja
2009-06-01 20:21 ` Magnus Lilja
2009-06-01 20:39 ` Scott Wood
2009-06-01 20:42 ` Magnus Lilja
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090509212810.GH13502@game.jcrosoft.org \
--to=plagnioj@jcrosoft.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox