News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

TE0720 QSPI programming after booting from SD-Card

Started by bigguiness, September 11, 2023, 05:37:01 PM

Previous topic - Next topic

bigguiness

Hello all,

I am using a TE0720 on a custom carrier board.

I am currently using Vivado v2020.2 for the FGPA development and Petalinux is creating a 5.4.0-xilinx-v2020.2 kernel and rooftfs.
With that, I have a (mostly) working system that boots from a SD-card.

I know need to work out how to boot the system from QSPI with the rootfs in the eMMC.

Right now my SD-card has 2 partitions on it. The 1st partition is vfat and has the BOOT.BIN, boot.scr, and image.ub files on it. The 2nd partition is ext4 and has the rootfs.

When the board boots I see the QSPI is detected and has these partitions:

spi-nor spi0.0: s25fl256s1 (32768 Kbytes)
5 fixed-partitions partitions found on MTD device spi0.0
Creating 5 MTD partitions on "spi0.0":
0x000000000000-0x000000500000 : "boot"
0x000000500000-0x000000520000 : "bootenv"
0x000000520000-0x000001920000 : "kernel"
0x000001920000-0x000001960000 : "bootscr"
0x000001960000-0x000002000000 : "spare"

After booting the system from the SD-card, can I simply copy the boot files to the QSPI like this:

# flashcp /media/sd-mmcblk0p1/BOOT.BIN /dev/mtd0
# flashcp /media/sd-mmcblk0p1/image.ub /dev/mtd2
# flashcp /media/sd-mmcblk0p1/boot.scr /dev/mtd3

Then change the bootmode switches to boot from the QSPI?

What about the rootfs? Is there an easy way to transfer/create the rootfs on the eMMC?

Thanks for any help!

bigguiness

Well... some progress...

I booted the system from the SD-Card and then did:

# flashcp /media/sd-mmcblk0p1/BOOT.BIN /dev/mtd0
# flashcp /media/sd-mmcblk0p1/image.ub /dev/mtd2
# flashcp /media/sd-mmcblk0p1/boot.scr /dev/mtd3


I then powered down and changed the bootmode switches to boot from QSPI.

When I powered on it did boot u-boot but was not able to find and boot the kernel. I forgot to copy the console messages.

I then rebooted from the SD-Card and created 2 partitions on the eMMC. A 1G boot partition and the remainder for the rootfs (~2.7G).

I formatted the 1G partition as vfat and the 2nd partition as ext4:

# mkfs.vfat -F 32 -n boot /dev/mmcblk1p1
# mkfs.ext4 -L root /dev/mmcblk1p2


I then rebooted and the new partitions were found and mounted (relevant parts of boot shown):

mmc0: new high speed SDXC card at address 59b4
mmcblk0: mmc0:59b4 USD00 58.9 GiB
mmcblk0: p1 p2
EXT4-fs (mmcblk0p2): recovery complete
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
mmc1: new high speed MMC card at address 0001
mmcblk1: mmc1:0001 H4G2a 3.64 GiB
mmcblk1boot0: mmc1:0001 H4G2a partition 1 4.00 MiB
mmcblk1boot1: mmc1:0001 H4G2a partition 2 4.00 MiB
mmcblk1rpmb: mmc1:0001 H4G2a partition 3 4.00 MiB, chardev (245:0)
mmcblk1: p1 p2

