[Proposal] Regions on an eeprom to serve as logical eeproms
Summary
New platform_manager requirements prohibit the an eeprom thats already being utilized as the pmunit idprom from also acting as the chassis-eeprom. This introduces a new challenge for platforms with hardware that doesn't have additional eeproms to spare as a chassis-eeprom.
Solution
The physical eeprom itself can be abstracted and instead platform manager & weutil will work with eeprom regions where each region is 512 Bytes.
We redefine each eeprom created to be understood as an eeprom region. This allows multiple eeproms to be created against the same physical device as long as they meet these conditions:
- No region overlap. Every region on an eeprom should have at least a 512B offset from other regions.
- Must specify the same kernelDeviceName on regions using the same physical eeprom (same bus/register).
- Eeproms defined under i2cDeviceConfigs with
isEeprom=truemust containEEPROMin the pmUnitScopedName. A condition already met by all configs as of today. This is to help distinguish between actual duplicate deviecs and eeprom regions.
I have implemented this idea with these goals in mind:
- Backwards compatible & non-disruptive to existing platform_manager configs
- No change to the functionality of platform_manager & weutil
- Limited code changes
Test Plan
A GLATH05A-64O system was used in the testing https://github.com/facebook/fboss/pull/462
The same SMB eeprom had two regions programmed
- 15360-15871: programmed as the CHASSIS EEPROM
- 15872-16383: programmed as the SMB IDPROM
Platform Manager
NO ERROS
I2cExplorer.cpp:136] Creating i2c device CHASSIS_EEPROM (24c512) at i2c-10
I2cExplorer.cpp:146] Device CHASSIS_EEPROM (24c512) already exists at bus: 10, addr: 0x50. Skipping creation. This is expected for logical eeproms sharing the same physical device.
DataStore.cpp:78] Updating SysfsPath for /SMB_SLOT@0/[CHASSIS_EEPROM] to /sys/bus/i2c/devices/10-0050
DataStore.cpp:182] Updating EepromContents for DevicePath (/SMB_SLOT@0/[CHASSIS_EEPROM])
...
PlatformExplorer.cpp:770] Creating symlink from /run/devmap/eeproms/CHASSIS_EEPROM to /sys/bus/i2c/devices/10-0050/eeprom. DevicePath: /SMB_SLOT@0/[CHASSIS_EEPROM]
...
PlatformExplorer.cpp:166] Generating human readable EEPROM contents ...
DataStore.cpp:170] Resolved /SMB_SLOT@0 to default PmUnitConfig of SMB. No versioned config for ProductSubVersion 0
DataStore.cpp:170] Resolved /SMB_SLOT@0 to default PmUnitConfig of SMB. No versioned config for ProductSubVersion 0
PlatformExplorer.cpp:168] Publishing hardware version of the unit ...
PlatformExplorer.cpp:851] Reporting Production State: 1
PlatformExplorer.cpp:859] Reporting Production Sub-State: 1
PlatformExplorer.cpp:869] Reporting Variant Indicator: 0
ExplorationSummary.cpp:53] Successfully explored GLATH05A-64O...
platform_manager_hw_test
# /opt/fboss/bin/platform_manager_hw_test --config-file /opt/fboss/share/platform_configs/platform_manager.json -noenable_pkg_mgmnt
[==========] Running 8 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 8 tests from PlatformManagerHwTest
...
[ OK ] PlatformManagerHwTest.XcvrLedFiles (43579 ms)
[----------] 8 tests from PlatformManagerHwTest (350987 ms total)
[----------] Global test environment tear-down
[==========] 8 tests from 1 test suite ran. (350987 ms total)
[ PASSED ] 8 tests.
Weutil
# weutil --list
Name:SCM Path:/run/devmap/eeproms/MERU_SCM_EEPROM Offset:15360
Name:SMB Path:/run/devmap/eeproms/GLATH05A-64O_SMB_EEPROM Offset:15872
Name:CHASSIS Path:/run/devmap/eeproms/CHASSIS_EEPROM Offset:15360
# weutil --all
#### Reading EEPROM: SCM ####
Version: 5
Product Name: SCM
Product Part Number:
System Assembly Part Number:
Meta PCBA Part Number:
Meta PCB Part Number:
ODM/JDM PCBA Part Number: *********
ODM/JDM PCBA Serial Number:
Product Production State: 4
Product Version: 2
Product Sub-Version: 0
Product Serial Number: *********
System Manufacturer:
System Manufacturing Date: *********
PCB Manufacturer:
Assembled At:
EEPROM location on Fabric:
X86 CPU MAC Base: *********
X86 CPU MAC Address Size: 1
BMC MAC Base: *********
BMC MAC Address Size: 1
Switch ASIC MAC Base:
Switch ASIC MAC Address Size:
META Reserved MAC Base:
META Reserved MAC Address Size:
CRC16: 0xc594 (CRC Matched)
#### Reading EEPROM: SMB ####
Version: 6
Product Name: SMB
Product Part Number:
System Assembly Part Number:
Meta PCBA Part Number:
Meta PCB Part Number:
ODM/JDM PCBA Part Number:
ODM/JDM PCBA Serial Number:
Production State: EVT
Production Sub-State: 1
Re-Spin/Variant Indicator: 0
Product Serial Number: *********
System Manufacturer:
System Manufacturing Date: *********
PCB Manufacturer:
Assembled At:
EEPROM location on Fabric:
X86 CPU MAC Base:
X86 CPU MAC Address Size:
BMC MAC Base:
BMC MAC Address Size:
Switch ASIC MAC Base: *********
Switch ASIC MAC Address Size: 515
META Reserved MAC Base:
META Reserved MAC Address Size:
RMA:
Vendor Defined Field 1:
Vendor Defined Field 2:
Vendor Defined Field 3:
CRC16: 0x16e1 (CRC Matched)
#### Reading EEPROM: CHASSIS ####
Version: 6
Product Name: GLATH05A-64O
Product Part Number:
System Assembly Part Number:
Meta PCBA Part Number:
Meta PCB Part Number:
ODM/JDM PCBA Part Number:
ODM/JDM PCBA Serial Number:
Production State: EVT
Production Sub-State: 1
Re-Spin/Variant Indicator: 0
Product Serial Number: *********
System Manufacturer:
System Manufacturing Date: *********
PCB Manufacturer:
Assembled At:
EEPROM location on Fabric:
X86 CPU MAC Base:
X86 CPU MAC Address Size:
BMC MAC Base:
BMC MAC Address Size:
Switch ASIC MAC Base: *********
Switch ASIC MAC Address Size: 515
META Reserved MAC Base:
META Reserved MAC Address Size:
RMA:
Vendor Defined Field 1:
Vendor Defined Field 2:
Vendor Defined Field 3:
CRC16: 0xcd3a (CRC Matched)
weutil hw_test
# /opt/fboss/bin/weutil_hw_test
[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from WeutilTest
[ RUN ] WeutilTest.getWedgeInfo
I1231 19:42:43.188522 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
I1231 19:42:43.188577 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
[ OK ] WeutilTest.getWedgeInfo (11236 ms)
[ RUN ] WeutilTest.getEepromPaths
I1231 19:42:54.424633 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
I1231 19:42:54.424655 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
[ OK ] WeutilTest.getEepromPaths (0 ms)
[ RUN ] WeutilTest.ValidateAllEepromContents
I1231 19:42:54.425109 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
I1231 19:42:54.425118 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
I1231 19:42:54.425522 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
I1231 19:42:54.425530 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
I1231 19:43:05.602078 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
I1231 19:43:16.861384 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
[ OK ] WeutilTest.ValidateAllEepromContents (22436 ms)
[ RUN ] WeutilTest.getInfoJson
I1231 19:43:16.861721 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
I1231 19:43:16.861734 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
I1231 19:43:16.862146 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
I1231 19:43:39.806792 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
I1231 19:44:02.165043 6923 PlatformNameLib.cpp:80] Platform name read from cache: GLATH05A-64O
[ OK ] WeutilTest.getInfoJson (45303 ms)
[----------] 4 tests from WeutilTest (78976 ms total)
[----------] Global test environment tear-down
[==========] 4 tests from 1 test suite ran. (78976 ms total)
[ PASSED ] 4 tests.