Skip to contentSkip to conversation

MIPS: Octeon: Register EEPROM device on the I2C bus

PATCH Superseded Yang Shi 4 participants 12 messages Mar 5, 2010 – Mar 8, 2010 11 messages not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yang Shi

author
#0 lore raw

PATCH 1/1 MIPS: Octeon: Register EEPROM device on the I2C bus

An EEPROM resides on 0x50 of I2C bus on CN56xx/57xx board, register this device.

---
 arch/mips/cavium-octeon/octeon-platform.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/mips/cavium-octeon/octeon-platform.c +3 -0
index 62ac30e..5bfa513 100644
@@ -164,6 +164,9 @@ static struct i2c_board_info __initdata octeon_i2c_devices[] = {
 	{
 		I2C_BOARD_INFO("ds1337", 0x68),
 	},
+	{
+		I2C_BOARD_INFO("eeprom", 0x50),
+	},
 };
 
 static int __init octeon_i2c_devices_init(void)
Signature · 1 line
1.6.3.3

A message that is not in the archive (sent off-list or not yet received): 1267772895-25409-1-git-send-email-yang.shi-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org

#2 lore raw

arch/mips/cavium-octeon/octeon-platform.c static struct i2c_board_info __initdata octeon_i2c_devices[] = { · line 169

Quoted 3 lines
arch/mips/cavium-octeon/octeon-platform.c +3 -0
+	{
+		I2C_BOARD_INFO("eeprom", 0x50),
+	},

Is the use of 'eeprom' instead of 'at24' intentional?

Regards

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#4 lore raw
Quoted 7 lines · Wolfram Sang

arch/mips/cavium-octeon/octeon-platform.c static struct i2c_board_info __initdata octeon_i2c_devices[] = { · line 169

Quoted 4 lines
arch/mips/cavium-octeon/octeon-platform.c +3 -0
+	{
+		I2C_BOARD_INFO("eeprom", 0x50),
+	},

Is the use of 'eeprom' instead of 'at24' intentional?

Unfortunately, at24 driver can't work on this board, I must use legacy eeprom.

My config:

#CONFIG_EEPROM_AT24 is not set
CONFIG_EEPROM_LEGACY=y

Regards,
Yang

Quoted 3 lines

Regards

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 5 lines
Quoted 2 lines

Is the use of 'eeprom' instead of 'at24' intentional?

Unfortunately, at24 driver can't work on this board, I must use legacy eeprom.

Well, you are of course free to choose here :)

I'd just be interested if there is a software limitation which prevents you from using AT24. Because, it _should_ work with all kind of eeproms the legacy driver deals with. Otherwise it is probably a bug which needs to be fixed.

Regards,

Wolfram

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#8 lore raw
Quoted 7 lines · Wolfram Sang
Quoted 6 lines
Quoted 3 lines

Is the use of 'eeprom' instead of 'at24' intentional?

Unfortunately, at24 driver can't work on this board, I must use legacy eeprom.

Quoted 6 lines

Well, you are of course free to choose here :)

I'd just be interested if there is a software limitation which prevents you from using AT24. Because, it _should_ work with all kind of eeproms the legacy driver deals with. Otherwise it is probably a bug which needs to be fixed.

Thanks to point out this. Let me take a look at this.

Regards,
Yang

Quoted 5 lines

Regards,

Wolfram

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw

Hi Yang, Wolfram,

Quoted 8 lines · Yang Shi
Quoted 7 lines · Wolfram Sang
Quoted 6 lines
Quoted 3 lines

Is the use of 'eeprom' instead of 'at24' intentional?

Unfortunately, at24 driver can't work on this board, I must use legacy eeprom.

Quoted 8 lines
Quoted 6 lines

Well, you are of course free to choose here :)

I'd just be interested if there is a software limitation which prevents you from using AT24. Because, it _should_ work with all kind of eeproms the legacy driver deals with. Otherwise it is probably a bug which needs to be fixed.

Thanks to point out this. Let me take a look at this.

One limitation of the at24 driver is that it needs the underlying controller to support either raw I2C access or at least I2C block transactions. Konstantin Lazarev complained about that one month ago already.

