Trying to boot mainline on Wink Hub v1

Rogan Dawes rogan at dawes.za.net
Sun Jun 25 14:09:21 PDT 2023


I tried adding a &nand block to my device tree, but I think it is not
quite as simple as that, as I got an error message complaining about
my additions:

Error: arch/arm/boot/dts/imx28-wink-hub-v1.dts:40.6-11 syntax error
FATAL ERROR: Unable to parse input tree

This was pointing right at the &nand stanza. I suspect that the
problem is that the kirkwood.dtsi that your example was derived from
actually contained an existing nand node, while the imx28.dtsi that I
am deriving from does not. And unfortunately I do not understand
enough of the device tree syntax to solve this.

I did create the following entry, hopefully it maps the partitions
appropriately:
// Based on mtdparts=mtdparts=gpmi-nand:3m(u-boot),4m(updater-kernel),28m(updater-rootfs),8m(database),8m(app-kernel),-(app-rootfs)

&nand {
        status = "okay";

        partition at 0 {
                label = "u-boot";
                reg = <0x0000000 0x300000>;
                read-only;
        };

        partition at 300000 {
                label = "updater-kernel";
                reg = <0x0300000 0x400000>;
        };

        partition at 700000 {
                label = "updater-rootfs";
                reg = <0x0700000 0x1c00000>;
        };

        partition at 2300000 {
                label = "database";
                reg = <0x2300000 0x0800000>;
        };

        partition at 2b00000 {
                label = "app-kernel";
                reg = <0x2b00000 0x0800000>;
        };

        partition at 3300000 {
                label = "app-rootfs";
                reg = <0x3300000 0x0>;
        };

};

Hopefully at least the numbers look right?

Rogan

On Sun, 25 Jun 2023 at 21:31, Rogan Dawes <rogan at dawes.za.net> wrote:
>
> Thanks for the suggestion. It definitely sounds like it might
> short-cut my problems. I'd obviously still like to try and do things
> the "correct" way, whatever that is. My attempts to load the kernel
> and device tree in a FIT so far just end with:
>
> => nand read ${loadaddr} app-kernel 0x00600000
>
> NAND read: device 0 offset 0x2b00000, size 0x600000
>  6291456 bytes read: OK
> => iminfo ${lodaddr}
>
> ## Checking Image at 42000000 ...
> Unknown image format!
> => md.b ${loadaddr} 0x80
> 42000000: d0 0d fe ed 00 5a 81 08 00 00 00 38 00 5a 7c fc    .....Z.....8.Z|.
> 42000010: 00 00 00 28 00 00 00 11 00 00 00 10 00 00 00 00    ...(............
> 42000020: 00 00 00 6c 00 5a 7c c4 00 00 00 00 00 00 00 00    ...l.Z|.........
> 42000030: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00    ................
> 42000040: 00 00 00 03 00 00 00 04 00 00 00 5c 64 98 90 71    ...........\d..q
> 42000050: 00 00 00 03 00 00 00 21 00 00 00 00 61 72 6d 20    .......!....arm
> 42000060: 6b 65 72 6e 65 6c 2c 20 72 61 6d 64 69 73 6b 20    kernel, ramdisk
> 42000070: 61 6e 64 20 46 44 54 20 62 6c 6f 62 00 00 00 00    and FDT blob....
>
> Seems like it is loaded in the right place, though, and corresponds
> with the FIT file that I would expect to be there.
>
> Anyway, will try replicate the partition information directly into the DT.
>
> I also found the memory base address in the U-Boot bdinfo command output:
>
> => bdinfo
> arch_number = 0x000009E3
> boot_params = 0x40000100
> DRAM bank   = 0x00000000
> -> start    = 0x40000000
> -> size     = 0x04000000
>
> So I updated the .its as shown, with the image loaded from NAND to
> 32MB, the kernel relocated to 16MB, and no relocation/entry data for
> the device tree. I also tried loading it to 0x41000000 (by updating
> ${loadaddr}, specified that the kernel should be relocated to
> 0x42000000, which is where it usually was to be found, with the same
> "Unknown image format!" error:
>
> /dts-v1/;
>
> / {
>         description = "arm kernel, ramdisk and FDT blob";
>         #address-cells = <1>;
>
>         images {
>                 kernel {
>                         description = "ARM MXS Kernel";
>                         data = /incbin/("Image.gz");
>                         type = "kernel";
>                         arch = "arm";
>                         os = "linux";
>                         compression = "gzip";
>                         load = <0x41000000>;
>                         entry = <0x41000000>;
>                         hash {
>                                 algo = "sha1";
>                         };
>                 };
>
>                 imx28-wink-hub-v1 {
>                         description = "lx2162aqds-dtb";
>                         data = /incbin/("imx28-wink-hub-v1.dtb");
>                         type = "flat_dt";
>                         arch = "arm";
>                         os = "linux";
>                         compression = "none";
>                         hash {
>                                 algo = "sha1";
>                         };
>                 };
>         };
>
>         configurations {
>                 default = "wink-hub-v1";
>                 wink-hub-v1 {
>                         description = "config for Wink Hub v1";
>                         kernel = "kernel";
>                         fdt = "imx28-wink-hub-v1";
>                 };
>         };
> };
>
> Suggestions welcome.
>
> Regards,
>
> Rogan
>
> On Sun, 25 Jun 2023 at 17:24, Andrew Lunn <andrew at lunn.ch> wrote:
> >
> > > I *think* my problem is that U-Boot is not aware of the device tree,
> > > as I have been passing it as an appended item to the kernel, thinking
> > > that U-Boot was not Device-Tree compliant. Consequently, it is unable
> > > to patch it with the contents of the mtdparts environment variable,
> > > and hence the kernel never knows to go looking for the mtd partitions.
> >
> > You should be able to fully describe the MTD partition in DT. For
> > example, from arch/arm/boot/dts/kirkwood-dockstar.dts.
> >
> > &nand {
> >         status = "okay";
> >
> >         partition at 0 {
> >                 label = "u-boot";
> >                 reg = <0x0000000 0x100000>;
> >                 read-only;
> >         };
> >
> >         partition at 100000 {
> >                 label = "uImage";
> >                 reg = <0x0100000 0x400000>;
> >         };
> >
> >         partition at 500000 {
> >                 label = "data";
> >                 reg = <0x0500000 0xfb00000>;
> >         };
> > };
> >
> > You can then continue with appending the DT blob to the kernel. All
> > the bootloader needs to do is load the kernel.
> >
> >     Andrew



More information about the linux-arm-kernel mailing list