All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] misc: i2c_eeprom: add support for microchip 24aa025e48
@ 2022-04-29 14:22 Eugen Hristev
  2022-04-29 14:22 ` [PATCH 2/2] ARM: dts: at91: sam9x60ek: fix eeprom compatible Eugen Hristev
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Eugen Hristev @ 2022-04-29 14:22 UTC (permalink / raw)
  To: hs, u-boot, rasmus.villemoes; +Cc: Eugen Hristev

24aa025e48 is a variant of 24aa02e48 that has a page size of 16 bytes.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---
 drivers/misc/i2c_eeprom.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c
index 89a450d0f8..265c1d0591 100644
--- a/drivers/misc/i2c_eeprom.c
+++ b/drivers/misc/i2c_eeprom.c
@@ -176,6 +176,13 @@ static const struct i2c_eeprom_drv_data mc24aa02e48_data = {
 	.offset_len = 1,
 };
 
+static const struct i2c_eeprom_drv_data mc24aa025e48_data = {
+	.size = 256,
+	.pagesize = 16,
+	.addr_offset_mask = 0,
+	.offset_len = 1,
+};
+
 static const struct i2c_eeprom_drv_data atmel24c01a_data = {
 	.size = 128,
 	.pagesize = 8,
@@ -264,6 +271,7 @@ static const struct i2c_eeprom_drv_data atmel24c512_data = {
 static const struct udevice_id i2c_eeprom_std_ids[] = {
 	{ .compatible = "i2c-eeprom", (ulong)&eeprom_data },
 	{ .compatible = "microchip,24aa02e48", (ulong)&mc24aa02e48_data },
+	{ .compatible = "microchip,24aa025e48", (ulong)&mc24aa025e48_data },
 	{ .compatible = "atmel,24c01", (ulong)&atmel24c01a_data },
 	{ .compatible = "atmel,24c01a", (ulong)&atmel24c01a_data },
 	{ .compatible = "atmel,24c02", (ulong)&atmel24c02_data },
-- 
2.25.1


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

* [PATCH 2/2] ARM: dts: at91: sam9x60ek: fix eeprom compatible
  2022-04-29 14:22 [PATCH 1/2] misc: i2c_eeprom: add support for microchip 24aa025e48 Eugen Hristev
@ 2022-04-29 14:22 ` Eugen Hristev
  2022-05-02  4:30 ` [PATCH 1/2] misc: i2c_eeprom: add support for microchip 24aa025e48 Heiko Schocher
  2022-05-02  9:24 ` Michael Walle
  2 siblings, 0 replies; 6+ messages in thread
From: Eugen Hristev @ 2022-04-29 14:22 UTC (permalink / raw)
  To: hs, u-boot, rasmus.villemoes; +Cc: Eugen Hristev, Sergiu Moga

The correct compatible for the eeprom is microchip,24aa025e48
as this is the populated memory on this board.

Reported-by: Sergiu Moga <sergiu.moga@microchip.com>
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---
 arch/arm/dts/sam9x60ek.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/dts/sam9x60ek.dts b/arch/arm/dts/sam9x60ek.dts
index 32ffe93b4d..bc626d4eb9 100644
--- a/arch/arm/dts/sam9x60ek.dts
+++ b/arch/arm/dts/sam9x60ek.dts
@@ -72,7 +72,7 @@
 					status = "okay";
 
 					eeprom@53 {
-						compatible = "atmel,24c32";
+						compatible = "microchip,24aa025e48";
 						reg = <0x53>;
 						pagesize = <16>;
 					};
-- 
2.25.1


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

