All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Remis Lima Baima <remis.developer@googlemail.com>
Subject: [PATCH 11/15] asm-generic: add legacy I/O header files
Date: Wed, 13 May 2009 22:56:34 +0000	[thread overview]
Message-ID: <1242255398-23779-12-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1242255398-23779-1-git-send-email-arnd@arndb.de>

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: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Remis Lima Baima <remis.developer@googlemail.com>
---
 include/asm-generic/dma.h     |   15 +++++++++++++++
 include/asm-generic/hw_irq.h  |    9 +++++++++
 include/asm-generic/parport.h |   23 +++++++++++++++++++++++
 include/asm-generic/serial.h  |   13 +++++++++++++
 include/asm-generic/timex.h   |   22 ++++++++++++++++++++++
 include/asm-generic/vga.h     |   24 ++++++++++++++++++++++++
 6 files changed, 106 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-generic/dma.h
 create mode 100644 include/asm-generic/hw_irq.h
 create mode 100644 include/asm-generic/parport.h
 create mode 100644 include/asm-generic/serial.h
 create mode 100644 include/asm-generic/timex.h
 create mode 100644 include/asm-generic/vga.h

diff --git a/include/asm-generic/dma.h b/include/asm-generic/dma.h
new file mode 100644
index 0000000..9dfc3a7
--- /dev/null
+++ b/include/asm-generic/dma.h
@@ -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 */
diff --git a/include/asm-generic/hw_irq.h b/include/asm-generic/hw_irq.h
new file mode 100644
index 0000000..89036d7
--- /dev/null
+++ b/include/asm-generic/hw_irq.h
@@ -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 */
diff --git a/include/asm-generic/parport.h b/include/asm-generic/parport.h
new file mode 100644
index 0000000..40528cb
--- /dev/null
+++ b/include/asm-generic/parport.h
@@ -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 */
diff --git a/include/asm-generic/serial.h b/include/asm-generic/serial.h
new file mode 100644
index 0000000..5e29109
--- /dev/null
+++ b/include/asm-generic/serial.h
@@ -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 */
diff --git a/include/asm-generic/timex.h b/include/asm-generic/timex.h
new file mode 100644
index 0000000..b2243cb
--- /dev/null
+++ b/include/asm-generic/timex.h
@@ -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 */
diff --git a/include/asm-generic/vga.h b/include/asm-generic/vga.h
new file mode 100644
index 0000000..36c8ff5
--- /dev/null
+++ b/include/asm-generic/vga.h
@@ -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 */
-- 
1.6.0.4

  parent reply	other threads:[~2009-05-13 22:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13 22:56 [PATCH 00/16] asm-generic headers, v4 Arnd Bergmann
2009-05-13 22:56 ` [PATCH 01/15] asm-generic: rename termios.h, signal.h and mman.h Arnd Bergmann
2009-05-14  5:11   ` Stephen Rothwell
2009-05-14  6:16     ` Sam Ravnborg
2009-05-14  6:43       ` Stephen Rothwell
2009-05-13 22:56 ` [PATCH 02/15] asm-generic: introduce asm/bitsperlong.h Arnd Bergmann
2009-05-13 22:56 ` [PATCH 03/15] asm-generic: add generic sysv ipc headers Arnd Bergmann
2009-05-13 22:56 ` [PATCH 04/15] asm-generic: add generic ABI headers Arnd Bergmann
2009-05-13 22:56 ` [PATCH 05/15] asm-generic: add a generic unistd.h Arnd Bergmann
2009-05-13 22:56 ` [PATCH 06/15] asm-generic: rename atomic.h to atomic-long.h Arnd Bergmann
2009-05-13 22:56 ` [PATCH 07/15] asm-generic: rename page.h and uaccess.h Arnd Bergmann
2009-05-13 22:56 ` [PATCH 08/15] asm-generic: make pci.h usable directly Arnd Bergmann
2009-05-13 22:56 ` [PATCH 09/15] asm-generic: make bitops.h usable Arnd Bergmann
2009-05-13 22:56 ` [PATCH 10/15] asm-generic: add generic versions of common headers Arnd Bergmann
2009-05-13 22:56 ` Arnd Bergmann [this message]
2009-05-13 22:56 ` [PATCH 12/15] asm-generic: add generic atomic.h and io.h Arnd Bergmann
2009-05-13 22:56 ` [PATCH 13/15] asm-generic: add generic NOMMU versions of some headers Arnd Bergmann
2009-05-13 22:56 ` [PATCH 14/15] asm-generic: add a generic uaccess.h Arnd Bergmann
2009-05-13 22:56 ` [PATCH 15/15] add generic lib/checksum.c Arnd Bergmann
2009-05-14  6:45 ` [PATCH 00/16] asm-generic headers, v4 Stephen Rothwell
2009-05-14  7:28   ` Arnd Bergmann
2009-05-14  7:48     ` Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1242255398-23779-12-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=remis.developer@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.