From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Vivier Subject: Re: [PATCH] nouveau: fix OpenFirmware support Date: Sat, 10 Oct 2015 21:29:19 +0200 Message-ID: <5619670F.9080800@vivier.eu> References: <1444483668-5278-1-git-send-email-laurent@vivier.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Ilia Mirkin Cc: "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Ben Skeggs , Dave Airlie List-Id: dri-devel@lists.freedesktop.org Le 10/10/2015 20:41, Ilia Mirkin a =C3=A9crit : > Hi Laurent, >=20 > On Sat, Oct 10, 2015 at 9:27 AM, Laurent Vivier w= rote: >> On PowerMac G5 (and I think on all OpenFirmware platforms), nvbios_p= cirTp() >> returns NULL. But in fact the OpenFirmware has given us the size >> we can store in image->size. >> >> This size is stored in bios->size by of_init() as there is no way >> to retrieve it otherwise. And as we know the size, copy all data >> to bios->data. >> >> Tested on PowerMac G5 with 64bit kernel and a NV43 card (GeForce 660= 0 LE). >=20 > Can you give this patch a shot instead? >=20 > http://cgit.freedesktop.org/~darktama/nouveau/commit/?id=3D794a63cc75= eada9ad6b2a0275c1c8c4d3522864f Well, I think mine is also a good solution and it is much more simple. ;) =2E.. because it is useless to add a size() function if we can directly copy the content/size of the bios in bios->data and bios->size. We can do that because we have the size of the property, which is not the case when we discover the BIOS directly from a PCI ROM or from ACPI (this is why we need a shadow, I think). =46or pcir part, I think we can just ignore the result and take the siz= e from bios->size, as in the case of non openfirmware bios->size will be = 4 (we have only shadowed the first word to read the id, 0xaa55) and then the checksum and others ID searches will fail. So I think the checksum should not be ignored. I've tried to restore behavior before commit: 7af4dec drm/nouveau/bios: use size/type from pci data structure and commit: ad4a362 drm/nouveau/bios: split out shadow methods Originally, openfirmware content was copied directly into bios->data: 77145f1 drm/nouveau: port remainder of drm code, and rip out compat lay= er > This resolved my issues on a PPC G5 + NV34. I think mine ran into a > few additional problems that you didn't see -- no PCIR header and > invalid checksum. I have no PCIR header too. Could you send me the content of the file "NVDA,BMP" you can find somewhere under /proc/device-tree/ ? Could you try my patch on your system, please ? Laurent