Difference between revisions of "Novena/EEPROM"

From Studio Kousagi Wiki
Jump to: navigation, search
(Feature bitmask)
(LVDS/HDMI flags bitmask)
 
(19 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
All multi-byte integers are in native host order.
 
All multi-byte integers are in native host order.
  
==Structure==
+
==Version 1 structure==
  
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
Line 24: Line 24:
 
|-
 
|-
 
| 2 || 0 || Feature bitmask || No features are enabled
 
| 2 || 0 || Feature bitmask || No features are enabled
 +
|}
 +
 +
==Version 2 structure==
 +
 +
The actual structure is defined in [https://github.com/xobs/novena-eeprom/blob/master/novena-eeprom.h novena-eeprom.h] as "struct novena_eeprom_data".
 +
 +
{| class="wikitable sortable"
 +
|+ EEPROM structure
 +
|-
 +
! scope="col" | Size
 +
! scope="col" | Default Value
 +
! scope="col" | Description
 +
! scope="col" | Result if no EEPROM present
 +
|-
 +
| 6 || 'Novena' || Unterminated EEPROM signature || The EEPROM contents will not be used
 +
|-
 +
| 1 || 2 || Version number of EEPROM structure || The EEPROM contents will not be used
 +
|-
 +
| 1 || 32 || Length of EEPROM read/write page || EEPROMOops may not be able to properly save panics
 +
|-
 +
| 4 || 0 || Device serial number || No change
 +
|-
 +
| 6 || (Random) || Gigabit MAC address || Random MAC address is generated on each boot
 +
|-
 +
| 2 || 0 || Feature bitmask || No features are enabled
 +
|}
 +
 +
The following fields were intended to allow for custom panels.  However, due to the way Linux now defines LCD panels, these fields were never actually used, and are not likely to ever be used.  They are kept here for historical reasons.
 +
 +
{| class="wikitable sortable"
 +
|+ Deprecated EEPROM structure
 +
|-
 +
! scope="col" | Size
 +
! scope="col" | Default Value
 +
! scope="col" | Description
 +
! scope="col" | Result if no EEPROM present
 +
|-
 +
 +
| 4 || 0 || LVDS channel 1 frequency || No display
 +
|-
 +
| 2 || 0 || LVDS channel 1 display width || No display
 +
|-
 +
| 2 || 0 || LVDS channel 1 display height || No display
 +
|-
 +
| 2 || 0 || LVDS channel 1 horizontal back porch || No display
 +
|-
 +
| 2 || 0 || LVDS channel 1 horizontal front porch || No display
 +
|-
 +
| 2 || 0 || LVDS channel 1 horizontal sync length || No display
 +
|-
 +
| 2 || 0 || LVDS channel 1 vertical back porch || No display
 +
|-
 +
| 2 || 0 || LVDS channel 1 vertical front porch || No display
 +
|-
 +
| 2 || 0 || LVDS channel 1 vertical sync length || No display
 +
|-
 +
| 4 || 0 || LVDS channel 1 flags (see below) || No display
 +
|-
 +
| 4 || 0 || LVDS channel 2 frequency || No display
 +
|-
 +
| 2 || 0 || LVDS channel 2 display width || No display
 +
|-
 +
| 2 || 0 || LVDS channel 2 display height || No display
 +
|-
 +
| 2 || 0 || LVDS channel 2 horizontal back porch || No display
 +
|-
 +
| 2 || 0 || LVDS channel 2 horizontal front porch || No display
 +
|-
 +
| 2 || 0 || LVDS channel 2 horizontal sync length || No display
 +
|-
 +
| 2 || 0 || LVDS channel 2 vertical back porch || No display
 +
|-
 +
| 2 || 0 || LVDS channel 2 vertical front porch || No display
 +
|-
 +
| 2 || 0 || LVDS channel 2 vertical sync length || No display
 +
|-
 +
| 4 || 0 || LVDS channel 2 flags (see below) || No display
 +
|-
 +
| 4 || 0 || HDMI default frequency || No display
 +
|-
 +
| 2 || 0 || HDMI default display width || No display
 +
|-
 +
| 2 || 0 || HDMI default display height || No display
 +
|-
 +
| 2 || 0 || HDMI default horizontal back porch || No display
 +
|-
 +
| 2 || 0 || HDMI default horizontal front porch || No display
 +
|-
 +
| 2 || 0 || HDMI default horizontal sync length || No display
 +
|-
 +
| 2 || 0 || HDMI default vertical back porch || No display
 +
|-
 +
| 2 || 0 || HDMI default vertical front porch || No display
 +
|-
 +
| 2 || 0 || HDMI default vertical sync length || No display
 +
|-
 +
| 4 || 0 || HDMI default flags (see below) || No display
 +
|-
 +
| 4 || 4096 || EEPROM capacity (in bytes) || No change
 +
|-
 +
| 4 || 4096 || EEPROMoops offset (in bytes) || EEPROMoops support will be disabled
 +
|-
 +
| 4 || 61440 || EEPROMoops length (in bytes) || EEPROMoops support will be disabled
 
|}
 
|}
  
