asm-generic: add legacy I/O header files

The dma.h, hw_irq.h, serial.h and timex.h files originally
described PC-style i8237, i8259A, i8250, i8253 and i8255 chips
as well as the VGA style text mode graphics.

Modern architectures live happily without these specific
interfaces, but a few definitions from these headers keep
getting used in common code.

The new generic headers are what most architectures use
anyway nowadays, just implementing the minimal definitions.

Signed-off-by: Remis Lima Baima <remis.developer@googlemail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2009-05-13 22:56:34 +00:00 committed by Arnd Bergmann
parent aafe4dbed0
commit ae49e80795
6 changed files with 106 additions and 0 deletions

15
include/asm-generic/dma.h Normal file
View file

@ -0,0 +1,15 @@
#ifndef __ASM_GENERIC_DMA_H
#define __ASM_GENERIC_DMA_H
/*
* This file traditionally describes the i8237 PC style DMA controller.
* Most architectures don't have these any more and can get the minimal
* implementation from kernel/dma.c by not defining MAX_DMA_CHANNELS.
*
* Some code relies on seeing MAX_DMA_ADDRESS though.
*/
#define MAX_DMA_ADDRESS PAGE_OFFSET
extern int request_dma(unsigned int dmanr, const char *device_id);
extern void free_dma(unsigned int dmanr);
#endif /* __ASM_GENERIC_DMA_H */

View file

@ -0,0 +1,9 @@
#ifndef __ASM_GENERIC_HW_IRQ_H
#define __ASM_GENERIC_HW_IRQ_H
/*
* hw_irq.h has internal declarations for the low-level interrupt
* controller, like the original i8259A.
* In general, this is not needed for new architectures.
*/
#endif /* __ASM_GENERIC_HW_IRQ_H */

View file

@ -0,0 +1,23 @@
#ifndef __ASM_GENERIC_PARPORT_H
#define __ASM_GENERIC_PARPORT_H
/*
* An ISA bus may have i8255 parallel ports at well-known
* locations in the I/O space, which are scanned by
* parport_pc_find_isa_ports.
*
* Without ISA support, the driver will only attach
* to devices on the PCI bus.
*/
static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma);
static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma)
{
#ifdef CONFIG_ISA
return parport_pc_find_isa_ports(autoirq, autodma);
#else
return 0;
#endif
}
#endif /* __ASM_GENERIC_PARPORT_H */

View file

@ -0,0 +1,13 @@
#ifndef __ASM_GENERIC_SERIAL_H
#define __ASM_GENERIC_SERIAL_H
/*
* This should not be an architecture specific #define, oh well.
*
* Traditionally, it just describes i8250 and related serial ports
* that have this clock rate.
*/
#define BASE_BAUD (1843200 / 16)
#endif /* __ASM_GENERIC_SERIAL_H */

View file

@ -0,0 +1,22 @@
#ifndef __ASM_GENERIC_TIMEX_H
#define __ASM_GENERIC_TIMEX_H
/*
* If you have a cycle counter, return the value here.
*/
typedef unsigned long cycles_t;
#ifndef get_cycles
static inline cycles_t get_cycles(void)
{
return 0;
}
#endif
/*
* Architectures are encouraged to implement read_current_timer
* and define this in order to avoid the expensive delay loop
* calibration during boot.
*/
#undef ARCH_HAS_READ_CURRENT_TIMER
#endif /* __ASM_GENERIC_TIMEX_H */

24
include/asm-generic/vga.h Normal file
View file

@ -0,0 +1,24 @@
/*
* Access to VGA videoram
*
* (c) 1998 Martin Mares <mj@ucw.cz>
*/
#ifndef __ASM_GENERIC_VGA_H
#define __ASM_GENERIC_VGA_H
/*
* On most architectures that support VGA, we can just
* recalculate addresses and then access the videoram
* directly without any black magic.
*
* Everyone else needs to ioremap the address and use
* proper I/O accesses.
*/
#ifndef VGA_MAP_MEM
#define VGA_MAP_MEM(x, s) (unsigned long)phys_to_virt(x)
#endif
#define vga_readb(x) (*(x))
#define vga_writeb(x, y) (*(y) = (x))
#endif /* _ASM_GENERIC_VGA_H */