I am currently working on improving the at24 driver so that it falls back to byte transactions when block transactions are not available. I might also add word transaction support (as the eeprom driver has) as it is often the best performance/compatibility trade-off. I'll post the patch when I'm done.

I'm not yet sure what will happen to the legacy eeprom driver in the long run, but I would prefer new designs to not rely on it.

Signature · 1 line
Jean Delvare

A message that is not in the archive (sent off-list or not yet received): [email protected]

#12 lore raw

Jean Delvare said the following:

Quoted 25 lines

Hi Yang, Wolfram,

Quoted 8 lines · Yang Shi
Quoted 7 lines · Wolfram Sang
Quoted 6 lines
Quoted 3 lines

Is the use of 'eeprom' instead of 'at24' intentional?

Unfortunately, at24 driver can't work on this board, I must use legacy eeprom.

Quoted 8 lines
Quoted 6 lines

Well, you are of course free to choose here :)

I'd just be interested if there is a software limitation which prevents you from using AT24. Because, it _should_ work with all kind of eeproms the legacy driver deals with. Otherwise it is probably a bug which needs to be fixed.

Thanks to point out this. Let me take a look at this.

One limitation of the at24 driver is that it needs the underlying controller to support either raw I2C access or at least I2C block transactions. Konstantin Lazarev complained about that one month ago already.

Quoted 9 lines

I am currently working on improving the at24 driver so that it falls back to byte transactions when block transactions are not available. I might also add word transaction support (as the eeprom driver has) as it is often the best performance/compatibility trade-off. I'll post the patch when I'm done.

I'm not yet sure what will happen to the legacy eeprom driver in the long run, but I would prefer new designs to not rely on it.

If I don't get all wrong, my 2 Cents:
i2c-octeon will/should be based on raw i2c from kernel version .34 on. (my patch :-) ) So it should support all transfer modes that i2c can. Currently it is limited to 8 bytes per transaction.

If I misunderstood something, please ignore the noise.

Signature · 2 lines
KR
Michael

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#14 lore raw

Hi guys,

Thanks for you guys kind advice. I think I find the cause. I coded a wrong eeprom type, "at24" can't work here, it should be "24c64". It works with AT24 eeprom driver, but I'm not sure if this is the right type.

So, a possible correct to the patch is that:

+{
+ I2C_BOARD_INFO("24c64",·0x50),
+},

Regards,
Yang

Quoted 49 lines · Michael Lawnick

Jean Delvare said the following:

Quoted 28 lines

Hi Yang, Wolfram,

Quoted 10 lines · Yang Shi
Quoted 8 lines · Wolfram Sang
Quoted 8 lines
Quoted 4 lines

Is the use of 'eeprom' instead of 'at24' intentional?

Unfortunately, at24 driver can't work on this board, I must use legacy eeprom.

Quoted 9 lines
Quoted 7 lines

Well, you are of course free to choose here :)

I'd just be interested if there is a software limitation which prevents you from using AT24. Because, it _should_ work with all kind of eeproms the legacy driver deals with. Otherwise it is probably a bug which needs to be fixed.

Thanks to point out this. Let me take a look at this.

One limitation of the at24 driver is that it needs the underlying controller to support either raw I2C access or at least I2C block transactions. Konstantin Lazarev complained about that one month ago already.

Quoted 10 lines

I am currently working on improving the at24 driver so that it falls back to byte transactions when block transactions are not available. I might also add word transaction support (as the eeprom driver has) as it is often the best performance/compatibility trade-off. I'll post the patch when I'm done.

I'm not yet sure what will happen to the legacy eeprom driver in the long run, but I would prefer new designs to not rely on it.

If I don't get all wrong, my 2 Cents:
i2c-octeon will/should be based on raw i2c from kernel version .34 on. (my patch :-) ) So it should support all transfer modes that i2c can. Currently it is limited to 8 bytes per transaction.

If I misunderstood something, please ignore the noise.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#16 lore raw
Quoted 5 lines · Yang Shi

