From: Arnd Bergmann <arnd@arndb.de>
To: linux-kernel@vger.kernel.org
Cc: linux-arch@vger.kernel.org, Michal Simek <monstr@monstr.eu>,
Remis Lima Baima <remis.developer@googlemail.com>
Subject: [PATCH v2 7/9] asm-generic: add legacy I/O header files
Date: Thu, 30 Apr 2009 20:56:35 +0200 [thread overview]
Message-ID: <20090430185717.507117728@arndb.de> (raw)
In-Reply-To: 20090430185628.866082445@arndb.de
[-- Attachment #1: 0007-asm-generic-add-legacy-I-O-header-files.patch --]
[-- Type: text/plain, Size: 3499 bytes --]
The dma.h, hw_irq.h, serial.h and timex.h files originally
described PC-style i8237, i8259A, i8250 and i8253 chips.
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/serial.h | 13 +++++++++++++
include/asm-generic/timex.h | 29 +++++++++++++++++++++++++++++
4 files changed, 66 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/serial.h
create mode 100644 include/asm-generic/timex.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/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..8a8d4a0
--- /dev/null
+++ b/include/asm-generic/timex.h
@@ -0,0 +1,29 @@
+#ifndef __ASM_GENERIC_TIMEX_H
+#define __ASM_GENERIC_TIMEX_H
+
+/*
+ * CLOCK_TICK_RATE is highly PC-specific and should not
+ * be used in portable code. 1193182 is the value for the
+ * original i8253 PIC.
+ */
+#ifndef CLOCK_TICK_RATE
+#define CLOCK_TICK_RATE 1193182
+#endif
+
+/*
+ * If you have a cycle counter, return the value here.
+ */
+typedef unsigned long cycles_t;
+static inline cycles_t get_cycles(void)
+{
+ return 0;
+}
+
+/*
+ * 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 */
--
1.5.6.3
--
next prev parent reply other threads:[~2009-04-30 19:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-30 18:56 [PATCH v2 0/9] more non-ABI asm-generic headers Arnd Bergmann
2009-04-30 18:56 ` [PATCH v2 1/9] asm-generic: rename atomic.h to atomic-long.h Arnd Bergmann
2009-04-30 18:56 ` [PATCH v2 2/9] asm-generic: rename page.h to getorder.h Arnd Bergmann
2009-04-30 18:56 ` [PATCH v2 3/9] asm-generic: rename uaccess.h to uaccess-unaligned.h Arnd Bergmann
2009-04-30 18:56 ` [PATCH v2 4/9] asm-generic: make pci.h usable directly Arnd Bergmann
2009-04-30 18:56 ` [PATCH v2 5/9] asm-generic: make bitops.h usable Arnd Bergmann
2009-04-30 18:56 ` [PATCH v2 6/9] asm-generic: add generic versions of common headers Arnd Bergmann
2009-04-30 18:56 ` Arnd Bergmann [this message]
2009-04-30 18:56 ` [PATCH v2 8/9] asm-generic: add generic atomic.h and io.h Arnd Bergmann
2009-04-30 18:56 ` [PATCH v2 9/9] asm-generic: add generic NOMMU versions of some headers Arnd Bergmann
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=20090430185717.507117728@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=monstr@monstr.eu \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox