2N/A * GRUB -- GRand Unified Bootloader 2N/A * Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 2N/A * GRUB is free software: you can redistribute it and/or modify 2N/A * it under the terms of the GNU General Public License as published by 2N/A * the Free Software Foundation, either version 3 of the License, or 2N/A * (at your option) any later version. 2N/A * GRUB is distributed in the hope that it will be useful, 2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A * GNU General Public License for more details. 2N/A * You should have received a copy of the GNU General Public License 2N/A /* Check if this class ID matches that of a PCI IDE Controller. */ 2N/A for (i = 0; i <
5; i++)
2N/A grub_uint64_t endtime; 2N/A hba->global_control |= 1; 2N/A endtime = grub_get_time_ms () + 1000; 2N/A while (hba->global_control & 1) 2N/A if (grub_get_time_ms () > endtime) 2N/A grub_dprintf ("ahci", "couldn't reset AHCI\n"); 2N/A for (i = 0; i < 5; i++) 2N/A hba->global_control |= GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN; 2N/A grub_millisleep (1); 2N/A if (hba->global_control & GRUB_AHCI_HBA_GLOBAL_CONTROL_AHCI_EN) 2N/A grub_dprintf ("ahci", "Couldn't put AHCI in AHCI mode\n"); 2N/A /* FIXME: support hotplugging. */ 2N/A if ((
st &
0xf) !=
0x3 && (
st &
0xf) !=
0x1)
2N/A for (i = 0; i <
32; i++)
2N/A 2 /* CMD register */,
2N/A 13 /* Sectors 48 */,
2N/A 10 /* LBA48 high */ };
2N/A /* FIXME: support port multipliers. */ 2N/A // | GRUB_AHCI_CONFIG_CLEAR_R_OK 2N/A "last PIO FIS %08x %08x %08x %08x %08x %08x %08x %08x\n",
2N/A "last REG FIS %08x %08x %08x %08x %08x %08x %08x %08x\n",
2N/A /* To prevent two drivers operating on the same disks. */ 2N/A /* AHCI initialization. */ 2N/A /* AHCI devices are handled by scsi.mod. */