Skip to content

Serial number in Device Tree #1670

Closed
Closed

Description

@notro

Currently the serial number is passed in 2 ways by the bootloader:

  • Kernel commandline as text: bcm270{8,9}.serial= (used by bcm2708/9)
  • Device Tree in binary form: /system/linux,serial (used by downstream bcm2835)

This is the only in-kernel user of this information:

$ cat /proc/cpuinfo | grep Serial
Serial          : 00000000316e5228

Linux 4.2 introduced a way to pass in the serial number via Device Tree as a string:
Commit: torvalds/linux@3f59987
Doc: torvalds/linux@13dd92b

/ {
    serial-number = "00000000316e5228";
};

@pelwell can we have it a third way? :-)

Activity

  1. pelwell commented on Oct 10, 2016

    @pelwell
    Contributor

    Sure - I've dropped a patch in the pipe.

  2. popcornmix commented on Oct 11, 2016

    @popcornmix
    Collaborator

    This is in latest rpi-update firmware.

  3. notro commented on Oct 11, 2016

    @notro
    ContributorAuthor

    Thanks, that worked just fine.

  4. kukabu commented on Oct 12, 2016

    @kukabu

    @popcornmix what about implement local-mac-address in DT? We can use the c489565 and drop the 1bc5568

  5. kukabu commented on Oct 12, 2016

    @kukabu

    WOW! The mac-address exists in DT, it seems we can drop the 1bc5568.
    But can you rename the mac-address to local-mac-address? The mac-address is better use for user-defined whereas local-mac-address - vendor-defined.

  6. pelwell commented on Oct 12, 2016

    @pelwell
    Contributor

    The of_get_mac_address() function tries "mac-address" first, then "local-mac-address", then "address", so using "mac-address" is actually a performance optimisation.

    But seriously, can you think of a situation where defining "local-mac-address" instead is of some practical benefit?

  7. kukabu commented on Oct 12, 2016

    @kukabu

    doc says:

    • local-mac-address: array of 6 bytes, specifies the MAC address that was
      assigned to the network device;
    • mac-address: array of 6 bytes, specifies the MAC address that was last used by
      the boot program; should be used in cases where the MAC address assigned to
      the device by the boot program is different from the "local-mac-address"
      property;

    I think a one 'if' doesn't significantly degrade performance but the user may be able to change the mac address via DT.

  8. pelwell commented on Oct 12, 2016

    @pelwell
    Contributor

    I don't see how it is particularly useful retaining the original MAC address (except perhaps for information), but I agree that our usage doesn't really match the spec.

    Create a new issue for tracking purposes (one problem per issue, please) and I'll change it (assuming there are no problems).

  9. added a commit that references this issue on Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions