MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / include / asm-arm / arch-s3c24a0 / hardware.h
blob6f07c1892d6a51d94e5cbfaa77e053e271208a90
1 /*
2 * include/asm-arm/arch-s3c24a0/hardware.h
4 * $Id: hardware.h,v 1.3 2006/12/12 13:13:07 gerg Exp $
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * based on S3C2410.h modified by hcyun <heechul.yun@samsung.com>
23 * modified for hybrid MM support (uClinux and Linux) by Hyok S. Choi
26 #ifndef __ASM_ARCH_HARDWARE_H
27 #define __ASM_ARCH_HARDWARE_H
29 #ifndef CONFIG_MMU
30 /* called on reserve_node_zero() for reserving mmu section table */
31 #ifndef CONFIG_DRAM_BASE
32 #define CONFIG_DRAM_BASE 0x10000000
33 #endif
35 #define MACH_RESERVE_BOOTMEM() do { \
36 reserve_bootmem_node(pgdat, (CONFIG_DRAM_BASE + 0x4000), 0x4000); \
37 } while(0)
39 #define MACH_FREE_BOOTMEM()
41 #endif /* !CONFIG_MMU */
43 #define PCIO_BASE 0
45 #if defined(CONFIG_DRAM_BASE) && defined(CONFIG_DRAM_SIZE)
46 #define PA_SDRAM_BASE (CONFIG_DRAM_BASE)
47 #define MEM_SIZE (CONFIG_DRAM_SIZE)
48 #else
49 #define PA_SDRAM_BASE 0x10000000
50 #define MEM_SIZE 0x04000000
51 #endif
54 * S3C24A0 internal I/O mappings
56 * We have the following mapping:
57 * phys virt
58 * 40000000 e0000000
61 #ifdef CONFIG_MMU
63 #define VIO_BASE 0xe0000000 /* virtual start of IO space */
64 #define PIO_START 0x40000000 /* physical start of IO space */
66 #define io_p2v(x) ((x) | 0xa0000000)
67 #define io_v2p(x) ((x) & ~0xa0000000)
69 #define io_p2v_isp(x) ((x) + 0xec000000)
70 #define io_v2p_isp(x) ((x) - 0xec000000)
73 #else /* UCLINUX */
75 #define PIO_START 0x40000000
76 #define VIO_BASE PIO_START
78 #define io_p2v(x) (x)
79 #define io_v2p(x) (x)
81 #define io_p2v_isp(x) (x)
82 #define io_v2p_isp(x) (x)
85 #endif /* CONFIG_MMU */
88 #ifndef __ASSEMBLY__
89 #include <asm/types.h>
92 * This __REG() version gives the same results as the one above, except
93 * that we are fooling gcc some how so it generates far better and smaller
94 * assembly code for access to contigous registers. It's a shame that gcc
95 * doesn't guess this by itself
97 typedef struct { volatile u32 offset[4096]; } __regbase;
98 #define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2]
99 #define __REG(x) __REGP(io_p2v(x))
101 /* Let's kick gcc's ass again... */
102 # define __REG2(x,y) \
103 ( __builtin_constant_p(y) ? (__REG((x) + (y))) \
104 : (*(volatile u32 *)((u32)&__REG(x) + (y))) )
106 #define __PREG(x) (io_v2p((u32)&(x)))
108 /*SEO add to allocate vertual memory address for ISP1583 */
109 #define __REG_ISP(x) io_p2v_isp(x)
110 #define __PREG_ISP(x) io_v2p_isp(x)
113 #else /* __ASSEMBLY__ */
115 # define __REG(x) io_p2v(x)
116 # define __PREG(x) io_v2p(x)
118 #endif /* __ASSEMBLY__ */
120 #include "S3C24A0.h"
122 #ifndef __ASSEMBLY__
124 #define EINT_PULLUP_EN (0)
125 #define EINT_PULLUP_DIS (1)
127 #define EINT_LOW_LEVEL (0x0)
128 #define EINT_HIGH_LEVEL (0x1)
129 #define EINT_FALLING_EDGE (0x2)
130 #define EINT_RISING_EDGE (0x4)
131 #define EINT_BOTH_EDGES (0x6)
133 extern int set_external_irq(int irq, int edge, int pullup);
135 #endif
137 #ifdef CONFIG_ARCH_SMDK24A0
138 #include "smdk.h"
139 #else
140 #error not defined board
141 #endif
143 #endif /* __ASM_ARCH_HARDWARE_H */