Skip to contentSkip to conversation

Loading a kernel on MX31ADS using U-boot

U-Boot-Users Fabio Estevam 4 participants 14 messages Apr 11, 2008 – May 15, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

I am using U-boot 1.3.2 with the MX31ADS patches posted by Guennadi Liakhovetski.

I would like to load the zImage kernel from Freescale Linux BSP via TFTP and mount the rootfs via NFS.

Does anyone have an example for doing this? I am not sure what address should I use to load the kernel into RAM.

Thanks,

Fabio Estevam

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#1 lore raw
Quoted 5 lines · Fabio Estevam

I am using U-boot 1.3.2 with the MX31ADS patches posted by Guennadi Liakhovetski.

I would like to load the zImage kernel from Freescale Linux BSP via TFTP and mount the rootfs via NFS.

You nead a uImage. Just use the same kernel sources and do make uImage instead of zImage.

Quoted 3 lines

Does anyone have an example for doing this? I am not sure what address should I use to load the kernel into RAM.

Load it to 0x80800000. You can also try the patch below, which will give you a better default environment, it shall be submitted to the list soon.

Thanks
Guennadi
---
Guennadi Liakhovetski

[PATCH] mx31ads: Fix default environment

Fix wrong load address in RAM, undefined environment variables, make the default environment more usable.

---
 include/configs/mx31ads.h |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)
include/configs/mx31ads.h +18 -7
index 78e2545..3ad3883 100644
@@ -80,13 +80,24 @@
 #define CONFIG_IPADDR		192.168.23.168
 #define CONFIG_SERVERIP		192.168.23.2
 
-#define	CONFIG_EXTRA_ENV_SETTINGS											\
-	"bootargs_base=setenv bootargs console=ttymxc0,115200\0"							\
-	"bootargs_nfs=setenv bootargs $(bootargs) root=/dev/nfs ip=dhcp nfsroot=$(serverip):$(nfsrootfs),v3,tcp\0"	\
-	"bootcmd=run bootcmd_net\0"											\
-	"bootcmd_net=run bootargs_base bootargs_mtd bootargs_nfs; tftpboot 0x80000000 uImage-mx31; bootm\0"		\
-	"prg_uboot=tftpboot 0x80000000 u-boot-mx31ads.bin; protect off 0xa0000000 0xa001ffff; erase 0xa0000000 0xa001ffff; cp.b 0x80000000 0xa0000000 $(filesize)\0"
-
+#define	CONFIG_EXTRA_ENV_SETTINGS					\
+	"netdev=eth0\0"							\
+	"load_addr=0x80800000\0"					\
+	"uboot_addr=0xa0000000\0"					\
+	"uboot=mx31ads/u-boot.bin\0"					\
+	"kernel=mx31ads/uImage\0"					\
+	"nfsroot=/opt/eldk/arm\0"					\
+	"bootargs_base=setenv bootargs console=ttymxc0,115200\0"	\
+	"bootargs_nfs=setenv bootargs ${bootargs} root=/dev/nfs "	\
+		"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0"	\
+	"bootcmd=run bootcmd_net\0"					\
+	"bootcmd_net=run bootargs_base bootargs_nfs; "			\
+		"tftpboot ${load_addr} ${kernel}; bootm\0"		\
+	"prg_uboot=tftpboot ${load_addr} ${uboot}; "			\
+		"protect off ${uboot_addr} 0xa003ffff; "		\
+		"erase ${uboot_addr} 0xa003ffff; "			\
+		"cp.b ${load_addr} ${uboot_addr} ${filesize}; "		\
+		"setenv filesize; saveenv\0"
 
 #define CONFIG_DRIVER_CS8900	1
 #define CS8900_BASE		0xb4020300
Signature · 1 line
1.5.4
#2 lore raw

Hi Guennadi,

I tried to load the kernel at 0x80800000, but this is what I get:
Hit any key to stop autoboot: 0
=> run bootargs_base bootargs_nfs
=> tftp 80800000 uImage
TFTP from server 10.29.244.101; our IP address is 10.29.244.102
Filename 'uImage'.
Load address: 0x80800000
Loading:
#################################################################

         ###########################

done
Bytes transferred = 1339152 (146f10 hex)
=> bootm
## Booting image at 80800000 ...

   Image Name:   Linux-2.6.22
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1339088 Bytes =  1.3 MB

Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux............................................................. ................................... done, booting the kernel.
(then it freezes)

