how to create barebox-state for nand flash

83 Views Asked by At

i'm facing an issue in barebox-state. when first stage bootloader runs an error occured

"state: state failed to parse path to backend: No such device"

and in kernel, when i run barebox-state it gives error that

"Neither /aliases/state nor /state found".

i am adding a state node in barebox device tree.

state: state {
            #address-cells = <1>;
                #size-cells = <1>;
        compatible = "barebox,state";
        magic = <0xab67421f>;
        backend-type = "raw";
        backend = <&state_part>;
        backend-storage-type = "circular";

        bootstate {
        system0 {
            remaining_attempts@0 {
            reg = <0x0 0x4>;
            type = "uint32";
            default = <3>;
            };
            priority@4 {
            reg = <0x4 0x4>;
            type = "uint32";
            default = <20>;
            };
        };

        system1 {
            remaining_attempts@8 {
            reg = <0x8 0x4>;
            type = "uint32";
            default = <3>;
            };
            priority@c {
            reg = <0xC 0x4>;
            type = "uint32";
            default = <20>;
            };
        };

        last_chosen@10 {
            reg = <0x10 0x4>;
            type = "uint32";
        };
        };
    };

and the nand partition looks like this

&gpmc {

  /* ... */

  nand: nand@0,0 {

    /* ... */

    state_part: partition@1c0000 {
      label = "barebox_state";
      reg = <0x1c0000 0x320000>;
    };

    /* ... */

  };

when i add this state for eeprom it works fine. i donot know what is the issue. my barebox version is ""2018.11.0-phy3", dt-utils version is "2021.03.0" and kernel version is "linux-mainline_4.14.78-phy4".

kindly guide me if anyones know. Thanks in advance.

i tried to add the state in eeprom it works fine but in case of nand it creating an issues.

1

There are 1 best solutions below

0
a3f On

You didn't mention what Phytec board you have, but in case that it's the imx6q-phytec-pbab01.dts with NAND, the state example in barebox has recently been updated to be compatible with newer revisions of that board's device trees. I'd suggest you build a barebox from the upstream repository and report what issues you run into using it.