mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* barebox state is not fixed up into kernel-device-tree
@ 2018-11-04 22:39 Patrick Boettcher
  2018-11-05  8:28 ` Ulrich Ölmann
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Boettcher @ 2018-11-04 22:39 UTC (permalink / raw)
  To: Barebox List

Hi,

I'm using a device-state (for bootchooser) which is stored in an eeprom.

Works fine from within barebox - read and write.

Userspace does not see the state:

  Neither /aliases/state nor /state found

The displayed device-tree when booting with 'boot -v -v <name>' does
not contain the state-entry.

However, there is a warning of a failed fixup:

  Failed to fixup node in of_state_fixup+0x1/0x1ac: No such device

Could it be that the eeprom-alias is missing? I'm still learning
device-tree and stuff and I'm not yet entirely sure how everything is
related.

The partition is created within a 

  &eeprom {
     [..]
  }

section and eeprom is defined as 

  eeprom: eeprom@52 {

  }

(I added the 'eeprom: '- name/alias)

Where am I missing the link?

best regards,
--
Patrick.

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

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

* Re: barebox state is not fixed up into kernel-device-tree
  2018-11-04 22:39 barebox state is not fixed up into kernel-device-tree Patrick Boettcher
@ 2018-11-05  8:28 ` Ulrich Ölmann
  2018-11-05  8:41   ` Patrick Boettcher
  0 siblings, 1 reply; 7+ messages in thread
From: Ulrich Ölmann @ 2018-11-05  8:28 UTC (permalink / raw)
  To: Patrick Boettcher; +Cc: Barebox List

Hi Patrick,

Patrick Boettcher <patrick.boettcher@posteo.de> writes:
> I'm using a device-state (for bootchooser) which is stored in an
> eeprom.
>
> Works fine from within barebox - read and write.
>
> Userspace does not see the state:
>
>   Neither /aliases/state nor /state found
>
> The displayed device-tree when booting with 'boot -v -v <name>' does
> not contain the state-entry.
>
> However, there is a warning of a failed fixup:
>
>   Failed to fixup node in of_state_fixup+0x1/0x1ac: No such device
>
> Could it be that the eeprom-alias is missing? I'm still learning
> device-tree and stuff and I'm not yet entirely sure how everything is
> related.
>
> The partition is created within a
>
>   &eeprom {
>      [..]
>   }
>
> section and eeprom is defined as
>
>   eeprom: eeprom@52 {
>
>   }
>
> (I added the 'eeprom: '- name/alias)
>
> Where am I missing the link?

there was a patch recently that fixed a bug in the context of partition
fixups and as a result repaired the state fixup as well for some setups:

  http://lists.infradead.org/pipermail/barebox/2018-October/035091.html

Please check if it solves your problem. If not then please provide more
insight into your devicetrees (barebox & kernel) and post a little bit
more context of the state node as well as the eeprom and the aliases
nodes.

Best regards
Ulrich
--
Pengutronix e.K.                           | Ulrich Ölmann               |
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] 7+ messages in thread

* Re: barebox state is not fixed up into kernel-device-tree
  2018-11-05  8:28 ` Ulrich Ölmann
