SabreSD Kernel Not booting from TFTP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SabreSD Kernel Not booting from TFTP

4,260 Views
makislivadas
Contributor IV

Have iMX6q SabreSD board, that boots OK from SD card to Android.

I build basic Linux Kernel (minimal profile) and setup TFTP on the board.

I am using u-boot from Android SD card to boot Kernel via TFTP with NFS root file system.

TFTP is OK, as tftpboot will load the kernel to memory. When I use bootm to boot the kernel image the kernel boot will start but will fail very quickly and reboot the board. I tried a few kernel arguments by setting the bootargs environment variable in u-boot but did not have any success. I also tried to boot the kernel binary supplied by Freescale and it fails in the same way.

Any tips on how to do this? Setting bootargs looks tricky and there seems to be to many options to choose from which can be prone to error.

Labels (1)
12 Replies

2,074 Views
PaulDeMetrotion
Senior Contributor I

Can you provide some details on how you set up the TFTP server. When I attempt to read the uImage across the network, the file is never found. It appears to be trying continuously.

U-Boot > run bootcmd_net

PHY indentify @ 0x7 = 0x00221621

FEC: Link is Up 796d

Using FEC0 device

TFTP from server 192.168.1.101; our IP address is 192.168.1.103

Filename 'uImage'.

Load address: 0x10800000

Loading: T T T T T T T T T T T T

Thanks!

0 Kudos

2,074 Views
makislivadas
Contributor IV

I use something like this on the host Ubuntu machine to set nfs and tftp

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

For NFS, Edit /etc/exports

/home/<uid>/ltib/rootfs *(rw,no_root_squash)

Install tftpd-hpa

sudo apt-get install tftpd-hpa

Install nfs-kernel-server

sudo apt-get install nfs-kernel-server

Then:

Edit the file:

# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"

Then run the services: (start_services.sh)

sudo service tftpd-hpa restart

sudo /etc/init.d/nfs-kernel-server restart

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

You can find numerous examples that show how to set up these.

In your case I woudl try to make sure your u-boot sees the server at all.

try to ping it

ping 192.168.1.101

It should say if it is alive or not. However I found this not alway reliable on sabre board.

In your case is possible that the tftp server is not started on the host, in which case it will try forever. Also make sure you put uImage in

TFTP_DIRECTORY="/tftpboot"

However you can point the directory ro point to where ltib build uImage so you don't have to copy the uImage file to TFTP_DIRECTORY each time you build the kernel.


0 Kudos

2,074 Views
joanxie
NXP TechSupport
NXP TechSupport

could you try to print your bootup error message and uboot commands? let's check it. how did you set your uboot command for booting from tftp?

on my side, I can boot up the board using tftp, I tried the ubuntu image.

the steps are:

1)set up the host 2) restart the tftp and nfs 3) put the image to /tftpboot/, 4) set the uboot command  4) run the bootcmd_net

0 Kudos

2,074 Views
makislivadas
Contributor IV

Thanks you for your reply. I cannot try this untlil tuesday but will use your suggestion "run bootcmd_net" instead of what I am doing and see how is goiing.

0 Kudos

2,074 Views
makislivadas
Contributor IV

Hi I set bootargs like in the trace below.

Then use "tftp uImage" to load kernel to RAM

Then use "bootm" to boot kernel.

Loading pre-build kernel image fails same.

The kernel will start booting but fails early on reseting the board. Console output is as follows:

======================================

bootargs=ip=192.168.42.30:192.168.42.1:0.0.0.0:255.255.255.0 console=ttymxc0,115200 root=nfs nfsroot=192.168.42.1:/home/makis/imx6/ltib/rootfs

Environment size: 617/8188 bytes
MX6Q SABRESD U-Boot > tftp uImage
FEC: Link is Up 796d
Using FEC0 device
TFTP from server 192.168.42.1; our IP address is 192.168.42.30
Filename 'uImage'.
Load address: 0x10800000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###
done
Bytes transferred = 3851168 (3ac3a0 hex)
MX6Q SABRESD U-Boot > bootm
## Booting kernel from Legacy Image at 10800000 ...
   Image Name:   Linux-3.0.35-2310-gc27cb38
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3851104 Bytes =  3.7 MB
   Load Address: 10008000
   Entry Point:  10008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 3.0.35-2310-gc27cb38 (makis@makis-virtual-machine) (gcc version 4.6.2 20110630 (prerelease) (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20) ) #3 SMP PREEMPT Tue Jun 11 17:40:54 BST 2013
CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: Freescale i.MX 6Quad/DualLite/Solo Sabre-SD Board
Ignoring unrecognised tag 0x54410008
Memory policy: ECC disabled, Data cache writealloc
CPU identified as i.MX6Q, silicon rev 1.2
PERCPU: Embedded 7 pages/cpu @8c008000 s5440 r8192 d15040 u32768
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 227328
Kernel command line: ip=192.168.42.30:192.168.42.1:0.0.0.0:255.255.255.0 console=ttymxc0,115200 root=nfs nfsroot=192.168.42.1:/home/makis/imx6/ltib/rootfs
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 640MB 256MB = 896MB total
Memory: 896880k/896880k available, 151696k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xf4600000 - 0xffe00000   ( 184 MB)
    vmalloc : 0xc0800000 - 0xf2000000   ( 792 MB)
    lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
    pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
    modules : 0x7f000000 - 0x7fe00000   (  14 MB)
      .init : 0x80008000 - 0x8003b000   ( 204 kB)
      .text : 0x8003b000 - 0x80a886d0   (10550 kB)
      .data : 0x80a8a000 - 0x80ae8a40   ( 379 kB)
       .bss : 0x80ae8a64 - 0x80b368ec   ( 312 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
Preemptible hierarchical RCU implementation.
NR_IRQS:496
MXC GPIO hardware
sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 1431655ms
arm_max_freq=2
MXC_Early serial console at MMIO 0x2020000 (options '115200')
bootconsole [ttymxc0] enabled
Console: colour dummy device 80x30
Calibrating delay loop... 1581.05 BogoMIPS (lpj=7905280)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
CPU1: Booted secondary processor
CPU2: Booted secondary processor
CPU3: Booted secondary processor
Brought up 4 CPUs
SMP: Total of 4 processors activated (6324.22 BogoMIPS).
print_constraints: dummy:
NET: Registered protocol family 16
print_constraints: vddpu: 725 <--> 1300 mV at 700 mV fast normal
print_constraints: vddcore: 725 <--> 1300 mV at 1150 mV fast normal
print_constraints: vddsoc: 725 <--> 1300 mV at 1200 mV fast normal
print_constraints: vdd2p5: 2000 <--> 2775 mV at 2400 mV fast normal
print_constraints: vdd1p1: 800 <--> 1400 mV at 1100 mV fast normal
print_constraints: vdd3p0: 2625 <--> 3400 mV at 3000 mV fast normal

<<<<<<<<- Here is where it resets?


U-Boot 2009.08 (Apr 10 2013 - 18:58:57)

CPU: Freescale i.MX6 family TO1.2 at 792 MHz
Temperature:   44 C, calibration data 0x5ae50f7d
mx6q pll1: 792MHz
mx6q pll2: 528MHz
mx6q pll3: 480MHz
mx6q pll8: 50MHz
ipg clock     : 66000000Hz
ipg per clock : 66000000Hz
uart clock    : 80000000Hz
cspi clock    : 60000000Hz
ahb clock     : 132000000Hz
axi clock   : 264000000Hz
emi_slow clock: 29333333Hz
ddr clock     : 528000000Hz
usdhc1 clock  : 198000000Hz
usdhc2 clock  : 198000000Hz
usdhc3 clock  : 198000000Hz
usdhc4 clock  : 198000000Hz
nfc clock     : 24000000Hz
Board: i.MX6Q-SABRESD: unknown-board Board: 0x63012 [POR ]
Boot Device: SD
I2C:   ready
DRAM:   1 GB
MMC:   FSL_USDHC: 0,FSL_USDHC: 1,FSL_USDHC: 2,FSL_USDHC: 3
In:    serial
Out:   serial
Err:   serial
Found PFUZE100! deviceid=10,revid=11
Net:   got MAC address from IIM: 00:04:9f:02:af:8b
FEC0 [PRIME]
Hit any key to stop autoboot:  0
MX6Q SABRESD U-Boot >

===============================

0 Kudos

2,074 Views
joanxie
NXP TechSupport
NXP TechSupport

HI,

Refer to your kernel comman:ip=192.168.42.30:192.168.42.1:0.0.0.0:255.255.255.0 console=ttymxc0,115200 root=nfs nfsroot=192.168.42.1:/home/makis/imx6/ltib/rootfs

it seems doesn't correct, pls dont add ip address before the console.

I send to you my kernel command, hope helpful:

bootcmd_net=run bootargs_base bootargs_nfs; tftpboot ${loaddaddr} ${kernel}; bootm

bootargs_nfs=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp video=mxcfb0:dev=ldb, LDB-XGA, if=RGB666 ldb=sin1 nfsroot=${serverip}:${nfsroot},v3,tcp

2,074 Views
makislivadas
Contributor IV

Cheers thanks. I tried to not use at all ip and it will die in the same way. The kernel resets well before it has time to use the ip information.

I did some debugging of the kernel and it seems that it dies when the following IOMUX_PAD is enabled:

#define _MX6Q_PAD_GPIO_1__WDOG2_WDOG_B                  \
                IOMUX_PAD(0x05F4, 0x0224, 1, 0x0000, 0, 0)
Now looking at the schematics of my SabreSD board it appears that the GPIO_1 pin that implements the WDOG2 is connected to the PowerON pin which sort of explains why to board reboots. By removing this IOMUX_PAD entry from the pad list bellow:

static iomux_v3_cfg_t mx6q_sabresd_pads[] = {
        /* AUDMUX */
        MX6Q_PAD_CSI0_DAT4__AUDMUX_AUD3_TXC,
        MX6Q_PAD_CSI0_DAT5__AUDMUX_AUD3_TXD,
        MX6Q_PAD_CSI0_DAT6__AUDMUX_AUD3_TXFS,
        MX6Q_PAD_CSI0_DAT7__AUDMUX_AUD3_RXD,

        /* CAN1  */
        MX6Q_PAD_KEY_ROW2__HDMI_TX_CEC_LINE,
        /* MX6Q_PAD_KEY_COL2__CAN1_TXCAN, */
        MX6Q_PAD_GPIO_1__WDOG2_WDOG_B,          /*WDOG_B to reset pmic*/  <<--- removing or commenting out stops resetting the board
        MX6Q_PAD_GPIO_2__GPIO_1_2,              /* user defined red led */
        MX6Q_PAD_GPIO_7__GPIO_1_7,              /* NERR */

............

The kernel will try to go further and it dies eventually again but from unrelated problem I suspect.

My question is if this finding is true why freescale will build kernel with default configuration that is not working out of the box? I also tried to download pre-build kernel binaries from here and they seem to die same way as the one I build.

0 Kudos

2,074 Views
foosechek
NXP Employee
NXP Employee

Hi Makis,

I am seeing this same failure with a SabreSDB, but not on all boards. I'm hoping to narrow it down to specific board revisions. Can you please post what your SCH and 700 revision numbers are, and confirm that we are testing with the same kernel. 

Details :

Using the kernel from the demo image L3.0.35_4.0.0_130424_images_MX6

md5sum : b9d2eccea53f0cac7d12dc1a09cfb0df  uImage

board #1

     SabreSDB SCH-27516 Rev C1, 700-27516 Rev A

     SD boot (SW6 01000010), Slot SD3

     result : full boot, no issues.

board #2

     SabreSDP SCH-27392 Rev C4, 700-27392 Rev B

     SB boot (SW6 01000010), Slot SD3

     result: full boot, no issues

board #3

     SabreSDB SCH-27516 Rev C2, 700-27516 Rev A

     SB boot (SW6 01000010), Slot SD3

     result: boot reboots during print_constraints as you've shown

     modified WDOG2 IOMUX setting allows board to continue boot.

Thanks,

-Ben

0 Kudos

2,074 Views
sinanakman
Senior Contributor III

Ben, can you please send me the schematics for SCH-27516 Rev C2, 700-27516 Rev A. We are seeing the same problem. Thanks

0 Kudos

2,074 Views
makislivadas
Contributor IV

Hi,

If it helps you, I found the following behaviour.

Original problem was showing up when Linux kernel was booted using u-boot from the Android SD card labeled:

Android 13.4.1

110-77478 C

When I do "v" on uboot command line I get version:

U-Boot 2009.08 (Apr 10 2013 - 18:58:57)

I reprogrammed another SD card with the Linux Image from freescale site which has a different u-boot

When I do "v" on uboot command line I get version:

U-Boot 2009.08 (Apr 25 2013 - 01:17:52)

Linux image will then boot without any issues. I am guessing that the PADs can be modified within u-boot causig the kernel to boot normally!

Makis

2,074 Views
makislivadas
Contributor IV

Hi Ben,

Thank you for your reply.

Won't be able to check this one until tuesday (25 June) but will let you know.

It does look from what you saying that I have one of those boards though.(board3)

Regards,

Makis

0 Kudos

2,074 Views
makislivadas
Contributor IV

Hi Ben,

Here is the numbers:

SCH-27392 REV C3       700-27392 REV B

This is similar to Board#2 appart of C3 which is C4 on the board you mentioned.

However, my board exhibits the problem whereas the one you mentioned is OK.

In the mean time I managed to fully boot linux from NFS with the modified code and modified configuration as follows:

U-Boot 2009.08 (Apr 10 2013 - 18:58:57)

CPU: Freescale i.MX6 family TO1.2 at 792 MHz
Temperature:   34 C, calibration data 0x5ae50f7d
mx6q pll1: 792MHz
mx6q pll2: 528MHz
mx6q pll3: 480MHz
mx6q pll8: 50MHz
ipg clock     : 66000000Hz
ipg per clock : 66000000Hz
uart clock    : 80000000Hz
cspi clock    : 60000000Hz
ahb clock     : 132000000Hz
axi clock   : 264000000Hz
emi_slow clock: 29333333Hz
ddr clock     : 528000000Hz
usdhc1 clock  : 198000000Hz
usdhc2 clock  : 198000000Hz
usdhc3 clock  : 198000000Hz
usdhc4 clock  : 198000000Hz
nfc clock     : 24000000Hz
Board: i.MX6Q-SABRESD: unknown-board Board: 0x63012 [POR ]
Boot Device: SD
I2C:   ready
DRAM:   1 GB
MMC:   FSL_USDHC: 0,FSL_USDHC: 1,FSL_USDHC: 2,FSL_USDHC: 3
In:    serial
Out:   serial
Err:   serial
Found PFUZE100! deviceid=10,revid=11
Net:   got MAC address from IIM: 00:04:9f:02:af:8b
FEC0 [PRIME]
Hit any key to stop autoboot:  0
MX6Q SABRESD U-Boot > pri
baudrate=115200
loadaddr=0x10800000
rd_loadaddr=0x11000000
netdev=eth0
ethprime=FEC0
fastboot_dev=mmc3
splashimage=0x30000000
splashpos=m,m
lvds_num=1
ethact=FEC0
bootdelay=6
kernel=uImage
bootcmd=booti mmc2
gateawayip=0.0.0.0
filesize=3AE998
fileaddr=10800000
netmask=255.255.255.0
ipaddr=192.168.42.30
serverip=192.168.42.1
boot_base=console=ttymxc0,115200
base_roots=/home/makis/imx6/ltib/rootfs
base_nfs=root=/dev/nfs ip=192.168.42.30 nfsroot=192.168.42.1:/home/makis/imx6/ltib/rootfs,v3,tcp
bootargs=console=ttymxc0,115200 root=/dev/nfs ip=192.168.42.30 nfsroot=192.168.42.1:/home/makis/imx6/ltib/rootfs,v3,tcp
stdin=serial
stdout=serial
stderr=serial

Then using:

tftp uImage

and

bootm

got me to the free scale login screen.

As my board now seem to boot to linux, I assume is OK to use modified WDOG2 IOMUX setting to carry on with my work?

0 Kudos