[PATCH] libdt: fix detection of eeprom devicepath

Marc Kleine-Budde mkl at pengutronix.de
Fri Jun 19 00:52:07 PDT 2015


Hey Jan,

I think it's okay to use the barebox list for dt-utils related stuff. :)

On 06/19/2015 09:41 AM, Jan Remmet wrote:
> If nodepath can directly be translated to a device, the device can also
> be a eeprom. Set default size to 0. The real size can be got from the
> path.
> 
> Signed-off-by: Jan Remmet <j.remmet at phytec.de>
> ---
> I my setup I have an eeprom as backend:
>   backend = "/soc/aips-bus at 02100000/i2c at 021a0000/eeprom at 50";
> barebox-state runs in a initramfs without udev daemon, but wih libudev and
> devtmpfs
> 
> of_find_device_by_node_path directly found a devices and it was handled as mtd
> device. I added a check for eeprom. Setting the size to 0 let barebox-state
> check the size by itself.
> 
> At the end of of_get_devicepath there is a check for eeproms, but then
> of_parse_partition looks for a reg property which is in a casse of a i2c
> eeprom is the i2c address. This results in a wrong offset.

doh!

> With this patch a i2c eeprom backend works. It's not tested with a mtd device
> or a eeprom with a partition layout.

AFAIK on Linux partition layouts are not supported on eeprom devices, as
they are not handled by the mtd layer. I'll apply this patch and test on
my standard device, which uses a mtd device.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/barebox/attachments/20150619/cb263ad3/attachment.sig>


More information about the barebox mailing list