Barebox bootchooser/state integration Raspberry Pi 3 issue

0

I have an issue regarding barebox bootchooser/state integration for Raspberry Pi 3 (used for multiple rootfs + RAUC software update).

I am using the following: Yocto Pyro 2.3.2, barebox 2018.12.0 . I have successfully configured barebox, I can see the output on the debug console.

Rpi 3 does not have any other non-volatile memory (except SD card). How can I store the barebox state on SD card? For other boards, the barebox state is stored on EEPROM/onboard eMMC/NAND (even SD card) which is already described in the Device Tree Source. The SD card for RPI (mci0) is detected at barebox startup, and it is not described in the DTS (see devinfo output below):

barebox@RaspberryPi 3 Model B:/ devinfo
`-- global
`-- nv
`-- platform
   `-- soc
      `-- 3f003000.timer@7e003000
      `-- 3f004000.txp@7e004000
      `-- 3f007000.dma@7e007000
      `-- 3f00b200.interrupt-controller@7e00b200
      `-- 3f100000.watchdog@7e100000
         `-- wdog0
      `-- 3f101000.cprman@7e101000
      `-- 3f104000.rng@7e104000
      `-- 3f00b880.mailbox@7e00b880
      `-- 3f200000.gpio@7e200000
      `-- 3f202000.mmc@7e202000
      `-- 3f205000.i2c@7e205000
      `-- 3f206000.pixelvalve@7e206000
      `-- 3f207000.pixelvalve@7e207000
      `-- 3f209000.dsi@7e209000
      `-- 3f212000.thermal@7e212000
      `-- 3f215000.aux@7e215000
      `-- 3f215040.serial@7e215040
      `-- 3f20c000.pwm@7e20c000
      `-- 3f300000.sdhci@7e300000
         `-- mci0
            `-- 0x00000000-0x76e47ffff (  29.7 GiB): /dev/disk0
            `-- 0x00001000-0x022c1fff (  34.8 MiB): /dev/disk0.0
            `-- 0x022c2000-0xfbc5bbff (   3.9 GiB): /dev/disk0.1
            `-- 0xfbc5c000-0x1f55f5bff (   3.9 GiB): /dev/disk0.2
            `-- 0x1f55f5c00-0x2149f5fff (   500 MiB): /dev/disk0.3
            `-- 0x1f55f5e00-0x1fb9f5dff (   100 MiB): /dev/disk0.4
            `-- 0x1fb9f6000-0x2149f5fff (   400 MiB): /dev/disk0.5
            `-- fat0
      `-- 3f400000.hvs@7e400000
      `-- 3f804000.i2c@7e804000
      `-- 3f805000.i2c@7e805000
      `-- 3f806000.vec@7e806000
      `-- 3f807000.pixelvalve@7e807000
      `-- 3f902000.hdmi@7e902000
      `-- 3f980000.usb@7e980000
      `-- 3fc00000.v3d@7ec00000
      `-- soc:gpu
      `-- 40000000.local_intc@40000000
      `-- soc:firmware
         `-- soc:firmware:gpio
      `-- soc:power
      `-- 3f00b840.mailbox@7e00b840
   `-- clocks
      `-- clocks:clock@3
      `-- clocks:clock@4
   `-- phy
   `-- arm-pmu
   `-- timer
   `-- leds
   `-- wifi-pwrseq
   `-- regulator-bcm2835
   `-- mem0
      `-- 0x00000000-0x3b3fffff (   948 MiB): /dev/ram0
   `-- mem1
      `-- 0x00000000-0xfffffffe (     4 GiB): /dev/mem
   `-- bcm2835_fb0
`-- amba
   `-- 3f201000.serial@7e201000
      `-- cs0
         `-- 0x00000000-0xffffffffffffffff (   0 Bytes): /dev/cs0
`-- spi
`-- fs
   `-- ramfs0
   `-- devfs0

In addition, barebox documentation states the following (regarding SD card state storage) : "Note that currently there is no support for on-disk partition tables. Instead, an ofpart partition description must be used. You have to make sure that this partition does not conflict with any other partition in the partition table."

Would it be okay if I define the mci0 node in the device tree source? How should I do it? The barebox documentation provides an example, but that does not help too much in my case :

backend_state_sd: part@100000 {
        label = "state";
        reg = <0x100000 0x20000>;
};

aliases {
        state = &state_sd;
};

state_sd: state_memory {
        #address-cells = <1>;
        #size-cells = <1>;
        compatible = "barebox,state";
        magic = <0xab67421f>;
        backend-type = "raw";
        backend = <&backend_state_sd>;
        backend-stridesize = <0x40>;

        variable@0 {
                reg = <0x0 0x1>;
                type ="uint8";
                default = <0x1>;
        };
};

Many Thanks!

Regards, Vali.

raspberry-pi
bootloader
sd-card
software-update
yocto-project
asked on Super User May 24, 2019 by Vali Rusu • edited May 24, 2019 by Vali Rusu

1 Answer

0

Would it be okay if I define the mci0 node in the device tree source?

Yes, this is exactly what the documentation suggests.

How should I do it? The barebox documentation provides an example, but that does not help too much in my case

Check out how it's done for the SoCFPGA Arria10 Achilles board:

&mmc {
        partitions {
                compatible = "fixed-partitions";
                #size-cells = <1>;
                #address-cells = <1>;

                state_mmc: partition@400000 {
                        label = "state";
                        reg = <0x400000 0x8000>;
                };
        };
};

P.S: There's a barebox mailing list and freenode channel, with a greater density of people who might be able to answer barebox questions. :)

answered on Super User Nov 10, 2019 by a3f

User contributions licensed under CC BY-SA 3.0