Changeset 154 for trunk/src/os2ahci/ahci.c
- Timestamp:
- Apr 10, 2013, 6:47:05 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ahci.c
r148 r154 144 144 ddprintf("ahci_save_bios_config: BIOS AHCI mode is %d\n", ai->bios_config[HOST_CTL / sizeof(u32)] & HOST_AHCI_EN); 145 145 146 #if 0 146 147 if ((ai->bios_config[HOST_CTL / sizeof(u32)] & HOST_AHCI_EN) == 0 && 147 148 ai->pci->vendor == PCI_VENDOR_ID_INTEL) { … … 151 152 init_reset = 1; 152 153 } 154 #endif 153 155 154 156 /* HOST_CAP2 only exists for AHCI V1.2 and later */ … … 676 678 if (ai->port_map & (1UL << p)) { 677 679 if (init_reset) { 678 d printf("ahci_complete_init: resetting port %d\n", p);680 ddprintf("ahci_complete_init: resetting port %d\n", p); 679 681 ahci_reset_port(ai, p, 1); 680 682 } else { 681 d printf("ahci_complete_init: restarting port #%d\n", p);683 ddprintf("ahci_complete_init: restarting port #%d\n", p); 682 684 ahci_stop_port(ai, p); 683 685 ahci_start_port(ai, p, 1); … … 718 720 int timeout; 719 721 720 d printf("ahci_reset_port: resetting port %d.%d\n", ad_no(ai), p);722 ddprintf("ahci_reset_port: resetting port %d.%d\n", ad_no(ai), p); 721 723 if (debug > 1) { 722 724 printf(" PORT_CMD = 0x%lx\n", readl(port_mmio + PORT_CMD)); … … 749 751 /* set link speed and power management options */ 750 752 ddprintf("ahci_reset_port: setting link speed and power management options\n"); 751 tmp = readl(port_mmio + PORT_SCR_CTL) & ~0x00000fffUL; //DAZ753 tmp = readl(port_mmio + PORT_SCR_CTL) & ~0x00000fffUL; 752 754 tmp |= ((u32) link_speed[ad_no(ai)][p] & 0x0f) << 4; 753 755 tmp |= ((u32) link_power[ad_no(ai)][p] & 0x0f) << 8; 754 //DAZwritel(port_mmio + PORT_SCR_CTL, tmp);756 writel(port_mmio + PORT_SCR_CTL, tmp); 755 757 756 758 /* issue COMRESET on the port */ 757 759 ddprintf("ahci_reset_port: issuing COMRESET on port %d\n", p); 758 //DAZ tmp = readl(port_mmio + PORT_SCR_CTL) & ~0x0000000fUL;759 760 writel(port_mmio + PORT_SCR_CTL, tmp | 1); 760 761 readl(port_mmio + PORT_SCR_CTL); /* flush */ … … 810 811 u8 _far *port_mmio = port_base(ai, p); 811 812 u32 status; 812 //int timeout; 813 814 dprintf("ahci_start_port %d.%d\n", ad_no(ai), p); 813 814 ddprintf("ahci_start_port %d.%d\n", ad_no(ai), p); 815 815 /* check whether device presence is detected and link established */ 816 817 #if 0818 /* wait for communication to be re-established after port reset */819 timeout = 5000;820 while (((status = readl(port_mmio + PORT_SCR_STAT)) & 3) != 3) {821 mdelay(10);822 timeout -= 10;823 if (timeout <= 0) {824 dprintf("ahci_start_port #%d (PORT_SCR_STAT = 0x%lx)\n", p, status);825 return(-1);826 }827 }828 #endif829 816 830 817 status = readl(port_mmio + PORT_SCR_STAT); … … 920 907 int rc; 921 908 922 d printf("ahci_stop_port %d.%d\n", ad_no(ai), p);909 ddprintf("ahci_stop_port %d.%d\n", ad_no(ai), p); 923 910 924 911 /* disable port interrupts */ … … 1195 1182 1196 1183 /* restart/reset port (includes the necessary port configuration) */ 1197 if ((ai->bios_config[HOST_CTL / sizeof(u32)] & HOST_AHCI_EN) == 0 && 1198 ai->pci->vendor == PCI_VENDOR_ID_INTEL) { 1184 if (init_reset) { 1199 1185 /* As outlined in ahci_restore_bios_config(), switching back and 1200 1186 * forth between SATA and AHCI mode requires a COMRESET to force … … 1803 1789 } 1804 1790 1805
Note:
See TracChangeset
for help on using the changeset viewer.