summaryrefslogtreecommitdiffstats
path: root/target/linux/ifxmips/files/include
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-06-25 23:05:50 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-06-25 23:05:50 +0000
commite0fb3b63965109c9ae459e7316b4956cfdd61296 (patch)
treed40c620ffc7a785694b144d1eb885d42c2bf4388 /target/linux/ifxmips/files/include
parent49c631ff5305545484375b89cb667fb91860a7ef (diff)
cleanup ifxmips and add support for both ttyS
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11578 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ifxmips/files/include')
-rw-r--r--target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips.h81
-rw-r--r--target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_irq.h6
-rw-r--r--target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_prom.h6
-rw-r--r--target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_wdt.h1
-rw-r--r--target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/gpio.h50
-rw-r--r--target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/irq.h3
-rw-r--r--target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/war.h18
7 files changed, 57 insertions, 108 deletions
diff --git a/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips.h b/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips.h
index a2efc7883..7966b13c0 100644
--- a/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips.h
+++ b/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips.h
@@ -38,17 +38,31 @@
/*------------ ASC1 */
-#define IFXMIPS_ASC1_BASE_ADDR (KSEG1 + 0x1E100C00)
-
-/* FIFO status register */
-#define IFXMIPS_ASC1_FSTAT ((u32*)(IFXMIPS_ASC1_BASE_ADDR + 0x0048))
-#define ASCFSTAT_TXFFLMASK 0x3F00
-#define ASCFSTAT_TXFFLOFF 8
-
-/* ASC1 transmit buffer */
-#define IFXMIPS_ASC1_TBUF ((u32*)(IFXMIPS_ASC1_BASE_ADDR + 0x0020))
-
-/* channel operating modes */
+#define IFXMIPS_ASC_BASE_ADDR (KSEG1 + 0x1E100400)
+#define IFXMIPS_ASC_BASE_DIFF (0x1E100C00 - 0x1E100400)
+
+#define IFXMIPS_ASC_FSTAT 0x0048
+#define IFXMIPS_ASC_TBUF 0x0020
+#define IFXMIPS_ASC_WHBSTATE 0x0018
+#define IFXMIPS_ASC_RBUF 0x0024
+#define IFXMIPS_ASC_STATE 0x0014
+#define IFXMIPS_ASC_IRNCR 0x00F8
+#define IFXMIPS_ASC_CLC 0x0000
+#define IFXMIPS_ASC_PISEL 0x0004
+#define IFXMIPS_ASC_TXFCON 0x0044
+#define IFXMIPS_ASC_RXFCON 0x0040
+#define IFXMIPS_ASC_CON 0x0010
+#define IFXMIPS_ASC_BG 0x0050
+#define IFXMIPS_ASC_IRNREN 0x00F4
+
+#define IFXMIPS_ASC_CLC_DISS 0x2
+#define ASC_IRNREN_RX_BUF 0x8
+#define ASC_IRNREN_TX_BUF 0x4
+#define ASC_IRNREN_ERR 0x2
+#define ASC_IRNREN_TX 0x1
+#define ASC_IRNCR_TIR 0x4
+#define ASC_IRNCR_RIR 0x2
+#define ASC_IRNCR_EIR 0x4
#define ASCOPT_CSIZE 0x3
#define ASCOPT_CS7 0x1
#define ASCOPT_CS8 0x2
@@ -56,50 +70,9 @@
#define ASCOPT_STOPB 0x8
#define ASCOPT_PARODD 0x0
#define ASCOPT_CREAD 0x20
+#define ASCFSTAT_TXFFLMASK 0x3F00
+#define ASCFSTAT_TXFFLOFF 8
-/* hardware modified control register */
-#define IFXMIPS_ASC1_WHBSTATE ((u32*)(IFXMIPS_ASC1_BASE_ADDR + 0x0018))
-
-/* receive buffer register */
-#define IFXMIPS_ASC1_RBUF ((u32*)(IFXMIPS_ASC1_BASE_ADDR + 0x0024))
-
-/* status register */
-#define IFXMIPS_ASC1_STATE ((u32*)(IFXMIPS_ASC1_BASE_ADDR + 0x0014))
-
-/* interrupt control */
-#define IFXMIPS_ASC1_IRNCR ((u32*)(IFXMIPS_ASC1_BASE_ADDR + 0x00F8))
-
-#define ASC_IRNCR_TIR 0x4
-#define ASC_IRNCR_RIR 0x2
-#define ASC_IRNCR_EIR 0x4
-
-/* clock control */
-#define IFXMIPS_ASC1_CLC ((u32*)(IFXMIPS_ASC1_BASE_ADDR + 0x0000))
-
-#define IFXMIPS_ASC1_CLC_DISS 0x2
-
-/* port input select register */
-#define IFXMIPS_ASC1_PISEL ((u32*)(IFXMIPS_ASC1_BASE_ADDR + 0x0004))
-
-/* tx fifo */
-#define IFXMIPS_ASC1_TXFCON ((u32*)(IFXMIPS_ASC1_BASE_ADDR + 0x0044))
-
-/* rx fifo */
-#define IFXMIPS_ASC1_RXFCON ((u32*)(IFXMIPS_ASC1_BASE_ADDR + 0x0040))
-
-/* control */
-#define IFXMIPS_ASC1_CON ((u32*)(IFXMIPS_ASC1_BASE_ADDR + 0x0010))
-
-/* timer reload */
-#define IFXMIPS_ASC1_BG ((u32*)(IFXMIPS_ASC1_BASE_ADDR + 0x0050))
-
-/* int enable */
-#define IFXMIPS_ASC1_IRNREN ((u32*)(IFXMIPS_ASC1_BASE_ADDR + 0x00F4))
-
-#define ASC_IRNREN_RX_BUF 0x8
-#define ASC_IRNREN_TX_BUF 0x4
-#define ASC_IRNREN_ERR 0x2
-#define ASC_IRNREN_TX 0x1
/*------------ RCU */
diff --git a/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_irq.h b/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_irq.h
index 6c9f59e0f..6017df0ac 100644
--- a/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_irq.h
+++ b/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_irq.h
@@ -28,9 +28,9 @@
#define INT_NUM_IM4_IRL0 (INT_NUM_IRQ0 + 128)
#define INT_NUM_IM_OFFSET (INT_NUM_IM1_IRL0 - INT_NUM_IM0_IRL0)
-#define IFXMIPSASC1_TIR (INT_NUM_IM3_IRL0 + 7)
-#define IFXMIPSASC1_RIR (INT_NUM_IM3_IRL0 + 9)
-#define IFXMIPSASC1_EIR (INT_NUM_IM3_IRL0 + 10)
+#define IFXMIPSASC_TIR(x) (INT_NUM_IM3_IRL0 + (x * 7))
+#define IFXMIPSASC_RIR(x) (INT_NUM_IM3_IRL0 + (x * 7) + 2)
+#define IFXMIPSASC_EIR(x) (INT_NUM_IM3_IRL0 + (x * 7) + 3)
#define IFXMIPS_SSC_TIR (INT_NUM_IM0_IRL0 + 15)
#define IFXMIPS_SSC_RIR (INT_NUM_IM0_IRL0 + 14)
diff --git a/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_prom.h b/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_prom.h
index 248fe50ad..1c2013ed6 100644
--- a/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_prom.h
+++ b/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_prom.h
@@ -20,8 +20,8 @@
#ifndef _IFXPROM_H__
#define _IFXPROM_H__
-void prom_printf(const char * fmt, ...);
-u32 *prom_get_cp1_base(void);
-u32 prom_get_cp1_size(void);
+extern void prom_printf(const char * fmt, ...);
+extern u32 *prom_get_cp1_base(void);
+extern u32 prom_get_cp1_size(void);
#endif
diff --git a/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_wdt.h b/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_wdt.h
index 5071d778a..34833e8ea 100644
--- a/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_wdt.h
+++ b/target/linux/ifxmips/files/include/asm-mips/ifxmips/ifxmips_wdt.h
@@ -15,6 +15,7 @@
*
* Copyright (C) 2005 infineon
* Copyright (C) 2007 John Crispin <blogic@openwrt.org>
+ *
*/
#ifndef IFXMIPS_WDT_H
diff --git a/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/gpio.h b/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/gpio.h
index 2ea25f289..0d207b093 100644
--- a/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/gpio.h
+++ b/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/gpio.h
@@ -1,4 +1,6 @@
/*
+ * include/asm-mips/mach-ifxmips/gpio.h
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -14,81 +16,63 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Copyright (C) 2007 John Crispin <blogic@openwrt.org>
+ *
*/
+
#ifndef _IFXMIPS_GPIO_H_
#define _IFXMIPS_GPIO_H_
#include <asm/ifxmips/ifxmips.h>
#include <asm/ifxmips/ifxmips_gpio.h>
-static inline int
-gpio_direction_input(unsigned gpio)
-{
+static inline int gpio_direction_input(unsigned gpio) {
ifxmips_port_set_dir_in(0, gpio);
return 0;
}
-static inline int
-gpio_direction_output(unsigned gpio, int value)
-{
+static inline int gpio_direction_output(unsigned gpio, int value) {
ifxmips_port_set_dir_out(0, gpio);
return 0;
}
-static inline int
-gpio_get_value(unsigned gpio)
-{
+static inline int gpio_get_value(unsigned gpio) {
ifxmips_port_get_input(0, gpio);
return 0;
}
-static inline void
-gpio_set_value(unsigned gpio, int value)
-{
+static inline void gpio_set_value(unsigned gpio, int value) {
ifxmips_port_set_output(0, gpio);
}
-static inline int
-gpio_request(unsigned gpio, const char *label)
-{
+static inline int gpio_request(unsigned gpio, const char *label) {
return 0;
}
-static inline void
-gpio_free(unsigned gpio)
-{
+static inline void gpio_free(unsigned gpio) {
}
-static inline int
-gpio_to_irq(unsigned gpio)
-{
+static inline int gpio_to_irq(unsigned gpio) {
return 0;
}
-static inline int
-irq_to_gpio(unsigned irq)
-{
+static inline int irq_to_gpio(unsigned irq) {
return 0;
}
-static inline int
-gpio_cansleep(unsigned gpio)
-{
+static inline int gpio_cansleep(unsigned gpio) {
return 0;
}
-static inline int
-gpio_get_value_cansleep(unsigned gpio)
-{
+static inline int gpio_get_value_cansleep(unsigned gpio) {
might_sleep();
return gpio_get_value(gpio);
}
-static inline void
-gpio_set_value_cansleep(unsigned gpio, int value)
-{
+static inline void gpio_set_value_cansleep(unsigned gpio, int value) {
might_sleep();
gpio_set_value(gpio, value);
}
+
#endif
+
diff --git a/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/irq.h b/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/irq.h
index 98d8902fb..f178abf48 100644
--- a/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/irq.h
+++ b/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/irq.h
@@ -1,4 +1,6 @@
/*
+ * include/asm-mips/mach-ifxmips/irq.h
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -14,6 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Copyright (C) 2007 John Crispin <blogic@openwrt.org>
+ *
*/
#ifndef __IFXMIPS_IRQ_H
diff --git a/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/war.h b/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/war.h
index 077a3f4f8..de3584ecf 100644
--- a/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/war.h
+++ b/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/war.h
@@ -1,21 +1,9 @@
/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- *
- * Copyright (C) 2007 John Crispin <blogic@openwrt.org>
*/
-
#ifndef __ASM_MIPS_MACH_IFXMIPS_WAR_H
#define __ASM_MIPS_MACH_IFXMIPS_WAR_H