sun4m: Set HostID in NVRAM
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Sun, 23 Feb 2014 17:08:06 +0000 (17:08 +0000)
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Thu, 27 Feb 2014 10:01:40 +0000 (10:01 +0000)
On SparcStations, the HostID field in the NVRAM is equal to the last
three bytes of the MAC address (which is also stored in the NVRAM).

This constant is used as an identification/serial number on Solaris.

Signed-off-by: Olivier Danet <odanet@caramail.com>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
include/hw/nvram/openbios_firmware_abi.h

index 5e6e5d4d34d835aa7c69ec387828087f8de935b3..c66ee22685eef46bfdd81439465c091bdf7d77a6 100644 (file)
@@ -62,6 +62,8 @@ Sun_init_header(struct Sun_nvram *header, const uint8_t *macaddr, int machine_id
     header->type = 1;
     header->machine_id = machine_id & 0xff;
     memcpy(&header->macaddr, macaddr, 6);
+    memcpy(&header->hostid , &macaddr[3], 3);
+
     /* Calculate checksum */
     tmp = 0;
     tmpptr = (uint8_t *)header;