@ 2018-11-05  8:41   ` Patrick Boettcher
  2018-11-05  9:20     ` Patrick Boettcher
  2018-11-05  9:26     ` Ulrich Ölmann
  0 siblings, 2 replies; 7+ messages in thread
From: Patrick Boettcher @ 2018-11-05  8:41 UTC (permalink / raw)
  To: Ulrich Ölmann; +Cc: Barebox List

Hi Ulrich,

On Mon, 05 Nov 2018 09:28:53 +0100
Ulrich Ölmann <u.oelmann@pengutronix.de> wrote:

> Hi Patrick,
> 
> Patrick Boettcher <patrick.boettcher@posteo.de> writes:
> > I'm using a device-state (for bootchooser) which is stored in an
> > eeprom.
> >
> > Works fine from within barebox - read and write.
> >
> > Userspace does not see the state:
> >
> >   Neither /aliases/state nor /state found
> >
> > The displayed device-tree when booting with 'boot -v -v <name>' does
> > not contain the state-entry.
> >
> > However, there is a warning of a failed fixup:
> >
> >   Failed to fixup node in of_state_fixup+0x1/0x1ac: No such device
> >
> > Could it be that the eeprom-alias is missing? I'm still learning
> > device-tree and stuff and I'm not yet entirely sure how everything
> > is related.
> >
> > The partition is created within a
> >
> >   &eeprom {
> >      [..]
> >   }
> >
> > section and eeprom is defined as
> >
> >   eeprom: eeprom@52 {
> >
> >   }
> >
> > (I added the 'eeprom: '- name/alias)
> >
> > Where am I missing the link?  
> 
> there was a patch recently that fixed a bug in the context of
> partition fixups and as a result repaired the state fixup as well for
> some setups:
> 
>   http://lists.infradead.org/pipermail/barebox/2018-October/035091.html
> 
> Please check if it solves your problem. If not then please provide
> more insight into your devicetrees (barebox & kernel) and post a
> little bit more context of the state node as well as the eeprom and
> the aliases nodes.

I investigated further (still doing right now). In my kernel device-tree
the eeprom does not have the partition definition. So of_state_fixup()
does not find it (I added some debug prints to analyze):

   of_find_node_by_path_from: 
       /soc/aips-bus@02100000/i2c@021a0000/eeprom@52/partitions/state@0
       not found

I wrongly assumed from mails I found in the archive that barebox is
fixing up even the partitions. 

Does your patch from above will be helpful in my case?

Do I need to change the kernel-device-tree to insert the partitions
manually? If so, how should it look like if the state-partition in
barebox is defined like this:

  &eeprom {
	status = "okay";
	partitions {
		compatible = "fixed-partitions";
		#size-cells = <1>;
		#address-cells = <1>;
		backend_update_eeprom: state@0 {
			reg = <0x0 0x100>;
			label = "barebox-state-eeprom";
		};
	};
  };


Thanks,
--
Patrick.

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

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

* Re: barebox state is not fixed up into kernel-device-tree
  2018-11-05  8:41   ` Patrick Boettcher