# mount | grep mmc
/dev/mmcblk0p2 on / type ext4 (rw,relatime)
/dev/mmcblk0p2 on /media/sd-mmcblk0p2 type ext4 (rw,relatime)
/dev/mmcblk0p1 on /media/sd-mmcblk0p1 type vfat (rw,relatime,gid=100,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/mmcblk1p1 on /media/sd-mmcblk1p1 type vfat (rw,relatime,gid=100,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/mmcblk1p2 on /media/sd-mmcblk1p2 type ext4 (rw,relatime)


So I copied the boot files from the SD-Card to the eMMC boot partition:
# cp /media/sd-mmcblk1p1 /media/sd-mmcblk2p1

I had put the rootfs.tar.gz used to create the SD-Card rootfs on the boot partition. So I used that to create the rootfs on the eMMC:
# tar xf /media/sd-mmcblk1p1 -C /media/sd-mmcblk2p2

A ls of the eMMC partitions _look_ right so I powered off again and switched to QSPI boot. Booting then gives me this:

--------------------------------------------------------------------------------
Xilinx First Stage Boot Loader (TE modified)
Release 2020.2  Feb 15 2023-20:07:04

Device IDCODE: 23727093
Device Name: 7z020 (7)
Device Revision: 2
--------------------------------------------------------------------------------
TE0720 TE_FsblHookBeforeHandoff_Custom

SoM: TE0720-03-1C  F SC REV:05
MAC: D8 80 39 DE 31 20

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


U-Boot 2020.01 (Aug 17 2023 - 15:51:31 +0000)

CPU:   Zynq 7z020
Silicon: v3.1
Model: xxxxxxxxxxxxxxxxx
DRAM:  ECC disabled 1 GiB
Flash: 0 Bytes
NAND:  0 MiB
MMC:   mmc@e0100000: 0, mmc@e0101000: 1
In:    serial@e0000000
Out:   serial@e0000000
Err:   serial@e0000000
Net:   
ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr 0, interface rgmii-id

Warning: ethernet@e000b000 using MAC address from DT
eth0: ethernet@e000b000
ZYNQ GEM: e000c000, mdio bus e000c000, phyaddr 1, interface gmii

Warning: ethernet@e000c000 using MAC address from DT
, eth1: ethernet@e000c000
U-BOOT for petalinux
importing env from FSBL shared area at 0xFFFFFC00
Found valid magic
## Info: input data size = 27 = 0x1B

Hit any key to stop autoboot:  0
SF: Detected s25fl256s1 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
device 0 offset 0x1920000, size 0x40000
SF: 262144 bytes @ 0x1920000 Read: OK
QSPI: Trying to boot script at 0x3000000
## Executing script at 03000000
SF: Detected s25fl256s1 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
device 0 offset 0x1000000, size 0xf00000
SF: 15728640 bytes @ 0x1000000 Read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!
QSPI: SCRIPT FAILED: continuing...
JTAG: Trying to boot script at 0x3000000
## Executing script at 03000000
SF: Detected s25fl256s1 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
device 0 offset 0x1000000, size 0xf00000
SF: 15728640 bytes @ 0x1000000 Read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!
JTAG: SCRIPT FAILED: continuing...
Card did not respond to voltage select!
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
2010 bytes read in 14 ms (139.6 KiB/s)
## Executing script at 03000000
SF: Detected s25fl256s1 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
device 0 offset 0x1000000, size 0xf00000
SF: 15728640 bytes @ 0x1000000 Read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!
SCRIPT FAILED: continuing...
SF: Detected s25fl256s1 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
device 0 offset 0x1920000, size 0x40000
SF: 262144 bytes @ 0x1920000 Read: OK
QSPI: Trying to boot script at 0x3000000
## Executing script at 03000000
SF: Detected s25fl256s1 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
device 0 offset 0x1000000, size 0xf00000
SF: 15728640 bytes @ 0x1000000 Read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!
QSPI: SCRIPT FAILED: continuing...


no devices available
NAND: SCRIPT FAILED: continuing...
NOR: Trying to boot script at 0x3000000
## Executing script at 03000000
Wrong image format for "source" command
NOR: SCRIPT FAILED: continuing...
starting USB...
Bus usb@e0002000: USB EHCI 1.00
scanning bus usb@e0002000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device

Device 1: unknown device
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 10.168.0.143 (252 ms)
*** ERROR: `serverip' not set
Cannot autoload with TFTPGET
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-d8-80-39-de-31-20
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0AA8008F
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0AA8008
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0AA800
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0AA80
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0AA8
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0AA
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0A
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-zynq-zynq
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-zynq
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
*** ERROR: `serverip' not set
Config file not found
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 10.168.0.143 (252 ms)
*** ERROR: `serverip' not set
Cannot autoload with TFTPGET
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 10.168.0.143 (252 ms)
*** ERROR: `serverip' not set
Cannot autoload with TFTPGET
Zynq>


So, it looks like the boot.src is found on mmc 1:1. But the kernel is not found.

Any ideas?

bigguiness

Interesting...

I looked at the boot.scr and worked out the commands that _should_ be executing to boot from mmc1. So I tried entering them manually after the autoboot failed:

Zynq> fatload mmc 1:1 0x10000000 image.ub
4362552 bytes read in 257 ms (16.2 MiB/s)
Zynq> bootm 0x10000000
## Loading kernel from FIT Image at 10000000 ...
   Using 'conf@system-top.dtb' configuration
   Verifying Hash Integrity ... OK
   Trying 'kernel@1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x100000e8
     Data Size:    4338760 Bytes = 4.1 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x00200000
     Entry Point:  0x00200000
     Hash algo:    sha256
     Hash value:   9d9bac218a568136be57335c08fe51c94472859393b195fc86cb780c2e109335
   Verifying Hash Integrity ... sha256+ OK
## Loading fdt from FIT Image at 10000000 ...
   Using 'conf@system-top.dtb' configuration
   Verifying Hash Integrity ... OK
   Trying 'fdt@system-top.dtb' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x1042363c
     Data Size:    21911 Bytes = 21.4 KiB
     Architecture: ARM
     Hash algo:    sha256
     Hash value:   ae043913b14c133fce081ad8b8b2973648a622354346c91b95df61531e426da5
   Verifying Hash Integrity ... sha256+ OK
   Booting using the fdt blob at 0x1042363c
   Loading Kernel Image
   Loading Device Tree to 1fff7000, end 1ffff596 ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 5.4.0-xilinx-v2020.2 (oe-user@oe-host) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Mon Feb 27 15:10:22 UTC 2023
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: xxxxxxxxxxxxxxxxxxx
earlycon: cdns0 at MMIO 0xe0000000 (options '115200n8')
printk: bootconsole [cdns0] enabled
Memory policy: Data cache writealloc
cma: Reserved 16 MiB at 0x3f000000
percpu: Embedded 15 pages/cpu s31948 r8192 d21300 u61440
Built 1 zonelists, mobility grouping on.  Total pages: 260416
Kernel command line: console=ttyPS0,115200 earlycon root=/dev/mmcblk0p2 rw rootwait
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 1010888K/1048576K available (6144K kernel code, 218K rwdata, 1860K rodata, 1024K init, 132K bss, 21304K reserved, 16384K cma-reserved, 245760K highmem)
rcu: Preemptible hierarchical RCU implementation.
rcu:    RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
        Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
efuse mapped to (ptrval)
slcr mapped to (ptrval)
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
random: get_random_bytes called from start_kernel+0x260/0x440 with crng_init=0
zynq_clock_init: clkc starts at (ptrval)
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
Console: colour dummy device 80x30
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, linear)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: using BPIALL workaround
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100060
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
CPU1: Spectre v2: using BPIALL workaround
smp: Brought up 1 node, 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
futex hash table entries: 512 (order: 3, 32768 bytes, linear)
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 @ 0x(ptrval)
e0000000.serial: ttyPS0 at MMIO 0xe0000000 (irq = 27, base_baud = 6249999) is a xuartps
printk: console [ttyPS0] enabled
printk: console [ttyPS0] enabled
printk: bootconsole [cdns0] disabled
printk: bootconsole [cdns0] disabled
e0001000.serial: ttyPS1 at MMIO 0xe0001000 (irq = 28, base_baud = 6249999) is a xuartps
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
mc: Linux media interface: v0.10
videodev: Linux video capture interface: v2.00
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
FPGA manager framework
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm_global_timer
thermal_sys: Registered thermal governor 'step_wise'
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes, linear)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
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.
PCI: CLS 0 bytes, default 64
hw perfevents: no interrupt-affinity property for /pmu@f8891000, guessing.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
workingset: timestamp_bits=14 max_order=18 bucket_order=4
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
bounce: pool size: 64 pages
io scheduler mq-deadline registered
io scheduler kyber registered
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
GPIO IRQ not connected
XGpio: gpio@41200000: registered, base is 1021
GPIO IRQ not connected
XGpio: gpio@41200000: dual channel registered, base is 1012
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
brd: module loaded
loop: module loaded
spi-nor spi0.0: s25fl256s1 (32768 Kbytes)
5 fixed-partitions partitions found on MTD device spi0.0
Creating 5 MTD partitions on "spi0.0":
0x000000000000-0x000000500000 : "boot"
0x000000500000-0x000000520000 : "bootenv"
0x000000520000-0x000001920000 : "kernel"
0x000001920000-0x000001960000 : "bootscr"
0x000001960000-0x000002000000 : "spare"
libphy: Fixed MDIO Bus: probed
CAN device driver interface
libphy: MACB_mii_bus: probed
Marvell 88E1510 e000b000.ethernet-ffffffff:00: attached PHY driver [Marvell 88E1510] (mii_bus:phy_addr=e000b000.ethernet-ffffffff:00, irq=POLL)
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 30 (d8:80:39:de:31:20)
libphy: MACB_mii_bus: probed
xgmiitorgmii e000c000.ethernet-ffffffff:08: Couldn't find phydev
Marvell 88E1510 e000c000.ethernet-ffffffff:01: attached PHY driver [Marvell 88E1510] (mii_bus:phy_addr=e000c000.ethernet-ffffffff:01, irq=POLL)
macb e000c000.ethernet eth1: Cadence GEM rev 0x00020118 at 0xe000c000 irq 31 (00:0a:35:00:db:b2)
e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
chipidea-usb2 e0002000.usb: e0002000.usb supply vbus not found, using dummy regulator
ULPI transceiver vendor/product ID 0x0424/0x0007
Found SMSC USB3320 ULPI transceiver.
ULPI integrity check: passed.
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
i2c /dev entries driver
cdns-i2c e0004000.i2c: 400 kHz mmio e0004000 irq 23
rtc-isl12022 1-006f: registered as rtc0
cdns-i2c e0005000.i2c: 400 kHz mmio e0005000 irq 24
cdns-wdt f8005000.watchdog: Xilinx Watchdog Timer with timeout 10s
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.mmc [e0100000.mmc] using ADMA
mmc1: SDHCI controller on e0101000.mmc [e0101000.mmc] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
timer #0 at (ptrval), irq=45
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
fpga_manager fpga0: Xilinx Zynq FPGA Manager registered
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20170425 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20170425)
can: broadcast manager protocol (rev 20170425 t)
can: netlink gateway (rev 20190810) max_hops=1
Registering SWP/SWPB emulation handler
of-fpga-region fpga-full: FPGA Region probed
rtc-isl12022 1-006f: setting system clock to 2023-09-12T20:33:23 UTC (1694550803)
of_cfs_init
of_cfs_init: OK
ALSA device list:
  No soundcards found.
Waiting for root device /dev/mmcblk0p2...
mmc1: new high speed MMC card at address 0001
mmcblk1: mmc1:0001 H4G2a 3.64 GiB
mmcblk1boot0: mmc1:0001 H4G2a partition 1 4.00 MiB
mmcblk1boot1: mmc1:0001 H4G2a partition 2 4.00 MiB
mmcblk1rpmb: mmc1:0001 H4G2a partition 3 4.00 MiB, chardev (245:0)
mmcblk1: p1 p2


That works up to loading the rootfs. It looks like the kernel command line must be getting set somehow by Petalinux.

Kernel command line: console=ttyPS0,115200 earlycon root=/dev/mmcblk0p2 rw rootwait

That is causing the boot to hang:

Waiting for root device /dev/mmcblk0p2...

So, why is the boot.scr not working and how to I change the root=?

Thanks


bigguiness

Update. If I stop the autoboot and do this:

--------------------------------------------------------------------------------
Xilinx First Stage Boot Loader (TE modified)
Release 2020.2  Feb 15 2023-20:07:04

Device IDCODE: 23727093
Device Name: 7z020 (7)
Device Revision: 2
--------------------------------------------------------------------------------
TE0720 TE_FsblHookBeforeHandoff_Custom

SoM: TE0720-03-1C  F SC REV:05
MAC: D8 80 39 DE 31 20

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


