Hal pci support – Comtrol eCos User Manual

Page 450

Advertising
background image

Chapter 30. The eCos PCI Library

void cyg_pcihw_write_config_uint16( cyg_uint8 bus,

cyg_uint8 devfn, cyg_uint8 offset, cyg_uint16 val);

void cyg_pcihw_write_config_uint32( cyg_uint8 bus,

cyg_uint8 devfn, cyg_uint8 offset, cyg_uint32 val);

These functions write a register of the appropriate size to the PCI configuration space at an address composed from
the

bus

,

devfn

and

offset

arguments.

cyg_bool cyg_pcihw_translate_interrupt( cyg_uint8 bus,

cyg_uint8 devfn,

CYG_ADDRWORD *vec);

This function interrogates the device and determines which HAL interrupt vector it is connected to.

HAL PCI support

HAL support consists of a set of C macros that provide the implementation of the low level PCI API.

HAL_PCI_INIT()

Initialize the PCI bus.

HAL_PCI_READ_UINT8( bus, devfn, offset, val )

HAL_PCI_READ_UINT16( bus, devfn, offset, val )

HAL_PCI_READ_UINT32( bus, devfn, offset, val )

Read a value from the PCI configuration space of the appropriate size at an address composed from the

bus

,

devfn

and

offset

.

HAL_PCI_WRITE_UINT8( bus, devfn, offset, val )

HAL_PCI_WRITE_UINT16( bus, devfn, offset, val )

HAL_PCI_WRITE_UINT32( bus, devfn, offset, val )

Write a value to the PCI configuration space of the appropriate size at an address composed from the

bus

,

devfn

and

offset

.

HAL_PCI_TRANSLATE_INTERRUPT( bus, devfn, *vec, valid )

Translate the device’s interrupt line into a HAL interrupt vector.

HAL_PCI_ALLOC_BASE_MEMORY

HAL_PCI_ALLOC_BASE_IO

These macros define the default base addresses used to initialize the memory and I/O allocation pointers.

HAL_PCI_PHYSICAL_MEMORY_BASE

HAL_PCI_PHYSICAL_IO_BASE

PCI memory and IO range do not always correspond directly to physical memory or IO addresses. Frequently the
PCI address spaces are windowed into the processor’s address range at some offset. These macros define offsets to
be added to the PCI base addresses to translate PCI bus addresses into physical memory addresses that can be used
to access the allocated memory or IO space.

346

Advertising