Received: from eggs.gnu.org ([2001:4830:134:3::10]:58106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMgPh-00075V-3i for qemu-devel@nongnu.org; Fri, 22 Jan 2016 13:26:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMgPf-0002ty-VB for qemu-devel@nongnu.org; Fri, 22 Jan 2016 13:26:25 -0500 Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Programmingkid In-Reply-To: <56A25CD0.4060709@ilande.co.uk> Date: Fri, 22 Jan 2016 13:26:14 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <0E0356B0-F2CB-4EBE-B433-ECE86466F173@gmail.com> References: <96510826-2FD7-4967-9BEC-746DB44A81F8@gmail.com> <56A25CD0.4060709@ilande.co.uk> Subject: Re: [Qemu-devel] [PATCH] hw/pci-host/uninorth.c: Add support for Apple's PCI bridge register 0x48 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: qemu-devel qemu-devel , "qemu-ppc@nongnu.org list:PowerPC" , Alexander Graf , david@gibson.dropbear.id.au On Jan 22, 2016, at 11:46 AM, Mark Cave-Ayland wrote: > On 22/01/16 16:09, Programmingkid wrote: >=20 >> Apple has custom PCI bridge registers that are not a part of any = known standard. This patch implements register 0x48. With this patch the = AppleMacRiscPCI kernel extension no longer prints these error messages = for the mac99 target: >> AppleMacRiscPCI: bad range 2(80000000:01000000) >> AppleMacRiscPCI: bad range 2(81000000:00001000) >> AppleMacRiscPCI: bad range 2(81080000:00080000) >>=20 >> Signed-off-by: John Arbuckle >>=20 >> --- >> hw/pci-host/uninorth.c | 4 ++++ >> 1 files changed, 4 insertions(+), 0 deletions(-) >>=20 >> diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c >> index 215b64f..6541b10 100644 >> --- a/hw/pci-host/uninorth.c >> +++ b/hw/pci-host/uninorth.c >> @@ -330,6 +330,10 @@ static void unin_agp_pci_host_realize(PCIDevice = *d, Error **errp) >> d->config[0x0C] =3D 0x08; // cache_line_size >> d->config[0x0D] =3D 0x10; // latency_timer >> // d->config[0x34] =3D 0x80; // capabilities_pointer >> + d->config[0x48] =3D 0x0; >> + d->config[0x49] =3D 0x0; >> + d->config[0x4a] =3D 0x0; >> + d->config[0x4b] =3D 0x1; >> } >>=20 >> static void u3_agp_pci_host_realize(PCIDevice *d, Error **errp) >=20 > Tested-by: Mark Cave-Ayland >=20 > As this config space register is seemingly an Apple custom option (or = at > least I can't find a mention of it in the PCI-PCI bridge spec) I think > this should have a comment explaining exactly what it does, and should > reference both AppleMacRiscPCI.cpp filename and the enum for the > register value (0x48 =3D=3D kMacRISCPCIAddressSelect). Is this what you want: Apple has custom PCI bridge registers that are not a part of any known = standard. This patch implements register 0x48. With this patch the = AppleMacRiscPCI kernel extension no longer prints these error messages = for the mac99 target: AppleMacRiscPCI: bad range 2(80000000:01000000) AppleMacRiscPCI: bad range 2(81000000:00001000) AppleMacRiscPCI: bad range 2(81080000:00080000) In Apple's AppleMacRiscPCI.h source code, the register is defined as = kMacRISCPCIAddressSelect. It is accessed in the AppleMacRiscPCI.cpp = file. What this register is used for is determining the address a pci = bridge range that is kept track of by the operating system.=20 > I'd also like to see a note explaining that this sets up the register = to > match the PCI memory region base/size currently used in QEMU/OpenBIOS > too in order to provide a hint that if one changes, so must the other. Note: OpenBIOS in the arch/ppc/qemu/init.c file has a structure with an = index of [ARCH_MAC99]. It keeps track of the PCI MMIO range for the = mac99 target. If a change happens to either this file or the = AppleMacRiscPCI kernel extension, the other would have to be changed as = well. >=20 > BTW is the register required for any of the other uni-north realize > functions? Alex? My guess is no. Only the AppleMacRiscPCI kernel extension needs to know = those details. Since this is only a change to the patch's comment, do I still need to = use v2 in the "[PATCH]" text?