Bug 66791 - Radeon fails to find vbios on macbook pro 2,1 (2007) for x1600 using kernel EFI stub
Summary: Radeon fails to find vbios on macbook pro 2,1 (2007) for x1600 using kernel E...
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - non Intel) (show other bugs)
Hardware: IA-32 Linux
: P1 blocking
Assignee: drivers_video-dri
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-09 10:07 UTC by moonman
Modified: 2016-03-23 18:58 UTC (History)
4 users (show)

See Also:
Kernel Version: 3.12.3
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description moonman 2013-12-09 10:07:15 UTC
The kernel does boot up, but I don't see anything on the screen. I managed to bootup with radeon blacklisted to automate things and enable ssh access. I made sure that kernel and EFI are both 32-bit (this mac has 32-bit firmware).

When booting kernel right from rEFInd without using grub, this is what I see:

[    9.750168] radeon 0000:01:00.0: Invalid ROM contents
[    9.750210] radeon 0000:01:00.0: Invalid ROM contents
[    9.750232] BUG: unable to handle kernel paging request at 7c57703c
[    9.750239] IP: [<fa974d50>] radeon_get_bios+0x490/0x1160 [radeon]
[    9.750276] *pde = 00000000 
[    9.750280] Oops: 0000 [#1] PREEMPT SMP 
[    9.750285] Modules linked in: radeon(+) coretemp ttm ath9k(+) drm_kms_helper kvm_intel kvm ath9k_common ath9k_hw iTCO_wdt drm joydev iTCO_vendor_support i2c_algo_bit ath microcode evdev mac80211 snd_hda_codec_idt cfg80211 applesmc sky2 input_polldev pcspkr snd_hda_intel i2c_i801 snd_hda_codec snd_hwdep snd_pcm snd_page_alloc snd_timer i2c_core rfkill snd lpc_ich soundcore acpi_cpufreq video button ac battery processor shpchp intel_agp intel_gtt agpgart apple_bl ext4 crc16 mbcache jbd2 sr_mod cdrom sd_mod ata_generic pata_acpi firewire_ohci firewire_core crc_itu_t ata_piix ahci libahci libata scsi_mod ehci_pci uhci_hcd ehci_hcd usbcore usb_common
[    9.750358] CPU: 0 PID: 142 Comm: systemd-udevd Not tainted 3.12.3-1-ARCH #1
[    9.750363] Hardware name: Apple Computer, Inc. MacBookPro2,1/Mac-F42189C8, BIOS    MBP21.88Z.00A5.B08.0802291403 02/29/08
[    9.750370] task: f450bd30 ti: f71ca000 task.ti: f71ca000
[    9.750375] EIP: 0060:[<fa974d50>] EFLAGS: 00010206 CPU: 0
[    9.750407] EIP is at radeon_get_bios+0x490/0x1160 [radeon]
[    9.750411] EAX: 7c57703c EBX: 00000000 ECX: 0000fa00 EDX: 0000fa00
[    9.750416] ESI: f72ee008 EDI: f72ee000 EBP: f71cbc24 ESP: f71cbb94
[    9.750420]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[    9.750424] CR0: 80050033 CR2: 7c57703c CR3: 372df000 CR4: 000007d0
[    9.750429] Stack:
[    9.750431]  00000000 00000082 f71cbbac 00000000 f71cbbac c0290f08 f71cbbe8 c02911c8
[    9.750442]  c08b1120 00000400 00000000 00000080 00000000 0000000f 00000400 00000400
[    9.750451]  00000001 f71cbbf8 00000000 00ff0000 c04ee1f4 f71ca000 00000020 c07ddc80
[    9.750461] Call Trace:
[    9.750469]  [<c0290f08>] ? wake_up_klogd+0x38/0x70
[    9.750475]  [<c02911c8>] ? console_unlock+0x288/0x460
[    9.750482]  [<c04ee1f4>] ? register_client+0x34/0xf0
[    9.750516]  [<fa989499>] r520_init+0x29/0x2d0 [radeon]
[    9.750522]  [<c04ee31b>] ? vga_switcheroo_register_client+0x3b/0x50
[    9.750549]  [<fa945b58>] radeon_device_init+0x6c8/0x800 [radeon]
[    9.750576]  [<fa944190>] ? cail_mc_write+0x20/0x20 [radeon]
[    9.750604]  [<fa9479b1>] radeon_driver_load_kms+0x81/0x160 [radeon]
[    9.750615]  [<fa36e96b>] drm_get_pci_dev+0x10b/0x2b0 [drm]
[    9.750642]  [<fa9440d6>] ? radeon_pci_probe+0x76/0xb0 [radeon]
[    9.750668]  [<fa9440e4>] radeon_pci_probe+0x84/0xb0 [radeon]
[    9.750676]  [<c044d8af>] pci_device_probe+0x6f/0xb0
[    9.750681]  [<c04f3cc9>] driver_probe_device+0x79/0x360
[    9.750687]  [<c044d1f2>] ? pci_match_device+0xb2/0xc0
[    9.750692]  [<c04f4061>] __driver_attach+0x71/0x80
[    9.750697]  [<c04f3ff0>] ? __device_attach+0x40/0x40
[    9.750703]  [<c04f2077>] bus_for_each_dev+0x47/0x80
[    9.750708]  [<c04f37be>] driver_attach+0x1e/0x20
[    9.750713]  [<c04f3ff0>] ? __device_attach+0x40/0x40
[    9.750718]  [<c04f33c7>] bus_add_driver+0x1d7/0x2b0
[    9.750724]  [<c04f4629>] driver_register+0x59/0xe0
[    9.750729]  [<c044d742>] __pci_register_driver+0x32/0x40
[    9.750738]  [<fa36ec05>] drm_pci_init+0xf5/0x100 [drm]
[    9.750746]  [<faa6c000>] ? 0xfaa6bfff
[    9.750770]  [<faa6c093>] radeon_init+0x93/0xb0 [radeon]
[    9.750776]  [<c020042a>] do_one_initcall+0xca/0x190
[    9.750783]  [<c02cd997>] ? tracepoint_update_probe_range+0x47/0x130
[    9.750791]  [<c062f04d>] ? mutex_unlock+0xd/0x10
[    9.750796]  [<c02ce359>] ? tracepoint_module_notify+0x119/0x180
[    9.750803]  [<c0635181>] ? notifier_call_chain+0x41/0x60
[    9.750809]  [<c02682a4>] ? __blocking_notifier_call_chain+0x44/0x60
[    9.750816]  [<c02ad3fb>] load_module+0x19eb/0x22f0
[    9.750823]  [<c02add8f>] SyS_init_module+0x8f/0xf0
[    9.750832]  [<c06384cd>] sysenter_do_call+0x12/0x28
[    9.750836] Code: fa ff ff 84 c0 0f 85 a8 0c 00 00 8b 47 08 8b 55 b4 c7 87 18 01 00 00 00 00 00 00 e8 6b b9 ad c5 85 c0 74 0c 8b 55 d4 85 d2 74 05 <80> 38 55 74 2b c7 44 24 04 b2 c4 a3 fa c7 04 24 d0 3a a1 fa e8
[    9.750881] EIP: [<fa974d50>] radeon_get_bios+0x490/0x1160 [radeon] SS:ESP 0068:f71cbb94
[    9.750917] CR2: 000000007c57703c
[    9.751029] ---[ end trace 76884cf384c2001c ]---

Please let me know if any other information is required.
Comment 1 Alex Deucher 2013-12-09 16:03:35 UTC
Apple's EFI implementation does not provide a way to fetch the vbios after the OS takes over.  IIRC, you need a special bootloader and kernel support for fetching the vbios before passing control to the OS.  I think Matthew Garret had patches to support this at some point, I'm not sure what their status is.  The other option is to boot using the legacy bios interface (not EFI).
Comment 2 moonman 2013-12-10 01:43:03 UTC
Do you have any pointers where the patches are please?

Yes, I can boot in legacy mode but I don't want to do it this way due to certain limitations it imposes
Comment 3 Alex Deucher 2013-12-10 03:06:48 UTC
I can't find the patches off hand, but IIRC, you cannot use grub to load the firmware as the information is only accessible before you exit the boot services in EFI.  The kernel must be booted using EFI stub booting (that's where the code for getting the bios image is).  If you are already using EFI stub booting, maybe you need to add additional handling for your mac?  Anyway, this isn't really a radeon driver issue per se, it's a mac platform bug.
Comment 4 moonman 2013-12-10 03:39:33 UTC
I've read that I need to use EFI stub booting, and I did. I only used grub to set things up for ssh. Is there any way to dump vbios and load it separately using grub (loadbios?)
Comment 5 Alex Deucher 2013-12-10 14:07:47 UTC
IIRC, the efi stub driver fetches the vbios via EFI and copies it to the legacy vga shadow location (0xc0000).  It's probably worth checking the efistub source to see how it handles that for other systems to make sure you don't have to add a special case for your laptop and to see if your system even makes a vbios available via EFI at that point.
Comment 6 moonman 2013-12-24 02:03:12 UTC
Just a quick update: I managed to get it to work finally, though this is not really an optimal solution.

1. Patched the kernel with this patch: https://bugs.freedesktop.org/attachment.cgi?id=33766 from this bugreport: https://bugs.freedesktop.org/show_bug.cgi?id=26891

2. Extracted the vbios while booted into archlinux live cd in bios mode (by the way the live cd needs to be patched to be booted because it comes with EFI 64bit support and not 32bit - well described how to do it in ArchWiki)

3. Only 1 method worked to extract the bios:

echo 1 > /sys/devices/pci0000:00/<id>/rom
cat /sys/devices/pci0000:00/<id>/rom > vbios.dump

for me id=0000:00:02.0

The resulted image is 64000 bytes and does not work for loadbios in grub. Really don't know why.

Actually there's another method: If you have windows installed you can use aida64 to extract the vbios. GPUZ does not work.

Now I can succesfully boot into KDE, BUT only if booted using grub. With EFI Stub I get to console (screen does not stay black anymore), but X server fails to start.
Comment 7 johnson 2015-03-28 09:24:38 UTC
I seem to have run into a similar situation. I filed this Bug #95651

Note You need to log in before you can comment on or make changes to this bug.