Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oxide-barcode: allow shorter serial and part numbers #1939

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

cbiffle
Copy link
Collaborator

@cbiffle cbiffle commented Dec 2, 2024

This retains the original maximum length for both fields, but permits parsed strings to contain shorter sections. Shorter sections are right-padded with NULs for consistency with IPCC.

Fixes #1893

Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handful of very unimportant nits, feel free to disregard me.

lib/oxide-barcode/src/lib.rs Outdated Show resolved Hide resolved
lib/oxide-barcode/src/lib.rs Outdated Show resolved Hide resolved
@citrus-it
Copy link
Contributor

I flashed these changes to a rev B bench gimlet which has an unlocked VPD, then replaced the VPD contents with a v2 barcode containing short part and serial numbers:

% pfexec humility vpd -i 10 -r
[
    ("FRU0", [
        ("BARC", [
            "0XV2:9131234:000:EVT0006",
        ]),
        ("MAC0", [
            [
                168,
                64,
                37,
                1,
                1,
                3,
                8,
                0,
                8,
            ],
        ]),
    ]),

and booted. The board properties (and their length) printed as the kernel starts up look good:

Boot properties:
        0xb3e8 baseboard-revision = len=4 00000000
        0xb398 baseboard-model = len=8 9131234
        0xb348 baseboard-identifier = len=8 EVT0006

and sending an IPCC ident command from the running OS also shows the expected results:

# /usr/platform/oxide/bin/ipcc ident
Serial: 'EVT0006'
Model:  '9131234'
Rev:    0x0

The t6init service detected that the data encoded in the T6 SROM was no longer correct, and replaced it. That also worked correctly:

# t6mfgadm srom vpd show -d 1
OFFSET  FLAGS   ID              PN              SN              MAC
0x0400  CIPS-   T62100-KR       9131234         EVT0006         -
0x0800  CIPSM   T62100-KR       9131234         EVT0006         a8:40:25:1:1:13
0x0c00  CIPS-   T62100-KR       9131234         EVT0006         -
0x1000  CIPSM   T62100-KR       9131234         EVT0006         a8:40:25:1:1:13
0x1400  CIPS-   T62100-KR       9131234         EVT0006         -
0x1800  CIPSM   T62100-KR       9131234         EVT0006         a8:40:25:1:1:13
0x1c00  CIPS-   T62100-KR       9131234         EVT0006         -
0x2000  CIPSM   T62100-KR       9131234         EVT0006         a8:40:25:1:1:13
0x2400  CIPS-   T62100-KR       9131234         EVT0006         -
0x2800  CIPSM   T62100-KR       9131234         EVT0006         a8:40:25:1:1:13
0x2c00  CIPS-   T62100-KR       9131234         EVT0006         -
0x3000  CIPSM   T62100-KR       9131234         EVT0006         a8:40:25:1:1:13
0x3400  CIPS-   T62100-KR       9131234         EVT0006         -
0x3800  CIPSM   T62100-KR       9131234         EVT0006         a8:40:25:1:1:13
0x3c00  CIPS-   T62100-KR       9131234         EVT0006         -
0x4000  CIPSM   T62100-KR       9131234         EVT0006         a8:40:25:1:1:13

This retains the original maximum length for both fields, but permits
parsed strings to contain shorter sections. Shorter sections are
right-padded with NULs for consistency with IPCC.

Fixes #1893
@cbiffle cbiffle enabled auto-merge (rebase) December 10, 2024 19:44
@cbiffle cbiffle merged commit 60c3bbd into master Dec 10, 2024
125 checks passed
@cbiffle cbiffle deleted the cbiffle/serialv2 branch December 10, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prepare oxide-barcode for Terra, v2 serial numbers
5 participants