I generated uImage manually by doing:
./mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n 'Linux-2.6.22' -d zImage uImage

Used 0x80008000 to match the value of ZRELADDR in /arch/arm/mach-mx3/Makefile.boot from Freescale Linux BSP.

Any suggestions?

Thanks,

Fabio Estevam

--- Guennadi Liakhovetski <[email protected]>

Quoted 94 lines · wrote:
Quoted 4 lines · Fabio Estevam

I am using U-boot 1.3.2 with the MX31ADS patches
posted by Guennadi Liakhovetski.

I would like to load the zImage kernel from

Freescale

Quoted 1 line

Linux BSP via TFTP and mount the rootfs via NFS.

You nead a uImage. Just use the same kernel sources and do make uImage
instead of zImage.

Quoted 1 line

Does anyone have an example for doing this? I am

not

Quoted 1 line

sure what address should I use to load the kernel

into

Quoted 1 line

RAM.

Load it to 0x80800000. You can also try the patch below, which will give
you a better default environment, it shall be submitted to the list soon.

Thanks
Guennadi
---
Guennadi Liakhovetski

[PATCH] mx31ads: Fix default environment

Fix wrong load address in RAM, undefined environment variables,
make the default environment more usable.

---
 include/configs/mx31ads.h |   25
++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)
include/configs/mx31ads.h +0 -3
index 78e2545..3ad3883 100644
@@ -80,13 +80,24 @@
 #define CONFIG_IPADDR		192.168.23.168
 #define CONFIG_SERVERIP		192.168.23.2
 
-#define	CONFIG_EXTRA_ENV_SETTINGS											\
-	"bootargs_base=setenv bootargs
 console=ttymxc0,115200\0"							\
-	"bootargs_nfs=setenv bootargs $(bootargs)

root=/dev/nfs ip=dhcp
nfsroot=$(serverip):$(nfsrootfs),v3,tcp\0" \

include/configs/mx31ads.h +0 -2
-	"bootcmd=run bootcmd_net\0"											\
-	"bootcmd_net=run bootargs_base bootargs_mtd

bootargs_nfs; tftpboot 0x80000000 uImage-mx31;
bootm\0" \

include/configs/mx31ads.h +0 -1
-	"prg_uboot=tftpboot 0x80000000 u-boot-mx31ads.bin;

protect off 0xa0000000 0xa001ffff; erase 0xa0000000 0xa001ffff; cp.b 0x80000000 0xa0000000 $(filesize)\0"

include/configs/mx31ads.h +8 -1
-
+#define	CONFIG_EXTRA_ENV_SETTINGS					\
+	"netdev=eth0\0"							\
+	"load_addr=0x80800000\0"					\
+	"uboot_addr=0xa0000000\0"					\
+	"uboot=mx31ads/u-boot.bin\0"					\
+	"kernel=mx31ads/uImage\0"					\
+	"nfsroot=/opt/eldk/arm\0"					\
+	"bootargs_base=setenv bootargs

console=ttymxc0,115200\0" \

include/configs/mx31ads.h +1 -0
+	"bootargs_nfs=setenv bootargs ${bootargs}

root=/dev/nfs " \

include/configs/mx31ads.h +1 -0
+		"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0"

\

include/configs/mx31ads.h +7 -0
+	"bootcmd=run bootcmd_net\0"					\
+	"bootcmd_net=run bootargs_base bootargs_nfs; "			\
+		"tftpboot ${load_addr} ${kernel}; bootm\0"		\
+	"prg_uboot=tftpboot ${load_addr} ${uboot}; "			\
+		"protect off ${uboot_addr} 0xa003ffff; "		\
+		"erase ${uboot_addr} 0xa003ffff; "			\
+		"cp.b ${load_addr} ${uboot_addr} ${filesize}; "	

\

include/configs/mx31ads.h +1 -0
+		"setenv filesize; saveenv\0"
 
 #define CONFIG_DRIVER_CS8900	1
 #define CS8900_BASE		0xb4020300
Signature · 1 line
1.5.4

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#3 lore raw
Quoted 32 lines · Fabio Estevam

