[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/18] hw/m68k/q800: fix PROM checksum and MAC address storage
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 16/18] hw/m68k/q800: fix PROM checksum and MAC address storage |
Date: |
Fri, 2 Jul 2021 15:35:55 +0200 |
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
The checksum used by MacOS to validate the PROM content is an exclusive-OR
rather than a sum over the corresponding bytes. In addition the MAC address
must be stored in bit-reversed format as indicated in comments in Linux's
macsonic.c.
With the PROM contents fixed MacOS starts to probe the device registers
when AppleTalk is enabled in the Control Panel.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Finn Thain <fthain@linux-m68k.org>
Message-Id: <20210625065401.30170-8-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/m68k/q800.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 491f283a17a..6817c8b5d1a 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -334,11 +334,8 @@ static void q800_init(MachineState *machine)
prom = memory_region_get_ram_ptr(dp8393x_prom);
checksum = 0;
for (i = 0; i < 6; i++) {
- prom[i] = nd_table[0].macaddr.a[i];
- checksum += prom[i];
- if (checksum > 0xff) {
- checksum = (checksum + 1) & 0xff;
- }
+ prom[i] = bitrev8(nd_table[0].macaddr.a[i]);
+ checksum ^= prom[i];
}
prom[7] = 0xff - checksum;
--
2.31.1
- Re: [PULL 06/18] hw/pci-host/bonito: Allow PCI config accesses smaller than 32-bit, (continued)
- [PULL 07/18] tests/acceptance: Test Linux on the Fuloong 2E machine, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 08/18] g364fb: use RAM memory region for framebuffer, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 09/18] g364fb: add VMStateDescription for G364SysBusState, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 10/18] dp8393x: checkpatch fixes, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 11/18] dp8393x: convert to trace-events, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 12/18] hw/mips/jazz: move PROM and checksum calculation from dp8393x device to board, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 13/18] hw/m68k/q800: move PROM and checksum calculation from dp8393x device to board, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 14/18] dp8393x: remove onboard PROM containing MAC address and checksum, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 15/18] qemu/bitops.h: add bitrev8 implementation, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 16/18] hw/m68k/q800: fix PROM checksum and MAC address storage,
Philippe Mathieu-Daudé <=
- [PULL 17/18] hw/mips/jazz: specify correct endian for dp8393x device, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 18/18] hw/mips/jazz: Map the UART devices unconditionally, Philippe Mathieu-Daudé, 2021/07/02
- Re: [PULL 00/18] MIPS patches for 2021-07-02, Peter Maydell, 2021/07/04