ahci

package
v0.0.0-...-70d8496 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2019 License: BSD-3-Clause, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_PRD_ENTRIES int = 65536
	MAX_PRD_SIZE    int = 4 * 1024 * 1024
)
View Source
const (
	PCI_MSI_MCR_64BIT = 0x00800000

	HBD_PORT_IPM_ACTIVE  uint32 = 1
	HBD_PORT_DET_PRESENT uint32 = 3

	SATA_SIG_ATA = 0x00000101 // SATA drive

	AHCI_GHC_AE uint32 = (1 << 31) // Use AHCI to communicate
	AHCI_GHC_IE uint32 = (1 << 1)  // Enable interrupts from AHCI

	AHCI_PORT_CMD_ST     uint32 = (1 << 0)  // start
	AHCI_PORT_CMD_SUD    uint32 = (1 << 1)  // spin-up device
	AHCI_PORT_CMD_POD    uint32 = (1 << 2)  // power on device
	AHCI_PORT_CMD_FRE    uint32 = (1 << 4)  // FIS receive enable
	AHCI_PORT_CMD_FR     uint32 = (1 << 14) // FIS receive running
	AHCI_PORT_CMD_CR     uint32 = (1 << 15) // command list running
	AHCI_PORT_CMD_ACTIVE uint32 = (1 << 28) // ICC active

	AHCI_PORT_INTR_DPE  = (1 << 5) // Descriptor (PRD) processed
	AHCI_PORT_INTR_SDBE = (1 << 3) // Set Device Bits FIS received
	AHCI_PORT_INTR_DSE  = (1 << 2) // DMA Setup FIS received
	AHCI_PORT_INTR_PSE  = (1 << 1) // PIO Setup FIS received
	AHCI_PORT_INTR_DHRE = (1 << 0) // D2H Register FIS received

	AHCI_PORT_INTR_DEFAULT = AHCI_PORT_INTR_DPE | AHCI_PORT_INTR_SDBE |
		AHCI_PORT_INTR_DSE | AHCI_PORT_INTR_PSE |
		AHCI_PORT_INTR_DHRE

	AHCI_CMD_FLAGS_WRITE uint16 = (1 << 6)

	SATA_FIS_TYPE_REG_H2D uint8 = 0x27
	SATA_FIS_TYPE_REG_D2H uint8 = 0x34
	SATA_FIS_REG_CFLAG    uint8 = (1 << 7) // issuing new command

	IDE_CMD_READ_DMA_EXT    uint8 = 0x25
	IDE_CMD_WRITE_DMA_EXT   uint8 = 0x35
	IDE_CMD_FLUSH_CACHE_EXT       = 0xea
	IDE_CMD_IDENTIFY        uint8 = 0xec
	IDE_CMD_SETFEATURES     uint8 = 0xef

	IDE_DEV_LBA   = 0x40
	IDE_CTL_LBA48 = 0x80

	IDE_FEATURE86_LBA48 uint16 = (1 << 10)
	IDE_STAT_BSY        uint32 = 0x80

	IDE_SATA_NCQ_SUPPORTED   = (1 << 8)
	IDE_SATA_NCQ_QUEUE_DEPTH = 0x1f

	IDE_FEATURE_WCACHE_ENA = 0x02
	IDE_FEATURE_RLA_ENA    = 0xAA
)

Variables

View Source
var Ahci fs.Disk_i
View Source
var Blockmem = &blockmem_t{}

Functions

func Ahci_init

func Ahci_init()

func CLR

func CLR(f *uint32, v uint32)

func CLR16

func CLR16(f *uint16, v uint16)

func LD

func LD(f *uint32) uint32

func LD16

func LD16(f *uint16) uint16

func LD32

func LD32(f *uint32) uint32

func LD64

func LD64(f *uint64) uint64

func SET

func SET(f *uint32, v uint32)

func SET16

func SET16(f *uint16, v uint16)

func ST

func ST(f *uint32, v uint32)

func ST16

func ST16(f *uint16, v uint16)

func ST64

func ST64(f *uint64, v uint64)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL