Skip to content

Commit 3382b90

Browse files
timothytrippelpamaury
authored andcommitted
[manuf] set DIN to all 1s for FPGA devices
This updates the DIN to be set to all 1s for FPGA emulated devices to enable test owner firmware images to bind to this invalid device ID. Signed-off-by: Tim Trippel <[email protected]> (cherry picked from commit c8ba1ab)
1 parent 34a8421 commit 3382b90

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

sw/device/silicon_creator/manuf/lib/individualize.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,15 @@ status_t manuf_individualize_device_hw_cfg(
115115
}
116116

117117
// On non-silicon targets, we expect the CP device ID from flash to be
118-
// empty. In this case we set the HW origin portion of the CP device ID to
119-
// all 1s to indicate this is an FPGA/Sim generated device ID.
118+
// empty. In this case we set the HW origin and DIN portions of the CP
119+
// device ID to all 1s to indicate this is an FPGA/Sim generated device ID.
120120
// Otherwise, we expect the CP device ID to be present and non-zero.
121121
if (flash_cp_device_id_empty) {
122122
if (kDeviceType != kDeviceSilicon && kDeviceType != kDeviceSimDV) {
123123
memset(&cp_device_id, 0, sizeof(cp_device_id));
124124
cp_device_id[0] = UINT32_MAX;
125+
cp_device_id[1] = UINT32_MAX;
126+
cp_device_id[2] = UINT32_MAX;
125127
} else {
126128
return NOT_FOUND();
127129
}

sw/host/provisioning/orchestrator/src/device_id.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,19 @@ def to_int(self) -> int:
8383

8484
@staticmethod
8585
def from_int(din: int) -> "DeviceIdentificationNumber":
86-
year = util.bcd_decode(din & 0xF)
87-
week = util.bcd_decode((din >> 4) & 0xFF)
88-
lot = util.bcd_decode((din >> 12) & 0xFFF)
89-
wafer = util.bcd_decode((din >> 24) & 0xFF)
90-
wafer_x_coord = util.bcd_decode((din >> 32) & 0xFFF)
91-
wafer_y_coord = util.bcd_decode((din >> 44) & 0xFFF)
86+
year = -1
87+
week = -1
88+
lot = -1
89+
wafer = -1
90+
wafer_x_coord = -1
91+
wafer_y_coord = -1
92+
if din != 0xFFFFFFFFFFFFFFFF:
93+
year = util.bcd_decode(din & 0xF)
94+
week = util.bcd_decode((din >> 4) & 0xFF)
95+
lot = util.bcd_decode((din >> 12) & 0xFFF)
96+
wafer = util.bcd_decode((din >> 24) & 0xFF)
97+
wafer_x_coord = util.bcd_decode((din >> 32) & 0xFFF)
98+
wafer_y_coord = util.bcd_decode((din >> 44) & 0xFFF)
9299
return DeviceIdentificationNumber(year=year,
93100
week=week,
94101
lot=lot,

0 commit comments

Comments
 (0)