Trying to boot mainline on Wink Hub v1

Rogan Dawes rogan at dawes.za.net
Sun Jun 25 12:31:01 PDT 2023


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-mtd mailing list