Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: booting Zynq 7000 ...



On Tue, 2024-03-26 at 17:44 -0500, David Young wrote:
> Thanks, Lloyd!  I think this is getting me closer.  I had tried to
> EFI
> boot but that does not seem to be how this board is ordinarily
> booted.

FWIW I built -current from a day or so ago and the efiboot worked much
better than I've ever seen in the past. 

> 
> What do you see on the console after you type `bootm`?  

This is what I get. 

> 
> U-Boot 2023.01 (Sep 21 2023 - 11:02:37 +0000)
> 
> CPU:   Zynq 7z020
> Silicon: v3.1
> DRAM:  ECC disabled 1 GiB
> Core:  29 devices, 16 uclasses, devicetree: board
> Flash: 0 Bytes
> NAND:  0 MiB
> MMC:   mmc@e0100000: 0, mmc@e0101000: 1
> Loading Environment from FAT... *** Error - No Valid Environment Area
> found
> *** Warning - bad env area, using default environment
> 
> In:    serial@e0001000
> Out:   serial@e0001000
> Err:   serial@e0001000
> Net:   
> ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr 1, interface rgmii-id
> eth1: ethernet@e000b000
> Hit any key to stop autoboot:  0 
> Zynq> fatload mmc 0 $kernel_addr_r netbsd-GENERIC.ub
> 11841628 bytes read in 657 ms (17.2 MiB/s)
> Zynq> fatload mmc 0 $fdt_addr_r dtb/ax7021b.dtb
> 14502 bytes read in 54 ms (261.7 KiB/s)
> Zynq> bootm $kernel_addr_r - $fdt_addr_r
> ## Booting kernel from Legacy Image at 02000000 ...
>    Image Name:   NetBSD/earmv7hf 10.99.10
>    Image Type:   ARM Linux Kernel Image (no loading done) >
(uncompressed)
>    Data Size:    11841564 Bytes = 11.3 MiB
>    Load Address: 00000000
>    Entry Point:  00000000
>    Verifying Checksum ... OK
> ## Flattened Device Tree blob at 01f00000
>    Booting using the fdt blob at 0x1f00000
> Working FDT set to 1f00000
>    XIP Kernel Image (no loading done)
>    Loading Device Tree to 2fff9000, end 2ffff8a5 ... OK
> Working FDT set to 2fff9000
> 
> Starting kernel ...
> 
> [   1.0000000] NetBSD/evbarm (fdt) booting ...
> [   1.0000000] [ Kernel symbol table missing! ]
> ...


> 
> Ok.  Right now I use the .dtb that comes from Red Pitaya.
> 
> I wonder what it is that NetBSD needs in the .dtb that the FreeBSD
> .dtb
> does not have....

I had a look at the time. I haven't looked into what NetBSD needs, but
I did note that various non-working .dtb files lacked things like CPU
definitions. I also noted definitions for the serial console that had
me thinking "how is that ever going to work?" 

You can decompile a .dtb file with "dtc -I dtb -O dts FILE.dtb" and
this is more useful than it might be because the bulk of the source for
most Zynq device trees is shared and so you only have to write a little
bit. An example is in
src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/zynq-zybo.dts. You
would need to copy the "memory@0" and "&clkc" entries from Red Pitaya
device tree, but everything else will be fine(ish). 

There is a bug in the ethernet driver and the ethernet will not attach
correctly if the PHY isn't a buggy Realtek PHY. I have a completed and
tested patch that I'll PR today.

The Red Pitaya sources in Github looks like it isn't too awful to work
with, although the device tree source code looks bespoke rather than
using the GPL code from kernel.org that NetBSD uses. I didn't see any
serial console definitions in the Red Pitaya sources in Github, so that
might be somewhere to start.

Ngā mihi,
Lloyd



Home | Main Index | Thread Index | Old Index