From dc6040d671875a3c71ac8322a7aa412d1669b100 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Thu, 24 Nov 2016 09:43:42 +0000 Subject: [PATCH] fwohci: report whether PhysicalUpperBound register is implemented Please see section 5.15 of 1394 OHCI Specification. If the register is not implemented, then the physical response unit is limited to the first 4GB of the physical memory. In that case the non-cooperative debugging over firewire (using /dev/fwmem) can not be expected to work if a target has more RAM than that. The method is described in gdb.4 and the Developer's Handbook. It seems that most of the consumer hardware does not implement PhysicalUpperBound register. MFC after: 1 week --- sys/dev/firewire/fwohci.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c index a5d25ccf6d8..5162c065f67 100644 --- a/sys/dev/firewire/fwohci.c +++ b/sys/dev/firewire/fwohci.c @@ -1860,6 +1860,16 @@ fwohci_intr_core(struct fwohci_softc *sc, uint32_t stat, int count) prequpper = OHCI_PREQUPPER_MAX; } OWRITE(sc, OHCI_PREQUPPER, prequpper & 0xffffffff); + if (OREAD(sc, OHCI_PREQUPPER) != + (prequpper & 0xffffffff)) { + device_printf(fc->dev, + "PhysicalUpperBound register is not " + "implemented. Physical memory access " + "is limited to the first 4GB\n"); + device_printf(fc->dev, + "PhysicalUpperBound = 0x%08x\n", + OREAD(sc, OHCI_PREQUPPER)); + } } /* Set ATRetries register */ OWRITE(sc, OHCI_ATRETRY, 1<<(13 + 16) | 0xfff);