@ 2018-11-05  9:20     ` Patrick Boettcher
  2018-11-06  5:42       ` Ulrich Ölmann
  2018-11-05  9:26     ` Ulrich Ölmann
  1 sibling, 1 reply; 7+ messages in thread
From: Patrick Boettcher @ 2018-11-05  9:20 UTC (permalink / raw)
  To: Ulrich Ölmann; +Cc: Barebox List

On Mon, 5 Nov 2018 09:41:51 +0100
Patrick Boettcher <patrick.boettcher@posteo.de> wrote:

> Hi Ulrich,
> 
> On Mon, 05 Nov 2018 09:28:53 +0100
> Ulrich Ölmann <u.oelmann@pengutronix.de> wrote:
> 
> > Hi Patrick,
> > 
> > Patrick Boettcher <patrick.boettcher@posteo.de> writes:  
> > > I'm using a device-state (for bootchooser) which is stored in an
> > > eeprom.
> > >
> > > Works fine from within barebox - read and write.
> > >
> > > Userspace does not see the state:
> > >
> > >   Neither /aliases/state nor /state found
> > >
> > > The displayed device-tree when booting with 'boot -v -v <name>'
> > > does not contain the state-entry.
> > >
> > > However, there is a warning of a failed fixup:
> > >
> > >   Failed to fixup node in of_state_fixup+0x1/0x1ac: No such device
> > >
> > > Could it be that the eeprom-alias is missing? I'm still learning
> > > device-tree and stuff and I'm not yet entirely sure how everything
> > > is related.
> > >
> > > The partition is created within a
> > >
> > >   &eeprom {
> > >      [..]
> > >   }
> > >
> > > section and eeprom is defined as
> > >
> > >   eeprom: eeprom@52 {
> > >
> > >   }
> > >
> > > (I added the 'eeprom: '- name/alias)
> > >
> > > Where am I missing the link?    
> > 
> > there was a patch recently that fixed a bug in the context of
> > partition fixups and as a result repaired the state fixup as well
> > for some setups:
> > 
> >   http://lists.infradead.org/pipermail/barebox/2018-October/035091.html
> > 
> > Please check if it solves your problem. If not then please provide
> > more insight into your devicetrees (barebox & kernel) and post a
> > little bit more context of the state node as well as the eeprom and
> > the aliases nodes.  
> 
> I investigated further (still doing right now). In my kernel
> device-tree the eeprom does not have the partition definition. So
> of_state_fixup() does not find it (I added some debug prints to
> analyze):
> 
>    of_find_node_by_path_from: 
>        /soc/aips-bus@02100000/i2c@021a0000/eeprom@52/partitions/state@0
>        not found
> 
> I wrongly assumed from mails I found in the archive that barebox is
> fixing up even the partitions. 
> 
> Does your patch from above will be helpful in my case?
> 
> Do I need to change the kernel-device-tree to insert the partitions
> manually? If so, how should it look like if the state-partition in
> barebox is defined like this:
> 
>   &eeprom {
> 	status = "okay";
> 	partitions {
> 		compatible = "fixed-partitions";
> 		#size-cells = <1>;
> 		#address-cells = <1>;
> 		backend_update_eeprom: state@0 {
> 			reg = <0x0 0x100>;
> 			label = "barebox-state-eeprom";
> 		};
> 	};
>   };

After adding the partition the kernel-device-tree 

  &eeprom {
	status = "okay";
	partitions {
		backend_update_eeprom: state@0 {
			reg = <0x0 0x100>;
		};
	};
  };
 
The barebox-fixup error disappear, the dumped device tree at boot-time
contains the state-node.

However, barebox-state, run from userspace gives 

  of_get_devicepath: no 'label' property found
  in /soc/aips-bus@02100000/i2c@021a0000/eeprom@52/partitions/state@0
  Cannot find backend path in /state


Do I need to copy all of the partition-description into the
kernel-device-tree? Is this, what your patch addresses?

--
Patrick.

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

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

* Re: barebox state is not fixed up into kernel-device-tree
  2018-11-05  8:41   ` Patrick Boettcher
  2018-11-05  9:20     ` Patrick Boettcher
@ 2018-11-05  9:26     ` Ulrich Ölmann
  2018-11-05 18:21       ` Patrick Boettcher
  1 sibling, 1 reply; 7+ messages in thread
From: Ulrich Ölmann @ 2018-11-05  9:26 UTC (permalink / raw)
  To: Patrick Boettcher; +Cc: Barebox List

Patrick Boettcher <patrick.boettcher@posteo.de> writes:
> On Mon, 05 Nov 2018 09:28:53 +0100
> Ulrich Ölmann <u.oelmann@pengutronix.de> wrote:
>> Patrick Boettcher <patrick.boettcher@posteo.de> writes:
>> > I'm using a device-state (for bootchooser) which is stored in an
>> > eeprom.
>> >
>> > Works fine from within barebox - read and write.
>> >
>> > Userspace does not see the state:
>> >
>> >   Neither /aliases/state nor /state found
>> >
>> > The displayed device-tree when booting with 'boot -v -v <name>' does
>> > not contain the state-entry.
>> >
>> > However, there is a warning of a failed fixup:
>> >
>> >   Failed to fixup node in of_state_fixup+0x1/0x1ac: No such device
>> >
>> > Could it be that the eeprom-alias is missing? I'm still learning
>> > device-tree and stuff and I'm not yet entirely sure how everything
>> > is related.
>> >
>> > The partition is created within a
>> >
>> >   &eeprom {
>> >      [..]
>> >   }
>> >
>> > section and eeprom is defined as
>> >
>> >   eeprom: eeprom@52 {
>> >
>> >   }
>> >
>> > (I added the 'eeprom: '- name/alias)
>> >
>> > Where am I missing the link?
>>
>> there was a patch recently that fixed a bug in the context of
>> partition fixups and as a result repaired the state fixup as well for
>> some setups:
>>
>>   http://lists.infradead.org/pipermail/barebox/2018-October/035091.html
>>
>> Please check if it solves your problem. If not then please provide
>> more insight into your devicetrees (barebox & kernel) and post a
>> little bit more context of the state node as well as the eeprom and
>> the aliases nodes.
>
> I investigated further (still doing right now). In my kernel device-tree
> the eeprom does not have the partition definition. So of_state_fixup()
> does not find it (I added some debug prints to analyze):
>
>    of_find_node_by_path_from:
>        /soc/aips-bus@02100000/i2c@021a0000/eeprom@52/partitions/state@0
>        not found
>
> I wrongly assumed from mails I found in the archive that barebox is
> fixing up even the partitions.

In my last mail I forgot to ask which version of barebox you are using?
Which version of the Linux kernel are you booting from within barebox?

Best regards
Ulrich

> Does your patch from above will be helpful in my case?
>
> Do I need to change the kernel-device-tree to insert the partitions
> manually? If so, how should it look like if the state-partition in
> barebox is defined like this:
>
>   &eeprom {
> 	status = "okay";
> 	partitions {
> 		compatible = "fixed-partitions";
> 		#size-cells = <1>;
> 		#address-cells = <1>;
> 		backend_update_eeprom: state@0 {
> 			reg = <0x0 0x100>;
> 			label = "barebox-state-eeprom";
> 		};
> 	};
>   };
>
>
> Thanks,


--
Pengutronix e.K.                           | Ulrich Ölmann               |
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] 7+ messages in thread

* Re: barebox state is not fixed up into kernel-device-tree
  2018-11-05  9:26     ` Ulrich Ölmann