* Re: [PATCH 1/2] misc: i2c_eeprom: add support for microchip 24aa025e48
  2022-04-29 14:22 [PATCH 1/2] misc: i2c_eeprom: add support for microchip 24aa025e48 Eugen Hristev
  2022-04-29 14:22 ` [PATCH 2/2] ARM: dts: at91: sam9x60ek: fix eeprom compatible Eugen Hristev
@ 2022-05-02  4:30 ` Heiko Schocher
  2022-05-02  9:24 ` Michael Walle
  2 siblings, 0 replies; 6+ messages in thread
From: Heiko Schocher @ 2022-05-02  4:30 UTC (permalink / raw)
  To: Eugen Hristev, u-boot, rasmus.villemoes

Hello Eugen,

On 29.04.22 16:22, Eugen Hristev wrote:
> 24aa025e48 is a variant of 24aa02e48 that has a page size of 16 bytes.
> 
> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
> ---
>  drivers/misc/i2c_eeprom.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Reviewed-by: Heiko Schocher <hs@denx.de>

bye,
Heiko

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs@denx.de

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

* Re: [PATCH 1/2] misc: i2c_eeprom: add support for microchip 24aa025e48
  2022-04-29 14:22 [PATCH 1/2] misc: i2c_eeprom: add support for microchip 24aa025e48 Eugen Hristev
  2022-04-29 14:22 ` [PATCH 2/2] ARM: dts: at91: sam9x60ek: fix eeprom compatible Eugen Hristev
  2022-05-02  4:30 ` [PATCH 1/2] misc: i2c_eeprom: add support for microchip 24aa025e48 Heiko Schocher
@ 2022-05-02  9:24 ` Michael Walle
  2022-05-10  7:44   ` Eugen.Hristev
  2 siblings, 1 reply; 6+ messages in thread
From: Michael Walle @ 2022-05-02  9:24 UTC (permalink / raw)
  To: eugen.hristev; +Cc: hs, rasmus.villemoes, u-boot, Michael Walle

> 24aa025e48 is a variant of 24aa02e48 that has a page size of 16 bytes.
> 
> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
> ---
>  drivers/misc/i2c_eeprom.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c
> index 89a450d0f8..265c1d0591 100644
> --- a/drivers/misc/i2c_eeprom.c
> +++ b/drivers/misc/i2c_eeprom.c
> @@ -176,6 +176,13 @@ static const struct i2c_eeprom_drv_data mc24aa02e48_data = {
>  	.offset_len = 1,
>  };
>  
> +static const struct i2c_eeprom_drv_data mc24aa025e48_data = {
> +	.size = 256,
> +	.pagesize = 16,
> +	.addr_offset_mask = 0,
> +	.offset_len = 1,
> +};
> +
>  static const struct i2c_eeprom_drv_data atmel24c01a_data = {
>  	.size = 128,
>  	.pagesize = 8,
> @@ -264,6 +271,7 @@ static const struct i2c_eeprom_drv_data atmel24c512_data = {
>  static const struct udevice_id i2c_eeprom_std_ids[] = {
>  	{ .compatible = "i2c-eeprom", (ulong)&eeprom_data },
>  	{ .compatible = "microchip,24aa02e48", (ulong)&mc24aa02e48_data },
> +	{ .compatible = "microchip,24aa025e48", (ulong)&mc24aa025e48_data },

As far as I can see, this is not a documented compatible string in the
device tree bindings, which means u-boot is diverting again from its linux
counterpart. (The same goes for the 24aa02e48).

-michael

>  	{ .compatible = "atmel,24c01", (ulong)&atmel24c01a_data },
>  	{ .compatible = "atmel,24c01a", (ulong)&atmel24c01a_data },
>  	{ .compatible = "atmel,24c02", (ulong)&atmel24c02_data },

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

* Re: [PATCH 1/2] misc: i2c_eeprom: add support for microchip 24aa025e48
  2022-05-02  9:24 ` Michael Walle
@ 2022-05-10  7:44   ` Eugen.Hristev
  2022-05-10  8:46     ` Heiko Schocher
  0 siblings, 1 reply; 6+ messages in thread
From: Eugen.Hristev @ 2022-05-10  7:44 UTC (permalink / raw)
  To: michael; +Cc: hs, rasmus.villemoes, u-boot