U-Boot 2020.01 (Aug 17 2023 - 15:51:31 +0000)

CPU:   Zynq 7z020
Silicon: v3.1
Model: Vision Series 6 - Zynq-7000
DRAM:  ECC disabled 1 GiB
Flash: 0 Bytes
NAND:  0 MiB
MMC:   mmc@e0100000: 0, mmc@e0101000: 1
In:    serial@e0000000
Out:   serial@e0000000
Err:   serial@e0000000
Net:   
ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr 0, interface rgmii-id

Warning: ethernet@e000b000 using MAC address from DT
eth0: ethernet@e000b000
ZYNQ GEM: e000c000, mdio bus e000c000, phyaddr 1, interface gmii

Warning: ethernet@e000c000 using MAC address from DT
, eth1: ethernet@e000c000
U-BOOT for petalinux
importing env from FSBL shared area at 0xFFFFFC00
Found valid magic
## Info: input data size = 27 = 0x1B

Hit any key to stop autoboot:  0
Zynq> setenv bootargs 'console=ttyPS0,115200 earlycon root=/dev/mmcblk1p2 rw rootwait'
Zynq> fatload mmc 1:1 0x10000000 image.ub
4362552 bytes read in 256 ms (16.3 MiB/s)
Zynq> bootm 0x10000000


The system will boot from the QSPI and use the kernel and rootfs on the e.MMC (mmc1).

This is, of course, not optimal.... In need it to autoboot properly. But it does prove that the system can boot.

Does anyone have any ideas...

Thanks


JH

Hi,
you must change boot.scr script and put it on the correct place in the QSPI(use amd default offset or change it on the config)
we have some notes and links to boot.scr usage:
https://wiki.trenz-electronic.de/display/PD/Distro+Boot+with+Boot.scr
br
John