Line 32: Line 135:
 
|-
 
|-
 
! scope="col" | Bit position
 
! scope="col" | Bit position
 +
! scope="col" | Mask
 
! scope="col" | Feature
 
! scope="col" | Feature
 
|-
 
|-
| 1 || ES8328 Audio Codec
+
| 0 || 0x0001 || ES8328 Audio Codec
 +
|-
 +
| 1 || 0x0002 || Senono-based battery board
 +
|-
 +
| 2 || 0x0004 || Retina LVDS display (in version 2, indicates there is an IT6251)
 +
|-
 +
| 3 || 0x0008 || (Reserved: Other LVDS display)
 +
|-
 +
| 4 || 0x0010 || mPCIe port
 +
|-
 +
| 5 || 0x0020 || Gigabit Ethernet
 +
|-
 +
| 6 || 0x0040 || HDMI Output (flag ignored in version 2)
 +
|-
 +
| 7 || 0x0080 || EEPROM Oops support
 +
|-
 +
| 8 || 0x0100 || Root is on SATA (if 0, root is on internal MMC)
 +
|-
 +
| 9 || 0x0200 || Laptop is an "Heirloom" model
 +
|-
 +
| 10 || 0x0400 || Don't boot if lid is closed
 +
|}
 +
 
 +
==LVDS/HDMI flags bitmask==
 +
 
 +
These flags were meant to indicate various timing information on an LVDS or HDMI channel.  However, this feature was never enabled.
 +
 
 +
{| class="wikitable sortable"
 +
|+ Feature list
 +
|-
 +
! scope="col" | Bit position
 +
! scope="col" | Mask
 +
! scope="col" | Feature
 +
|-
 +
| 0 || 0x0001 || Channel is present
 +
|-
 +
| 1 || 0x0002 || If 1, use both LVDS channels together
 +
|-
 +
| 2 || 0x0004 || Polarity of vsync signal
 +
|-
 +
| 3 || 0x0008 || Polarity of hsync signal
 
|-
 
|-
| 2 || Battery board
+
| 4 || 0x0010 || 1 if LVDS is JEIDA mapping, 0 if it's PSWG/SWPG
 
|-
 
|-
| 3 || Retina LVDS display
+
| 5 || 0x0020 || 1 if data is 8-bit (24 bpp), 0 if it's 6-bit (18 bpp)
 
|-
 
|-
| 4 || (Reserved: Other LVDS display)
+
| 6 || 0x0040 || Auto-detect settings, rather than taking them from the EEPROM
 
|}
 
|}

Latest revision as of 04:00, 27 April 2015

Novena has a utility EEPROM that can be used for storing device-specific data. This is optional, and default values will be used if it is blank / not present.

All multi-byte integers are in native host order.

Version 1 structure

EEPROM structure
Size Default Value Description Result if no EEPROM present
6 'Novena' Unterminated EEPROM signature The EEPROM contents will not be used
1 1 Version number of EEPROM structure The EEPROM contents will not be used
1 0 Reserved No change
4 0 Device serial number No change
6 (Random) Gigabit MAC address Random MAC address is generated on each boot
2 0 Feature bitmask No features are enabled

Version 2 structure