Hi guys,

Thanks for you guys kind advice. I think I find the cause. I coded a wrong eeprom type, "at24" can't work here, it should be "24c64". It works with AT24 eeprom driver, but I'm not sure if this is the right type.

Actually, "at24" can work but you have to provide extra parameters detailing the size, page size etc. of the EEPROM. All the "24cXX" names are shortcuts with predefined sizes.

Review

Quoted 6 lines

So, a possible correct to the patch is that:

(quoted diff) +3 -0
+{
+    I2C_BOARD_INFO("24c64",·0x50),
+},

Well, what EEPROM type do you have exactly? 24c64 is for 64 kbit (8 kByte) EEPROMs using 16-bit addressing. You must use the correct type, otherwise the at24 driver will misbehave. I am a little surprised because originally you went for "eeprom" which is not compatible with "24c64" (8-bit vs. 16-bit addressing).

Also note that you may want to provide specific page size if you have tight control over what hardware is used and you intend to write to the EEPROM on a regular basis. The driver defaults to safe but slow settings.

OTOH, if you do _not_ want to write to the EEPROM, you want to provide the AT24_FLAG_READONLY flag.

Signature · 1 line
Jean Delvare

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#19 lore raw

Hi Michael,

Quoted 7 lines · Michael Lawnick

Jean Delvare said the following:

Quoted 5 lines

Well, what EEPROM type do you have exactly? 24c64 is for 64 kbit (8 kByte) EEPROMs using 16-bit addressing. You must use the correct type, otherwise the at24 driver will misbehave. I am a little surprised because originally you went for "eeprom" which is not compatible with "24c64" (8-bit vs. 16-bit addressing).

Quoted 5 lines

Furthermore this brings up another issue:
0x50 typically is SPD-eeprom (DDR initialisation). Corrupting the contents might make your board unbootable - and using a 16bit driver instead of an 8-bit one can corrupt your contents already on (positioned) reading!

This is totally correct, but better said loud to the list and the original poster than only privately to me ;)

Signature · 1 line
Jean Delvare

A message that is not in the archive (sent off-list or not yet received): [email protected]

#21 lore raw

Jean Delvare said the following:

Quoted 10 lines

Hi Michael,

Quoted 7 lines · Michael Lawnick

Jean Delvare said the following:

Quoted 5 lines

Well, what EEPROM type do you have exactly? 24c64 is for 64 kbit (8 kByte) EEPROMs using 16-bit addressing. You must use the correct type, otherwise the at24 driver will misbehave. I am a little surprised because originally you went for "eeprom" which is not compatible with "24c64" (8-bit vs. 16-bit addressing).

Quoted 9 lines
Quoted 5 lines

Furthermore this brings up another issue:
0x50 typically is SPD-eeprom (DDR initialisation). Corrupting the contents might make your board unbootable - and using a 16bit driver instead of an 8-bit one can corrupt your contents already on (positioned) reading!

This is totally correct, but better said loud to the list and the original poster than only privately to me ;)

sh.., :-(

author
#22 lore raw
In reply to a message not in the archive
Quoted 19 lines · Jean Delvare

Hi Michael,

Quoted 8 lines · Michael Lawnick

Jean Delvare said the following:

Quoted 6 lines

Well, what EEPROM type do you have exactly? 24c64 is for 64 kbit (8 kByte) EEPROMs using 16-bit addressing. You must use the correct type, otherwise the at24 driver will misbehave. I am a little surprised because originally you went for "eeprom" which is not compatible with "24c64" (8-bit vs. 16-bit addressing).

Quoted 6 lines

Furthermore this brings up another issue:
0x50 typically is SPD-eeprom (DDR initialisation). Corrupting the contents might make your board unbootable - and using a 16bit driver instead of an 8-bit one can corrupt your contents already on (positioned) reading!

Quoted 3 lines

This is totally correct, but better said loud to the list and the original poster than only privately to me ;)

Thanks a lot to point out this.

I double checked the manual, the eeprom is SPD of the DIMMs.

I will rework my patch, then send V2 soon.

Regards,
Yang