I tried to load the kernel at 0x80800000, but this is what I get:
Hit any key to stop autoboot: 0
=> run bootargs_base bootargs_nfs
=> tftp 80800000 uImage
TFTP from server 10.29.244.101; our IP address is 10.29.244.102
Filename 'uImage'.
Load address: 0x80800000
Loading:
#################################################################

         ###########################

done
Bytes transferred = 1339152 (146f10 hex)
=> bootm
## Booting image at 80800000 ...

   Image Name:   Linux-2.6.22
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1339088 Bytes =  1.3 MB

Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux............................................................. ................................... done, booting the kernel.
(then it freezes)

Quoted 8 lines

I generated uImage manually by doing:
./mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n 'Linux-2.6.22' -d zImage uImage

Used 0x80008000 to match the value of ZRELADDR in /arch/arm/mach-mx3/Makefile.boot from Freescale Linux BSP.

I'll just assume your uImage is correct - although I don't understand why you don't just do make uImage. Apart from that, verify that your console= command line parameter is correct, your machine ID matches, and that you don't have a jtag debugger like bdi2000 connected when you're trying to boot.

Thanks
Guennadi
---
Guennadi Liakhovetski

#4 lore raw

Hi Guennadi,

Now I generated uImage correctly and it boots fine.

Have you ever tried to boot U-boot from NAND
(K9K1G08U0B) on the i.MX31ADS?

Thanks,

Fabio Estevam

--- Guennadi Liakhovetski <[email protected]>

Quoted 15 lines · wrote:
Quoted 1 line · Fabio Estevam

I tried to load the kernel at 0x80800000, but this

is

Quoted 10 lines

what I get:
Hit any key to stop autoboot: 0
=> run bootargs_base bootargs_nfs
=> tftp 80800000 uImage
TFTP from server 10.29.244.101; our IP address is
10.29.244.102
Filename 'uImage'.
Load address: 0x80800000
Loading:

#################################################################

Quoted 7 lines
Quoted 7 lines
         ###########################

done
Bytes transferred = 1339152 (146f10 hex)
=> bootm
## Booting image at 80800000 ...
Image Name: Linux-2.6.22
Image Type: ARM Linux Kernel Image

Quoted 12 lines

(uncompressed)

Quoted 10 lines
   Data Size:    1339088 Bytes =  1.3 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK

OK

Starting kernel ...

Uncompressing

Linux.............................................................

Quoted 26 lines
Quoted 1 line

................................... done, booting

the

Quoted 6 lines

kernel.
(then it freezes)

I generated uImage manually by doing:
./mkimage -A arm -O linux -T kernel -C none -a
0x80008000 -e 0x80008000 -n 'Linux-2.6.22' -d

zImage

Quoted 4 lines

uImage

Used 0x80008000 to match the value of ZRELADDR in
/arch/arm/mach-mx3/Makefile.boot from Freescale

Linux

Quoted 1 line

BSP.

I'll just assume your uImage is correct - although I don't understand why
you don't just do make uImage. Apart from that, verify that your console=
command line parameter is correct, your machine ID matches, and that you
don't have a jtag debugger like bdi2000 connected when you're trying to
boot.

Quoted 6 lines

Thanks
Guennadi
---
Guennadi Liakhovetski

-------------------------------------------------------------------------

Quoted 6 lines

This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.

http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

Quoted 4 lines

_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/u-boot-users

Quoted 1 line

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#5 lore raw
Quoted 1 line · Fabio Estevam

Now I generated uImage correctly and it boots fine.

Good

Quoted 2 lines

Have you ever tried to boot U-boot from NAND
(K9K1G08U0B) on the i.MX31ADS?

No, I have not.

Thanks
Guennadi
---
Guennadi Liakhovetski

#6 lore raw
In reply to Fabio Estevam

Hi Fabio,

Quoted 3 lines · Fabio Estevam

Hi Guennadi,

Now I generated uImage correctly and it boots fine.

How did you build this Kernel? Did you use the LTIB?

Regards
Jens

#7 lore raw

Hi Jens,

Yes, I used LTIB for building the kernel:

export SYSCFG_KTARG=uImage
./ltib -p kernel -m prep
./ltib -p kernel -m scbuild
./ltib -p kernel -m scdeploy

The uImage is generated at:
.../rpm/BUILD/linux/arch/arm/boot/uImage

Regards,

