sparc: Set HostID in NVRAM
PATCH 1/1 sparc: Set HostID in NVRAM
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.
--- include/hw/nvram/openbios_firmware_abi.h | 2 ++ 1 file changed, 2 insertions(+)
include/hw/nvram/openbios_firmware_abi.h +2 -0
@@ -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;
Signature · 1 line
1.8.1.5
Quoted 6 lines · Olivier Danet
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 <[email protected]>
Corresponds with http://www.squirrel.com/squirrel/sun-nvram-hostid.faq
and Solaris 9 detects the hostid after this patch fine, so
Quoted 21 lines
--- include/hw/nvram/openbios_firmware_abi.h | 2 ++ 1 file changed, 2 insertions(+)include/hw/nvram/openbios_firmware_abi.h +2
-0@@ -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;--
1.8.1.5
Signature · 5 lines
Regards, Artyom Tarasenko linux/sparc and solaris/sparc under qemu blog: http://tyom.blogspot.com/search/label/qemu
PATCH 1/1 Sun4m: Set HostID in NVRAM
Ping.
Repost !
Quoted 35 lines · Artyom Tarasenko
Quoted 6 lines · Olivier Danet
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 <[email protected]>Corresponds with http://www.squirrel.com/squirrel/sun-nvram-hostid.faq
and Solaris 9 detects the hostid after this patch fine, soReviewed-by Artyom Tarasenko <[email protected]>Quoted 21 lines
--- include/hw/nvram/openbios_firmware_abi.h | 2 ++ 1 file changed, 2 insertions(+)include/hw/nvram/openbios_firmware_abi.h +2
-0@@ -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;--
1.8.1.5
Re: [Qemu-devel] [PATCH] Sun4m: Set HostID in NVRAM
Quoted 30 lines · Olivier Danet
Ping.
Repost !Quoted 26 lines · Artyom Tarasenko
Quoted 6 lines · Olivier Danet
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 <[email protected]>Corresponds with http://www.squirrel.com/squirrel/sun-nvram-hostid.faq
and Solaris 9 detects the hostid after this patch fine, soReviewed-by Artyom Tarasenko <[email protected]>Quoted 13 lines
---
include/hw/nvram/openbios_firmware_abi.h| 2 ++1 file changed, 2 insertions(+)include/hw/nvram/openbios_firmware_abi.h +0
-0@@ -62,6 +62,8 @@ Sun_init_header(struct Sun_nvram *header, const
uint8_t
*macaddr, intmachine_idheader->type= 1;
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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;
--
I've applied this to my qemu-sparc branch.
ATB,
Mark.
Quoted 16 lines · Olivier Danet
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 <[email protected]>---
include/hw/nvram/openbios_firmware_abi.h| 2 ++1 file changed, 2 insertions(+)include/hw/nvram/openbios_firmware_abi.h +0
-0@@ -62,6 +62,8 @@ Sun_init_header(struct Sun_nvram *header, const
Quoted 5 lines
uint8_t*macaddr, intmachine_idheader->type= 1;header->machine_id=machine_id&0xff;memcpy(&header->macaddr, macaddr, 6);
+memcpy(&header->hostid , &macaddr[3],3);
I think there is some whitespace damage on this patch? At least I couldn't apply it as is :/ Also the lack of a space after the final comma on the line above looks suspicious too... have you tried running scripts/checkpatch.pl on the resulting diffs?
Quoted 4 lines
+
/* Calculate checksum */
tmp = 0;
tmpptr = (uint8_t*)header;
Apart from the whitespace issues, the basic patch looks fine though.
ATB,
Mark.