initial commit with v2.6.9
[linux-2.6.9-moxart.git] / include / asm-arm / arch-h720x / hardware.h
blob864dc1f62ee06ae49b44b4d7700edc5d6ae080c8
1 /*
2 * linux/include/asm-arm/arch-h720x/hardware.h
4 * Copyright (C) 2000 Jungjun Kim, Hynix Semiconductor Inc.
5 * (C) 2003 Thomas Gleixner <tglx@linutronix.de>
6 * (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>
8 * This file contains the hardware definitions of the h720x processors
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
14 * Do not add implementations specific defines here. This files contains
15 * only defines of the onchip peripherals. Add those defines to boards.h,
16 * which is included by this file.
19 #ifndef __ASM_ARCH_HARDWARE_H
20 #define __ASM_ARCH_HARDWARE_H
22 #define IOCLK (3686400L)
24 /* Onchip peripherals */
26 #define IO_VIRT 0xf0000000 /* IO peripherals */
27 #define IO_PHYS 0x80000000
28 #define IO_SIZE 0x00050000
30 #ifdef CONFIG_CPU_H7202
31 #include "h7202-regs.h"
32 #elif defined CONFIG_CPU_H7201
33 #include "h7201-regs.h"
34 #else
35 #error machine definition mismatch
36 #endif
38 /* Macro to access the CPU IO */
39 #define CPU_IO(x) (*(volatile u32*)(x))
41 /* Macro to access general purpose regs (base, offset) */
42 #define CPU_REG(x,y) CPU_IO(x+y)
44 /* Macro to access irq related regs */
45 #define IRQ_REG(x) CPU_REG(IRQC_VIRT,x)
47 /* CPU registers */
48 /* general purpose I/O */
49 #define GPIO_VIRT(x) (IO_VIRT + 0x23000 + ((x)<<5))
50 #define GPIO_A_VIRT (GPIO_VIRT(0))
51 #define GPIO_B_VIRT (GPIO_VIRT(1))
52 #define GPIO_C_VIRT (GPIO_VIRT(2))
53 #define GPIO_D_VIRT (GPIO_VIRT(3))
54 #define GPIO_E_VIRT (GPIO_VIRT(4))
55 #define GPIO_AMULSEL (GPIO_VIRT + 0xA4)
56 /* Register offsets general purpose I/O */
57 #define GPIO_DATA 0x00
58 #define GPIO_DIR 0x04
59 #define GPIO_MASK 0x08
60 #define GPIO_STAT 0x0C
61 #define GPIO_EDGE 0x10
62 #define GPIO_CLR 0x14
63 #define GPIO_POL 0x18
64 #define GPIO_EN 0x1C
66 /*interrupt controller */
67 #define IRQC_VIRT (IO_VIRT + 0x24000)
68 /* register offset interrupt controller */
69 #define IRQC_IER 0x00
70 #define IRQC_ISR 0x04
72 /* timer unit */
73 #define TIMER_VIRT (IO_VIRT + 0x25000)
74 /* Register offsets timer unit */
75 #define TM0_PERIOD 0x00
76 #define TM0_COUNT 0x08
77 #define TM0_CTRL 0x10
78 #define TM1_PERIOD 0x20
79 #define TM1_COUNT 0x28
80 #define TM1_CTRL 0x30
81 #define TM2_PERIOD 0x40
82 #define TM2_COUNT 0x48
83 #define TM2_CTRL 0x50
84 #define TIMER_TOPCTRL 0x60
85 #define TIMER_TOPSTAT 0x64
86 #define T64_COUNTL 0x80
87 #define T64_COUNTH 0x84
88 #define T64_CTRL 0x88
89 #define T64_BASEL 0x94
90 #define T64_BASEH 0x98
91 /* Bitmaks timer unit TOPSTAT reg */
92 #define TSTAT_T0INT 0x1
93 #define TSTAT_T1INT 0x2
94 #define TSTAT_T2INT 0x4
95 #define TSTAT_T3INT 0x8
96 /* Bit description of TMx_CTRL register */
97 #define TM_START 0x1
98 #define TM_REPEAT 0x2
99 #define TM_RESET 0x4
100 /* Bit description of TIMER_CTRL register */
101 #define ENABLE_TM0_INTR 0x1
102 #define ENABLE_TM1_INTR 0x2
103 #define ENABLE_TM2_INTR 0x4
104 #define TIMER_ENABLE_BIT 0x8
105 #define ENABLE_TIMER64 0x10
106 #define ENABLE_TIMER64_INT 0x20
108 /* PMU & PLL */
109 #define PMU_BASE (IO_VIRT + 0x1000)
110 #define PMU_MODE 0x00
111 #define PMU_STAT 0x20
112 #define PMU_PLL_CTRL 0x28
114 /* PMU Mode bits */
115 #define PMU_MODE_SLOW 0x00
116 #define PMU_MODE_RUN 0x01
117 #define PMU_MODE_IDLE 0x02
118 #define PMU_MODE_SLEEP 0x03
119 #define PMU_MODE_INIT 0x04
120 #define PMU_MODE_DEEPSLEEP 0x07
121 #define PMU_MODE_WAKEUP 0x08
123 /* PMU ... */
124 #define PLL_2_EN 0x8000
125 #define PLL_1_EN 0x4000
126 #define PLL_3_MUTE 0x0080
128 /* Control bits for PMU/ PLL */
129 #define PMU_WARMRESET 0x00010000
130 #define PLL_CTRL_MASK23 0x000080ff
132 /* LCD Controller */
133 #define LCD_BASE (IO_VIRT + 0x10000)
134 #define LCD_CTRL 0x00
135 #define LCD_STATUS 0x04
136 #define LCD_STATUS_M 0x08
137 #define LCD_INTERRUPT 0x0C
138 #define LCD_DBAR 0x10
139 #define LCD_DCAR 0x14
140 #define LCD_TIMING0 0x20
141 #define LCD_TIMING1 0x24
142 #define LCD_TIMING2 0x28
143 #define LCD_TEST 0x40
145 /* LCD Control Bits */
146 #define LCD_CTRL_LCD_ENABLE 0x00000001
147 /* Bits per pixel */
148 #define LCD_CTRL_LCD_BPP_MASK 0x00000006
149 #define LCD_CTRL_LCD_4BPP 0x00000000
150 #define LCD_CTRL_LCD_8BPP 0x00000002
151 #define LCD_CTRL_LCD_16BPP 0x00000004
152 #define LCD_CTRL_LCD_BW 0x00000008
153 #define LCD_CTRL_LCD_TFT 0x00000010
154 #define LCD_CTRL_BGR 0x00001000
155 #define LCD_CTRL_LCD_VCOMP 0x00080000
156 #define LCD_CTRL_LCD_MONO8 0x00200000
157 #define LCD_CTRL_LCD_PWR 0x00400000
158 #define LCD_CTRL_LCD_BLE 0x00800000
159 #define LCD_CTRL_LDBUSEN 0x01000000
161 /* Palette */
162 #define LCD_PALETTE_BASE (IO_VIRT + 0x10400)
164 /* Serial ports */
165 #define SERIAL0_VIRT (IO_VIRT + 0x20000)
166 #define SERIAL1_VIRT (IO_VIRT + 0x21000)
168 #define SERIAL0_BASE SERIAL0_VIRT
169 #define SERIAL1_BASE SERIAL1_VIRT
170 #define SERIAL2_BASE SERIAL2_VIRT
171 #define SERIAL3_BASE SERIAL3_VIRT
174 /* General defines to pacify gcc */
175 #define PCIO_BASE (0) /* for inb, outb and friends */
176 #define PCIO_VIRT PCIO_BASE
178 #define __ASM_ARCH_HARDWARE_INCMACH_H
179 #include "boards.h"
180 #undef __ASM_ARCH_HARDWARE_INCMACH_H
182 #endif /* __ASM_ARCH_HARDWARE_H */