[OpenBIOS] [PATCH 3/6] escc: Fix legacy addresses
Benjamin Herrenschmidt
benh at kernel.crashing.org
Tue Aug 2 11:13:19 CEST 2016
On Tue, 2016-08-02 at 09:39 +0100, Mark Cave-Ayland wrote:
> I remember going through these a while back and thinking that while the
> current values didn't match real hardware, they did match what was in
> QEMU's hw/misc/macio/macio.c's macio_escc_legacy_setup().
Nope, though I have this patch below pending (not sent yet) to also fix
other problems in that latter function. But you'll note that the registers
we do care about aren't changed
> > >From memory someone (Alyssa?) picked up on this and posted a patch to
> update the mappings in macio_escc_legacy_setup() to match, but I never
> > got around to digging deeper.
Nah so the patch below is based on MacTech.pdf, matches Apple device-
trees and some other Apple documents I can't publish nor talk about :-)
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -89,22 +89,16 @@ static void macio_escc_legacy_setup(MacIOState *macio_state)
MemoryRegion *bar = &macio_state->bar;
int i;
static const int maps[] = {
- 0x00, 0x00,
- 0x02, 0x20,
- 0x04, 0x10,
- 0x06, 0x30,
- 0x08, 0x40,
- 0x0A, 0x50,
- 0x60, 0x60,
- 0x70, 0x70,
- 0x80, 0x70,
- 0x90, 0x80,
- 0xA0, 0x90,
- 0xB0, 0xA0,
- 0xC0, 0xB0,
- 0xD0, 0xC0,
- 0xE0, 0xD0,
- 0xF0, 0xE0,
+ 0x00, 0x00, /* Command B */
+ 0x02, 0x20, /* Command A */
+ 0x04, 0x10, /* Data B */
+ 0x06, 0x30, /* Data A */
+ 0x08, 0x40, /* Enhancement B */
+ 0x0A, 0x50, /* Enhancement A */
+ 0x80, 0x80, /* Recovery count */
+ 0x90, 0x90, /* Start A */
+ 0xa0, 0xa0, /* Start B */
+ 0xb0, 0xb0, /* Detect AB */
};
memory_region_init(escc_legacy, OBJECT(macio_state), "escc-legacy", 256);
More information about the OpenBIOS
mailing list