24c08 contains four 256B blocks which are addresses by last two bits.
Linux at24 driver automatically detects number of addresses based on
this algorithm.
num_addresses = DIV_ROUND_UP(chip.byte_len,
(chip.flags & AT24_FLAG_ADDR16) ? 65536 : 256);
for 24c08 it is 4 addresses where driver create one regular device
and 3 dummy devices.
These dummy devices were causing problem when kernel tries to create
another eeprom device on already allocated addresses which were
in collision with dummy devices.
Error log:
[ 3.124001] i2c i2c-6: Failed to register i2c client 24c08 at 0x55
(-16)
[ 3.124005] i2c i2c-6: of_i2c: Failure registering
/amba/i2c@
ff030000/i2cswitch@74/i2c@0/eeprom@55
[ 3.124012] i2c i2c-6: Failed to register i2c client 24c08 at 0x56
(-16)
[ 3.124015] i2c i2c-6: of_i2c: Failure registering
/amba/i2c@
ff030000/i2cswitch@74/i2c@0/eeprom@56
[ 3.124022] i2c i2c-6: Failed to register i2c client 24c08 at 0x57
(-16)
[ 3.124025] i2c i2c-6: of_i2c: Failure registering
/amba/i2c@
ff030000/i2cswitch@74/i2c@0/eeprom@57
This patch removes incorrect eeprom devices which were detect via U-Boot
but it is same device with 4 blocks on 4 different addresses.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
- /* IIC_EEPROM */
+ /*
+ * IIC_EEPROM 1kB memory which uses 256B blocks
+ * where every block has different address.
+ * 0 - 256B address 0x54
+ * 256B - 512B address 0x55
+ * 512B - 768B address 0x56
+ * 768B - 1024B address 0x57
+ */
eeprom@54 { /* u23 */
compatible = "at,24c08";
reg = <0x54>;
};
-
- eeprom@55 { /* u-boot detection */
- compatible = "at,24c08";
- reg = <0x55>;
- };
-
- eeprom@56 { /* u-boot detection */
- compatible = "at,24c08";
- reg = <0x56>;
- };
-
- eeprom@57 { /* u-boot detection */
- compatible = "at,24c08";
- reg = <0x57>;
- };
};
i2c@1 { /* i2c mw 74 0 2 */
#address-cells = <1>;