diff mbox

[U-Boot,v2,7/7] am335x_evm: Add support to boot from NOR.

Message ID 51DEADD2.3050805@newflow.co.uk
State Not Applicable
Delegated to: Tom Rini
Headers show

Commit Message

Mark Jackson July 11, 2013, 1:06 p.m. UTC
On 18/06/13 13:11, Mark Jackson wrote:
> On 17/06/13 15:43, Mark Jackson wrote:
>> On 13/05/13 19:28, Tom Rini wrote:
>>> From: Steve Kipisz <s-kipisz2@ti.com>
>>>
>>> NOR requires that s_init be within the first 4KiB of the image so that
>>> we can perform the rest of the required pinmuxing to talk with the rest
>>> of NOR that we are found on.  When NOR_BOOT is set we save our
>>> environment in NOR at 512KiB and a redundant copy at 768KiB.  We avoid
>>> using SPL for this case and u-boot.bin is written directly to the start
>>> of NOR.
>>
>> I'm trying to get this up and running our NanoBone platform, but I'm having
>> no success.
> 
> Just an update ... I now have it working ... yay !!
> 
> The main (and possibly the *only*) culprit was that SYSBOOT[8] (which selects
> 8/16bit mode) was being incorrectly influenced by a hardware fault.
> 
> I have pulled quite a few patches from various places, some of which might
> not be required.  Now I have a working base, I'll work out what is needed
> on top of Tom's original patch set.

Okay ... I've now got NOR booting rebased to master using the patch set below.
This doesn't include my board code as that's of no interest until NOR booting
is added to the mainline code.

Sorry, Tom, I'm no git expert, so I'm not sure how to compare this to your
previous patches ... I hope this is useful in some way ??

Cheers
Mark J.
---
 arch/arm/config.mk                 |    2 +-
 arch/arm/cpu/armv7/am33xx/board.c  |    2 +-
 arch/arm/cpu/armv7/am33xx/emif4.c  |    6 +++++-
 arch/arm/cpu/armv7/am33xx/mem.c    |   18 ++++++++----------
 arch/arm/cpu/armv7/lowlevel_init.S |    2 +-
 arch/arm/cpu/armv7/omap3/mem.c     |   18 ++++--------------
 arch/arm/cpu/armv7/start.S         |    2 +-
 7 files changed, 21 insertions(+), 29 deletions(-)

Comments

Tom Rini July 11, 2013, 1:28 p.m. UTC | #1
On Thu, Jul 11, 2013 at 02:06:26PM +0100, Mark Jackson wrote:
> On 18/06/13 13:11, Mark Jackson wrote:
> > On 17/06/13 15:43, Mark Jackson wrote:
> >> On 13/05/13 19:28, Tom Rini wrote:
> >>> From: Steve Kipisz <s-kipisz2@ti.com>
> >>>
> >>> NOR requires that s_init be within the first 4KiB of the image so that
> >>> we can perform the rest of the required pinmuxing to talk with the rest
> >>> of NOR that we are found on.  When NOR_BOOT is set we save our
> >>> environment in NOR at 512KiB and a redundant copy at 768KiB.  We avoid
> >>> using SPL for this case and u-boot.bin is written directly to the start
> >>> of NOR.
> >>
> >> I'm trying to get this up and running our NanoBone platform, but I'm having
> >> no success.
> > 
> > Just an update ... I now have it working ... yay !!
> > 
> > The main (and possibly the *only*) culprit was that SYSBOOT[8] (which selects
> > 8/16bit mode) was being incorrectly influenced by a hardware fault.
> > 
> > I have pulled quite a few patches from various places, some of which might
> > not be required.  Now I have a working base, I'll work out what is needed
> > on top of Tom's original patch set.
> 
> Okay ... I've now got NOR booting rebased to master using the patch set below.
> This doesn't include my board code as that's of no interest until NOR booting
> is added to the mainline code.
> 
> Sorry, Tom, I'm no git expert, so I'm not sure how to compare this to your
> previous patches ... I hope this is useful in some way ??

I'm just starting to cycle back to the NOR patches again myself and
fixup the few remaining comments.  But in your series:

> diff --git a/arch/arm/config.mk b/arch/arm/config.mk
> index e80e1ed..ba310cb 100644
> --- a/arch/arm/config.mk
> +++ b/arch/arm/config.mk
> @@ -111,6 +111,6 @@ endif
>  endif
>  
>  # check that only R_ARM_RELATIVE relocations are generated
> -ifneq ($(CONFIG_SPL_BUILD),y)
> +ifneq ($(CONFIG_SPL_BUILD)$(CONFIG_NOR_BOOT),y)
>  ALL-y	+= checkarmreloc
>  endif

