cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mashman
Adventurer
Adventurer
7,618 Views
Registered: ‎11-11-2015

U-Boot - not booting from sdcard immediately

Jump to solution

Petalinux 2016.4, when I boot I see the message 'BOOTP broadcast n', for about 20 seconds before finally my system boots from the SDCard as expected.

I'd like to set U-boot up to immediately boot from the sdcard.

I modified the file meta-plnx-generated/recipes-bsp/u-boot/configs/platform-auto.h, I changed CONFIG_BOOTCOMMAND to "run sdboot"

I added #define CONFIG_BOOTDELAY 0

 

What do I need to do to have u-boot immediately boot from the sdcard rather than attempt a tftpboot?

0 Kudos
Reply
1 Solution

Accepted Solutions
vanmierlo
Mentor
Mentor
10,637 Views
Registered: ‎06-10-2008

Hello,

 

I usually use this for platform-top.h to speed up U-boot:

#include <configs/platform-auto.h>

#ifdef CONFIG_BOOTDELAY
#undef CONFIG_BOOTDELAY
#endif
#define CONFIG_BOOTDELAY        0

#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
#undef CONFIG_ENV_IS_IN_SPI_FLASH
#endif
#define CONFIG_ENV_IS_NOWHERE

#undef CONFIG_NETCONSOLE
#undef CONFIG_CMD_DHCP
#undef CONFIG_CMD_MII
#undef CONFIG_CMD_NET
#undef CONFIG_CMD_PING
#undef CONFIG_CMD_NFS

/* PREBOOT */
#ifdef CONFIG_PREBOOT
#undef CONFIG_PREBOOT
#endif
#define CONFIG_PREBOOT  "echo U-BOOT for ${hostname};setenv preboot; echo no-net"

View solution in original post

0 Kudos
Reply
11 Replies
mashman
Adventurer
Adventurer
7,617 Views
Registered: ‎11-11-2015

I also set the 'autoload' to "yes" and that did not work either.

0 Kudos
Reply
hpoetzl
Voyager
Voyager
7,598 Views
Registered: ‎06-24-2013

Hey @mashman,

 

Depending on the (development) board and device you are using, there are configuration pins (or jumpers) which select the 'boot mode' of the FPGA. Make sure those are set to SDBOOT.

 

Hope this helps,

Herbert

-------------- Yes, I do this for fun!
mashman
Adventurer
Adventurer
7,571 Views
Registered: ‎11-11-2015

Herbert,

Thanks for your reply. Yes the board is setup correctly, I've had this board running for a while now under and older version of PetaLinux and have recently upgraded to 2016.4. After the upgrade the board still boots from the sdcard but it's just that u-boot attempts to do a tftpboot first and it takes an extra 20 seconds or so to boot.  Before the upgrade to 2016.4 the board would immediately boot from sdcard.

So I know there is a u-boot command or config setting to tell it to boot from the sdcard immediately but I can't quite figure it out.

0 Kudos
Reply
hpoetzl
Voyager
Voyager
7,560 Views
Registered: ‎06-24-2013

Hey @mashman,

 

Before the upgrade to 2016.4 the board would immediately boot from sdcard.

I wouldn't jump to conclusions here, it could just have 'skipped' the TFTP boot for whatever reason before.

 

Let's start with the simple stuff like, what board is it? what does the boot log show?

 

Thanks,

Herbert

-------------- Yes, I do this for fun!
mashman
Adventurer
Adventurer
7,517 Views
Registered: ‎11-11-2015

Hi @hpoetzl,

This is a custom board using the Zynq 7020, for a few years we have been using a PetaLinux version from 2014 and I am in the process of upgrading to 2016.4

Here is the text from the U-Boot sequence...you can see that it attempts the bootp connection multiple times before timing out and booting from the sdcard. I'd like to immediately boot from the sdcard

 

I've also attached the petaLinux platform-auto.h file which is what is used to configure u-boot settings. I've made some mods to this file such as setting the autoload = yes, and the config_bootcommand to 'run sdboot', neither got rid of the bootp messages.

 

 

U-Boot 2016.07 (Aug 07 2017 - 13:24:59 -0400)

