Changeset 39596 in vbox
- Timestamp:
- Dec 13, 2011 3:13:29 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS-new/ahci.c
r39591 r39596 88 88 } ahci_t; 89 89 90 #define AhciData ((ahci_t *) 0) 90 /* The AHCI specific data must fit into 1KB (statically allocated). */ 91 ct_assert(sizeof(ahci_t) <= 1024); 91 92 92 93 /** PCI configuration fields. */ … … 317 318 /* Build variable part first of command dword (reuses 'cmd'). */ 318 319 if (cmd == AHCI_CMD_WRITE_DMA_EXT) 319 cmd = RT_BIT_32(6); /* Indicate write to device. */320 cmd = RT_BIT_32(6); /* Indicate a write to device. */ 320 321 else if (cmd == ATA_CMD_PACKET) { 321 322 cmd |= RT_BIT_32(5); /* Indicate ATAPI command. */ … … 406 407 407 408 DBG_AHCI("AHCI: FIS receive area %lx from %x:%x\n", 408 ahci_addr_to_phys(&ahci->abFisRecv), FP_SEG(ahci ), &AhciData->abFisRecv);409 ahci_addr_to_phys(&ahci->abFisRecv), FP_SEG(ahci->abFisRecv), FP_OFF(ahci->abFisRecv)); 409 410 VBOXAHCI_PORT_WRITE_REG(ahci->iobase, u8Port, AHCI_REG_PORT_FB, ahci_addr_to_phys(&ahci->abFisRecv)); 410 411 VBOXAHCI_PORT_WRITE_REG(ahci->iobase, u8Port, AHCI_REG_PORT_FBU, 0); … … 727 728 static int ahci_hba_init(uint16_t io_base) 728 729 { 729 uint8_t i, cPorts; 730 uint32_t val; 731 uint16_t ebda_seg; 732 uint16_t ahci_seg; 730 uint8_t i, cPorts; 731 uint32_t val; 732 uint16_t ebda_seg; 733 uint16_t ahci_seg; 734 bio_dsk_t __far *bios_dsk; 735 ahci_t __far *ahci; 736 733 737 734 738 ebda_seg = read_word(0x0040, 0x000E); 739 bios_dsk = ebda_seg :> &EbdaData->bdisk; 735 740 736 741 AHCI_READ_REG(io_base, AHCI_REG_VS, val); … … 749 754 ahci_seg, sizeof(ahci_t), (uint16_t)&EbdaData->bdisk.ahci_seg, sizeof(ebda_data_t)); 750 755 751 write_word(ebda_seg, (uint16_t)&EbdaData->bdisk.ahci_seg, ahci_seg); 752 write_byte(ebda_seg, (uint16_t)&EbdaData->bdisk.ahci_devcnt, 0); 753 write_byte(ahci_seg, (uint16_t)&AhciData->cur_port, 0xff); 754 write_word(ahci_seg, (uint16_t)&AhciData->iobase, io_base); 756 bios_dsk->ahci_seg = ahci_seg; 757 bios_dsk->ahci_devcnt = 0; 758 759 ahci = ahci_seg :> 0; 760 ahci->cur_port = 0xff; 761 ahci->iobase = io_base; 755 762 756 763 /* Reset the controller. */
Note:
See TracChangeset
for help on using the changeset viewer.