@ 2018-11-05 18:21       ` Patrick Boettcher
  0 siblings, 0 replies; 7+ messages in thread
From: Patrick Boettcher @ 2018-11-05 18:21 UTC (permalink / raw)
  To: Ulrich Ölmann; +Cc: Barebox List

On Mon, 05 Nov 2018 10:26:50 +0100
Ulrich Ölmann <u.oelmann@pengutronix.de> wrote:

> Patrick Boettcher <patrick.boettcher@posteo.de> writes:
> > On Mon, 05 Nov 2018 09:28:53 +0100
> > Ulrich Ölmann <u.oelmann@pengutronix.de> wrote:  
> >> Patrick Boettcher <patrick.boettcher@posteo.de> writes:  
> >> > I'm using a device-state (for bootchooser) which is stored in an
> >> > eeprom.
> >> >
> >> > Works fine from within barebox - read and write.
> >> >
> >> > Userspace does not see the state:
> >> >
> >> >   Neither /aliases/state nor /state found
> >> >
> >> > The displayed device-tree when booting with 'boot -v -v <name>'
> >> > does not contain the state-entry.
> >> >
> >> > However, there is a warning of a failed fixup:
> >> >
> >> >   Failed to fixup node in of_state_fixup+0x1/0x1ac: No such
> >> > device
> >> >
> >> > Could it be that the eeprom-alias is missing? I'm still learning
> >> > device-tree and stuff and I'm not yet entirely sure how
> >> > everything is related.
> >> >
> >> > The partition is created within a
> >> >
> >> >   &eeprom {
> >> >      [..]
> >> >   }
> >> >
> >> > section and eeprom is defined as
> >> >
> >> >   eeprom: eeprom@52 {
> >> >
> >> >   }
> >> >
> >> > (I added the 'eeprom: '- name/alias)
> >> >
> >> > Where am I missing the link?  
> >>
> >> there was a patch recently that fixed a bug in the context of
> >> partition fixups and as a result repaired the state fixup as well
> >> for some setups:
> >>
> >>   http://lists.infradead.org/pipermail/barebox/2018-October/035091.html
> >>
> >> Please check if it solves your problem. If not then please provide
> >> more insight into your devicetrees (barebox & kernel) and post a
> >> little bit more context of the state node as well as the eeprom and
> >> the aliases nodes.  
> >
> > I investigated further (still doing right now). In my kernel
> > device-tree the eeprom does not have the partition definition. So
> > of_state_fixup() does not find it (I added some debug prints to
> > analyze):
> >
> >    of_find_node_by_path_from:
> >        /soc/aips-bus@02100000/i2c@021a0000/eeprom@52/partitions/state@0
> >        not found
> >
> > I wrongly assumed from mails I found in the archive that barebox is
> > fixing up even the partitions.  
> 
> In my last mail I forgot to ask which version of barebox you are
> using? Which version of the Linux kernel are you booting from within
> barebox?

Barebox: v2017.04.0-phy
Kernel: 4.12.4-BSP-Yocto-phyBOARD-Segin-PD17.2.0

(Including phytec patches)

(I made it just now, when copying the entire eeprom-parition to the
eeprom-section of the device-tree of the kernel). I don't like this
redundancy, however.

best regards,
--
Patrick.

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

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

* Re: barebox state is not fixed up into kernel-device-tree
  2018-11-05  9:20     ` Patrick Boettcher