DRAM:  ECC disabled 1 GiB
MMC:   sdhci@e0100000: 0
SF: Unsupported flash IDs: manuf 00, jedec 0000, ext_jedec 0000
*** Warning - spi_flash_probe() failed, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ZYNQ GEM: e000b000, phyaddr 7, interface rgmii-id
eth0: ethernet@e000b000
U-BOOT for

ethernet@e000b000 Waiting for PHY auto negotiation to complete....... done
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17

Retry time exceeded
Hit any key to stop autoboot:  0
Device: sdhci@e0100000
Manufacturer ID: 28
OEM: 4245
Name:
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.5 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading image.ub
98535256 bytes read in 8166 ms (11.5 MiB/s)
## Loading kernel from FIT Image at 10000000 ...
   Using 'conf@1' configuration
   Verifying Hash Integrity ... OK
   Trying 'kernel@0' kernel subimage
     Description:  Linux Kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x100000d4
     Data Size:    3560440 Bytes = 3.4 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x00008000
     Entry Point:  0x00008000
     Hash algo:    sha1
     Hash value:   c27717fe5ba33671729539284eea52115bc15009
   Verifying Hash Integrity ... sha1+ OK
## Loading ramdisk from FIT Image at 10000000 ...
   Using 'conf@1' configuration
   Trying 'ramdisk@0' ramdisk subimage
     Description:  ramdisk
     Type:         RAMDisk Image
     Compression:  uncompressed
     Data Start:   0x10369164
     Data Size:    94958081 Bytes = 90.6 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: unavailable
     Entry Point:  unavailable
     Hash algo:    sha1
     Hash value:   3fb2a8e3b16d12e79c03c73a53dfdcd07da0f762
   Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 10000000 ...
   Using 'conf@1' configuration
   Trying 'fdt@0' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x103655c0
     Data Size:    15090 Bytes = 14.7 KiB
     Architecture: ARM
     Hash algo:    sha1
     Hash value:   6b6ee17ef43c8ecc0452dcc491b6cfae572828b4
   Verifying Hash Integrity ... sha1+ OK
   Booting using the fdt blob at 0x103655c0
   Loading Kernel Image ... OK
   Loading Ramdisk to 02570000, end 07fff201 ... OK
   Loading Device Tree to 02569000, end 0256faf1 ... OK

Starting kernel ...

0 Kudos
Reply
hpoetzl
Voyager
Voyager
7,512 Views
Registered: ‎06-24-2013

Hey @mashman,

 

What are the mode pins (M0,M1 and M2) tied to in your custom board?

What is the u-boot environment when you interrupt the boot (printenv)?

 

Thanks in advance,

Herbert

-------------- Yes, I do this for fun!
mashman
Adventurer
Adventurer
7,503 Views
Registered: ‎11-11-2015

@hpoetzl

It looks like in my previous build one of my environment vars did not take, I set them all again in my header file and I no longer see the bootp statements during the u-boot bootup.

Here is my latest boot screen, this cuts about 20 seconds off of my boot process which is great. I think I should be all set. Thanks so much for all of your help.

 

 

 

U-Boot 2016.07 (Aug 16 2017 - 08:30:48 -0400)

DRAM:  ECC disabled 1 GiB
MMC:   sdhci@e0100000: 0
SF: Unsupported flash IDs: manuf 00, jedec 0000, ext_jedec 0000
*** Warning - spi_flash_probe() failed, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ZYNQ GEM: e000b000, phyaddr 7, interface rgmii-id
eth0: ethernet@e000b000
U-BOOT for

ethernet@e000b000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Hit any key to stop autoboot:  0
boot Petalinux
syntax error
Device: sdhci@e0100000
Manufacturer ID: 28
OEM: 4245
Name:
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.5 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading image.ub
98960020 bytes read in 8200 ms (11.5 MiB/s)
## Loading kernel from FIT Image at 10000000 ...
   Using 'conf@1' configuration
   Verifying Hash Integrity ... OK
   Trying 'kernel@0' kernel subimage
     Description:  Linux Kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x100000d4
     Data Size:    3560440 Bytes = 3.4 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x00008000
     Entry Point:  0x00008000
     Hash algo:    sha1
     Hash value:   42f8a145f109559a1c9908209144d5cb84c40d58
   Verifying Hash Integrity ... sha1+ OK