Fabio Estevam

Quoted 5 lines · --- Jens Gehrlein

Hi Fabio,

Quoted 2 lines · Fabio Estevam

Hi Guennadi,

Quoted 9 lines
Quoted 1 line

Now I generated uImage correctly and it boots

fine.

How did you build this Kernel? Did you use the LTIB?

Regards
Jens

-------------------------------------------------------------------------

Quoted 6 lines

This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.

http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

Quoted 4 lines

_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/u-boot-users

Quoted 1 line
      ____________________________________________________________________________________

Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

#8 lore raw
Quoted 9 lines · Fabio Estevam

Hi Jens,

Yes, I used LTIB for building the kernel:

export SYSCFG_KTARG=uImage
./ltib -p kernel -m prep
./ltib -p kernel -m scbuild
./ltib -p kernel -m scdeploy

Quoted 6 lines

The uImage is generated at:
.../rpm/BUILD/linux/arch/arm/boot/uImage

Regards,

Fabio Estevam

Thank you very much.
I will try it as soon as I come to the Linux part.

Regards
Jens

#9 lore raw
In reply to Guennadi Liakhovetski

Hi Guennadi,

Guennadi Liakhovetski schrieb:

...

Apart from that, verify that your console=

Quoted 3 lines

command line parameter is correct, your machine ID matches, and that you don't have a jtag debugger like bdi2000 connected when you're trying to boot.

I have the same problem on our board: I don't see the console outputs if the BDI2000 cable is connected to the target, although the BDI is in mode "reset run". Do have an idea why?

Best Regards,
Jens

#10 lore raw
Quoted 8 lines · Jens Gehrlein

Apart from that, verify that your console=

Quoted 3 lines

command line parameter is correct, your machine ID matches, and that you don't have a jtag debugger like bdi2000 connected when you're trying to boot.

I have the same problem on our board: I don't see the console outputs if the BDI2000 cable is connected to the target, although the BDI is in mode "reset run". Do have an idea why?

No, I don't know "why", but that's exactly why I've mentioned it above - I had the same problem here and I spent about half a day trying to figure out why it didn't boot.

Thanks
Guennadi
---
Guennadi Liakhovetski

#11 lore raw
In reply to Jens Gehrlein

Hi Jens,

Have you tried to pass the "jtag=on" option into the kernel command line?

Regards,

Fabio Estevam

Quoted 36 lines · Jens Gehrlein

From: Jens Gehrlein <[email protected]>
Subject: Re: [U-Boot-Users] Loading a kernel on MX31ADS using U-boot
To: "Guennadi Liakhovetski" <[email protected]>
Cc: u-boot-users at lists.sourceforge.net
Date: Wednesday, May 14, 2008, 4:08 AM
Hi Guennadi,

Guennadi Liakhovetski schrieb:

...

Apart from that, verify that your console=

Quoted 1 line

command line parameter is correct, your machine ID

matches, and that you

Quoted 1 line

don't have a jtag debugger like bdi2000 connected

when you're trying to

Quoted 1 line

boot.

I have the same problem on our board: I don't see the console outputs if
the BDI2000 cable is connected to the target, although the BDI is in
mode "reset run". Do have an idea why?

Best Regards,
Jens

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

#12 lore raw

Hi Fabio,

Quoted 3 lines · Fabio Estevam

Hi Jens,

Have you tried to pass the "jtag=on" option into the kernel command line?

Yippee! This works.
Thank you very much for this hint!
Where is this parameter documented? I didn't found anything in linux/Documentation or with google.

...

Quoted 11 lines
Quoted 11 lines

Apart from that, verify that your console=

Quoted 1 line

command line parameter is correct, your machine ID

matches, and that you

Quoted 1 line

don't have a jtag debugger like bdi2000 connected

when you're trying to

Quoted 1 line

boot.

I have the same problem on our board: I don't see the console outputs if
the BDI2000 cable is connected to the target, although the BDI is in
mode "reset run". Do have an idea why?

Best Regards,
Jens

#13 lore raw
Quoted 5 lines · Jens Gehrlein

Yippee! This works.
Thank you very much for this hint!
Where is this parameter documented? I didn't found anything in
linux/Documentation or with google.

Yes, this is a Freescale specific option as part of the BSP for mainly debugging purpose.

Regards,

Fabio Estevam