All of lore.kernel.org
 help / color / mirror / Atom feed
* Linux hangs on Tegra 2 / U-Boot board
@ 2012-07-24 13:32 Nuno Santos
       [not found] ` <loom.20120724T152735-115-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Nuno Santos @ 2012-07-24 13:32 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA

Hi

As I explained in a previous post, I have a Tegra2 based board (Harmony)
and (thanks to your help) I successfully managed to flash and boot U-Boot.

However, I’ve been trying to boot Linux from U-Boot but to no avail. Once the
device runs U-boot, I load a Linux image into memory over TFTP, run the
command “bootm”, and then Linux immediately hangs after printing message
“Starting kernel ...".

I’ve tried multiple suggestions I’ve seen online: defining linux console
boot in the “bootargs” parameter in case it is a console misconfiguration,
recompile the kernel with CONFIG_DEBUG_LL to diagnose the problem, and check
the machine id (by providing machine id 0xAAB in the environment var
“machid”). In all these attempts there is no change whatsoever in the output.

I’d be really grateful if someone could give me a hand on this. So, here’s
the details.

1. I’m using the kernel from git://nv-tegra.nvidia.com/linux-2.6.git,
pulled today and configured as indicated in the doc (make tegra_defconfig);
the compilation also creates a uImage for U-Boot. I’m using the latest version
of U-Boot, compiled locally using the standard procedure.

2. First, I flash U-boot and boot the device. U-boot looks for the bootstrap
scripts on several locations and it fails (as it would be expected). At this
point the current environment variables are:

----------------------------------------
Tegra2 (Harmony) # printenv
arch=arm
baudrate=115200
board=harmony
boot_fstypes=ext2  fat
boot_prefixes=/ /boot/
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc1 mmc0 usb0 dhcp
bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
bootcmd_dhcp=run usb_init; if dhcp ${scriptaddr} boot.scr.uimg; then source
        ${scriptaddr}; fi
bootcmd_mmc0=setenv devnum 0; run mmc_boot;
bootcmd_mmc1=setenv devnum 1; run mmc_boot;
bootcmd_usb0=setenv devnum 0; run usb_boot;
bootdelay=2
bootfile=;
cpu=armv7
devnum=0
devtype=usb
ethact=sms0
fdt_high=01100000
fdt_load=0x01000000
loadaddr=0x408000
mmc_boot=setenv devtype mmc; if mmc dev ${devnum}; then run scan_boot; fi
rootpart=1
scan_boot=echo Scanning ${devtype} ${devnum}...; for fs in ${boot_fstypes};
        do for prefix in ${boot_prefixes}; do for script in ${boot_scripts};
        do run script_boot; done; done; done;
script_boot=if ${fs}load ${devtype} ${devnum}:${rootpart} ${scriptaddr}
        ${prefix}${script}; then echo ${script} found! Executing ...;source
        ${scriptaddr};fi;
scriptaddr=0x400000
soc=tegra2
stderr=serial
stdin=serial
stdout=serial
usb_boot=setenv devtype usb; run usb_init; if usb dev ${devnum}; then 
        run scan_boot; fi
usb_init=if ${usb_need_init}; then set usb_need_init false; usb start 0; fi
usb_need_init=false
vendor=nvidia
----------------------------------------

3. Then, I define some vars to tell U-boot how to fetch the uImage remotely. 
Here’s the sequence of commands:

----------------------------------------
Tegra2 (Harmony) # setenv autoload no
Tegra2 (Harmony) # dhcp
Waiting for Ethernet connection... done.
BOOTP broadcast 1
BOOTP broadcast 2
*** Unhandled DHCP Option in OFFER/ACK: 252
...
*** Unhandled DHCP Option in OFFER/ACK: 52
DHCP client bound to address <my-device-ip>
Tegra2 (Harmony) # setenv serverip <my-host-ip>
Tegra2 (Harmony) # setenv bootfile uImage
Tegra2 (Harmony) # setenv bootargs "mem=1024M console=ttyS0,115200n8
        root=/dev/sda1 rw rootwait"
----------------------------------------

4. Next, I tell u-boot to load the uImage file:

----------------------------------------
Tegra2 (Harmony) # tftpboot
Waiting for Ethernet connection... done.
Using sms0 device
TFTP from server <my-host-ip>; our IP address is <my-device-ip>
Filename 'uImage'.
Load address: 0x408000
Loading: EHCI timed out on TD - token=0x8008d80
T #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##########################################
done
Bytes transferred = 3540180 (3604d4 hex)
----------------------------------------

5. And then tell it to boot the kernel from memory:

----------------------------------------
Tegra2 (Harmony) # bootm
## Booting kernel from Legacy Image at 00408000 ...
   Image Name:   Linux-2.6.36.3
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3540116 Bytes = 3.4 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...
----------------------------------------

And then it hangs here. When I compile the kernel with the debug flag, I see
no additional output. I’ve also tried to load uImage to a different address
without any changes.

Many thanks in advance!
--Nuno

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Linux hangs on Tegra 2 / U-Boot board
       [not found] ` <loom.20120724T152735-115-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
