# EEPROM software configuration

Source: [https://docs.qualcomm.com/doc/80-88500-1/topic/85_EEPROM_software_configuration.html](https://docs.qualcomm.com/doc/80-88500-1/topic/85_EEPROM_software_configuration.html)

The EEPROM has an associated XML configuration file used to define calibration
      parameters such as PDAF, lens shading calibration (LSC), autofocus (AF), dual camera, and
      white balance data.

The entire settings are enclosed in the
        `<EEPROMDriverData></EEPROMDriverData>` node of this XML file.

**Parent Topic:** [EEPROM configuration](https://docs.qualcomm.com/doc/80-88500-1/topic/84_EEPROM_bring_up_guidelines.html)

## slaveInfo node

Source: [https://docs.qualcomm.com/doc/80-88500-1/topic/85_EEPROM_software_configuration.html](https://docs.qualcomm.com/doc/80-88500-1/topic/85_EEPROM_software_configuration.html)

The `slaveInfo` node contains the information that is used by the driver to power
      on or off the EEPROM device. Configuring this node is optional in kernel probe, as in kernel
      probe the EEPROM device tree node contains this information.

Table : EEPROM slaveInfo

| Field | Description |
| --- | --- |
| `slaveInfo` | Contains the sensor slave information and power settings. |
| `EEPROMName` | Name of the EEPROM.<br><br><br>              <br>Example: atmel\_at24c32e |
| `slaveAddress` | 8‑bit or 10‑bit slave address. Example: 0xa0 |
| `regAddrType` | Register address or data size in bytes. Example 2:<br><br><br>              <ul class="ul"><br>                <li class="li">1 = byte address</li><br><br>                <li class="li">2 = word address</li><br><br>                <li class="li">3 = 3‑byte address</li><br><br>                <li class="li">4 = address type max</li><br><br>              </ul> |
| `regDataType` | Register address or data size in bytes. Example 1:<br><br><br>              <ul class="ul"><br>                <li class="li">1 = byte data</li><br><br>                <li class="li">2 = word data</li><br><br>                <li class="li">3 = double word data</li><br><br>                <li class="li">4 = Data type max</li><br><br>              </ul> |
| `i2cFrequencyMode` | I^2^C frequency mode of slave. Example: FAST<br><br><br>              <br>The supported modes are: <ul class="ul" id="slaveInfo_node_87__ul_wnq_2tb_bxb"><br>                  <li class="li">STANDARD (100 kHz)</li><br><br>                  <li class="li">FAST (400 kHz)</li><br><br>                  <li class="li">FAST_PLUS (1 MHz)</li><br><br>                  <li class="li">CUSTOM (custom frequency in DTSI)</li><br><br>                </ul> |
| `powerUpSequence` | Contains the power-up configuration sequence required to control the power to the<br>                device while turning it on.<br><br><br>              <ul class="ul"><br>                <li class="li"><code class="ph codeph">powerSetting</code>: contains power configuration type, value, and<br>                  delay. </li><br><br>                <li class="li"><code class="ph codeph">configType</code>: Power configuration type. The supported types are:<ul class="ul"><br>                    <li class="li">MCLK</li><br><br>                    <li class="li">VANA</li><br><br>                    <li class="li">VDIG</li><br><br>                    <li class="li">VIO</li><br><br>                    <li class="li">VAF</li><br><br>                    <li class="li">RESET</li><br><br>                    <li class="li">STANDBY</li><br><br>                  </ul><br></li><br><br>                <li class="li"><code class="ph codeph">configValue</code>: value for the specified type or 0, to use the<br>                  default value.</li><br><br>                <li class="li"><code class="ph codeph">delayMs</code>: delay in milliseconds.</li><br><br>              </ul><br><br>              <br>Example: <br><br>    <powerUpSequence><br>    <powerSetting><br>    <configType>VIO</configType><br>    <configValue>0</configValue><br>    <delayMs>0</delayMs><br>    Copy to clipboard |
| `moduleType` | Type of sensor module. The supported types are: <ul class="ul" id="slaveInfo_node_87__ul_dzn_ftb_bxb"><br>                  <li class="li">REAL</li><br><br>                  <li class="li">VIRTUAL</li><br><br>                  <li class="li">EXTERNAL</li><br><br>                </ul> |

## memoryMap node

Source: [https://docs.qualcomm.com/doc/80-88500-1/topic/85_EEPROM_software_configuration.html](https://docs.qualcomm.com/doc/80-88500-1/topic/85_EEPROM_software_configuration.html)

The memory map node contains the information that the driver requires to read the one-time
      programmable (OTP) data from EEPROM. Configuring this node is optional in the kernel probe
      because this information is available in the EEPROM device tree node. But minimum one set of
      nodes must be configured, containing the READ operation and the total size of the data in
        `registerData`. To read the total size of the data for multiple sets of
        `regSetting` nodes, the information is calculated as the sum off all the
        `registerData` values corresponding to the READ operation.

Table : EEPROM memoryMap

| Field | Description |
| --- | --- |
| `memoryMap` | Contains `regSetting` node, which has details for read, write, and<br>                poll operations. This field can contain multiple sets of `regSetting`<br>                nodes. |
| `regSetting` | Contains the<br>                  `slaveAddr`,`registerAddr`,`registerData`,`regAddrType`,`regDataType`,`operation`,`delayUS`<br>                fields.<br><br><br>              <br>Example:<br><br><br>              <br><br>    <regSetting> <br>    <slaveAddr>0xa0</slaveAddr> <br>    <registerAddr>0x00</registerAddr> <br>    <registerData>700</registerData> <br>    <regAddrType >2</regAddrType> <br>    <regDataType>1</regDataType><br>    <operation>READ</operation> <br>    <delayUs>0</delayUs> </regSetting> <br>    <regSetting> <br>    <slaveAddr>0xa1</slaveAddr> <br>    <registerAddr>0x00</registerAddr> <br>    <registerData>800</registerData> <br>    <regAddrType >2</regAddrType> <br>    <regDataType>1</regDataType> <br>    <operation>READ</operation> <br>    <delayUs>0</delayUs> </regSetting> Copy to clipboard |
| `slaveAddr` | Slave address to communicate with the device. Supports both 8‑bit and 10‑bit slave<br>                address.<br><br><br>              <br>Example: 0xa0 |
| `registerAddr` | The register address that is accessed.<br><br><br>              <br>Example: 0x00 |
| `registerData` | Register data to be programmed or read.<ul class="ul" id="memoryMap_node_88__ul_z5d_kqx_pxb_auppara_05-29-23-1829-56-862"><br>                  <li class="li">For WRITE operation, <code class="ph codeph">registerData</code> is the data value to be<br>                    written into the specified register address. Example: 0x02.</li><br><br>                  <li class="li">For READ operation, <code class="ph codeph">registerData</code> is the number of bytes to be<br>                    read from the specified register address. Example: 1584.</li><br><br>                  <li class="li">For POLL operation, <code class="ph codeph">registerData</code> is the value for which the<br>                    poll is being done. Example: 0x01.</li><br><br>                </ul> |
| `regAddrType` | Register address type or data size in bytes.<br><br><br>              <br>Example: 2<br><br><br>              <ul class="ul"><br>                <li class="li">1 = byte address</li><br><br>                <li class="li">2 = word address</li><br><br>                <li class="li">3 = 3‑byte address</li><br><br>                <li class="li">4 = address type max</li><br><br>              </ul> |
| `regDataType` | Register data type or data size in bytes. Example: 1<br><br><br>              <ul class="ul"><br>                <li class="li">1 = byte data</li><br><br>                <li class="li">2 = word data</li><br><br>                <li class="li">3 = double word data</li><br><br>                <li class="li">4 = DT max</li><br><br>              </ul> |
| `operation` | Operation to be performed on EEPROM. The supported operations are: <ul class="ul" id="memoryMap_node_88__ul_gg5_k5b_bxb"><br>                  <li class="li">READ</li><br><br>                  <li class="li">WRITE</li><br><br>                  <li class="li">POLL</li><br><br>                </ul> |
| `delayUs` | Delay in micro seconds.<br><br><br>              <br>Example: 100 |

## formatInfo node

Source: [https://docs.qualcomm.com/doc/80-88500-1/topic/85_EEPROM_software_configuration.html](https://docs.qualcomm.com/doc/80-88500-1/topic/85_EEPROM_software_configuration.html)

The `formatInfo` node contains the information needed to format the OTP data
      obtained from EEPROM. It is not necessary to have all the subfields configured as each EEPROM
      can have some or all types of OTP data and only those fields, whose data is available can be
      configured. In the absence of format data information, raw or unformatted data is published to
      the metadata pool and that can be used to format and obtain the required data from individual
      modules.

Following information is required for formatting the data buffer read from the EEPROM:

- The position of each field, also known as offset with starting position reference as 0.
- Exact number of bits of data of that specific field, that is, size of the field represented in
        the form of mask and endianness to know the byte reading order.

In addition to the raw buffer formatting, this structure can also contain other constants that are not part of the buffer data to be configured.

Table : EEPROM formatInfo

| Field | Description |
| --- | --- |
| `macroMargin` | Margin to be extended towards macro region. Example: 0.3 that is, the new<br>                macro value is:<br><br>`macro = macro + DACRange × 0.3`<br>Where,<br>                  `DACRange = macro - infinity` |
| `AF` | The autofocus (AF) data information to format the AF OTP data. |
| `autoFocusData` | <ul class="ul"><br>                <li class="li"><code class="ph codeph">isAvailable</code>: indicates whether the AF data is available or not<br>                  in the OTP data buffer and valid values are true or false. If this parameter is<br>                  set as false, all the remaining fields under AF node will be ignored. </li><br><br>                <li class="li"><code class="ph codeph">BIG</code> or <code class="ph codeph">LITTLE</code>: indicates type of the<br>                  endianness. </li><br><br>              </ul> |
| `macro` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of macro value in the buffer. Example:<br>                  22</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data read from offset.<br>                  Example: 0xFFF means 2 bytes of data to be read and in that 12 bits contain the<br>                  valid data.</li><br><br>                <li class="li">Mask 0 indicates that particular data is not available in the buffer.</li><br><br>              </ul><br><br>              <br>The same is applicable for all other fields, which need offset and mask<br>                information. |
| `infinity` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of infinity value in the buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `hall` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of hall value in the buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `hallBias` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of hall bias value in the buffer</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data</li><br><br>              </ul> |
| `hallRegisterAddr` | Register address for hall and hall bias to be programmed.<br><br><br>              <br>Example: 0x28 |
| `verticalMacro` | <ul class="ul" id="formatInfo_node_89__ul_fkz_c1z_nxb_auppara_05-22-23-1924-50-430"><br>                <li class="li">offset – Position of the first byte of vertical macro value in the buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `horizontalMacro` | <ul class="ul" id="formatInfo_node_89__ul_nxl_b1z_nxb_auppara_05-22-23-1924-23-735"><br>                <li class="li">offset – Position of the first byte of horizontal macro value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `verticalInfinity` | <ul class="ul" id="formatInfo_node_89__ul_a4l_zzy_nxb_auppara_05-22-23-1923-48-336"><br>                <li class="li">offset – Position of the first byte of vertical infinity value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `horizontalInfinity` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of horizontal infinity value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `infinityMargin` | Margin to be extended towards infinity region. Example: 0.15, that is, the new<br>                infinity value is:<br><br>`infinity = infinity + DACRange ×<br>                0.15`<br>Where,<br><br>`DACRange = macro - infinity` |
| `WB` | White balance (WB) data information to format WB data |
| `WBData` | <ul class="ul"><br>                <li class="li"><code class="ph codeph">isAvailable</code>: indicates whether the WB data is available or not<br>                  in the OTP data buffer and valid values are true or false. If this field is set to<br>                  false, all the remaining fields under <code class="ph codeph">WBData</code> node are<br>                  ignored.</li><br><br>                <li class="li"><code class="ph codeph">BIG</code> or <code class="ph codeph">LITTLE</code>: indicates type of the<br>                  endianness. </li><br><br>              </ul> |
| `dataType` | Indicates whether the WB data is available in the form of RATIO or INDIVIDUAL.<br><ul class="ul"><br>                <li class="li">If the data is available in the form of RATIO, then <code class="ph codeph">rOverGValue,<br>                    bOverGValue, grOverGBValue</code> fields must be configured.</li><br><br>                <li class="li">If the data is available in the form of INDIVIDUAL, then <code class="ph codeph">rValue,<br>                    grValue, bValue, gbValue</code> fields must be configured.</li><br><br>              </ul> |
| `lightInfo` | Contains the type of the illuminant and corresponding color values based on the<br>                value of `dataType` field. |
| `illuminantType` | Type of the illuminant for which WB data is available.<br><br><br>              <br>Supported illuminants are D65, TL84, A, D50, H. |
| `rValue` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of <code class="ph codeph">rValue</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `grValue` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of <code class="ph codeph">grValue</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `bValue` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of <code class="ph codeph">bValue</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `gbValue` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of <code class="ph codeph">gbValue</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `rOverGValue` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of <code class="ph codeph">rOverGValue</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `bOverGValue` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of <code class="ph codeph">bOverGValue</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `grOverGBValue` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of <code class="ph codeph">grOverGBValue</code> value in<br>                  the buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `mirror` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of mirror value in the buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `flip` | <ul class="ul"><br>                <li class="li">offset – Position of the first byte of flip value in the buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `qValue` | Factor to convert the obtained real values to the required float values. |
| `isInvertGROverGB` | Set to true if `GRoverGB` must be inverted or else set to false. |
| `LSC` | Lens shading calibration (LSC) data needed to format LSC data. |
| `LSCData` | <ul class="ul"><br>                <li class="li"><code class="ph codeph">isAvailable</code>: Indicates whether the LSC data is available or not<br>                  in the OTP data buffer and valid values are true or false. If this field is set to<br>                  false, all the remaining fields under <code class="ph codeph">LSCData</code> node are<br>                  ignored.</li><br><br>                <li class="li"><code class="ph codeph">BIG</code> or <code class="ph codeph">LITTLE</code>: indicates type of the<br>                  endianness. </li><br><br>              </ul> |
| `lightInfo` | Contains the type of the illuminant and corresponding LSC gain values. |
| `illuminantType` | Type of the illuminant for which LSC data is available.<br><br><br>              <br>Supported illuminants are D65, TL84, A, D50, and H. |
| `rGainMSB` | <ul class="ul"><br>                <li class="li">offset – Position of the MSB of the <code class="ph codeph">rGain</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `rGainLSB` | <ul class="ul"><br>                <li class="li">offset – Position of the LSB of the <code class="ph codeph">rGain</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `grGainMSB` | <ul class="ul"><br>                <li class="li">offset – Position of the MSB of the <code class="ph codeph">grGain</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `grGainLSB` | <ul class="ul"><br>                <li class="li">offset – Position of the LSB of the <code class="ph codeph">grGain</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `gbGainMSB` | <ul class="ul"><br>                <li class="li">offset – Position of the MSB of the <code class="ph codeph">gbGain</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `gbGainLSB` | <ul class="ul"><br>                <li class="li">offset – Position of the LSB of the <code class="ph codeph">gbGain</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `bGainMSB` | <ul class="ul"><br>                <li class="li">offset – Position of the MSB of the <code class="ph codeph">bGain</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `bGainLSB` | <ul class="ul"><br>                <li class="li">offset – Position of the LSB of the <code class="ph codeph">bGain</code> value in the<br>                  buffer.</li><br><br>                <li class="li">mask – Represents the number of valid bits of the data.</li><br><br>              </ul> |
| `meshHWRollOffSize` | Mesh hardware rolloff size. |
| `rIncrement` | Value to be incremented to find the next `rGainMSB` and<br>                  `rGainLSB` value Example: 5<br><ul class="ul"><br>                <li class="li">If <code class="ph codeph">rGainMSB</code> offset is 28, then the next<br>                    <code class="ph codeph">rGainMSB</code> offset will be 28+5 = 33. Same applies to other<br>                  increments.</li><br><br>                <li class="li">If <code class="ph codeph">rGainLSB</code> offset is 24, then the next <code class="ph codeph"><br>                    rGainMSB</code> offset will be 24+5 = 29. Same applies to other<br>                  increments.</li><br><br>              </ul> |
| `grIncrement` | Value to be incremented to find next `grGainMSB` and<br>                  `grGainLSB` values. |
| `gbIncrement` | Value to be incremented to find next `gbGainMSB` and<br>                  `gbGainLSB` values. |
| `bIncrement` | Value to be incremented to find next `bGainMSB` and<br>                  `bGainLSB` values. |

Last Published: Aug 18, 2023

[Previous Topic
EEPROM configuration](https://docs.qualcomm.com/bundle/publicresource/80-88500-1/topics/84_EEPROM_bring_up_guidelines.md) [Next Topic
slaveInfo node](https://docs.qualcomm.com/bundle/publicresource/80-88500-1/topics/85_EEPROM_software_configuration.md#slaveInfo_node_87)