x86: move drivers to sys_{in,out} functions from PLB_* macros

These x86 drivers are the last users of the PLB_* macros change to use
the sys_{in,out} functions.

Change-Id: Iebd0ad1bf5e74379498f86b24d835a0430db1311
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
This commit is contained in:
Dirk Brandewie 2015-09-10 08:37:53 -07:00 committed by Anas Nashif
commit 7b3e7544d1
3 changed files with 8 additions and 19 deletions

View file

@ -36,13 +36,6 @@ This module disables the Intel 8259A PIC (Programmable Interrupt Controller)
to prevent it from generating spurious interrupts.
*/
/*
* A board support package's board.h header must provide definitions for the
* following register access macros:
*
* PLB_BYTE_REG_WRITE
* PLB_BYTE_REG_READ
*/
#include <nanokernel.h>
#include <arch/cpu.h>
@ -66,6 +59,6 @@ to prevent it from generating spurious interrupts.
void _i8259_init(void)
{
PLB_BYTE_REG_WRITE(PIC_DISABLE, PIC_PORT2(PIC_SLAVE_BASE_ADRS));
PLB_BYTE_REG_WRITE(PIC_DISABLE, PIC_PORT2(PIC_MASTER_BASE_ADRS));
sys_out8(PIC_DISABLE, PIC_PORT2(PIC_SLAVE_BASE_ADRS));
sys_out8(PIC_DISABLE, PIC_PORT2(PIC_MASTER_BASE_ADRS));
}

View file

@ -41,10 +41,6 @@ To use the driver, the platform must define:
- Register addresses:
- PCI_CTRL_ADDR_REG;
- PCI_CTRL_DATA_REG;
- Register read/write routines:
- PLB_LONG_REG_READ() / PLB_LONG_REG_WRITE();
- PLB_WORD_REG_READ() / PLB_WORD_REG_WRITE();
- PLB_BYTE_REG_READ() / PLB_BYTE_REG_WRITE();
- pci_pin2irq() - the routine that converts the PCI interrupt pin
number to IRQ number.

View file

@ -73,15 +73,15 @@ static void pci_ctrl_read(uint32_t reg, /* PCI register to read */
switch (size) {
/* long (32 bits) */
case SYS_PCI_ACCESS_32BIT:
*data = PLB_LONG_REG_READ(reg);
*data = sys_in32(reg);
break;
/* word (16 bits) */
case SYS_PCI_ACCESS_16BIT:
*data = PLB_WORD_REG_READ(reg);
*data = sys_in16(reg);
break;
/* byte (8 bits) */
case SYS_PCI_ACCESS_8BIT:
*data = PLB_BYTE_REG_READ(reg);
*data = sys_in8(reg);
break;
}
}
@ -108,15 +108,15 @@ static void pci_ctrl_write(uint32_t reg, /* PCI register to write */
switch (size) {
/* long (32 bits) */
case SYS_PCI_ACCESS_32BIT:
PLB_LONG_REG_WRITE(data, reg);
sys_out32(data, reg);
break;
/* word (16 bits) */
case SYS_PCI_ACCESS_16BIT:
PLB_WORD_REG_WRITE(data, reg);
sys_out16(data, reg);
break;
/* byte (8 bits) */
case SYS_PCI_ACCESS_8BIT:
PLB_BYTE_REG_WRITE(data, reg);
sys_out8(data, reg);
break;
}
}