@ 2012-07-24 14:05   ` Thierry Reding
       [not found]     ` <20120724140547.GA27999-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Thierry Reding @ 2012-07-24 14:05 UTC (permalink / raw)
  To: Nuno Santos; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1728 bytes --]

On Tue, Jul 24, 2012 at 01:32:59PM +0000, Nuno Santos wrote:
> Hi
> 
> As I explained in a previous post, I have a Tegra2 based board (Harmony)
> and (thanks to your help) I successfully managed to flash and boot U-Boot.
> 
> However, I’ve been trying to boot Linux from U-Boot but to no avail. Once the
> device runs U-boot, I load a Linux image into memory over TFTP, run the
> command “bootm”, and then Linux immediately hangs after printing message
> “Starting kernel ...".
> 
> I’ve tried multiple suggestions I’ve seen online: defining linux console
> boot in the “bootargs” parameter in case it is a console misconfiguration,
> recompile the kernel with CONFIG_DEBUG_LL to diagnose the problem, and check
> the machine id (by providing machine id 0xAAB in the environment var
> “machid”). In all these attempts there is no change whatsoever in the output.

You need to pass earlyprintk in bootargs to see early debug output
(CONFIG_DEBUG_LL). Also make sure that you've flashed with the correct
ODMDATA set so the output goes to the correct UART.

> I’d be really grateful if someone could give me a hand on this. So, here’s
> the details.
> 
> 1. I’m using the kernel from git://nv-tegra.nvidia.com/linux-2.6.git,
> pulled today and configured as indicated in the doc (make tegra_defconfig);
> the compilation also creates a uImage for U-Boot. I’m using the latest version
> of U-Boot, compiled locally using the standard procedure.

It might help to try and run the upstream kernel just to check that
everything works. I believe the NVIDIA downstream kernels currently
don't boot properly when run from the upstream U-Boot. But I may be
mistaken.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Linux hangs on Tegra 2 / U-Boot board
       [not found]     ` <20120724140547.GA27999-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
@ 2012-07-24 15:59       ` Stephen Warren
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2012-07-24 15:59 UTC (permalink / raw)
  To: Thierry Reding; +Cc: Nuno Santos, linux-tegra-u79uwXL29TY76Z2rM5mHXA

On 07/24/2012 08:05 AM, Thierry Reding wrote:
> On Tue, Jul 24, 2012 at 01:32:59PM +0000, Nuno Santos wrote:
>> Hi
>> 
>> As I explained in a previous post, I have a Tegra2 based board
>> (Harmony) and (thanks to your help) I successfully managed to
>> flash and boot U-Boot.
>> 
>> However, I’ve been trying to boot Linux from U-Boot but to no
>> avail. Once the device runs U-boot, I load a Linux image into
>> memory over TFTP, run the command “bootm”, and then Linux
>> immediately hangs after printing message “Starting kernel ...".
>> 
>> I’ve tried multiple suggestions I’ve seen online: defining linux
>> console boot in the “bootargs” parameter in case it is a console
>> misconfiguration, recompile the kernel with CONFIG_DEBUG_LL to
>> diagnose the problem, and check the machine id (by providing
>> machine id 0xAAB in the environment var “machid”). In all these
>> attempts there is no change whatsoever in the output.
> 
> You need to pass earlyprintk in bootargs to see early debug output 
> (CONFIG_DEBUG_LL). Also make sure that you've flashed with the
> correct ODMDATA set so the output goes to the correct UART.

Also, you need an appropriate Kconfig option to select which debug
UART to use. CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA should hopefully
work fine, assuming your ODMDATA contains the correct UART setting
(e.g. 0x300d8011 should work).

>> I’d be really grateful if someone could give me a hand on this.
>> So, here’s the details.
>> 
>> 1. I’m using the kernel from
>> git://nv-tegra.nvidia.com/linux-2.6.git, pulled today and
>> configured as indicated in the doc (make tegra_defconfig); the
>> compilation also creates a uImage for U-Boot. I’m using the
>> latest version of U-Boot, compiled locally using the standard
>> procedure.
> 
> It might help to try and run the upstream kernel just to check
> that everything works. I believe the NVIDIA downstream kernels
> currently don't boot properly when run from the upstream U-Boot.
> But I may be mistaken.

Upstream U-Boot has primarily (perhaps even only) been tested with an
upstream Linux kernel. Equally, our downstream kernels have mostly
only been tested with downstream fastboot, and partially with
downstream U-Boot. The upshot of this is that downstream kernels
incorrectly assume that the bootloader initializes a lot more stuff
(e.g. clocks). You will likely have much more luck booting an upstream
kernel, at least initially in order to get the process working.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-24 15:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-24 13:32 Linux hangs on Tegra 2 / U-Boot board Nuno Santos
     [not found] ` <loom.20120724T152735-115-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
2012-07-24 14:05   ` Thierry Reding
     [not found]     ` <20120724140547.GA27999-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-07-24 15:59       ` Stephen Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.