What toolchain are you using?  This seems worrying at best.
Mark Jackson July 11, 2013, 1:45 p.m. UTC | #2
On 11/07/13 14:28, Tom Rini wrote:
> On Thu, Jul 11, 2013 at 02:06:26PM +0100, Mark Jackson wrote:
>> On 18/06/13 13:11, Mark Jackson wrote:
>>> On 17/06/13 15:43, Mark Jackson wrote:
>>
>> Okay ... I've now got NOR booting rebased to master using the patch set below.
>> This doesn't include my board code as that's of no interest until NOR booting
>> is added to the mainline code.
>>
>> Sorry, Tom, I'm no git expert, so I'm not sure how to compare this to your
>> previous patches ... I hope this is useful in some way ??
> 
> I'm just starting to cycle back to the NOR patches again myself and
> fixup the few remaining comments.  But in your series:
> 
>> diff --git a/arch/arm/config.mk b/arch/arm/config.mk
>> index e80e1ed..ba310cb 100644
>> --- a/arch/arm/config.mk
>> +++ b/arch/arm/config.mk
>> @@ -111,6 +111,6 @@ endif
>>  endif
>>  
>>  # check that only R_ARM_RELATIVE relocations are generated
>> -ifneq ($(CONFIG_SPL_BUILD),y)
>> +ifneq ($(CONFIG_SPL_BUILD)$(CONFIG_NOR_BOOT),y)
>>  ALL-y	+= checkarmreloc
>>  endif
> 
> What toolchain are you using?  This seems worrying at best.

Generated via Buildroot ... here's the (rather copious) version info ...

mpfj@mpfj-nanobone:~/uboot/u-boot$ arm-linux-gcc --version -v
Using built-in specs.
COLLECT_GCC=arm-linux-gcc
COLLECT_LTO_WRAPPER=/home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/lto-wrapper
arm-linux-gcc (Buildroot 2013.02-dirty) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Target: arm-buildroot-linux-uclibcgnueabi
Configured with: /home/mpfj/buildroot/output/toolchain/gcc-4.6.3/configure --prefix=/home/mpfj/buildroot/output/host/usr --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-buildroot-linux-uclibcgnueabi --enable-languages=c,c++ --with-sysroot=/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot --with-build-time-tools=/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/bin --disable-__cxa_atexit --enable-target-optspace --disable-libquadmath --disable-libgomp --with-gnu-ld --disable-libssp --disable-multilib --enable-tls --enable-shared --with-gmp=/home/mpfj/buildroot/output/host/usr --with-mpfr=/home/mpfj/buildroot/output/host/usr --with-mpc=/home/mpfj/buildroot/output/host/usr --disable-nls --enable-threads --disable-decimal-float --with-abi=aapcs-linux --with-arch=armv7-a --with-tune=cortex-a8 --disable-largefile --with-pkgversion='Buildroot 2013.02-dirty' --with-bugurl=http://bugs.buildroot.net/ --with
 -fpu=vfpv
3 --with-float=hard
Thread model: posix
gcc version 4.6.3 (Buildroot 2013.02-dirty) 
COLLECT_GCC_OPTIONS='--version' '-v' '-march=armv7-a' '-mtune=cortex-a8' '-mfloat-abi=hard' '-mfpu=vfpv3' '-mabi=aapcs-linux'
 /home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/cc1 -quiet -v help-dummy -quiet -dumpbase help-dummy -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=vfpv3 -mabi=aapcs-linux -auxbase help-dummy -version --version -o /tmp/cczFlXPw.s
GNU C (Buildroot 2013.02-dirty) version 4.6.3 (arm-buildroot-linux-uclibcgnueabi)
	compiled by GNU C version 4.6.3, GMP version 5.1.0, MPFR version 3.1.1-p2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COLLECT_GCC_OPTIONS='--version' '-v' '-march=armv7-a' '-mtune=cortex-a8' '-mfloat-abi=hard' '-mfpu=vfpv3' '-mabi=aapcs-linux'
 /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/bin/as -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3 -meabi=5 --version -o /tmp/ccgLl9x8.o /tmp/cczFlXPw.s
