xref: /OK3568_Linux_fs/kernel/Documentation/misc-devices/eeprom.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun====================
2*4882a593SmuzhiyunKernel driver eeprom
3*4882a593Smuzhiyun====================
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunSupported chips:
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun  * Any EEPROM chip in the designated address range
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun    Prefix: 'eeprom'
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun    Addresses scanned: I2C 0x50 - 0x57
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun    Datasheets: Publicly available from:
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun                Atmel (www.atmel.com),
16*4882a593Smuzhiyun                Catalyst (www.catsemi.com),
17*4882a593Smuzhiyun                Fairchild (www.fairchildsemi.com),
18*4882a593Smuzhiyun                Microchip (www.microchip.com),
19*4882a593Smuzhiyun                Philips (www.semiconductor.philips.com),
20*4882a593Smuzhiyun                Rohm (www.rohm.com),
21*4882a593Smuzhiyun                ST (www.st.com),
22*4882a593Smuzhiyun                Xicor (www.xicor.com),
23*4882a593Smuzhiyun                and others.
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun        ========= ============= ============================================
26*4882a593Smuzhiyun        Chip      Size (bits)   Address
27*4882a593Smuzhiyun        ========= ============= ============================================
28*4882a593Smuzhiyun        24C01     1K            0x50 (shadows at 0x51 - 0x57)
29*4882a593Smuzhiyun        24C01A    1K            0x50 - 0x57 (Typical device on DIMMs)
30*4882a593Smuzhiyun        24C02     2K            0x50 - 0x57
31*4882a593Smuzhiyun        24C04     4K            0x50, 0x52, 0x54, 0x56
32*4882a593Smuzhiyun                                (additional data at 0x51, 0x53, 0x55, 0x57)
33*4882a593Smuzhiyun        24C08     8K            0x50, 0x54 (additional data at 0x51, 0x52,
34*4882a593Smuzhiyun                                0x53, 0x55, 0x56, 0x57)
35*4882a593Smuzhiyun        24C16     16K           0x50 (additional data at 0x51 - 0x57)
36*4882a593Smuzhiyun        Sony      2K            0x57
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun        Atmel     34C02B  2K    0x50 - 0x57, SW write protect at 0x30-37
39*4882a593Smuzhiyun        Catalyst  34FC02  2K    0x50 - 0x57, SW write protect at 0x30-37
40*4882a593Smuzhiyun        Catalyst  34RC02  2K    0x50 - 0x57, SW write protect at 0x30-37
41*4882a593Smuzhiyun        Fairchild 34W02   2K    0x50 - 0x57, SW write protect at 0x30-37
42*4882a593Smuzhiyun        Microchip 24AA52  2K    0x50 - 0x57, SW write protect at 0x30-37
43*4882a593Smuzhiyun        ST        M34C02  2K    0x50 - 0x57, SW write protect at 0x30-37
44*4882a593Smuzhiyun        ========= ============= ============================================
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun
47*4882a593SmuzhiyunAuthors:
48*4882a593Smuzhiyun        - Frodo Looijaard <frodol@dds.nl>,
49*4882a593Smuzhiyun        - Philip Edelbrock <phil@netroedge.com>,
50*4882a593Smuzhiyun        - Jean Delvare <jdelvare@suse.de>,
51*4882a593Smuzhiyun        - Greg Kroah-Hartman <greg@kroah.com>,
52*4882a593Smuzhiyun        - IBM Corp.
53*4882a593Smuzhiyun
54*4882a593SmuzhiyunDescription
55*4882a593Smuzhiyun-----------
56*4882a593Smuzhiyun
57*4882a593SmuzhiyunThis is a simple EEPROM module meant to enable reading the first 256 bytes
58*4882a593Smuzhiyunof an EEPROM (on a SDRAM DIMM for example). However, it will access serial
59*4882a593SmuzhiyunEEPROMs on any I2C adapter. The supported devices are generically called
60*4882a593Smuzhiyun24Cxx, and are listed above; however the numbering for these
61*4882a593Smuzhiyunindustry-standard devices may vary by manufacturer.
62*4882a593Smuzhiyun
63*4882a593SmuzhiyunThis module was a programming exercise to get used to the new project
64*4882a593Smuzhiyunorganization laid out by Frodo, but it should be at least completely
65*4882a593Smuzhiyuneffective for decoding the contents of EEPROMs on DIMMs.
66*4882a593Smuzhiyun
67*4882a593SmuzhiyunDIMMS will typically contain a 24C01A or 24C02, or the 34C02 variants.
68*4882a593SmuzhiyunThe other devices will not be found on a DIMM because they respond to more
69*4882a593Smuzhiyunthan one address.
70*4882a593Smuzhiyun
71*4882a593SmuzhiyunDDC Monitors may contain any device. Often a 24C01, which responds to all 8
72*4882a593Smuzhiyunaddresses, is found.
73*4882a593Smuzhiyun
74*4882a593SmuzhiyunRecent Sony Vaio laptops have an EEPROM at 0x57. We couldn't get the
75*4882a593Smuzhiyunspecification, so it is guess work and far from being complete.
76*4882a593Smuzhiyun
77*4882a593SmuzhiyunThe Microchip 24AA52/24LCS52, ST M34C02, and others support an additional
78*4882a593Smuzhiyunsoftware write protect register at 0x30 - 0x37 (0x20 less than the memory
79*4882a593Smuzhiyunlocation). The chip responds to "write quick" detection at this address but
80*4882a593Smuzhiyundoes not respond to byte reads. If this register is present, the lower 128
81*4882a593Smuzhiyunbytes of the memory array are not write protected. Any byte data write to
82*4882a593Smuzhiyunthis address will write protect the memory array permanently, and the
83*4882a593Smuzhiyundevice will no longer respond at the 0x30-37 address. The eeprom driver
84*4882a593Smuzhiyundoes not support this register.
85*4882a593Smuzhiyun
86*4882a593SmuzhiyunLacking functionality
87*4882a593Smuzhiyun---------------------
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun* Full support for larger devices (24C04, 24C08, 24C16). These are not
90*4882a593Smuzhiyun  typically found on a PC. These devices will appear as separate devices at
91*4882a593Smuzhiyun  multiple addresses.
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun* Support for really large devices (24C32, 24C64, 24C128, 24C256, 24C512).
94*4882a593Smuzhiyun  These devices require two-byte address fields and are not supported.
95*4882a593Smuzhiyun
96*4882a593Smuzhiyun* Enable Writing. Again, no technical reason why not, but making it easy
97*4882a593Smuzhiyun  to change the contents of the EEPROMs (on DIMMs anyway) also makes it easy
98*4882a593Smuzhiyun  to disable the DIMMs (potentially preventing the computer from booting)
99*4882a593Smuzhiyun  until the values are restored somehow.
100*4882a593Smuzhiyun
101*4882a593SmuzhiyunUse
102*4882a593Smuzhiyun---
103*4882a593Smuzhiyun
104*4882a593SmuzhiyunAfter inserting the module (and any other required SMBus/i2c modules), you
105*4882a593Smuzhiyunshould have some EEPROM directories in ``/sys/bus/i2c/devices/*`` of names such
106*4882a593Smuzhiyunas "0-0050". Inside each of these is a series of files, the eeprom file
107*4882a593Smuzhiyuncontains the binary data from EEPROM.
108