On 5/2/22 12:24 PM, Michael Walle wrote:
>> 24aa025e48 is a variant of 24aa02e48 that has a page size of 16 bytes.
>>
>> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
>> ---
>>   drivers/misc/i2c_eeprom.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c
>> index 89a450d0f8..265c1d0591 100644
>> --- a/drivers/misc/i2c_eeprom.c
>> +++ b/drivers/misc/i2c_eeprom.c
>> @@ -176,6 +176,13 @@ static const struct i2c_eeprom_drv_data mc24aa02e48_data = {
>>        .offset_len = 1,
>>   };
>>
>> +static const struct i2c_eeprom_drv_data mc24aa025e48_data = {
>> +     .size = 256,
>> +     .pagesize = 16,
>> +     .addr_offset_mask = 0,
>> +     .offset_len = 1,
>> +};
>> +
>>   static const struct i2c_eeprom_drv_data atmel24c01a_data = {
>>        .size = 128,
>>        .pagesize = 8,
>> @@ -264,6 +271,7 @@ static const struct i2c_eeprom_drv_data atmel24c512_data = {
>>   static const struct udevice_id i2c_eeprom_std_ids[] = {
>>        { .compatible = "i2c-eeprom", (ulong)&eeprom_data },
>>        { .compatible = "microchip,24aa02e48", (ulong)&mc24aa02e48_data },
>> +     { .compatible = "microchip,24aa025e48", (ulong)&mc24aa025e48_data },
> 
> As far as I can see, this is not a documented compatible string in the
> device tree bindings, which means u-boot is diverting again from its linux
> counterpart. (The same goes for the 24aa02e48).

Hello Michael,

I know. But I thought it was the best way rather than reusing one 
existing compatible and forcing the page size. I can do that if you feel 
it's better.

I have to check how Linux is handling this eeprom as it's using the 
at24c32 compatible which is incorrect. It may be that the at24c32 
compatible with additional properties makes the driver behaving as if 
it's a mc23aa025e48 . Which is not really right... (as the idea above)

Heiko, your thoughts ?

Eugen

> 
> -michael
> 
>>        { .compatible = "atmel,24c01", (ulong)&atmel24c01a_data },
>>        { .compatible = "atmel,24c01a", (ulong)&atmel24c01a_data },
>>        { .compatible = "atmel,24c02", (ulong)&atmel24c02_data },


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

* Re: [PATCH 1/2] misc: i2c_eeprom: add support for microchip 24aa025e48
  2022-05-10  7:44   ` Eugen.Hristev
@ 2022-05-10  8:46     ` Heiko Schocher
  0 siblings, 0 replies; 6+ messages in thread
From: Heiko Schocher @ 2022-05-10  8:46 UTC (permalink / raw)
  To: Eugen.Hristev, michael; +Cc: rasmus.villemoes, u-boot

Hello Eugen,

On 10.05.22 09:44, Eugen.Hristev@microchip.com wrote:
> On 5/2/22 12:24 PM, Michael Walle wrote:
>>> 24aa025e48 is a variant of 24aa02e48 that has a page size of 16 bytes.
>>>
>>> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
>>> ---
>>>   drivers/misc/i2c_eeprom.c | 8 ++++++++
>>>   1 file changed, 8 insertions(+)
>>>
>>> diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c
>>> index 89a450d0f8..265c1d0591 100644
>>> --- a/drivers/misc/i2c_eeprom.c
>>> +++ b/drivers/misc/i2c_eeprom.c
>>> @@ -176,6 +176,13 @@ static const struct i2c_eeprom_drv_data mc24aa02e48_data = {
>>>        .offset_len = 1,
>>>   };
>>>
>>> +static const struct i2c_eeprom_drv_data mc24aa025e48_data = {
>>> +     .size = 256,
>>> +     .pagesize = 16,
>>> +     .addr_offset_mask = 0,
>>> +     .offset_len = 1,
>>> +};
>>> +
>>>   static const struct i2c_eeprom_drv_data atmel24c01a_data = {
>>>        .size = 128,
>>>        .pagesize = 8,
>>> @@ -264,6 +271,7 @@ static const struct i2c_eeprom_drv_data atmel24c512_data = {
>>>   static const struct udevice_id i2c_eeprom_std_ids[] = {
>>>        { .compatible = "i2c-eeprom", (ulong)&eeprom_data },
>>>        { .compatible = "microchip,24aa02e48", (ulong)&mc24aa02e48_data },
>>> +     { .compatible = "microchip,24aa025e48", (ulong)&mc24aa025e48_data },
>>
>> As far as I can see, this is not a documented compatible string in the
>> device tree bindings, which means u-boot is diverting again from its linux
>> counterpart. (The same goes for the 24aa02e48).
> 
> Hello Michael,
> 
> I know. But I thought it was the best way rather than reusing one 
> existing compatible and forcing the page size. I can do that if you feel 
> it's better.
> 
> I have to check how Linux is handling this eeprom as it's using the 
> at24c32 compatible which is incorrect. It may be that the at24c32 
> compatible with additional properties makes the driver behaving as if 
> it's a mc23aa025e48 . Which is not really right... (as the idea above)
> 
> Heiko, your thoughts ?

Best would be to find out, what linux do.

I think, you should have the same problem with linux?

So I think, best would be to introduce this 2 compatible strings also
in linux and add of course the correct settings for "24aa025e48".

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs@denx.de

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

end of thread, other threads:[~2022-05-10  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29 14:22 [PATCH 1/2] misc: i2c_eeprom: add support for microchip 24aa025e48 Eugen Hristev
2022-04-29 14:22 ` [PATCH 2/2] ARM: dts: at91: sam9x60ek: fix eeprom compatible Eugen Hristev
2022-05-02  4:30 ` [PATCH 1/2] misc: i2c_eeprom: add support for microchip 24aa025e48 Heiko Schocher
2022-05-02  9:24 ` Michael Walle
2022-05-10  7:44   ` Eugen.Hristev
2022-05-10  8:46     ` Heiko Schocher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.