GNU assembler (GNU Binutils) 2.21.1
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `arm-buildroot-linux-uclibcgnueabi'.
COMPILER_PATH=/home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/:/home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/:/home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/:/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/:/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/:/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/bin/
LIBRARY_PATH=/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/:/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/lib/:/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/lib/:/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/
COLLECT_GCC_OPTIONS='--version' '-v' '-march=armv7-a' '-mtune=cortex-a8' '-mfloat-abi=hard' '-mfpu=vfpv3' '-mabi=aapcs-linux'
 /home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/collect2 --sysroot=/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot --eh-frame-hdr -dynamic-linker /lib/ld-uClibc.so.0 -X -m armelf_linux_eabi --version /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crt1.o /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crti.o /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/crtbegin.o -L/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3 -L/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/lib -L/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/lib -L/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib /tmp/ccgLl9x8.o -lgcc --as-needed -
 lgcc_s --
no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/crtend.o /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crtn.o
collect2 version 4.6.3 (ARM GNU/Linux with ELF)
/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld --sysroot=/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot --eh-frame-hdr -dynamic-linker /lib/ld-uClibc.so.0 -X -m armelf_linux_eabi --version /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crt1.o /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crti.o /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/crtbegin.o -L/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3 -L/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/lib -L/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/lib -L/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/
 lib /tmp/
ccgLl9x8.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/crtend.o /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crtn.o
GNU ld (GNU Binutils) 2.21.1
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
Albert ARIBAUD July 11, 2013, 2:34 p.m. UTC | #3
Hi Mark,

On Thu, 11 Jul 2013 14:45:08 +0100, Mark Jackson
<mpfj-list@newflow.co.uk> wrote:

> On 11/07/13 14:28, Tom Rini wrote:
> > On Thu, Jul 11, 2013 at 02:06:26PM +0100, Mark Jackson wrote:
> >> On 18/06/13 13:11, Mark Jackson wrote:
> >>> On 17/06/13 15:43, Mark Jackson wrote:
> >>
> >> Okay ... I've now got NOR booting rebased to master using the patch set below.
> >> This doesn't include my board code as that's of no interest until NOR booting
> >> is added to the mainline code.
> >>
> >> Sorry, Tom, I'm no git expert, so I'm not sure how to compare this to your
> >> previous patches ... I hope this is useful in some way ??
> > 
> > I'm just starting to cycle back to the NOR patches again myself and
> > fixup the few remaining comments.  But in your series:
> > 
> >> diff --git a/arch/arm/config.mk b/arch/arm/config.mk
> >> index e80e1ed..ba310cb 100644
> >> --- a/arch/arm/config.mk
> >> +++ b/arch/arm/config.mk
> >> @@ -111,6 +111,6 @@ endif
> >>  endif
> >>  
> >>  # check that only R_ARM_RELATIVE relocations are generated
> >> -ifneq ($(CONFIG_SPL_BUILD),y)
> >> +ifneq ($(CONFIG_SPL_BUILD)$(CONFIG_NOR_BOOT),y)
> >>  ALL-y	+= checkarmreloc
> >>  endif
> > 
> > What toolchain are you using?  This seems worrying at best.
> 
> Generated via Buildroot ... here's the (rather copious) version info ...
> 
> mpfj@mpfj-nanobone:~/uboot/u-boot$ arm-linux-gcc --version -v
> Using built-in specs.
> COLLECT_GCC=arm-linux-gcc
> COLLECT_LTO_WRAPPER=/home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/lto-wrapper
> arm-linux-gcc (Buildroot 2013.02-dirty) 4.6.3
> Copyright (C) 2011 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> 
> Target: arm-buildroot-linux-uclibcgnueabi
> Configured with: /home/mpfj/buildroot/output/toolchain/gcc-4.6.3/configure --prefix=/home/mpfj/buildroot/output/host/usr --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-buildroot-linux-uclibcgnueabi --enable-languages=c,c++ --with-sysroot=/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot --with-build-time-tools=/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/bin --disable-__cxa_atexit --enable-target-optspace --disable-libquadmath --disable-libgomp --with-gnu-ld --disable-libssp --disable-multilib --enable-tls --enable-shared --with-gmp=/home/mpfj/buildroot/output/host/usr --with-mpfr=/home/mpfj/buildroot/output/host/usr --with-mpc=/home/mpfj/buildroot/output/host/usr --disable-nls --enable-threads --disable-decimal-float --with-abi=aapcs-linux --with-arch=armv7-a --with-tune=cortex-a8 --disable-largefile --with-pkgversion='Buildroot 2013.02-dirty' --with-bugurl=http://bugs.buildroot.net/ --wi
 th
>  -fpu=vfpv
> 3 --with-float=hard
> Thread model: posix
> gcc version 4.6.3 (Buildroot 2013.02-dirty) 
> COLLECT_GCC_OPTIONS='--version' '-v' '-march=armv7-a' '-mtune=cortex-a8' '-mfloat-abi=hard' '-mfpu=vfpv3' '-mabi=aapcs-linux'
>  /home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/cc1 -quiet -v help-dummy -quiet -dumpbase help-dummy -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=vfpv3 -mabi=aapcs-linux -auxbase help-dummy -version --version -o /tmp/cczFlXPw.s
> GNU C (Buildroot 2013.02-dirty) version 4.6.3 (arm-buildroot-linux-uclibcgnueabi)
> 	compiled by GNU C version 4.6.3, GMP version 5.1.0, MPFR version 3.1.1-p2, MPC version 1.0.1
> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
> COLLECT_GCC_OPTIONS='--version' '-v' '-march=armv7-a' '-mtune=cortex-a8' '-mfloat-abi=hard' '-mfpu=vfpv3' '-mabi=aapcs-linux'
>  /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/bin/as -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3 -meabi=5 --version -o /tmp/ccgLl9x8.o /tmp/cczFlXPw.s
> GNU assembler (GNU Binutils) 2.21.1
> Copyright 2011 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or later.
> This program has absolutely no warranty.
> This assembler was configured for a target of `arm-buildroot-linux-uclibcgnueabi'.
> COMPILER_PATH=/home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/:/home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/:/home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/:/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/:/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/:/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/bin/
> LIBRARY_PATH=/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/:/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/lib/:/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/lib/:/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/
> COLLECT_GCC_OPTIONS='--version' '-v' '-march=armv7-a' '-mtune=cortex-a8' '-mfloat-abi=hard' '-mfpu=vfpv3' '-mabi=aapcs-linux'
>  /home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/collect2 --sysroot=/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot --eh-frame-hdr -dynamic-linker /lib/ld-uClibc.so.0 -X -m armelf_linux_eabi --version /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crt1.o /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crti.o /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/crtbegin.o -L/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3 -L/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/lib -L/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/lib -L/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib /tmp/ccgLl9x8.o -lgcc --as-needed
  -
>  lgcc_s --
> no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/crtend.o /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crtn.o
> collect2 version 4.6.3 (ARM GNU/Linux with ELF)
> /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld --sysroot=/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot --eh-frame-hdr -dynamic-linker /lib/ld-uClibc.so.0 -X -m armelf_linux_eabi --version /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crt1.o /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crti.o /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/crtbegin.o -L/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3 -L/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/lib -L/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/lib -L/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/us
 r/
>  lib /tmp/
> ccgLl9x8.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/crtend.o /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crtn.o
> GNU ld (GNU Binutils) 2.21.1
> Copyright 2011 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or (at your option) a later version.
> This program has absolutely no warranty.

Can you make the the ELF, and possibly the corresponding git branch,
available?

Amicalement,
Tom Rini July 11, 2013, 3:54 p.m. UTC | #4
On Thu, Jul 11, 2013 at 04:34:18PM +0200, Albert ARIBAUD wrote:
> Hi Mark,
> 
> On Thu, 11 Jul 2013 14:45:08 +0100, Mark Jackson
> <mpfj-list@newflow.co.uk> wrote:
> 
> > On 11/07/13 14:28, Tom Rini wrote:
> > > On Thu, Jul 11, 2013 at 02:06:26PM +0100, Mark Jackson wrote:
> > >> On 18/06/13 13:11, Mark Jackson wrote:
> > >>> On 17/06/13 15:43, Mark Jackson wrote:
> > >>
> > >> Okay ... I've now got NOR booting rebased to master using the patch set below.
> > >> This doesn't include my board code as that's of no interest until NOR booting
> > >> is added to the mainline code.
> > >>
> > >> Sorry, Tom, I'm no git expert, so I'm not sure how to compare this to your
> > >> previous patches ... I hope this is useful in some way ??
> > > 
> > > I'm just starting to cycle back to the NOR patches again myself and
> > > fixup the few remaining comments.  But in your series:
> > > 
> > >> diff --git a/arch/arm/config.mk b/arch/arm/config.mk
> > >> index e80e1ed..ba310cb 100644
> > >> --- a/arch/arm/config.mk
> > >> +++ b/arch/arm/config.mk
> > >> @@ -111,6 +111,6 @@ endif
> > >>  endif
> > >>  
> > >>  # check that only R_ARM_RELATIVE relocations are generated
> > >> -ifneq ($(CONFIG_SPL_BUILD),y)
> > >> +ifneq ($(CONFIG_SPL_BUILD)$(CONFIG_NOR_BOOT),y)
> > >>  ALL-y	+= checkarmreloc
> > >>  endif
> > > 
> > > What toolchain are you using?  This seems worrying at best.
> > 
> > Generated via Buildroot ... here's the (rather copious) version info ...
> > 
> > mpfj@mpfj-nanobone:~/uboot/u-boot$ arm-linux-gcc --version -v
> > Using built-in specs.
> > COLLECT_GCC=arm-linux-gcc
> > COLLECT_LTO_WRAPPER=/home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/lto-wrapper
> > arm-linux-gcc (Buildroot 2013.02-dirty) 4.6.3
> > Copyright (C) 2011 Free Software Foundation, Inc.
> > This is free software; see the source for copying conditions.  There is NO
> > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> > 
> > 
> > Target: arm-buildroot-linux-uclibcgnueabi
> > Configured with: /home/mpfj/buildroot/output/toolchain/gcc-4.6.3/configure --prefix=/home/mpfj/buildroot/output/host/usr --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-buildroot-linux-uclibcgnueabi --enable-languages=c,c++ --with-sysroot=/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot --with-build-time-tools=/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/bin --disable-__cxa_atexit --enable-target-optspace --disable-libquadmath --disable-libgomp --with-gnu-ld --disable-libssp --disable-multilib --enable-tls --enable-shared --with-gmp=/home/mpfj/buildroot/output/host/usr --with-mpfr=/home/mpfj/buildroot/output/host/usr --with-mpc=/home/mpfj/buildroot/output/host/usr --disable-nls --enable-threads --disable-decimal-float --with-abi=aapcs-linux --with-arch=armv7-a --with-tune=cortex-a8 --disable-largefile --with-pkgversion='Buildroot 2013.02-dirty' --with-bugurl=http://bugs.buildroot.net/ --wi
>  th
> >  -fpu=vfpv
> > 3 --with-float=hard
> > Thread model: posix
> > gcc version 4.6.3 (Buildroot 2013.02-dirty) 
> > COLLECT_GCC_OPTIONS='--version' '-v' '-march=armv7-a' '-mtune=cortex-a8' '-mfloat-abi=hard' '-mfpu=vfpv3' '-mabi=aapcs-linux'
> >  /home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/cc1 -quiet -v help-dummy -quiet -dumpbase help-dummy -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=vfpv3 -mabi=aapcs-linux -auxbase help-dummy -version --version -o /tmp/cczFlXPw.s
> > GNU C (Buildroot 2013.02-dirty) version 4.6.3 (arm-buildroot-linux-uclibcgnueabi)
> > 	compiled by GNU C version 4.6.3, GMP version 5.1.0, MPFR version 3.1.1-p2, MPC version 1.0.1
> > GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
> > COLLECT_GCC_OPTIONS='--version' '-v' '-march=armv7-a' '-mtune=cortex-a8' '-mfloat-abi=hard' '-mfpu=vfpv3' '-mabi=aapcs-linux'
> >  /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/bin/as -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3 -meabi=5 --version -o /tmp/ccgLl9x8.o /tmp/cczFlXPw.s
> > GNU assembler (GNU Binutils) 2.21.1
> > Copyright 2011 Free Software Foundation, Inc.
> > This program is free software; you may redistribute it under the terms of
> > the GNU General Public License version 3 or later.
> > This program has absolutely no warranty.
> > This assembler was configured for a target of `arm-buildroot-linux-uclibcgnueabi'.
> > COMPILER_PATH=/home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/:/home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/:/home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/:/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/:/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/:/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/bin/
> > LIBRARY_PATH=/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/:/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/lib/:/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/lib/:/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/
> > COLLECT_GCC_OPTIONS='--version' '-v' '-march=armv7-a' '-mtune=cortex-a8' '-mfloat-abi=hard' '-mfpu=vfpv3' '-mabi=aapcs-linux'
> >  /home/mpfj/buildroot/output/host/usr/libexec/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/collect2 --sysroot=/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot --eh-frame-hdr -dynamic-linker /lib/ld-uClibc.so.0 -X -m armelf_linux_eabi --version /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crt1.o /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crti.o /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/crtbegin.o -L/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3 -L/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/lib -L/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/lib -L/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib /tmp/ccgLl9x8.o -lgcc --as-needed
>   -
> >  lgcc_s --
> > no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/crtend.o /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crtn.o
> > collect2 version 4.6.3 (ARM GNU/Linux with ELF)
> > /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld --sysroot=/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot --eh-frame-hdr -dynamic-linker /lib/ld-uClibc.so.0 -X -m armelf_linux_eabi --version /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crt1.o /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crti.o /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/crtbegin.o -L/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3 -L/home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/../../../../arm-buildroot-linux-uclibcgnueabi/lib -L/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/lib -L/home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/us
>  r/
> >  lib /tmp/
> > ccgLl9x8.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /home/mpfj/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.6.3/crtend.o /home/mpfj/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/crtn.o
> > GNU ld (GNU Binutils) 2.21.1
> > Copyright 2011 Free Software Foundation, Inc.
> > This program is free software; you may redistribute it under the terms of
> > the GNU General Public License version 3 or (at your option) a later version.
> > This program has absolutely no warranty.
> 
> Can you make the the ELF, and possibly the corresponding git branch,
> available?

OK, with some help from Albert on IRC, fixed.  The new in the patch
board/ti/am335x/u-boot.lds needed to be re-synced with
arch/arm/cpu/u-boot.lds again.
Albert ARIBAUD July 11, 2013, 4:08 p.m. UTC | #5
Hi Tom,

On Thu, 11 Jul 2013 11:54:09 -0400, Tom Rini <trini@ti.com> wrote:

> The new in the patch
> board/ti/am335x/u-boot.lds needed to be re-synced with
> arch/arm/cpu/u-boot.lds again.

Actually, I wonder why so many ARM .lds files need to exist at all,
when arch/arm/cpu/u-boot[-spl].lds could be used most of the time. I
suspect that the main reason for custom .lds files is ad hoc MEMORY
declarations, which could easily be commonalized through adequate
preprocessing.

Amicalement,
Albert ARIBAUD July 11, 2013, 4:14 p.m. UTC | #6
On Thu, 11 Jul 2013 18:08:59 +0200, Albert ARIBAUD
<albert.u.boot@aribaud.net> wrote:

> Hi Tom,
> 
> On Thu, 11 Jul 2013 11:54:09 -0400, Tom Rini <trini@ti.com> wrote:
> 
> > The new in the patch
> > board/ti/am335x/u-boot.lds needed to be re-synced with
> > arch/arm/cpu/u-boot.lds again.
> 
> Actually, I wonder why so many ARM .lds files need to exist at all,
> when arch/arm/cpu/u-boot[-spl].lds could be used most of the time. I
> suspect that the main reason for custom .lds files is ad hoc MEMORY
> declarations, which could easily be commonalized through adequate
> preprocessing.

... well here the only difference with arch/arm/cpu/u-boot.lds is the
addition of board/ti/am335x/libam335x.o right after start.o but this
should probably also be manageable in arch/arm/cpu/u-boot.lds.

Amicalement,
Tom Rini July 11, 2013, 4:17 p.m. UTC | #7
On Thu, Jul 11, 2013 at 06:14:11PM +0200, Albert ARIBAUD wrote:
> On Thu, 11 Jul 2013 18:08:59 +0200, Albert ARIBAUD
> <albert.u.boot@aribaud.net> wrote:
> 
> > Hi Tom,
> > 
> > On Thu, 11 Jul 2013 11:54:09 -0400, Tom Rini <trini@ti.com> wrote:
> > 
> > > The new in the patch
> > > board/ti/am335x/u-boot.lds needed to be re-synced with
> > > arch/arm/cpu/u-boot.lds again.
> > 
> > Actually, I wonder why so many ARM .lds files need to exist at all,
> > when arch/arm/cpu/u-boot[-spl].lds could be used most of the time. I
> > suspect that the main reason for custom .lds files is ad hoc MEMORY
> > declarations, which could easily be commonalized through adequate
> > preprocessing.
> 
> ... well here the only difference with arch/arm/cpu/u-boot.lds is the
> addition of board/ti/am335x/libam335x.o right after start.o but this
> should probably also be manageable in arch/arm/cpu/u-boot.lds.

Right.  And this is a hard requirement (rather than "lets try and
optimize around flash sectors for least waste) for NOR to work.
Mark Jackson July 17, 2013, 12:58 p.m. UTC | #8
On 11/07/13 14:06, Mark Jackson wrote:
> On 18/06/13 13:11, Mark Jackson wrote:
>> On 17/06/13 15:43, Mark Jackson wrote:
>>> On 13/05/13 19:28, Tom Rini wrote:
>>>> From: Steve Kipisz <s-kipisz2@ti.com>
>>>>
>>>> NOR requires that s_init be within the first 4KiB of the image so that
>>>> we can perform the rest of the required pinmuxing to talk with the rest
>>>> of NOR that we are found on.  When NOR_BOOT is set we save our
>>>> environment in NOR at 512KiB and a redundant copy at 768KiB.  We avoid
>>>> using SPL for this case and u-boot.bin is written directly to the start
>>>> of NOR.
>>>
>>> I'm trying to get this up and running our NanoBone platform, but I'm having
>>> no success.
>>
>> Just an update ... I now have it working ... yay !!
>>
>> The main (and possibly the *only*) culprit was that SYSBOOT[8] (which selects
>> 8/16bit mode) was being incorrectly influenced by a hardware fault.
>>
>> I have pulled quite a few patches from various places, some of which might
>> not be required.  Now I have a working base, I'll work out what is needed
>> on top of Tom's original patch set.
> 
> Okay ... I've now got NOR booting rebased to master using the patch set below.
> This doesn't include my board code as that's of no interest until NOR booting
> is added to the mainline code.
> 
> Sorry, Tom, I'm no git expert, so I'm not sure how to compare this to your
> previous patches ... I hope this is useful in some way ??

Tom ... any idea when NOR booting will be merged into the mainline code ?

I'm keen to get our NanoBone board support added.

Cheers
Mark J.
Tom Rini July 17, 2013, 1:32 p.m. UTC | #9
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/17/2013 08:58 AM, Mark Jackson wrote:
> On 11/07/13 14:06, Mark Jackson wrote:
>> On 18/06/13 13:11, Mark Jackson wrote:
>>> On 17/06/13 15:43, Mark Jackson wrote:
>>>> On 13/05/13 19:28, Tom Rini wrote:
>>>>> From: Steve Kipisz <s-kipisz2@ti.com>
>>>>> 
>>>>> NOR requires that s_init be within the first 4KiB of the 
>>>>> image so that we can perform the rest of the required 
>>>>> pinmuxing to talk with the rest of NOR that we are found 
>>>>> on.  When NOR_BOOT is set we save our environment in NOR at
>>>>> 512KiB and a redundant copy at 768KiB.  We avoid using SPL
>>>>> for this case and u-boot.bin is written directly to the
>>>>> start of NOR.
>>>> 
>>>> I'm trying to get this up and running our NanoBone platform,
>>>>  but I'm having no success.
>>> 
>>> Just an update ... I now have it working ... yay !!
>>> 
>>> The main (and possibly the *only*) culprit was that SYSBOOT[8]
>>>  (which selects 8/16bit mode) was being incorrectly influenced
>>>  by a hardware fault.
>>> 
>>> I have pulled quite a few patches from various places, some of
>>>  which might not be required.  Now I have a working base, I'll
>>>  work out what is needed on top of Tom's original patch set.
>> 
>> Okay ... I've now got NOR booting rebased to master using the 
>> patch set below. This doesn't include my board code as that's of
>>  no interest until NOR booting is added to the mainline code.
>> 
>> Sorry, Tom, I'm no git expert, so I'm not sure how to compare 
>> this to your previous patches ... I hope this is useful in some 
>> way ??
> 
> Tom ... any idea when NOR booting will be merged into the mainline
>  code ?

I've been working this week on things, and I'm hopeful about
re-posting the series today.  The only minor issue I have is that
calling save_omap_boot_params and the asm() bits for finishing NOR
pinmux seem to conflict and leave me in a bad state.  But, since we
don't make use of the boot_params info yet in full U-Boot, that's not
a blocker to me.

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJR5pz8AAoJENk4IS6UOR1WVjgP/AjmJE/HMX5MGhR4xUYmr8ae
XOJRJmwHhw6Y+nJdiwNwoVJtdA4xQErwtLGJvFvRVqocKJZGJvhHtu0BnnilsAQQ
e9eyC4l1kGowSV2HPLVGjkxpgRSSPxo8fGXVw1DBOE12mcAh2U75QvONZwcG6L/w
ZW/d1E97pCL0Wfunj6/QA3BJROpzNnRbmGsMpTp+l/2HES7xHwVf5WLl+aUB/Zy7
VtKHc61XUHYLxvGAisaruPZfhJMfT0cCNc7XAB/HvZGYrSX4ed/XVWZr5FouGV42
yx0grjihAfd+JLSN1wIvtSFxdGw/y3fGJ6lOXsBI9D4k07JE7AHniQg4o+VQM6Fw
9/z17d4wm6BR2zwBdSnjek24OTM3bBzGjYkcQHJEwghzyQgglifbX7emDCqvObvb
kRidZ8WqHlVbbKi69namInZ1f5tgoFbRlTdpxKpXxEUuArRJQwFoPTWKoVeANJjE
ToltaHJa1g9Yqr2fI17Y8K2cjFeEid/64/Yd3LLtJFN22jsFetc1nJj/INkZI1CU
QPgB445+eWiZWVae8PUXyaH8CKkMCa4pYilY+l2JQJAG1aCr0yPP7+1706LheQKY
3qjLsb9jCNLoZ/Sn+jZg4VgK3LfDhp0CyVZafeRQbjGfhuqAT3QBdXi9biBN81zl
EvoUyWaSmbQkzq53xFs6
=+Uko
-----END PGP SIGNATURE-----
diff mbox

Patch

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index e80e1ed..ba310cb 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -111,6 +111,6 @@  endif
 endif
 
 # check that only R_ARM_RELATIVE relocations are generated
-ifneq ($(CONFIG_SPL_BUILD),y)
+ifneq ($(CONFIG_SPL_BUILD)$(CONFIG_NOR_BOOT),y)
 ALL-y	+= checkarmreloc
 endif
diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c
index b935a29..3085292 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -150,7 +150,7 @@  int arch_misc_init(void)
 	return 0;
 }
 
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
 void rtc32k_enable(void)
 {
 	struct rtc_regs *rtc = (struct rtc_regs *)RTC_BASE;
diff --git a/arch/arm/cpu/armv7/am33xx/emif4.c b/arch/arm/cpu/armv7/am33xx/emif4.c
index aa84e96..370230b 100644
--- a/arch/arm/cpu/armv7/am33xx/emif4.c
+++ b/arch/arm/cpu/armv7/am33xx/emif4.c
@@ -43,9 +43,11 @@  void dram_init_banksize(void)
 }
 
 
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
+#ifdef CONFIG_TI81XX
 static struct dmm_lisa_map_regs *hw_lisa_map_regs =
 				(struct dmm_lisa_map_regs *)DMM_BASE;
+#endif
 static struct vtp_reg *vtpreg[2] = {
 				(struct vtp_reg *)VTP0_CTRL_ADDR,
 				(struct vtp_reg *)VTP1_CTRL_ADDR};
@@ -53,6 +55,7 @@  static struct vtp_reg *vtpreg[2] = {
 static struct ddr_ctrl *ddrctrl = (struct ddr_ctrl *)DDR_CTRL_ADDR;
 #endif
 
+#ifdef CONFIG_TI81XX
 void config_dmm(const struct dmm_lisa_map_regs *regs)
 {
 	enable_dmm_clocks();
@@ -67,6 +70,7 @@  void config_dmm(const struct dmm_lisa_map_regs *regs)
 	writel(regs->dmm_lisa_map_1, &hw_lisa_map_regs->dmm_lisa_map_1);
 	writel(regs->dmm_lisa_map_0, &hw_lisa_map_regs->dmm_lisa_map_0);
 }
+#endif
 
 static void config_vtp(int nr)
 {
diff --git a/arch/arm/cpu/armv7/am33xx/mem.c b/arch/arm/cpu/armv7/am33xx/mem.c
index b86b0de..923ea83 100644
--- a/arch/arm/cpu/armv7/am33xx/mem.c
+++ b/arch/arm/cpu/armv7/am33xx/mem.c
@@ -75,16 +75,17 @@  void gpmc_init(void)
 	/* putting a blanket check on GPMC based on ZeBu for now */
 	gpmc_cfg = (struct gpmc *)GPMC_BASE;
 
-#ifdef CONFIG_CMD_NAND
-	const u32 *gpmc_config = NULL;
-	u32 base = 0;
-	u32 size = 0;
-#endif
 	/* global settings */
 	writel(0x00000008, &gpmc_cfg->sysconfig);
+#ifdef CONFIG_NOR
+	writel(0x00000000, &gpmc_cfg->irqstatus);
+	writel(0x00000000, &gpmc_cfg->irqenable);
+	writel(0x00000A00, &gpmc_cfg->config);
+#else
 	writel(0x00000100, &gpmc_cfg->irqstatus);
 	writel(0x00000100, &gpmc_cfg->irqenable);
 	writel(0x00000012, &gpmc_cfg->config);
+#endif
 	/*
 	 * Disable the GPMC0 config set by ROM code
 	 */
@@ -92,10 +93,7 @@  void gpmc_init(void)
 	sdelay(1000);
 
 #ifdef CONFIG_CMD_NAND
-	gpmc_config = gpmc_m_nand;
-
-	base = PISMO1_NAND_BASE;
-	size = PISMO1_NAND_SIZE;
-	enable_gpmc_cs_config(gpmc_config, &gpmc_cfg->cs[0], base, size);
+	enable_gpmc_cs_config(gpmc_m_nand, &gpmc_cfg->cs[0],
+			      CONFIG_SYS_NAND_BASE, GPMC_SIZE_256M);
 #endif
 }
diff --git a/arch/arm/cpu/armv7/lowlevel_init.S b/arch/arm/cpu/armv7/lowlevel_init.S
index 0a15aa4..eed9336 100644
--- a/arch/arm/cpu/armv7/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/lowlevel_init.S
@@ -37,7 +37,7 @@  ENTRY(lowlevel_init)
 	 */
 	ldr	sp, =CONFIG_SYS_INIT_SP_ADDR
 	bic	sp, sp, #7 /* 8-byte alignment for ABI compliance */
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
 	ldr	r8, =gdata
 #else
 	sub	sp, #GD_SIZE
diff --git a/arch/arm/cpu/armv7/omap3/mem.c b/arch/arm/cpu/armv7/omap3/mem.c
index d04a5a1..6f65a73 100644
--- a/arch/arm/cpu/armv7/omap3/mem.c
+++ b/arch/arm/cpu/armv7/omap3/mem.c
@@ -113,11 +113,6 @@  void gpmc_init(void)
 {
 	/* putting a blanket check on GPMC based on ZeBu for now */
 	gpmc_cfg = (struct gpmc *)GPMC_BASE;
-#if defined(CONFIG_CMD_NAND) || defined(CONFIG_CMD_ONENAND)
-	const u32 *gpmc_config = NULL;
-	u32 base = 0;
-	u32 size = 0;
-#endif
 	u32 config = 0;
 
 	/* global settings */
@@ -136,17 +131,12 @@  void gpmc_init(void)
 	sdelay(1000);
 
 #if defined(CONFIG_CMD_NAND)	/* CS 0 */
-	gpmc_config = gpmc_m_nand;
-
-	base = PISMO1_NAND_BASE;
-	size = PISMO1_NAND_SIZE;
-	enable_gpmc_cs_config(gpmc_config, &gpmc_cfg->cs[0], base, size);
+	enable_gpmc_cs_config(gpmc_m_nand, &gpmc_cfg->cs[0], PISMO1_NAND_BASE,
+			      PISMO1_NAND_SIZE);
 #endif
 
 #if defined(CONFIG_CMD_ONENAND)
-	gpmc_config = gpmc_onenand;
-	base = PISMO1_ONEN_BASE;
-	size = PISMO1_ONEN_SIZE;
-	enable_gpmc_cs_config(gpmc_config, &gpmc_cfg->cs[0], base, size);
+	enable_gpmc_cs_config(gpmc_onenand, &gpmc_cfg->cs[0], PISMO1_ONEN_BASE,
+			      PISMO1_ONEN_SIZE);
 #endif
 }
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 8e9cb19..082998c 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -44,7 +44,7 @@  _start: b	reset
 	ldr	pc, _not_used
 	ldr	pc, _irq
 	ldr	pc, _fiq
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
 _undefined_instruction: .word _undefined_instruction
 _software_interrupt:	.word _software_interrupt
 _prefetch_abort:	.word _prefetch_abort