misc/at24: Add at24c512b eeprom support
Subsystems (4)
PATCH 1/2 misc/at24: Add at24c512b eeprom support
This patch adds at24c512b eeprom support.
The datasheet of at24c512b can be found at:
http://www.alldatasheet.com/datasheet-pdf/pdf/
256958/ATMEL/AT24C512B-TH-B.html
--- Documentation/devicetree/bindings/eeprom.txt | 2 +- drivers/misc/eeprom/at24.c | 1 + 2 files changed, 2 insertions(+), 1 deletions(-)
Documentation/devicetree/bindings/eeprom.txt +1 -1
@@ -6,7 +6,7 @@ Required properties: If there is no specific driver for <manufacturer>, a generic driver based on <type> is selected. Possible types are: 24c00, 24c01, 24c02, 24c04, 24c08, 24c16, 24c32, 24c64, - 24c128, 24c256, 24c512, 24c1024, spd + 24c128, 24c256, 24c512, 24c512b, 24c1024, spd - reg : the I2C address of the EEPROM
drivers/misc/eeprom/at24.c +1 -0
@@ -124,6 +124,7 @@ static const struct i2c_device_id at24_ids[] = { { "24c128", AT24_DEVICE_MAGIC(131072 / 8, AT24_FLAG_ADDR16) }, { "24c256", AT24_DEVICE_MAGIC(262144 / 8, AT24_FLAG_ADDR16) }, { "24c512", AT24_DEVICE_MAGIC(524288 / 8, AT24_FLAG_ADDR16) }, + { "24c512b", AT24_DEVICE_MAGIC(524288 / 8, AT24_FLAG_ADDR16) }, { "24c1024", AT24_DEVICE_MAGIC(1048576 / 8, AT24_FLAG_ADDR16) }, { "at24", 0 }, { /* END OF LIST */ }
Signature · 1 line
1.7.1
PATCH 2/2 ARM: dts: imx51-babbage: Add at24c512b eeprom support
This patch adds at24c512b i2c device to the device tree along with the necessary i2c device node and pinctrl settings for i2c bus.
The eeprom chip is populated on the accessory board of the imx51-babbage board.
--- arch/arm/boot/dts/imx51-babbage.dts | 12 ++++++++++++ arch/arm/boot/dts/imx51.dtsi | 9 +++++++++ 2 files changed, 21 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx51-babbage.dts +12 -0
@@ -241,6 +241,18 @@ }; }; + i2c at 83fc8000 { /* I2C1 */ + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1_1>; + status = "okay"; + + at24 at 50 { + compatible = "at24,24c512b"; + pagesize = <128>; + reg = <0x50>; + }; + }; + audmux at 83fd0000 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_audmux_1>;
arch/arm/boot/dts/imx51.dtsi +9 -0
@@ -311,6 +311,15 @@ }; }; + i2c1 { + pinctrl_i2c1_1: i2c1grp-1 { + fsl,pins = < + 4 0x400001ed /* MX51_PAD_EIM_D16__I2C1_SDA */ + 23 0x400001ed /* MX51_PAD_EIM_D19__I2C1_SCL */ + >; + }; + }; + i2c2 { pinctrl_i2c2_1: i2c2grp-1 { fsl,pins = <
Signature · 1 line
1.7.1
Sascha Hauer
maintainerPATCH 2/2 ARM: dts: imx51-babbage: Add at24c512b eeprom support
Quoted 5 lines · Liu Ying
This patch adds at24c512b i2c device to the device tree along with the necessary i2c device node and pinctrl settings for i2c bus.
The eeprom chip is populated on the accessory board of the imx51-babbage board.
Given that it's optional should the binding be here anyway? I don't have this accessory board and this may conflict with the boards other people have connected on this port.
Sascha
Quoted 55 lines
Signed-off-by Liu Ying <[email protected]>--- arch/arm/boot/dts/imx51-babbage.dts | 12 ++++++++++++ arch/arm/boot/dts/imx51.dtsi | 9 +++++++++ 2 files changed, 21 insertions(+), 0 deletions(-)arch/arm/boot/dts/imx51-babbage.dts +12
-0@@ -241,6 +241,18 @@ }; }; + i2c at 83fc8000 { /* I2C1 */ + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1_1>; + status = "okay"; + + at24 at 50 { + compatible = "at24,24c512b"; + pagesize = <128>; + reg = <0x50>; + }; + }; + audmux at 83fd0000 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_audmux_1>;arch/arm/boot/dts/imx51.dtsi +9
-0@@ -311,6 +311,15 @@ }; }; + i2c1 { + pinctrl_i2c1_1: i2c1grp-1 { + fsl,pins = < + 4 0x400001ed /* MX51_PAD_EIM_D16__I2C1_SDA */ + 23 0x400001ed /* MX51_PAD_EIM_D19__I2C1_SCL */ + >; + }; + }; + i2c2 { pinctrl_i2c2_1: i2c2grp-1 { fsl,pins = <Signature · 1 line
1.7.1
Signature · 4 lines
Pengutronix e.K. | | 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 |
PATCH 2/2 ARM: dts: imx51-babbage: Add at24c512b eeprom support
2013/1/23 Sascha Hauer <[email protected]>:
Quoted 7 lines · Liu Ying
Quoted 5 lines
This patch adds at24c512b i2c device to the device tree along with the necessary i2c device node and pinctrl settings for i2c bus.
The eeprom chip is populated on the accessory board of the imx51-babbage board.
Quoted 5 lines
Given that it's optional should the binding be here anyway? I don't have this accessory board and this may conflict with the boards other people have connected on this port.
Sascha
Understand your concern. Is there any way to handle this? How can we support the present accessory board correctly? More generally, not all main boards can figure out what kind of accessory board is attached to them, at least, some main boards can only figure out limited number of accessory boards by using some ways of board ID check.
Quoted 62 lines
Quoted 52 lines
Signed-off-by Liu Ying <[email protected]>--- arch/arm/boot/dts/imx51-babbage.dts | 12 ++++++++++++ arch/arm/boot/dts/imx51.dtsi | 9 +++++++++ 2 files changed, 21 insertions(+), 0 deletions(-)arch/arm/boot/dts/imx51-babbage.dts +12
-0@@ -241,6 +241,18 @@ }; }; + i2c at 83fc8000 { /* I2C1 */ + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1_1>; + status = "okay"; + + at24 at 50 { + compatible = "at24,24c512b"; + pagesize = <128>; + reg = <0x50>; + }; + }; + audmux at 83fd0000 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_audmux_1>;arch/arm/boot/dts/imx51.dtsi +9
-1@@ -311,6 +311,15 @@ }; }; + i2c1 { + pinctrl_i2c1_1: i2c1grp-1 { + fsl,pins = < + 4 0x400001ed /* MX51_PAD_EIM_D16__I2C1_SDA */ + 23 0x400001ed /* MX51_PAD_EIM_D19__I2C1_SCL */ + >; + }; + }; + i2c2 { pinctrl_i2c2_1: i2c2grp-1 { fsl,pins = < --Quoted 4 lines
1.7.1
--
Pengutronix e.K. | | 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 |
Signature · 2 lines
Best Regards, Liu Ying
Sascha Hauer
maintainerPATCH 2/2 ARM: dts: imx51-babbage: Add at24c512b eeprom support
Quoted 12 lines · Liu Ying
2013/1/23 Sascha Hauer <[email protected]>:
Quoted 11 lines · Liu Ying
Quoted 5 lines
This patch adds at24c512b i2c device to the device tree along with the necessary i2c device node and pinctrl settings for i2c bus.
The eeprom chip is populated on the accessory board of the imx51-babbage board.Given that it's optional should the binding be here anyway? I don't have this accessory board and this may conflict with the boards other people have connected on this port.
Quoted 7 lines
Quoted 1 line
Sascha
Understand your concern. Is there any way to handle this? How can we support the present accessory board correctly? More generally, not all main boards can figure out what kind of accessory board is attached to them, at least, some main boards can only figure out limited number of accessory boards by using some ways of board ID check.
We don't have support for such things atm. We'll have to wait for
OF: Introduce DT overlay support.
Pantelis Antoniou is working on this currently.
Sascha
Signature · 4 lines
Pengutronix e.K. | | 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 |
PATCH 2/2 ARM: dts: imx51-babbage: Add at24c512b eeprom support
2013/1/23 Sascha Hauer <[email protected]>:
Quoted 27 lines · Liu Ying
Quoted 12 lines
2013/1/23 Sascha Hauer <[email protected]>:
Quoted 11 lines · Liu Ying
Quoted 5 lines
This patch adds at24c512b i2c device to the device tree along with the necessary i2c device node and pinctrl settings for i2c bus.
The eeprom chip is populated on the accessory board of the imx51-babbage board.Given that it's optional should the binding be here anyway? I don't have this accessory board and this may conflict with the boards other people have connected on this port.
Quoted 7 lines
Quoted 1 line
Sascha
Understand your concern. Is there any way to handle this? How can we support the present accessory board correctly? More generally, not all main boards can figure out what kind of accessory board is attached to them, at least, some main boards can only figure out limited number of accessory boards by using some ways of board ID check.
We don't have support for such things atm. We'll have to wait for
OF: Introduce DT overlay support.
Pantelis Antoniou is working on this currently.
Quoted 8 lines
Sascha
--
Pengutronix e.K. | | 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 |
Good to know that. Thanks.
Signature · 2 lines
Best Regards, Liu Ying
PATCH 1/2 misc/at24: Add at24c512b eeprom support
In reply to Liu YingQuoted 6 lines · Liu Ying
This patch adds at24c512b eeprom support.
The datasheet of at24c512b can be found at:
http://www.alldatasheet.com/datasheet-pdf/pdf/
256958/ATMEL/AT24C512B-TH-B.htmlSigned-off-by Liu Ying <[email protected]>
Arnd Bergmann is the misc maintainer, route this by him.
Yours,
Linus Walleij
PATCH 1/2 misc/at24: Add at24c512b eeprom support
Quoted 10 lines · Linus Walleij
Quoted 6 lines · Liu Ying
This patch adds at24c512b eeprom support.
The datasheet of at24c512b can be found at:
http://www.alldatasheet.com/datasheet-pdf/pdf/
256958/ATMEL/AT24C512B-TH-B.htmlSigned-off-by Liu Ying <[email protected]>Arnd Bergmann is the misc maintainer, route this by him.
I usually take at24 patches via my I2C tree.
But not this one, though. The 512b can equally use the 512 entry. The devicetree should contain both entries, the 512 one as a fallback. (And the vendor is not "at24"!)
Regards,
Wolfram
Signature · 9 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130123/86f5b0b3/attachment.sig>
PATCH 1/2 misc/at24: Add at24c512b eeprom support
2013/1/23 Wolfram Sang <[email protected]>:
Quoted 10 lines · Linus Walleij
Quoted 9 lines · Liu Ying
Quoted 7 lines
This patch adds at24c512b eeprom support.
The datasheet of at24c512b can be found at:
http://www.alldatasheet.com/datasheet-pdf/pdf/
256958/ATMEL/AT24C512B-TH-B.htmlSigned-off-by Liu Ying <[email protected]>
Quoted 7 lines
Quoted 1 line
Arnd Bergmann is the misc maintainer, route this by him.
I usually take at24 patches via my I2C tree.
But not this one, though. The 512b can equally use the 512 entry. The devicetree should contain both entries, the 512 one as a fallback. (And the vendor is not "at24"!)
There are some difference between 24c512 and 24c512b about the system reset procedure, according to the two devices' spec:
24c512b:(a) Create a start bit condition, (b)clock 9 cycles, (c) create another start bit followed by stop bit condition. 24c512:(a) Clock up to 9 cycles, (b) look for SDA high in each cycle while SCL is high and then, (c) create a start condition as SDA is high.
Could this be a reason to add an entry for 24c512b?
About the vendor name, I took the at24c32 node inarch/arm/boot/dts/imx28-evk.dts as a reference:
at24 at 51 {
compatible = "at24,24c32";
pagesize = <32>;
reg = <0x51>;
};Now, I think the correct vendor name should be "at" or "atmel".
Thanks.
Quoted 8 lines
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Signature · 2 lines
Best Regards, Liu Ying
PATCH 1/2 misc/at24: Add at24c512b eeprom support
Hi,
Quoted 8 lines
There are some difference between 24c512 and 24c512b about the system reset procedure, according to the two devices' spec:
24c512b:(a) Create a start bit condition, (b)clock 9 cycles, (c) create another start bit followed by stop bit condition. 24c512:(a) Clock up to 9 cycles, (b) look for SDA high in each cycle while SCL is high and then, (c) create a start condition as SDA is high.
Could this be a reason to add an entry for 24c512b?
Since the entries in at24_ids[] are the same, no. If they would differ, that is a reason.
Quoted 1 line
Now, I think the correct vendor name should be "at" or "atmel".
"atmel" would be better, but the MX28EVK doesn't even have an I2C eeprom by default IIRC? But that is unrelated to your patch.
Signature · 9 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130123/dab379ec/attachment.sig>
PATCH 1/2 misc/at24: Add at24c512b eeprom support
2013/1/23 Wolfram Sang <[email protected]>:
Quoted 11 lines
Hi,
Quoted 8 lines
There are some difference between 24c512 and 24c512b about the system reset procedure, according to the two devices' spec:
24c512b:(a) Create a start bit condition, (b)clock 9 cycles, (c) create another start bit followed by stop bit condition. 24c512:(a) Clock up to 9 cycles, (b) look for SDA high in each cycle while SCL is high and then, (c) create a start condition as SDA is high.
Could this be a reason to add an entry for 24c512b?
Quoted 2 lines
Since the entries in at24_ids[] are the same, no. If they would differ, that is a reason.
The names of the two entries are not the same, one is "24c512", the other is "24c512b".
My original idea to add the new entry is to count on the name difference to do different system reset operations.
Quoted 5 lines
Quoted 2 lines
Now, I think the correct vendor name should be "at" or "atmel".
"atmel" would be better, but the MX28EVK doesn't even have an I2C eeprom by default IIRC? But that is unrelated to your patch.
The commit message of the patch which adds 24c32 support for MX28EVK tells that "mx28evk has a free slot U50 that can be used to populate an I2C EEPROM.".
Quoted 4 lines
--
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Signature · 2 lines
Best Regards, Liu Ying
PATCH 1/2 misc/at24: Add at24c512b eeprom support
Quoted 3 lines
The names of the two entries are not the same, one is "24c512", the other is "24c512b".
I do understand that. There are TONS of 24c512 variants out there.
Quoted 2 lines
My original idea to add the new entry is to count on the name difference to do different system reset operations.
Your devicetree may have both names, but at24 doesn't need it since there is no code involved handling the difference.
Quoted 3 lines
The commit message of the patch which adds 24c32 support for MX28EVK tells that "mx28evk has a free slot U50 that can be used to populate an I2C EEPROM.".
I do know that, too. You can put other things there, too. But well, not worth the hazzle...
Signature · 9 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130123/f1167045/attachment.sig>
PATCH 1/2 misc/at24: Add at24c512b eeprom support
2013/1/23 Wolfram Sang <[email protected]>:
Quoted 12 lines
Quoted 3 lines
The names of the two entries are not the same, one is "24c512", the other is "24c512b".
I do understand that. There are TONS of 24c512 variants out there.
Quoted 2 lines
My original idea to add the new entry is to count on the name difference to do different system reset operations.
Your devicetree may have both names, but at24 doesn't need it since there is no code involved handling the difference.
Quoted 6 lines
Quoted 3 lines
The commit message of the patch which adds 24c32 support for MX28EVK tells that "mx28evk has a free slot U50 that can be used to populate an I2C EEPROM.".
I do know that, too. You can put other things there, too. But well, not worth the hazzle...
I accept your comments on this patch. Thanks for your review!
Quoted 13 lines
--
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)iEYEARECAAYFAlD/8FUACgkQD27XaX1/VRsmGgCeJZCaByj0gw37lr753wxW0npY 06oAn0WAmYiUabRNgQ6eAmcO7Ky3f1U4
=JSKP
-----END PGP SIGNATURE-----
Signature · 2 lines
Best Regards, Liu Ying
PATCH 1/2 misc/at24: Add at24c512b eeprom support
In reply to Wolfram SangQuoted 8 lines · Wolfram Sang
Quoted 7 lines · Linus Walleij
Quoted 5 lines · Liu Ying
This patch adds at24c512b eeprom support.
The datasheet of at24c512b can be found at:
http://www.alldatasheet.com/datasheet-pdf/pdf/
256958/ATMEL/AT24C512B-TH-B.html
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Liu Ying <[email protected]>Arnd Bergmann is the misc maintainer, route this by him.
I usually take at24 patches via my I2C tree.
Oh I didn't mean he'd merge it, I meant route it by him as in "let him have a look at it" :-)
Yours,
Linus Walleij