## Loading ramdisk from FIT Image at 10000000 ...
   Using 'conf@1' configuration
   Trying 'ramdisk@0' ramdisk subimage
     Description:  ramdisk
     Type:         RAMDisk Image
     Compression:  uncompressed
     Data Start:   0x10369164
     Data Size:    95382845 Bytes = 91 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: unavailable
     Entry Point:  unavailable
     Hash algo:    sha1
     Hash value:   ed23384d72780e2a236cf4bee219a150ccd475a7
   Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 10000000 ...
   Using 'conf@1' configuration
   Trying 'fdt@0' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x103655c0
     Data Size:    15090 Bytes = 14.7 KiB
     Architecture: ARM
     Hash algo:    sha1
     Hash value:   6b6ee17ef43c8ecc0452dcc491b6cfae572828b4
   Verifying Hash Integrity ... sha1+ OK
   Booting using the fdt blob at 0x103655c0
   Loading Kernel Image ... OK
   Loading Ramdisk to 02509000, end 07fffd3d ... OK
   Loading Device Tree to 02502000, end 02508af1 ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.6.0-xilinx (instron@localhost.localdomain) (gcc version 5.2.1 20151005 (Linaro GCC 5.2-2015.11-2) ) #1 SMP PREEMPT Wed Aug 16 08:25:46 EDT 2017
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Ave2_peta
cma: Reserved 16 MiB at 0x3f000000
Memory policy: Data cache writealloc
percpu: Embedded 12 pages/cpu @ef7d3000 s19776 r8192 d21184 u49152
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260608
Kernel command line:
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: 921228K/1048576K available (5276K kernel code, 204K rwdata, 1672K rodata, 1024K init, 218K bss, 110964K reserved, 16384K cma-reserved, 245760K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
    lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc07c93b8   (7941 kB)
      .init : 0xc0800000 - 0xc0900000   (1024 kB)
      .data : 0xc0900000 - 0xc0933360   ( 205 kB)
       .bss : 0xc0933360 - 0xc0969f24   ( 219 kB)
Preemptible hierarchical RCU implementation.
        Build-time adjustment of leaf fanout to 32.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
efuse mapped to f0800000
slcr mapped to f0802000
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
zynq_clock_init: clkc starts at f0802100
Zynq clock init
sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af025, max_idle_ns: 440795209040 ns
Switching to timer-based delay loop, resolution 3ns
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
timer #0 at f080a000, irq=17
Console: colour dummy device 80x30
console [tty0] enabled
Calibrating delay loop (skipped), value calculated using timer frequency.. 666.66 BogoMIPS (lpj=3333333)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100058
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (1333.33 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xf0880000
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
vgaarb: loaded
SCSI subsystem initialized
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 93148K (c2509000 - c8000000)
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
workingset: timestamp_bits=28 max_order=18 bucket_order=0
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
bounce: pool size: 64 pages
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac:        DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
xilinx-vdma 40004000.dma: unable to request IRQ 0
xilinx-vdma 40004000.dma: Xilinx AXI VDMA Engine Driver Probed!!
e0000000.serial: ttyPS1 at MMIO 0xe0000000 (irq = 144, base_baud = 3125000) is a xuartps
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 145, base_baud = 3125000) is a xuartps
console [ttyPS0] enabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to f0872000
[drm] Initialized drm 1.1.0 20060810
brd: module loaded
loop: module loaded
m25p80 spi0.0: SPI transfer timed out
m25p80 spi0.0: error -110 reading 9f
m25p80: probe of spi0.0 failed with error -110
CAN device driver interface
gpiod_set_value: invalid GPIO
libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 147 (00:0a:35:00:1e:53)
Marvell 88E1116R e000b000.etherne:07: attached PHY driver [Marvell 88E1116R] (mii_bus:phy_addr=e000b000.etherne:07, irq=-1)
e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
cdns-i2c e0005000.i2c: 400 kHz mmio e0005000 irq 141
EDAC MC: ECC not enabled
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using DMA
ledtrig-cpu: registered to indicate activity on CPUs
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
Registering SWP/SWPB emulation handler
hctosys: unable to open rtc device (rtc0)
ALSA device list:
  No soundcards found.
Freeing unused kernel memory: 1024K (c0800000 - c0900000)
mmc0: new high speed SDHC card at address b368
INIT: mmcblk0: mmc0:b368       7.46 GiB
 mmcblk0: p1
version 2.88 booting
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
random: dd urandom read with 2 bits of entropy available
Thu Aug 17 16:50:51 UTC 2017
Starting internet superserver: inetd.
INIT: Entering runlevel: 5
Configuring network interfaces... IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
done.
Starting system message bus: dbus.
Starting Dropbear SSH server: Generating key, this may take a while...
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDloMUotBvdhAxbYh6an3QM8lOWkFO4nfq2M8nyQnKjVgtD1yUWl5zc0FP6bZo0OeoylJ27puJGw/KI8XYn+fZlGQSVIuuQjCWgMa44stujo/h99moDiyEo0dwnp2ubZWxpY4WyutLgQzMy/56gJAdYYHwEyTSNtboqPfGtXpy8o146Cvf8otH9Lc+H+Rdou54QnuQbu17dwyOd4zxeQWEKYXYbdRLZUCapBjfZo+VbDGBLF+s4OfllzfmAX3TI2FbXERgaocZVXdvZuyBWLM22S5D8sscFQKMeRR+zYxk7JVHtnbBUtxebwZHdsxosuUZWSx4GzotnlhxABbItojnN root@plnx_arm
Fingerprint: md5 e2:e1:0b:1b:1b:e6:8a:ef:a8:0c:05:91:9d:74:01:27
dropbear.
Starting syslogd/klogd: done
RUNNING AVE STARTUP
++ echo 2.1.0
++ mount /dev/mmcblk0p1 /mnt
++ cp /mnt/AveServer.elf /tmp/AveServer.elf
++ cd /tmp
++ umount /mnt
Starting tcf-agent: OK

PetaLinux 2016.4 plnx_arm /dev/ttyPS0

plnx_arm login:

0 Kudos
Reply
hpoetzl
Voyager
Voyager
7,501 Views
Registered: ‎06-24-2013

You're welcome!

Glad it could be resolved!

 

All the best,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
Reply
vanmierlo
Mentor
Mentor
10,638 Views
Registered: ‎06-10-2008

Hello,

 

I usually use this for platform-top.h to speed up U-boot:

#include <configs/platform-auto.h>

#ifdef CONFIG_BOOTDELAY
#undef CONFIG_BOOTDELAY
#endif
#define CONFIG_BOOTDELAY        0

#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
#undef CONFIG_ENV_IS_IN_SPI_FLASH
#endif
#define CONFIG_ENV_IS_NOWHERE

#undef CONFIG_NETCONSOLE
#undef CONFIG_CMD_DHCP
#undef CONFIG_CMD_MII
#undef CONFIG_CMD_NET
#undef CONFIG_CMD_PING
#undef CONFIG_CMD_NFS

/* PREBOOT */
#ifdef CONFIG_PREBOOT
#undef CONFIG_PREBOOT
#endif
#define CONFIG_PREBOOT  "echo U-BOOT for ${hostname};setenv preboot; echo no-net"

View solution in original post

0 Kudos
Reply
mashman
Adventurer
Adventurer
4,368 Views
Registered: ‎11-11-2015

@vanmierlo,

This was great, Thank you! Recently my previous changes were not working and my board went back to attempting the network boot first. Your platform-top.h fixed it.

Thanks!

0 Kudos
Reply
vanmierlo
Mentor
Mentor
4,048 Views
Registered: ‎06-10-2008

Unfortunately this no longer works for petalinux 2017.x. As soon as you make any modification to u-boot it fails to build. So if anyone knows how one is supposed to configure u-boot with a more recent version of petalinux than 2016.4, pray explain.

0 Kudos
Reply