File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -213,9 +213,9 @@ void RAMFUNCTION wolfBoot_start(void)
213213 panic ();
214214 }
215215
216+ sata_disable (sata_bar );
216217 wolfBoot_printf ("Firmware Valid.\r\n" );
217218 wolfBoot_printf ("Booting at %08lx\r\n" , os_image .fw_base );
218- sata_disable (sata_bar );
219219 hal_prepare_boot ();
220220 do_boot ((uint32_t * )os_image .fw_base );
221221
Original file line number Diff line number Diff line change @@ -646,10 +646,17 @@ void sata_enable(uint32_t base)
646646 */
647647void sata_disable (uint32_t base )
648648{
649+ uint32_t ports_impl ;
649650 uint32_t i , reg ;
650651 volatile uint32_t count ;
652+ AHCI_DEBUG_PRINTF ("SATA: disabling sata controller at 0x%x\r\n" , base );
653+
654+ ports_impl = mmio_read32 (AHCI_HBA_PI (base ));
651655
652656 for (i = 0 ; i < AHCI_MAX_PORTS ; i ++ ) {
657+ if ((ports_impl & (1 << i )) == 0 )
658+ continue ;
659+ AHCI_DEBUG_PRINTF ("AHCI: disabling port %d\r\n" , i );
653660 /* Clear port SERR */
654661 reg = mmio_read32 (AHCI_PxSERR (base , i ));
655662 mmio_write32 (AHCI_PxSERR (base ,i ), reg );
You can’t perform that action at this time.
0 commit comments