The actual structure is defined in novena-eeprom.h as "struct novena_eeprom_data".

EEPROM structure
Size Default Value Description Result if no EEPROM present
6 'Novena' Unterminated EEPROM signature The EEPROM contents will not be used
1 2 Version number of EEPROM structure The EEPROM contents will not be used
1 32 Length of EEPROM read/write page EEPROMOops may not be able to properly save panics
4 0 Device serial number No change
6 (Random) Gigabit MAC address Random MAC address is generated on each boot
2 0 Feature bitmask No features are enabled

The following fields were intended to allow for custom panels. However, due to the way Linux now defines LCD panels, these fields were never actually used, and are not likely to ever be used. They are kept here for historical reasons.

Deprecated EEPROM structure
Size Default Value Description Result if no EEPROM present
4 0 LVDS channel 1 frequency No display
2 0 LVDS channel 1 display width No display
2 0 LVDS channel 1 display height No display
2 0 LVDS channel 1 horizontal back porch No display
2 0 LVDS channel 1 horizontal front porch No display
2 0 LVDS channel 1 horizontal sync length No display
2 0 LVDS channel 1 vertical back porch No display
2 0 LVDS channel 1 vertical front porch No display
2 0 LVDS channel 1 vertical sync length No display
4 0 LVDS channel 1 flags (see below) No display
4 0 LVDS channel 2 frequency No display
2 0 LVDS channel 2 display width No display
2 0 LVDS channel 2 display height No display
2 0 LVDS channel 2 horizontal back porch No display
2 0 LVDS channel 2 horizontal front porch No display
2 0 LVDS channel 2 horizontal sync length No display
2 0 LVDS channel 2 vertical back porch No display
2 0 LVDS channel 2 vertical front porch No display
2 0 LVDS channel 2 vertical sync length No display
4 0 LVDS channel 2 flags (see below) No display
4 0 HDMI default frequency No display
2 0 HDMI default display width No display
2 0 HDMI default display height No display
2 0 HDMI default horizontal back porch No display
2 0 HDMI default horizontal front porch No display
2 0 HDMI default horizontal sync length No display
2 0 HDMI default vertical back porch No display
2 0 HDMI default vertical front porch No display
2 0 HDMI default vertical sync length No display
4 0 HDMI default flags (see below) No display
4 4096 EEPROM capacity (in bytes) No change
4 4096 EEPROMoops offset (in bytes) EEPROMoops support will be disabled
4 61440 EEPROMoops length (in bytes) EEPROMoops support will be disabled

Feature bitmask

There is a bitmask field that defines various board features. In this way, a single image can be shipped that supports various components. For example, a router might not have a display, but a laptop would need to have its LCD turned on. A bit is "1" if the feature is present (and needs to be enabled), and "0" if it is not present. Note that some values are mutually-exclusive (e.g. you can only have one kind of LVDS display attached).

Feature list
Bit position Mask Feature
0 0x0001 ES8328 Audio Codec
1 0x0002 Senono-based battery board
2 0x0004 Retina LVDS display (in version 2, indicates there is an IT6251)
3 0x0008 (Reserved: Other LVDS display)
4 0x0010 mPCIe port
5 0x0020 Gigabit Ethernet
6 0x0040 HDMI Output (flag ignored in version 2)
7 0x0080 EEPROM Oops support
8 0x0100 Root is on SATA (if 0, root is on internal MMC)
9 0x0200 Laptop is an "Heirloom" model
10 0x0400 Don't boot if lid is closed

LVDS/HDMI flags bitmask

These flags were meant to indicate various timing information on an LVDS or HDMI channel. However, this feature was never enabled.

Feature list
Bit position Mask Feature
0 0x0001 Channel is present
1 0x0002 If 1, use both LVDS channels together
2 0x0004 Polarity of vsync signal
3 0x0008 Polarity of hsync signal
4 0x0010 1 if LVDS is JEIDA mapping, 0 if it's PSWG/SWPG
5 0x0020 1 if data is 8-bit (24 bpp), 0 if it's 6-bit (18 bpp)
6 0x0040 Auto-detect settings, rather than taking them from the EEPROM