[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SATA disk on cntroller in AHCI mode not found: `disk/ahci.c:225: cou
From: |
Paul Menzel |
Subject: |
Re: SATA disk on cntroller in AHCI mode not found: `disk/ahci.c:225: couldn't start CR` |
Date: |
Thu, 18 Apr 2013 13:11:47 +0200 |
Dear GRUB folks,
here is an update on the issue I only reported to #grub on
<irc.freenode.net>.
Am Freitag, den 05.04.2013, 12:54 +0200 schrieb Paul Menzel:
> as reported to the coreboot mailing list already [1][2], using GRUB
> (4778) as a payload [3] on the AMD SB800 based ASRock E350M1 [4], the
> SATA disk attached to the SATA controller is not found when the
> controller is in AHCI mode. Using IDE mode works.
[…]
> I’ll gladly test patches and provide more information.
Vladmir gave me the following patch to test [5].
=== modified file 'grub-core/disk/ahci.c'
--- grub-core/disk/ahci.c 2013-03-25 09:32:56 +0000
+++ grub-core/disk/ahci.c 2013-04-12 16:30:24 +0000
@@ -218,6 +218,21 @@
dev->hba->ports[dev->port].command &=
~GRUB_AHCI_HBA_PORT_CMD_FRE;
goto out;
}
+ dev->hba->ports[dev->port].command |= 2;
+ while (1)
+ {
+ int det = dev->hba->ports[dev->port].status & 7;
+ grub_dprintf ("ahci", "det = %d\n", det);
+ if (det == 1 || det == 3)
+ break;
+ if (grub_get_time_ms () > endtime)
+ {
+ grub_dprintf ("ahci", "couldn't spin-up\n");
+ dev->hba->ports[dev->port].command &=
~GRUB_AHCI_HBA_PORT_CMD_CR;
+ goto out_stop_fr;
+ }
+ }
+
dev->hba->ports[dev->port].command |= GRUB_AHCI_HBA_PORT_CMD_ST;
while (!(dev->hba->ports[dev->port].command &
GRUB_AHCI_HBA_PORT_CMD_CR))
if (grub_get_time_ms () > endtime)
=== modified file 'grub-core/disk/pata.c'
--- grub-core/disk/pata.c 2013-01-20 15:52:15 +0000
+++ grub-core/disk/pata.c 2013-04-12 15:52:44 +0000
@@ -366,7 +366,7 @@
}
/* Check if this class ID matches that of a PCI IDE Controller. */
- if (!cs5536 && (class >> 16 != 0x0101))
+ if (!cs5536 && (class >> 16 != 0x0101) && (class >> 8 != 0x010601))
return 0;
for (i = 0; i < nports; i++)
The PATA change did not make any difference and the module did not load
on my system.
The change to `ahci.c` did make a change and it progressed further.
grub> insmod pata
disk/pata.c:295: sectors=0x5a
disk/pata.c:295: sectors=0x5a
disk/pata.c:295: sectors=0xff
error: no device connected.
disk/pata.c:295: sectors=0xff
error: no device connected.
grub> insmod ahci
disk/ahci.c:308: Requesting AHCI ownership
disk/ahci.c:311: Waiting for BIOS to give up ownership
disk/ahci.c:322: AHCI ownership obtained
disk/ahci.c:328: AHCI is in compat mode. Switching
disk/ahci.c:374: 6 AHCI ports
disk/ahci.c:384: status 0:123
disk/ahci.c:186: found device ahci0 (port 0)
disk/ahci.c:229: det = 3
disk/ahci.c:240: link up
disk/ahci.c:246: After PORT_CMD_ST
disk/ahci.c:255: before return 0
disk/ahci.c:384: status 1:0
disk/ahci.c:384: status 2:0
disk/ahci.c:384: status 3:0
disk/ahci.c:384: status 4:0
disk/ahci.c:384: status 5:0
grub> ls
disk/ahci.c:710: opening AHCI dev `ahci0'
disk/ahci.c:535: AHCI tfd = 150
disk/ahci.c:561: grub_ahci_read (size=512, cmdsize = 0)
disk/ahci.c:574: AHCI tfd = 150
disk/ahci.c:604: cfis: 27 80 ec 00 00 00 00 e0
disk/ahci.c:609: cfis: 00 00 00 00 00 00 00 00
disk/ahci.c:622: PRDT = c7eed800, 0, 800001ff (128)
disk/ahci.c:627: AHCI command schedulded
disk/ahci.c:629: AHCI tfd = 150
disk/ahci.c:633: AHCI tfd = 150
disk/ahci.c:635: AHCI sig = 101
disk/ahci.c:637: AHCI tfd = 150
disk/ahci.c:646: AHCI status <1 0 150>
disk/ahci.c:658: AHCI command completed <1 0 150 0 0, 0 0>
disk/ahci.c:668: last PIO FIS 00000000 00000000 00000000 00000000
00000000
00000000 00000000 00000000
disk/ahci.c:678: last REG FIS 00000000 00000000 00000000 00000000
00000000
00000000 00000000 00000000
disk/pata.c:295: sectors=0x5a
disk/pata.c:295: sectors=0x5a
disk/pata.c:295: sectors=0xff
disk/pata.c:295: sectors=0xff
disk/ahci.c:710: opening AHCI dev `ahci0'
disk/ahci.c:535: AHCI tfd = 150
disk/ahci.c:561: grub_ahci_read (size=512, cmdsize = 0)
disk/ahci.c:574: AHCI tfd = 150
disk/ahci.c:604: cfis: 27 80 ec 00 00 00 00 e0
disk/ahci.c:609: cfis: 00 00 00 00 00 00 00 00
disk/ahci.c:622: PRDT = c7eed800, 0, 800001ff (128)
disk/ahci.c:627: AHCI command schedulded
disk/ahci.c:629: AHCI tfd = 150
disk/ahci.c:633: AHCI tfd = 150
disk/ahci.c:635: AHCI sig = 101
disk/ahci.c:637: AHCI tfd = 150
disk/ahci.c:646: AHCI status <1 0 150>
disk/ahci.c:658: AHCI command completed <1 0 150 0 0, 0 0>
disk/ahci.c:668: last PIO FIS 00000000 00000000 00000000 00000000
00000000
00000000 00000000 00000000
disk/ahci.c:678: last REG FIS 00000000 00000000 00000000 00000000
00000000
00000000 00000000 00000000
disk/pata.c:295: sectors=0x5a
disk/pata.c:295: sectors=0x5a
disk/pata.c:295: sectors=0xff
disk/pata.c:295: sectors=0xff
(memdisk)
So it gets further but still does not find the disk.
Vladimir also said, he can reproduce this issue, when putting his AMD
board’s SATA controller in IDE mode in the BIOS and then trying to
change it in GRUB to AHCI mode.
Thanks,
Paul
> [1] http://www.coreboot.org/pipermail/coreboot/2013-March/075583.html
> [2] http://www.coreboot.org/pipermail/coreboot/2013-April/075592.html
> [3] http://www.coreboot.org/GRUB2
> [4] http://www.coreboot.org/ASRock_E350M1
[5] http://paste.debian.net/249135/
signature.asc
Description: This is a digitally signed message part