On 28. 05. 20 11:27, Michal Simek wrote:
> HI Robert and Heiko,
> 
> po 28. 10. 2019 v 19:32 odesílatel Robert Beckett 
> <bob.beck...@collabora.com> napsal:
>> 
>> Add ability to specify paritions for eeprom in device tree, and
>> query eeprom device sizes. Each partition creates a child device,
>> allowing board code to find the eeprom parition by name.
>> 
>> 
>> Robert Beckett (2): misc: i2c_eeprom: add fixed partitions
>> support misc: i2c_eeprom: add size query
>> 
>> drivers/misc/i2c_eeprom.c | 243
>> +++++++++++++++++++++++++++++++++++--- include/i2c_eeprom.h
>> |  12 ++ 2 files changed, 236 insertions(+), 19 deletions(-)
> 
> What's the recommended way to work with i2c_eeprom_partitions?
> 
> I have them probed but curious how I should work with them. i2c
> 1  [ + ]   i2c_mux_bus_drv       |   |       |-- 
> i2c@ff030000->i2c-mux@74->i2c@0 i2c_eeprom    0  [ + ]   i2c_eeprom
> |   |       |   `-- eeprom@54 i2c_eeprom    1  [   ]
> i2c_eeprom_partition  |   |       | |-- board-sn@0 i2c_eeprom    2
> [   ]   i2c_eeprom_partition  |   |       | |-- eth-mac@20 
> i2c_eeprom    3  [   ]   i2c_eeprom_partition  |   |       | |--
> board-name@d0 i2c_eeprom    4  [   ]   i2c_eeprom_partition  |   |
> | `-- board-revision@e0
> 
> Is there any u-boot command for reading values from these
> partitions? Or are you just referencing them by 
> fdt_path_offset/uclass_get_device_by_of_offset?

I think I found that path you use.

 13         bootcount {
 14                 compatible = "u-boot,bootcount-i2c-eeprom";
 15                 i2c-eeprom = <&bootcount>;
 16         };

 24 &eeprom {
 25         partitions {
 26                 compatible = "fixed-partitions";
 27
 28                 vpd {
 29                         offset = <0>;
 30                         size = <1022>;
 31                 };
 32
 32
 33                 bootcount: bootcount {
 34                         offset = <1022>;
 35                         size = <2>;
 36                 };
 37         };
 38 };

I am curious about these offset/size properties which you are using
here which are out of dt spec in the kernel.
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/mtd/partition.txt?h=next-20200526

Why not just to use reg property which does exactly it?

Anyway and then you use link to bootcount and code in
drivers/bootcount/i2c-eeprom.c to read it.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to