Browse Source

ahci reset check 10ms once, mac 1s for fast boot.

Change-Id: I475421b2da036d5c94f585b3016725f2588a1a42
Signed-off-by: QiaoChong <qiaochong@loongson.cn>
master
QiaoChong 6 years ago
committed by Chong Qiao
parent
commit
478787be6c
  1. 10
      sys/dev/pci/ahci.c

10
sys/dev/pci/ahci.c

@ -263,9 +263,15 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent)
/* reset must complete within 1 second, or
* the hardware should be considered fried.
*/
ssleep(1);
for(i=0;i<1000;i+=10)
{
msleep(10);
tmp = readl(mmio + HOST_CTL);
if ((tmp & HOST_RESET) == 0) {
break;
}
}
tmp = readl(mmio + HOST_CTL);
if (tmp & HOST_RESET) {
printf("controller reset failed (0x%x)\n", tmp);
return -1;

Loading…
Cancel
Save