@ 2018-11-06  5:42       ` Ulrich Ölmann
  0 siblings, 0 replies; 7+ messages in thread
From: Ulrich Ölmann @ 2018-11-06  5:42 UTC (permalink / raw)
  To: Patrick Boettcher; +Cc: Barebox List

Hi Patrick,

Patrick Boettcher <patrick.boettcher@posteo.de> writes:
> On Mon, 5 Nov 2018 09:41:51 +0100
> Patrick Boettcher <patrick.boettcher@posteo.de> wrote:
>> On Mon, 05 Nov 2018 09:28:53 +0100
>> Ulrich Ölmann <u.oelmann@pengutronix.de> wrote:
>> > Patrick Boettcher <patrick.boettcher@posteo.de> writes:
>> > > I'm using a device-state (for bootchooser) which is stored in an
>> > > eeprom.
>> > >
>> > > Works fine from within barebox - read and write.
>> > >
>> > > Userspace does not see the state:
>> > >
>> > >   Neither /aliases/state nor /state found
>> > >
>> > > The displayed device-tree when booting with 'boot -v -v <name>'
>> > > does not contain the state-entry.
>> > >
>> > > However, there is a warning of a failed fixup:
>> > >
>> > >   Failed to fixup node in of_state_fixup+0x1/0x1ac: No such device
>> > >
>> > > Could it be that the eeprom-alias is missing? I'm still learning
>> > > device-tree and stuff and I'm not yet entirely sure how everything
>> > > is related.
>> > >
>> > > The partition is created within a
>> > >
>> > >   &eeprom {
>> > >      [..]
>> > >   }
>> > >
>> > > section and eeprom is defined as
>> > >
>> > >   eeprom: eeprom@52 {
>> > >
>> > >   }
>> > >
>> > > (I added the 'eeprom: '- name/alias)
>> > >
>> > > Where am I missing the link?
>> >
>> > there was a patch recently that fixed a bug in the context of
>> > partition fixups and as a result repaired the state fixup as well
>> > for some setups:
>> >
>> >   http://lists.infradead.org/pipermail/barebox/2018-October/035091.html
>> >
>> > Please check if it solves your problem. If not then please provide
>> > more insight into your devicetrees (barebox & kernel) and post a
>> > little bit more context of the state node as well as the eeprom and
>> > the aliases nodes.
>>
>> I investigated further (still doing right now). In my kernel
>> device-tree the eeprom does not have the partition definition. So
>> of_state_fixup() does not find it (I added some debug prints to
>> analyze):
>>
>>    of_find_node_by_path_from:
>>        /soc/aips-bus@02100000/i2c@021a0000/eeprom@52/partitions/state@0
>>        not found
>>
>> I wrongly assumed from mails I found in the archive that barebox is
>> fixing up even the partitions.
>>
>> Does your patch from above will be helpful in my case?
>>
>> Do I need to change the kernel-device-tree to insert the partitions
>> manually? If so, how should it look like if the state-partition in
>> barebox is defined like this:
>>
>>   &eeprom {
>> 	status = "okay";
>> 	partitions {
>> 		compatible = "fixed-partitions";
>> 		#size-cells = <1>;
>> 		#address-cells = <1>;
>> 		backend_update_eeprom: state@0 {
>> 			reg = <0x0 0x100>;
>> 			label = "barebox-state-eeprom";
>> 		};
>> 	};
>>   };
>
> After adding the partition the kernel-device-tree
>
>   &eeprom {
> 	status = "okay";
> 	partitions {
> 		backend_update_eeprom: state@0 {
> 			reg = <0x0 0x100>;
> 		};
> 	};
>   };
>
> The barebox-fixup error disappear, the dumped device tree at boot-time
> contains the state-node.
>
> However, barebox-state, run from userspace gives
>
>   of_get_devicepath: no 'label' property found
>   in /soc/aips-bus@02100000/i2c@021a0000/eeprom@52/partitions/state@0
>   Cannot find backend path in /state
>
>
> Do I need to copy all of the partition-description into the
> kernel-device-tree? Is this, what your patch addresses?

The patch is needed to fix newer barebox releases, but you are using an
old vendor patched version where it is not needed.

It looks like no fixup for the eeprom partitions in the kernel
devicetree takes place. As an alternative to adding the partitions
manually you could probably patch your barebox to register the wanted
fixup in the driver.

Best regards
Ulrich
--
Pengutronix e.K.                           | Ulrich Ölmann               |
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] 7+ messages in thread

end of thread, other threads:[~2018-11-06  5:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-04 22:39 barebox state is not fixed up into kernel-device-tree Patrick Boettcher
2018-11-05  8:28 ` Ulrich Ölmann
2018-11-05  8:41   ` Patrick Boettcher
2018-11-05  9:20     ` Patrick Boettcher
2018-11-06  5:42       ` Ulrich Ölmann
2018-11-05  9:26     ` Ulrich Ölmann
2018-11-05 18:21       ` Patrick Boettcher

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