mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* state/bootchoser and sdhci/sdhost switchover
@ 2019-04-25 18:46 Moritz Augsburger
  2019-04-26  6:27 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Moritz Augsburger @ 2019-04-25 18:46 UTC (permalink / raw)
  To: barebox

Hey,

I'm a bit clueless about using bootchooser/state (together with rauc) on 
raspberry pi.

Inside barebox itself, everything works fine. I defined a state backend 
inside the dt, and I can set/update/read values:

     state: state {
         magic = <0x4d433230>;
         compatible = "barebox,state";
         backend-type = "raw";
         backend = <&backend_state_sd>;
         backend-storage-type = "circular";
         backend-stridesize = <0x800>;
[...]
     };
&sdhci { // extended the original entry
         pinctrl-0 = <&emmc_gpio48>;
         no-sd;
         non-removable;
         status = "okay";
         partitions {
                 compatible = "fixed-partitions";
                 #size-cells = <1>;
                 #address-cells = <1>;
                 backend_state_sd: part@200000 {
                         label = "state_sd";
                         reg = <0x200000 0x200000>;
                 };
         };
};

Linux uses &sdhost, barebox switched to &sdhci in 
ed5d970c16d14aa24edc20b8a096f230a398f7be as it has no driver for the 
sdhost interface. barebox-state doesn't find the storage, as expected:

# barebox-state
of_get_devicepath: cannot find device from node /soc/mmc@7e300000
state: state failed to parse path to backend: No such device
unable to initialize state: Unknown error -19

I would need some way to switch the backend for the state variable to 
the sdhost interface when it is copied into the device tree used for 
booting - or any other good proposal how to deal with the problem.

Best regards
Moritz

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: state/bootchoser and sdhci/sdhost switchover
  2019-04-25 18:46 state/bootchoser and sdhci/sdhost switchover Moritz Augsburger
@ 2019-04-26  6:27 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2019-04-26  6:27 UTC (permalink / raw)
  To: Moritz Augsburger; +Cc: barebox

On Thu, Apr 25, 2019 at 08:46:13PM +0200, Moritz Augsburger wrote:
> Hey,
> 
> I'm a bit clueless about using bootchooser/state (together with rauc) on
> raspberry pi.
> 
> Inside barebox itself, everything works fine. I defined a state backend
> inside the dt, and I can set/update/read values:
> 
>     state: state {
>         magic = <0x4d433230>;
>         compatible = "barebox,state";
>         backend-type = "raw";
>         backend = <&backend_state_sd>;
>         backend-storage-type = "circular";
>         backend-stridesize = <0x800>;
> [...]
>     };
> &sdhci { // extended the original entry
>         pinctrl-0 = <&emmc_gpio48>;
>         no-sd;
>         non-removable;
>         status = "okay";
>         partitions {
>                 compatible = "fixed-partitions";
>                 #size-cells = <1>;
>                 #address-cells = <1>;
>                 backend_state_sd: part@200000 {
>                         label = "state_sd";
>                         reg = <0x200000 0x200000>;
>                 };
>         };
> };
> 
> Linux uses &sdhost, barebox switched to &sdhci in
> ed5d970c16d14aa24edc20b8a096f230a398f7be as it has no driver for the sdhost
> interface. barebox-state doesn't find the storage, as expected:
> 
> # barebox-state
> of_get_devicepath: cannot find device from node /soc/mmc@7e300000
> state: state failed to parse path to backend: No such device
> unable to initialize state: Unknown error -19
> 
> I would need some way to switch the backend for the state variable to the
> sdhost interface when it is copied into the device tree used for booting -
> or any other good proposal how to deal with the problem.

How about porting the sdhost driver from U-Boot to barebox? This is
probably not what you wanted to hear, but I think porting the driver
mainly requires changing the boilerplate code which shouldn't be too
much effort.

The other solutions I can think of are crude hacks, like sneaking in
the correct device node by adjusting state->of_path in the state code.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-26  6:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-25 18:46 state/bootchoser and sdhci/sdhost switchover Moritz Augsburger
2019-04-26  6:27 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox