aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-m68knommu
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-m68knommu')
-rw-r--r--include/asm-m68knommu/MC68328.h1266
-rw-r--r--include/asm-m68knommu/MC68332.h152
-rw-r--r--include/asm-m68knommu/MC68EZ328.h1253
-rw-r--r--include/asm-m68knommu/MC68VZ328.h1349
-rw-r--r--include/asm-m68knommu/a.out.h1
-rw-r--r--include/asm-m68knommu/anchor.h112
-rw-r--r--include/asm-m68knommu/asm-offsets.h49
-rw-r--r--include/asm-m68knommu/atomic.h134
-rw-r--r--include/asm-m68knommu/bitops.h503
-rw-r--r--include/asm-m68knommu/bootinfo.h2
-rw-r--r--include/asm-m68knommu/bootstd.h132
-rw-r--r--include/asm-m68knommu/bug.h4
-rw-r--r--include/asm-m68knommu/bugs.h16
-rw-r--r--include/asm-m68knommu/byteorder.h13
-rw-r--r--include/asm-m68knommu/cache.h12
-rw-r--r--include/asm-m68knommu/cachectl.h1
-rw-r--r--include/asm-m68knommu/cacheflush.h75
-rw-r--r--include/asm-m68knommu/checksum.h133
-rw-r--r--include/asm-m68knommu/coldfire.h86
-rw-r--r--include/asm-m68knommu/commproc.h723
-rw-r--r--include/asm-m68knommu/cputime.h6
-rw-r--r--include/asm-m68knommu/current.h24
-rw-r--r--include/asm-m68knommu/dbg.h6
-rw-r--r--include/asm-m68knommu/delay.h76
-rw-r--r--include/asm-m68knommu/div64.h1
-rw-r--r--include/asm-m68knommu/dma-mapping.h10
-rw-r--r--include/asm-m68knommu/dma.h492
-rw-r--r--include/asm-m68knommu/elf.h113
-rw-r--r--include/asm-m68knommu/elia.h42
-rw-r--r--include/asm-m68knommu/entry.h183
-rw-r--r--include/asm-m68knommu/errno.h1
-rw-r--r--include/asm-m68knommu/fcntl.h1
-rw-r--r--include/asm-m68knommu/flat.h16
-rw-r--r--include/asm-m68knommu/fpu.h22
-rw-r--r--include/asm-m68knommu/hardirq.h25
-rw-r--r--include/asm-m68knommu/hdreg.h1
-rw-r--r--include/asm-m68knommu/hwtest.h1
-rw-r--r--include/asm-m68knommu/ide.h444
-rw-r--r--include/asm-m68knommu/io.h203
-rw-r--r--include/asm-m68knommu/ioctl.h1
-rw-r--r--include/asm-m68knommu/ioctls.h1
-rw-r--r--include/asm-m68knommu/ipc.h1
-rw-r--r--include/asm-m68knommu/ipcbuf.h1
-rw-r--r--include/asm-m68knommu/irq.h128
-rw-r--r--include/asm-m68knommu/kmap_types.h21
-rw-r--r--include/asm-m68knommu/linkage.h1
-rw-r--r--include/asm-m68knommu/local.h6
-rw-r--r--include/asm-m68knommu/m5206sim.h132
-rw-r--r--include/asm-m68knommu/m5249sim.h209
-rw-r--r--include/asm-m68knommu/m5272sim.h79
-rw-r--r--include/asm-m68knommu/m527xsim.h58
-rw-r--r--include/asm-m68knommu/m528xsim.h45
-rw-r--r--include/asm-m68knommu/m5307sim.h181
-rw-r--r--include/asm-m68knommu/m5407sim.h157
-rw-r--r--include/asm-m68knommu/m68360.h5
-rw-r--r--include/asm-m68knommu/m68360_enet.h177
-rw-r--r--include/asm-m68knommu/m68360_pram.h431
-rw-r--r--include/asm-m68knommu/m68360_quicc.h362
-rw-r--r--include/asm-m68knommu/m68360_regs.h408
-rw-r--r--include/asm-m68knommu/machdep.h54
-rw-r--r--include/asm-m68knommu/math-emu.h1
-rw-r--r--include/asm-m68knommu/mc146818rtc.h9
-rw-r--r--include/asm-m68knommu/mcfcache.h125
-rw-r--r--include/asm-m68knommu/mcfdma.h145
-rw-r--r--include/asm-m68knommu/mcfmbus.h78
-rw-r--r--include/asm-m68knommu/mcfne.h353
-rw-r--r--include/asm-m68knommu/mcfpci.h120
-rw-r--r--include/asm-m68knommu/mcfpit.h63
-rw-r--r--include/asm-m68knommu/mcfsim.h109
-rw-r--r--include/asm-m68knommu/mcfsmc.h188
-rw-r--r--include/asm-m68knommu/mcftimer.h85
-rw-r--r--include/asm-m68knommu/mcfuart.h200
-rw-r--r--include/asm-m68knommu/mcfwdebug.h119
-rw-r--r--include/asm-m68knommu/md.h1
-rw-r--r--include/asm-m68knommu/mman.h1
-rw-r--r--include/asm-m68knommu/mmu.h11
-rw-r--r--include/asm-m68knommu/mmu_context.h33
-rw-r--r--include/asm-m68knommu/module.h1
-rw-r--r--include/asm-m68knommu/movs.h1
-rw-r--r--include/asm-m68knommu/msgbuf.h1
-rw-r--r--include/asm-m68knommu/namei.h1
-rw-r--r--include/asm-m68knommu/nettel.h109
-rw-r--r--include/asm-m68knommu/openprom.h1
-rw-r--r--include/asm-m68knommu/oplib.h1
-rw-r--r--include/asm-m68knommu/page.h95
-rw-r--r--include/asm-m68knommu/page_offset.h47
-rw-r--r--include/asm-m68knommu/param.h26
-rw-r--r--include/asm-m68knommu/pci.h39
-rw-r--r--include/asm-m68knommu/percpu.h6
-rw-r--r--include/asm-m68knommu/pgalloc.h8
-rw-r--r--include/asm-m68knommu/pgtable.h76
-rw-r--r--include/asm-m68knommu/poll.h1
-rw-r--r--include/asm-m68knommu/posix_types.h1
-rw-r--r--include/asm-m68knommu/processor.h131
-rw-r--r--include/asm-m68knommu/ptrace.h91
-rw-r--r--include/asm-m68knommu/quicc_simple.h52
-rw-r--r--include/asm-m68knommu/resource.h1
-rw-r--r--include/asm-m68knommu/scatterlist.h13
-rw-r--r--include/asm-m68knommu/sections.h7
-rw-r--r--include/asm-m68knommu/segment.h51
-rw-r--r--include/asm-m68knommu/semaphore-helper.h83
-rw-r--r--include/asm-m68knommu/semaphore.h157
-rw-r--r--include/asm-m68knommu/sembuf.h1
-rw-r--r--include/asm-m68knommu/setup.h5
-rw-r--r--include/asm-m68knommu/shm.h1
-rw-r--r--include/asm-m68knommu/shmbuf.h1
-rw-r--r--include/asm-m68knommu/shmparam.h1
-rw-r--r--include/asm-m68knommu/sigcontext.h16
-rw-r--r--include/asm-m68knommu/siginfo.h6
-rw-r--r--include/asm-m68knommu/signal.h183
-rw-r--r--include/asm-m68knommu/smp.h1
-rw-r--r--include/asm-m68knommu/socket.h1
-rw-r--r--include/asm-m68knommu/sockios.h1
-rw-r--r--include/asm-m68knommu/spinlock.h1
-rw-r--r--include/asm-m68knommu/stat.h1
-rw-r--r--include/asm-m68knommu/statfs.h1
-rw-r--r--include/asm-m68knommu/string.h126
-rw-r--r--include/asm-m68knommu/system.h286
-rw-r--r--include/asm-m68knommu/termbits.h1
-rw-r--r--include/asm-m68knommu/termios.h1
-rw-r--r--include/asm-m68knommu/thread_info.h106
-rw-r--r--include/asm-m68knommu/timex.h1
-rw-r--r--include/asm-m68knommu/tlb.h1
-rw-r--r--include/asm-m68knommu/tlbflush.h61
-rw-r--r--include/asm-m68knommu/topology.h6
-rw-r--r--include/asm-m68knommu/traps.h150
-rw-r--r--include/asm-m68knommu/types.h1
-rw-r--r--include/asm-m68knommu/uaccess.h182
-rw-r--r--include/asm-m68knommu/ucontext.h38
-rw-r--r--include/asm-m68knommu/unaligned.h24
-rw-r--r--include/asm-m68knommu/unistd.h529
-rw-r--r--include/asm-m68knommu/user.h1
132 files changed, 14516 insertions, 0 deletions
diff --git a/include/asm-m68knommu/MC68328.h b/include/asm-m68knommu/MC68328.h
new file mode 100644
index 000000000000..4f5a9845f5be
--- /dev/null
+++ b/include/asm-m68knommu/MC68328.h
@@ -0,0 +1,1266 @@
1
2/* include/asm-m68knommu/MC68328.h: '328 control registers
3 *
4 * Copyright (C) 1999 Vladimir Gurevich <vgurevic@cisco.com>
5 * Bear & Hare Software, Inc.
6 *
7 * Based on include/asm-m68knommu/MC68332.h
8 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>,
9 *
10 */
11
12#ifndef _MC68328_H_
13#define _MC68328_H_
14
15#define BYTE_REF(addr) (*((volatile unsigned char*)addr))
16#define WORD_REF(addr) (*((volatile unsigned short*)addr))
17#define LONG_REF(addr) (*((volatile unsigned long*)addr))
18
19#define PUT_FIELD(field, val) (((val) << field##_SHIFT) & field##_MASK)
20#define GET_FIELD(reg, field) (((reg) & field##_MASK) >> field##_SHIFT)
21
22/**********
23 *
24 * 0xFFFFF0xx -- System Control
25 *
26 **********/
27
28/*
29 * System Control Register (SCR)
30 */
31#define SCR_ADDR 0xfffff000
32#define SCR BYTE_REF(SCR_ADDR)
33
34#define SCR_WDTH8 0x01 /* 8-Bit Width Select */
35#define SCR_DMAP 0x04 /* Double Map */
36#define SCR_SO 0x08 /* Supervisor Only */
37#define SCR_BETEN 0x10 /* Bus-Error Time-Out Enable */
38#define SCR_PRV 0x20 /* Privilege Violation */
39#define SCR_WPV 0x40 /* Write Protect Violation */
40#define SCR_BETO 0x80 /* Bus-Error TimeOut */
41
42/*
43 * Mask Revision Register
44 */
45#define MRR_ADDR 0xfffff004
46#define MRR LONG_REF(MRR_ADDR)
47
48/**********
49 *
50 * 0xFFFFF1xx -- Chip-Select logic
51 *
52 **********/
53
54/**********
55 *
56 * 0xFFFFF2xx -- Phase Locked Loop (PLL) & Power Control
57 *
58 **********/
59
60/*
61 * Group Base Address Registers
62 */
63#define GRPBASEA_ADDR 0xfffff100
64#define GRPBASEB_ADDR 0xfffff102
65#define GRPBASEC_ADDR 0xfffff104
66#define GRPBASED_ADDR 0xfffff106
67
68#define GRPBASEA WORD_REF(GRPBASEA_ADDR)
69#define GRPBASEB WORD_REF(GRPBASEB_ADDR)
70#define GRPBASEC WORD_REF(GRPBASEC_ADDR)
71#define GRPBASED WORD_REF(GRPBASED_ADDR)
72
73#define GRPBASE_V 0x0001 /* Valid */
74#define GRPBASE_GBA_MASK 0xfff0 /* Group Base Address (bits 31-20) */
75
76/*
77 * Group Base Address Mask Registers
78 */
79#define GRPMASKA_ADDR 0xfffff108
80#define GRPMASKB_ADDR 0xfffff10a
81#define GRPMASKC_ADDR 0xfffff10c
82#define GRPMASKD_ADDR 0xfffff10e
83
84#define GRPMASKA WORD_REF(GRPMASKA_ADDR)
85#define GRPMASKB WORD_REF(GRPMASKB_ADDR)
86#define GRPMASKC WORD_REF(GRPMASKC_ADDR)
87#define GRPMASKD WORD_REF(GRPMASKD_ADDR)
88
89#define GRMMASK_GMA_MASK 0xfffff0 /* Group Base Mask (bits 31-20) */
90
91/*
92 * Chip-Select Option Registers (group A)
93 */
94#define CSA0_ADDR 0xfffff110
95#define CSA1_ADDR 0xfffff114
96#define CSA2_ADDR 0xfffff118
97#define CSA3_ADDR 0xfffff11c
98
99#define CSA0 LONG_REF(CSA0_ADDR)
100#define CSA1 LONG_REF(CSA1_ADDR)
101#define CSA2 LONG_REF(CSA2_ADDR)
102#define CSA3 LONG_REF(CSA3_ADDR)
103
104#define CSA_WAIT_MASK 0x00000007 /* Wait State Selection */
105#define CSA_WAIT_SHIFT 0
106#define CSA_RO 0x00000008 /* Read-Only */
107#define CSA_AM_MASK 0x0000ff00 /* Address Mask (bits 23-16) */
108#define CSA_AM_SHIFT 8
109#define CSA_BUSW 0x00010000 /* Bus Width Select */
110#define CSA_AC_MASK 0xff000000 /* Address Compare (bits 23-16) */
111#define CSA_AC_SHIFT 24
112
113/*
114 * Chip-Select Option Registers (group B)
115 */
116#define CSB0_ADDR 0xfffff120
117#define CSB1_ADDR 0xfffff124
118#define CSB2_ADDR 0xfffff128
119#define CSB3_ADDR 0xfffff12c
120
121#define CSB0 LONG_REF(CSB0_ADDR)
122#define CSB1 LONG_REF(CSB1_ADDR)
123#define CSB2 LONG_REF(CSB2_ADDR)
124#define CSB3 LONG_REF(CSB3_ADDR)
125
126#define CSB_WAIT_MASK 0x00000007 /* Wait State Selection */
127#define CSB_WAIT_SHIFT 0
128#define CSB_RO 0x00000008 /* Read-Only */
129#define CSB_AM_MASK 0x0000ff00 /* Address Mask (bits 23-16) */
130#define CSB_AM_SHIFT 8
131#define CSB_BUSW 0x00010000 /* Bus Width Select */
132#define CSB_AC_MASK 0xff000000 /* Address Compare (bits 23-16) */
133#define CSB_AC_SHIFT 24
134
135/*
136 * Chip-Select Option Registers (group C)
137 */
138#define CSC0_ADDR 0xfffff130
139#define CSC1_ADDR 0xfffff134
140#define CSC2_ADDR 0xfffff138
141#define CSC3_ADDR 0xfffff13c
142
143#define CSC0 LONG_REF(CSC0_ADDR)
144#define CSC1 LONG_REF(CSC1_ADDR)
145#define CSC2 LONG_REF(CSC2_ADDR)
146#define CSC3 LONG_REF(CSC3_ADDR)
147
148#define CSC_WAIT_MASK 0x00000007 /* Wait State Selection */
149#define CSC_WAIT_SHIFT 0
150#define CSC_RO 0x00000008 /* Read-Only */
151#define CSC_AM_MASK 0x0000fff0 /* Address Mask (bits 23-12) */
152#define CSC_AM_SHIFT 4
153#define CSC_BUSW 0x00010000 /* Bus Width Select */
154#define CSC_AC_MASK 0xfff00000 /* Address Compare (bits 23-12) */
155#define CSC_AC_SHIFT 20
156
157/*
158 * Chip-Select Option Registers (group D)
159 */
160#define CSD0_ADDR 0xfffff140
161#define CSD1_ADDR 0xfffff144
162#define CSD2_ADDR 0xfffff148
163#define CSD3_ADDR 0xfffff14c
164
165#define CSD0 LONG_REF(CSD0_ADDR)
166#define CSD1 LONG_REF(CSD1_ADDR)
167#define CSD2 LONG_REF(CSD2_ADDR)
168#define CSD3 LONG_REF(CSD3_ADDR)
169
170#define CSD_WAIT_MASK 0x00000007 /* Wait State Selection */
171#define CSD_WAIT_SHIFT 0
172#define CSD_RO 0x00000008 /* Read-Only */
173#define CSD_AM_MASK 0x0000fff0 /* Address Mask (bits 23-12) */
174#define CSD_AM_SHIFT 4
175#define CSD_BUSW 0x00010000 /* Bus Width Select */
176#define CSD_AC_MASK 0xfff00000 /* Address Compare (bits 23-12) */
177#define CSD_AC_SHIFT 20
178
179/**********
180 *
181 * 0xFFFFF2xx -- Phase Locked Loop (PLL) & Power Control
182 *
183 **********/
184
185/*
186 * PLL Control Register
187 */
188#define PLLCR_ADDR 0xfffff200
189#define PLLCR WORD_REF(PLLCR_ADDR)
190
191#define PLLCR_DISPLL 0x0008 /* Disable PLL */
192#define PLLCR_CLKEN 0x0010 /* Clock (CLKO pin) enable */
193#define PLLCR_SYSCLK_SEL_MASK 0x0700 /* System Clock Selection */
194#define PLLCR_SYSCLK_SEL_SHIFT 8
195#define PLLCR_PIXCLK_SEL_MASK 0x3800 /* LCD Clock Selection */
196#define PLLCR_PIXCLK_SEL_SHIFT 11
197
198/* 'EZ328-compatible definitions */
199#define PLLCR_LCDCLK_SEL_MASK PLLCR_PIXCLK_SEL_MASK
200#define PLLCR_LCDCLK_SEL_SHIFT PLLCR_PIXCLK_SEL_SHIFT
201
202/*
203 * PLL Frequency Select Register
204 */
205#define PLLFSR_ADDR 0xfffff202
206#define PLLFSR WORD_REF(PLLFSR_ADDR)
207
208#define PLLFSR_PC_MASK 0x00ff /* P Count */
209#define PLLFSR_PC_SHIFT 0
210#define PLLFSR_QC_MASK 0x0f00 /* Q Count */
211#define PLLFSR_QC_SHIFT 8
212#define PLLFSR_PROT 0x4000 /* Protect P & Q */
213#define PLLFSR_CLK32 0x8000 /* Clock 32 (kHz) */
214
215/*
216 * Power Control Register
217 */
218#define PCTRL_ADDR 0xfffff207
219#define PCTRL BYTE_REF(PCTRL_ADDR)
220
221#define PCTRL_WIDTH_MASK 0x1f /* CPU Clock bursts width */
222#define PCTRL_WIDTH_SHIFT 0
223#define PCTRL_STOP 0x40 /* Enter power-save mode immediately */
224#define PCTRL_PCEN 0x80 /* Power Control Enable */
225
226/**********
227 *
228 * 0xFFFFF3xx -- Interrupt Controller
229 *
230 **********/
231
232/*
233 * Interrupt Vector Register
234 */
235#define IVR_ADDR 0xfffff300
236#define IVR BYTE_REF(IVR_ADDR)
237
238#define IVR_VECTOR_MASK 0xF8
239
240/*
241 * Interrupt control Register
242 */
243#define ICR_ADRR 0xfffff302
244#define ICR WORD_REF(ICR_ADDR)
245
246#define ICR_ET6 0x0100 /* Edge Trigger Select for IRQ6 */
247#define ICR_ET3 0x0200 /* Edge Trigger Select for IRQ3 */
248#define ICR_ET2 0x0400 /* Edge Trigger Select for IRQ2 */
249#define ICR_ET1 0x0800 /* Edge Trigger Select for IRQ1 */
250#define ICR_POL6 0x1000 /* Polarity Control for IRQ6 */
251#define ICR_POL3 0x2000 /* Polarity Control for IRQ3 */
252#define ICR_POL2 0x4000 /* Polarity Control for IRQ2 */
253#define ICR_POL1 0x8000 /* Polarity Control for IRQ1 */
254
255/*
256 * Interrupt Mask Register
257 */
258#define IMR_ADDR 0xfffff304
259#define IMR LONG_REF(IMR_ADDR)
260
261/*
262 * Define the names for bit positions first. This is useful for
263 * request_irq
264 */
265#define SPIM_IRQ_NUM 0 /* SPI Master interrupt */
266#define TMR2_IRQ_NUM 1 /* Timer 2 interrupt */
267#define UART_IRQ_NUM 2 /* UART interrupt */
268#define WDT_IRQ_NUM 3 /* Watchdog Timer interrupt */
269#define RTC_IRQ_NUM 4 /* RTC interrupt */
270#define KB_IRQ_NUM 6 /* Keyboard Interrupt */
271#define PWM_IRQ_NUM 7 /* Pulse-Width Modulator int. */
272#define INT0_IRQ_NUM 8 /* External INT0 */
273#define INT1_IRQ_NUM 9 /* External INT1 */
274#define INT2_IRQ_NUM 10 /* External INT2 */
275#define INT3_IRQ_NUM 11 /* External INT3 */
276#define INT4_IRQ_NUM 12 /* External INT4 */
277#define INT5_IRQ_NUM 13 /* External INT5 */
278#define INT6_IRQ_NUM 14 /* External INT6 */
279#define INT7_IRQ_NUM 15 /* External INT7 */
280#define IRQ1_IRQ_NUM 16 /* IRQ1 */
281#define IRQ2_IRQ_NUM 17 /* IRQ2 */
282#define IRQ3_IRQ_NUM 18 /* IRQ3 */
283#define IRQ6_IRQ_NUM 19 /* IRQ6 */
284#define PEN_IRQ_NUM 20 /* Pen Interrupt */
285#define SPIS_IRQ_NUM 21 /* SPI Slave Interrupt */
286#define TMR1_IRQ_NUM 22 /* Timer 1 interrupt */
287#define IRQ7_IRQ_NUM 23 /* IRQ7 */
288
289/* '328-compatible definitions */
290#define SPI_IRQ_NUM SPIM_IRQ_NUM
291#define TMR_IRQ_NUM TMR1_IRQ_NUM
292
293/*
294 * Here go the bitmasks themselves
295 */
296#define IMR_MSPIM (1 << SPIM _IRQ_NUM) /* Mask SPI Master interrupt */
297#define IMR_MTMR2 (1 << TMR2_IRQ_NUM) /* Mask Timer 2 interrupt */
298#define IMR_MUART (1 << UART_IRQ_NUM) /* Mask UART interrupt */
299#define IMR_MWDT (1 << WDT_IRQ_NUM) /* Mask Watchdog Timer interrupt */
300#define IMR_MRTC (1 << RTC_IRQ_NUM) /* Mask RTC interrupt */
301#define IMR_MKB (1 << KB_IRQ_NUM) /* Mask Keyboard Interrupt */
302#define IMR_MPWM (1 << PWM_IRQ_NUM) /* Mask Pulse-Width Modulator int. */
303#define IMR_MINT0 (1 << INT0_IRQ_NUM) /* Mask External INT0 */
304#define IMR_MINT1 (1 << INT1_IRQ_NUM) /* Mask External INT1 */
305#define IMR_MINT2 (1 << INT2_IRQ_NUM) /* Mask External INT2 */
306#define IMR_MINT3 (1 << INT3_IRQ_NUM) /* Mask External INT3 */
307#define IMR_MINT4 (1 << INT4_IRQ_NUM) /* Mask External INT4 */
308#define IMR_MINT5 (1 << INT5_IRQ_NUM) /* Mask External INT5 */
309#define IMR_MINT6 (1 << INT6_IRQ_NUM) /* Mask External INT6 */
310#define IMR_MINT7 (1 << INT7_IRQ_NUM) /* Mask External INT7 */
311#define IMR_MIRQ1 (1 << IRQ1_IRQ_NUM) /* Mask IRQ1 */
312#define IMR_MIRQ2 (1 << IRQ2_IRQ_NUM) /* Mask IRQ2 */
313#define IMR_MIRQ3 (1 << IRQ3_IRQ_NUM) /* Mask IRQ3 */
314#define IMR_MIRQ6 (1 << IRQ6_IRQ_NUM) /* Mask IRQ6 */
315#define IMR_MPEN (1 << PEN_IRQ_NUM) /* Mask Pen Interrupt */
316#define IMR_MSPIS (1 << SPIS_IRQ_NUM) /* Mask SPI Slave Interrupt */
317#define IMR_MTMR1 (1 << TMR1_IRQ_NUM) /* Mask Timer 1 interrupt */
318#define IMR_MIRQ7 (1 << IRQ7_IRQ_NUM) /* Mask IRQ7 */
319
320/* 'EZ328-compatible definitions */
321#define IMR_MSPI IMR_MSPIM
322#define IMR_MTMR IMR_MTMR1
323
324/*
325 * Interrupt Wake-Up Enable Register
326 */
327#define IWR_ADDR 0xfffff308
328#define IWR LONG_REF(IWR_ADDR)
329
330#define IWR_SPIM (1 << SPIM _IRQ_NUM) /* SPI Master interrupt */
331#define IWR_TMR2 (1 << TMR2_IRQ_NUM) /* Timer 2 interrupt */
332#define IWR_UART (1 << UART_IRQ_NUM) /* UART interrupt */
333#define IWR_WDT (1 << WDT_IRQ_NUM) /* Watchdog Timer interrupt */
334#define IWR_RTC (1 << RTC_IRQ_NUM) /* RTC interrupt */
335#define IWR_KB (1 << KB_IRQ_NUM) /* Keyboard Interrupt */
336#define IWR_PWM (1 << PWM_IRQ_NUM) /* Pulse-Width Modulator int. */
337#define IWR_INT0 (1 << INT0_IRQ_NUM) /* External INT0 */
338#define IWR_INT1 (1 << INT1_IRQ_NUM) /* External INT1 */
339#define IWR_INT2 (1 << INT2_IRQ_NUM) /* External INT2 */
340#define IWR_INT3 (1 << INT3_IRQ_NUM) /* External INT3 */
341#define IWR_INT4 (1 << INT4_IRQ_NUM) /* External INT4 */
342#define IWR_INT5 (1 << INT5_IRQ_NUM) /* External INT5 */
343#define IWR_INT6 (1 << INT6_IRQ_NUM) /* External INT6 */
344#define IWR_INT7 (1 << INT7_IRQ_NUM) /* External INT7 */
345#define IWR_IRQ1 (1 << IRQ1_IRQ_NUM) /* IRQ1 */
346#define IWR_IRQ2 (1 << IRQ2_IRQ_NUM) /* IRQ2 */
347#define IWR_IRQ3 (1 << IRQ3_IRQ_NUM) /* IRQ3 */
348#define IWR_IRQ6 (1 << IRQ6_IRQ_NUM) /* IRQ6 */
349#define IWR_PEN (1 << PEN_IRQ_NUM) /* Pen Interrupt */
350#define IWR_SPIS (1 << SPIS_IRQ_NUM) /* SPI Slave Interrupt */
351#define IWR_TMR1 (1 << TMR1_IRQ_NUM) /* Timer 1 interrupt */
352#define IWR_IRQ7 (1 << IRQ7_IRQ_NUM) /* IRQ7 */
353
354/*
355 * Interrupt Status Register
356 */
357#define ISR_ADDR 0xfffff30c
358#define ISR LONG_REF(ISR_ADDR)
359
360#define ISR_SPIM (1 << SPIM _IRQ_NUM) /* SPI Master interrupt */
361#define ISR_TMR2 (1 << TMR2_IRQ_NUM) /* Timer 2 interrupt */
362#define ISR_UART (1 << UART_IRQ_NUM) /* UART interrupt */
363#define ISR_WDT (1 << WDT_IRQ_NUM) /* Watchdog Timer interrupt */
364#define ISR_RTC (1 << RTC_IRQ_NUM) /* RTC interrupt */
365#define ISR_KB (1 << KB_IRQ_NUM) /* Keyboard Interrupt */
366#define ISR_PWM (1 << PWM_IRQ_NUM) /* Pulse-Width Modulator int. */
367#define ISR_INT0 (1 << INT0_IRQ_NUM) /* External INT0 */
368#define ISR_INT1 (1 << INT1_IRQ_NUM) /* External INT1 */
369#define ISR_INT2 (1 << INT2_IRQ_NUM) /* External INT2 */
370#define ISR_INT3 (1 << INT3_IRQ_NUM) /* External INT3 */
371#define ISR_INT4 (1 << INT4_IRQ_NUM) /* External INT4 */
372#define ISR_INT5 (1 << INT5_IRQ_NUM) /* External INT5 */
373#define ISR_INT6 (1 << INT6_IRQ_NUM) /* External INT6 */
374#define ISR_INT7 (1 << INT7_IRQ_NUM) /* External INT7 */
375#define ISR_IRQ1 (1 << IRQ1_IRQ_NUM) /* IRQ1 */
376#define ISR_IRQ2 (1 << IRQ2_IRQ_NUM) /* IRQ2 */
377#define ISR_IRQ3 (1 << IRQ3_IRQ_NUM) /* IRQ3 */
378#define ISR_IRQ6 (1 << IRQ6_IRQ_NUM) /* IRQ6 */
379#define ISR_PEN (1 << PEN_IRQ_NUM) /* Pen Interrupt */
380#define ISR_SPIS (1 << SPIS_IRQ_NUM) /* SPI Slave Interrupt */
381#define ISR_TMR1 (1 << TMR1_IRQ_NUM) /* Timer 1 interrupt */
382#define ISR_IRQ7 (1 << IRQ7_IRQ_NUM) /* IRQ7 */
383
384/* 'EZ328-compatible definitions */
385#define ISR_SPI ISR_SPIM
386#define ISR_TMR ISR_TMR1
387
388/*
389 * Interrupt Pending Register
390 */
391#define IPR_ADDR 0xfffff310
392#define IPR LONG_REF(IPR_ADDR)
393
394#define IPR_SPIM (1 << SPIM _IRQ_NUM) /* SPI Master interrupt */
395#define IPR_TMR2 (1 << TMR2_IRQ_NUM) /* Timer 2 interrupt */
396#define IPR_UART (1 << UART_IRQ_NUM) /* UART interrupt */
397#define IPR_WDT (1 << WDT_IRQ_NUM) /* Watchdog Timer interrupt */
398#define IPR_RTC (1 << RTC_IRQ_NUM) /* RTC interrupt */
399#define IPR_KB (1 << KB_IRQ_NUM) /* Keyboard Interrupt */
400#define IPR_PWM (1 << PWM_IRQ_NUM) /* Pulse-Width Modulator int. */
401#define IPR_INT0 (1 << INT0_IRQ_NUM) /* External INT0 */
402#define IPR_INT1 (1 << INT1_IRQ_NUM) /* External INT1 */
403#define IPR_INT2 (1 << INT2_IRQ_NUM) /* External INT2 */
404#define IPR_INT3 (1 << INT3_IRQ_NUM) /* External INT3 */
405#define IPR_INT4 (1 << INT4_IRQ_NUM) /* External INT4 */
406#define IPR_INT5 (1 << INT5_IRQ_NUM) /* External INT5 */
407#define IPR_INT6 (1 << INT6_IRQ_NUM) /* External INT6 */
408#define IPR_INT7 (1 << INT7_IRQ_NUM) /* External INT7 */
409#define IPR_IRQ1 (1 << IRQ1_IRQ_NUM) /* IRQ1 */
410#define IPR_IRQ2 (1 << IRQ2_IRQ_NUM) /* IRQ2 */
411#define IPR_IRQ3 (1 << IRQ3_IRQ_NUM) /* IRQ3 */
412#define IPR_IRQ6 (1 << IRQ6_IRQ_NUM) /* IRQ6 */
413#define IPR_PEN (1 << PEN_IRQ_NUM) /* Pen Interrupt */
414#define IPR_SPIS (1 << SPIS_IRQ_NUM) /* SPI Slave Interrupt */
415#define IPR_TMR1 (1 << TMR1_IRQ_NUM) /* Timer 1 interrupt */
416#define IPR_IRQ7 (1 << IRQ7_IRQ_NUM) /* IRQ7 */
417
418/* 'EZ328-compatible definitions */
419#define IPR_SPI IPR_SPIM
420#define IPR_TMR IPR_TMR1
421
422/**********
423 *
424 * 0xFFFFF4xx -- Parallel Ports
425 *
426 **********/
427
428/*
429 * Port A
430 */
431#define PADIR_ADDR 0xfffff400 /* Port A direction reg */
432#define PADATA_ADDR 0xfffff401 /* Port A data register */
433#define PASEL_ADDR 0xfffff403 /* Port A Select register */
434
435#define PADIR BYTE_REF(PADIR_ADDR)
436#define PADATA BYTE_REF(PADATA_ADDR)
437#define PASEL BYTE_REF(PASEL_ADDR)
438
439#define PA(x) (1 << (x))
440#define PA_A(x) PA((x) - 16) /* This is specific to PA only! */
441
442#define PA_A16 PA(0) /* Use A16 as PA(0) */
443#define PA_A17 PA(1) /* Use A17 as PA(1) */
444#define PA_A18 PA(2) /* Use A18 as PA(2) */
445#define PA_A19 PA(3) /* Use A19 as PA(3) */
446#define PA_A20 PA(4) /* Use A20 as PA(4) */
447#define PA_A21 PA(5) /* Use A21 as PA(5) */
448#define PA_A22 PA(6) /* Use A22 as PA(6) */
449#define PA_A23 PA(7) /* Use A23 as PA(7) */
450
451/*
452 * Port B
453 */
454#define PBDIR_ADDR 0xfffff408 /* Port B direction reg */
455#define PBDATA_ADDR 0xfffff409 /* Port B data register */
456#define PBSEL_ADDR 0xfffff40b /* Port B Select Register */
457
458#define PBDIR BYTE_REF(PBDIR_ADDR)
459#define PBDATA BYTE_REF(PBDATA_ADDR)
460#define PBSEL BYTE_REF(PBSEL_ADDR)
461
462#define PB(x) (1 << (x))
463#define PB_D(x) PB(x) /* This is specific to port B only */
464
465#define PB_D0 PB(0) /* Use D0 as PB(0) */
466#define PB_D1 PB(1) /* Use D1 as PB(1) */
467#define PB_D2 PB(2) /* Use D2 as PB(2) */
468#define PB_D3 PB(3) /* Use D3 as PB(3) */
469#define PB_D4 PB(4) /* Use D4 as PB(4) */
470#define PB_D5 PB(5) /* Use D5 as PB(5) */
471#define PB_D6 PB(6) /* Use D6 as PB(6) */
472#define PB_D7 PB(7) /* Use D7 as PB(7) */
473
474/*
475 * Port C
476 */
477#define PCDIR_ADDR 0xfffff410 /* Port C direction reg */
478#define PCDATA_ADDR 0xfffff411 /* Port C data register */
479#define PCSEL_ADDR 0xfffff413 /* Port C Select Register */
480
481#define PCDIR BYTE_REF(PCDIR_ADDR)
482#define PCDATA BYTE_REF(PCDATA_ADDR)
483#define PCSEL BYTE_REF(PCSEL_ADDR)
484
485#define PC(x) (1 << (x))
486
487#define PC_WE PC(6) /* Use WE as PC(6) */
488#define PC_DTACK PC(5) /* Use DTACK as PC(5) */
489#define PC_IRQ7 PC(4) /* Use IRQ7 as PC(4) */
490#define PC_LDS PC(2) /* Use LDS as PC(2) */
491#define PC_UDS PC(1) /* Use UDS as PC(1) */
492#define PC_MOCLK PC(0) /* Use MOCLK as PC(0) */
493
494/*
495 * Port D
496 */
497#define PDDIR_ADDR 0xfffff418 /* Port D direction reg */
498#define PDDATA_ADDR 0xfffff419 /* Port D data register */
499#define PDPUEN_ADDR 0xfffff41a /* Port D Pull-Up enable reg */
500#define PDPOL_ADDR 0xfffff41c /* Port D Polarity Register */
501#define PDIRQEN_ADDR 0xfffff41d /* Port D IRQ enable register */
502#define PDIQEG_ADDR 0xfffff41f /* Port D IRQ Edge Register */
503
504#define PDDIR BYTE_REF(PDDIR_ADDR)
505#define PDDATA BYTE_REF(PDDATA_ADDR)
506#define PDPUEN BYTE_REF(PDPUEN_ADDR)
507#define PDPOL BYTE_REF(PDPOL_ADDR)
508#define PDIRQEN BYTE_REF(PDIRQEN_ADDR)
509#define PDIQEG BYTE_REF(PDIQEG_ADDR)
510
511#define PD(x) (1 << (x))
512#define PD_KB(x) PD(x) /* This is specific for Port D only */
513
514#define PD_KB0 PD(0) /* Use KB0 as PD(0) */
515#define PD_KB1 PD(1) /* Use KB1 as PD(1) */
516#define PD_KB2 PD(2) /* Use KB2 as PD(2) */
517#define PD_KB3 PD(3) /* Use KB3 as PD(3) */
518#define PD_KB4 PD(4) /* Use KB4 as PD(4) */
519#define PD_KB5 PD(5) /* Use KB5 as PD(5) */
520#define PD_KB6 PD(6) /* Use KB6 as PD(6) */
521#define PD_KB7 PD(7) /* Use KB7 as PD(7) */
522
523/*
524 * Port E
525 */
526#define PEDIR_ADDR 0xfffff420 /* Port E direction reg */
527#define PEDATA_ADDR 0xfffff421 /* Port E data register */
528#define PEPUEN_ADDR 0xfffff422 /* Port E Pull-Up enable reg */
529#define PESEL_ADDR 0xfffff423 /* Port E Select Register */
530
531#define PEDIR BYTE_REF(PEDIR_ADDR)
532#define PEDATA BYTE_REF(PEDATA_ADDR)
533#define PEPUEN BYTE_REF(PEPUEN_ADDR)
534#define PESEL BYTE_REF(PESEL_ADDR)
535
536#define PE(x) (1 << (x))
537
538#define PE_CSA1 PE(1) /* Use CSA1 as PE(1) */
539#define PE_CSA2 PE(2) /* Use CSA2 as PE(2) */
540#define PE_CSA3 PE(3) /* Use CSA3 as PE(3) */
541#define PE_CSB0 PE(4) /* Use CSB0 as PE(4) */
542#define PE_CSB1 PE(5) /* Use CSB1 as PE(5) */
543#define PE_CSB2 PE(6) /* Use CSB2 as PE(6) */
544#define PE_CSB3 PE(7) /* Use CSB3 as PE(7) */
545
546/*
547 * Port F
548 */
549#define PFDIR_ADDR 0xfffff428 /* Port F direction reg */
550#define PFDATA_ADDR 0xfffff429 /* Port F data register */
551#define PFPUEN_ADDR 0xfffff42a /* Port F Pull-Up enable reg */
552#define PFSEL_ADDR 0xfffff42b /* Port F Select Register */
553
554#define PFDIR BYTE_REF(PFDIR_ADDR)
555#define PFDATA BYTE_REF(PFDATA_ADDR)
556#define PFPUEN BYTE_REF(PFPUEN_ADDR)
557#define PFSEL BYTE_REF(PFSEL_ADDR)
558
559#define PF(x) (1 << (x))
560#define PF_A(x) PF((x) - 24) /* This is Port F specific only */
561
562#define PF_A24 PF(0) /* Use A24 as PF(0) */
563#define PF_A25 PF(1) /* Use A25 as PF(1) */
564#define PF_A26 PF(2) /* Use A26 as PF(2) */
565#define PF_A27 PF(3) /* Use A27 as PF(3) */
566#define PF_A28 PF(4) /* Use A28 as PF(4) */
567#define PF_A29 PF(5) /* Use A29 as PF(5) */
568#define PF_A30 PF(6) /* Use A30 as PF(6) */
569#define PF_A31 PF(7) /* Use A31 as PF(7) */
570
571/*
572 * Port G
573 */
574#define PGDIR_ADDR 0xfffff430 /* Port G direction reg */
575#define PGDATA_ADDR 0xfffff431 /* Port G data register */
576#define PGPUEN_ADDR 0xfffff432 /* Port G Pull-Up enable reg */
577#define PGSEL_ADDR 0xfffff433 /* Port G Select Register */
578
579#define PGDIR BYTE_REF(PGDIR_ADDR)
580#define PGDATA BYTE_REF(PGDATA_ADDR)
581#define PGPUEN BYTE_REF(PGPUEN_ADDR)
582#define PGSEL BYTE_REF(PGSEL_ADDR)
583
584#define PG(x) (1 << (x))
585
586#define PG_UART_TXD PG(0) /* Use UART_TXD as PG(0) */
587#define PG_UART_RXD PG(1) /* Use UART_RXD as PG(1) */
588#define PG_PWMOUT PG(2) /* Use PWMOUT as PG(2) */
589#define PG_TOUT2 PG(3) /* Use TOUT2 as PG(3) */
590#define PG_TIN2 PG(4) /* Use TIN2 as PG(4) */
591#define PG_TOUT1 PG(5) /* Use TOUT1 as PG(5) */
592#define PG_TIN1 PG(6) /* Use TIN1 as PG(6) */
593#define PG_RTCOUT PG(7) /* Use RTCOUT as PG(7) */
594
595/*
596 * Port J
597 */
598#define PJDIR_ADDR 0xfffff438 /* Port J direction reg */
599#define PJDATA_ADDR 0xfffff439 /* Port J data register */
600#define PJSEL_ADDR 0xfffff43b /* Port J Select Register */
601
602#define PJDIR BYTE_REF(PJDIR_ADDR)
603#define PJDATA BYTE_REF(PJDATA_ADDR)
604#define PJSEL BYTE_REF(PJSEL_ADDR)
605
606#define PJ(x) (1 << (x))
607
608#define PJ_CSD3 PJ(7) /* Use CSD3 as PJ(7) */
609
610/*
611 * Port K
612 */
613#define PKDIR_ADDR 0xfffff440 /* Port K direction reg */
614#define PKDATA_ADDR 0xfffff441 /* Port K data register */
615#define PKPUEN_ADDR 0xfffff442 /* Port K Pull-Up enable reg */
616#define PKSEL_ADDR 0xfffff443 /* Port K Select Register */
617
618#define PKDIR BYTE_REF(PKDIR_ADDR)
619#define PKDATA BYTE_REF(PKDATA_ADDR)
620#define PKPUEN BYTE_REF(PKPUEN_ADDR)
621#define PKSEL BYTE_REF(PKSEL_ADDR)
622
623#define PK(x) (1 << (x))
624
625/*
626 * Port M
627 */
628#define PMDIR_ADDR 0xfffff438 /* Port M direction reg */
629#define PMDATA_ADDR 0xfffff439 /* Port M data register */
630#define PMPUEN_ADDR 0xfffff43a /* Port M Pull-Up enable reg */
631#define PMSEL_ADDR 0xfffff43b /* Port M Select Register */
632
633#define PMDIR BYTE_REF(PMDIR_ADDR)
634#define PMDATA BYTE_REF(PMDATA_ADDR)
635#define PMPUEN BYTE_REF(PMPUEN_ADDR)
636#define PMSEL BYTE_REF(PMSEL_ADDR)
637
638#define PM(x) (1 << (x))
639
640/**********
641 *
642 * 0xFFFFF5xx -- Pulse-Width Modulator (PWM)
643 *
644 **********/
645
646/*
647 * PWM Control Register
648 */
649#define PWMC_ADDR 0xfffff500
650#define PWMC WORD_REF(PWMC_ADDR)
651
652#define PWMC_CLKSEL_MASK 0x0007 /* Clock Selection */
653#define PWMC_CLKSEL_SHIFT 0
654#define PWMC_PWMEN 0x0010 /* Enable PWM */
655#define PMNC_POL 0x0020 /* PWM Output Bit Polarity */
656#define PWMC_PIN 0x0080 /* Current PWM output pin status */
657#define PWMC_LOAD 0x0100 /* Force a new period */
658#define PWMC_IRQEN 0x4000 /* Interrupt Request Enable */
659#define PWMC_CLKSRC 0x8000 /* Clock Source Select */
660
661/* 'EZ328-compatible definitions */
662#define PWMC_EN PWMC_PWMEN
663
664/*
665 * PWM Period Register
666 */
667#define PWMP_ADDR 0xfffff502
668#define PWMP WORD_REF(PWMP_ADDR)
669
670/*
671 * PWM Width Register
672 */
673#define PWMW_ADDR 0xfffff504
674#define PWMW WORD_REF(PWMW_ADDR)
675
676/*
677 * PWM Counter Register
678 */
679#define PWMCNT_ADDR 0xfffff506
680#define PWMCNT WORD_REF(PWMCNT_ADDR)
681
682/**********
683 *
684 * 0xFFFFF6xx -- General-Purpose Timers
685 *
686 **********/
687
688/*
689 * Timer Unit 1 and 2 Control Registers
690 */
691#define TCTL1_ADDR 0xfffff600
692#define TCTL1 WORD_REF(TCTL1_ADDR)
693#define TCTL2_ADDR 0xfffff60c
694#define TCTL2 WORD_REF(TCTL2_ADDR)
695
696#define TCTL_TEN 0x0001 /* Timer Enable */
697#define TCTL_CLKSOURCE_MASK 0x000e /* Clock Source: */
698#define TCTL_CLKSOURCE_STOP 0x0000 /* Stop count (disabled) */
699#define TCTL_CLKSOURCE_SYSCLK 0x0002 /* SYSCLK to prescaler */
700#define TCTL_CLKSOURCE_SYSCLK_16 0x0004 /* SYSCLK/16 to prescaler */
701#define TCTL_CLKSOURCE_TIN 0x0006 /* TIN to prescaler */
702#define TCTL_CLKSOURCE_32KHZ 0x0008 /* 32kHz clock to prescaler */
703#define TCTL_IRQEN 0x0010 /* IRQ Enable */
704#define TCTL_OM 0x0020 /* Output Mode */
705#define TCTL_CAP_MASK 0x00c0 /* Capture Edge: */
706#define TCTL_CAP_RE 0x0040 /* Capture on rizing edge */
707#define TCTL_CAP_FE 0x0080 /* Capture on falling edge */
708#define TCTL_FRR 0x0010 /* Free-Run Mode */
709
710/* 'EZ328-compatible definitions */
711#define TCTL_ADDR TCTL1_ADDR
712#define TCTL TCTL1
713
714/*
715 * Timer Unit 1 and 2 Prescaler Registers
716 */
717#define TPRER1_ADDR 0xfffff602
718#define TPRER1 WORD_REF(TPRER1_ADDR)
719#define TPRER2_ADDR 0xfffff60e
720#define TPRER2 WORD_REF(TPRER2_ADDR)
721
722/* 'EZ328-compatible definitions */
723#define TPRER_ADDR TPRER1_ADDR
724#define TPRER TPRER1
725
726/*
727 * Timer Unit 1 and 2 Compare Registers
728 */
729#define TCMP1_ADDR 0xfffff604
730#define TCMP1 WORD_REF(TCMP1_ADDR)
731#define TCMP2_ADDR 0xfffff610
732#define TCMP2 WORD_REF(TCMP2_ADDR)
733
734/* 'EZ328-compatible definitions */
735#define TCMP_ADDR TCMP1_ADDR
736#define TCMP TCMP1
737
738/*
739 * Timer Unit 1 and 2 Capture Registers
740 */
741#define TCR1_ADDR 0xfffff606
742#define TCR1 WORD_REF(TCR1_ADDR)
743#define TCR2_ADDR 0xfffff612
744#define TCR2 WORD_REF(TCR2_ADDR)
745
746/* 'EZ328-compatible definitions */
747#define TCR_ADDR TCR1_ADDR
748#define TCR TCR1
749
750/*
751 * Timer Unit 1 and 2 Counter Registers
752 */
753#define TCN1_ADDR 0xfffff608
754#define TCN1 WORD_REF(TCN1_ADDR)
755#define TCN2_ADDR 0xfffff614
756#define TCN2 WORD_REF(TCN2_ADDR)
757
758/* 'EZ328-compatible definitions */
759#define TCN_ADDR TCN1_ADDR
760#define TCN TCN
761
762/*
763 * Timer Unit 1 and 2 Status Registers
764 */
765#define TSTAT1_ADDR 0xfffff60a
766#define TSTAT1 WORD_REF(TSTAT1_ADDR)
767#define TSTAT2_ADDR 0xfffff616
768#define TSTAT2 WORD_REF(TSTAT2_ADDR)
769
770#define TSTAT_COMP 0x0001 /* Compare Event occurred */
771#define TSTAT_CAPT 0x0001 /* Capture Event occurred */
772
773/* 'EZ328-compatible definitions */
774#define TSTAT_ADDR TSTAT1_ADDR
775#define TSTAT TSTAT1
776
777/*
778 * Watchdog Compare Register
779 */
780#define WRR_ADDR 0xfffff61a
781#define WRR WORD_REF(WRR_ADDR)
782
783/*
784 * Watchdog Counter Register
785 */
786#define WCN_ADDR 0xfffff61c
787#define WCN WORD_REF(WCN_ADDR)
788
789/*
790 * Watchdog Control and Status Register
791 */
792#define WCSR_ADDR 0xfffff618
793#define WCSR WORD_REF(WCSR_ADDR)
794
795#define WCSR_WDEN 0x0001 /* Watchdog Enable */
796#define WCSR_FI 0x0002 /* Forced Interrupt (instead of SW reset)*/
797#define WCSR_WRST 0x0004 /* Watchdog Reset */
798
799/**********
800 *
801 * 0xFFFFF7xx -- Serial Periferial Interface Slave (SPIS)
802 *
803 **********/
804
805/*
806 * SPI Slave Register
807 */
808#define SPISR_ADDR 0xfffff700
809#define SPISR WORD_REF(SPISR_ADDR)
810
811#define SPISR_DATA_ADDR 0xfffff701
812#define SPISR_DATA BYTE_REF(SPISR_DATA_ADDR)
813
814#define SPISR_DATA_MASK 0x00ff /* Shifted data from the external device */
815#define SPISR_DATA_SHIFT 0
816#define SPISR_SPISEN 0x0100 /* SPIS module enable */
817#define SPISR_POL 0x0200 /* SPSCLK polarity control */
818#define SPISR_PHA 0x0400 /* Phase relationship between SPSCLK & SPSRxD */
819#define SPISR_OVWR 0x0800 /* Data buffer has been overwritten */
820#define SPISR_DATARDY 0x1000 /* Data ready */
821#define SPISR_ENPOL 0x2000 /* Enable Polarity */
822#define SPISR_IRQEN 0x4000 /* SPIS IRQ Enable */
823#define SPISR_SPISIRQ 0x8000 /* SPIS IRQ posted */
824
825/**********
826 *
827 * 0xFFFFF8xx -- Serial Periferial Interface Master (SPIM)
828 *
829 **********/
830
831/*
832 * SPIM Data Register
833 */
834#define SPIMDATA_ADDR 0xfffff800
835#define SPIMDATA WORD_REF(SPIMDATA_ADDR)
836
837/*
838 * SPIM Control/Status Register
839 */
840#define SPIMCONT_ADDR 0xfffff802
841#define SPIMCONT WORD_REF(SPIMCONT_ADDR)
842
843#define SPIMCONT_BIT_COUNT_MASK 0x000f /* Transfer Length in Bytes */
844#define SPIMCONT_BIT_COUNT_SHIFT 0
845#define SPIMCONT_POL 0x0010 /* SPMCLK Signel Polarity */
846#define SPIMCONT_PHA 0x0020 /* Clock/Data phase relationship */
847#define SPIMCONT_IRQEN 0x0040 /* IRQ Enable */
848#define SPIMCONT_SPIMIRQ 0x0080 /* Interrupt Request */
849#define SPIMCONT_XCH 0x0100 /* Exchange */
850#define SPIMCONT_RSPIMEN 0x0200 /* Enable SPIM */
851#define SPIMCONT_DATA_RATE_MASK 0xe000 /* SPIM Data Rate */
852#define SPIMCONT_DATA_RATE_SHIFT 13
853
854/* 'EZ328-compatible definitions */
855#define SPIMCONT_IRQ SPIMCONT_SPIMIRQ
856#define SPIMCONT_ENABLE SPIMCONT_SPIMEN
857/**********
858 *
859 * 0xFFFFF9xx -- UART
860 *
861 **********/
862
863/*
864 * UART Status/Control Register
865 */
866#define USTCNT_ADDR 0xfffff900
867#define USTCNT WORD_REF(USTCNT_ADDR)
868
869#define USTCNT_TXAVAILEN 0x0001 /* Transmitter Available Int Enable */
870#define USTCNT_TXHALFEN 0x0002 /* Transmitter Half Empty Int Enable */
871#define USTCNT_TXEMPTYEN 0x0004 /* Transmitter Empty Int Enable */
872#define USTCNT_RXREADYEN 0x0008 /* Receiver Ready Interrupt Enable */
873#define USTCNT_RXHALFEN 0x0010 /* Receiver Half-Full Int Enable */
874#define USTCNT_RXFULLEN 0x0020 /* Receiver Full Interrupt Enable */
875#define USTCNT_CTSDELTAEN 0x0040 /* CTS Delta Interrupt Enable */
876#define USTCNT_GPIODELTAEN 0x0080 /* Old Data Interrupt Enable */
877#define USTCNT_8_7 0x0100 /* Eight or seven-bit transmission */
878#define USTCNT_STOP 0x0200 /* Stop bit transmission */
879#define USTCNT_ODD_EVEN 0x0400 /* Odd Parity */
880#define USTCNT_PARITYEN 0x0800 /* Parity Enable */
881#define USTCNT_CLKMODE 0x1000 /* Clock Mode Select */
882#define USTCNT_TXEN 0x2000 /* Transmitter Enable */
883#define USTCNT_RXEN 0x4000 /* Receiver Enable */
884#define USTCNT_UARTEN 0x8000 /* UART Enable */
885
886/* 'EZ328-compatible definitions */
887#define USTCNT_TXAE USTCNT_TXAVAILEN
888#define USTCNT_TXHE USTCNT_TXHALFEN
889#define USTCNT_TXEE USTCNT_TXEMPTYEN
890#define USTCNT_RXRE USTCNT_RXREADYEN
891#define USTCNT_RXHE USTCNT_RXHALFEN
892#define USTCNT_RXFE USTCNT_RXFULLEN
893#define USTCNT_CTSD USTCNT_CTSDELTAEN
894#define USTCNT_ODD USTCNT_ODD_EVEN
895#define USTCNT_PEN USTCNT_PARITYEN
896#define USTCNT_CLKM USTCNT_CLKMODE
897#define USTCNT_UEN USTCNT_UARTEN
898
899/*
900 * UART Baud Control Register
901 */
902#define UBAUD_ADDR 0xfffff902
903#define UBAUD WORD_REF(UBAUD_ADDR)
904
905#define UBAUD_PRESCALER_MASK 0x003f /* Actual divisor is 65 - PRESCALER */
906#define UBAUD_PRESCALER_SHIFT 0
907#define UBAUD_DIVIDE_MASK 0x0700 /* Baud Rate freq. divizor */
908#define UBAUD_DIVIDE_SHIFT 8
909#define UBAUD_BAUD_SRC 0x0800 /* Baud Rate Source */
910#define UBAUD_GPIOSRC 0x1000 /* GPIO source */
911#define UBAUD_GPIODIR 0x2000 /* GPIO Direction */
912#define UBAUD_GPIO 0x4000 /* Current GPIO pin status */
913#define UBAUD_GPIODELTA 0x8000 /* GPIO pin value changed */
914
915/*
916 * UART Receiver Register
917 */
918#define URX_ADDR 0xfffff904
919#define URX WORD_REF(URX_ADDR)
920
921#define URX_RXDATA_ADDR 0xfffff905
922#define URX_RXDATA BYTE_REF(URX_RXDATA_ADDR)
923
924#define URX_RXDATA_MASK 0x00ff /* Received data */
925#define URX_RXDATA_SHIFT 0
926#define URX_PARITY_ERROR 0x0100 /* Parity Error */
927#define URX_BREAK 0x0200 /* Break Detected */
928#define URX_FRAME_ERROR 0x0400 /* Framing Error */
929#define URX_OVRUN 0x0800 /* Serial Overrun */
930#define URX_DATA_READY 0x2000 /* Data Ready (FIFO not empty) */
931#define URX_FIFO_HALF 0x4000 /* FIFO is Half-Full */
932#define URX_FIFO_FULL 0x8000 /* FIFO is Full */
933
934/*
935 * UART Transmitter Register
936 */
937#define UTX_ADDR 0xfffff906
938#define UTX WORD_REF(UTX_ADDR)
939
940#define UTX_TXDATA_ADDR 0xfffff907
941#define UTX_TXDATA BYTE_REF(UTX_TXDATA_ADDR)
942
943#define UTX_TXDATA_MASK 0x00ff /* Data to be transmitted */
944#define UTX_TXDATA_SHIFT 0
945#define UTX_CTS_DELTA 0x0100 /* CTS changed */
946#define UTX_CTS_STATUS 0x0200 /* CTS State */
947#define UTX_IGNORE_CTS 0x0800 /* Ignore CTS */
948#define UTX_SEND_BREAK 0x1000 /* Send a BREAK */
949#define UTX_TX_AVAIL 0x2000 /* Transmit FIFO has a slot available */
950#define UTX_FIFO_HALF 0x4000 /* Transmit FIFO is half empty */
951#define UTX_FIFO_EMPTY 0x8000 /* Transmit FIFO is empty */
952
953/* 'EZ328-compatible definitions */
954#define UTX_CTS_STAT UTX_CTS_STATUS
955#define UTX_NOCTS UTX_IGNORE_CTS
956
957/*
958 * UART Miscellaneous Register
959 */
960#define UMISC_ADDR 0xfffff908
961#define UMISC WORD_REF(UMISC_ADDR)
962
963#define UMISC_TX_POL 0x0004 /* Transmit Polarity */
964#define UMISC_RX_POL 0x0008 /* Receive Polarity */
965#define UMISC_IRDA_LOOP 0x0010 /* IrDA Loopback Enable */
966#define UMISC_IRDA_EN 0x0020 /* Infra-Red Enable */
967#define UMISC_RTS 0x0040 /* Set RTS status */
968#define UMISC_RTSCONT 0x0080 /* Choose RTS control */
969#define UMISC_LOOP 0x1000 /* Serial Loopback Enable */
970#define UMISC_FORCE_PERR 0x2000 /* Force Parity Error */
971#define UMISC_CLKSRC 0x4000 /* Clock Source */
972
973
974/* generalization of uart control registers to support multiple ports: */
975typedef volatile struct {
976 volatile unsigned short int ustcnt;
977 volatile unsigned short int ubaud;
978 union {
979 volatile unsigned short int w;
980 struct {
981 volatile unsigned char status;
982 volatile unsigned char rxdata;
983 } b;
984 } urx;
985 union {
986 volatile unsigned short int w;
987 struct {
988 volatile unsigned char status;
989 volatile unsigned char txdata;
990 } b;
991 } utx;
992 volatile unsigned short int umisc;
993 volatile unsigned short int pad1;
994 volatile unsigned short int pad2;
995 volatile unsigned short int pad3;
996} m68328_uart __attribute__((packed));
997
998
999/**********
1000 *
1001 * 0xFFFFFAxx -- LCD Controller
1002 *
1003 **********/
1004
1005/*
1006 * LCD Screen Starting Address Register
1007 */
1008#define LSSA_ADDR 0xfffffa00
1009#define LSSA LONG_REF(LSSA_ADDR)
1010
1011#define LSSA_SSA_MASK 0xfffffffe /* Bit 0 is reserved */
1012
1013/*
1014 * LCD Virtual Page Width Register
1015 */
1016#define LVPW_ADDR 0xfffffa05
1017#define LVPW BYTE_REF(LVPW_ADDR)
1018
1019/*
1020 * LCD Screen Width Register (not compatible with 'EZ328 !!!)
1021 */
1022#define LXMAX_ADDR 0xfffffa08
1023#define LXMAX WORD_REF(LXMAX_ADDR)
1024
1025#define LXMAX_XM_MASK 0x02ff /* Bits 0-3 are reserved */
1026
1027/*
1028 * LCD Screen Height Register
1029 */
1030#define LYMAX_ADDR 0xfffffa0a
1031#define LYMAX WORD_REF(LYMAX_ADDR)
1032
1033#define LYMAX_YM_MASK 0x02ff /* Bits 10-15 are reserved */
1034
1035/*
1036 * LCD Cursor X Position Register
1037 */
1038#define LCXP_ADDR 0xfffffa18
1039#define LCXP WORD_REF(LCXP_ADDR)
1040
1041#define LCXP_CC_MASK 0xc000 /* Cursor Control */
1042#define LCXP_CC_TRAMSPARENT 0x0000
1043#define LCXP_CC_BLACK 0x4000
1044#define LCXP_CC_REVERSED 0x8000
1045#define LCXP_CC_WHITE 0xc000
1046#define LCXP_CXP_MASK 0x02ff /* Cursor X position */
1047
1048/*
1049 * LCD Cursor Y Position Register
1050 */
1051#define LCYP_ADDR 0xfffffa1a
1052#define LCYP WORD_REF(LCYP_ADDR)
1053
1054#define LCYP_CYP_MASK 0x01ff /* Cursor Y Position */
1055
1056/*
1057 * LCD Cursor Width and Heigth Register
1058 */
1059#define LCWCH_ADDR 0xfffffa1c
1060#define LCWCH WORD_REF(LCWCH_ADDR)
1061
1062#define LCWCH_CH_MASK 0x001f /* Cursor Height */
1063#define LCWCH_CH_SHIFT 0
1064#define LCWCH_CW_MASK 0x1f00 /* Cursor Width */
1065#define LCWCH_CW_SHIFT 8
1066
1067/*
1068 * LCD Blink Control Register
1069 */
1070#define LBLKC_ADDR 0xfffffa1f
1071#define LBLKC BYTE_REF(LBLKC_ADDR)
1072
1073#define LBLKC_BD_MASK 0x7f /* Blink Divisor */
1074#define LBLKC_BD_SHIFT 0
1075#define LBLKC_BKEN 0x80 /* Blink Enabled */
1076
1077/*
1078 * LCD Panel Interface Configuration Register
1079 */
1080#define LPICF_ADDR 0xfffffa20
1081#define LPICF BYTE_REF(LPICF_ADDR)
1082
1083#define LPICF_GS_MASK 0x01 /* Gray-Scale Mode */
1084#define LPICF_GS_BW 0x00
1085#define LPICF_GS_GRAY_4 0x01
1086#define LPICF_PBSIZ_MASK 0x06 /* Panel Bus Width */
1087#define LPICF_PBSIZ_1 0x00
1088#define LPICF_PBSIZ_2 0x02
1089#define LPICF_PBSIZ_4 0x04
1090
1091/*
1092 * LCD Polarity Configuration Register
1093 */
1094#define LPOLCF_ADDR 0xfffffa21
1095#define LPOLCF BYTE_REF(LPOLCF_ADDR)
1096
1097#define LPOLCF_PIXPOL 0x01 /* Pixel Polarity */
1098#define LPOLCF_LPPOL 0x02 /* Line Pulse Polarity */
1099#define LPOLCF_FLMPOL 0x04 /* Frame Marker Polarity */
1100#define LPOLCF_LCKPOL 0x08 /* LCD Shift Lock Polarity */
1101
1102/*
1103 * LACD (LCD Alternate Crystal Direction) Rate Control Register
1104 */
1105#define LACDRC_ADDR 0xfffffa23
1106#define LACDRC BYTE_REF(LACDRC_ADDR)
1107
1108#define LACDRC_ACD_MASK 0x0f /* Alternate Crystal Direction Control */
1109#define LACDRC_ACD_SHIFT 0
1110
1111/*
1112 * LCD Pixel Clock Divider Register
1113 */
1114#define LPXCD_ADDR 0xfffffa25
1115#define LPXCD BYTE_REF(LPXCD_ADDR)
1116
1117#define LPXCD_PCD_MASK 0x3f /* Pixel Clock Divider */
1118#define LPXCD_PCD_SHIFT 0
1119
1120/*
1121 * LCD Clocking Control Register
1122 */
1123#define LCKCON_ADDR 0xfffffa27
1124#define LCKCON BYTE_REF(LCKCON_ADDR)
1125
1126#define LCKCON_PCDS 0x01 /* Pixel Clock Divider Source Select */
1127#define LCKCON_DWIDTH 0x02 /* Display Memory Width */
1128#define LCKCON_DWS_MASK 0x3c /* Display Wait-State */
1129#define LCKCON_DWS_SHIFT 2
1130#define LCKCON_DMA16 0x40 /* DMA burst length */
1131#define LCKCON_LCDON 0x80 /* Enable LCD Controller */
1132
1133/* 'EZ328-compatible definitions */
1134#define LCKCON_DW_MASK LCKCON_DWS_MASK
1135#define LCKCON_DW_SHIFT LCKCON_DWS_SHIFT
1136
1137/*
1138 * LCD Last Buffer Address Register
1139 */
1140#define LLBAR_ADDR 0xfffffa29
1141#define LLBAR BYTE_REF(LLBAR_ADDR)
1142
1143#define LLBAR_LBAR_MASK 0x7f /* Number of memory words to fill 1 line */
1144#define LLBAR_LBAR_SHIFT 0
1145
1146/*
1147 * LCD Octet Terminal Count Register
1148 */
1149#define LOTCR_ADDR 0xfffffa2b
1150#define LOTCR BYTE_REF(LOTCR_ADDR)
1151
1152/*
1153 * LCD Panning Offset Register
1154 */
1155#define LPOSR_ADDR 0xfffffa2d
1156#define LPOSR BYTE_REF(LPOSR_ADDR)
1157
1158#define LPOSR_BOS 0x08 /* Byte offset (for B/W mode only */
1159#define LPOSR_POS_MASK 0x07 /* Pixel Offset Code */
1160#define LPOSR_POS_SHIFT 0
1161
1162/*
1163 * LCD Frame Rate Control Modulation Register
1164 */
1165#define LFRCM_ADDR 0xfffffa31
1166#define LFRCM BYTE_REF(LFRCM_ADDR)
1167
1168#define LFRCM_YMOD_MASK 0x0f /* Vertical Modulation */
1169#define LFRCM_YMOD_SHIFT 0
1170#define LFRCM_XMOD_MASK 0xf0 /* Horizontal Modulation */
1171#define LFRCM_XMOD_SHIFT 4
1172
1173/*
1174 * LCD Gray Palette Mapping Register
1175 */
1176#define LGPMR_ADDR 0xfffffa32
1177#define LGPMR WORD_REF(LGPMR_ADDR)
1178
1179#define LGPMR_GLEVEL3_MASK 0x000f
1180#define LGPMR_GLEVEL3_SHIFT 0
1181#define LGPMR_GLEVEL2_MASK 0x00f0
1182#define LGPMR_GLEVEL2_SHIFT 4
1183#define LGPMR_GLEVEL0_MASK 0x0f00
1184#define LGPMR_GLEVEL0_SHIFT 8
1185#define LGPMR_GLEVEL1_MASK 0xf000
1186#define LGPMR_GLEVEL1_SHIFT 12
1187
1188/**********
1189 *
1190 * 0xFFFFFBxx -- Real-Time Clock (RTC)
1191 *
1192 **********/
1193
1194/*
1195 * RTC Hours Minutes and Seconds Register
1196 */
1197#define RTCTIME_ADDR 0xfffffb00
1198#define RTCTIME LONG_REF(RTCTIME_ADDR)
1199
1200#define RTCTIME_SECONDS_MASK 0x0000003f /* Seconds */
1201#define RTCTIME_SECONDS_SHIFT 0
1202#define RTCTIME_MINUTES_MASK 0x003f0000 /* Minutes */
1203#define RTCTIME_MINUTES_SHIFT 16
1204#define RTCTIME_HOURS_MASK 0x1f000000 /* Hours */
1205#define RTCTIME_HOURS_SHIFT 24
1206
1207/*
1208 * RTC Alarm Register
1209 */
1210#define RTCALRM_ADDR 0xfffffb04
1211#define RTCALRM LONG_REF(RTCALRM_ADDR)
1212
1213#define RTCALRM_SECONDS_MASK 0x0000003f /* Seconds */
1214#define RTCALRM_SECONDS_SHIFT 0
1215#define RTCALRM_MINUTES_MASK 0x003f0000 /* Minutes */
1216#define RTCALRM_MINUTES_SHIFT 16
1217#define RTCALRM_HOURS_MASK 0x1f000000 /* Hours */
1218#define RTCALRM_HOURS_SHIFT 24
1219
1220/*
1221 * RTC Control Register
1222 */
1223#define RTCCTL_ADDR 0xfffffb0c
1224#define RTCCTL WORD_REF(RTCCTL_ADDR)
1225
1226#define RTCCTL_384 0x0020 /* Crystal Selection */
1227#define RTCCTL_ENABLE 0x0080 /* RTC Enable */
1228
1229/* 'EZ328-compatible definitions */
1230#define RTCCTL_XTL RTCCTL_384
1231#define RTCCTL_EN RTCCTL_ENABLE
1232
1233/*
1234 * RTC Interrupt Status Register
1235 */
1236#define RTCISR_ADDR 0xfffffb0e
1237#define RTCISR WORD_REF(RTCISR_ADDR)
1238
1239#define RTCISR_SW 0x0001 /* Stopwatch timed out */
1240#define RTCISR_MIN 0x0002 /* 1-minute interrupt has occurred */
1241#define RTCISR_ALM 0x0004 /* Alarm interrupt has occurred */
1242#define RTCISR_DAY 0x0008 /* 24-hour rollover interrupt has occurred */
1243#define RTCISR_1HZ 0x0010 /* 1Hz interrupt has occurred */
1244
1245/*
1246 * RTC Interrupt Enable Register
1247 */
1248#define RTCIENR_ADDR 0xfffffb10
1249#define RTCIENR WORD_REF(RTCIENR_ADDR)
1250
1251#define RTCIENR_SW 0x0001 /* Stopwatch interrupt enable */
1252#define RTCIENR_MIN 0x0002 /* 1-minute interrupt enable */
1253#define RTCIENR_ALM 0x0004 /* Alarm interrupt enable */
1254#define RTCIENR_DAY 0x0008 /* 24-hour rollover interrupt enable */
1255#define RTCIENR_1HZ 0x0010 /* 1Hz interrupt enable */
1256
1257/*
1258 * Stopwatch Minutes Register
1259 */
1260#define STPWCH_ADDR 0xfffffb12
1261#define STPWCH WORD_REF(STPWCH)
1262
1263#define STPWCH_CNT_MASK 0x00ff /* Stopwatch countdown value */
1264#define SPTWCH_CNT_SHIFT 0
1265
1266#endif /* _MC68328_H_ */
diff --git a/include/asm-m68knommu/MC68332.h b/include/asm-m68knommu/MC68332.h
new file mode 100644
index 000000000000..6bb8f02685a2
--- /dev/null
+++ b/include/asm-m68knommu/MC68332.h
@@ -0,0 +1,152 @@
1
2/* include/asm-m68knommu/MC68332.h: '332 control registers
3 *
4 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>,
5 *
6 */
7
8#ifndef _MC68332_H_
9#define _MC68332_H_
10
11#define BYTE_REF(addr) (*((volatile unsigned char*)addr))
12#define WORD_REF(addr) (*((volatile unsigned short*)addr))
13
14#define PORTE_ADDR 0xfffa11
15#define PORTE BYTE_REF(PORTE_ADDR)
16#define DDRE_ADDR 0xfffa15
17#define DDRE BYTE_REF(DDRE_ADDR)
18#define PEPAR_ADDR 0xfffa17
19#define PEPAR BYTE_REF(PEPAR_ADDR)
20
21#define PORTF_ADDR 0xfffa19
22#define PORTF BYTE_REF(PORTF_ADDR)
23#define DDRF_ADDR 0xfffa1d
24#define DDRF BYTE_REF(DDRF_ADDR)
25#define PFPAR_ADDR 0xfffa1f
26#define PFPAR BYTE_REF(PFPAR_ADDR)
27
28#define PORTQS_ADDR 0xfffc15
29#define PORTQS BYTE_REF(PORTQS_ADDR)
30#define DDRQS_ADDR 0xfffc17
31#define DDRQS BYTE_REF(DDRQS_ADDR)
32#define PQSPAR_ADDR 0xfffc16
33#define PQSPAR BYTE_REF(PQSPAR_ADDR)
34
35#define CSPAR0_ADDR 0xFFFA44
36#define CSPAR0 WORD_REF(CSPAR0_ADDR)
37#define CSPAR1_ADDR 0xFFFA46
38#define CSPAR1 WORD_REF(CSPAR1_ADDR)
39#define CSARBT_ADDR 0xFFFA48
40#define CSARBT WORD_REF(CSARBT_ADDR)
41#define CSOPBT_ADDR 0xFFFA4A
42#define CSOPBT WORD_REF(CSOPBT_ADDR)
43#define CSBAR0_ADDR 0xFFFA4C
44#define CSBAR0 WORD_REF(CSBAR0_ADDR)
45#define CSOR0_ADDR 0xFFFA4E
46#define CSOR0 WORD_REF(CSOR0_ADDR)
47#define CSBAR1_ADDR 0xFFFA50
48#define CSBAR1 WORD_REF(CSBAR1_ADDR)
49#define CSOR1_ADDR 0xFFFA52
50#define CSOR1 WORD_REF(CSOR1_ADDR)
51#define CSBAR2_ADDR 0xFFFA54
52#define CSBAR2 WORD_REF(CSBAR2_ADDR)
53#define CSOR2_ADDR 0xFFFA56
54#define CSOR2 WORD_REF(CSOR2_ADDR)
55#define CSBAR3_ADDR 0xFFFA58
56#define CSBAR3 WORD_REF(CSBAR3_ADDR)
57#define CSOR3_ADDR 0xFFFA5A
58#define CSOR3 WORD_REF(CSOR3_ADDR)
59#define CSBAR4_ADDR 0xFFFA5C
60#define CSBAR4 WORD_REF(CSBAR4_ADDR)
61#define CSOR4_ADDR 0xFFFA5E
62#define CSOR4 WORD_REF(CSOR4_ADDR)
63#define CSBAR5_ADDR 0xFFFA60
64#define CSBAR5 WORD_REF(CSBAR5_ADDR)
65#define CSOR5_ADDR 0xFFFA62
66#define CSOR5 WORD_REF(CSOR5_ADDR)
67#define CSBAR6_ADDR 0xFFFA64
68#define CSBAR6 WORD_REF(CSBAR6_ADDR)
69#define CSOR6_ADDR 0xFFFA66
70#define CSOR6 WORD_REF(CSOR6_ADDR)
71#define CSBAR7_ADDR 0xFFFA68
72#define CSBAR7 WORD_REF(CSBAR7_ADDR)
73#define CSOR7_ADDR 0xFFFA6A
74#define CSOR7 WORD_REF(CSOR7_ADDR)
75#define CSBAR8_ADDR 0xFFFA6C
76#define CSBAR8 WORD_REF(CSBAR8_ADDR)
77#define CSOR8_ADDR 0xFFFA6E
78#define CSOR8 WORD_REF(CSOR8_ADDR)
79#define CSBAR9_ADDR 0xFFFA70
80#define CSBAR9 WORD_REF(CSBAR9_ADDR)
81#define CSOR9_ADDR 0xFFFA72
82#define CSOR9 WORD_REF(CSOR9_ADDR)
83#define CSBAR10_ADDR 0xFFFA74
84#define CSBAR10 WORD_REF(CSBAR10_ADDR)
85#define CSOR10_ADDR 0xFFFA76
86#define CSOR10 WORD_REF(CSOR10_ADDR)
87
88#define CSOR_MODE_ASYNC 0x0000
89#define CSOR_MODE_SYNC 0x8000
90#define CSOR_MODE_MASK 0x8000
91#define CSOR_BYTE_DISABLE 0x0000
92#define CSOR_BYTE_UPPER 0x4000
93#define CSOR_BYTE_LOWER 0x2000
94#define CSOR_BYTE_BOTH 0x6000
95#define CSOR_BYTE_MASK 0x6000
96#define CSOR_RW_RSVD 0x0000
97#define CSOR_RW_READ 0x0800
98#define CSOR_RW_WRITE 0x1000
99#define CSOR_RW_BOTH 0x1800
100#define CSOR_RW_MASK 0x1800
101#define CSOR_STROBE_DS 0x0400
102#define CSOR_STROBE_AS 0x0000
103#define CSOR_STROBE_MASK 0x0400
104#define CSOR_DSACK_WAIT(x) (wait << 6)
105#define CSOR_DSACK_FTERM (14 << 6)
106#define CSOR_DSACK_EXTERNAL (15 << 6)
107#define CSOR_DSACK_MASK 0x03c0
108#define CSOR_SPACE_CPU 0x0000
109#define CSOR_SPACE_USER 0x0010
110#define CSOR_SPACE_SU 0x0020
111#define CSOR_SPACE_BOTH 0x0030
112#define CSOR_SPACE_MASK 0x0030
113#define CSOR_IPL_ALL 0x0000
114#define CSOR_IPL_PRIORITY(x) (x << 1)
115#define CSOR_IPL_MASK 0x000e
116#define CSOR_AVEC_ON 0x0001
117#define CSOR_AVEC_OFF 0x0000
118#define CSOR_AVEC_MASK 0x0001
119
120#define CSBAR_ADDR(x) ((addr >> 11) << 3)
121#define CSBAR_ADDR_MASK 0xfff8
122#define CSBAR_BLKSIZE_2K 0x0000
123#define CSBAR_BLKSIZE_8K 0x0001
124#define CSBAR_BLKSIZE_16K 0x0002
125#define CSBAR_BLKSIZE_64K 0x0003
126#define CSBAR_BLKSIZE_128K 0x0004
127#define CSBAR_BLKSIZE_256K 0x0005
128#define CSBAR_BLKSIZE_512K 0x0006
129#define CSBAR_BLKSIZE_1M 0x0007
130#define CSBAR_BLKSIZE_MASK 0x0007
131
132#define CSPAR_DISC 0
133#define CSPAR_ALT 1
134#define CSPAR_CS8 2
135#define CSPAR_CS16 3
136#define CSPAR_MASK 3
137
138#define CSPAR0_CSBOOT(x) (x << 0)
139#define CSPAR0_CS0(x) (x << 2)
140#define CSPAR0_CS1(x) (x << 4)
141#define CSPAR0_CS2(x) (x << 6)
142#define CSPAR0_CS3(x) (x << 8)
143#define CSPAR0_CS4(x) (x << 10)
144#define CSPAR0_CS5(x) (x << 12)
145
146#define CSPAR1_CS6(x) (x << 0)
147#define CSPAR1_CS7(x) (x << 2)
148#define CSPAR1_CS8(x) (x << 4)
149#define CSPAR1_CS9(x) (x << 6)
150#define CSPAR1_CS10(x) (x << 8)
151
152#endif
diff --git a/include/asm-m68knommu/MC68EZ328.h b/include/asm-m68knommu/MC68EZ328.h
new file mode 100644
index 000000000000..801933da4c70
--- /dev/null
+++ b/include/asm-m68knommu/MC68EZ328.h
@@ -0,0 +1,1253 @@
1
2/* include/asm-m68knommu/MC68EZ328.h: 'EZ328 control registers
3 *
4 * Copyright (C) 1999 Vladimir Gurevich <vgurevic@cisco.com>
5 * Bear & Hare Software, Inc.
6 *
7 * Based on include/asm-m68knommu/MC68332.h
8 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>,
9 * The Silver Hammer Group, Ltd.
10 *
11 */
12
13#ifndef _MC68EZ328_H_
14#define _MC68EZ328_H_
15
16#define BYTE_REF(addr) (*((volatile unsigned char*)addr))
17#define WORD_REF(addr) (*((volatile unsigned short*)addr))
18#define LONG_REF(addr) (*((volatile unsigned long*)addr))
19
20#define PUT_FIELD(field, val) (((val) << field##_SHIFT) & field##_MASK)
21#define GET_FIELD(reg, field) (((reg) & field##_MASK) >> field##_SHIFT)
22
23/**********
24 *
25 * 0xFFFFF0xx -- System Control
26 *
27 **********/
28
29/*
30 * System Control Register (SCR)
31 */
32#define SCR_ADDR 0xfffff000
33#define SCR BYTE_REF(SCR_ADDR)
34
35#define SCR_WDTH8 0x01 /* 8-Bit Width Select */
36#define SCR_DMAP 0x04 /* Double Map */
37#define SCR_SO 0x08 /* Supervisor Only */
38#define SCR_BETEN 0x10 /* Bus-Error Time-Out Enable */
39#define SCR_PRV 0x20 /* Privilege Violation */
40#define SCR_WPV 0x40 /* Write Protect Violation */
41#define SCR_BETO 0x80 /* Bus-Error TimeOut */
42
43/*
44 * Silicon ID Register (Mask Revision Register (MRR) for '328 Compatibility)
45 */
46#define MRR_ADDR 0xfffff004
47#define MRR LONG_REF(MRR_ADDR)
48
49/**********
50 *
51 * 0xFFFFF1xx -- Chip-Select logic
52 *
53 **********/
54
55/*
56 * Chip Select Group Base Registers
57 */
58#define CSGBA_ADDR 0xfffff100
59#define CSGBB_ADDR 0xfffff102
60
61#define CSGBC_ADDR 0xfffff104
62#define CSGBD_ADDR 0xfffff106
63
64#define CSGBA WORD_REF(CSGBA_ADDR)
65#define CSGBB WORD_REF(CSGBB_ADDR)
66#define CSGBC WORD_REF(CSGBC_ADDR)
67#define CSGBD WORD_REF(CSGBD_ADDR)
68
69/*
70 * Chip Select Registers
71 */
72#define CSA_ADDR 0xfffff110
73#define CSB_ADDR 0xfffff112
74#define CSC_ADDR 0xfffff114
75#define CSD_ADDR 0xfffff116
76
77#define CSA WORD_REF(CSA_ADDR)
78#define CSB WORD_REF(CSB_ADDR)
79#define CSC WORD_REF(CSC_ADDR)
80#define CSD WORD_REF(CSD_ADDR)
81
82#define CSA_EN 0x0001 /* Chip-Select Enable */
83#define CSA_SIZ_MASK 0x000e /* Chip-Select Size */
84#define CSA_SIZ_SHIFT 1
85#define CSA_WS_MASK 0x0070 /* Wait State */
86#define CSA_WS_SHIFT 4
87#define CSA_BSW 0x0080 /* Data Bus Width */
88#define CSA_FLASH 0x0100 /* FLASH Memory Support */
89#define CSA_RO 0x8000 /* Read-Only */
90
91#define CSB_EN 0x0001 /* Chip-Select Enable */
92#define CSB_SIZ_MASK 0x000e /* Chip-Select Size */
93#define CSB_SIZ_SHIFT 1
94#define CSB_WS_MASK 0x0070 /* Wait State */
95#define CSB_WS_SHIFT 4
96#define CSB_BSW 0x0080 /* Data Bus Width */
97#define CSB_FLASH 0x0100 /* FLASH Memory Support */
98#define CSB_UPSIZ_MASK 0x1800 /* Unprotected memory block size */
99#define CSB_UPSIZ_SHIFT 11
100#define CSB_ROP 0x2000 /* Readonly if protected */
101#define CSB_SOP 0x4000 /* Supervisor only if protected */
102#define CSB_RO 0x8000 /* Read-Only */
103
104#define CSC_EN 0x0001 /* Chip-Select Enable */
105#define CSC_SIZ_MASK 0x000e /* Chip-Select Size */
106#define CSC_SIZ_SHIFT 1
107#define CSC_WS_MASK 0x0070 /* Wait State */
108#define CSC_WS_SHIFT 4
109#define CSC_BSW 0x0080 /* Data Bus Width */
110#define CSC_FLASH 0x0100 /* FLASH Memory Support */
111#define CSC_UPSIZ_MASK 0x1800 /* Unprotected memory block size */
112#define CSC_UPSIZ_SHIFT 11
113#define CSC_ROP 0x2000 /* Readonly if protected */
114#define CSC_SOP 0x4000 /* Supervisor only if protected */
115#define CSC_RO 0x8000 /* Read-Only */
116
117#define CSD_EN 0x0001 /* Chip-Select Enable */
118#define CSD_SIZ_MASK 0x000e /* Chip-Select Size */
119#define CSD_SIZ_SHIFT 1
120#define CSD_WS_MASK 0x0070 /* Wait State */
121#define CSD_WS_SHIFT 4
122#define CSD_BSW 0x0080 /* Data Bus Width */
123#define CSD_FLASH 0x0100 /* FLASH Memory Support */
124#define CSD_DRAM 0x0200 /* Dram Selection */
125#define CSD_COMB 0x0400 /* Combining */
126#define CSD_UPSIZ_MASK 0x1800 /* Unprotected memory block size */
127#define CSD_UPSIZ_SHIFT 11
128#define CSD_ROP 0x2000 /* Readonly if protected */
129#define CSD_SOP 0x4000 /* Supervisor only if protected */
130#define CSD_RO 0x8000 /* Read-Only */
131
132/*
133 * Emulation Chip-Select Register
134 */
135#define EMUCS_ADDR 0xfffff118
136#define EMUCS WORD_REF(EMUCS_ADDR)
137
138#define EMUCS_WS_MASK 0x0070
139#define EMUCS_WS_SHIFT 4
140
141/**********
142 *
143 * 0xFFFFF2xx -- Phase Locked Loop (PLL) & Power Control
144 *
145 **********/
146
147/*
148 * PLL Control Register
149 */
150#define PLLCR_ADDR 0xfffff200
151#define PLLCR WORD_REF(PLLCR_ADDR)
152
153#define PLLCR_DISPLL 0x0008 /* Disable PLL */
154#define PLLCR_CLKEN 0x0010 /* Clock (CLKO pin) enable */
155#define PLLCR_PRESC 0x0020 /* VCO prescaler */
156#define PLLCR_SYSCLK_SEL_MASK 0x0700 /* System Clock Selection */
157#define PLLCR_SYSCLK_SEL_SHIFT 8
158#define PLLCR_LCDCLK_SEL_MASK 0x3800 /* LCD Clock Selection */
159#define PLLCR_LCDCLK_SEL_SHIFT 11
160
161/* '328-compatible definitions */
162#define PLLCR_PIXCLK_SEL_MASK PLLCR_LCDCLK_SEL_MASK
163#define PLLCR_PIXCLK_SEL_SHIFT PLLCR_LCDCLK_SEL_SHIFT
164
165/*
166 * PLL Frequency Select Register
167 */
168#define PLLFSR_ADDR 0xfffff202
169#define PLLFSR WORD_REF(PLLFSR_ADDR)
170
171#define PLLFSR_PC_MASK 0x00ff /* P Count */
172#define PLLFSR_PC_SHIFT 0
173#define PLLFSR_QC_MASK 0x0f00 /* Q Count */
174#define PLLFSR_QC_SHIFT 8
175#define PLLFSR_PROT 0x4000 /* Protect P & Q */
176#define PLLFSR_CLK32 0x8000 /* Clock 32 (kHz) */
177
178/*
179 * Power Control Register
180 */
181#define PCTRL_ADDR 0xfffff207
182#define PCTRL BYTE_REF(PCTRL_ADDR)
183
184#define PCTRL_WIDTH_MASK 0x1f /* CPU Clock bursts width */
185#define PCTRL_WIDTH_SHIFT 0
186#define PCTRL_PCEN 0x80 /* Power Control Enable */
187
188/**********
189 *
190 * 0xFFFFF3xx -- Interrupt Controller
191 *
192 **********/
193
194/*
195 * Interrupt Vector Register
196 */
197#define IVR_ADDR 0xfffff300
198#define IVR BYTE_REF(IVR_ADDR)
199
200#define IVR_VECTOR_MASK 0xF8
201
202/*
203 * Interrupt control Register
204 */
205#define ICR_ADDR 0xfffff302
206#define ICR WORD_REF(ICR_ADDR)
207
208#define ICR_POL5 0x0080 /* Polarity Control for IRQ5 */
209#define ICR_ET6 0x0100 /* Edge Trigger Select for IRQ6 */
210#define ICR_ET3 0x0200 /* Edge Trigger Select for IRQ3 */
211#define ICR_ET2 0x0400 /* Edge Trigger Select for IRQ2 */
212#define ICR_ET1 0x0800 /* Edge Trigger Select for IRQ1 */
213#define ICR_POL6 0x1000 /* Polarity Control for IRQ6 */
214#define ICR_POL3 0x2000 /* Polarity Control for IRQ3 */
215#define ICR_POL2 0x4000 /* Polarity Control for IRQ2 */
216#define ICR_POL1 0x8000 /* Polarity Control for IRQ1 */
217
218/*
219 * Interrupt Mask Register
220 */
221#define IMR_ADDR 0xfffff304
222#define IMR LONG_REF(IMR_ADDR)
223
224/*
225 * Define the names for bit positions first. This is useful for
226 * request_irq
227 */
228#define SPI_IRQ_NUM 0 /* SPI interrupt */
229#define TMR_IRQ_NUM 1 /* Timer interrupt */
230#define UART_IRQ_NUM 2 /* UART interrupt */
231#define WDT_IRQ_NUM 3 /* Watchdog Timer interrupt */
232#define RTC_IRQ_NUM 4 /* RTC interrupt */
233#define KB_IRQ_NUM 6 /* Keyboard Interrupt */
234#define PWM_IRQ_NUM 7 /* Pulse-Width Modulator int. */
235#define INT0_IRQ_NUM 8 /* External INT0 */
236#define INT1_IRQ_NUM 9 /* External INT1 */
237#define INT2_IRQ_NUM 10 /* External INT2 */
238#define INT3_IRQ_NUM 11 /* External INT3 */
239#define IRQ1_IRQ_NUM 16 /* IRQ1 */
240#define IRQ2_IRQ_NUM 17 /* IRQ2 */
241#define IRQ3_IRQ_NUM 18 /* IRQ3 */
242#define IRQ6_IRQ_NUM 19 /* IRQ6 */
243#define IRQ5_IRQ_NUM 20 /* IRQ5 */
244#define SAM_IRQ_NUM 22 /* Sampling Timer for RTC */
245#define EMIQ_IRQ_NUM 23 /* Emulator Interrupt */
246
247/* '328-compatible definitions */
248#define SPIM_IRQ_NUM SPI_IRQ_NUM
249#define TMR1_IRQ_NUM TMR_IRQ_NUM
250
251/*
252 * Here go the bitmasks themselves
253 */
254#define IMR_MSPI (1 << SPI_IRQ_NUM) /* Mask SPI interrupt */
255#define IMR_MTMR (1 << TMR_IRQ_NUM) /* Mask Timer interrupt */
256#define IMR_MUART (1 << UART_IRQ_NUM) /* Mask UART interrupt */
257#define IMR_MWDT (1 << WDT_IRQ_NUM) /* Mask Watchdog Timer interrupt */
258#define IMR_MRTC (1 << RTC_IRQ_NUM) /* Mask RTC interrupt */
259#define IMR_MKB (1 << KB_IRQ_NUM) /* Mask Keyboard Interrupt */
260#define IMR_MPWM (1 << PWM_IRQ_NUM) /* Mask Pulse-Width Modulator int. */
261#define IMR_MINT0 (1 << INT0_IRQ_NUM) /* Mask External INT0 */
262#define IMR_MINT1 (1 << INT1_IRQ_NUM) /* Mask External INT1 */
263#define IMR_MINT2 (1 << INT2_IRQ_NUM) /* Mask External INT2 */
264#define IMR_MINT3 (1 << INT3_IRQ_NUM) /* Mask External INT3 */
265#define IMR_MIRQ1 (1 << IRQ1_IRQ_NUM) /* Mask IRQ1 */
266#define IMR_MIRQ2 (1 << IRQ2_IRQ_NUM) /* Mask IRQ2 */
267#define IMR_MIRQ3 (1 << IRQ3_IRQ_NUM) /* Mask IRQ3 */
268#define IMR_MIRQ6 (1 << IRQ6_IRQ_NUM) /* Mask IRQ6 */
269#define IMR_MIRQ5 (1 << IRQ5_IRQ_NUM) /* Mask IRQ5 */
270#define IMR_MSAM (1 << SAM_IRQ_NUM) /* Mask Sampling Timer for RTC */
271#define IMR_MEMIQ (1 << EMIQ_IRQ_NUM) /* Mask Emulator Interrupt */
272
273/* '328-compatible definitions */
274#define IMR_MSPIM IMR_MSPI
275#define IMR_MTMR1 IMR_MTMR
276
277/*
278 * Interrupt Status Register
279 */
280#define ISR_ADDR 0xfffff30c
281#define ISR LONG_REF(ISR_ADDR)
282
283#define ISR_SPI (1 << SPI_IRQ_NUM) /* SPI interrupt */
284#define ISR_TMR (1 << TMR_IRQ_NUM) /* Timer interrupt */
285#define ISR_UART (1 << UART_IRQ_NUM) /* UART interrupt */
286#define ISR_WDT (1 << WDT_IRQ_NUM) /* Watchdog Timer interrupt */
287#define ISR_RTC (1 << RTC_IRQ_NUM) /* RTC interrupt */
288#define ISR_KB (1 << KB_IRQ_NUM) /* Keyboard Interrupt */
289#define ISR_PWM (1 << PWM_IRQ_NUM) /* Pulse-Width Modulator interrupt */
290#define ISR_INT0 (1 << INT0_IRQ_NUM) /* External INT0 */
291#define ISR_INT1 (1 << INT1_IRQ_NUM) /* External INT1 */
292#define ISR_INT2 (1 << INT2_IRQ_NUM) /* External INT2 */
293#define ISR_INT3 (1 << INT3_IRQ_NUM) /* External INT3 */
294#define ISR_IRQ1 (1 << IRQ1_IRQ_NUM) /* IRQ1 */
295#define ISR_IRQ2 (1 << IRQ2_IRQ_NUM) /* IRQ2 */
296#define ISR_IRQ3 (1 << IRQ3_IRQ_NUM) /* IRQ3 */
297#define ISR_IRQ6 (1 << IRQ6_IRQ_NUM) /* IRQ6 */
298#define ISR_IRQ5 (1 << IRQ5_IRQ_NUM) /* IRQ5 */
299#define ISR_SAM (1 << SAM_IRQ_NUM) /* Sampling Timer for RTC */
300#define ISR_EMIQ (1 << EMIQ_IRQ_NUM) /* Emulator Interrupt */
301
302/* '328-compatible definitions */
303#define ISR_SPIM ISR_SPI
304#define ISR_TMR1 ISR_TMR
305
306/*
307 * Interrupt Pending Register
308 */
309#define IPR_ADDR 0xfffff30c
310#define IPR LONG_REF(IPR_ADDR)
311
312#define IPR_SPI (1 << SPI_IRQ_NUM) /* SPI interrupt */
313#define IPR_TMR (1 << TMR_IRQ_NUM) /* Timer interrupt */
314#define IPR_UART (1 << UART_IRQ_NUM) /* UART interrupt */
315#define IPR_WDT (1 << WDT_IRQ_NUM) /* Watchdog Timer interrupt */
316#define IPR_RTC (1 << RTC_IRQ_NUM) /* RTC interrupt */
317#define IPR_KB (1 << KB_IRQ_NUM) /* Keyboard Interrupt */
318#define IPR_PWM (1 << PWM_IRQ_NUM) /* Pulse-Width Modulator interrupt */
319#define IPR_INT0 (1 << INT0_IRQ_NUM) /* External INT0 */
320#define IPR_INT1 (1 << INT1_IRQ_NUM) /* External INT1 */
321#define IPR_INT2 (1 << INT2_IRQ_NUM) /* External INT2 */
322#define IPR_INT3 (1 << INT3_IRQ_NUM) /* External INT3 */
323#define IPR_IRQ1 (1 << IRQ1_IRQ_NUM) /* IRQ1 */
324#define IPR_IRQ2 (1 << IRQ2_IRQ_NUM) /* IRQ2 */
325#define IPR_IRQ3 (1 << IRQ3_IRQ_NUM) /* IRQ3 */
326#define IPR_IRQ6 (1 << IRQ6_IRQ_NUM) /* IRQ6 */
327#define IPR_IRQ5 (1 << IRQ5_IRQ_NUM) /* IRQ5 */
328#define IPR_SAM (1 << SAM_IRQ_NUM) /* Sampling Timer for RTC */
329#define IPR_EMIQ (1 << EMIQ_IRQ_NUM) /* Emulator Interrupt */
330
331/* '328-compatible definitions */
332#define IPR_SPIM IPR_SPI
333#define IPR_TMR1 IPR_TMR
334
335/**********
336 *
337 * 0xFFFFF4xx -- Parallel Ports
338 *
339 **********/
340
341/*
342 * Port A
343 */
344#define PADIR_ADDR 0xfffff400 /* Port A direction reg */
345#define PADATA_ADDR 0xfffff401 /* Port A data register */
346#define PAPUEN_ADDR 0xfffff402 /* Port A Pull-Up enable reg */
347
348#define PADIR BYTE_REF(PADIR_ADDR)
349#define PADATA BYTE_REF(PADATA_ADDR)
350#define PAPUEN BYTE_REF(PAPUEN_ADDR)
351
352#define PA(x) (1 << (x))
353
354/*
355 * Port B
356 */
357#define PBDIR_ADDR 0xfffff408 /* Port B direction reg */
358#define PBDATA_ADDR 0xfffff409 /* Port B data register */
359#define PBPUEN_ADDR 0xfffff40a /* Port B Pull-Up enable reg */
360#define PBSEL_ADDR 0xfffff40b /* Port B Select Register */
361
362#define PBDIR BYTE_REF(PBDIR_ADDR)
363#define PBDATA BYTE_REF(PBDATA_ADDR)
364#define PBPUEN BYTE_REF(PBPUEN_ADDR)
365#define PBSEL BYTE_REF(PBSEL_ADDR)
366
367#define PB(x) (1 << (x))
368
369#define PB_CSB0 0x01 /* Use CSB0 as PB[0] */
370#define PB_CSB1 0x02 /* Use CSB1 as PB[1] */
371#define PB_CSC0_RAS0 0x04 /* Use CSC0/RAS0 as PB[2] */
372#define PB_CSC1_RAS1 0x08 /* Use CSC1/RAS1 as PB[3] */
373#define PB_CSD0_CAS0 0x10 /* Use CSD0/CAS0 as PB[4] */
374#define PB_CSD1_CAS1 0x20 /* Use CSD1/CAS1 as PB[5] */
375#define PB_TIN_TOUT 0x40 /* Use TIN/TOUT as PB[6] */
376#define PB_PWMO 0x80 /* Use PWMO as PB[7] */
377
378/*
379 * Port C
380 */
381#define PCDIR_ADDR 0xfffff410 /* Port C direction reg */
382#define PCDATA_ADDR 0xfffff411 /* Port C data register */
383#define PCPDEN_ADDR 0xfffff412 /* Port C Pull-Down enb. reg */
384#define PCSEL_ADDR 0xfffff413 /* Port C Select Register */
385
386#define PCDIR BYTE_REF(PCDIR_ADDR)
387#define PCDATA BYTE_REF(PCDATA_ADDR)
388#define PCPDEN BYTE_REF(PCPDEN_ADDR)
389#define PCSEL BYTE_REF(PCSEL_ADDR)
390
391#define PC(x) (1 << (x))
392
393#define PC_LD0 0x01 /* Use LD0 as PC[0] */
394#define PC_LD1 0x02 /* Use LD1 as PC[1] */
395#define PC_LD2 0x04 /* Use LD2 as PC[2] */
396#define PC_LD3 0x08 /* Use LD3 as PC[3] */
397#define PC_LFLM 0x10 /* Use LFLM as PC[4] */
398#define PC_LLP 0x20 /* Use LLP as PC[5] */
399#define PC_LCLK 0x40 /* Use LCLK as PC[6] */
400#define PC_LACD 0x80 /* Use LACD as PC[7] */
401
402/*
403 * Port D
404 */
405#define PDDIR_ADDR 0xfffff418 /* Port D direction reg */
406#define PDDATA_ADDR 0xfffff419 /* Port D data register */
407#define PDPUEN_ADDR 0xfffff41a /* Port D Pull-Up enable reg */
408#define PDSEL_ADDR 0xfffff41b /* Port D Select Register */
409#define PDPOL_ADDR 0xfffff41c /* Port D Polarity Register */
410#define PDIRQEN_ADDR 0xfffff41d /* Port D IRQ enable register */
411#define PDKBEN_ADDR 0xfffff41e /* Port D Keyboard Enable reg */
412#define PDIQEG_ADDR 0xfffff41f /* Port D IRQ Edge Register */
413
414#define PDDIR BYTE_REF(PDDIR_ADDR)
415#define PDDATA BYTE_REF(PDDATA_ADDR)
416#define PDPUEN BYTE_REF(PDPUEN_ADDR)
417#define PDSEL BYTE_REF(PDSEL_ADDR)
418#define PDPOL BYTE_REF(PDPOL_ADDR)
419#define PDIRQEN BYTE_REF(PDIRQEN_ADDR)
420#define PDKBEN BYTE_REF(PDKBEN_ADDR)
421#define PDIQEG BYTE_REF(PDIQEG_ADDR)
422
423#define PD(x) (1 << (x))
424
425#define PD_INT0 0x01 /* Use INT0 as PD[0] */
426#define PD_INT1 0x02 /* Use INT1 as PD[1] */
427#define PD_INT2 0x04 /* Use INT2 as PD[2] */
428#define PD_INT3 0x08 /* Use INT3 as PD[3] */
429#define PD_IRQ1 0x10 /* Use IRQ1 as PD[4] */
430#define PD_IRQ2 0x20 /* Use IRQ2 as PD[5] */
431#define PD_IRQ3 0x40 /* Use IRQ3 as PD[6] */
432#define PD_IRQ6 0x80 /* Use IRQ6 as PD[7] */
433
434/*
435 * Port E
436 */
437#define PEDIR_ADDR 0xfffff420 /* Port E direction reg */
438#define PEDATA_ADDR 0xfffff421 /* Port E data register */
439#define PEPUEN_ADDR 0xfffff422 /* Port E Pull-Up enable reg */
440#define PESEL_ADDR 0xfffff423 /* Port E Select Register */
441
442#define PEDIR BYTE_REF(PEDIR_ADDR)
443#define PEDATA BYTE_REF(PEDATA_ADDR)
444#define PEPUEN BYTE_REF(PEPUEN_ADDR)
445#define PESEL BYTE_REF(PESEL_ADDR)
446
447#define PE(x) (1 << (x))
448
449#define PE_SPMTXD 0x01 /* Use SPMTXD as PE[0] */
450#define PE_SPMRXD 0x02 /* Use SPMRXD as PE[1] */
451#define PE_SPMCLK 0x04 /* Use SPMCLK as PE[2] */
452#define PE_DWE 0x08 /* Use DWE as PE[3] */
453#define PE_RXD 0x10 /* Use RXD as PE[4] */
454#define PE_TXD 0x20 /* Use TXD as PE[5] */
455#define PE_RTS 0x40 /* Use RTS as PE[6] */
456#define PE_CTS 0x80 /* Use CTS as PE[7] */
457
458/*
459 * Port F
460 */
461#define PFDIR_ADDR 0xfffff428 /* Port F direction reg */
462#define PFDATA_ADDR 0xfffff429 /* Port F data register */
463#define PFPUEN_ADDR 0xfffff42a /* Port F Pull-Up enable reg */
464#define PFSEL_ADDR 0xfffff42b /* Port F Select Register */
465
466#define PFDIR BYTE_REF(PFDIR_ADDR)
467#define PFDATA BYTE_REF(PFDATA_ADDR)
468#define PFPUEN BYTE_REF(PFPUEN_ADDR)
469#define PFSEL BYTE_REF(PFSEL_ADDR)
470
471#define PF(x) (1 << (x))
472
473#define PF_LCONTRAST 0x01 /* Use LCONTRAST as PF[0] */
474#define PF_IRQ5 0x02 /* Use IRQ5 as PF[1] */
475#define PF_CLKO 0x04 /* Use CLKO as PF[2] */
476#define PF_A20 0x08 /* Use A20 as PF[3] */
477#define PF_A21 0x10 /* Use A21 as PF[4] */
478#define PF_A22 0x20 /* Use A22 as PF[5] */
479#define PF_A23 0x40 /* Use A23 as PF[6] */
480#define PF_CSA1 0x80 /* Use CSA1 as PF[7] */
481
482/*
483 * Port G
484 */
485#define PGDIR_ADDR 0xfffff430 /* Port G direction reg */
486#define PGDATA_ADDR 0xfffff431 /* Port G data register */
487#define PGPUEN_ADDR 0xfffff432 /* Port G Pull-Up enable reg */
488#define PGSEL_ADDR 0xfffff433 /* Port G Select Register */
489
490#define PGDIR BYTE_REF(PGDIR_ADDR)
491#define PGDATA BYTE_REF(PGDATA_ADDR)
492#define PGPUEN BYTE_REF(PGPUEN_ADDR)
493#define PGSEL BYTE_REF(PGSEL_ADDR)
494
495#define PG(x) (1 << (x))
496
497#define PG_BUSW_DTACK 0x01 /* Use BUSW/DTACK as PG[0] */
498#define PG_A0 0x02 /* Use A0 as PG[1] */
499#define PG_EMUIRQ 0x04 /* Use EMUIRQ as PG[2] */
500#define PG_HIZ_P_D 0x08 /* Use HIZ/P/D as PG[3] */
501#define PG_EMUCS 0x10 /* Use EMUCS as PG[4] */
502#define PG_EMUBRK 0x20 /* Use EMUBRK as PG[5] */
503
504/**********
505 *
506 * 0xFFFFF5xx -- Pulse-Width Modulator (PWM)
507 *
508 **********/
509
510/*
511 * PWM Control Register
512 */
513#define PWMC_ADDR 0xfffff500
514#define PWMC WORD_REF(PWMC_ADDR)
515
516#define PWMC_CLKSEL_MASK 0x0003 /* Clock Selection */
517#define PWMC_CLKSEL_SHIFT 0
518#define PWMC_REPEAT_MASK 0x000c /* Sample Repeats */
519#define PWMC_REPEAT_SHIFT 2
520#define PWMC_EN 0x0010 /* Enable PWM */
521#define PMNC_FIFOAV 0x0020 /* FIFO Available */
522#define PWMC_IRQEN 0x0040 /* Interrupt Request Enable */
523#define PWMC_IRQ 0x0080 /* Interrupt Request (FIFO empty) */
524#define PWMC_PRESCALER_MASK 0x7f00 /* Incoming Clock prescaler */
525#define PWMC_PRESCALER_SHIFT 8
526#define PWMC_CLKSRC 0x8000 /* Clock Source Select */
527
528/* '328-compatible definitions */
529#define PWMC_PWMEN PWMC_EN
530
531/*
532 * PWM Sample Register
533 */
534#define PWMS_ADDR 0xfffff502
535#define PWMS WORD_REF(PWMS_ADDR)
536
537/*
538 * PWM Period Register
539 */
540#define PWMP_ADDR 0xfffff504
541#define PWMP BYTE_REF(PWMP_ADDR)
542
543/*
544 * PWM Counter Register
545 */
546#define PWMCNT_ADDR 0xfffff505
547#define PWMCNT BYTE_REF(PWMCNT_ADDR)
548
549/**********
550 *
551 * 0xFFFFF6xx -- General-Purpose Timer
552 *
553 **********/
554
555/*
556 * Timer Control register
557 */
558#define TCTL_ADDR 0xfffff600
559#define TCTL WORD_REF(TCTL_ADDR)
560
561#define TCTL_TEN 0x0001 /* Timer Enable */
562#define TCTL_CLKSOURCE_MASK 0x000e /* Clock Source: */
563#define TCTL_CLKSOURCE_STOP 0x0000 /* Stop count (disabled) */
564#define TCTL_CLKSOURCE_SYSCLK 0x0002 /* SYSCLK to prescaler */
565#define TCTL_CLKSOURCE_SYSCLK_16 0x0004 /* SYSCLK/16 to prescaler */
566#define TCTL_CLKSOURCE_TIN 0x0006 /* TIN to prescaler */
567#define TCTL_CLKSOURCE_32KHZ 0x0008 /* 32kHz clock to prescaler */
568#define TCTL_IRQEN 0x0010 /* IRQ Enable */
569#define TCTL_OM 0x0020 /* Output Mode */
570#define TCTL_CAP_MASK 0x00c0 /* Capture Edge: */
571#define TCTL_CAP_RE 0x0040 /* Capture on rizing edge */
572#define TCTL_CAP_FE 0x0080 /* Capture on falling edge */
573#define TCTL_FRR 0x0010 /* Free-Run Mode */
574
575/* '328-compatible definitions */
576#define TCTL1_ADDR TCTL_ADDR
577#define TCTL1 TCTL
578
579/*
580 * Timer Prescaler Register
581 */
582#define TPRER_ADDR 0xfffff602
583#define TPRER WORD_REF(TPRER_ADDR)
584
585/* '328-compatible definitions */
586#define TPRER1_ADDR TPRER_ADDR
587#define TPRER1 TPRER
588
589/*
590 * Timer Compare Register
591 */
592#define TCMP_ADDR 0xfffff604
593#define TCMP WORD_REF(TCMP_ADDR)
594
595/* '328-compatible definitions */
596#define TCMP1_ADDR TCMP_ADDR
597#define TCMP1 TCMP
598
599/*
600 * Timer Capture register
601 */
602#define TCR_ADDR 0xfffff606
603#define TCR WORD_REF(TCR_ADDR)
604
605/* '328-compatible definitions */
606#define TCR1_ADDR TCR_ADDR
607#define TCR1 TCR
608
609/*
610 * Timer Counter Register
611 */
612#define TCN_ADDR 0xfffff608
613#define TCN WORD_REF(TCN_ADDR)
614
615/* '328-compatible definitions */
616#define TCN1_ADDR TCN_ADDR
617#define TCN1 TCN
618
619/*
620 * Timer Status Register
621 */
622#define TSTAT_ADDR 0xfffff60a
623#define TSTAT WORD_REF(TSTAT_ADDR)
624
625#define TSTAT_COMP 0x0001 /* Compare Event occurred */
626#define TSTAT_CAPT 0x0001 /* Capture Event occurred */
627
628/* '328-compatible definitions */
629#define TSTAT1_ADDR TSTAT_ADDR
630#define TSTAT1 TSTAT
631
632/**********
633 *
634 * 0xFFFFF8xx -- Serial Periferial Interface Master (SPIM)
635 *
636 **********/
637
638/*
639 * SPIM Data Register
640 */
641#define SPIMDATA_ADDR 0xfffff800
642#define SPIMDATA WORD_REF(SPIMDATA_ADDR)
643
644/*
645 * SPIM Control/Status Register
646 */
647#define SPIMCONT_ADDR 0xfffff802
648#define SPIMCONT WORD_REF(SPIMCONT_ADDR)
649
650#define SPIMCONT_BIT_COUNT_MASK 0x000f /* Transfer Length in Bytes */
651#define SPIMCONT_BIT_COUNT_SHIFT 0
652#define SPIMCONT_POL 0x0010 /* SPMCLK Signel Polarity */
653#define SPIMCONT_PHA 0x0020 /* Clock/Data phase relationship */
654#define SPIMCONT_IRQEN 0x0040 /* IRQ Enable */
655#define SPIMCONT_IRQ 0x0080 /* Interrupt Request */
656#define SPIMCONT_XCH 0x0100 /* Exchange */
657#define SPIMCONT_ENABLE 0x0200 /* Enable SPIM */
658#define SPIMCONT_DATA_RATE_MASK 0xe000 /* SPIM Data Rate */
659#define SPIMCONT_DATA_RATE_SHIFT 13
660
661/* '328-compatible definitions */
662#define SPIMCONT_SPIMIRQ SPIMCONT_IRQ
663#define SPIMCONT_SPIMEN SPIMCONT_ENABLE
664
665/**********
666 *
667 * 0xFFFFF9xx -- UART
668 *
669 **********/
670
671/*
672 * UART Status/Control Register
673 */
674#define USTCNT_ADDR 0xfffff900
675#define USTCNT WORD_REF(USTCNT_ADDR)
676
677#define USTCNT_TXAE 0x0001 /* Transmitter Available Interrupt Enable */
678#define USTCNT_TXHE 0x0002 /* Transmitter Half Empty Enable */
679#define USTCNT_TXEE 0x0004 /* Transmitter Empty Interrupt Enable */
680#define USTCNT_RXRE 0x0008 /* Receiver Ready Interrupt Enable */
681#define USTCNT_RXHE 0x0010 /* Receiver Half-Full Interrupt Enable */
682#define USTCNT_RXFE 0x0020 /* Receiver Full Interrupt Enable */
683#define USTCNT_CTSD 0x0040 /* CTS Delta Interrupt Enable */
684#define USTCNT_ODEN 0x0080 /* Old Data Interrupt Enable */
685#define USTCNT_8_7 0x0100 /* Eight or seven-bit transmission */
686#define USTCNT_STOP 0x0200 /* Stop bit transmission */
687#define USTCNT_ODD 0x0400 /* Odd Parity */
688#define USTCNT_PEN 0x0800 /* Parity Enable */
689#define USTCNT_CLKM 0x1000 /* Clock Mode Select */
690#define USTCNT_TXEN 0x2000 /* Transmitter Enable */
691#define USTCNT_RXEN 0x4000 /* Receiver Enable */
692#define USTCNT_UEN 0x8000 /* UART Enable */
693
694/* '328-compatible definitions */
695#define USTCNT_TXAVAILEN USTCNT_TXAE
696#define USTCNT_TXHALFEN USTCNT_TXHE
697#define USTCNT_TXEMPTYEN USTCNT_TXEE
698#define USTCNT_RXREADYEN USTCNT_RXRE
699#define USTCNT_RXHALFEN USTCNT_RXHE
700#define USTCNT_RXFULLEN USTCNT_RXFE
701#define USTCNT_CTSDELTAEN USTCNT_CTSD
702#define USTCNT_ODD_EVEN USTCNT_ODD
703#define USTCNT_PARITYEN USTCNT_PEN
704#define USTCNT_CLKMODE USTCNT_CLKM
705#define USTCNT_UARTEN USTCNT_UEN
706
707/*
708 * UART Baud Control Register
709 */
710#define UBAUD_ADDR 0xfffff902
711#define UBAUD WORD_REF(UBAUD_ADDR)
712
713#define UBAUD_PRESCALER_MASK 0x003f /* Actual divisor is 65 - PRESCALER */
714#define UBAUD_PRESCALER_SHIFT 0
715#define UBAUD_DIVIDE_MASK 0x0700 /* Baud Rate freq. divizor */
716#define UBAUD_DIVIDE_SHIFT 8
717#define UBAUD_BAUD_SRC 0x0800 /* Baud Rate Source */
718#define UBAUD_UCLKDIR 0x2000 /* UCLK Direction */
719
720/*
721 * UART Receiver Register
722 */
723#define URX_ADDR 0xfffff904
724#define URX WORD_REF(URX_ADDR)
725
726#define URX_RXDATA_ADDR 0xfffff905
727#define URX_RXDATA BYTE_REF(URX_RXDATA_ADDR)
728
729#define URX_RXDATA_MASK 0x00ff /* Received data */
730#define URX_RXDATA_SHIFT 0
731#define URX_PARITY_ERROR 0x0100 /* Parity Error */
732#define URX_BREAK 0x0200 /* Break Detected */
733#define URX_FRAME_ERROR 0x0400 /* Framing Error */
734#define URX_OVRUN 0x0800 /* Serial Overrun */
735#define URX_OLD_DATA 0x1000 /* Old data in FIFO */
736#define URX_DATA_READY 0x2000 /* Data Ready (FIFO not empty) */
737#define URX_FIFO_HALF 0x4000 /* FIFO is Half-Full */
738#define URX_FIFO_FULL 0x8000 /* FIFO is Full */
739
740/*
741 * UART Transmitter Register
742 */
743#define UTX_ADDR 0xfffff906
744#define UTX WORD_REF(UTX_ADDR)
745
746#define UTX_TXDATA_ADDR 0xfffff907
747#define UTX_TXDATA BYTE_REF(UTX_TXDATA_ADDR)
748
749#define UTX_TXDATA_MASK 0x00ff /* Data to be transmitted */
750#define UTX_TXDATA_SHIFT 0
751#define UTX_CTS_DELTA 0x0100 /* CTS changed */
752#define UTX_CTS_STAT 0x0200 /* CTS State */
753#define UTX_BUSY 0x0400 /* FIFO is busy, sending a character */
754#define UTX_NOCTS 0x0800 /* Ignore CTS */
755#define UTX_SEND_BREAK 0x1000 /* Send a BREAK */
756#define UTX_TX_AVAIL 0x2000 /* Transmit FIFO has a slot available */
757#define UTX_FIFO_HALF 0x4000 /* Transmit FIFO is half empty */
758#define UTX_FIFO_EMPTY 0x8000 /* Transmit FIFO is empty */
759
760/* '328-compatible definitions */
761#define UTX_CTS_STATUS UTX_CTS_STAT
762#define UTX_IGNORE_CTS UTX_NOCTS
763
764/*
765 * UART Miscellaneous Register
766 */
767#define UMISC_ADDR 0xfffff908
768#define UMISC WORD_REF(UMISC_ADDR)
769
770#define UMISC_TX_POL 0x0004 /* Transmit Polarity */
771#define UMISC_RX_POL 0x0008 /* Receive Polarity */
772#define UMISC_IRDA_LOOP 0x0010 /* IrDA Loopback Enable */
773#define UMISC_IRDA_EN 0x0020 /* Infra-Red Enable */
774#define UMISC_RTS 0x0040 /* Set RTS status */
775#define UMISC_RTSCONT 0x0080 /* Choose RTS control */
776#define UMISC_IR_TEST 0x0400 /* IRDA Test Enable */
777#define UMISC_BAUD_RESET 0x0800 /* Reset Baud Rate Generation Counters */
778#define UMISC_LOOP 0x1000 /* Serial Loopback Enable */
779#define UMISC_FORCE_PERR 0x2000 /* Force Parity Error */
780#define UMISC_CLKSRC 0x4000 /* Clock Source */
781#define UMISC_BAUD_TEST 0x8000 /* Enable Baud Test Mode */
782
783/*
784 * UART Non-integer Prescaler Register
785 */
786#define NIPR_ADDR 0xfffff90a
787#define NIPR WORD_REF(NIPR_ADDR)
788
789#define NIPR_STEP_VALUE_MASK 0x00ff /* NI prescaler step value */
790#define NIPR_STEP_VALUE_SHIFT 0
791#define NIPR_SELECT_MASK 0x0700 /* Tap Selection */
792#define NIPR_SELECT_SHIFT 8
793#define NIPR_PRE_SEL 0x8000 /* Non-integer prescaler select */
794
795
796/* generalization of uart control registers to support multiple ports: */
797typedef volatile struct {
798 volatile unsigned short int ustcnt;
799 volatile unsigned short int ubaud;
800 union {
801 volatile unsigned short int w;
802 struct {
803 volatile unsigned char status;
804 volatile unsigned char rxdata;
805 } b;
806 } urx;
807 union {
808 volatile unsigned short int w;
809 struct {
810 volatile unsigned char status;
811 volatile unsigned char txdata;
812 } b;
813 } utx;
814 volatile unsigned short int umisc;
815 volatile unsigned short int nipr;
816 volatile unsigned short int pad1;
817 volatile unsigned short int pad2;
818} m68328_uart __attribute__((packed));
819
820
821/**********
822 *
823 * 0xFFFFFAxx -- LCD Controller
824 *
825 **********/
826
827/*
828 * LCD Screen Starting Address Register
829 */
830#define LSSA_ADDR 0xfffffa00
831#define LSSA LONG_REF(LSSA_ADDR)
832
833#define LSSA_SSA_MASK 0x1ffffffe /* Bits 0 and 29-31 are reserved */
834
835/*
836 * LCD Virtual Page Width Register
837 */
838#define LVPW_ADDR 0xfffffa05
839#define LVPW BYTE_REF(LVPW_ADDR)
840
841/*
842 * LCD Screen Width Register (not compatible with '328 !!!)
843 */
844#define LXMAX_ADDR 0xfffffa08
845#define LXMAX WORD_REF(LXMAX_ADDR)
846
847#define LXMAX_XM_MASK 0x02f0 /* Bits 0-3 and 10-15 are reserved */
848
849/*
850 * LCD Screen Height Register
851 */
852#define LYMAX_ADDR 0xfffffa0a
853#define LYMAX WORD_REF(LYMAX_ADDR)
854
855#define LYMAX_YM_MASK 0x01ff /* Bits 9-15 are reserved */
856
857/*
858 * LCD Cursor X Position Register
859 */
860#define LCXP_ADDR 0xfffffa18
861#define LCXP WORD_REF(LCXP_ADDR)
862
863#define LCXP_CC_MASK 0xc000 /* Cursor Control */
864#define LCXP_CC_TRAMSPARENT 0x0000
865#define LCXP_CC_BLACK 0x4000
866#define LCXP_CC_REVERSED 0x8000
867#define LCXP_CC_WHITE 0xc000
868#define LCXP_CXP_MASK 0x02ff /* Cursor X position */
869
870/*
871 * LCD Cursor Y Position Register
872 */
873#define LCYP_ADDR 0xfffffa1a
874#define LCYP WORD_REF(LCYP_ADDR)
875
876#define LCYP_CYP_MASK 0x01ff /* Cursor Y Position */
877
878/*
879 * LCD Cursor Width and Heigth Register
880 */
881#define LCWCH_ADDR 0xfffffa1c
882#define LCWCH WORD_REF(LCWCH_ADDR)
883
884#define LCWCH_CH_MASK 0x001f /* Cursor Height */
885#define LCWCH_CH_SHIFT 0
886#define LCWCH_CW_MASK 0x1f00 /* Cursor Width */
887#define LCWCH_CW_SHIFT 8
888
889/*
890 * LCD Blink Control Register
891 */
892#define LBLKC_ADDR 0xfffffa1f
893#define LBLKC BYTE_REF(LBLKC_ADDR)
894
895#define LBLKC_BD_MASK 0x7f /* Blink Divisor */
896#define LBLKC_BD_SHIFT 0
897#define LBLKC_BKEN 0x80 /* Blink Enabled */
898
899/*
900 * LCD Panel Interface Configuration Register
901 */
902#define LPICF_ADDR 0xfffffa20
903#define LPICF BYTE_REF(LPICF_ADDR)
904
905#define LPICF_GS_MASK 0x03 /* Gray-Scale Mode */
906#define LPICF_GS_BW 0x00
907#define LPICF_GS_GRAY_4 0x01
908#define LPICF_GS_GRAY_16 0x02
909#define LPICF_PBSIZ_MASK 0x0c /* Panel Bus Width */
910#define LPICF_PBSIZ_1 0x00
911#define LPICF_PBSIZ_2 0x04
912#define LPICF_PBSIZ_4 0x08
913
914/*
915 * LCD Polarity Configuration Register
916 */
917#define LPOLCF_ADDR 0xfffffa21
918#define LPOLCF BYTE_REF(LPOLCF_ADDR)
919
920#define LPOLCF_PIXPOL 0x01 /* Pixel Polarity */
921#define LPOLCF_LPPOL 0x02 /* Line Pulse Polarity */
922#define LPOLCF_FLMPOL 0x04 /* Frame Marker Polarity */
923#define LPOLCF_LCKPOL 0x08 /* LCD Shift Lock Polarity */
924
925/*
926 * LACD (LCD Alternate Crystal Direction) Rate Control Register
927 */
928#define LACDRC_ADDR 0xfffffa23
929#define LACDRC BYTE_REF(LACDRC_ADDR)
930
931#define LACDRC_ACDSLT 0x80 /* Signal Source Select */
932#define LACDRC_ACD_MASK 0x0f /* Alternate Crystal Direction Control */
933#define LACDRC_ACD_SHIFT 0
934
935/*
936 * LCD Pixel Clock Divider Register
937 */
938#define LPXCD_ADDR 0xfffffa25
939#define LPXCD BYTE_REF(LPXCD_ADDR)
940
941#define LPXCD_PCD_MASK 0x3f /* Pixel Clock Divider */
942#define LPXCD_PCD_SHIFT 0
943
944/*
945 * LCD Clocking Control Register
946 */
947#define LCKCON_ADDR 0xfffffa27
948#define LCKCON BYTE_REF(LCKCON_ADDR)
949
950#define LCKCON_DWS_MASK 0x0f /* Display Wait-State */
951#define LCKCON_DWS_SHIFT 0
952#define LCKCON_DWIDTH 0x40 /* Display Memory Width */
953#define LCKCON_LCDON 0x80 /* Enable LCD Controller */
954
955/* '328-compatible definitions */
956#define LCKCON_DW_MASK LCKCON_DWS_MASK
957#define LCKCON_DW_SHIFT LCKCON_DWS_SHIFT
958
959/*
960 * LCD Refresh Rate Adjustment Register
961 */
962#define LRRA_ADDR 0xfffffa29
963#define LRRA BYTE_REF(LRRA_ADDR)
964
965/*
966 * LCD Panning Offset Register
967 */
968#define LPOSR_ADDR 0xfffffa2d
969#define LPOSR BYTE_REF(LPOSR_ADDR)
970
971#define LPOSR_POS_MASK 0x0f /* Pixel Offset Code */
972#define LPOSR_POS_SHIFT 0
973
974/*
975 * LCD Frame Rate Control Modulation Register
976 */
977#define LFRCM_ADDR 0xfffffa31
978#define LFRCM BYTE_REF(LFRCM_ADDR)
979
980#define LFRCM_YMOD_MASK 0x0f /* Vertical Modulation */
981#define LFRCM_YMOD_SHIFT 0
982#define LFRCM_XMOD_MASK 0xf0 /* Horizontal Modulation */
983#define LFRCM_XMOD_SHIFT 4
984
985/*
986 * LCD Gray Palette Mapping Register
987 */
988#define LGPMR_ADDR 0xfffffa33
989#define LGPMR BYTE_REF(LGPMR_ADDR)
990
991#define LGPMR_G1_MASK 0x0f
992#define LGPMR_G1_SHIFT 0
993#define LGPMR_G2_MASK 0xf0
994#define LGPMR_G2_SHIFT 4
995
996/*
997 * PWM Contrast Control Register
998 */
999#define PWMR_ADDR 0xfffffa36
1000#define PWMR WORD_REF(PWMR_ADDR)
1001
1002#define PWMR_PW_MASK 0x00ff /* Pulse Width */
1003#define PWMR_PW_SHIFT 0
1004#define PWMR_CCPEN 0x0100 /* Contrast Control Enable */
1005#define PWMR_SRC_MASK 0x0600 /* Input Clock Source */
1006#define PWMR_SRC_LINE 0x0000 /* Line Pulse */
1007#define PWMR_SRC_PIXEL 0x0200 /* Pixel Clock */
1008#define PWMR_SRC_LCD 0x4000 /* LCD clock */
1009
1010/**********
1011 *
1012 * 0xFFFFFBxx -- Real-Time Clock (RTC)
1013 *
1014 **********/
1015
1016/*
1017 * RTC Hours Minutes and Seconds Register
1018 */
1019#define RTCTIME_ADDR 0xfffffb00
1020#define RTCTIME LONG_REF(RTCTIME_ADDR)
1021
1022#define RTCTIME_SECONDS_MASK 0x0000003f /* Seconds */
1023#define RTCTIME_SECONDS_SHIFT 0
1024#define RTCTIME_MINUTES_MASK 0x003f0000 /* Minutes */
1025#define RTCTIME_MINUTES_SHIFT 16
1026#define RTCTIME_HOURS_MASK 0x1f000000 /* Hours */
1027#define RTCTIME_HOURS_SHIFT 24
1028
1029/*
1030 * RTC Alarm Register
1031 */
1032#define RTCALRM_ADDR 0xfffffb04
1033#define RTCALRM LONG_REF(RTCALRM_ADDR)
1034
1035#define RTCALRM_SECONDS_MASK 0x0000003f /* Seconds */
1036#define RTCALRM_SECONDS_SHIFT 0
1037#define RTCALRM_MINUTES_MASK 0x003f0000 /* Minutes */
1038#define RTCALRM_MINUTES_SHIFT 16
1039#define RTCALRM_HOURS_MASK 0x1f000000 /* Hours */
1040#define RTCALRM_HOURS_SHIFT 24
1041
1042/*
1043 * Watchdog Timer Register
1044 */
1045#define WATCHDOG_ADDR 0xfffffb0a
1046#define WATCHDOG WORD_REF(WATCHDOG_ADDR)
1047
1048#define WATCHDOG_EN 0x0001 /* Watchdog Enabled */
1049#define WATCHDOG_ISEL 0x0002 /* Select the watchdog interrupt */
1050#define WATCHDOG_INTF 0x0080 /* Watchdog interrupt occcured */
1051#define WATCHDOG_CNT_MASK 0x0300 /* Watchdog Counter */
1052#define WATCHDOG_CNT_SHIFT 8
1053
1054/*
1055 * RTC Control Register
1056 */
1057#define RTCCTL_ADDR 0xfffffb0c
1058#define RTCCTL WORD_REF(RTCCTL_ADDR)
1059
1060#define RTCCTL_XTL 0x0020 /* Crystal Selection */
1061#define RTCCTL_EN 0x0080 /* RTC Enable */
1062
1063/* '328-compatible definitions */
1064#define RTCCTL_384 RTCCTL_XTL
1065#define RTCCTL_ENABLE RTCCTL_EN
1066
1067/*
1068 * RTC Interrupt Status Register
1069 */
1070#define RTCISR_ADDR 0xfffffb0e
1071#define RTCISR WORD_REF(RTCISR_ADDR)
1072
1073#define RTCISR_SW 0x0001 /* Stopwatch timed out */
1074#define RTCISR_MIN 0x0002 /* 1-minute interrupt has occurred */
1075#define RTCISR_ALM 0x0004 /* Alarm interrupt has occurred */
1076#define RTCISR_DAY 0x0008 /* 24-hour rollover interrupt has occurred */
1077#define RTCISR_1HZ 0x0010 /* 1Hz interrupt has occurred */
1078#define RTCISR_HR 0x0020 /* 1-hour interrupt has occurred */
1079#define RTCISR_SAM0 0x0100 /* 4Hz / 4.6875Hz interrupt has occurred */
1080#define RTCISR_SAM1 0x0200 /* 8Hz / 9.3750Hz interrupt has occurred */
1081#define RTCISR_SAM2 0x0400 /* 16Hz / 18.7500Hz interrupt has occurred */
1082#define RTCISR_SAM3 0x0800 /* 32Hz / 37.5000Hz interrupt has occurred */
1083#define RTCISR_SAM4 0x1000 /* 64Hz / 75.0000Hz interrupt has occurred */
1084#define RTCISR_SAM5 0x2000 /* 128Hz / 150.0000Hz interrupt has occurred */
1085#define RTCISR_SAM6 0x4000 /* 256Hz / 300.0000Hz interrupt has occurred */
1086#define RTCISR_SAM7 0x8000 /* 512Hz / 600.0000Hz interrupt has occurred */
1087
1088/*
1089 * RTC Interrupt Enable Register
1090 */
1091#define RTCIENR_ADDR 0xfffffb10
1092#define RTCIENR WORD_REF(RTCIENR_ADDR)
1093
1094#define RTCIENR_SW 0x0001 /* Stopwatch interrupt enable */
1095#define RTCIENR_MIN 0x0002 /* 1-minute interrupt enable */
1096#define RTCIENR_ALM 0x0004 /* Alarm interrupt enable */
1097#define RTCIENR_DAY 0x0008 /* 24-hour rollover interrupt enable */
1098#define RTCIENR_1HZ 0x0010 /* 1Hz interrupt enable */
1099#define RTCIENR_HR 0x0020 /* 1-hour interrupt enable */
1100#define RTCIENR_SAM0 0x0100 /* 4Hz / 4.6875Hz interrupt enable */
1101#define RTCIENR_SAM1 0x0200 /* 8Hz / 9.3750Hz interrupt enable */
1102#define RTCIENR_SAM2 0x0400 /* 16Hz / 18.7500Hz interrupt enable */
1103#define RTCIENR_SAM3 0x0800 /* 32Hz / 37.5000Hz interrupt enable */
1104#define RTCIENR_SAM4 0x1000 /* 64Hz / 75.0000Hz interrupt enable */
1105#define RTCIENR_SAM5 0x2000 /* 128Hz / 150.0000Hz interrupt enable */
1106#define RTCIENR_SAM6 0x4000 /* 256Hz / 300.0000Hz interrupt enable */
1107#define RTCIENR_SAM7 0x8000 /* 512Hz / 600.0000Hz interrupt enable */
1108
1109/*
1110 * Stopwatch Minutes Register
1111 */
1112#define STPWCH_ADDR 0xfffffb12
1113#define STPWCH WORD_REF(STPWCH)
1114
1115#define STPWCH_CNT_MASK 0x003f /* Stopwatch countdown value */
1116#define SPTWCH_CNT_SHIFT 0
1117
1118/*
1119 * RTC Day Count Register
1120 */
1121#define DAYR_ADDR 0xfffffb1a
1122#define DAYR WORD_REF(DAYR_ADDR)
1123
1124#define DAYR_DAYS_MASK 0x1ff /* Day Setting */
1125#define DAYR_DAYS_SHIFT 0
1126
1127/*
1128 * RTC Day Alarm Register
1129 */
1130#define DAYALARM_ADDR 0xfffffb1c
1131#define DAYALARM WORD_REF(DAYALARM_ADDR)
1132
1133#define DAYALARM_DAYSAL_MASK 0x01ff /* Day Setting of the Alarm */
1134#define DAYALARM_DAYSAL_SHIFT 0
1135
1136/**********
1137 *
1138 * 0xFFFFFCxx -- DRAM Controller
1139 *
1140 **********/
1141
1142/*
1143 * DRAM Memory Configuration Register
1144 */
1145#define DRAMMC_ADDR 0xfffffc00
1146#define DRAMMC WORD_REF(DRAMMC_ADDR)
1147
1148#define DRAMMC_ROW12_MASK 0xc000 /* Row address bit for MD12 */
1149#define DRAMMC_ROW12_PA10 0x0000
1150#define DRAMMC_ROW12_PA21 0x4000
1151#define DRAMMC_ROW12_PA23 0x8000
1152#define DRAMMC_ROW0_MASK 0x3000 /* Row address bit for MD0 */
1153#define DRAMMC_ROW0_PA11 0x0000
1154#define DRAMMC_ROW0_PA22 0x1000
1155#define DRAMMC_ROW0_PA23 0x2000
1156#define DRAMMC_ROW11 0x0800 /* Row address bit for MD11 PA20/PA22 */
1157#define DRAMMC_ROW10 0x0400 /* Row address bit for MD10 PA19/PA21 */
1158#define DRAMMC_ROW9 0x0200 /* Row address bit for MD9 PA9/PA19 */
1159#define DRAMMC_ROW8 0x0100 /* Row address bit for MD8 PA10/PA20 */
1160#define DRAMMC_COL10 0x0080 /* Col address bit for MD10 PA11/PA0 */
1161#define DRAMMC_COL9 0x0040 /* Col address bit for MD9 PA10/PA0 */
1162#define DRAMMC_COL8 0x0020 /* Col address bit for MD8 PA9/PA0 */
1163#define DRAMMC_REF_MASK 0x001f /* Reresh Cycle */
1164#define DRAMMC_REF_SHIFT 0
1165
1166/*
1167 * DRAM Control Register
1168 */
1169#define DRAMC_ADDR 0xfffffc02
1170#define DRAMC WORD_REF(DRAMC_ADDR)
1171
1172#define DRAMC_DWE 0x0001 /* DRAM Write Enable */
1173#define DRAMC_RST 0x0002 /* Reset Burst Refresh Enable */
1174#define DRAMC_LPR 0x0004 /* Low-Power Refresh Enable */
1175#define DRAMC_SLW 0x0008 /* Slow RAM */
1176#define DRAMC_LSP 0x0010 /* Light Sleep */
1177#define DRAMC_MSW 0x0020 /* Slow Multiplexing */
1178#define DRAMC_WS_MASK 0x00c0 /* Wait-states */
1179#define DRAMC_WS_SHIFT 6
1180#define DRAMC_PGSZ_MASK 0x0300 /* Page Size for fast page mode */
1181#define DRAMC_PGSZ_SHIFT 8
1182#define DRAMC_PGSZ_256K 0x0000
1183#define DRAMC_PGSZ_512K 0x0100
1184#define DRAMC_PGSZ_1024K 0x0200
1185#define DRAMC_PGSZ_2048K 0x0300
1186#define DRAMC_EDO 0x0400 /* EDO DRAM */
1187#define DRAMC_CLK 0x0800 /* Refresh Timer Clock source select */
1188#define DRAMC_BC_MASK 0x3000 /* Page Access Clock Cycle (FP mode) */
1189#define DRAMC_BC_SHIFT 12
1190#define DRAMC_RM 0x4000 /* Refresh Mode */
1191#define DRAMC_EN 0x8000 /* DRAM Controller enable */
1192
1193
1194/**********
1195 *
1196 * 0xFFFFFDxx -- In-Circuit Emulation (ICE)
1197 *
1198 **********/
1199
1200/*
1201 * ICE Module Address Compare Register
1202 */
1203#define ICEMACR_ADDR 0xfffffd00
1204#define ICEMACR LONG_REF(ICEMACR_ADDR)
1205
1206/*
1207 * ICE Module Address Mask Register
1208 */
1209#define ICEMAMR_ADDR 0xfffffd04
1210#define ICEMAMR LONG_REF(ICEMAMR_ADDR)
1211
1212/*
1213 * ICE Module Control Compare Register
1214 */
1215#define ICEMCCR_ADDR 0xfffffd08
1216#define ICEMCCR WORD_REF(ICEMCCR_ADDR)
1217
1218#define ICEMCCR_PD 0x0001 /* Program/Data Cycle Selection */
1219#define ICEMCCR_RW 0x0002 /* Read/Write Cycle Selection */
1220
1221/*
1222 * ICE Module Control Mask Register
1223 */
1224#define ICEMCMR_ADDR 0xfffffd0a
1225#define ICEMCMR WORD_REF(ICEMCMR_ADDR)
1226
1227#define ICEMCMR_PDM 0x0001 /* Program/Data Cycle Mask */
1228#define ICEMCMR_RWM 0x0002 /* Read/Write Cycle Mask */
1229
1230/*
1231 * ICE Module Control Register
1232 */
1233#define ICEMCR_ADDR 0xfffffd0c
1234#define ICEMCR WORD_REF(ICEMCR_ADDR)
1235
1236#define ICEMCR_CEN 0x0001 /* Compare Enable */
1237#define ICEMCR_PBEN 0x0002 /* Program Break Enable */
1238#define ICEMCR_SB 0x0004 /* Single Breakpoint */
1239#define ICEMCR_HMDIS 0x0008 /* HardMap disable */
1240#define ICEMCR_BBIEN 0x0010 /* Bus Break Interrupt Enable */
1241
1242/*
1243 * ICE Module Status Register
1244 */
1245#define ICEMSR_ADDR 0xfffffd0e
1246#define ICEMSR WORD_REF(ICEMSR_ADDR)
1247
1248#define ICEMSR_EMUEN 0x0001 /* Emulation Enable */
1249#define ICEMSR_BRKIRQ 0x0002 /* A-Line Vector Fetch Detected */
1250#define ICEMSR_BBIRQ 0x0004 /* Bus Break Interrupt Detected */
1251#define ICEMSR_EMIRQ 0x0008 /* EMUIRQ Falling Edge Detected */
1252
1253#endif /* _MC68EZ328_H_ */
diff --git a/include/asm-m68knommu/MC68VZ328.h b/include/asm-m68knommu/MC68VZ328.h
new file mode 100644
index 000000000000..df74322f37ed
--- /dev/null
+++ b/include/asm-m68knommu/MC68VZ328.h
@@ -0,0 +1,1349 @@
1
2/* include/asm-m68knommu/MC68VZ328.h: 'VZ328 control registers
3 *
4 * Copyright (c) 2000-2001 Lineo Inc. <www.lineo.com>
5 * Copyright (c) 2000-2001 Lineo Canada Corp. <www.lineo.ca>
6 * Copyright (C) 1999 Vladimir Gurevich <vgurevic@cisco.com>
7 * Bare & Hare Software, Inc.
8 * Based on include/asm-m68knommu/MC68332.h
9 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>,
10 * The Silver Hammer Group, Ltd.
11 *
12 * M68VZ328 fixes by Evan Stawnyczy <evan@lineo.com>
13 * vz multiport fixes by Michael Leslie <mleslie@lineo.com>
14 */
15
16#ifndef _MC68VZ328_H_
17#define _MC68VZ328_H_
18
19#define BYTE_REF(addr) (*((volatile unsigned char*)addr))
20#define WORD_REF(addr) (*((volatile unsigned short*)addr))
21#define LONG_REF(addr) (*((volatile unsigned long*)addr))
22
23#define PUT_FIELD(field, val) (((val) << field##_SHIFT) & field##_MASK)
24#define GET_FIELD(reg, field) (((reg) & field##_MASK) >> field##_SHIFT)
25
26/**********
27 *
28 * 0xFFFFF0xx -- System Control
29 *
30 **********/
31
32/*
33 * System Control Register (SCR)
34 */
35#define SCR_ADDR 0xfffff000
36#define SCR BYTE_REF(SCR_ADDR)
37
38#define SCR_WDTH8 0x01 /* 8-Bit Width Select */
39#define SCR_DMAP 0x04 /* Double Map */
40#define SCR_SO 0x08 /* Supervisor Only */
41#define SCR_BETEN 0x10 /* Bus-Error Time-Out Enable */
42#define SCR_PRV 0x20 /* Privilege Violation */
43#define SCR_WPV 0x40 /* Write Protect Violation */
44#define SCR_BETO 0x80 /* Bus-Error TimeOut */
45
46/*
47 * Silicon ID Register (Mask Revision Register (MRR) for '328 Compatibility)
48 */
49#define MRR_ADDR 0xfffff004
50#define MRR LONG_REF(MRR_ADDR)
51
52/**********
53 *
54 * 0xFFFFF1xx -- Chip-Select logic
55 *
56 **********/
57
58/*
59 * Chip Select Group Base Registers
60 */
61#define CSGBA_ADDR 0xfffff100
62#define CSGBB_ADDR 0xfffff102
63
64#define CSGBC_ADDR 0xfffff104
65#define CSGBD_ADDR 0xfffff106
66
67#define CSGBA WORD_REF(CSGBA_ADDR)
68#define CSGBB WORD_REF(CSGBB_ADDR)
69#define CSGBC WORD_REF(CSGBC_ADDR)
70#define CSGBD WORD_REF(CSGBD_ADDR)
71
72/*
73 * Chip Select Registers
74 */
75#define CSA_ADDR 0xfffff110
76#define CSB_ADDR 0xfffff112
77#define CSC_ADDR 0xfffff114
78#define CSD_ADDR 0xfffff116
79
80#define CSA WORD_REF(CSA_ADDR)
81#define CSB WORD_REF(CSB_ADDR)
82#define CSC WORD_REF(CSC_ADDR)
83#define CSD WORD_REF(CSD_ADDR)
84
85#define CSA_EN 0x0001 /* Chip-Select Enable */
86#define CSA_SIZ_MASK 0x000e /* Chip-Select Size */
87#define CSA_SIZ_SHIFT 1
88#define CSA_WS_MASK 0x0070 /* Wait State */
89#define CSA_WS_SHIFT 4
90#define CSA_BSW 0x0080 /* Data Bus Width */
91#define CSA_FLASH 0x0100 /* FLASH Memory Support */
92#define CSA_RO 0x8000 /* Read-Only */
93
94#define CSB_EN 0x0001 /* Chip-Select Enable */
95#define CSB_SIZ_MASK 0x000e /* Chip-Select Size */
96#define CSB_SIZ_SHIFT 1
97#define CSB_WS_MASK 0x0070 /* Wait State */
98#define CSB_WS_SHIFT 4
99#define CSB_BSW 0x0080 /* Data Bus Width */
100#define CSB_FLASH 0x0100 /* FLASH Memory Support */
101#define CSB_UPSIZ_MASK 0x1800 /* Unprotected memory block size */
102#define CSB_UPSIZ_SHIFT 11
103#define CSB_ROP 0x2000 /* Readonly if protected */
104#define CSB_SOP 0x4000 /* Supervisor only if protected */
105#define CSB_RO 0x8000 /* Read-Only */
106
107#define CSC_EN 0x0001 /* Chip-Select Enable */
108#define CSC_SIZ_MASK 0x000e /* Chip-Select Size */
109#define CSC_SIZ_SHIFT 1
110#define CSC_WS_MASK 0x0070 /* Wait State */
111#define CSC_WS_SHIFT 4
112#define CSC_BSW 0x0080 /* Data Bus Width */
113#define CSC_FLASH 0x0100 /* FLASH Memory Support */
114#define CSC_UPSIZ_MASK 0x1800 /* Unprotected memory block size */
115#define CSC_UPSIZ_SHIFT 11
116#define CSC_ROP 0x2000 /* Readonly if protected */
117#define CSC_SOP 0x4000 /* Supervisor only if protected */
118#define CSC_RO 0x8000 /* Read-Only */
119
120#define CSD_EN 0x0001 /* Chip-Select Enable */
121#define CSD_SIZ_MASK 0x000e /* Chip-Select Size */
122#define CSD_SIZ_SHIFT 1
123#define CSD_WS_MASK 0x0070 /* Wait State */
124#define CSD_WS_SHIFT 4
125#define CSD_BSW 0x0080 /* Data Bus Width */
126#define CSD_FLASH 0x0100 /* FLASH Memory Support */
127#define CSD_DRAM 0x0200 /* Dram Selection */
128#define CSD_COMB 0x0400 /* Combining */
129#define CSD_UPSIZ_MASK 0x1800 /* Unprotected memory block size */
130#define CSD_UPSIZ_SHIFT 11
131#define CSD_ROP 0x2000 /* Readonly if protected */
132#define CSD_SOP 0x4000 /* Supervisor only if protected */
133#define CSD_RO 0x8000 /* Read-Only */
134
135/*
136 * Emulation Chip-Select Register
137 */
138#define EMUCS_ADDR 0xfffff118
139#define EMUCS WORD_REF(EMUCS_ADDR)
140
141#define EMUCS_WS_MASK 0x0070
142#define EMUCS_WS_SHIFT 4
143
144/**********
145 *
146 * 0xFFFFF2xx -- Phase Locked Loop (PLL) & Power Control
147 *
148 **********/
149
150/*
151 * PLL Control Register
152 */
153#define PLLCR_ADDR 0xfffff200
154#define PLLCR WORD_REF(PLLCR_ADDR)
155
156#define PLLCR_DISPLL 0x0008 /* Disable PLL */
157#define PLLCR_CLKEN 0x0010 /* Clock (CLKO pin) enable */
158#define PLLCR_PRESC 0x0020 /* VCO prescaler */
159#define PLLCR_SYSCLK_SEL_MASK 0x0700 /* System Clock Selection */
160#define PLLCR_SYSCLK_SEL_SHIFT 8
161#define PLLCR_LCDCLK_SEL_MASK 0x3800 /* LCD Clock Selection */
162#define PLLCR_LCDCLK_SEL_SHIFT 11
163
164/* '328-compatible definitions */
165#define PLLCR_PIXCLK_SEL_MASK PLLCR_LCDCLK_SEL_MASK
166#define PLLCR_PIXCLK_SEL_SHIFT PLLCR_LCDCLK_SEL_SHIFT
167
168/*
169 * PLL Frequency Select Register
170 */
171#define PLLFSR_ADDR 0xfffff202
172#define PLLFSR WORD_REF(PLLFSR_ADDR)
173
174#define PLLFSR_PC_MASK 0x00ff /* P Count */
175#define PLLFSR_PC_SHIFT 0
176#define PLLFSR_QC_MASK 0x0f00 /* Q Count */
177#define PLLFSR_QC_SHIFT 8
178#define PLLFSR_PROT 0x4000 /* Protect P & Q */
179#define PLLFSR_CLK32 0x8000 /* Clock 32 (kHz) */
180
181/*
182 * Power Control Register
183 */
184#define PCTRL_ADDR 0xfffff207
185#define PCTRL BYTE_REF(PCTRL_ADDR)
186
187#define PCTRL_WIDTH_MASK 0x1f /* CPU Clock bursts width */
188#define PCTRL_WIDTH_SHIFT 0
189#define PCTRL_PCEN 0x80 /* Power Control Enable */
190
191/**********
192 *
193 * 0xFFFFF3xx -- Interrupt Controller
194 *
195 **********/
196
197/*
198 * Interrupt Vector Register
199 */
200#define IVR_ADDR 0xfffff300
201#define IVR BYTE_REF(IVR_ADDR)
202
203#define IVR_VECTOR_MASK 0xF8
204
205/*
206 * Interrupt control Register
207 */
208#define ICR_ADDR 0xfffff302
209#define ICR WORD_REF(ICR_ADDR)
210
211#define ICR_POL5 0x0080 /* Polarity Control for IRQ5 */
212#define ICR_ET6 0x0100 /* Edge Trigger Select for IRQ6 */
213#define ICR_ET3 0x0200 /* Edge Trigger Select for IRQ3 */
214#define ICR_ET2 0x0400 /* Edge Trigger Select for IRQ2 */
215#define ICR_ET1 0x0800 /* Edge Trigger Select for IRQ1 */
216#define ICR_POL6 0x1000 /* Polarity Control for IRQ6 */
217#define ICR_POL3 0x2000 /* Polarity Control for IRQ3 */
218#define ICR_POL2 0x4000 /* Polarity Control for IRQ2 */
219#define ICR_POL1 0x8000 /* Polarity Control for IRQ1 */
220
221/*
222 * Interrupt Mask Register
223 */
224#define IMR_ADDR 0xfffff304
225#define IMR LONG_REF(IMR_ADDR)
226
227/*
228 * Define the names for bit positions first. This is useful for
229 * request_irq
230 */
231#define SPI2_IRQ_NUM 0 /* SPI 2 interrupt */
232#define TMR_IRQ_NUM 1 /* Timer 1 interrupt */
233#define UART1_IRQ_NUM 2 /* UART 1 interrupt */
234#define WDT_IRQ_NUM 3 /* Watchdog Timer interrupt */
235#define RTC_IRQ_NUM 4 /* RTC interrupt */
236#define TMR2_IRQ_NUM 5 /* Timer 2 interrupt */
237#define KB_IRQ_NUM 6 /* Keyboard Interrupt */
238#define PWM1_IRQ_NUM 7 /* Pulse-Width Modulator 1 int. */
239#define INT0_IRQ_NUM 8 /* External INT0 */
240#define INT1_IRQ_NUM 9 /* External INT1 */
241#define INT2_IRQ_NUM 10 /* External INT2 */
242#define INT3_IRQ_NUM 11 /* External INT3 */
243#define UART2_IRQ_NUM 12 /* UART 2 interrupt */
244#define PWM2_IRQ_NUM 13 /* Pulse-Width Modulator 1 int. */
245#define IRQ1_IRQ_NUM 16 /* IRQ1 */
246#define IRQ2_IRQ_NUM 17 /* IRQ2 */
247#define IRQ3_IRQ_NUM 18 /* IRQ3 */
248#define IRQ6_IRQ_NUM 19 /* IRQ6 */
249#define IRQ5_IRQ_NUM 20 /* IRQ5 */
250#define SPI1_IRQ_NUM 21 /* SPI 1 interrupt */
251#define SAM_IRQ_NUM 22 /* Sampling Timer for RTC */
252#define EMIQ_IRQ_NUM 23 /* Emulator Interrupt */
253
254#define SPI_IRQ_NUM SPI2_IRQ_NUM
255
256/* '328-compatible definitions */
257#define SPIM_IRQ_NUM SPI_IRQ_NUM
258#define TMR1_IRQ_NUM TMR_IRQ_NUM
259#define UART_IRQ_NUM UART1_IRQ_NUM
260
261/*
262 * Here go the bitmasks themselves
263 */
264#define IMR_MSPI (1 << SPI_IRQ_NUM) /* Mask SPI interrupt */
265#define IMR_MTMR (1 << TMR_IRQ_NUM) /* Mask Timer interrupt */
266#define IMR_MUART (1 << UART_IRQ_NUM) /* Mask UART interrupt */
267#define IMR_MWDT (1 << WDT_IRQ_NUM) /* Mask Watchdog Timer interrupt */
268#define IMR_MRTC (1 << RTC_IRQ_NUM) /* Mask RTC interrupt */
269#define IMR_MKB (1 << KB_IRQ_NUM) /* Mask Keyboard Interrupt */
270#define IMR_MPWM (1 << PWM_IRQ_NUM) /* Mask Pulse-Width Modulator int. */
271#define IMR_MINT0 (1 << INT0_IRQ_NUM) /* Mask External INT0 */
272#define IMR_MINT1 (1 << INT1_IRQ_NUM) /* Mask External INT1 */
273#define IMR_MINT2 (1 << INT2_IRQ_NUM) /* Mask External INT2 */
274#define IMR_MINT3 (1 << INT3_IRQ_NUM) /* Mask External INT3 */
275#define IMR_MIRQ1 (1 << IRQ1_IRQ_NUM) /* Mask IRQ1 */
276#define IMR_MIRQ2 (1 << IRQ2_IRQ_NUM) /* Mask IRQ2 */
277#define IMR_MIRQ3 (1 << IRQ3_IRQ_NUM) /* Mask IRQ3 */
278#define IMR_MIRQ6 (1 << IRQ6_IRQ_NUM) /* Mask IRQ6 */
279#define IMR_MIRQ5 (1 << IRQ5_IRQ_NUM) /* Mask IRQ5 */
280#define IMR_MSAM (1 << SAM_IRQ_NUM) /* Mask Sampling Timer for RTC */
281#define IMR_MEMIQ (1 << EMIQ_IRQ_NUM) /* Mask Emulator Interrupt */
282
283/* '328-compatible definitions */
284#define IMR_MSPIM IMR_MSPI
285#define IMR_MTMR1 IMR_MTMR
286
287/*
288 * Interrupt Status Register
289 */
290#define ISR_ADDR 0xfffff30c
291#define ISR LONG_REF(ISR_ADDR)
292
293#define ISR_SPI (1 << SPI_IRQ_NUM) /* SPI interrupt */
294#define ISR_TMR (1 << TMR_IRQ_NUM) /* Timer interrupt */
295#define ISR_UART (1 << UART_IRQ_NUM) /* UART interrupt */
296#define ISR_WDT (1 << WDT_IRQ_NUM) /* Watchdog Timer interrupt */
297#define ISR_RTC (1 << RTC_IRQ_NUM) /* RTC interrupt */
298#define ISR_KB (1 << KB_IRQ_NUM) /* Keyboard Interrupt */
299#define ISR_PWM (1 << PWM_IRQ_NUM) /* Pulse-Width Modulator interrupt */
300#define ISR_INT0 (1 << INT0_IRQ_NUM) /* External INT0 */
301#define ISR_INT1 (1 << INT1_IRQ_NUM) /* External INT1 */
302#define ISR_INT2 (1 << INT2_IRQ_NUM) /* External INT2 */
303#define ISR_INT3 (1 << INT3_IRQ_NUM) /* External INT3 */
304#define ISR_IRQ1 (1 << IRQ1_IRQ_NUM) /* IRQ1 */
305#define ISR_IRQ2 (1 << IRQ2_IRQ_NUM) /* IRQ2 */
306#define ISR_IRQ3 (1 << IRQ3_IRQ_NUM) /* IRQ3 */
307#define ISR_IRQ6 (1 << IRQ6_IRQ_NUM) /* IRQ6 */
308#define ISR_IRQ5 (1 << IRQ5_IRQ_NUM) /* IRQ5 */
309#define ISR_SAM (1 << SAM_IRQ_NUM) /* Sampling Timer for RTC */
310#define ISR_EMIQ (1 << EMIQ_IRQ_NUM) /* Emulator Interrupt */
311
312/* '328-compatible definitions */
313#define ISR_SPIM ISR_SPI
314#define ISR_TMR1 ISR_TMR
315
316/*
317 * Interrupt Pending Register
318 */
319#define IPR_ADDR 0xfffff30c
320#define IPR LONG_REF(IPR_ADDR)
321
322#define IPR_SPI (1 << SPI_IRQ_NUM) /* SPI interrupt */
323#define IPR_TMR (1 << TMR_IRQ_NUM) /* Timer interrupt */
324#define IPR_UART (1 << UART_IRQ_NUM) /* UART interrupt */
325#define IPR_WDT (1 << WDT_IRQ_NUM) /* Watchdog Timer interrupt */
326#define IPR_RTC (1 << RTC_IRQ_NUM) /* RTC interrupt */
327#define IPR_KB (1 << KB_IRQ_NUM) /* Keyboard Interrupt */
328#define IPR_PWM (1 << PWM_IRQ_NUM) /* Pulse-Width Modulator interrupt */
329#define IPR_INT0 (1 << INT0_IRQ_NUM) /* External INT0 */
330#define IPR_INT1 (1 << INT1_IRQ_NUM) /* External INT1 */
331#define IPR_INT2 (1 << INT2_IRQ_NUM) /* External INT2 */
332#define IPR_INT3 (1 << INT3_IRQ_NUM) /* External INT3 */
333#define IPR_IRQ1 (1 << IRQ1_IRQ_NUM) /* IRQ1 */
334#define IPR_IRQ2 (1 << IRQ2_IRQ_NUM) /* IRQ2 */
335#define IPR_IRQ3 (1 << IRQ3_IRQ_NUM) /* IRQ3 */
336#define IPR_IRQ6 (1 << IRQ6_IRQ_NUM) /* IRQ6 */
337#define IPR_IRQ5 (1 << IRQ5_IRQ_NUM) /* IRQ5 */
338#define IPR_SAM (1 << SAM_IRQ_NUM) /* Sampling Timer for RTC */
339#define IPR_EMIQ (1 << EMIQ_IRQ_NUM) /* Emulator Interrupt */
340
341/* '328-compatible definitions */
342#define IPR_SPIM IPR_SPI
343#define IPR_TMR1 IPR_TMR
344
345/**********
346 *
347 * 0xFFFFF4xx -- Parallel Ports
348 *
349 **********/
350
351/*
352 * Port A
353 */
354#define PADIR_ADDR 0xfffff400 /* Port A direction reg */
355#define PADATA_ADDR 0xfffff401 /* Port A data register */
356#define PAPUEN_ADDR 0xfffff402 /* Port A Pull-Up enable reg */
357
358#define PADIR BYTE_REF(PADIR_ADDR)
359#define PADATA BYTE_REF(PADATA_ADDR)
360#define PAPUEN BYTE_REF(PAPUEN_ADDR)
361
362#define PA(x) (1 << (x))
363
364/*
365 * Port B
366 */
367#define PBDIR_ADDR 0xfffff408 /* Port B direction reg */
368#define PBDATA_ADDR 0xfffff409 /* Port B data register */
369#define PBPUEN_ADDR 0xfffff40a /* Port B Pull-Up enable reg */
370#define PBSEL_ADDR 0xfffff40b /* Port B Select Register */
371
372#define PBDIR BYTE_REF(PBDIR_ADDR)
373#define PBDATA BYTE_REF(PBDATA_ADDR)
374#define PBPUEN BYTE_REF(PBPUEN_ADDR)
375#define PBSEL BYTE_REF(PBSEL_ADDR)
376
377#define PB(x) (1 << (x))
378
379#define PB_CSB0 0x01 /* Use CSB0 as PB[0] */
380#define PB_CSB1 0x02 /* Use CSB1 as PB[1] */
381#define PB_CSC0_RAS0 0x04 /* Use CSC0/RAS0 as PB[2] */
382#define PB_CSC1_RAS1 0x08 /* Use CSC1/RAS1 as PB[3] */
383#define PB_CSD0_CAS0 0x10 /* Use CSD0/CAS0 as PB[4] */
384#define PB_CSD1_CAS1 0x20 /* Use CSD1/CAS1 as PB[5] */
385#define PB_TIN_TOUT 0x40 /* Use TIN/TOUT as PB[6] */
386#define PB_PWMO 0x80 /* Use PWMO as PB[7] */
387
388/*
389 * Port C
390 */
391#define PCDIR_ADDR 0xfffff410 /* Port C direction reg */
392#define PCDATA_ADDR 0xfffff411 /* Port C data register */
393#define PCPDEN_ADDR 0xfffff412 /* Port C Pull-Down enb. reg */
394#define PCSEL_ADDR 0xfffff413 /* Port C Select Register */
395
396#define PCDIR BYTE_REF(PCDIR_ADDR)
397#define PCDATA BYTE_REF(PCDATA_ADDR)
398#define PCPDEN BYTE_REF(PCPDEN_ADDR)
399#define PCSEL BYTE_REF(PCSEL_ADDR)
400
401#define PC(x) (1 << (x))
402
403#define PC_LD0 0x01 /* Use LD0 as PC[0] */
404#define PC_LD1 0x02 /* Use LD1 as PC[1] */
405#define PC_LD2 0x04 /* Use LD2 as PC[2] */
406#define PC_LD3 0x08 /* Use LD3 as PC[3] */
407#define PC_LFLM 0x10 /* Use LFLM as PC[4] */
408#define PC_LLP 0x20 /* Use LLP as PC[5] */
409#define PC_LCLK 0x40 /* Use LCLK as PC[6] */
410#define PC_LACD 0x80 /* Use LACD as PC[7] */
411
412/*
413 * Port D
414 */
415#define PDDIR_ADDR 0xfffff418 /* Port D direction reg */
416#define PDDATA_ADDR 0xfffff419 /* Port D data register */
417#define PDPUEN_ADDR 0xfffff41a /* Port D Pull-Up enable reg */
418#define PDSEL_ADDR 0xfffff41b /* Port D Select Register */
419#define PDPOL_ADDR 0xfffff41c /* Port D Polarity Register */
420#define PDIRQEN_ADDR 0xfffff41d /* Port D IRQ enable register */
421#define PDKBEN_ADDR 0xfffff41e /* Port D Keyboard Enable reg */
422#define PDIQEG_ADDR 0xfffff41f /* Port D IRQ Edge Register */
423
424#define PDDIR BYTE_REF(PDDIR_ADDR)
425#define PDDATA BYTE_REF(PDDATA_ADDR)
426#define PDPUEN BYTE_REF(PDPUEN_ADDR)
427#define PDSEL BYTE_REF(PDSEL_ADDR)
428#define PDPOL BYTE_REF(PDPOL_ADDR)
429#define PDIRQEN BYTE_REF(PDIRQEN_ADDR)
430#define PDKBEN BYTE_REF(PDKBEN_ADDR)
431#define PDIQEG BYTE_REF(PDIQEG_ADDR)
432
433#define PD(x) (1 << (x))
434
435#define PD_INT0 0x01 /* Use INT0 as PD[0] */
436#define PD_INT1 0x02 /* Use INT1 as PD[1] */
437#define PD_INT2 0x04 /* Use INT2 as PD[2] */
438#define PD_INT3 0x08 /* Use INT3 as PD[3] */
439#define PD_IRQ1 0x10 /* Use IRQ1 as PD[4] */
440#define PD_IRQ2 0x20 /* Use IRQ2 as PD[5] */
441#define PD_IRQ3 0x40 /* Use IRQ3 as PD[6] */
442#define PD_IRQ6 0x80 /* Use IRQ6 as PD[7] */
443
444/*
445 * Port E
446 */
447#define PEDIR_ADDR 0xfffff420 /* Port E direction reg */
448#define PEDATA_ADDR 0xfffff421 /* Port E data register */
449#define PEPUEN_ADDR 0xfffff422 /* Port E Pull-Up enable reg */
450#define PESEL_ADDR 0xfffff423 /* Port E Select Register */
451
452#define PEDIR BYTE_REF(PEDIR_ADDR)
453#define PEDATA BYTE_REF(PEDATA_ADDR)
454#define PEPUEN BYTE_REF(PEPUEN_ADDR)
455#define PESEL BYTE_REF(PESEL_ADDR)
456
457#define PE(x) (1 << (x))
458
459#define PE_SPMTXD 0x01 /* Use SPMTXD as PE[0] */
460#define PE_SPMRXD 0x02 /* Use SPMRXD as PE[1] */
461#define PE_SPMCLK 0x04 /* Use SPMCLK as PE[2] */
462#define PE_DWE 0x08 /* Use DWE as PE[3] */
463#define PE_RXD 0x10 /* Use RXD as PE[4] */
464#define PE_TXD 0x20 /* Use TXD as PE[5] */
465#define PE_RTS 0x40 /* Use RTS as PE[6] */
466#define PE_CTS 0x80 /* Use CTS as PE[7] */
467
468/*
469 * Port F
470 */
471#define PFDIR_ADDR 0xfffff428 /* Port F direction reg */
472#define PFDATA_ADDR 0xfffff429 /* Port F data register */
473#define PFPUEN_ADDR 0xfffff42a /* Port F Pull-Up enable reg */
474#define PFSEL_ADDR 0xfffff42b /* Port F Select Register */
475
476#define PFDIR BYTE_REF(PFDIR_ADDR)
477#define PFDATA BYTE_REF(PFDATA_ADDR)
478#define PFPUEN BYTE_REF(PFPUEN_ADDR)
479#define PFSEL BYTE_REF(PFSEL_ADDR)
480
481#define PF(x) (1 << (x))
482
483#define PF_LCONTRAST 0x01 /* Use LCONTRAST as PF[0] */
484#define PF_IRQ5 0x02 /* Use IRQ5 as PF[1] */
485#define PF_CLKO 0x04 /* Use CLKO as PF[2] */
486#define PF_A20 0x08 /* Use A20 as PF[3] */
487#define PF_A21 0x10 /* Use A21 as PF[4] */
488#define PF_A22 0x20 /* Use A22 as PF[5] */
489#define PF_A23 0x40 /* Use A23 as PF[6] */
490#define PF_CSA1 0x80 /* Use CSA1 as PF[7] */
491
492/*
493 * Port G
494 */
495#define PGDIR_ADDR 0xfffff430 /* Port G direction reg */
496#define PGDATA_ADDR 0xfffff431 /* Port G data register */
497#define PGPUEN_ADDR 0xfffff432 /* Port G Pull-Up enable reg */
498#define PGSEL_ADDR 0xfffff433 /* Port G Select Register */
499
500#define PGDIR BYTE_REF(PGDIR_ADDR)
501#define PGDATA BYTE_REF(PGDATA_ADDR)
502#define PGPUEN BYTE_REF(PGPUEN_ADDR)
503#define PGSEL BYTE_REF(PGSEL_ADDR)
504
505#define PG(x) (1 << (x))
506
507#define PG_BUSW_DTACK 0x01 /* Use BUSW/DTACK as PG[0] */
508#define PG_A0 0x02 /* Use A0 as PG[1] */
509#define PG_EMUIRQ 0x04 /* Use EMUIRQ as PG[2] */
510#define PG_HIZ_P_D 0x08 /* Use HIZ/P/D as PG[3] */
511#define PG_EMUCS 0x10 /* Use EMUCS as PG[4] */
512#define PG_EMUBRK 0x20 /* Use EMUBRK as PG[5] */
513
514/*
515 * Port J
516 */
517#define PJDIR_ADDR 0xfffff438 /* Port J direction reg */
518#define PJDATA_ADDR 0xfffff439 /* Port J data register */
519#define PJPUEN_ADDR 0xfffff43A /* Port J Pull-Up enb. reg */
520#define PJSEL_ADDR 0xfffff43B /* Port J Select Register */
521
522#define PJDIR BYTE_REF(PJDIR_ADDR)
523#define PJDATA BYTE_REF(PJDATA_ADDR)
524#define PJPUEN BYTE_REF(PJPUEN_ADDR)
525#define PJSEL BYTE_REF(PJSEL_ADDR)
526
527#define PJ(x) (1 << (x))
528
529/*
530 * Port K
531 */
532#define PKDIR_ADDR 0xfffff440 /* Port K direction reg */
533#define PKDATA_ADDR 0xfffff441 /* Port K data register */
534#define PKPUEN_ADDR 0xfffff442 /* Port K Pull-Up enb. reg */
535#define PKSEL_ADDR 0xfffff443 /* Port K Select Register */
536
537#define PKDIR BYTE_REF(PKDIR_ADDR)
538#define PKDATA BYTE_REF(PKDATA_ADDR)
539#define PKPUEN BYTE_REF(PKPUEN_ADDR)
540#define PKSEL BYTE_REF(PKSEL_ADDR)
541
542#define PK(x) (1 << (x))
543
544#define PK_DATAREADY 0x01 /* Use ~DATA_READY as PK[0] */
545#define PK_PWM2 0x01 /* Use PWM2 as PK[0] */
546#define PK_R_W 0x02 /* Use R/W as PK[1] */
547#define PK_LDS 0x04 /* Use /LDS as PK[2] */
548#define PK_UDS 0x08 /* Use /UDS as PK[3] */
549#define PK_LD4 0x10 /* Use LD4 as PK[4] */
550#define PK_LD5 0x20 /* Use LD5 as PK[5] */
551#define PK_LD6 0x40 /* Use LD6 as PK[6] */
552#define PK_LD7 0x80 /* Use LD7 as PK[7] */
553
554#define PJDIR_ADDR 0xfffff438 /* Port J direction reg */
555#define PJDATA_ADDR 0xfffff439 /* Port J data register */
556#define PJPUEN_ADDR 0xfffff43A /* Port J Pull-Up enable reg */
557#define PJSEL_ADDR 0xfffff43B /* Port J Select Register */
558
559#define PJDIR BYTE_REF(PJDIR_ADDR)
560#define PJDATA BYTE_REF(PJDATA_ADDR)
561#define PJPUEN BYTE_REF(PJPUEN_ADDR)
562#define PJSEL BYTE_REF(PJSEL_ADDR)
563
564#define PJ(x) (1 << (x))
565
566#define PJ_MOSI 0x01 /* Use MOSI as PJ[0] */
567#define PJ_MISO 0x02 /* Use MISO as PJ[1] */
568#define PJ_SPICLK1 0x04 /* Use SPICLK1 as PJ[2] */
569#define PJ_SS 0x08 /* Use SS as PJ[3] */
570#define PJ_RXD2 0x10 /* Use RXD2 as PJ[4] */
571#define PJ_TXD2 0x20 /* Use TXD2 as PJ[5] */
572#define PJ_RTS2 0x40 /* Use RTS2 as PJ[5] */
573#define PJ_CTS2 0x80 /* Use CTS2 as PJ[5] */
574
575/*
576 * Port M
577 */
578#define PMDIR_ADDR 0xfffff448 /* Port M direction reg */
579#define PMDATA_ADDR 0xfffff449 /* Port M data register */
580#define PMPUEN_ADDR 0xfffff44a /* Port M Pull-Up enable reg */
581#define PMSEL_ADDR 0xfffff44b /* Port M Select Register */
582
583#define PMDIR BYTE_REF(PMDIR_ADDR)
584#define PMDATA BYTE_REF(PMDATA_ADDR)
585#define PMPUEN BYTE_REF(PMPUEN_ADDR)
586#define PMSEL BYTE_REF(PMSEL_ADDR)
587
588#define PM(x) (1 << (x))
589
590#define PM_SDCLK 0x01 /* Use SDCLK as PM[0] */
591#define PM_SDCE 0x02 /* Use SDCE as PM[1] */
592#define PM_DQMH 0x04 /* Use DQMH as PM[2] */
593#define PM_DQML 0x08 /* Use DQML as PM[3] */
594#define PM_SDA10 0x10 /* Use SDA10 as PM[4] */
595#define PM_DMOE 0x20 /* Use DMOE as PM[5] */
596
597/**********
598 *
599 * 0xFFFFF5xx -- Pulse-Width Modulator (PWM)
600 *
601 **********/
602
603/*
604 * PWM Control Register
605 */
606#define PWMC_ADDR 0xfffff500
607#define PWMC WORD_REF(PWMC_ADDR)
608
609#define PWMC_CLKSEL_MASK 0x0003 /* Clock Selection */
610#define PWMC_CLKSEL_SHIFT 0
611#define PWMC_REPEAT_MASK 0x000c /* Sample Repeats */
612#define PWMC_REPEAT_SHIFT 2
613#define PWMC_EN 0x0010 /* Enable PWM */
614#define PMNC_FIFOAV 0x0020 /* FIFO Available */
615#define PWMC_IRQEN 0x0040 /* Interrupt Request Enable */
616#define PWMC_IRQ 0x0080 /* Interrupt Request (FIFO empty) */
617#define PWMC_PRESCALER_MASK 0x7f00 /* Incoming Clock prescaler */
618#define PWMC_PRESCALER_SHIFT 8
619#define PWMC_CLKSRC 0x8000 /* Clock Source Select */
620
621/* '328-compatible definitions */
622#define PWMC_PWMEN PWMC_EN
623
624/*
625 * PWM Sample Register
626 */
627#define PWMS_ADDR 0xfffff502
628#define PWMS WORD_REF(PWMS_ADDR)
629
630/*
631 * PWM Period Register
632 */
633#define PWMP_ADDR 0xfffff504
634#define PWMP BYTE_REF(PWMP_ADDR)
635
636/*
637 * PWM Counter Register
638 */
639#define PWMCNT_ADDR 0xfffff505
640#define PWMCNT BYTE_REF(PWMCNT_ADDR)
641
642/**********
643 *
644 * 0xFFFFF6xx -- General-Purpose Timer
645 *
646 **********/
647
648/*
649 * Timer Control register
650 */
651#define TCTL_ADDR 0xfffff600
652#define TCTL WORD_REF(TCTL_ADDR)
653
654#define TCTL_TEN 0x0001 /* Timer Enable */
655#define TCTL_CLKSOURCE_MASK 0x000e /* Clock Source: */
656#define TCTL_CLKSOURCE_STOP 0x0000 /* Stop count (disabled) */
657#define TCTL_CLKSOURCE_SYSCLK 0x0002 /* SYSCLK to prescaler */
658#define TCTL_CLKSOURCE_SYSCLK_16 0x0004 /* SYSCLK/16 to prescaler */
659#define TCTL_CLKSOURCE_TIN 0x0006 /* TIN to prescaler */
660#define TCTL_CLKSOURCE_32KHZ 0x0008 /* 32kHz clock to prescaler */
661#define TCTL_IRQEN 0x0010 /* IRQ Enable */
662#define TCTL_OM 0x0020 /* Output Mode */
663#define TCTL_CAP_MASK 0x00c0 /* Capture Edge: */
664#define TCTL_CAP_RE 0x0040 /* Capture on rizing edge */
665#define TCTL_CAP_FE 0x0080 /* Capture on falling edge */
666#define TCTL_FRR 0x0010 /* Free-Run Mode */
667
668/* '328-compatible definitions */
669#define TCTL1_ADDR TCTL_ADDR
670#define TCTL1 TCTL
671
672/*
673 * Timer Prescaler Register
674 */
675#define TPRER_ADDR 0xfffff602
676#define TPRER WORD_REF(TPRER_ADDR)
677
678/* '328-compatible definitions */
679#define TPRER1_ADDR TPRER_ADDR
680#define TPRER1 TPRER
681
682/*
683 * Timer Compare Register
684 */
685#define TCMP_ADDR 0xfffff604
686#define TCMP WORD_REF(TCMP_ADDR)
687
688/* '328-compatible definitions */
689#define TCMP1_ADDR TCMP_ADDR
690#define TCMP1 TCMP
691
692/*
693 * Timer Capture register
694 */
695#define TCR_ADDR 0xfffff606
696#define TCR WORD_REF(TCR_ADDR)
697
698/* '328-compatible definitions */
699#define TCR1_ADDR TCR_ADDR
700#define TCR1 TCR
701
702/*
703 * Timer Counter Register
704 */
705#define TCN_ADDR 0xfffff608
706#define TCN WORD_REF(TCN_ADDR)
707
708/* '328-compatible definitions */
709#define TCN1_ADDR TCN_ADDR
710#define TCN1 TCN
711
712/*
713 * Timer Status Register
714 */
715#define TSTAT_ADDR 0xfffff60a
716#define TSTAT WORD_REF(TSTAT_ADDR)
717
718#define TSTAT_COMP 0x0001 /* Compare Event occurred */
719#define TSTAT_CAPT 0x0001 /* Capture Event occurred */
720
721/* '328-compatible definitions */
722#define TSTAT1_ADDR TSTAT_ADDR
723#define TSTAT1 TSTAT
724
725/**********
726 *
727 * 0xFFFFF8xx -- Serial Periferial Interface Master (SPIM)
728 *
729 **********/
730
731/*
732 * SPIM Data Register
733 */
734#define SPIMDATA_ADDR 0xfffff800
735#define SPIMDATA WORD_REF(SPIMDATA_ADDR)
736
737/*
738 * SPIM Control/Status Register
739 */
740#define SPIMCONT_ADDR 0xfffff802
741#define SPIMCONT WORD_REF(SPIMCONT_ADDR)
742
743#define SPIMCONT_BIT_COUNT_MASK 0x000f /* Transfer Length in Bytes */
744#define SPIMCONT_BIT_COUNT_SHIFT 0
745#define SPIMCONT_POL 0x0010 /* SPMCLK Signel Polarity */
746#define SPIMCONT_PHA 0x0020 /* Clock/Data phase relationship */
747#define SPIMCONT_IRQEN 0x0040 /* IRQ Enable */
748#define SPIMCONT_IRQ 0x0080 /* Interrupt Request */
749#define SPIMCONT_XCH 0x0100 /* Exchange */
750#define SPIMCONT_ENABLE 0x0200 /* Enable SPIM */
751#define SPIMCONT_DATA_RATE_MASK 0xe000 /* SPIM Data Rate */
752#define SPIMCONT_DATA_RATE_SHIFT 13
753
754/* '328-compatible definitions */
755#define SPIMCONT_SPIMIRQ SPIMCONT_IRQ
756#define SPIMCONT_SPIMEN SPIMCONT_ENABLE
757
758/**********
759 *
760 * 0xFFFFF9xx -- UART
761 *
762 **********/
763
764/*
765 * UART Status/Control Register
766 */
767
768#define USTCNT_ADDR 0xfffff900
769#define USTCNT WORD_REF(USTCNT_ADDR)
770
771#define USTCNT_TXAE 0x0001 /* Transmitter Available Interrupt Enable */
772#define USTCNT_TXHE 0x0002 /* Transmitter Half Empty Enable */
773#define USTCNT_TXEE 0x0004 /* Transmitter Empty Interrupt Enable */
774#define USTCNT_RXRE 0x0008 /* Receiver Ready Interrupt Enable */
775#define USTCNT_RXHE 0x0010 /* Receiver Half-Full Interrupt Enable */
776#define USTCNT_RXFE 0x0020 /* Receiver Full Interrupt Enable */
777#define USTCNT_CTSD 0x0040 /* CTS Delta Interrupt Enable */
778#define USTCNT_ODEN 0x0080 /* Old Data Interrupt Enable */
779#define USTCNT_8_7 0x0100 /* Eight or seven-bit transmission */
780#define USTCNT_STOP 0x0200 /* Stop bit transmission */
781#define USTCNT_ODD 0x0400 /* Odd Parity */
782#define USTCNT_PEN 0x0800 /* Parity Enable */
783#define USTCNT_CLKM 0x1000 /* Clock Mode Select */
784#define USTCNT_TXEN 0x2000 /* Transmitter Enable */
785#define USTCNT_RXEN 0x4000 /* Receiver Enable */
786#define USTCNT_UEN 0x8000 /* UART Enable */
787
788/* '328-compatible definitions */
789#define USTCNT_TXAVAILEN USTCNT_TXAE
790#define USTCNT_TXHALFEN USTCNT_TXHE
791#define USTCNT_TXEMPTYEN USTCNT_TXEE
792#define USTCNT_RXREADYEN USTCNT_RXRE
793#define USTCNT_RXHALFEN USTCNT_RXHE
794#define USTCNT_RXFULLEN USTCNT_RXFE
795#define USTCNT_CTSDELTAEN USTCNT_CTSD
796#define USTCNT_ODD_EVEN USTCNT_ODD
797#define USTCNT_PARITYEN USTCNT_PEN
798#define USTCNT_CLKMODE USTCNT_CLKM
799#define USTCNT_UARTEN USTCNT_UEN
800
801/*
802 * UART Baud Control Register
803 */
804#define UBAUD_ADDR 0xfffff902
805#define UBAUD WORD_REF(UBAUD_ADDR)
806
807#define UBAUD_PRESCALER_MASK 0x003f /* Actual divisor is 65 - PRESCALER */
808#define UBAUD_PRESCALER_SHIFT 0
809#define UBAUD_DIVIDE_MASK 0x0700 /* Baud Rate freq. divizor */
810#define UBAUD_DIVIDE_SHIFT 8
811#define UBAUD_BAUD_SRC 0x0800 /* Baud Rate Source */
812#define UBAUD_UCLKDIR 0x2000 /* UCLK Direction */
813
814/*
815 * UART Receiver Register
816 */
817#define URX_ADDR 0xfffff904
818#define URX WORD_REF(URX_ADDR)
819
820#define URX_RXDATA_ADDR 0xfffff905
821#define URX_RXDATA BYTE_REF(URX_RXDATA_ADDR)
822
823#define URX_RXDATA_MASK 0x00ff /* Received data */
824#define URX_RXDATA_SHIFT 0
825#define URX_PARITY_ERROR 0x0100 /* Parity Error */
826#define URX_BREAK 0x0200 /* Break Detected */
827#define URX_FRAME_ERROR 0x0400 /* Framing Error */
828#define URX_OVRUN 0x0800 /* Serial Overrun */
829#define URX_OLD_DATA 0x1000 /* Old data in FIFO */
830#define URX_DATA_READY 0x2000 /* Data Ready (FIFO not empty) */
831#define URX_FIFO_HALF 0x4000 /* FIFO is Half-Full */
832#define URX_FIFO_FULL 0x8000 /* FIFO is Full */
833
834/*
835 * UART Transmitter Register
836 */
837#define UTX_ADDR 0xfffff906
838#define UTX WORD_REF(UTX_ADDR)
839
840#define UTX_TXDATA_ADDR 0xfffff907
841#define UTX_TXDATA BYTE_REF(UTX_TXDATA_ADDR)
842
843#define UTX_TXDATA_MASK 0x00ff /* Data to be transmitted */
844#define UTX_TXDATA_SHIFT 0
845#define UTX_CTS_DELTA 0x0100 /* CTS changed */
846#define UTX_CTS_STAT 0x0200 /* CTS State */
847#define UTX_BUSY 0x0400 /* FIFO is busy, sending a character */
848#define UTX_NOCTS 0x0800 /* Ignore CTS */
849#define UTX_SEND_BREAK 0x1000 /* Send a BREAK */
850#define UTX_TX_AVAIL 0x2000 /* Transmit FIFO has a slot available */
851#define UTX_FIFO_HALF 0x4000 /* Transmit FIFO is half empty */
852#define UTX_FIFO_EMPTY 0x8000 /* Transmit FIFO is empty */
853
854/* '328-compatible definitions */
855#define UTX_CTS_STATUS UTX_CTS_STAT
856#define UTX_IGNORE_CTS UTX_NOCTS
857
858/*
859 * UART Miscellaneous Register
860 */
861#define UMISC_ADDR 0xfffff908
862#define UMISC WORD_REF(UMISC_ADDR)
863
864#define UMISC_TX_POL 0x0004 /* Transmit Polarity */
865#define UMISC_RX_POL 0x0008 /* Receive Polarity */
866#define UMISC_IRDA_LOOP 0x0010 /* IrDA Loopback Enable */
867#define UMISC_IRDA_EN 0x0020 /* Infra-Red Enable */
868#define UMISC_RTS 0x0040 /* Set RTS status */
869#define UMISC_RTSCONT 0x0080 /* Choose RTS control */
870#define UMISC_IR_TEST 0x0400 /* IRDA Test Enable */
871#define UMISC_BAUD_RESET 0x0800 /* Reset Baud Rate Generation Counters */
872#define UMISC_LOOP 0x1000 /* Serial Loopback Enable */
873#define UMISC_FORCE_PERR 0x2000 /* Force Parity Error */
874#define UMISC_CLKSRC 0x4000 /* Clock Source */
875#define UMISC_BAUD_TEST 0x8000 /* Enable Baud Test Mode */
876
877/*
878 * UART Non-integer Prescaler Register
879 */
880#define NIPR_ADDR 0xfffff90a
881#define NIPR WORD_REF(NIPR_ADDR)
882
883#define NIPR_STEP_VALUE_MASK 0x00ff /* NI prescaler step value */
884#define NIPR_STEP_VALUE_SHIFT 0
885#define NIPR_SELECT_MASK 0x0700 /* Tap Selection */
886#define NIPR_SELECT_SHIFT 8
887#define NIPR_PRE_SEL 0x8000 /* Non-integer prescaler select */
888
889
890/* generalization of uart control registers to support multiple ports: */
891typedef struct {
892 volatile unsigned short int ustcnt;
893 volatile unsigned short int ubaud;
894 union {
895 volatile unsigned short int w;
896 struct {
897 volatile unsigned char status;
898 volatile unsigned char rxdata;
899 } b;
900 } urx;
901 union {
902 volatile unsigned short int w;
903 struct {
904 volatile unsigned char status;
905 volatile unsigned char txdata;
906 } b;
907 } utx;
908 volatile unsigned short int umisc;
909 volatile unsigned short int nipr;
910 volatile unsigned short int hmark;
911 volatile unsigned short int unused;
912} m68328_uart __attribute__((packed));
913
914
915
916
917/**********
918 *
919 * 0xFFFFFAxx -- LCD Controller
920 *
921 **********/
922
923/*
924 * LCD Screen Starting Address Register
925 */
926#define LSSA_ADDR 0xfffffa00
927#define LSSA LONG_REF(LSSA_ADDR)
928
929#define LSSA_SSA_MASK 0x1ffffffe /* Bits 0 and 29-31 are reserved */
930
931/*
932 * LCD Virtual Page Width Register
933 */
934#define LVPW_ADDR 0xfffffa05
935#define LVPW BYTE_REF(LVPW_ADDR)
936
937/*
938 * LCD Screen Width Register (not compatible with '328 !!!)
939 */
940#define LXMAX_ADDR 0xfffffa08
941#define LXMAX WORD_REF(LXMAX_ADDR)
942
943#define LXMAX_XM_MASK 0x02f0 /* Bits 0-3 and 10-15 are reserved */
944
945/*
946 * LCD Screen Height Register
947 */
948#define LYMAX_ADDR 0xfffffa0a
949#define LYMAX WORD_REF(LYMAX_ADDR)
950
951#define LYMAX_YM_MASK 0x01ff /* Bits 9-15 are reserved */
952
953/*
954 * LCD Cursor X Position Register
955 */
956#define LCXP_ADDR 0xfffffa18
957#define LCXP WORD_REF(LCXP_ADDR)
958
959#define LCXP_CC_MASK 0xc000 /* Cursor Control */
960#define LCXP_CC_TRAMSPARENT 0x0000
961#define LCXP_CC_BLACK 0x4000
962#define LCXP_CC_REVERSED 0x8000
963#define LCXP_CC_WHITE 0xc000
964#define LCXP_CXP_MASK 0x02ff /* Cursor X position */
965
966/*
967 * LCD Cursor Y Position Register
968 */
969#define LCYP_ADDR 0xfffffa1a
970#define LCYP WORD_REF(LCYP_ADDR)
971
972#define LCYP_CYP_MASK 0x01ff /* Cursor Y Position */
973
974/*
975 * LCD Cursor Width and Heigth Register
976 */
977#define LCWCH_ADDR 0xfffffa1c
978#define LCWCH WORD_REF(LCWCH_ADDR)
979
980#define LCWCH_CH_MASK 0x001f /* Cursor Height */
981#define LCWCH_CH_SHIFT 0
982#define LCWCH_CW_MASK 0x1f00 /* Cursor Width */
983#define LCWCH_CW_SHIFT 8
984
985/*
986 * LCD Blink Control Register
987 */
988#define LBLKC_ADDR 0xfffffa1f
989#define LBLKC BYTE_REF(LBLKC_ADDR)
990
991#define LBLKC_BD_MASK 0x7f /* Blink Divisor */
992#define LBLKC_BD_SHIFT 0
993#define LBLKC_BKEN 0x80 /* Blink Enabled */
994
995/*
996 * LCD Panel Interface Configuration Register
997 */
998#define LPICF_ADDR 0xfffffa20
999#define LPICF BYTE_REF(LPICF_ADDR)
1000
1001#define LPICF_GS_MASK 0x03 /* Gray-Scale Mode */
1002#define LPICF_GS_BW 0x00
1003#define LPICF_GS_GRAY_4 0x01
1004#define LPICF_GS_GRAY_16 0x02
1005#define LPICF_PBSIZ_MASK 0x0c /* Panel Bus Width */
1006#define LPICF_PBSIZ_1 0x00
1007#define LPICF_PBSIZ_2 0x04
1008#define LPICF_PBSIZ_4 0x08
1009
1010/*
1011 * LCD Polarity Configuration Register
1012 */
1013#define LPOLCF_ADDR 0xfffffa21
1014#define LPOLCF BYTE_REF(LPOLCF_ADDR)
1015
1016#define LPOLCF_PIXPOL 0x01 /* Pixel Polarity */
1017#define LPOLCF_LPPOL 0x02 /* Line Pulse Polarity */
1018#define LPOLCF_FLMPOL 0x04 /* Frame Marker Polarity */
1019#define LPOLCF_LCKPOL 0x08 /* LCD Shift Lock Polarity */
1020
1021/*
1022 * LACD (LCD Alternate Crystal Direction) Rate Control Register
1023 */
1024#define LACDRC_ADDR 0xfffffa23
1025#define LACDRC BYTE_REF(LACDRC_ADDR)
1026
1027#define LACDRC_ACDSLT 0x80 /* Signal Source Select */
1028#define LACDRC_ACD_MASK 0x0f /* Alternate Crystal Direction Control */
1029#define LACDRC_ACD_SHIFT 0
1030
1031/*
1032 * LCD Pixel Clock Divider Register
1033 */
1034#define LPXCD_ADDR 0xfffffa25
1035#define LPXCD BYTE_REF(LPXCD_ADDR)
1036
1037#define LPXCD_PCD_MASK 0x3f /* Pixel Clock Divider */
1038#define LPXCD_PCD_SHIFT 0
1039
1040/*
1041 * LCD Clocking Control Register
1042 */
1043#define LCKCON_ADDR 0xfffffa27
1044#define LCKCON BYTE_REF(LCKCON_ADDR)
1045
1046#define LCKCON_DWS_MASK 0x0f /* Display Wait-State */
1047#define LCKCON_DWS_SHIFT 0
1048#define LCKCON_DWIDTH 0x40 /* Display Memory Width */
1049#define LCKCON_LCDON 0x80 /* Enable LCD Controller */
1050
1051/* '328-compatible definitions */
1052#define LCKCON_DW_MASK LCKCON_DWS_MASK
1053#define LCKCON_DW_SHIFT LCKCON_DWS_SHIFT
1054
1055/*
1056 * LCD Refresh Rate Adjustment Register
1057 */
1058#define LRRA_ADDR 0xfffffa29
1059#define LRRA BYTE_REF(LRRA_ADDR)
1060
1061/*
1062 * LCD Panning Offset Register
1063 */
1064#define LPOSR_ADDR 0xfffffa2d
1065#define LPOSR BYTE_REF(LPOSR_ADDR)
1066
1067#define LPOSR_POS_MASK 0x0f /* Pixel Offset Code */
1068#define LPOSR_POS_SHIFT 0
1069
1070/*
1071 * LCD Frame Rate Control Modulation Register
1072 */
1073#define LFRCM_ADDR 0xfffffa31
1074#define LFRCM BYTE_REF(LFRCM_ADDR)
1075
1076#define LFRCM_YMOD_MASK 0x0f /* Vertical Modulation */
1077#define LFRCM_YMOD_SHIFT 0
1078#define LFRCM_XMOD_MASK 0xf0 /* Horizontal Modulation */
1079#define LFRCM_XMOD_SHIFT 4
1080
1081/*
1082 * LCD Gray Palette Mapping Register
1083 */
1084#define LGPMR_ADDR 0xfffffa33
1085#define LGPMR BYTE_REF(LGPMR_ADDR)
1086
1087#define LGPMR_G1_MASK 0x0f
1088#define LGPMR_G1_SHIFT 0
1089#define LGPMR_G2_MASK 0xf0
1090#define LGPMR_G2_SHIFT 4
1091
1092/*
1093 * PWM Contrast Control Register
1094 */
1095#define PWMR_ADDR 0xfffffa36
1096#define PWMR WORD_REF(PWMR_ADDR)
1097
1098#define PWMR_PW_MASK 0x00ff /* Pulse Width */
1099#define PWMR_PW_SHIFT 0
1100#define PWMR_CCPEN 0x0100 /* Contrast Control Enable */
1101#define PWMR_SRC_MASK 0x0600 /* Input Clock Source */
1102#define PWMR_SRC_LINE 0x0000 /* Line Pulse */
1103#define PWMR_SRC_PIXEL 0x0200 /* Pixel Clock */
1104#define PWMR_SRC_LCD 0x4000 /* LCD clock */
1105
1106/**********
1107 *
1108 * 0xFFFFFBxx -- Real-Time Clock (RTC)
1109 *
1110 **********/
1111
1112/*
1113 * RTC Hours Minutes and Seconds Register
1114 */
1115#define RTCTIME_ADDR 0xfffffb00
1116#define RTCTIME LONG_REF(RTCTIME_ADDR)
1117
1118#define RTCTIME_SECONDS_MASK 0x0000003f /* Seconds */
1119#define RTCTIME_SECONDS_SHIFT 0
1120#define RTCTIME_MINUTES_MASK 0x003f0000 /* Minutes */
1121#define RTCTIME_MINUTES_SHIFT 16
1122#define RTCTIME_HOURS_MASK 0x1f000000 /* Hours */
1123#define RTCTIME_HOURS_SHIFT 24
1124
1125/*
1126 * RTC Alarm Register
1127 */
1128#define RTCALRM_ADDR 0xfffffb04
1129#define RTCALRM LONG_REF(RTCALRM_ADDR)
1130
1131#define RTCALRM_SECONDS_MASK 0x0000003f /* Seconds */
1132#define RTCALRM_SECONDS_SHIFT 0
1133#define RTCALRM_MINUTES_MASK 0x003f0000 /* Minutes */
1134#define RTCALRM_MINUTES_SHIFT 16
1135#define RTCALRM_HOURS_MASK 0x1f000000 /* Hours */
1136#define RTCALRM_HOURS_SHIFT 24
1137
1138/*
1139 * Watchdog Timer Register
1140 */
1141#define WATCHDOG_ADDR 0xfffffb0a
1142#define WATCHDOG WORD_REF(WATCHDOG_ADDR)
1143
1144#define WATCHDOG_EN 0x0001 /* Watchdog Enabled */
1145#define WATCHDOG_ISEL 0x0002 /* Select the watchdog interrupt */
1146#define WATCHDOG_INTF 0x0080 /* Watchdog interrupt occcured */
1147#define WATCHDOG_CNT_MASK 0x0300 /* Watchdog Counter */
1148#define WATCHDOG_CNT_SHIFT 8
1149
1150/*
1151 * RTC Control Register
1152 */
1153#define RTCCTL_ADDR 0xfffffb0c
1154#define RTCCTL WORD_REF(RTCCTL_ADDR)
1155
1156#define RTCCTL_XTL 0x0020 /* Crystal Selection */
1157#define RTCCTL_EN 0x0080 /* RTC Enable */
1158
1159/* '328-compatible definitions */
1160#define RTCCTL_384 RTCCTL_XTL
1161#define RTCCTL_ENABLE RTCCTL_EN
1162
1163/*
1164 * RTC Interrupt Status Register
1165 */
1166#define RTCISR_ADDR 0xfffffb0e
1167#define RTCISR WORD_REF(RTCISR_ADDR)
1168
1169#define RTCISR_SW 0x0001 /* Stopwatch timed out */
1170#define RTCISR_MIN 0x0002 /* 1-minute interrupt has occurred */
1171#define RTCISR_ALM 0x0004 /* Alarm interrupt has occurred */
1172#define RTCISR_DAY 0x0008 /* 24-hour rollover interrupt has occurred */
1173#define RTCISR_1HZ 0x0010 /* 1Hz interrupt has occurred */
1174#define RTCISR_HR 0x0020 /* 1-hour interrupt has occurred */
1175#define RTCISR_SAM0 0x0100 /* 4Hz / 4.6875Hz interrupt has occurred */
1176#define RTCISR_SAM1 0x0200 /* 8Hz / 9.3750Hz interrupt has occurred */
1177#define RTCISR_SAM2 0x0400 /* 16Hz / 18.7500Hz interrupt has occurred */
1178#define RTCISR_SAM3 0x0800 /* 32Hz / 37.5000Hz interrupt has occurred */
1179#define RTCISR_SAM4 0x1000 /* 64Hz / 75.0000Hz interrupt has occurred */
1180#define RTCISR_SAM5 0x2000 /* 128Hz / 150.0000Hz interrupt has occurred */
1181#define RTCISR_SAM6 0x4000 /* 256Hz / 300.0000Hz interrupt has occurred */
1182#define RTCISR_SAM7 0x8000 /* 512Hz / 600.0000Hz interrupt has occurred */
1183
1184/*
1185 * RTC Interrupt Enable Register
1186 */
1187#define RTCIENR_ADDR 0xfffffb10
1188#define RTCIENR WORD_REF(RTCIENR_ADDR)
1189
1190#define RTCIENR_SW 0x0001 /* Stopwatch interrupt enable */
1191#define RTCIENR_MIN 0x0002 /* 1-minute interrupt enable */
1192#define RTCIENR_ALM 0x0004 /* Alarm interrupt enable */
1193#define RTCIENR_DAY 0x0008 /* 24-hour rollover interrupt enable */
1194#define RTCIENR_1HZ 0x0010 /* 1Hz interrupt enable */
1195#define RTCIENR_HR 0x0020 /* 1-hour interrupt enable */
1196#define RTCIENR_SAM0 0x0100 /* 4Hz / 4.6875Hz interrupt enable */
1197#define RTCIENR_SAM1 0x0200 /* 8Hz / 9.3750Hz interrupt enable */
1198#define RTCIENR_SAM2 0x0400 /* 16Hz / 18.7500Hz interrupt enable */
1199#define RTCIENR_SAM3 0x0800 /* 32Hz / 37.5000Hz interrupt enable */
1200#define RTCIENR_SAM4 0x1000 /* 64Hz / 75.0000Hz interrupt enable */
1201#define RTCIENR_SAM5 0x2000 /* 128Hz / 150.0000Hz interrupt enable */
1202#define RTCIENR_SAM6 0x4000 /* 256Hz / 300.0000Hz interrupt enable */
1203#define RTCIENR_SAM7 0x8000 /* 512Hz / 600.0000Hz interrupt enable */
1204
1205/*
1206 * Stopwatch Minutes Register
1207 */
1208#define STPWCH_ADDR 0xfffffb12
1209#define STPWCH WORD_REF(STPWCH_ADDR)
1210
1211#define STPWCH_CNT_MASK 0x003f /* Stopwatch countdown value */
1212#define SPTWCH_CNT_SHIFT 0
1213
1214/*
1215 * RTC Day Count Register
1216 */
1217#define DAYR_ADDR 0xfffffb1a
1218#define DAYR WORD_REF(DAYR_ADDR)
1219
1220#define DAYR_DAYS_MASK 0x1ff /* Day Setting */
1221#define DAYR_DAYS_SHIFT 0
1222
1223/*
1224 * RTC Day Alarm Register
1225 */
1226#define DAYALARM_ADDR 0xfffffb1c
1227#define DAYALARM WORD_REF(DAYALARM_ADDR)
1228
1229#define DAYALARM_DAYSAL_MASK 0x01ff /* Day Setting of the Alarm */
1230#define DAYALARM_DAYSAL_SHIFT 0
1231
1232/**********
1233 *
1234 * 0xFFFFFCxx -- DRAM Controller
1235 *
1236 **********/
1237
1238/*
1239 * DRAM Memory Configuration Register
1240 */
1241#define DRAMMC_ADDR 0xfffffc00
1242#define DRAMMC WORD_REF(DRAMMC_ADDR)
1243
1244#define DRAMMC_ROW12_MASK 0xc000 /* Row address bit for MD12 */
1245#define DRAMMC_ROW12_PA10 0x0000
1246#define DRAMMC_ROW12_PA21 0x4000
1247#define DRAMMC_ROW12_PA23 0x8000
1248#define DRAMMC_ROW0_MASK 0x3000 /* Row address bit for MD0 */
1249#define DRAMMC_ROW0_PA11 0x0000
1250#define DRAMMC_ROW0_PA22 0x1000
1251#define DRAMMC_ROW0_PA23 0x2000
1252#define DRAMMC_ROW11 0x0800 /* Row address bit for MD11 PA20/PA22 */
1253#define DRAMMC_ROW10 0x0400 /* Row address bit for MD10 PA19/PA21 */
1254#define DRAMMC_ROW9 0x0200 /* Row address bit for MD9 PA9/PA19 */
1255#define DRAMMC_ROW8 0x0100 /* Row address bit for MD8 PA10/PA20 */
1256#define DRAMMC_COL10 0x0080 /* Col address bit for MD10 PA11/PA0 */
1257#define DRAMMC_COL9 0x0040 /* Col address bit for MD9 PA10/PA0 */
1258#define DRAMMC_COL8 0x0020 /* Col address bit for MD8 PA9/PA0 */
1259#define DRAMMC_REF_MASK 0x001f /* Reresh Cycle */
1260#define DRAMMC_REF_SHIFT 0
1261
1262/*
1263 * DRAM Control Register
1264 */
1265#define DRAMC_ADDR 0xfffffc02
1266#define DRAMC WORD_REF(DRAMC_ADDR)
1267
1268#define DRAMC_DWE 0x0001 /* DRAM Write Enable */
1269#define DRAMC_RST 0x0002 /* Reset Burst Refresh Enable */
1270#define DRAMC_LPR 0x0004 /* Low-Power Refresh Enable */
1271#define DRAMC_SLW 0x0008 /* Slow RAM */
1272#define DRAMC_LSP 0x0010 /* Light Sleep */
1273#define DRAMC_MSW 0x0020 /* Slow Multiplexing */
1274#define DRAMC_WS_MASK 0x00c0 /* Wait-states */
1275#define DRAMC_WS_SHIFT 6
1276#define DRAMC_PGSZ_MASK 0x0300 /* Page Size for fast page mode */
1277#define DRAMC_PGSZ_SHIFT 8
1278#define DRAMC_PGSZ_256K 0x0000
1279#define DRAMC_PGSZ_512K 0x0100
1280#define DRAMC_PGSZ_1024K 0x0200
1281#define DRAMC_PGSZ_2048K 0x0300
1282#define DRAMC_EDO 0x0400 /* EDO DRAM */
1283#define DRAMC_CLK 0x0800 /* Refresh Timer Clock source select */
1284#define DRAMC_BC_MASK 0x3000 /* Page Access Clock Cycle (FP mode) */
1285#define DRAMC_BC_SHIFT 12
1286#define DRAMC_RM 0x4000 /* Refresh Mode */
1287#define DRAMC_EN 0x8000 /* DRAM Controller enable */
1288
1289
1290/**********
1291 *
1292 * 0xFFFFFDxx -- In-Circuit Emulation (ICE)
1293 *
1294 **********/
1295
1296/*
1297 * ICE Module Address Compare Register
1298 */
1299#define ICEMACR_ADDR 0xfffffd00
1300#define ICEMACR LONG_REF(ICEMACR_ADDR)
1301
1302/*
1303 * ICE Module Address Mask Register
1304 */
1305#define ICEMAMR_ADDR 0xfffffd04
1306#define ICEMAMR LONG_REF(ICEMAMR_ADDR)
1307
1308/*
1309 * ICE Module Control Compare Register
1310 */
1311#define ICEMCCR_ADDR 0xfffffd08
1312#define ICEMCCR WORD_REF(ICEMCCR_ADDR)
1313
1314#define ICEMCCR_PD 0x0001 /* Program/Data Cycle Selection */
1315#define ICEMCCR_RW 0x0002 /* Read/Write Cycle Selection */
1316
1317/*
1318 * ICE Module Control Mask Register
1319 */
1320#define ICEMCMR_ADDR 0xfffffd0a
1321#define ICEMCMR WORD_REF(ICEMCMR_ADDR)
1322
1323#define ICEMCMR_PDM 0x0001 /* Program/Data Cycle Mask */
1324#define ICEMCMR_RWM 0x0002 /* Read/Write Cycle Mask */
1325
1326/*
1327 * ICE Module Control Register
1328 */
1329#define ICEMCR_ADDR 0xfffffd0c
1330#define ICEMCR WORD_REF(ICEMCR_ADDR)
1331
1332#define ICEMCR_CEN 0x0001 /* Compare Enable */
1333#define ICEMCR_PBEN 0x0002 /* Program Break Enable */
1334#define ICEMCR_SB 0x0004 /* Single Breakpoint */
1335#define ICEMCR_HMDIS 0x0008 /* HardMap disable */
1336#define ICEMCR_BBIEN 0x0010 /* Bus Break Interrupt Enable */
1337
1338/*
1339 * ICE Module Status Register
1340 */
1341#define ICEMSR_ADDR 0xfffffd0e
1342#define ICEMSR WORD_REF(ICEMSR_ADDR)
1343
1344#define ICEMSR_EMUEN 0x0001 /* Emulation Enable */
1345#define ICEMSR_BRKIRQ 0x0002 /* A-Line Vector Fetch Detected */
1346#define ICEMSR_BBIRQ 0x0004 /* Bus Break Interrupt Detected */
1347#define ICEMSR_EMIRQ 0x0008 /* EMUIRQ Falling Edge Detected */
1348
1349#endif /* _MC68VZ328_H_ */
diff --git a/include/asm-m68knommu/a.out.h b/include/asm-m68knommu/a.out.h
new file mode 100644
index 000000000000..ce18ef99de04
--- /dev/null
+++ b/include/asm-m68knommu/a.out.h
@@ -0,0 +1 @@
#include <asm-m68k/a.out.h>
diff --git a/include/asm-m68knommu/anchor.h b/include/asm-m68knommu/anchor.h
new file mode 100644
index 000000000000..75390e0b40c9
--- /dev/null
+++ b/include/asm-m68knommu/anchor.h
@@ -0,0 +1,112 @@
1/****************************************************************************/
2
3/*
4 * anchor.h -- Anchor CO-MEM Lite PCI host bridge part.
5 *
6 * (C) Copyright 2000, Moreton Bay (www.moreton.com.au)
7 */
8
9/****************************************************************************/
10#ifndef anchor_h
11#define anchor_h
12/****************************************************************************/
13
14/*
15 * Define basic addressing info.
16 */
17#if defined(CONFIG_MOTOROLA) && defined(CONFIG_M5407)
18#define COMEM_BASE 0xFFFF0000 /* Base of CO-MEM address space */
19#define COMEM_IRQ 25 /* IRQ of anchor part */
20#else
21#define COMEM_BASE 0x80000000 /* Base of CO-MEM address space */
22#define COMEM_IRQ 25 /* IRQ of anchor part */
23#endif
24
25/****************************************************************************/
26
27/*
28 * 4-byte registers of CO-MEM, so adjust register addresses for
29 * easy access. Handy macro for word access too.
30 */
31#define LREG(a) ((a) >> 2)
32#define WREG(a) ((a) >> 1)
33
34
35/*
36 * Define base addresses within CO-MEM Lite register address space.
37 */
38#define COMEM_I2O 0x0000 /* I2O registers */
39#define COMEM_OPREGS 0x0400 /* Operation registers */
40#define COMEM_PCIBUS 0x2000 /* Direct access to PCI bus */
41#define COMEM_SHMEM 0x4000 /* Shared memory region */
42
43#define COMEM_SHMEMSIZE 0x4000 /* Size of shared memory */
44
45
46/*
47 * Define CO-MEM Registers.
48 */
49#define COMEM_I2OHISR 0x0030 /* I2O host interrupt status */
50#define COMEM_I2OHIMR 0x0034 /* I2O host interrupt mask */
51#define COMEM_I2OLISR 0x0038 /* I2O local interrupt status */
52#define COMEM_I2OLIMR 0x003c /* I2O local interrupt mask */
53#define COMEM_IBFPFIFO 0x0040 /* I2O inbound free/post FIFO */
54#define COMEM_OBPFFIFO 0x0044 /* I2O outbound post/free FIFO */
55#define COMEM_IBPFFIFO 0x0048 /* I2O inbound post/free FIFO */
56#define COMEM_OBFPFIFO 0x004c /* I2O outbound free/post FIFO */
57
58#define COMEM_DAHBASE 0x0460 /* Direct access base address */
59
60#define COMEM_NVCMD 0x04a0 /* I2C serial command */
61#define COMEM_NVREAD 0x04a4 /* I2C serial read */
62#define COMEM_NVSTAT 0x04a8 /* I2C status */
63
64#define COMEM_DMALBASE 0x04b0 /* DMA local base address */
65#define COMEM_DMAHBASE 0x04b4 /* DMA host base address */
66#define COMEM_DMASIZE 0x04b8 /* DMA size */
67#define COMEM_DMACTL 0x04bc /* DMA control */
68
69#define COMEM_HCTL 0x04e0 /* Host control */
70#define COMEM_HINT 0x04e4 /* Host interrupt control/status */
71#define COMEM_HLDATA 0x04e8 /* Host to local data mailbox */
72#define COMEM_LINT 0x04f4 /* Local interrupt contole status */
73#define COMEM_LHDATA 0x04f8 /* Local to host data mailbox */
74
75#define COMEM_LBUSCFG 0x04fc /* Local bus configuration */
76
77
78/*
79 * Commands and flags for use with Direct Access Register.
80 */
81#define COMEM_DA_IACK 0x00000000 /* Interrupt acknowledge (read) */
82#define COMEM_DA_SPCL 0x00000010 /* Special cycle (write) */
83#define COMEM_DA_MEMRD 0x00000004 /* Memory read cycle */
84#define COMEM_DA_MEMWR 0x00000004 /* Memory write cycle */
85#define COMEM_DA_IORD 0x00000002 /* I/O read cycle */
86#define COMEM_DA_IOWR 0x00000002 /* I/O write cycle */
87#define COMEM_DA_CFGRD 0x00000006 /* Configuration read cycle */
88#define COMEM_DA_CFGWR 0x00000006 /* Configuration write cycle */
89
90#define COMEM_DA_ADDR(a) ((a) & 0xffffe000)
91
92#define COMEM_DA_OFFSET(a) ((a) & 0x00001fff)
93
94
95/*
96 * The PCI bus will be limited in what slots will actually be used.
97 * Define valid device numbers for different boards.
98 */
99#if defined(CONFIG_MOTOROLA) && defined(CONFIG_M5407)
100#define COMEM_MINDEV 14 /* Minimum valid DEVICE */
101#define COMEM_MAXDEV 14 /* Maximum valid DEVICE */
102#define COMEM_BRIDGEDEV 15 /* Slot bridge is in */
103#else
104#define COMEM_MINDEV 0 /* Minimum valid DEVICE */
105#define COMEM_MAXDEV 3 /* Maximum valid DEVICE */
106#endif
107
108#define COMEM_MAXPCI (COMEM_MAXDEV+1) /* Maximum PCI devices */
109
110
111/****************************************************************************/
112#endif /* anchor_h */
diff --git a/include/asm-m68knommu/asm-offsets.h b/include/asm-m68knommu/asm-offsets.h
new file mode 100644
index 000000000000..825f6e210f19
--- /dev/null
+++ b/include/asm-m68knommu/asm-offsets.h
@@ -0,0 +1,49 @@
1#ifndef __ASM_OFFSETS_H__
2#define __ASM_OFFSETS_H__
3/*
4 * DO NOT MODIFY.
5 *
6 * This file was generated by arch/m68knommu/Makefile
7 *
8 */
9
10#define TASK_STATE 0 /* offsetof(struct task_struct, state) */
11#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */
12#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */
13#define TASK_BLOCKED 922 /* offsetof(struct task_struct, blocked) */
14#define TASK_THREAD 772 /* offsetof(struct task_struct, thread) */
15#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */
16#define TASK_MM 92 /* offsetof(struct task_struct, mm) */
17#define TASK_ACTIVE_MM 96 /* offsetof(struct task_struct, active_mm) */
18#define CPUSTAT_SOFTIRQ_PENDING 0 /* offsetof(irq_cpustat_t, __softirq_pending) */
19#define THREAD_KSP 0 /* offsetof(struct thread_struct, ksp) */
20#define THREAD_USP 4 /* offsetof(struct thread_struct, usp) */
21#define THREAD_SR 8 /* offsetof(struct thread_struct, sr) */
22#define THREAD_FS 10 /* offsetof(struct thread_struct, fs) */
23#define THREAD_CRP 12 /* offsetof(struct thread_struct, crp) */
24#define THREAD_ESP0 20 /* offsetof(struct thread_struct, esp0) */
25#define THREAD_FPREG 24 /* offsetof(struct thread_struct, fp) */
26#define THREAD_FPCNTL 120 /* offsetof(struct thread_struct, fpcntl) */
27#define THREAD_FPSTATE 132 /* offsetof(struct thread_struct, fpstate) */
28#define PT_D0 32 /* offsetof(struct pt_regs, d0) */
29#define PT_ORIG_D0 36 /* offsetof(struct pt_regs, orig_d0) */
30#define PT_D1 0 /* offsetof(struct pt_regs, d1) */
31#define PT_D2 4 /* offsetof(struct pt_regs, d2) */
32#define PT_D3 8 /* offsetof(struct pt_regs, d3) */
33#define PT_D4 12 /* offsetof(struct pt_regs, d4) */
34#define PT_D5 16 /* offsetof(struct pt_regs, d5) */
35#define PT_A0 20 /* offsetof(struct pt_regs, a0) */
36#define PT_A1 24 /* offsetof(struct pt_regs, a1) */
37#define PT_A2 28 /* offsetof(struct pt_regs, a2) */
38#define PT_PC 48 /* offsetof(struct pt_regs, pc) */
39#define PT_SR 46 /* offsetof(struct pt_regs, sr) */
40#define PT_VECTOR 52 /* offsetof(struct pt_regs, pc) + 4 */
41#define STAT_IRQ 5140 /* offsetof(struct kernel_stat, irqs) */
42#define SIGSEGV 11 /* SIGSEGV */
43#define SEGV_MAPERR 196609 /* SEGV_MAPERR */
44#define SIGTRAP 5 /* SIGTRAP */
45#define TRAP_TRACE 196610 /* TRAP_TRACE */
46#define PT_PTRACED 1 /* PT_PTRACED */
47#define PT_DTRACE 2 /* PT_DTRACE */
48
49#endif
diff --git a/include/asm-m68knommu/atomic.h b/include/asm-m68knommu/atomic.h
new file mode 100644
index 000000000000..b1957fba083b
--- /dev/null
+++ b/include/asm-m68knommu/atomic.h
@@ -0,0 +1,134 @@
1#ifndef __ARCH_M68KNOMMU_ATOMIC__
2#define __ARCH_M68KNOMMU_ATOMIC__
3
4#include <asm/system.h> /* local_irq_XXX() */
5
6/*
7 * Atomic operations that C can't guarantee us. Useful for
8 * resource counting etc..
9 */
10
11/*
12 * We do not have SMP m68k systems, so we don't have to deal with that.
13 */
14
15typedef struct { int counter; } atomic_t;
16#define ATOMIC_INIT(i) { (i) }
17
18#define atomic_read(v) ((v)->counter)
19#define atomic_set(v, i) (((v)->counter) = i)
20
21static __inline__ void atomic_add(int i, atomic_t *v)
22{
23#ifdef CONFIG_COLDFIRE
24 __asm__ __volatile__("addl %1,%0" : "+m" (*v) : "d" (i));
25#else
26 __asm__ __volatile__("addl %1,%0" : "+m" (*v) : "di" (i));
27#endif
28}
29
30static __inline__ void atomic_sub(int i, atomic_t *v)
31{
32#ifdef CONFIG_COLDFIRE
33 __asm__ __volatile__("subl %1,%0" : "+m" (*v) : "d" (i));
34#else
35 __asm__ __volatile__("subl %1,%0" : "+m" (*v) : "di" (i));
36#endif
37}
38
39static __inline__ int atomic_sub_and_test(int i, atomic_t * v)
40{
41 char c;
42#ifdef CONFIG_COLDFIRE
43 __asm__ __volatile__("subl %2,%1; seq %0"
44 : "=d" (c), "+m" (*v)
45 : "d" (i));
46#else
47 __asm__ __volatile__("subl %2,%1; seq %0"
48 : "=d" (c), "+m" (*v)
49 : "di" (i));
50#endif
51 return c != 0;
52}
53
54static __inline__ void atomic_inc(volatile atomic_t *v)
55{
56 __asm__ __volatile__("addql #1,%0" : "+m" (*v));
57}
58
59/*
60 * atomic_inc_and_test - increment and test
61 * @v: pointer of type atomic_t
62 *
63 * Atomically increments @v by 1
64 * and returns true if the result is zero, or false for all
65 * other cases.
66 */
67
68static __inline__ int atomic_inc_and_test(volatile atomic_t *v)
69{
70 char c;
71 __asm__ __volatile__("addql #1,%1; seq %0" : "=d" (c), "+m" (*v));
72 return c != 0;
73}
74
75static __inline__ void atomic_dec(volatile atomic_t *v)
76{
77 __asm__ __volatile__("subql #1,%0" : "+m" (*v));
78}
79
80static __inline__ int atomic_dec_and_test(volatile atomic_t *v)
81{
82 char c;
83 __asm__ __volatile__("subql #1,%1; seq %0" : "=d" (c), "+m" (*v));
84 return c != 0;
85}
86
87static __inline__ void atomic_clear_mask(unsigned long mask, unsigned long *v)
88{
89 __asm__ __volatile__("andl %1,%0" : "+m" (*v) : "id" (~(mask)));
90}
91
92static __inline__ void atomic_set_mask(unsigned long mask, unsigned long *v)
93{
94 __asm__ __volatile__("orl %1,%0" : "+m" (*v) : "id" (mask));
95}
96
97/* Atomic operations are already serializing */
98#define smp_mb__before_atomic_dec() barrier()
99#define smp_mb__after_atomic_dec() barrier()
100#define smp_mb__before_atomic_inc() barrier()
101#define smp_mb__after_atomic_inc() barrier()
102
103extern __inline__ int atomic_add_return(int i, atomic_t * v)
104{
105 unsigned long temp, flags;
106
107 local_irq_save(flags);
108 temp = *(long *)v;
109 temp += i;
110 *(long *)v = temp;
111 local_irq_restore(flags);
112
113 return temp;
114}
115
116#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
117
118extern __inline__ int atomic_sub_return(int i, atomic_t * v)
119{
120 unsigned long temp, flags;
121
122 local_irq_save(flags);
123 temp = *(long *)v;
124 temp -= i;
125 *(long *)v = temp;
126 local_irq_restore(flags);
127
128 return temp;
129}
130
131#define atomic_dec_return(v) atomic_sub_return(1,(v))
132#define atomic_inc_return(v) atomic_add_return(1,(v))
133
134#endif /* __ARCH_M68KNOMMU_ATOMIC __ */
diff --git a/include/asm-m68knommu/bitops.h b/include/asm-m68knommu/bitops.h
new file mode 100644
index 000000000000..f95e32b40425
--- /dev/null
+++ b/include/asm-m68knommu/bitops.h
@@ -0,0 +1,503 @@
1#ifndef _M68KNOMMU_BITOPS_H
2#define _M68KNOMMU_BITOPS_H
3
4/*
5 * Copyright 1992, Linus Torvalds.
6 */
7
8#include <linux/config.h>
9#include <linux/compiler.h>
10#include <asm/byteorder.h> /* swab32 */
11#include <asm/system.h> /* save_flags */
12
13#ifdef __KERNEL__
14
15/*
16 * Generic ffs().
17 */
18static inline int ffs(int x)
19{
20 int r = 1;
21
22 if (!x)
23 return 0;
24 if (!(x & 0xffff)) {
25 x >>= 16;
26 r += 16;
27 }
28 if (!(x & 0xff)) {
29 x >>= 8;
30 r += 8;
31 }
32 if (!(x & 0xf)) {
33 x >>= 4;
34 r += 4;
35 }
36 if (!(x & 3)) {
37 x >>= 2;
38 r += 2;
39 }
40 if (!(x & 1)) {
41 x >>= 1;
42 r += 1;
43 }
44 return r;
45}
46
47/*
48 * Generic __ffs().
49 */
50static inline int __ffs(int x)
51{
52 int r = 0;
53
54 if (!x)
55 return 0;
56 if (!(x & 0xffff)) {
57 x >>= 16;
58 r += 16;
59 }
60 if (!(x & 0xff)) {
61 x >>= 8;
62 r += 8;
63 }
64 if (!(x & 0xf)) {
65 x >>= 4;
66 r += 4;
67 }
68 if (!(x & 3)) {
69 x >>= 2;
70 r += 2;
71 }
72 if (!(x & 1)) {
73 x >>= 1;
74 r += 1;
75 }
76 return r;
77}
78
79/*
80 * Every architecture must define this function. It's the fastest
81 * way of searching a 140-bit bitmap where the first 100 bits are
82 * unlikely to be set. It's guaranteed that at least one of the 140
83 * bits is cleared.
84 */
85static inline int sched_find_first_bit(unsigned long *b)
86{
87 if (unlikely(b[0]))
88 return __ffs(b[0]);
89 if (unlikely(b[1]))
90 return __ffs(b[1]) + 32;
91 if (unlikely(b[2]))
92 return __ffs(b[2]) + 64;
93 if (b[3])
94 return __ffs(b[3]) + 96;
95 return __ffs(b[4]) + 128;
96}
97
98/*
99 * ffz = Find First Zero in word. Undefined if no zero exists,
100 * so code should check against ~0UL first..
101 */
102static __inline__ unsigned long ffz(unsigned long word)
103{
104 unsigned long result = 0;
105
106 while(word & 1) {
107 result++;
108 word >>= 1;
109 }
110 return result;
111}
112
113
114static __inline__ void set_bit(int nr, volatile unsigned long * addr)
115{
116#ifdef CONFIG_COLDFIRE
117 __asm__ __volatile__ ("lea %0,%%a0; bset %1,(%%a0)"
118 : "+m" (((volatile char *)addr)[(nr^31) >> 3])
119 : "d" (nr)
120 : "%a0", "cc");
121#else
122 __asm__ __volatile__ ("bset %1,%0"
123 : "+m" (((volatile char *)addr)[(nr^31) >> 3])
124 : "di" (nr)
125 : "cc");
126#endif
127}
128
129#define __set_bit(nr, addr) set_bit(nr, addr)
130
131/*
132 * clear_bit() doesn't provide any barrier for the compiler.
133 */
134#define smp_mb__before_clear_bit() barrier()
135#define smp_mb__after_clear_bit() barrier()
136
137static __inline__ void clear_bit(int nr, volatile unsigned long * addr)
138{
139#ifdef CONFIG_COLDFIRE
140 __asm__ __volatile__ ("lea %0,%%a0; bclr %1,(%%a0)"
141 : "+m" (((volatile char *)addr)[(nr^31) >> 3])
142 : "d" (nr)
143 : "%a0", "cc");
144#else
145 __asm__ __volatile__ ("bclr %1,%0"
146 : "+m" (((volatile char *)addr)[(nr^31) >> 3])
147 : "di" (nr)
148 : "cc");
149#endif
150}
151
152#define __clear_bit(nr, addr) clear_bit(nr, addr)
153
154static __inline__ void change_bit(int nr, volatile unsigned long * addr)
155{
156#ifdef CONFIG_COLDFIRE
157 __asm__ __volatile__ ("lea %0,%%a0; bchg %1,(%%a0)"
158 : "+m" (((volatile char *)addr)[(nr^31) >> 3])
159 : "d" (nr)
160 : "%a0", "cc");
161#else
162 __asm__ __volatile__ ("bchg %1,%0"
163 : "+m" (((volatile char *)addr)[(nr^31) >> 3])
164 : "di" (nr)
165 : "cc");
166#endif
167}
168
169#define __change_bit(nr, addr) change_bit(nr, addr)
170
171static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr)
172{
173 char retval;
174
175#ifdef CONFIG_COLDFIRE
176 __asm__ __volatile__ ("lea %1,%%a0; bset %2,(%%a0); sne %0"
177 : "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3])
178 : "d" (nr)
179 : "%a0");
180#else
181 __asm__ __volatile__ ("bset %2,%1; sne %0"
182 : "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3])
183 : "di" (nr)
184 /* No clobber */);
185#endif
186
187 return retval;
188}
189
190#define __test_and_set_bit(nr, addr) test_and_set_bit(nr, addr)
191
192static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr)
193{
194 char retval;
195
196#ifdef CONFIG_COLDFIRE
197 __asm__ __volatile__ ("lea %1,%%a0; bclr %2,(%%a0); sne %0"
198 : "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3])
199 : "d" (nr)
200 : "%a0");
201#else
202 __asm__ __volatile__ ("bclr %2,%1; sne %0"
203 : "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3])
204 : "di" (nr)
205 /* No clobber */);
206#endif
207
208 return retval;
209}
210
211#define __test_and_clear_bit(nr, addr) test_and_clear_bit(nr, addr)
212
213static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr)
214{
215 char retval;
216
217#ifdef CONFIG_COLDFIRE
218 __asm__ __volatile__ ("lea %1,%%a0\n\tbchg %2,(%%a0)\n\tsne %0"
219 : "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3])
220 : "d" (nr)
221 : "%a0");
222#else
223 __asm__ __volatile__ ("bchg %2,%1; sne %0"
224 : "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3])
225 : "di" (nr)
226 /* No clobber */);
227#endif
228
229 return retval;
230}
231
232#define __test_and_change_bit(nr, addr) test_and_change_bit(nr, addr)
233
234/*
235 * This routine doesn't need to be atomic.
236 */
237static __inline__ int __constant_test_bit(int nr, const volatile unsigned long * addr)
238{
239 return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
240}
241
242static __inline__ int __test_bit(int nr, const volatile unsigned long * addr)
243{
244 int * a = (int *) addr;
245 int mask;
246
247 a += nr >> 5;
248 mask = 1 << (nr & 0x1f);
249 return ((mask & *a) != 0);
250}
251
252#define test_bit(nr,addr) \
253(__builtin_constant_p(nr) ? \
254 __constant_test_bit((nr),(addr)) : \
255 __test_bit((nr),(addr)))
256
257#define find_first_zero_bit(addr, size) \
258 find_next_zero_bit((addr), (size), 0)
259#define find_first_bit(addr, size) \
260 find_next_bit((addr), (size), 0)
261
262static __inline__ int find_next_zero_bit (void * addr, int size, int offset)
263{
264 unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
265 unsigned long result = offset & ~31UL;
266 unsigned long tmp;
267
268 if (offset >= size)
269 return size;
270 size -= result;
271 offset &= 31UL;
272 if (offset) {
273 tmp = *(p++);
274 tmp |= ~0UL >> (32-offset);
275 if (size < 32)
276 goto found_first;
277 if (~tmp)
278 goto found_middle;
279 size -= 32;
280 result += 32;
281 }
282 while (size & ~31UL) {
283 if (~(tmp = *(p++)))
284 goto found_middle;
285 result += 32;
286 size -= 32;
287 }
288 if (!size)
289 return result;
290 tmp = *p;
291
292found_first:
293 tmp |= ~0UL >> size;
294found_middle:
295 return result + ffz(tmp);
296}
297
298/*
299 * Find next one bit in a bitmap reasonably efficiently.
300 */
301static __inline__ unsigned long find_next_bit(const unsigned long *addr,
302 unsigned long size, unsigned long offset)
303{
304 unsigned int *p = ((unsigned int *) addr) + (offset >> 5);
305 unsigned int result = offset & ~31UL;
306 unsigned int tmp;
307
308 if (offset >= size)
309 return size;
310 size -= result;
311 offset &= 31UL;
312 if (offset) {
313 tmp = *p++;
314 tmp &= ~0UL << offset;
315 if (size < 32)
316 goto found_first;
317 if (tmp)
318 goto found_middle;
319 size -= 32;
320 result += 32;
321 }
322 while (size >= 32) {
323 if ((tmp = *p++) != 0)
324 goto found_middle;
325 result += 32;
326 size -= 32;
327 }
328 if (!size)
329 return result;
330 tmp = *p;
331
332found_first:
333 tmp &= ~0UL >> (32 - size);
334 if (tmp == 0UL) /* Are any bits set? */
335 return result + size; /* Nope. */
336found_middle:
337 return result + __ffs(tmp);
338}
339
340/*
341 * hweightN: returns the hamming weight (i.e. the number
342 * of bits set) of a N-bit word
343 */
344
345#define hweight32(x) generic_hweight32(x)
346#define hweight16(x) generic_hweight16(x)
347#define hweight8(x) generic_hweight8(x)
348
349
350static __inline__ int ext2_set_bit(int nr, volatile void * addr)
351{
352 char retval;
353
354#ifdef CONFIG_COLDFIRE
355 __asm__ __volatile__ ("lea %1,%%a0; bset %2,(%%a0); sne %0"
356 : "=d" (retval), "+m" (((volatile char *)addr)[nr >> 3])
357 : "d" (nr)
358 : "%a0");
359#else
360 __asm__ __volatile__ ("bset %2,%1; sne %0"
361 : "=d" (retval), "+m" (((volatile char *)addr)[nr >> 3])
362 : "di" (nr)
363 /* No clobber */);
364#endif
365
366 return retval;
367}
368
369static __inline__ int ext2_clear_bit(int nr, volatile void * addr)
370{
371 char retval;
372
373#ifdef CONFIG_COLDFIRE
374 __asm__ __volatile__ ("lea %1,%%a0; bclr %2,(%%a0); sne %0"
375 : "=d" (retval), "+m" (((volatile char *)addr)[nr >> 3])
376 : "d" (nr)
377 : "%a0");
378#else
379 __asm__ __volatile__ ("bclr %2,%1; sne %0"
380 : "=d" (retval), "+m" (((volatile char *)addr)[nr >> 3])
381 : "di" (nr)
382 /* No clobber */);
383#endif
384
385 return retval;
386}
387
388#define ext2_set_bit_atomic(lock, nr, addr) \
389 ({ \
390 int ret; \
391 spin_lock(lock); \
392 ret = ext2_set_bit((nr), (addr)); \
393 spin_unlock(lock); \
394 ret; \
395 })
396
397#define ext2_clear_bit_atomic(lock, nr, addr) \
398 ({ \
399 int ret; \
400 spin_lock(lock); \
401 ret = ext2_clear_bit((nr), (addr)); \
402 spin_unlock(lock); \
403 ret; \
404 })
405
406static __inline__ int ext2_test_bit(int nr, const volatile void * addr)
407{
408 char retval;
409
410#ifdef CONFIG_COLDFIRE
411 __asm__ __volatile__ ("lea %1,%%a0; btst %2,(%%a0); sne %0"
412 : "=d" (retval)
413 : "m" (((const volatile char *)addr)[nr >> 3]), "d" (nr)
414 : "%a0");
415#else
416 __asm__ __volatile__ ("btst %2,%1; sne %0"
417 : "=d" (retval)
418 : "m" (((const volatile char *)addr)[nr >> 3]), "di" (nr)
419 /* No clobber */);
420#endif
421
422 return retval;
423}
424
425#define ext2_find_first_zero_bit(addr, size) \
426 ext2_find_next_zero_bit((addr), (size), 0)
427
428static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
429{
430 unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
431 unsigned long result = offset & ~31UL;
432 unsigned long tmp;
433
434 if (offset >= size)
435 return size;
436 size -= result;
437 offset &= 31UL;
438 if(offset) {
439 /* We hold the little endian value in tmp, but then the
440 * shift is illegal. So we could keep a big endian value
441 * in tmp, like this:
442 *
443 * tmp = __swab32(*(p++));
444 * tmp |= ~0UL >> (32-offset);
445 *
446 * but this would decrease preformance, so we change the
447 * shift:
448 */
449 tmp = *(p++);
450 tmp |= __swab32(~0UL >> (32-offset));
451 if(size < 32)
452 goto found_first;
453 if(~tmp)
454 goto found_middle;
455 size -= 32;
456 result += 32;
457 }
458 while(size & ~31UL) {
459 if(~(tmp = *(p++)))
460 goto found_middle;
461 result += 32;
462 size -= 32;
463 }
464 if(!size)
465 return result;
466 tmp = *p;
467
468found_first:
469 /* tmp is little endian, so we would have to swab the shift,
470 * see above. But then we have to swab tmp below for ffz, so
471 * we might as well do this here.
472 */
473 return result + ffz(__swab32(tmp) | (~0UL << size));
474found_middle:
475 return result + ffz(__swab32(tmp));
476}
477
478/* Bitmap functions for the minix filesystem. */
479#define minix_test_and_set_bit(nr,addr) test_and_set_bit(nr,addr)
480#define minix_set_bit(nr,addr) set_bit(nr,addr)
481#define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr)
482#define minix_test_bit(nr,addr) test_bit(nr,addr)
483#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
484
485/**
486 * hweightN - returns the hamming weight of a N-bit word
487 * @x: the word to weigh
488 *
489 * The Hamming Weight of a number is the total number of bits set in it.
490 */
491
492#define hweight32(x) generic_hweight32(x)
493#define hweight16(x) generic_hweight16(x)
494#define hweight8(x) generic_hweight8(x)
495
496#endif /* __KERNEL__ */
497
498/*
499 * fls: find last bit set.
500 */
501#define fls(x) generic_fls(x)
502
503#endif /* _M68KNOMMU_BITOPS_H */
diff --git a/include/asm-m68knommu/bootinfo.h b/include/asm-m68knommu/bootinfo.h
new file mode 100644
index 000000000000..c12e526f5189
--- /dev/null
+++ b/include/asm-m68knommu/bootinfo.h
@@ -0,0 +1,2 @@
1
2/* Nothing for m68knommu */
diff --git a/include/asm-m68knommu/bootstd.h b/include/asm-m68knommu/bootstd.h
new file mode 100644
index 000000000000..3fdc79f06d50
--- /dev/null
+++ b/include/asm-m68knommu/bootstd.h
@@ -0,0 +1,132 @@
1/* bootstd.h: Bootloader system call interface
2 *
3 * (c) 1999, Rt-Control, Inc.
4 */
5
6#ifndef __BOOTSTD_H__
7#define __BOOTSTD_H__
8
9#define NR_BSC 21 /* last used bootloader system call */
10
11#define __BN_reset 0 /* reset and start the bootloader */
12#define __BN_test 1 /* tests the system call interface */
13#define __BN_exec 2 /* executes a bootloader image */
14#define __BN_exit 3 /* terminates a bootloader image */
15#define __BN_program 4 /* program FLASH from a chain */
16#define __BN_erase 5 /* erase sector(s) of FLASH */
17#define __BN_open 6
18#define __BN_write 7
19#define __BN_read 8
20#define __BN_close 9
21#define __BN_mmap 10 /* map a file descriptor into memory */
22#define __BN_munmap 11 /* remove a file to memory mapping */
23#define __BN_gethwaddr 12 /* get the hardware address of my interfaces */
24#define __BN_getserialnum 13 /* get the serial number of this board */
25#define __BN_getbenv 14 /* get a bootloader envvar */
26#define __BN_setbenv 15 /* get a bootloader envvar */
27#define __BN_setpmask 16 /* set the protection mask */
28#define __BN_readenv 17 /* read environment variables */
29#define __BN_flash_chattr_range 18
30#define __BN_flash_erase_range 19
31#define __BN_flash_write_range 20
32
33/* Calling conventions compatible to (uC)linux/68k
34 * We use simmilar macros to call into the bootloader as for uClinux
35 */
36
37#define __bsc_return(type, res) \
38do { \
39 if ((unsigned long)(res) >= (unsigned long)(-64)) { \
40 /* let errno be a function, preserve res in %d0 */ \
41 int __err = -(res); \
42 errno = __err; \
43 res = -1; \
44 } \
45 return (type)(res); \
46} while (0)
47
48#define _bsc0(type,name) \
49type name(void) \
50{ \
51 register long __res __asm__ ("%d0") = __BN_##name; \
52 __asm__ __volatile__ ("trap #2" \
53 : "=g" (__res) \
54 : "0" (__res) \
55 : "%d0"); \
56 __bsc_return(type,__res); \
57}
58
59#define _bsc1(type,name,atype,a) \
60type name(atype a) \
61{ \
62 register long __res __asm__ ("%d0") = __BN_##name; \
63 register long __a __asm__ ("%d1") = (long)a; \
64 __asm__ __volatile__ ("trap #2" \
65 : "=g" (__res) \
66 : "0" (__res), "d" (__a) \
67 : "%d0"); \
68 __bsc_return(type,__res); \
69}
70
71#define _bsc2(type,name,atype,a,btype,b) \
72type name(atype a, btype b) \
73{ \
74 register long __res __asm__ ("%d0") = __BN_##name; \
75 register long __a __asm__ ("%d1") = (long)a; \
76 register long __b __asm__ ("%d2") = (long)b; \
77 __asm__ __volatile__ ("trap #2" \
78 : "=g" (__res) \
79 : "0" (__res), "d" (__a), "d" (__b) \
80 : "%d0"); \
81 __bsc_return(type,__res); \
82}
83
84#define _bsc3(type,name,atype,a,btype,b,ctype,c) \
85type name(atype a, btype b, ctype c) \
86{ \
87 register long __res __asm__ ("%d0") = __BN_##name; \
88 register long __a __asm__ ("%d1") = (long)a; \
89 register long __b __asm__ ("%d2") = (long)b; \
90 register long __c __asm__ ("%d3") = (long)c; \
91 __asm__ __volatile__ ("trap #2" \
92 : "=g" (__res) \
93 : "0" (__res), "d" (__a), "d" (__b), \
94 "d" (__c) \
95 : "%d0"); \
96 __bsc_return(type,__res); \
97}
98
99#define _bsc4(type,name,atype,a,btype,b,ctype,c,dtype,d) \
100type name(atype a, btype b, ctype c, dtype d) \
101{ \
102 register long __res __asm__ ("%d0") = __BN_##name; \
103 register long __a __asm__ ("%d1") = (long)a; \
104 register long __b __asm__ ("%d2") = (long)b; \
105 register long __c __asm__ ("%d3") = (long)c; \
106 register long __d __asm__ ("%d4") = (long)d; \
107 __asm__ __volatile__ ("trap #2" \
108 : "=g" (__res) \
109 : "0" (__res), "d" (__a), "d" (__b), \
110 "d" (__c), "d" (__d) \
111 : "%d0"); \
112 __bsc_return(type,__res); \
113}
114
115#define _bsc5(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
116type name(atype a, btype b, ctype c, dtype d, etype e) \
117{ \
118 register long __res __asm__ ("%d0") = __BN_##name; \
119 register long __a __asm__ ("%d1") = (long)a; \
120 register long __b __asm__ ("%d2") = (long)b; \
121 register long __c __asm__ ("%d3") = (long)c; \
122 register long __d __asm__ ("%d4") = (long)d; \
123 register long __e __asm__ ("%d5") = (long)e; \
124 __asm__ __volatile__ ("trap #2" \
125 : "=g" (__res) \
126 : "0" (__res), "d" (__a), "d" (__b), \
127 "d" (__c), "d" (__d), "d" (__e) \
128 : "%d0"); \
129 __bsc_return(type,__res); \
130}
131
132#endif /* __BOOTSTD_H__ */
diff --git a/include/asm-m68knommu/bug.h b/include/asm-m68knommu/bug.h
new file mode 100644
index 000000000000..70e7dc0af21a
--- /dev/null
+++ b/include/asm-m68knommu/bug.h
@@ -0,0 +1,4 @@
1#ifndef _M68KNOMMU_BUG_H
2#define _M68KNOMMU_BUG_H
3#include <asm-generic/bug.h>
4#endif
diff --git a/include/asm-m68knommu/bugs.h b/include/asm-m68knommu/bugs.h
new file mode 100644
index 000000000000..5f382dac3a60
--- /dev/null
+++ b/include/asm-m68knommu/bugs.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-m68k/bugs.h
3 *
4 * Copyright (C) 1994 Linus Torvalds
5 */
6
7/*
8 * This is included by init/main.c to check for architecture-dependent bugs.
9 *
10 * Needs:
11 * void check_bugs(void);
12 */
13
14static void check_bugs(void)
15{
16}
diff --git a/include/asm-m68knommu/byteorder.h b/include/asm-m68knommu/byteorder.h
new file mode 100644
index 000000000000..8fcde907b0f9
--- /dev/null
+++ b/include/asm-m68knommu/byteorder.h
@@ -0,0 +1,13 @@
1#ifndef _M68KNOMMU_BYTEORDER_H
2#define _M68KNOMMU_BYTEORDER_H
3
4#include <asm/types.h>
5
6#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
7# define __BYTEORDER_HAS_U64__
8# define __SWAB_64_THRU_32__
9#endif
10
11#include <linux/byteorder/big_endian.h>
12
13#endif /* _M68KNOMMU_BYTEORDER_H */
diff --git a/include/asm-m68knommu/cache.h b/include/asm-m68knommu/cache.h
new file mode 100644
index 000000000000..24e9eace5f8c
--- /dev/null
+++ b/include/asm-m68knommu/cache.h
@@ -0,0 +1,12 @@
1#ifndef __ARCH_M68KNOMMU_CACHE_H
2#define __ARCH_M68KNOMMU_CACHE_H
3
4/* bytes per L1 cache line */
5#define L1_CACHE_BYTES 16 /* this need to be at least 1 */
6
7/* m68k-elf-gcc 2.95.2 doesn't like these */
8
9#define __cacheline_aligned
10#define ____cacheline_aligned
11
12#endif
diff --git a/include/asm-m68knommu/cachectl.h b/include/asm-m68knommu/cachectl.h
new file mode 100644
index 000000000000..bcf5a6a9dd52
--- /dev/null
+++ b/include/asm-m68knommu/cachectl.h
@@ -0,0 +1 @@
#include <asm-m68k/cachectl.h>
diff --git a/include/asm-m68knommu/cacheflush.h b/include/asm-m68knommu/cacheflush.h
new file mode 100644
index 000000000000..aa7a2ffa41af
--- /dev/null
+++ b/include/asm-m68knommu/cacheflush.h
@@ -0,0 +1,75 @@
1#ifndef _M68KNOMMU_CACHEFLUSH_H
2#define _M68KNOMMU_CACHEFLUSH_H
3
4/*
5 * (C) Copyright 2000-2002, Greg Ungerer <gerg@snapgear.com>
6 */
7#include <linux/mm.h>
8
9#define flush_cache_all() __flush_cache_all()
10#define flush_cache_mm(mm) do { } while (0)
11#define flush_cache_range(vma, start, end) do { } while (0)
12#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
13#define flush_dcache_range(start,len) do { } while (0)
14#define flush_dcache_page(page) do { } while (0)
15#define flush_dcache_mmap_lock(mapping) do { } while (0)
16#define flush_dcache_mmap_unlock(mapping) do { } while (0)
17#define flush_icache_range(start,len) __flush_cache_all()
18#define flush_icache_page(vma,pg) do { } while (0)
19#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
20#define flush_cache_vmap(start, end) flush_cache_all()
21#define flush_cache_vunmap(start, end) flush_cache_all()
22
23#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
24 memcpy(dst, src, len)
25#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
26 memcpy(dst, src, len)
27
28extern inline void __flush_cache_all(void)
29{
30#ifdef CONFIG_M5407
31 /*
32 * Use cpushl to push and invalidate all cache lines.
33 * Gas doesn't seem to know how to generate the ColdFire
34 * cpushl instruction... Oh well, bit stuff it for now.
35 */
36 __asm__ __volatile__ (
37 "nop\n\t"
38 "clrl %%d0\n\t"
39 "1:\n\t"
40 "movel %%d0,%%a0\n\t"
41 "2:\n\t"
42 ".word 0xf468\n\t"
43 "addl #0x10,%%a0\n\t"
44 "cmpl #0x00000800,%%a0\n\t"
45 "blt 2b\n\t"
46 "addql #1,%%d0\n\t"
47 "cmpil #4,%%d0\n\t"
48 "bne 1b\n\t"
49 "movel #0xb6088500,%%d0\n\t"
50 "movec %%d0,%%CACR\n\t"
51 : : : "d0", "a0" );
52#endif /* CONFIG_M5407 */
53#ifdef CONFIG_M5272
54 __asm__ __volatile__ (
55 "movel #0x01000000, %%d0\n\t"
56 "movec %%d0, %%CACR\n\t"
57 "nop\n\t"
58 "movel #0x80000100, %%d0\n\t"
59 "movec %%d0, %%CACR\n\t"
60 "nop\n\t"
61 : : : "d0" );
62#endif /* CONFIG_M5272 */
63#if 0 /* CONFIG_M5249 */
64 __asm__ __volatile__ (
65 "movel #0x01000000, %%d0\n\t"
66 "movec %%d0, %%CACR\n\t"
67 "nop\n\t"
68 "movel #0xa0000200, %%d0\n\t"
69 "movec %%d0, %%CACR\n\t"
70 "nop\n\t"
71 : : : "d0" );
72#endif /* CONFIG_M5249 */
73}
74
75#endif /* _M68KNOMMU_CACHEFLUSH_H */
diff --git a/include/asm-m68knommu/checksum.h b/include/asm-m68knommu/checksum.h
new file mode 100644
index 000000000000..92cf102c2534
--- /dev/null
+++ b/include/asm-m68knommu/checksum.h
@@ -0,0 +1,133 @@
1#ifndef _M68K_CHECKSUM_H
2#define _M68K_CHECKSUM_H
3
4#include <linux/in6.h>
5
6/*
7 * computes the checksum of a memory block at buff, length len,
8 * and adds in "sum" (32-bit)
9 *
10 * returns a 32-bit number suitable for feeding into itself
11 * or csum_tcpudp_magic
12 *
13 * this function must be called with even lengths, except
14 * for the last fragment, which may be odd
15 *
16 * it's best to have buff aligned on a 32-bit boundary
17 */
18unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
19
20/*
21 * the same as csum_partial, but copies from src while it
22 * checksums
23 *
24 * here even more important to align src and dst on a 32-bit (or even
25 * better 64-bit) boundary
26 */
27
28unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum);
29
30
31/*
32 * the same as csum_partial_copy, but copies from user space.
33 *
34 * here even more important to align src and dst on a 32-bit (or even
35 * better 64-bit) boundary
36 */
37
38extern unsigned int csum_partial_copy_from_user(const char *src, char *dst,
39 int len, int sum, int *csum_err);
40
41#define csum_partial_copy_nocheck(src, dst, len, sum) \
42 csum_partial_copy((src), (dst), (len), (sum))
43
44unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl);
45
46/*
47 * Fold a partial checksum
48 */
49
50static inline unsigned int csum_fold(unsigned int sum)
51{
52#ifdef CONFIG_COLDFIRE
53 sum = (sum & 0xffff) + (sum >> 16);
54 sum = (sum & 0xffff) + (sum >> 16);
55#else
56 unsigned int tmp = sum;
57 __asm__("swap %1\n\t"
58 "addw %1, %0\n\t"
59 "clrw %1\n\t"
60 "addxw %1, %0"
61 : "=&d" (sum), "=&d" (tmp)
62 : "0" (sum), "1" (sum));
63#endif
64 return ~sum;
65}
66
67
68/*
69 * computes the checksum of the TCP/UDP pseudo-header
70 * returns a 16-bit checksum, already complemented
71 */
72
73static inline unsigned int
74csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
75 unsigned short proto, unsigned int sum)
76{
77 __asm__ ("addl %1,%0\n\t"
78 "addxl %4,%0\n\t"
79 "addxl %5,%0\n\t"
80 "clrl %1\n\t"
81 "addxl %1,%0"
82 : "=&d" (sum), "=&d" (saddr)
83 : "0" (daddr), "1" (saddr), "d" (len + proto),
84 "d"(sum));
85 return sum;
86}
87
88static inline unsigned short int
89csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
90 unsigned short proto, unsigned int sum)
91{
92 return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
93}
94
95/*
96 * this routine is used for miscellaneous IP-like checksums, mainly
97 * in icmp.c
98 */
99
100extern unsigned short ip_compute_csum(const unsigned char * buff, int len);
101
102#define _HAVE_ARCH_IPV6_CSUM
103static __inline__ unsigned short int
104csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr,
105 __u32 len, unsigned short proto, unsigned int sum)
106{
107 register unsigned long tmp;
108 __asm__("addl %2@,%0\n\t"
109 "movel %2@(4),%1\n\t"
110 "addxl %1,%0\n\t"
111 "movel %2@(8),%1\n\t"
112 "addxl %1,%0\n\t"
113 "movel %2@(12),%1\n\t"
114 "addxl %1,%0\n\t"
115 "movel %3@,%1\n\t"
116 "addxl %1,%0\n\t"
117 "movel %3@(4),%1\n\t"
118 "addxl %1,%0\n\t"
119 "movel %3@(8),%1\n\t"
120 "addxl %1,%0\n\t"
121 "movel %3@(12),%1\n\t"
122 "addxl %1,%0\n\t"
123 "addxl %4,%0\n\t"
124 "clrl %1\n\t"
125 "addxl %1,%0"
126 : "=&d" (sum), "=&d" (tmp)
127 : "a" (saddr), "a" (daddr), "d" (len + proto),
128 "0" (sum));
129
130 return csum_fold(sum);
131}
132
133#endif /* _M68K_CHECKSUM_H */
diff --git a/include/asm-m68knommu/coldfire.h b/include/asm-m68knommu/coldfire.h
new file mode 100644
index 000000000000..16f32cc80c40
--- /dev/null
+++ b/include/asm-m68knommu/coldfire.h
@@ -0,0 +1,86 @@
1/****************************************************************************/
2
3/*
4 * coldfire.h -- Motorola ColdFire CPU sepecific defines
5 *
6 * (C) Copyright 1999-2002, Greg Ungerer (gerg@snapgear.com)
7 * (C) Copyright 2000, Lineo (www.lineo.com)
8 */
9
10/****************************************************************************/
11#ifndef coldfire_h
12#define coldfire_h
13/****************************************************************************/
14
15#include <linux/config.h>
16
17/*
18 * Define the processor support peripherals base address.
19 * This is generally setup by the boards start up code.
20 */
21#define MCF_MBAR 0x10000000
22#define MCF_MBAR2 0x80000000
23#define MCF_IPSBAR 0x40000000
24
25#if defined(CONFIG_M527x) || defined(CONFIG_M528x)
26#undef MCF_MBAR
27#define MCF_MBAR MCF_IPSBAR
28#endif
29
30/*
31 * Define master clock frequency.
32 */
33#if defined(CONFIG_CLOCK_11MHz)
34#define MCF_CLK 11289600
35#elif defined(CONFIG_CLOCK_16MHz)
36#define MCF_CLK 16000000
37#elif defined(CONFIG_CLOCK_20MHz)
38#define MCF_CLK 20000000
39#elif defined(CONFIG_CLOCK_24MHz)
40#define MCF_CLK 24000000
41#elif defined(CONFIG_CLOCK_25MHz)
42#define MCF_CLK 25000000
43#elif defined(CONFIG_CLOCK_33MHz)
44#define MCF_CLK 33000000
45#elif defined(CONFIG_CLOCK_40MHz)
46#define MCF_CLK 40000000
47#elif defined(CONFIG_CLOCK_45MHz)
48#define MCF_CLK 45000000
49#elif defined(CONFIG_CLOCK_48MHz)
50#define MCF_CLK 48000000
51#elif defined(CONFIG_CLOCK_50MHz)
52#define MCF_CLK 50000000
53#elif defined(CONFIG_CLOCK_54MHz)
54#define MCF_CLK 54000000
55#elif defined(CONFIG_CLOCK_60MHz)
56#define MCF_CLK 60000000
57#elif defined(CONFIG_CLOCK_64MHz)
58#define MCF_CLK 64000000
59#elif defined(CONFIG_CLOCK_66MHz)
60#define MCF_CLK 66000000
61#elif defined(CONFIG_CLOCK_70MHz)
62#define MCF_CLK 70000000
63#elif defined(CONFIG_CLOCK_100MHz)
64#define MCF_CLK 100000000
65#elif defined(CONFIG_CLOCK_140MHz)
66#define MCF_CLK 140000000
67#elif defined(CONFIG_CLOCK_150MHz)
68#define MCF_CLK 150000000
69#elif defined(CONFIG_CLOCK_166MHz)
70#define MCF_CLK 166000000
71#else
72#error "Don't know what your ColdFire CPU clock frequency is??"
73#endif
74
75/*
76 * One some ColdFire family members the bus clock (used by internal
77 * peripherals) is not the same as the CPU clock.
78 */
79#if defined(CONFIG_M5249) || defined(CONFIG_M527x)
80#define MCF_BUSCLK (MCF_CLK / 2)
81#else
82#define MCF_BUSCLK MCF_CLK
83#endif
84
85/****************************************************************************/
86#endif /* coldfire_h */
diff --git a/include/asm-m68knommu/commproc.h b/include/asm-m68knommu/commproc.h
new file mode 100644
index 000000000000..e522ca8193a2
--- /dev/null
+++ b/include/asm-m68knommu/commproc.h
@@ -0,0 +1,723 @@
1
2/*
3 * 68360 Communication Processor Module.
4 * Copyright (c) 2000 Michael Leslie <mleslie@lineo.com> (mc68360) after:
5 * Copyright (c) 1997 Dan Malek <dmalek@jlc.net> (mpc8xx)
6 *
7 * This file contains structures and information for the communication
8 * processor channels. Some CPM control and status is available
9 * through the 68360 internal memory map. See include/asm/360_immap.h for details.
10 * This file is not a complete map of all of the 360 QUICC's capabilities
11 *
12 * On the MBX board, EPPC-Bug loads CPM microcode into the first 512
13 * bytes of the DP RAM and relocates the I2C parameter area to the
14 * IDMA1 space. The remaining DP RAM is available for buffer descriptors
15 * or other use.
16 */
17#ifndef __CPM_360__
18#define __CPM_360__
19
20#include <linux/config.h>
21
22/* CPM Command register masks: */
23#define CPM_CR_RST ((ushort)0x8000)
24#define CPM_CR_OPCODE ((ushort)0x0f00)
25#define CPM_CR_CHAN ((ushort)0x00f0)
26#define CPM_CR_FLG ((ushort)0x0001)
27
28/* CPM Command set (opcodes): */
29#define CPM_CR_INIT_TRX ((ushort)0x0000)
30#define CPM_CR_INIT_RX ((ushort)0x0001)
31#define CPM_CR_INIT_TX ((ushort)0x0002)
32#define CPM_CR_HUNT_MODE ((ushort)0x0003)
33#define CPM_CR_STOP_TX ((ushort)0x0004)
34#define CPM_CR_GRSTOP_TX ((ushort)0x0005)
35#define CPM_CR_RESTART_TX ((ushort)0x0006)
36#define CPM_CR_CLOSE_RXBD ((ushort)0x0007)
37#define CPM_CR_SET_GADDR ((ushort)0x0008)
38#define CPM_CR_GCI_TIMEOUT ((ushort)0x0009)
39#define CPM_CR_GCI_ABORT ((ushort)0x000a)
40#define CPM_CR_RESET_BCS ((ushort)0x000a)
41
42/* CPM Channel numbers. */
43#define CPM_CR_CH_SCC1 ((ushort)0x0000)
44#define CPM_CR_CH_SCC2 ((ushort)0x0004)
45#define CPM_CR_CH_SPI ((ushort)0x0005) /* SPI / Timers */
46#define CPM_CR_CH_TMR ((ushort)0x0005)
47#define CPM_CR_CH_SCC3 ((ushort)0x0008)
48#define CPM_CR_CH_SMC1 ((ushort)0x0009) /* SMC1 / IDMA1 */
49#define CPM_CR_CH_IDMA1 ((ushort)0x0009)
50#define CPM_CR_CH_SCC4 ((ushort)0x000c)
51#define CPM_CR_CH_SMC2 ((ushort)0x000d) /* SMC2 / IDMA2 */
52#define CPM_CR_CH_IDMA2 ((ushort)0x000d)
53
54
55#define mk_cr_cmd(CH, CMD) ((CMD << 8) | (CH << 4))
56
57#if 1 /* mleslie: I dinna think we have any such restrictions on
58 * DP RAM aboard the 360 board - see the MC68360UM p.3-3 */
59
60/* The dual ported RAM is multi-functional. Some areas can be (and are
61 * being) used for microcode. There is an area that can only be used
62 * as data ram for buffer descriptors, which is all we use right now.
63 * Currently the first 512 and last 256 bytes are used for microcode.
64 */
65/* mleslie: The uCquicc board is using no extra microcode in DPRAM */
66#define CPM_DATAONLY_BASE ((uint)0x0000)
67#define CPM_DATAONLY_SIZE ((uint)0x0800)
68#define CPM_DP_NOSPACE ((uint)0x7fffffff)
69
70#endif
71
72
73/* Export the base address of the communication processor registers
74 * and dual port ram. */
75/* extern cpm360_t *cpmp; */ /* Pointer to comm processor */
76extern QUICC *pquicc;
77uint m360_cpm_dpalloc(uint size);
78/* void *m360_cpm_hostalloc(uint size); */
79void m360_cpm_setbrg(uint brg, uint rate);
80
81#if 0 /* use QUICC_BD declared in include/asm/m68360_quicc.h */
82/* Buffer descriptors used by many of the CPM protocols. */
83typedef struct cpm_buf_desc {
84 ushort cbd_sc; /* Status and Control */
85 ushort cbd_datlen; /* Data length in buffer */
86 uint cbd_bufaddr; /* Buffer address in host memory */
87} cbd_t;
88#endif
89
90
91/* rx bd status/control bits */
92#define BD_SC_EMPTY ((ushort)0x8000) /* Recieve is empty */
93#define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor in table */
94#define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */
95#define BD_SC_LAST ((ushort)0x0800) /* Last buffer in frame OR control char */
96
97#define BD_SC_FIRST ((ushort)0x0400) /* 1st buffer in an HDLC frame */
98#define BD_SC_ADDR ((ushort)0x0400) /* 1st byte is a multidrop address */
99
100#define BD_SC_CM ((ushort)0x0200) /* Continous mode */
101#define BD_SC_ID ((ushort)0x0100) /* Received too many idles */
102
103#define BD_SC_AM ((ushort)0x0080) /* Multidrop address match */
104#define BD_SC_DE ((ushort)0x0080) /* DPLL Error (HDLC) */
105
106#define BD_SC_BR ((ushort)0x0020) /* Break received */
107#define BD_SC_LG ((ushort)0x0020) /* Frame length violation (HDLC) */
108
109#define BD_SC_FR ((ushort)0x0010) /* Framing error */
110#define BD_SC_NO ((ushort)0x0010) /* Nonoctet aligned frame (HDLC) */
111
112#define BD_SC_PR ((ushort)0x0008) /* Parity error */
113#define BD_SC_AB ((ushort)0x0008) /* Received abort Sequence (HDLC) */
114
115#define BD_SC_OV ((ushort)0x0002) /* Overrun */
116#define BD_SC_CD ((ushort)0x0001) /* Carrier Detect lost */
117
118/* tx bd status/control bits (as differ from rx bd) */
119#define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */
120#define BD_SC_TC ((ushort)0x0400) /* Transmit CRC */
121#define BD_SC_P ((ushort)0x0100) /* xmt preamble */
122#define BD_SC_UN ((ushort)0x0002) /* Underrun */
123
124
125
126
127/* Parameter RAM offsets. */
128
129
130
131/* In 2.4 ppc, the PROFF_S?C? are used as byte offsets into DPRAM.
132 * In 2.0, we use a more structured C struct map of DPRAM, and so
133 * instead, we need only a parameter ram `slot' */
134
135#define PRSLOT_SCC1 0
136#define PRSLOT_SCC2 1
137#define PRSLOT_SCC3 2
138#define PRSLOT_SMC1 2
139#define PRSLOT_SCC4 3
140#define PRSLOT_SMC2 3
141
142
143/* #define PROFF_SCC1 ((uint)0x0000) */
144/* #define PROFF_SCC2 ((uint)0x0100) */
145/* #define PROFF_SCC3 ((uint)0x0200) */
146/* #define PROFF_SMC1 ((uint)0x0280) */
147/* #define PROFF_SCC4 ((uint)0x0300) */
148/* #define PROFF_SMC2 ((uint)0x0380) */
149
150
151/* Define enough so I can at least use the serial port as a UART.
152 * The MBX uses SMC1 as the host serial port.
153 */
154typedef struct smc_uart {
155 ushort smc_rbase; /* Rx Buffer descriptor base address */
156 ushort smc_tbase; /* Tx Buffer descriptor base address */
157 u_char smc_rfcr; /* Rx function code */
158 u_char smc_tfcr; /* Tx function code */
159 ushort smc_mrblr; /* Max receive buffer length */
160 uint smc_rstate; /* Internal */
161 uint smc_idp; /* Internal */
162 ushort smc_rbptr; /* Internal */
163 ushort smc_ibc; /* Internal */
164 uint smc_rxtmp; /* Internal */
165 uint smc_tstate; /* Internal */
166 uint smc_tdp; /* Internal */
167 ushort smc_tbptr; /* Internal */
168 ushort smc_tbc; /* Internal */
169 uint smc_txtmp; /* Internal */
170 ushort smc_maxidl; /* Maximum idle characters */
171 ushort smc_tmpidl; /* Temporary idle counter */
172 ushort smc_brklen; /* Last received break length */
173 ushort smc_brkec; /* rcv'd break condition counter */
174 ushort smc_brkcr; /* xmt break count register */
175 ushort smc_rmask; /* Temporary bit mask */
176} smc_uart_t;
177
178/* Function code bits.
179*/
180#define SMC_EB ((u_char)0x10) /* Set big endian byte order */
181
182/* SMC uart mode register.
183*/
184#define SMCMR_REN ((ushort)0x0001)
185#define SMCMR_TEN ((ushort)0x0002)
186#define SMCMR_DM ((ushort)0x000c)
187#define SMCMR_SM_GCI ((ushort)0x0000)
188#define SMCMR_SM_UART ((ushort)0x0020)
189#define SMCMR_SM_TRANS ((ushort)0x0030)
190#define SMCMR_SM_MASK ((ushort)0x0030)
191#define SMCMR_PM_EVEN ((ushort)0x0100) /* Even parity, else odd */
192#define SMCMR_REVD SMCMR_PM_EVEN
193#define SMCMR_PEN ((ushort)0x0200) /* Parity enable */
194#define SMCMR_BS SMCMR_PEN
195#define SMCMR_SL ((ushort)0x0400) /* Two stops, else one */
196#define SMCR_CLEN_MASK ((ushort)0x7800) /* Character length */
197#define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
198
199/* SMC2 as Centronics parallel printer. It is half duplex, in that
200 * it can only receive or transmit. The parameter ram values for
201 * each direction are either unique or properly overlap, so we can
202 * include them in one structure.
203 */
204typedef struct smc_centronics {
205 ushort scent_rbase;
206 ushort scent_tbase;
207 u_char scent_cfcr;
208 u_char scent_smask;
209 ushort scent_mrblr;
210 uint scent_rstate;
211 uint scent_r_ptr;
212 ushort scent_rbptr;
213 ushort scent_r_cnt;
214 uint scent_rtemp;
215 uint scent_tstate;
216 uint scent_t_ptr;
217 ushort scent_tbptr;
218 ushort scent_t_cnt;
219 uint scent_ttemp;
220 ushort scent_max_sl;
221 ushort scent_sl_cnt;
222 ushort scent_character1;
223 ushort scent_character2;
224 ushort scent_character3;
225 ushort scent_character4;
226 ushort scent_character5;
227 ushort scent_character6;
228 ushort scent_character7;
229 ushort scent_character8;
230 ushort scent_rccm;
231 ushort scent_rccr;
232} smc_cent_t;
233
234/* Centronics Status Mask Register.
235*/
236#define SMC_CENT_F ((u_char)0x08)
237#define SMC_CENT_PE ((u_char)0x04)
238#define SMC_CENT_S ((u_char)0x02)
239
240/* SMC Event and Mask register.
241*/
242#define SMCM_BRKE ((unsigned char)0x40) /* When in UART Mode */
243#define SMCM_BRK ((unsigned char)0x10) /* When in UART Mode */
244#define SMCM_TXE ((unsigned char)0x10) /* When in Transparent Mode */
245#define SMCM_BSY ((unsigned char)0x04)
246#define SMCM_TX ((unsigned char)0x02)
247#define SMCM_RX ((unsigned char)0x01)
248
249/* Baud rate generators.
250*/
251#define CPM_BRG_RST ((uint)0x00020000)
252#define CPM_BRG_EN ((uint)0x00010000)
253#define CPM_BRG_EXTC_INT ((uint)0x00000000)
254#define CPM_BRG_EXTC_CLK2 ((uint)0x00004000)
255#define CPM_BRG_EXTC_CLK6 ((uint)0x00008000)
256#define CPM_BRG_ATB ((uint)0x00002000)
257#define CPM_BRG_CD_MASK ((uint)0x00001ffe)
258#define CPM_BRG_DIV16 ((uint)0x00000001)
259
260/* SCCs.
261*/
262#define SCC_GSMRH_IRP ((uint)0x00040000)
263#define SCC_GSMRH_GDE ((uint)0x00010000)
264#define SCC_GSMRH_TCRC_CCITT ((uint)0x00008000)
265#define SCC_GSMRH_TCRC_BISYNC ((uint)0x00004000)
266#define SCC_GSMRH_TCRC_HDLC ((uint)0x00000000)
267#define SCC_GSMRH_REVD ((uint)0x00002000)
268#define SCC_GSMRH_TRX ((uint)0x00001000)
269#define SCC_GSMRH_TTX ((uint)0x00000800)
270#define SCC_GSMRH_CDP ((uint)0x00000400)
271#define SCC_GSMRH_CTSP ((uint)0x00000200)
272#define SCC_GSMRH_CDS ((uint)0x00000100)
273#define SCC_GSMRH_CTSS ((uint)0x00000080)
274#define SCC_GSMRH_TFL ((uint)0x00000040)
275#define SCC_GSMRH_RFW ((uint)0x00000020)
276#define SCC_GSMRH_TXSY ((uint)0x00000010)
277#define SCC_GSMRH_SYNL16 ((uint)0x0000000c)
278#define SCC_GSMRH_SYNL8 ((uint)0x00000008)
279#define SCC_GSMRH_SYNL4 ((uint)0x00000004)
280#define SCC_GSMRH_RTSM ((uint)0x00000002)
281#define SCC_GSMRH_RSYN ((uint)0x00000001)
282
283#define SCC_GSMRL_SIR ((uint)0x80000000) /* SCC2 only */
284#define SCC_GSMRL_EDGE_NONE ((uint)0x60000000)
285#define SCC_GSMRL_EDGE_NEG ((uint)0x40000000)
286#define SCC_GSMRL_EDGE_POS ((uint)0x20000000)
287#define SCC_GSMRL_EDGE_BOTH ((uint)0x00000000)
288#define SCC_GSMRL_TCI ((uint)0x10000000)
289#define SCC_GSMRL_TSNC_3 ((uint)0x0c000000)
290#define SCC_GSMRL_TSNC_4 ((uint)0x08000000)
291#define SCC_GSMRL_TSNC_14 ((uint)0x04000000)
292#define SCC_GSMRL_TSNC_INF ((uint)0x00000000)
293#define SCC_GSMRL_RINV ((uint)0x02000000)
294#define SCC_GSMRL_TINV ((uint)0x01000000)
295#define SCC_GSMRL_TPL_128 ((uint)0x00c00000)
296#define SCC_GSMRL_TPL_64 ((uint)0x00a00000)
297#define SCC_GSMRL_TPL_48 ((uint)0x00800000)
298#define SCC_GSMRL_TPL_32 ((uint)0x00600000)
299#define SCC_GSMRL_TPL_16 ((uint)0x00400000)
300#define SCC_GSMRL_TPL_8 ((uint)0x00200000)
301#define SCC_GSMRL_TPL_NONE ((uint)0x00000000)
302#define SCC_GSMRL_TPP_ALL1 ((uint)0x00180000)
303#define SCC_GSMRL_TPP_01 ((uint)0x00100000)
304#define SCC_GSMRL_TPP_10 ((uint)0x00080000)
305#define SCC_GSMRL_TPP_ZEROS ((uint)0x00000000)
306#define SCC_GSMRL_TEND ((uint)0x00040000)
307#define SCC_GSMRL_TDCR_32 ((uint)0x00030000)
308#define SCC_GSMRL_TDCR_16 ((uint)0x00020000)
309#define SCC_GSMRL_TDCR_8 ((uint)0x00010000)
310#define SCC_GSMRL_TDCR_1 ((uint)0x00000000)
311#define SCC_GSMRL_RDCR_32 ((uint)0x0000c000)
312#define SCC_GSMRL_RDCR_16 ((uint)0x00008000)
313#define SCC_GSMRL_RDCR_8 ((uint)0x00004000)
314#define SCC_GSMRL_RDCR_1 ((uint)0x00000000)
315#define SCC_GSMRL_RENC_DFMAN ((uint)0x00003000)
316#define SCC_GSMRL_RENC_MANCH ((uint)0x00002000)
317#define SCC_GSMRL_RENC_FM0 ((uint)0x00001000)
318#define SCC_GSMRL_RENC_NRZI ((uint)0x00000800)
319#define SCC_GSMRL_RENC_NRZ ((uint)0x00000000)
320#define SCC_GSMRL_TENC_DFMAN ((uint)0x00000600)
321#define SCC_GSMRL_TENC_MANCH ((uint)0x00000400)
322#define SCC_GSMRL_TENC_FM0 ((uint)0x00000200)
323#define SCC_GSMRL_TENC_NRZI ((uint)0x00000100)
324#define SCC_GSMRL_TENC_NRZ ((uint)0x00000000)
325#define SCC_GSMRL_DIAG_LE ((uint)0x000000c0) /* Loop and echo */
326#define SCC_GSMRL_DIAG_ECHO ((uint)0x00000080)
327#define SCC_GSMRL_DIAG_LOOP ((uint)0x00000040)
328#define SCC_GSMRL_DIAG_NORM ((uint)0x00000000)
329#define SCC_GSMRL_ENR ((uint)0x00000020)
330#define SCC_GSMRL_ENT ((uint)0x00000010)
331#define SCC_GSMRL_MODE_ENET ((uint)0x0000000c)
332#define SCC_GSMRL_MODE_DDCMP ((uint)0x00000009)
333#define SCC_GSMRL_MODE_BISYNC ((uint)0x00000008)
334#define SCC_GSMRL_MODE_V14 ((uint)0x00000007)
335#define SCC_GSMRL_MODE_AHDLC ((uint)0x00000006)
336#define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
337#define SCC_GSMRL_MODE_UART ((uint)0x00000004)
338#define SCC_GSMRL_MODE_SS7 ((uint)0x00000003)
339#define SCC_GSMRL_MODE_ATALK ((uint)0x00000002)
340#define SCC_GSMRL_MODE_HDLC ((uint)0x00000000)
341
342#define SCC_TODR_TOD ((ushort)0x8000)
343
344/* SCC Event and Mask register.
345*/
346#define SCCM_TXE ((unsigned char)0x10)
347#define SCCM_BSY ((unsigned char)0x04)
348#define SCCM_TX ((unsigned char)0x02)
349#define SCCM_RX ((unsigned char)0x01)
350
351typedef struct scc_param {
352 ushort scc_rbase; /* Rx Buffer descriptor base address */
353 ushort scc_tbase; /* Tx Buffer descriptor base address */
354 u_char scc_rfcr; /* Rx function code */
355 u_char scc_tfcr; /* Tx function code */
356 ushort scc_mrblr; /* Max receive buffer length */
357 uint scc_rstate; /* Internal */
358 uint scc_idp; /* Internal */
359 ushort scc_rbptr; /* Internal */
360 ushort scc_ibc; /* Internal */
361 uint scc_rxtmp; /* Internal */
362 uint scc_tstate; /* Internal */
363 uint scc_tdp; /* Internal */
364 ushort scc_tbptr; /* Internal */
365 ushort scc_tbc; /* Internal */
366 uint scc_txtmp; /* Internal */
367 uint scc_rcrc; /* Internal */
368 uint scc_tcrc; /* Internal */
369} sccp_t;
370
371
372/* Function code bits.
373 */
374#define SCC_EB ((u_char)0x10) /* Set big endian byte order */
375#define SCC_FC_DMA ((u_char)0x08) /* Set SDMA */
376
377/* CPM Ethernet through SCC1.
378 */
379typedef struct scc_enet {
380 sccp_t sen_genscc;
381 uint sen_cpres; /* Preset CRC */
382 uint sen_cmask; /* Constant mask for CRC */
383 uint sen_crcec; /* CRC Error counter */
384 uint sen_alec; /* alignment error counter */
385 uint sen_disfc; /* discard frame counter */
386 ushort sen_pads; /* Tx short frame pad character */
387 ushort sen_retlim; /* Retry limit threshold */
388 ushort sen_retcnt; /* Retry limit counter */
389 ushort sen_maxflr; /* maximum frame length register */
390 ushort sen_minflr; /* minimum frame length register */
391 ushort sen_maxd1; /* maximum DMA1 length */
392 ushort sen_maxd2; /* maximum DMA2 length */
393 ushort sen_maxd; /* Rx max DMA */
394 ushort sen_dmacnt; /* Rx DMA counter */
395 ushort sen_maxb; /* Max BD byte count */
396 ushort sen_gaddr1; /* Group address filter */
397 ushort sen_gaddr2;
398 ushort sen_gaddr3;
399 ushort sen_gaddr4;
400 uint sen_tbuf0data0; /* Save area 0 - current frame */
401 uint sen_tbuf0data1; /* Save area 1 - current frame */
402 uint sen_tbuf0rba; /* Internal */
403 uint sen_tbuf0crc; /* Internal */
404 ushort sen_tbuf0bcnt; /* Internal */
405 ushort sen_paddrh; /* physical address (MSB) */
406 ushort sen_paddrm;
407 ushort sen_paddrl; /* physical address (LSB) */
408 ushort sen_pper; /* persistence */
409 ushort sen_rfbdptr; /* Rx first BD pointer */
410 ushort sen_tfbdptr; /* Tx first BD pointer */
411 ushort sen_tlbdptr; /* Tx last BD pointer */
412 uint sen_tbuf1data0; /* Save area 0 - current frame */
413 uint sen_tbuf1data1; /* Save area 1 - current frame */
414 uint sen_tbuf1rba; /* Internal */
415 uint sen_tbuf1crc; /* Internal */
416 ushort sen_tbuf1bcnt; /* Internal */
417 ushort sen_txlen; /* Tx Frame length counter */
418 ushort sen_iaddr1; /* Individual address filter */
419 ushort sen_iaddr2;
420 ushort sen_iaddr3;
421 ushort sen_iaddr4;
422 ushort sen_boffcnt; /* Backoff counter */
423
424 /* NOTE: Some versions of the manual have the following items
425 * incorrectly documented. Below is the proper order.
426 */
427 ushort sen_taddrh; /* temp address (MSB) */
428 ushort sen_taddrm;
429 ushort sen_taddrl; /* temp address (LSB) */
430} scc_enet_t;
431
432
433
434#if defined (CONFIG_UCQUICC)
435/* uCquicc has the following signals connected to Ethernet:
436 * 68360 - lxt905
437 * PA0/RXD1 - rxd
438 * PA1/TXD1 - txd
439 * PA8/CLK1 - tclk
440 * PA9/CLK2 - rclk
441 * PC0/!RTS1 - t_en
442 * PC1/!CTS1 - col
443 * PC5/!CD1 - cd
444 */
445#define PA_ENET_RXD PA_RXD1
446#define PA_ENET_TXD PA_TXD1
447#define PA_ENET_TCLK PA_CLK1
448#define PA_ENET_RCLK PA_CLK2
449#define PC_ENET_TENA PC_RTS1
450#define PC_ENET_CLSN PC_CTS1
451#define PC_ENET_RENA PC_CD1
452
453/* Control bits in the SICR to route TCLK (CLK1) and RCLK (CLK2) to
454 * SCC1.
455 */
456#define SICR_ENET_MASK ((uint)0x000000ff)
457#define SICR_ENET_CLKRT ((uint)0x0000002c)
458
459#endif /* config_ucquicc */
460
461
462#ifdef MBX
463/* Bits in parallel I/O port registers that have to be set/cleared
464 * to configure the pins for SCC1 use. The TCLK and RCLK seem unique
465 * to the MBX860 board. Any two of the four available clocks could be
466 * used, and the MPC860 cookbook manual has an example using different
467 * clock pins.
468 */
469#define PA_ENET_RXD ((ushort)0x0001)
470#define PA_ENET_TXD ((ushort)0x0002)
471#define PA_ENET_TCLK ((ushort)0x0200)
472#define PA_ENET_RCLK ((ushort)0x0800)
473#define PC_ENET_TENA ((ushort)0x0001)
474#define PC_ENET_CLSN ((ushort)0x0010)
475#define PC_ENET_RENA ((ushort)0x0020)
476
477/* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
478 * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
479 */
480#define SICR_ENET_MASK ((uint)0x000000ff)
481#define SICR_ENET_CLKRT ((uint)0x0000003d)
482#endif
483
484#ifdef CONFIG_RPXLITE
485/* This ENET stuff is for the MPC850 with ethernet on SCC2. Some of
486 * this may be unique to the RPX-Lite configuration.
487 * Note TENA is on Port B.
488 */
489#define PA_ENET_RXD ((ushort)0x0004)
490#define PA_ENET_TXD ((ushort)0x0008)
491#define PA_ENET_TCLK ((ushort)0x0200)
492#define PA_ENET_RCLK ((ushort)0x0800)
493#define PB_ENET_TENA ((uint)0x00002000)
494#define PC_ENET_CLSN ((ushort)0x0040)
495#define PC_ENET_RENA ((ushort)0x0080)
496
497#define SICR_ENET_MASK ((uint)0x0000ff00)
498#define SICR_ENET_CLKRT ((uint)0x00003d00)
499#endif
500
501#ifdef CONFIG_BSEIP
502/* This ENET stuff is for the MPC823 with ethernet on SCC2.
503 * This is unique to the BSE ip-Engine board.
504 */
505#define PA_ENET_RXD ((ushort)0x0004)
506#define PA_ENET_TXD ((ushort)0x0008)
507#define PA_ENET_TCLK ((ushort)0x0100)
508#define PA_ENET_RCLK ((ushort)0x0200)
509#define PB_ENET_TENA ((uint)0x00002000)
510#define PC_ENET_CLSN ((ushort)0x0040)
511#define PC_ENET_RENA ((ushort)0x0080)
512
513/* BSE uses port B and C bits for PHY control also.
514*/
515#define PB_BSE_POWERUP ((uint)0x00000004)
516#define PB_BSE_FDXDIS ((uint)0x00008000)
517#define PC_BSE_LOOPBACK ((ushort)0x0800)
518
519#define SICR_ENET_MASK ((uint)0x0000ff00)
520#define SICR_ENET_CLKRT ((uint)0x00002c00)
521#endif
522
523#ifdef CONFIG_RPXCLASSIC
524/* Bits in parallel I/O port registers that have to be set/cleared
525 * to configure the pins for SCC1 use.
526 */
527#define PA_ENET_RXD ((ushort)0x0001)
528#define PA_ENET_TXD ((ushort)0x0002)
529#define PA_ENET_TCLK ((ushort)0x0200)
530#define PA_ENET_RCLK ((ushort)0x0800)
531#define PB_ENET_TENA ((uint)0x00001000)
532#define PC_ENET_CLSN ((ushort)0x0010)
533#define PC_ENET_RENA ((ushort)0x0020)
534
535/* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
536 * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
537 */
538#define SICR_ENET_MASK ((uint)0x000000ff)
539#define SICR_ENET_CLKRT ((uint)0x0000003d)
540#endif
541
542/* SCC Event register as used by Ethernet.
543*/
544#define SCCE_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
545#define SCCE_ENET_TXE ((ushort)0x0010) /* Transmit Error */
546#define SCCE_ENET_RXF ((ushort)0x0008) /* Full frame received */
547#define SCCE_ENET_BSY ((ushort)0x0004) /* All incoming buffers full */
548#define SCCE_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
549#define SCCE_ENET_RXB ((ushort)0x0001) /* A buffer was received */
550
551/* SCC Mode Register (PMSR) as used by Ethernet.
552*/
553#define SCC_PMSR_HBC ((ushort)0x8000) /* Enable heartbeat */
554#define SCC_PMSR_FC ((ushort)0x4000) /* Force collision */
555#define SCC_PMSR_RSH ((ushort)0x2000) /* Receive short frames */
556#define SCC_PMSR_IAM ((ushort)0x1000) /* Check individual hash */
557#define SCC_PMSR_ENCRC ((ushort)0x0800) /* Ethernet CRC mode */
558#define SCC_PMSR_PRO ((ushort)0x0200) /* Promiscuous mode */
559#define SCC_PMSR_BRO ((ushort)0x0100) /* Catch broadcast pkts */
560#define SCC_PMSR_SBT ((ushort)0x0080) /* Special backoff timer */
561#define SCC_PMSR_LPB ((ushort)0x0040) /* Set Loopback mode */
562#define SCC_PMSR_SIP ((ushort)0x0020) /* Sample Input Pins */
563#define SCC_PMSR_LCW ((ushort)0x0010) /* Late collision window */
564#define SCC_PMSR_NIB22 ((ushort)0x000a) /* Start frame search */
565#define SCC_PMSR_FDE ((ushort)0x0001) /* Full duplex enable */
566
567/* Buffer descriptor control/status used by Ethernet receive.
568*/
569#define BD_ENET_RX_EMPTY ((ushort)0x8000)
570#define BD_ENET_RX_WRAP ((ushort)0x2000)
571#define BD_ENET_RX_INTR ((ushort)0x1000)
572#define BD_ENET_RX_LAST ((ushort)0x0800)
573#define BD_ENET_RX_FIRST ((ushort)0x0400)
574#define BD_ENET_RX_MISS ((ushort)0x0100)
575#define BD_ENET_RX_LG ((ushort)0x0020)
576#define BD_ENET_RX_NO ((ushort)0x0010)
577#define BD_ENET_RX_SH ((ushort)0x0008)
578#define BD_ENET_RX_CR ((ushort)0x0004)
579#define BD_ENET_RX_OV ((ushort)0x0002)
580#define BD_ENET_RX_CL ((ushort)0x0001)
581#define BD_ENET_RX_STATS ((ushort)0x013f) /* All status bits */
582
583/* Buffer descriptor control/status used by Ethernet transmit.
584*/
585#define BD_ENET_TX_READY ((ushort)0x8000)
586#define BD_ENET_TX_PAD ((ushort)0x4000)
587#define BD_ENET_TX_WRAP ((ushort)0x2000)
588#define BD_ENET_TX_INTR ((ushort)0x1000)
589#define BD_ENET_TX_LAST ((ushort)0x0800)
590#define BD_ENET_TX_TC ((ushort)0x0400)
591#define BD_ENET_TX_DEF ((ushort)0x0200)
592#define BD_ENET_TX_HB ((ushort)0x0100)
593#define BD_ENET_TX_LC ((ushort)0x0080)
594#define BD_ENET_TX_RL ((ushort)0x0040)
595#define BD_ENET_TX_RCMASK ((ushort)0x003c)
596#define BD_ENET_TX_UN ((ushort)0x0002)
597#define BD_ENET_TX_CSL ((ushort)0x0001)
598#define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */
599
600/* SCC as UART
601*/
602typedef struct scc_uart {
603 sccp_t scc_genscc;
604 uint scc_res1; /* Reserved */
605 uint scc_res2; /* Reserved */
606 ushort scc_maxidl; /* Maximum idle chars */
607 ushort scc_idlc; /* temp idle counter */
608 ushort scc_brkcr; /* Break count register */
609 ushort scc_parec; /* receive parity error counter */
610 ushort scc_frmec; /* receive framing error counter */
611 ushort scc_nosec; /* receive noise counter */
612 ushort scc_brkec; /* receive break condition counter */
613 ushort scc_brkln; /* last received break length */
614 ushort scc_uaddr1; /* UART address character 1 */
615 ushort scc_uaddr2; /* UART address character 2 */
616 ushort scc_rtemp; /* Temp storage */
617 ushort scc_toseq; /* Transmit out of sequence char */
618 ushort scc_char1; /* control character 1 */
619 ushort scc_char2; /* control character 2 */
620 ushort scc_char3; /* control character 3 */
621 ushort scc_char4; /* control character 4 */
622 ushort scc_char5; /* control character 5 */
623 ushort scc_char6; /* control character 6 */
624 ushort scc_char7; /* control character 7 */
625 ushort scc_char8; /* control character 8 */
626 ushort scc_rccm; /* receive control character mask */
627 ushort scc_rccr; /* receive control character register */
628 ushort scc_rlbc; /* receive last break character */
629} scc_uart_t;
630
631/* SCC Event and Mask registers when it is used as a UART.
632*/
633#define UART_SCCM_GLR ((ushort)0x1000)
634#define UART_SCCM_GLT ((ushort)0x0800)
635#define UART_SCCM_AB ((ushort)0x0200)
636#define UART_SCCM_IDL ((ushort)0x0100)
637#define UART_SCCM_GRA ((ushort)0x0080)
638#define UART_SCCM_BRKE ((ushort)0x0040)
639#define UART_SCCM_BRKS ((ushort)0x0020)
640#define UART_SCCM_CCR ((ushort)0x0008)
641#define UART_SCCM_BSY ((ushort)0x0004)
642#define UART_SCCM_TX ((ushort)0x0002)
643#define UART_SCCM_RX ((ushort)0x0001)
644
645/* The SCC PMSR when used as a UART.
646*/
647#define SCU_PMSR_FLC ((ushort)0x8000)
648#define SCU_PMSR_SL ((ushort)0x4000)
649#define SCU_PMSR_CL ((ushort)0x3000)
650#define SCU_PMSR_UM ((ushort)0x0c00)
651#define SCU_PMSR_FRZ ((ushort)0x0200)
652#define SCU_PMSR_RZS ((ushort)0x0100)
653#define SCU_PMSR_SYN ((ushort)0x0080)
654#define SCU_PMSR_DRT ((ushort)0x0040)
655#define SCU_PMSR_PEN ((ushort)0x0010)
656#define SCU_PMSR_RPM ((ushort)0x000c)
657#define SCU_PMSR_REVP ((ushort)0x0008)
658#define SCU_PMSR_TPM ((ushort)0x0003)
659#define SCU_PMSR_TEVP ((ushort)0x0003)
660
661/* CPM Transparent mode SCC.
662 */
663typedef struct scc_trans {
664 sccp_t st_genscc;
665 uint st_cpres; /* Preset CRC */
666 uint st_cmask; /* Constant mask for CRC */
667} scc_trans_t;
668
669#define BD_SCC_TX_LAST ((ushort)0x0800)
670
671
672
673/* CPM interrupts. There are nearly 32 interrupts generated by CPM
674 * channels or devices. All of these are presented to the PPC core
675 * as a single interrupt. The CPM interrupt handler dispatches its
676 * own handlers, in a similar fashion to the PPC core handler. We
677 * use the table as defined in the manuals (i.e. no special high
678 * priority and SCC1 == SCCa, etc...).
679 */
680/* #define CPMVEC_NR 32 */
681/* #define CPMVEC_PIO_PC15 ((ushort)0x1f) */
682/* #define CPMVEC_SCC1 ((ushort)0x1e) */
683/* #define CPMVEC_SCC2 ((ushort)0x1d) */
684/* #define CPMVEC_SCC3 ((ushort)0x1c) */
685/* #define CPMVEC_SCC4 ((ushort)0x1b) */
686/* #define CPMVEC_PIO_PC14 ((ushort)0x1a) */
687/* #define CPMVEC_TIMER1 ((ushort)0x19) */
688/* #define CPMVEC_PIO_PC13 ((ushort)0x18) */
689/* #define CPMVEC_PIO_PC12 ((ushort)0x17) */
690/* #define CPMVEC_SDMA_CB_ERR ((ushort)0x16) */
691/* #define CPMVEC_IDMA1 ((ushort)0x15) */
692/* #define CPMVEC_IDMA2 ((ushort)0x14) */
693/* #define CPMVEC_TIMER2 ((ushort)0x12) */
694/* #define CPMVEC_RISCTIMER ((ushort)0x11) */
695/* #define CPMVEC_I2C ((ushort)0x10) */
696/* #define CPMVEC_PIO_PC11 ((ushort)0x0f) */
697/* #define CPMVEC_PIO_PC10 ((ushort)0x0e) */
698/* #define CPMVEC_TIMER3 ((ushort)0x0c) */
699/* #define CPMVEC_PIO_PC9 ((ushort)0x0b) */
700/* #define CPMVEC_PIO_PC8 ((ushort)0x0a) */
701/* #define CPMVEC_PIO_PC7 ((ushort)0x09) */
702/* #define CPMVEC_TIMER4 ((ushort)0x07) */
703/* #define CPMVEC_PIO_PC6 ((ushort)0x06) */
704/* #define CPMVEC_SPI ((ushort)0x05) */
705/* #define CPMVEC_SMC1 ((ushort)0x04) */
706/* #define CPMVEC_SMC2 ((ushort)0x03) */
707/* #define CPMVEC_PIO_PC5 ((ushort)0x02) */
708/* #define CPMVEC_PIO_PC4 ((ushort)0x01) */
709/* #define CPMVEC_ERROR ((ushort)0x00) */
710
711extern void cpm_install_handler(int vec, void (*handler)(void *), void *dev_id);
712
713/* CPM interrupt configuration vector.
714*/
715#define CICR_SCD_SCC4 ((uint)0x00c00000) /* SCC4 @ SCCd */
716#define CICR_SCC_SCC3 ((uint)0x00200000) /* SCC3 @ SCCc */
717#define CICR_SCB_SCC2 ((uint)0x00040000) /* SCC2 @ SCCb */
718#define CICR_SCA_SCC1 ((uint)0x00000000) /* SCC1 @ SCCa */
719#define CICR_IRL_MASK ((uint)0x0000e000) /* Core interrrupt */
720#define CICR_HP_MASK ((uint)0x00001f00) /* Hi-pri int. */
721#define CICR_IEN ((uint)0x00000080) /* Int. enable */
722#define CICR_SPS ((uint)0x00000001) /* SCC Spread */
723#endif /* __CPM_360__ */
diff --git a/include/asm-m68knommu/cputime.h b/include/asm-m68knommu/cputime.h
new file mode 100644
index 000000000000..a0c4a660878d
--- /dev/null
+++ b/include/asm-m68knommu/cputime.h
@@ -0,0 +1,6 @@
1#ifndef __M68KNOMMU_CPUTIME_H
2#define __M68KNOMMU_CPUTIME_H
3
4#include <asm-generic/cputime.h>
5
6#endif /* __M68KNOMMU_CPUTIME_H */
diff --git a/include/asm-m68knommu/current.h b/include/asm-m68knommu/current.h
new file mode 100644
index 000000000000..53ee0f9f7cef
--- /dev/null
+++ b/include/asm-m68knommu/current.h
@@ -0,0 +1,24 @@
1#ifndef _M68KNOMMU_CURRENT_H
2#define _M68KNOMMU_CURRENT_H
3/*
4 * current.h
5 * (C) Copyright 2000, Lineo, David McCullough <davidm@uclinux.org>
6 * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
7 *
8 * rather than dedicate a register (as the m68k source does), we
9 * just keep a global, we should probably just change it all to be
10 * current and lose _current_task.
11 */
12
13#include <linux/thread_info.h>
14
15struct task_struct;
16
17static inline struct task_struct *get_current(void)
18{
19 return(current_thread_info()->task);
20}
21
22#define current get_current()
23
24#endif /* _M68KNOMMU_CURRENT_H */
diff --git a/include/asm-m68knommu/dbg.h b/include/asm-m68knommu/dbg.h
new file mode 100644
index 000000000000..27af3270f671
--- /dev/null
+++ b/include/asm-m68knommu/dbg.h
@@ -0,0 +1,6 @@
1#define DEBUG 1
2#ifdef CONFIG_COLDFIRE
3#define BREAK asm volatile ("halt")
4#else
5#define BREAK *(volatile unsigned char *)0xdeadbee0 = 0
6#endif
diff --git a/include/asm-m68knommu/delay.h b/include/asm-m68knommu/delay.h
new file mode 100644
index 000000000000..e3a976254672
--- /dev/null
+++ b/include/asm-m68knommu/delay.h
@@ -0,0 +1,76 @@
1#ifndef _M68KNOMMU_DELAY_H
2#define _M68KNOMMU_DELAY_H
3
4/*
5 * Copyright (C) 1994 Hamish Macdonald
6 * Copyright (C) 2004 Greg Ungerer <gerg@snapgear.com>
7 */
8
9#include <asm/param.h>
10
11extern __inline__ void __delay(unsigned long loops)
12{
13#if defined(CONFIG_COLDFIRE)
14 /* The coldfire runs this loop at significantly different speeds
15 * depending upon long word alignment or not. We'll pad it to
16 * long word alignment which is the faster version.
17 * The 0x4a8e is of course a 'tstl %fp' instruction. This is better
18 * than using a NOP (0x4e71) instruction because it executes in one
19 * cycle not three and doesn't allow for an arbitary delay waiting
20 * for bus cycles to finish. Also fp/a6 isn't likely to cause a
21 * stall waiting for the register to become valid if such is added
22 * to the coldfire at some stage.
23 */
24 __asm__ __volatile__ ( ".balignw 4, 0x4a8e\n\t"
25 "1: subql #1, %0\n\t"
26 "jcc 1b"
27 : "=d" (loops) : "0" (loops));
28#else
29 __asm__ __volatile__ ( "1: subql #1, %0\n\t"
30 "jcc 1b"
31 : "=d" (loops) : "0" (loops));
32#endif
33}
34
35/*
36 * Ideally we use a 32*32->64 multiply to calculate the number of
37 * loop iterations, but the older standard 68k and ColdFire do not
38 * have this instruction. So for them we have a clsoe approximation
39 * loop using 32*32->32 multiplies only. This calculation based on
40 * the ARM version of delay.
41 *
42 * We want to implement:
43 *
44 * loops = (usecs * 0x10c6 * HZ * loops_per_jiffy) / 2^32
45 */
46
47#define HZSCALE (268435456 / (1000000/HZ))
48
49extern unsigned long loops_per_jiffy;
50
51extern __inline__ void _udelay(unsigned long usecs)
52{
53#if defined(CONFIG_M68328) || defined(CONFIG_M68EZ328) || \
54 defined(CONFIG_M68VZ328) || defined(CONFIG_M68360) || \
55 defined(CONFIG_COLDFIRE)
56 __delay((((usecs * HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6);
57#else
58 unsigned long tmp;
59
60 usecs *= 4295; /* 2**32 / 1000000 */
61 __asm__ ("mulul %2,%0:%1"
62 : "=d" (usecs), "=d" (tmp)
63 : "d" (usecs), "1" (loops_per_jiffy*HZ));
64 __delay(usecs);
65#endif
66}
67
68/*
69 * Moved the udelay() function into library code, no longer inlined.
70 * I had to change the algorithm because we are overflowing now on
71 * the faster ColdFire parts. The code is a little biger, so it makes
72 * sense to library it.
73 */
74extern void udelay(unsigned long usecs);
75
76#endif /* defined(_M68KNOMMU_DELAY_H) */
diff --git a/include/asm-m68knommu/div64.h b/include/asm-m68knommu/div64.h
new file mode 100644
index 000000000000..6cd978cefb28
--- /dev/null
+++ b/include/asm-m68knommu/div64.h
@@ -0,0 +1 @@
#include <asm-generic/div64.h>
diff --git a/include/asm-m68knommu/dma-mapping.h b/include/asm-m68knommu/dma-mapping.h
new file mode 100644
index 000000000000..a6c42ba48da6
--- /dev/null
+++ b/include/asm-m68knommu/dma-mapping.h
@@ -0,0 +1,10 @@
1#ifndef _M68KNOMMU_DMA_MAPPING_H
2#define _M68KNOMMU_DMA_MAPPING_H
3
4#include <linux/config.h>
5
6#ifdef CONFIG_PCI
7#include <asm-generic/dma-mapping.h>
8#endif
9
10#endif /* _M68KNOMMU_DMA_MAPPING_H */
diff --git a/include/asm-m68knommu/dma.h b/include/asm-m68knommu/dma.h
new file mode 100644
index 000000000000..43e98c96a5c2
--- /dev/null
+++ b/include/asm-m68knommu/dma.h
@@ -0,0 +1,492 @@
1#ifndef _M68K_DMA_H
2#define _M68K_DMA_H 1
3
4//#define DMA_DEBUG 1
5
6#include <linux/config.h>
7
8#ifdef CONFIG_COLDFIRE
9/*
10 * ColdFire DMA Model:
11 * ColdFire DMA supports two forms of DMA: Single and Dual address. Single
12 * address mode emits a source address, and expects that the device will either
13 * pick up the data (DMA READ) or source data (DMA WRITE). This implies that
14 * the device will place data on the correct byte(s) of the data bus, as the
15 * memory transactions are always 32 bits. This implies that only 32 bit
16 * devices will find single mode transfers useful. Dual address DMA mode
17 * performs two cycles: source read and destination write. ColdFire will
18 * align the data so that the device will always get the correct bytes, thus
19 * is useful for 8 and 16 bit devices. This is the mode that is supported
20 * below.
21 *
22 * AUG/22/2000 : added support for 32-bit Dual-Address-Mode (K) 2000
23 * Oliver Kamphenkel (O.Kamphenkel@tu-bs.de)
24 *
25 * AUG/25/2000 : addad support for 8, 16 and 32-bit Single-Address-Mode (K)2000
26 * Oliver Kamphenkel (O.Kamphenkel@tu-bs.de)
27 *
28 * APR/18/2002 : added proper support for MCF5272 DMA controller.
29 * Arthur Shipkowski (art@videon-central.com)
30 */
31
32#include <asm/coldfire.h>
33#include <asm/mcfsim.h>
34#include <asm/mcfdma.h>
35
36/*
37 * Set number of channels of DMA on ColdFire for different implementations.
38 */
39#if defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407)
40#define MAX_M68K_DMA_CHANNELS 4
41#elif defined(CONFIG_M5272)
42#define MAX_M68K_DMA_CHANNELS 1
43#else
44#define MAX_M68K_DMA_CHANNELS 2
45#endif
46
47extern unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS];
48extern unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
49
50#if !defined(CONFIG_M5272)
51#define DMA_MODE_WRITE_BIT 0x01 /* Memory/IO to IO/Memory select */
52#define DMA_MODE_WORD_BIT 0x02 /* 8 or 16 bit transfers */
53#define DMA_MODE_LONG_BIT 0x04 /* or 32 bit transfers */
54#define DMA_MODE_SINGLE_BIT 0x08 /* single-address-mode */
55
56/* I/O to memory, 8 bits, mode */
57#define DMA_MODE_READ 0
58/* memory to I/O, 8 bits, mode */
59#define DMA_MODE_WRITE 1
60/* I/O to memory, 16 bits, mode */
61#define DMA_MODE_READ_WORD 2
62/* memory to I/O, 16 bits, mode */
63#define DMA_MODE_WRITE_WORD 3
64/* I/O to memory, 32 bits, mode */
65#define DMA_MODE_READ_LONG 4
66/* memory to I/O, 32 bits, mode */
67#define DMA_MODE_WRITE_LONG 5
68/* I/O to memory, 8 bits, single-address-mode */
69#define DMA_MODE_READ_SINGLE 8
70/* memory to I/O, 8 bits, single-address-mode */
71#define DMA_MODE_WRITE_SINGLE 9
72/* I/O to memory, 16 bits, single-address-mode */
73#define DMA_MODE_READ_WORD_SINGLE 10
74/* memory to I/O, 16 bits, single-address-mode */
75#define DMA_MODE_WRITE_WORD_SINGLE 11
76/* I/O to memory, 32 bits, single-address-mode */
77#define DMA_MODE_READ_LONG_SINGLE 12
78/* memory to I/O, 32 bits, single-address-mode */
79#define DMA_MODE_WRITE_LONG_SINGLE 13
80
81#else /* CONFIG_M5272 is defined */
82
83/* Source static-address mode */
84#define DMA_MODE_SRC_SA_BIT 0x01
85/* Two bits to select between all four modes */
86#define DMA_MODE_SSIZE_MASK 0x06
87/* Offset to shift bits in */
88#define DMA_MODE_SSIZE_OFF 0x01
89/* Destination static-address mode */
90#define DMA_MODE_DES_SA_BIT 0x10
91/* Two bits to select between all four modes */
92#define DMA_MODE_DSIZE_MASK 0x60
93/* Offset to shift bits in */
94#define DMA_MODE_DSIZE_OFF 0x05
95/* Size modifiers */
96#define DMA_MODE_SIZE_LONG 0x00
97#define DMA_MODE_SIZE_BYTE 0x01
98#define DMA_MODE_SIZE_WORD 0x02
99#define DMA_MODE_SIZE_LINE 0x03
100
101/*
102 * Aliases to help speed quick ports; these may be suboptimal, however. They
103 * do not include the SINGLE mode modifiers since the MCF5272 does not have a
104 * mode where the device is in control of its addressing.
105 */
106
107/* I/O to memory, 8 bits, mode */
108#define DMA_MODE_READ ((DMA_MODE_SIZE_BYTE << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_BYTE << DMA_MODE_SSIZE_OFF) | DMA_SRC_SA_BIT)
109/* memory to I/O, 8 bits, mode */
110#define DMA_MODE_WRITE ((DMA_MODE_SIZE_BYTE << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_BYTE << DMA_MODE_SSIZE_OFF) | DMA_DES_SA_BIT)
111/* I/O to memory, 16 bits, mode */
112#define DMA_MODE_READ_WORD ((DMA_MODE_SIZE_WORD << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_WORD << DMA_MODE_SSIZE_OFF) | DMA_SRC_SA_BIT)
113/* memory to I/O, 16 bits, mode */
114#define DMA_MODE_WRITE_WORD ((DMA_MODE_SIZE_WORD << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_WORD << DMA_MODE_SSIZE_OFF) | DMA_DES_SA_BIT)
115/* I/O to memory, 32 bits, mode */
116#define DMA_MODE_READ_LONG ((DMA_MODE_SIZE_LONG << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_LONG << DMA_MODE_SSIZE_OFF) | DMA_SRC_SA_BIT)
117/* memory to I/O, 32 bits, mode */
118#define DMA_MODE_WRITE_LONG ((DMA_MODE_SIZE_LONG << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_LONG << DMA_MODE_SSIZE_OFF) | DMA_DES_SA_BIT)
119
120#endif /* !defined(CONFIG_M5272) */
121
122#if !defined(CONFIG_M5272)
123/* enable/disable a specific DMA channel */
124static __inline__ void enable_dma(unsigned int dmanr)
125{
126 volatile unsigned short *dmawp;
127
128#ifdef DMA_DEBUG
129 printk("enable_dma(dmanr=%d)\n", dmanr);
130#endif
131
132 dmawp = (unsigned short *) dma_base_addr[dmanr];
133 dmawp[MCFDMA_DCR] |= MCFDMA_DCR_EEXT;
134}
135
136static __inline__ void disable_dma(unsigned int dmanr)
137{
138 volatile unsigned short *dmawp;
139 volatile unsigned char *dmapb;
140
141#ifdef DMA_DEBUG
142 printk("disable_dma(dmanr=%d)\n", dmanr);
143#endif
144
145 dmawp = (unsigned short *) dma_base_addr[dmanr];
146 dmapb = (unsigned char *) dma_base_addr[dmanr];
147
148 /* Turn off external requests, and stop any DMA in progress */
149 dmawp[MCFDMA_DCR] &= ~MCFDMA_DCR_EEXT;
150 dmapb[MCFDMA_DSR] = MCFDMA_DSR_DONE;
151}
152
153/*
154 * Clear the 'DMA Pointer Flip Flop'.
155 * Write 0 for LSB/MSB, 1 for MSB/LSB access.
156 * Use this once to initialize the FF to a known state.
157 * After that, keep track of it. :-)
158 * --- In order to do that, the DMA routines below should ---
159 * --- only be used while interrupts are disabled! ---
160 *
161 * This is a NOP for ColdFire. Provide a stub for compatibility.
162 */
163static __inline__ void clear_dma_ff(unsigned int dmanr)
164{
165}
166
167/* set mode (above) for a specific DMA channel */
168static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
169{
170
171 volatile unsigned char *dmabp;
172 volatile unsigned short *dmawp;
173
174#ifdef DMA_DEBUG
175 printk("set_dma_mode(dmanr=%d,mode=%d)\n", dmanr, mode);
176#endif
177
178 dmabp = (unsigned char *) dma_base_addr[dmanr];
179 dmawp = (unsigned short *) dma_base_addr[dmanr];
180
181 // Clear config errors
182 dmabp[MCFDMA_DSR] = MCFDMA_DSR_DONE;
183
184 // Set command register
185 dmawp[MCFDMA_DCR] =
186 MCFDMA_DCR_INT | // Enable completion irq
187 MCFDMA_DCR_CS | // Force one xfer per request
188 MCFDMA_DCR_AA | // Enable auto alignment
189 // single-address-mode
190 ((mode & DMA_MODE_SINGLE_BIT) ? MCFDMA_DCR_SAA : 0) |
191 // sets s_rw (-> r/w) high if Memory to I/0
192 ((mode & DMA_MODE_WRITE_BIT) ? MCFDMA_DCR_S_RW : 0) |
193 // Memory to I/O or I/O to Memory
194 ((mode & DMA_MODE_WRITE_BIT) ? MCFDMA_DCR_SINC : MCFDMA_DCR_DINC) |
195 // 32 bit, 16 bit or 8 bit transfers
196 ((mode & DMA_MODE_WORD_BIT) ? MCFDMA_DCR_SSIZE_WORD :
197 ((mode & DMA_MODE_LONG_BIT) ? MCFDMA_DCR_SSIZE_LONG :
198 MCFDMA_DCR_SSIZE_BYTE)) |
199 ((mode & DMA_MODE_WORD_BIT) ? MCFDMA_DCR_DSIZE_WORD :
200 ((mode & DMA_MODE_LONG_BIT) ? MCFDMA_DCR_DSIZE_LONG :
201 MCFDMA_DCR_DSIZE_BYTE));
202
203#ifdef DEBUG_DMA
204 printk("%s(%d): dmanr=%d DSR[%x]=%x DCR[%x]=%x\n", __FILE__, __LINE__,
205 dmanr, (int) &dmabp[MCFDMA_DSR], dmabp[MCFDMA_DSR],
206 (int) &dmawp[MCFDMA_DCR], dmawp[MCFDMA_DCR]);
207#endif
208}
209
210/* Set transfer address for specific DMA channel */
211static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
212{
213 volatile unsigned short *dmawp;
214 volatile unsigned int *dmalp;
215
216#ifdef DMA_DEBUG
217 printk("set_dma_addr(dmanr=%d,a=%x)\n", dmanr, a);
218#endif
219
220 dmawp = (unsigned short *) dma_base_addr[dmanr];
221 dmalp = (unsigned int *) dma_base_addr[dmanr];
222
223 // Determine which address registers are used for memory/device accesses
224 if (dmawp[MCFDMA_DCR] & MCFDMA_DCR_SINC) {
225 // Source incrementing, must be memory
226 dmalp[MCFDMA_SAR] = a;
227 // Set dest address, must be device
228 dmalp[MCFDMA_DAR] = dma_device_address[dmanr];
229 } else {
230 // Destination incrementing, must be memory
231 dmalp[MCFDMA_DAR] = a;
232 // Set source address, must be device
233 dmalp[MCFDMA_SAR] = dma_device_address[dmanr];
234 }
235
236#ifdef DEBUG_DMA
237 printk("%s(%d): dmanr=%d DCR[%x]=%x SAR[%x]=%08x DAR[%x]=%08x\n",
238 __FILE__, __LINE__, dmanr, (int) &dmawp[MCFDMA_DCR], dmawp[MCFDMA_DCR],
239 (int) &dmalp[MCFDMA_SAR], dmalp[MCFDMA_SAR],
240 (int) &dmalp[MCFDMA_DAR], dmalp[MCFDMA_DAR]);
241#endif
242}
243
244/*
245 * Specific for Coldfire - sets device address.
246 * Should be called after the mode set call, and before set DMA address.
247 */
248static __inline__ void set_dma_device_addr(unsigned int dmanr, unsigned int a)
249{
250#ifdef DMA_DEBUG
251 printk("set_dma_device_addr(dmanr=%d,a=%x)\n", dmanr, a);
252#endif
253
254 dma_device_address[dmanr] = a;
255}
256
257/*
258 * NOTE 2: "count" represents _bytes_.
259 */
260static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
261{
262 volatile unsigned short *dmawp;
263
264#ifdef DMA_DEBUG
265 printk("set_dma_count(dmanr=%d,count=%d)\n", dmanr, count);
266#endif
267
268 dmawp = (unsigned short *) dma_base_addr[dmanr];
269 dmawp[MCFDMA_BCR] = (unsigned short)count;
270}
271
272/*
273 * Get DMA residue count. After a DMA transfer, this
274 * should return zero. Reading this while a DMA transfer is
275 * still in progress will return unpredictable results.
276 * Otherwise, it returns the number of _bytes_ left to transfer.
277 */
278static __inline__ int get_dma_residue(unsigned int dmanr)
279{
280 volatile unsigned short *dmawp;
281 unsigned short count;
282
283#ifdef DMA_DEBUG
284 printk("get_dma_residue(dmanr=%d)\n", dmanr);
285#endif
286
287 dmawp = (unsigned short *) dma_base_addr[dmanr];
288 count = dmawp[MCFDMA_BCR];
289 return((int) count);
290}
291#else /* CONFIG_M5272 is defined */
292
293/*
294 * The MCF5272 DMA controller is very different than the controller defined above
295 * in terms of register mapping. For instance, with the exception of the 16-bit
296 * interrupt register (IRQ#85, for reference), all of the registers are 32-bit.
297 *
298 * The big difference, however, is the lack of device-requested DMA. All modes
299 * are dual address transfer, and there is no 'device' setup or direction bit.
300 * You can DMA between a device and memory, between memory and memory, or even between
301 * two devices directly, with any combination of incrementing and non-incrementing
302 * addresses you choose. This puts a crimp in distinguishing between the 'device
303 * address' set up by set_dma_device_addr.
304 *
305 * Therefore, there are two options. One is to use set_dma_addr and set_dma_device_addr,
306 * which will act exactly as above in -- it will look to see if the source is set to
307 * autoincrement, and if so it will make the source use the set_dma_addr value and the
308 * destination the set_dma_device_addr value. Otherwise the source will be set to the
309 * set_dma_device_addr value and the destination will get the set_dma_addr value.
310 *
311 * The other is to use the provided set_dma_src_addr and set_dma_dest_addr functions
312 * and make it explicit. Depending on what you're doing, one of these two should work
313 * for you, but don't mix them in the same transfer setup.
314 */
315
316/* enable/disable a specific DMA channel */
317static __inline__ void enable_dma(unsigned int dmanr)
318{
319 volatile unsigned int *dmalp;
320
321#ifdef DMA_DEBUG
322 printk("enable_dma(dmanr=%d)\n", dmanr);
323#endif
324
325 dmalp = (unsigned int *) dma_base_addr[dmanr];
326 dmalp[MCFDMA_DMR] |= MCFDMA_DMR_EN;
327}
328
329static __inline__ void disable_dma(unsigned int dmanr)
330{
331 volatile unsigned int *dmalp;
332
333#ifdef DMA_DEBUG
334 printk("disable_dma(dmanr=%d)\n", dmanr);
335#endif
336
337 dmalp = (unsigned int *) dma_base_addr[dmanr];
338
339 /* Turn off external requests, and stop any DMA in progress */
340 dmalp[MCFDMA_DMR] &= ~MCFDMA_DMR_EN;
341 dmalp[MCFDMA_DMR] |= MCFDMA_DMR_RESET;
342}
343
344/*
345 * Clear the 'DMA Pointer Flip Flop'.
346 * Write 0 for LSB/MSB, 1 for MSB/LSB access.
347 * Use this once to initialize the FF to a known state.
348 * After that, keep track of it. :-)
349 * --- In order to do that, the DMA routines below should ---
350 * --- only be used while interrupts are disabled! ---
351 *
352 * This is a NOP for ColdFire. Provide a stub for compatibility.
353 */
354static __inline__ void clear_dma_ff(unsigned int dmanr)
355{
356}
357
358/* set mode (above) for a specific DMA channel */
359static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
360{
361
362 volatile unsigned int *dmalp;
363 volatile unsigned short *dmawp;
364
365#ifdef DMA_DEBUG
366 printk("set_dma_mode(dmanr=%d,mode=%d)\n", dmanr, mode);
367#endif
368 dmalp = (unsigned int *) dma_base_addr[dmanr];
369 dmawp = (unsigned short *) dma_base_addr[dmanr];
370
371 // Clear config errors
372 dmalp[MCFDMA_DMR] |= MCFDMA_DMR_RESET;
373
374 // Set command register
375 dmalp[MCFDMA_DMR] =
376 MCFDMA_DMR_RQM_DUAL | // Mandatory Request Mode setting
377 MCFDMA_DMR_DSTT_SD | // Set up addressing types; set to supervisor-data.
378 MCFDMA_DMR_SRCT_SD | // Set up addressing types; set to supervisor-data.
379 // source static-address-mode
380 ((mode & DMA_MODE_SRC_SA_BIT) ? MCFDMA_DMR_SRCM_SA : MCFDMA_DMR_SRCM_IA) |
381 // dest static-address-mode
382 ((mode & DMA_MODE_DES_SA_BIT) ? MCFDMA_DMR_DSTM_SA : MCFDMA_DMR_DSTM_IA) |
383 // burst, 32 bit, 16 bit or 8 bit transfers are separately configurable on the MCF5272
384 (((mode & DMA_MODE_SSIZE_MASK) >> DMA_MODE_SSIZE_OFF) << MCFDMA_DMR_DSTS_OFF) |
385 (((mode & DMA_MODE_SSIZE_MASK) >> DMA_MODE_SSIZE_OFF) << MCFDMA_DMR_SRCS_OFF);
386
387 dmawp[MCFDMA_DIR] |= MCFDMA_DIR_ASCEN; /* Enable completion interrupts */
388
389#ifdef DEBUG_DMA
390 printk("%s(%d): dmanr=%d DMR[%x]=%x DIR[%x]=%x\n", __FILE__, __LINE__,
391 dmanr, (int) &dmalp[MCFDMA_DMR], dmabp[MCFDMA_DMR],
392 (int) &dmawp[MCFDMA_DIR], dmawp[MCFDMA_DIR]);
393#endif
394}
395
396/* Set transfer address for specific DMA channel */
397static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
398{
399 volatile unsigned int *dmalp;
400
401#ifdef DMA_DEBUG
402 printk("set_dma_addr(dmanr=%d,a=%x)\n", dmanr, a);
403#endif
404
405 dmalp = (unsigned int *) dma_base_addr[dmanr];
406
407 // Determine which address registers are used for memory/device accesses
408 if (dmalp[MCFDMA_DMR] & MCFDMA_DMR_SRCM) {
409 // Source incrementing, must be memory
410 dmalp[MCFDMA_DSAR] = a;
411 // Set dest address, must be device
412 dmalp[MCFDMA_DDAR] = dma_device_address[dmanr];
413 } else {
414 // Destination incrementing, must be memory
415 dmalp[MCFDMA_DDAR] = a;
416 // Set source address, must be device
417 dmalp[MCFDMA_DSAR] = dma_device_address[dmanr];
418 }
419
420#ifdef DEBUG_DMA
421 printk("%s(%d): dmanr=%d DMR[%x]=%x SAR[%x]=%08x DAR[%x]=%08x\n",
422 __FILE__, __LINE__, dmanr, (int) &dmawp[MCFDMA_DMR], dmawp[MCFDMA_DMR],
423 (int) &dmalp[MCFDMA_DSAR], dmalp[MCFDMA_DSAR],
424 (int) &dmalp[MCFDMA_DDAR], dmalp[MCFDMA_DDAR]);
425#endif
426}
427
428/*
429 * Specific for Coldfire - sets device address.
430 * Should be called after the mode set call, and before set DMA address.
431 */
432static __inline__ void set_dma_device_addr(unsigned int dmanr, unsigned int a)
433{
434#ifdef DMA_DEBUG
435 printk("set_dma_device_addr(dmanr=%d,a=%x)\n", dmanr, a);
436#endif
437
438 dma_device_address[dmanr] = a;
439}
440
441/*
442 * NOTE 2: "count" represents _bytes_.
443 *
444 * NOTE 3: While a 32-bit register, "count" is only a maximum 24-bit value.
445 */
446static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
447{
448 volatile unsigned int *dmalp;
449
450#ifdef DMA_DEBUG
451 printk("set_dma_count(dmanr=%d,count=%d)\n", dmanr, count);
452#endif
453
454 dmalp = (unsigned int *) dma_base_addr[dmanr];
455 dmalp[MCFDMA_DBCR] = count;
456}
457
458/*
459 * Get DMA residue count. After a DMA transfer, this
460 * should return zero. Reading this while a DMA transfer is
461 * still in progress will return unpredictable results.
462 * Otherwise, it returns the number of _bytes_ left to transfer.
463 */
464static __inline__ int get_dma_residue(unsigned int dmanr)
465{
466 volatile unsigned int *dmalp;
467 unsigned int count;
468
469#ifdef DMA_DEBUG
470 printk("get_dma_residue(dmanr=%d)\n", dmanr);
471#endif
472
473 dmalp = (unsigned int *) dma_base_addr[dmanr];
474 count = dmalp[MCFDMA_DBCR];
475 return(count);
476}
477
478#endif /* !defined(CONFIG_M5272) */
479#endif /* CONFIG_COLDFIRE */
480
481#define MAX_DMA_CHANNELS 8
482
483/* Don't define MAX_DMA_ADDRESS; it's useless on the m68k/coldfire and any
484 occurrence should be flagged as an error. */
485/* under 2.4 it is actually needed by the new bootmem allocator */
486#define MAX_DMA_ADDRESS PAGE_OFFSET
487
488/* These are in kernel/dma.c: */
489extern int request_dma(unsigned int dmanr, const char *device_id); /* reserve a DMA channel */
490extern void free_dma(unsigned int dmanr); /* release it again */
491
492#endif /* _M68K_DMA_H */
diff --git a/include/asm-m68knommu/elf.h b/include/asm-m68knommu/elf.h
new file mode 100644
index 000000000000..9919487703bc
--- /dev/null
+++ b/include/asm-m68knommu/elf.h
@@ -0,0 +1,113 @@
1#ifndef __ASMm68k_ELF_H
2#define __ASMm68k_ELF_H
3
4/*
5 * ELF register definitions..
6 */
7
8#include <linux/config.h>
9#include <asm/ptrace.h>
10#include <asm/user.h>
11
12/*
13 * 68k ELF relocation types
14 */
15#define R_68K_NONE 0
16#define R_68K_32 1
17#define R_68K_16 2
18#define R_68K_8 3
19#define R_68K_PC32 4
20#define R_68K_PC16 5
21#define R_68K_PC8 6
22#define R_68K_GOT32 7
23#define R_68K_GOT16 8
24#define R_68K_GOT8 9
25#define R_68K_GOT32O 10
26#define R_68K_GOT16O 11
27#define R_68K_GOT8O 12
28#define R_68K_PLT32 13
29#define R_68K_PLT16 14
30#define R_68K_PLT8 15
31#define R_68K_PLT32O 16
32#define R_68K_PLT16O 17
33#define R_68K_PLT8O 18
34#define R_68K_COPY 19
35#define R_68K_GLOB_DAT 20
36#define R_68K_JMP_SLOT 21
37#define R_68K_RELATIVE 22
38
39typedef unsigned long elf_greg_t;
40
41#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
42typedef elf_greg_t elf_gregset_t[ELF_NGREG];
43
44typedef struct user_m68kfp_struct elf_fpregset_t;
45
46/*
47 * This is used to ensure we don't load something for the wrong architecture.
48 */
49#define elf_check_arch(x) ((x)->e_machine == EM_68K)
50
51/*
52 * These are used to set parameters in the core dumps.
53 */
54#define ELF_CLASS ELFCLASS32
55#define ELF_DATA ELFDATA2MSB
56#define ELF_ARCH EM_68K
57
58/* For SVR4/m68k the function pointer to be registered with `atexit' is
59 passed in %a1. Although my copy of the ABI has no such statement, it
60 is actually used on ASV. */
61#define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0
62
63#define USE_ELF_CORE_DUMP
64#define ELF_EXEC_PAGESIZE 4096
65
66/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
67 use of this is to invoke "./ld.so someprog" to test out a new version of
68 the loader. We need to make sure that it is out of the way of the program
69 that it will "exec", and that there is sufficient room for the brk. */
70
71#define ELF_ET_DYN_BASE 0xD0000000UL
72
73#define ELF_CORE_COPY_REGS(pr_reg, regs) \
74 /* Bleech. */ \
75 pr_reg[0] = regs->d1; \
76 pr_reg[1] = regs->d2; \
77 pr_reg[2] = regs->d3; \
78 pr_reg[3] = regs->d4; \
79 pr_reg[4] = regs->d5; \
80 pr_reg[7] = regs->a0; \
81 pr_reg[8] = regs->a1; \
82 pr_reg[14] = regs->d0; \
83 pr_reg[15] = rdusp(); \
84 pr_reg[16] = 0 /* regs->orig_d0 */; \
85 pr_reg[17] = regs->sr; \
86 pr_reg[18] = regs->pc; \
87 /* pr_reg[19] = (regs->format << 12) | regs->vector; */ \
88 { \
89 struct switch_stack *sw = ((struct switch_stack *)regs) - 1; \
90 pr_reg[5] = sw->d6; \
91 pr_reg[6] = sw->d7; \
92 pr_reg[10] = sw->a3; \
93 pr_reg[11] = sw->a4; \
94 pr_reg[12] = sw->a5; \
95 pr_reg[13] = sw->a6; \
96 }
97
98/* This yields a mask that user programs can use to figure out what
99 instruction set this cpu supports. */
100
101#define ELF_HWCAP (0)
102
103/* This yields a string that ld.so will use to load implementation
104 specific libraries for optimization. This is more specific in
105 intent than poking at uname or /proc/cpuinfo. */
106
107#define ELF_PLATFORM (NULL)
108
109#ifdef __KERNEL__
110#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
111#endif
112
113#endif
diff --git a/include/asm-m68knommu/elia.h b/include/asm-m68knommu/elia.h
new file mode 100644
index 000000000000..f18b8e9d8c36
--- /dev/null
+++ b/include/asm-m68knommu/elia.h
@@ -0,0 +1,42 @@
1/****************************************************************************/
2
3/*
4 * elia.h -- Lineo (formerly Moreton Bay) eLIA platform support.
5 *
6 * (C) Copyright 1999-2000, Moreton Bay (www.moreton.com.au)
7 * (C) Copyright 1999-2000, Lineo (www.lineo.com)
8 */
9
10/****************************************************************************/
11#ifndef elia_h
12#define elia_h
13/****************************************************************************/
14
15#include <linux/config.h>
16#include <asm/coldfire.h>
17
18#ifdef CONFIG_eLIA
19
20/*
21 * The serial port DTR and DCD lines are also on the Parallel I/O
22 * as well, so define those too.
23 */
24
25#define eLIA_DCD1 0x0001
26#define eLIA_DCD0 0x0002
27#define eLIA_DTR1 0x0004
28#define eLIA_DTR0 0x0008
29
30#define eLIA_PCIRESET 0x0020
31
32/*
33 * Kernel macros to set and unset the LEDs.
34 */
35#ifndef __ASSEMBLY__
36extern unsigned short ppdata;
37#endif /* __ASSEMBLY__ */
38
39#endif /* CONFIG_eLIA */
40
41/****************************************************************************/
42#endif /* elia_h */
diff --git a/include/asm-m68knommu/entry.h b/include/asm-m68knommu/entry.h
new file mode 100644
index 000000000000..06f5aa70b0b5
--- /dev/null
+++ b/include/asm-m68knommu/entry.h
@@ -0,0 +1,183 @@
1#ifndef __M68KNOMMU_ENTRY_H
2#define __M68KNOMMU_ENTRY_H
3
4#include <linux/config.h>
5#include <asm/setup.h>
6#include <asm/page.h>
7
8/*
9 * Stack layout in 'ret_from_exception':
10 *
11 * This allows access to the syscall arguments in registers d1-d5
12 *
13 * 0(sp) - d1
14 * 4(sp) - d2
15 * 8(sp) - d3
16 * C(sp) - d4
17 * 10(sp) - d5
18 * 14(sp) - a0
19 * 18(sp) - a1
20 * 1C(sp) - a2
21 * 20(sp) - d0
22 * 24(sp) - orig_d0
23 * 28(sp) - stack adjustment
24 * 2C(sp) - [ sr ] [ format & vector ]
25 * 2E(sp) - [ pc-hiword ] [ sr ]
26 * 30(sp) - [ pc-loword ] [ pc-hiword ]
27 * 32(sp) - [ format & vector ] [ pc-loword ]
28 * ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
29 * M68K COLDFIRE
30 */
31
32#define ALLOWINT 0xf8ff
33
34#ifdef __ASSEMBLY__
35
36/* process bits for task_struct.flags */
37PF_TRACESYS_OFF = 3
38PF_TRACESYS_BIT = 5
39PF_PTRACED_OFF = 3
40PF_PTRACED_BIT = 4
41PF_DTRACE_OFF = 1
42PF_DTRACE_BIT = 5
43
44LENOSYS = 38
45
46#define SWITCH_STACK_SIZE (6*4+4) /* Includes return address */
47
48/*
49 * This defines the normal kernel pt-regs layout.
50 *
51 * regs are a2-a6 and d6-d7 preserved by C code
52 * the kernel doesn't mess with usp unless it needs to
53 */
54
55#ifdef CONFIG_COLDFIRE
56/*
57 * This is made a little more tricky on the ColdFire. There is no
58 * separate kernel and user stack pointers. Need to artificially
59 * construct a usp in software... When doing this we need to disable
60 * interrupts, otherwise bad things could happen.
61 */
62.macro SAVE_ALL
63 move #0x2700,%sr /* disable intrs */
64 btst #5,%sp@(2) /* from user? */
65 bnes 6f /* no, skip */
66 movel %sp,sw_usp /* save user sp */
67 addql #8,sw_usp /* remove exception */
68 movel sw_ksp,%sp /* kernel sp */
69 subql #8,%sp /* room for exception */
70 clrl %sp@- /* stkadj */
71 movel %d0,%sp@- /* orig d0 */
72 movel %d0,%sp@- /* d0 */
73 lea %sp@(-32),%sp /* space for 8 regs */
74 moveml %d1-%d5/%a0-%a2,%sp@
75 movel sw_usp,%a0 /* get usp */
76 movel %a0@-,%sp@(PT_PC) /* copy exception program counter */
77 movel %a0@-,%sp@(PT_FORMATVEC)/* copy exception format/vector/sr */
78 bra 7f
79 6:
80 clrl %sp@- /* stkadj */
81 movel %d0,%sp@- /* orig d0 */
82 movel %d0,%sp@- /* d0 */
83 lea %sp@(-32),%sp /* space for 8 regs */
84 moveml %d1-%d5/%a0-%a2,%sp@
85 7:
86.endm
87
88.macro RESTORE_ALL
89 btst #5,%sp@(PT_SR) /* going user? */
90 bnes 8f /* no, skip */
91 move #0x2700,%sr /* disable intrs */
92 movel sw_usp,%a0 /* get usp */
93 movel %sp@(PT_PC),%a0@- /* copy exception program counter */
94 movel %sp@(PT_FORMATVEC),%a0@-/* copy exception format/vector/sr */
95 moveml %sp@,%d1-%d5/%a0-%a2
96 lea %sp@(32),%sp /* space for 8 regs */
97 movel %sp@+,%d0
98 addql #4,%sp /* orig d0 */
99 addl %sp@+,%sp /* stkadj */
100 addql #8,%sp /* remove exception */
101 movel %sp,sw_ksp /* save ksp */
102 subql #8,sw_usp /* set exception */
103 movel sw_usp,%sp /* restore usp */
104 rte
105 8:
106 moveml %sp@,%d1-%d5/%a0-%a2
107 lea %sp@(32),%sp /* space for 8 regs */
108 movel %sp@+,%d0
109 addql #4,%sp /* orig d0 */
110 addl %sp@+,%sp /* stkadj */
111 rte
112.endm
113
114/*
115 * Quick exception save, use current stack only.
116 */
117.macro SAVE_LOCAL
118 move #0x2700,%sr /* disable intrs */
119 clrl %sp@- /* stkadj */
120 movel %d0,%sp@- /* orig d0 */
121 movel %d0,%sp@- /* d0 */
122 lea %sp@(-32),%sp /* space for 8 regs */
123 moveml %d1-%d5/%a0-%a2,%sp@
124.endm
125
126.macro RESTORE_LOCAL
127 moveml %sp@,%d1-%d5/%a0-%a2
128 lea %sp@(32),%sp /* space for 8 regs */
129 movel %sp@+,%d0
130 addql #4,%sp /* orig d0 */
131 addl %sp@+,%sp /* stkadj */
132 rte
133.endm
134
135.macro SAVE_SWITCH_STACK
136 lea %sp@(-24),%sp /* 6 regs */
137 moveml %a3-%a6/%d6-%d7,%sp@
138.endm
139
140.macro RESTORE_SWITCH_STACK
141 moveml %sp@,%a3-%a6/%d6-%d7
142 lea %sp@(24),%sp /* 6 regs */
143.endm
144
145/*
146 * Software copy of the user and kernel stack pointers... Ugh...
147 * Need these to get around ColdFire not having separate kernel
148 * and user stack pointers.
149 */
150.globl sw_usp
151.globl sw_ksp
152
153#else /* !CONFIG_COLDFIRE */
154
155/*
156 * Standard 68k interrupt entry and exit macros.
157 */
158.macro SAVE_ALL
159 clrl %sp@- /* stkadj */
160 movel %d0,%sp@- /* orig d0 */
161 movel %d0,%sp@- /* d0 */
162 moveml %d1-%d5/%a0-%a2,%sp@-
163.endm
164
165.macro RESTORE_ALL
166 moveml %sp@+,%a0-%a2/%d1-%d5
167 movel %sp@+,%d0
168 addql #4,%sp /* orig d0 */
169 addl %sp@+,%sp /* stkadj */
170 rte
171.endm
172
173.macro SAVE_SWITCH_STACK
174 moveml %a3-%a6/%d6-%d7,%sp@-
175.endm
176
177.macro RESTORE_SWITCH_STACK
178 moveml %sp@+,%a3-%a6/%d6-%d7
179.endm
180
181#endif /* !CONFIG_COLDFIRE */
182#endif /* __ASSEMBLY__ */
183#endif /* __M68KNOMMU_ENTRY_H */
diff --git a/include/asm-m68knommu/errno.h b/include/asm-m68knommu/errno.h
new file mode 100644
index 000000000000..7e8c22b9a5e6
--- /dev/null
+++ b/include/asm-m68knommu/errno.h
@@ -0,0 +1 @@
#include <asm-m68k/errno.h>
diff --git a/include/asm-m68knommu/fcntl.h b/include/asm-m68knommu/fcntl.h
new file mode 100644
index 000000000000..f6a552cda4cd
--- /dev/null
+++ b/include/asm-m68knommu/fcntl.h
@@ -0,0 +1 @@
#include <asm-m68k/fcntl.h>
diff --git a/include/asm-m68knommu/flat.h b/include/asm-m68knommu/flat.h
new file mode 100644
index 000000000000..2d836edc4344
--- /dev/null
+++ b/include/asm-m68knommu/flat.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-m68knommu/flat.h -- uClinux flat-format executables
3 */
4
5#ifndef __M68KNOMMU_FLAT_H__
6#define __M68KNOMMU_FLAT_H__
7
8#define flat_stack_align(sp) /* nothing needed */
9#define flat_argvp_envp_on_stack() 1
10#define flat_old_ram_flag(flags) (flags)
11#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
12#define flat_get_addr_from_rp(rp, relval, flags) get_unaligned(rp)
13#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp)
14#define flat_get_relocate_addr(rel) (rel)
15
16#endif /* __M68KNOMMU_FLAT_H__ */
diff --git a/include/asm-m68knommu/fpu.h b/include/asm-m68knommu/fpu.h
new file mode 100644
index 000000000000..225082991a03
--- /dev/null
+++ b/include/asm-m68knommu/fpu.h
@@ -0,0 +1,22 @@
1#ifndef __M68KNOMMU_FPU_H
2#define __M68KNOMMU_FPU_H
3
4#include <linux/config.h>
5
6/*
7 * MAX floating point unit state size (FSAVE/FRESTORE)
8 */
9#if defined(CONFIG_M68020) || defined(CONFIG_M68030)
10#define FPSTATESIZE (216/sizeof(unsigned char))
11#elif defined(CONFIG_M68040)
12#define FPSTATESIZE (96/sizeof(unsigned char))
13#elif defined(CONFIG_M68KFPU_EMU)
14#define FPSTATESIZE (28/sizeof(unsigned char))
15#elif defined(CONFIG_M68060)
16#define FPSTATESIZE (12/sizeof(unsigned char))
17#else
18/* Assume no FP unit present then... */
19#define FPSTATESIZE (2) /* dummy size */
20#endif
21
22#endif /* __M68K_FPU_H */
diff --git a/include/asm-m68knommu/hardirq.h b/include/asm-m68knommu/hardirq.h
new file mode 100644
index 000000000000..e8659e739a64
--- /dev/null
+++ b/include/asm-m68knommu/hardirq.h
@@ -0,0 +1,25 @@
1#ifndef __M68K_HARDIRQ_H
2#define __M68K_HARDIRQ_H
3
4#include <linux/config.h>
5#include <linux/cache.h>
6#include <linux/threads.h>
7
8typedef struct {
9 unsigned int __softirq_pending;
10} ____cacheline_aligned irq_cpustat_t;
11
12#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
13
14#define HARDIRQ_BITS 8
15
16/*
17 * The hardirq mask has to be large enough to have
18 * space for potentially all IRQ sources in the system
19 * nesting on a single CPU:
20 */
21#if (1 << HARDIRQ_BITS) < NR_IRQS
22# error HARDIRQ_BITS is too low!
23#endif
24
25#endif /* __M68K_HARDIRQ_H */
diff --git a/include/asm-m68knommu/hdreg.h b/include/asm-m68knommu/hdreg.h
new file mode 100644
index 000000000000..5cdd9b084d37
--- /dev/null
+++ b/include/asm-m68knommu/hdreg.h
@@ -0,0 +1 @@
#include <asm-m68k/hdreg.h>
diff --git a/include/asm-m68knommu/hwtest.h b/include/asm-m68knommu/hwtest.h
new file mode 100644
index 000000000000..700626a1b1bf
--- /dev/null
+++ b/include/asm-m68knommu/hwtest.h
@@ -0,0 +1 @@
#include <asm-m68k/hwtest.h>
diff --git a/include/asm-m68knommu/ide.h b/include/asm-m68knommu/ide.h
new file mode 100644
index 000000000000..b1cbf8bb9232
--- /dev/null
+++ b/include/asm-m68knommu/ide.h
@@ -0,0 +1,444 @@
1/****************************************************************************/
2/*
3 * linux/include/asm-m68knommu/ide.h
4 *
5 * Copyright (C) 1994-1996 Linus Torvalds & authors
6 * Copyright (C) 2001 Lineo Inc., davidm@uclinux.org
7 */
8/****************************************************************************/
9#ifndef _M68KNOMMU_IDE_H
10#define _M68KNOMMU_IDE_H
11
12#ifdef __KERNEL__
13/****************************************************************************/
14
15#include <linux/config.h>
16#include <linux/interrupt.h>
17
18#include <asm/setup.h>
19#include <asm/io.h>
20#include <asm/irq.h>
21
22/****************************************************************************/
23/*
24 * some coldfire specifics
25 */
26
27#ifdef CONFIG_COLDFIRE
28#include <asm/coldfire.h>
29#include <asm/mcfsim.h>
30
31/*
32 * Save some space, only have 1 interface
33 */
34#define MAX_HWIFS 1 /* we only have one interface for now */
35
36#ifdef CONFIG_SECUREEDGEMP3
37#define MCFSIM_LOCALCS MCFSIM_CSCR4
38#else
39#define MCFSIM_LOCALCS MCFSIM_CSCR6
40#endif
41
42#endif /* CONFIG_COLDFIRE */
43
44/****************************************************************************/
45/*
46 * Fix up things that may not have been provided
47 */
48
49#ifndef MAX_HWIFS
50#define MAX_HWIFS 4 /* same as the other archs */
51#endif
52
53#undef SUPPORT_SLOW_DATA_PORTS
54#define SUPPORT_SLOW_DATA_PORTS 0
55
56#undef SUPPORT_VLB_SYNC
57#define SUPPORT_VLB_SYNC 0
58
59/* this definition is used only on startup .. */
60#undef HD_DATA
61#define HD_DATA NULL
62
63#define DBGIDE(fmt,a...)
64// #define DBGIDE(fmt,a...) printk(fmt, ##a)
65#define IDE_INLINE __inline__
66// #define IDE_INLINE
67
68/****************************************************************************/
69
70typedef union {
71 unsigned all : 8; /* all of the bits together */
72 struct {
73 unsigned bit7 : 1; /* always 1 */
74 unsigned lba : 1; /* using LBA instead of CHS */
75 unsigned bit5 : 1; /* always 1 */
76 unsigned unit : 1; /* drive select number, 0 or 1 */
77 unsigned head : 4; /* always zeros here */
78 } b;
79} select_t;
80
81/*
82 * our list of ports/irq's for different boards
83 */
84
85static struct m68k_ide_defaults {
86 ide_ioreg_t base;
87 int irq;
88} m68k_ide_defaults[MAX_HWIFS] = {
89#if defined(CONFIG_SECUREEDGEMP3)
90 { ((ide_ioreg_t)0x30800000), 29 },
91#elif defined(CONFIG_eLIA)
92 { ((ide_ioreg_t)0x30c00000), 29 },
93#else
94 { ((ide_ioreg_t)0x0), 0 }
95#endif
96};
97
98/****************************************************************************/
99
100static IDE_INLINE int ide_default_irq(ide_ioreg_t base)
101{
102 int i;
103
104 for (i = 0; i < MAX_HWIFS; i++)
105 if (m68k_ide_defaults[i].base == base)
106 return(m68k_ide_defaults[i].irq);
107 return 0;
108}
109
110static IDE_INLINE ide_ioreg_t ide_default_io_base(int index)
111{
112 if (index >= 0 && index < MAX_HWIFS)
113 return(m68k_ide_defaults[index].base);
114 return 0;
115}
116
117
118/*
119 * Set up a hw structure for a specified data port, control port and IRQ.
120 * This should follow whatever the default interface uses.
121 */
122static IDE_INLINE void ide_init_hwif_ports(
123 hw_regs_t *hw,
124 ide_ioreg_t data_port,
125 ide_ioreg_t ctrl_port,
126 int *irq)
127{
128 ide_ioreg_t reg = data_port;
129 int i;
130
131 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
132 hw->io_ports[i] = reg;
133 reg += 1;
134 }
135 if (ctrl_port) {
136 hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
137 } else {
138 hw->io_ports[IDE_CONTROL_OFFSET] = data_port + 0xe;
139 }
140}
141
142#define ide_init_default_irq(base) ide_default_irq(base)
143
144static IDE_INLINE int
145ide_request_irq(
146 unsigned int irq,
147 void (*handler)(int, void *, struct pt_regs *),
148 unsigned long flags,
149 const char *device,
150 void *dev_id)
151{
152#ifdef CONFIG_COLDFIRE
153 mcf_autovector(irq);
154#endif
155 return(request_irq(irq, handler, flags, device, dev_id));
156}
157
158
159static IDE_INLINE void
160ide_free_irq(unsigned int irq, void *dev_id)
161{
162 free_irq(irq, dev_id);
163}
164
165
166static IDE_INLINE int
167ide_check_region(ide_ioreg_t from, unsigned int extent)
168{
169 return 0;
170}
171
172
173static IDE_INLINE void
174ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name)
175{
176}
177
178
179static IDE_INLINE void
180ide_release_region(ide_ioreg_t from, unsigned int extent)
181{
182}
183
184
185static IDE_INLINE void
186ide_fix_driveid(struct hd_driveid *id)
187{
188#ifdef CONFIG_COLDFIRE
189 int i, n;
190 unsigned short *wp = (unsigned short *) id;
191 int avoid[] = {49, 51, 52, 59, -1 }; /* do not swap these words */
192
193 /* Need to byte swap shorts, but not char fields */
194 for (i = n = 0; i < sizeof(*id) / sizeof(*wp); i++, wp++) {
195 if (avoid[n] == i) {
196 n++;
197 continue;
198 }
199 *wp = ((*wp & 0xff) << 8) | ((*wp >> 8) & 0xff);
200 }
201 /* have to word swap the one 32 bit field */
202 id->lba_capacity = ((id->lba_capacity & 0xffff) << 16) |
203 ((id->lba_capacity >> 16) & 0xffff);
204#endif
205}
206
207
208static IDE_INLINE void
209ide_release_lock (int *ide_lock)
210{
211}
212
213
214static IDE_INLINE void
215ide_get_lock(
216 int *ide_lock,
217 void (*handler)(int, void *, struct pt_regs *),
218 void *data)
219{
220}
221
222
223#define ide_ack_intr(hwif) \
224 ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1)
225#define ide__sti() __sti()
226
227/****************************************************************************/
228/*
229 * System specific IO requirements
230 */
231
232#ifdef CONFIG_COLDFIRE
233
234#ifdef CONFIG_SECUREEDGEMP3
235
236/* Replace standard IO functions for funky mapping of MP3 board */
237#undef outb
238#undef outb_p
239#undef inb
240#undef inb_p
241
242#define outb(v, a) ide_outb(v, (unsigned long) (a))
243#define outb_p(v, a) ide_outb(v, (unsigned long) (a))
244#define inb(a) ide_inb((unsigned long) (a))
245#define inb_p(a) ide_inb((unsigned long) (a))
246
247#define ADDR8_PTR(addr) (((addr) & 0x1) ? (0x8000 + (addr) - 1) : (addr))
248#define ADDR16_PTR(addr) (addr)
249#define ADDR32_PTR(addr) (addr)
250#define SWAP8(w) ((((w) & 0xffff) << 8) | (((w) & 0xffff) >> 8))
251#define SWAP16(w) (w)
252#define SWAP32(w) (w)
253
254
255static IDE_INLINE void
256ide_outb(unsigned int val, unsigned int addr)
257{
258 volatile unsigned short *rp;
259
260 DBGIDE("%s(val=%x,addr=%x)\n", __FUNCTION__, val, addr);
261 rp = (volatile unsigned short *) ADDR8_PTR(addr);
262 *rp = SWAP8(val);
263}
264
265
266static IDE_INLINE int
267ide_inb(unsigned int addr)
268{
269 volatile unsigned short *rp, val;
270
271 DBGIDE("%s(addr=%x)\n", __FUNCTION__, addr);
272 rp = (volatile unsigned short *) ADDR8_PTR(addr);
273 val = *rp;
274 return(SWAP8(val));
275}
276
277
278static IDE_INLINE void
279ide_outw(unsigned int val, unsigned int addr)
280{
281 volatile unsigned short *rp;
282
283 DBGIDE("%s(val=%x,addr=%x)\n", __FUNCTION__, val, addr);
284 rp = (volatile unsigned short *) ADDR16_PTR(addr);
285 *rp = SWAP16(val);
286}
287
288static IDE_INLINE void
289ide_outsw(unsigned int addr, const void *vbuf, unsigned long len)
290{
291 volatile unsigned short *rp, val;
292 unsigned short *buf;
293
294 DBGIDE("%s(addr=%x,vbuf=%p,len=%x)\n", __FUNCTION__, addr, vbuf, len);
295 buf = (unsigned short *) vbuf;
296 rp = (volatile unsigned short *) ADDR16_PTR(addr);
297 for (; (len > 0); len--) {
298 val = *buf++;
299 *rp = SWAP16(val);
300 }
301}
302
303static IDE_INLINE int
304ide_inw(unsigned int addr)
305{
306 volatile unsigned short *rp, val;
307
308 DBGIDE("%s(addr=%x)\n", __FUNCTION__, addr);
309 rp = (volatile unsigned short *) ADDR16_PTR(addr);
310 val = *rp;
311 return(SWAP16(val));
312}
313
314static IDE_INLINE void
315ide_insw(unsigned int addr, void *vbuf, unsigned long len)
316{
317 volatile unsigned short *rp;
318 unsigned short w, *buf;
319
320 DBGIDE("%s(addr=%x,vbuf=%p,len=%x)\n", __FUNCTION__, addr, vbuf, len);
321 buf = (unsigned short *) vbuf;
322 rp = (volatile unsigned short *) ADDR16_PTR(addr);
323 for (; (len > 0); len--) {
324 w = *rp;
325 *buf++ = SWAP16(w);
326 }
327}
328
329static IDE_INLINE void
330ide_insl(unsigned int addr, void *vbuf, unsigned long len)
331{
332 volatile unsigned long *rp;
333 unsigned long w, *buf;
334
335 DBGIDE("%s(addr=%x,vbuf=%p,len=%x)\n", __FUNCTION__, addr, vbuf, len);
336 buf = (unsigned long *) vbuf;
337 rp = (volatile unsigned long *) ADDR32_PTR(addr);
338 for (; (len > 0); len--) {
339 w = *rp;
340 *buf++ = SWAP32(w);
341 }
342}
343
344static IDE_INLINE void
345ide_outsl(unsigned int addr, const void *vbuf, unsigned long len)
346{
347 volatile unsigned long *rp, val;
348 unsigned long *buf;
349
350 DBGIDE("%s(addr=%x,vbuf=%p,len=%x)\n", __FUNCTION__, addr, vbuf, len);
351 buf = (unsigned long *) vbuf;
352 rp = (volatile unsigned long *) ADDR32_PTR(addr);
353 for (; (len > 0); len--) {
354 val = *buf++;
355 *rp = SWAP32(val);
356 }
357}
358
359#elif CONFIG_eLIA
360
361/* 8/16 bit acesses are controlled by flicking bits in the CS register */
362#define ACCESS_MODE_16BIT() \
363 *((volatile unsigned short *) (MCF_MBAR + MCFSIM_LOCALCS)) = 0x0080
364#define ACCESS_MODE_8BIT() \
365 *((volatile unsigned short *) (MCF_MBAR + MCFSIM_LOCALCS)) = 0x0040
366
367
368static IDE_INLINE void
369ide_outw(unsigned int val, unsigned int addr)
370{
371 ACCESS_MODE_16BIT();
372 outw(val, addr);
373 ACCESS_MODE_8BIT();
374}
375
376static IDE_INLINE void
377ide_outsw(unsigned int addr, const void *vbuf, unsigned long len)
378{
379 ACCESS_MODE_16BIT();
380 outsw(addr, vbuf, len);
381 ACCESS_MODE_8BIT();
382}
383
384static IDE_INLINE int
385ide_inw(unsigned int addr)
386{
387 int ret;
388
389 ACCESS_MODE_16BIT();
390 ret = inw(addr);
391 ACCESS_MODE_8BIT();
392 return(ret);
393}
394
395static IDE_INLINE void
396ide_insw(unsigned int addr, void *vbuf, unsigned long len)
397{
398 ACCESS_MODE_16BIT();
399 insw(addr, vbuf, len);
400 ACCESS_MODE_8BIT();
401}
402
403static IDE_INLINE void
404ide_insl(unsigned int addr, void *vbuf, unsigned long len)
405{
406 ACCESS_MODE_16BIT();
407 insl(addr, vbuf, len);
408 ACCESS_MODE_8BIT();
409}
410
411static IDE_INLINE void
412ide_outsl(unsigned int addr, const void *vbuf, unsigned long len)
413{
414 ACCESS_MODE_16BIT();
415 outsl(addr, vbuf, len);
416 ACCESS_MODE_8BIT();
417}
418
419#endif /* CONFIG_SECUREEDGEMP3 */
420
421#undef outw
422#undef outw_p
423#undef outsw
424#undef inw
425#undef inw_p
426#undef insw
427#undef insl
428#undef outsl
429
430#define outw(v, a) ide_outw(v, (unsigned long) (a))
431#define outw_p(v, a) ide_outw(v, (unsigned long) (a))
432#define outsw(a, b, n) ide_outsw((unsigned long) (a), b, n)
433#define inw(a) ide_inw((unsigned long) (a))
434#define inw_p(a) ide_inw((unsigned long) (a))
435#define insw(a, b, n) ide_insw((unsigned long) (a), b, n)
436#define insl(a, b, n) ide_insl((unsigned long) (a), b, n)
437#define outsl(a, b, n) ide_outsl((unsigned long) (a), b, n)
438
439#endif CONFIG_COLDFIRE
440
441/****************************************************************************/
442#endif /* __KERNEL__ */
443#endif /* _M68KNOMMU_IDE_H */
444/****************************************************************************/
diff --git a/include/asm-m68knommu/io.h b/include/asm-m68knommu/io.h
new file mode 100644
index 000000000000..30fade4149b8
--- /dev/null
+++ b/include/asm-m68knommu/io.h
@@ -0,0 +1,203 @@
1#ifndef _M68KNOMMU_IO_H
2#define _M68KNOMMU_IO_H
3
4#ifdef __KERNEL__
5
6#include <linux/config.h>
7
8/*
9 * These are for ISA/PCI shared memory _only_ and should never be used
10 * on any other type of memory, including Zorro memory. They are meant to
11 * access the bus in the bus byte order which is little-endian!.
12 *
13 * readX/writeX() are used to access memory mapped devices. On some
14 * architectures the memory mapped IO stuff needs to be accessed
15 * differently. On the m68k architecture, we just read/write the
16 * memory location directly.
17 */
18/* ++roman: The assignments to temp. vars avoid that gcc sometimes generates
19 * two accesses to memory, which may be undesireable for some devices.
20 */
21
22/*
23 * swap functions are sometimes needed to interface little-endian hardware
24 */
25static inline unsigned short _swapw(volatile unsigned short v)
26{
27 return ((v << 8) | (v >> 8));
28}
29
30static inline unsigned int _swapl(volatile unsigned long v)
31{
32 return ((v << 24) | ((v & 0xff00) << 8) | ((v & 0xff0000) >> 8) | (v >> 24));
33}
34
35#define readb(addr) \
36 ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
37#define readw(addr) \
38 ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
39#define readl(addr) \
40 ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
41
42#define readb_relaxed(addr) readb(addr)
43#define readw_relaxed(addr) readw(addr)
44#define readl_relaxed(addr) readl(addr)
45
46#define writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b))
47#define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b))
48#define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b))
49
50#define __raw_readb readb
51#define __raw_readw readw
52#define __raw_readl readl
53#define __raw_writeb writeb
54#define __raw_writew writew
55#define __raw_writel writel
56
57static inline void io_outsb(unsigned int addr, void *buf, int len)
58{
59 volatile unsigned char *ap = (volatile unsigned char *) addr;
60 unsigned char *bp = (unsigned char *) buf;
61 while (len--)
62 *ap = *bp++;
63}
64
65static inline void io_outsw(unsigned int addr, void *buf, int len)
66{
67 volatile unsigned short *ap = (volatile unsigned short *) addr;
68 unsigned short *bp = (unsigned short *) buf;
69 while (len--)
70 *ap = _swapw(*bp++);
71}
72
73static inline void io_outsl(unsigned int addr, void *buf, int len)
74{
75 volatile unsigned int *ap = (volatile unsigned int *) addr;
76 unsigned int *bp = (unsigned int *) buf;
77 while (len--)
78 *ap = _swapl(*bp++);
79}
80
81static inline void io_insb(unsigned int addr, void *buf, int len)
82{
83 volatile unsigned char *ap = (volatile unsigned char *) addr;
84 unsigned char *bp = (unsigned char *) buf;
85 while (len--)
86 *bp++ = *ap;
87}
88
89static inline void io_insw(unsigned int addr, void *buf, int len)
90{
91 volatile unsigned short *ap = (volatile unsigned short *) addr;
92 unsigned short *bp = (unsigned short *) buf;
93 while (len--)
94 *bp++ = _swapw(*ap);
95}
96
97static inline void io_insl(unsigned int addr, void *buf, int len)
98{
99 volatile unsigned int *ap = (volatile unsigned int *) addr;
100 unsigned int *bp = (unsigned int *) buf;
101 while (len--)
102 *bp++ = _swapl(*ap);
103}
104
105#define mmiowb()
106
107/*
108 * make the short names macros so specific devices
109 * can override them as required
110 */
111
112#define memset_io(a,b,c) memset((void *)(a),(b),(c))
113#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
114#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
115
116#define inb(addr) readb(addr)
117#define inw(addr) readw(addr)
118#define inl(addr) readl(addr)
119#define outb(x,addr) ((void) writeb(x,addr))
120#define outw(x,addr) ((void) writew(x,addr))
121#define outl(x,addr) ((void) writel(x,addr))
122
123#define inb_p(addr) inb(addr)
124#define inw_p(addr) inw(addr)
125#define inl_p(addr) inl(addr)
126#define outb_p(x,addr) outb(x,addr)
127#define outw_p(x,addr) outw(x,addr)
128#define outl_p(x,addr) outl(x,addr)
129
130#define outsb(a,b,l) io_outsb(a,b,l)
131#define outsw(a,b,l) io_outsw(a,b,l)
132#define outsl(a,b,l) io_outsl(a,b,l)
133
134#define insb(a,b,l) io_insb(a,b,l)
135#define insw(a,b,l) io_insw(a,b,l)
136#define insl(a,b,l) io_insl(a,b,l)
137
138#define IO_SPACE_LIMIT 0xffff
139
140
141/* Values for nocacheflag and cmode */
142#define IOMAP_FULL_CACHING 0
143#define IOMAP_NOCACHE_SER 1
144#define IOMAP_NOCACHE_NONSER 2
145#define IOMAP_WRITETHROUGH 3
146
147extern void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag);
148extern void __iounmap(void *addr, unsigned long size);
149
150extern inline void *ioremap(unsigned long physaddr, unsigned long size)
151{
152 return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
153}
154extern inline void *ioremap_nocache(unsigned long physaddr, unsigned long size)
155{
156 return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
157}
158extern inline void *ioremap_writethrough(unsigned long physaddr, unsigned long size)
159{
160 return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
161}
162extern inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size)
163{
164 return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
165}
166
167extern void iounmap(void *addr);
168
169/* Nothing to do */
170
171#define dma_cache_inv(_start,_size) do { } while (0)
172#define dma_cache_wback(_start,_size) do { } while (0)
173#define dma_cache_wback_inv(_start,_size) do { } while (0)
174
175/* Pages to physical address... */
176#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
177#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT)
178
179/*
180 * Macros used for converting between virtual and physical mappings.
181 */
182#define mm_ptov(vaddr) ((void *) (vaddr))
183#define mm_vtop(vaddr) ((unsigned long) (vaddr))
184#define phys_to_virt(vaddr) ((void *) (vaddr))
185#define virt_to_phys(vaddr) ((unsigned long) (vaddr))
186
187#define virt_to_bus virt_to_phys
188#define bus_to_virt phys_to_virt
189
190/*
191 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
192 * access
193 */
194#define xlate_dev_mem_ptr(p) __va(p)
195
196/*
197 * Convert a virtual cached pointer to an uncached pointer
198 */
199#define xlate_dev_kmem_ptr(p) p
200
201#endif /* __KERNEL__ */
202
203#endif /* _M68KNOMMU_IO_H */
diff --git a/include/asm-m68knommu/ioctl.h b/include/asm-m68knommu/ioctl.h
new file mode 100644
index 000000000000..cff72f33350f
--- /dev/null
+++ b/include/asm-m68knommu/ioctl.h
@@ -0,0 +1 @@
#include <asm-m68k/ioctl.h>
diff --git a/include/asm-m68knommu/ioctls.h b/include/asm-m68knommu/ioctls.h
new file mode 100644
index 000000000000..0b1eb4d85059
--- /dev/null
+++ b/include/asm-m68knommu/ioctls.h
@@ -0,0 +1 @@
#include <asm-m68k/ioctls.h>
diff --git a/include/asm-m68knommu/ipc.h b/include/asm-m68knommu/ipc.h
new file mode 100644
index 000000000000..a46e3d9c2a3f
--- /dev/null
+++ b/include/asm-m68knommu/ipc.h
@@ -0,0 +1 @@
#include <asm-generic/ipc.h>
diff --git a/include/asm-m68knommu/ipcbuf.h b/include/asm-m68knommu/ipcbuf.h
new file mode 100644
index 000000000000..e4a7be6dd706
--- /dev/null
+++ b/include/asm-m68knommu/ipcbuf.h
@@ -0,0 +1 @@
#include <asm-m68k/ipcbuf.h>
diff --git a/include/asm-m68knommu/irq.h b/include/asm-m68knommu/irq.h
new file mode 100644
index 000000000000..208ccd969e4b
--- /dev/null
+++ b/include/asm-m68knommu/irq.h
@@ -0,0 +1,128 @@
1#ifndef _M68K_IRQ_H_
2#define _M68K_IRQ_H_
3
4#include <linux/config.h>
5#include <linux/interrupt.h>
6#include <asm/ptrace.h>
7
8#ifdef CONFIG_COLDFIRE
9/*
10 * On the ColdFire we keep track of all vectors. That way drivers
11 * can register whatever vector number they wish, and we can deal
12 * with it.
13 */
14#define SYS_IRQS 256
15#define NR_IRQS SYS_IRQS
16
17#else
18
19/*
20 * # of m68k interrupts
21 */
22#define SYS_IRQS 8
23#define NR_IRQS (24+SYS_IRQS)
24
25#endif /* CONFIG_COLDFIRE */
26
27/*
28 * Interrupt source definitions
29 * General interrupt sources are the level 1-7.
30 * Adding an interrupt service routine for one of these sources
31 * results in the addition of that routine to a chain of routines.
32 * Each one is called in succession. Each individual interrupt
33 * service routine should determine if the device associated with
34 * that routine requires service.
35 */
36
37#define IRQ1 (1) /* level 1 interrupt */
38#define IRQ2 (2) /* level 2 interrupt */
39#define IRQ3 (3) /* level 3 interrupt */
40#define IRQ4 (4) /* level 4 interrupt */
41#define IRQ5 (5) /* level 5 interrupt */
42#define IRQ6 (6) /* level 6 interrupt */
43#define IRQ7 (7) /* level 7 interrupt (non-maskable) */
44
45/*
46 * Machine specific interrupt sources.
47 *
48 * Adding an interrupt service routine for a source with this bit
49 * set indicates a special machine specific interrupt source.
50 * The machine specific files define these sources.
51 *
52 * The IRQ_MACHSPEC bit is now gone - the only thing it did was to
53 * introduce unnecessary overhead.
54 *
55 * All interrupt handling is actually machine specific so it is better
56 * to use function pointers, as used by the Sparc port, and select the
57 * interrupt handling functions when initializing the kernel. This way
58 * we save some unnecessary overhead at run-time.
59 * 01/11/97 - Jes
60 */
61
62extern void (*mach_enable_irq)(unsigned int);
63extern void (*mach_disable_irq)(unsigned int);
64
65/*
66 * various flags for request_irq() - the Amiga now uses the standard
67 * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ
68 * are your friends.
69 */
70#define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */
71#define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */
72#define IRQ_FLG_FAST (0x0004)
73#define IRQ_FLG_SLOW (0x0008)
74#define IRQ_FLG_STD (0x8000) /* internally used */
75
76#ifdef CONFIG_M68360
77
78#define CPM_INTERRUPT IRQ4
79
80/* see MC68360 User's Manual, p. 7-377 */
81#define CPM_VECTOR_BASE 0x04 /* 3 MSbits of CPM vector */
82
83#endif /* CONFIG_M68360 */
84
85/*
86 * This structure is used to chain together the ISRs for a particular
87 * interrupt source (if it supports chaining).
88 */
89typedef struct irq_node {
90 irqreturn_t (*handler)(int, void *, struct pt_regs *);
91 unsigned long flags;
92 void *dev_id;
93 const char *devname;
94 struct irq_node *next;
95} irq_node_t;
96
97/*
98 * This structure has only 4 elements for speed reasons
99 */
100typedef struct irq_handler {
101 irqreturn_t (*handler)(int, void *, struct pt_regs *);
102 unsigned long flags;
103 void *dev_id;
104 const char *devname;
105} irq_handler_t;
106
107/* count of spurious interrupts */
108extern volatile unsigned int num_spurious;
109
110/*
111 * This function returns a new irq_node_t
112 */
113extern irq_node_t *new_irq_node(void);
114
115/*
116 * Some drivers want these entry points
117 */
118#define enable_irq(x) (mach_enable_irq ? (*mach_enable_irq)(x) : 0)
119#define disable_irq(x) (mach_disable_irq ? (*mach_disable_irq)(x) : 0)
120
121#define enable_irq_nosync(x) enable_irq(x)
122#define disable_irq_nosync(x) disable_irq(x)
123
124struct irqaction;
125struct pt_regs;
126int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
127
128#endif /* _M68K_IRQ_H_ */
diff --git a/include/asm-m68knommu/kmap_types.h b/include/asm-m68knommu/kmap_types.h
new file mode 100644
index 000000000000..bfb6707575d1
--- /dev/null
+++ b/include/asm-m68knommu/kmap_types.h
@@ -0,0 +1,21 @@
1#ifndef __ASM_M68K_KMAP_TYPES_H
2#define __ASM_M68K_KMAP_TYPES_H
3
4enum km_type {
5 KM_BOUNCE_READ,
6 KM_SKB_SUNRPC_DATA,
7 KM_SKB_DATA_SOFTIRQ,
8 KM_USER0,
9 KM_USER1,
10 KM_BIO_SRC_IRQ,
11 KM_BIO_DST_IRQ,
12 KM_PTE0,
13 KM_PTE1,
14 KM_IRQ0,
15 KM_IRQ1,
16 KM_SOFTIRQ0,
17 KM_SOFTIRQ1,
18 KM_TYPE_NR
19};
20
21#endif
diff --git a/include/asm-m68knommu/linkage.h b/include/asm-m68knommu/linkage.h
new file mode 100644
index 000000000000..c288a19ff489
--- /dev/null
+++ b/include/asm-m68knommu/linkage.h
@@ -0,0 +1 @@
#include <asm-m68k/linkage.h>
diff --git a/include/asm-m68knommu/local.h b/include/asm-m68knommu/local.h
new file mode 100644
index 000000000000..84a39c1b86f8
--- /dev/null
+++ b/include/asm-m68knommu/local.h
@@ -0,0 +1,6 @@
1#ifndef __M68KNOMMU_LOCAL_H
2#define __M68KNOMMU_LOCAL_H
3
4#include <asm-generic/local.h>
5
6#endif /* __M68KNOMMU_LOCAL_H */
diff --git a/include/asm-m68knommu/m5206sim.h b/include/asm-m68knommu/m5206sim.h
new file mode 100644
index 000000000000..d1e7509021c5
--- /dev/null
+++ b/include/asm-m68knommu/m5206sim.h
@@ -0,0 +1,132 @@
1/****************************************************************************/
2
3/*
4 * m5206sim.h -- ColdFire 5206 System Integration Module support.
5 *
6 * (C) Copyright 1999, Greg Ungerer (gerg@snapgear.com)
7 * (C) Copyright 2000, Lineo Inc. (www.lineo.com)
8 */
9
10/****************************************************************************/
11#ifndef m5206sim_h
12#define m5206sim_h
13/****************************************************************************/
14
15#include <linux/config.h>
16
17/*
18 * Define the 5206 SIM register set addresses.
19 */
20#define MCFSIM_SIMR 0x03 /* SIM Config reg (r/w) */
21#define MCFSIM_ICR1 0x14 /* Intr Ctrl reg 1 (r/w) */
22#define MCFSIM_ICR2 0x15 /* Intr Ctrl reg 2 (r/w) */
23#define MCFSIM_ICR3 0x16 /* Intr Ctrl reg 3 (r/w) */
24#define MCFSIM_ICR4 0x17 /* Intr Ctrl reg 4 (r/w) */
25#define MCFSIM_ICR5 0x18 /* Intr Ctrl reg 5 (r/w) */
26#define MCFSIM_ICR6 0x19 /* Intr Ctrl reg 6 (r/w) */
27#define MCFSIM_ICR7 0x1a /* Intr Ctrl reg 7 (r/w) */
28#define MCFSIM_ICR8 0x1b /* Intr Ctrl reg 8 (r/w) */
29#define MCFSIM_ICR9 0x1c /* Intr Ctrl reg 9 (r/w) */
30#define MCFSIM_ICR10 0x1d /* Intr Ctrl reg 10 (r/w) */
31#define MCFSIM_ICR11 0x1e /* Intr Ctrl reg 11 (r/w) */
32#define MCFSIM_ICR12 0x1f /* Intr Ctrl reg 12 (r/w) */
33#define MCFSIM_ICR13 0x20 /* Intr Ctrl reg 13 (r/w) */
34#ifdef CONFIG_M5206e
35#define MCFSIM_ICR14 0x21 /* Intr Ctrl reg 14 (r/w) */
36#define MCFSIM_ICR15 0x22 /* Intr Ctrl reg 15 (r/w) */
37#endif
38
39#define MCFSIM_IMR 0x36 /* Interrupt Mask reg (r/w) */
40#define MCFSIM_IPR 0x3a /* Interrupt Pend reg (r/w) */
41
42#define MCFSIM_RSR 0x40 /* Reset Status reg (r/w) */
43#define MCFSIM_SYPCR 0x41 /* System Protection reg (r/w)*/
44
45#define MCFSIM_SWIVR 0x42 /* SW Watchdog intr reg (r/w) */
46#define MCFSIM_SWSR 0x43 /* SW Watchdog service (r/w) */
47
48#define MCFSIM_DCRR 0x46 /* DRAM Refresh reg (r/w) */
49#define MCFSIM_DCTR 0x4a /* DRAM Timing reg (r/w) */
50#define MCFSIM_DAR0 0x4c /* DRAM 0 Address reg(r/w) */
51#define MCFSIM_DMR0 0x50 /* DRAM 0 Mask reg (r/w) */
52#define MCFSIM_DCR0 0x57 /* DRAM 0 Control reg (r/w) */
53#define MCFSIM_DAR1 0x58 /* DRAM 1 Address reg (r/w) */
54#define MCFSIM_DMR1 0x5c /* DRAM 1 Mask reg (r/w) */
55#define MCFSIM_DCR1 0x63 /* DRAM 1 Control reg (r/w) */
56
57#define MCFSIM_CSAR0 0x64 /* CS 0 Address 0 reg (r/w) */
58#define MCFSIM_CSMR0 0x68 /* CS 0 Mask 0 reg (r/w) */
59#define MCFSIM_CSCR0 0x6e /* CS 0 Control reg (r/w) */
60#define MCFSIM_CSAR1 0x70 /* CS 1 Address reg (r/w) */
61#define MCFSIM_CSMR1 0x74 /* CS 1 Mask reg (r/w) */
62#define MCFSIM_CSCR1 0x7a /* CS 1 Control reg (r/w) */
63#define MCFSIM_CSAR2 0x7c /* CS 2 Address reg (r/w) */
64#define MCFSIM_CSMR2 0x80 /* CS 2 Mask reg (r/w) */
65#define MCFSIM_CSCR2 0x86 /* CS 2 Control reg (r/w) */
66#define MCFSIM_CSAR3 0x88 /* CS 3 Address reg (r/w) */
67#define MCFSIM_CSMR3 0x8c /* CS 3 Mask reg (r/w) */
68#define MCFSIM_CSCR3 0x92 /* CS 3 Control reg (r/w) */
69#define MCFSIM_CSAR4 0x94 /* CS 4 Address reg (r/w) */
70#define MCFSIM_CSMR4 0x98 /* CS 4 Mask reg (r/w) */
71#define MCFSIM_CSCR4 0x9e /* CS 4 Control reg (r/w) */
72#define MCFSIM_CSAR5 0xa0 /* CS 5 Address reg (r/w) */
73#define MCFSIM_CSMR5 0xa4 /* CS 5 Mask reg (r/w) */
74#define MCFSIM_CSCR5 0xaa /* CS 5 Control reg (r/w) */
75#define MCFSIM_CSAR6 0xac /* CS 6 Address reg (r/w) */
76#define MCFSIM_CSMR6 0xb0 /* CS 6 Mask reg (r/w) */
77#define MCFSIM_CSCR6 0xb6 /* CS 6 Control reg (r/w) */
78#define MCFSIM_CSAR7 0xb8 /* CS 7 Address reg (r/w) */
79#define MCFSIM_CSMR7 0xbc /* CS 7 Mask reg (r/w) */
80#define MCFSIM_CSCR7 0xc2 /* CS 7 Control reg (r/w) */
81#define MCFSIM_DMCR 0xc6 /* Default control */
82
83#ifdef CONFIG_M5206e
84#define MCFSIM_PAR 0xca /* Pin Assignment reg (r/w) */
85#else
86#define MCFSIM_PAR 0xcb /* Pin Assignment reg (r/w) */
87#endif
88
89#define MCFSIM_PADDR 0x1c5 /* Parallel Direction (r/w) */
90#define MCFSIM_PADAT 0x1c9 /* Parallel Port Value (r/w) */
91
92/*
93 * Some symbol defines for the Parallel Port Pin Assignment Register
94 */
95#ifdef CONFIG_M5206e
96#define MCFSIM_PAR_DREQ0 0x100 /* Set to select DREQ0 input */
97 /* Clear to select T0 input */
98#define MCFSIM_PAR_DREQ1 0x200 /* Select DREQ1 input */
99 /* Clear to select T0 output */
100#endif
101
102/*
103 * Some symbol defines for the Interrupt Control Register
104 */
105#define MCFSIM_SWDICR MCFSIM_ICR8 /* Watchdog timer ICR */
106#define MCFSIM_TIMER1ICR MCFSIM_ICR9 /* Timer 1 ICR */
107#define MCFSIM_TIMER2ICR MCFSIM_ICR10 /* Timer 2 ICR */
108#define MCFSIM_UART1ICR MCFSIM_ICR12 /* UART 1 ICR */
109#define MCFSIM_UART2ICR MCFSIM_ICR13 /* UART 2 ICR */
110#ifdef CONFIG_M5206e
111#define MCFSIM_DMA1ICR MCFSIM_ICR14 /* DMA 1 ICR */
112#define MCFSIM_DMA2ICR MCFSIM_ICR15 /* DMA 2 ICR */
113#endif
114
115#if defined(CONFIG_M5206e)
116#define MCFSIM_IMR_MASKALL 0xfffe /* All SIM intr sources */
117#endif
118
119/*
120 * Macro to get and set IMR register. It is 16 bits on the 5206.
121 */
122#define mcf_getimr() \
123 *((volatile unsigned short *) (MCF_MBAR + MCFSIM_IMR))
124
125#define mcf_setimr(imr) \
126 *((volatile unsigned short *) (MCF_MBAR + MCFSIM_IMR)) = (imr)
127
128#define mcf_getipr() \
129 *((volatile unsigned short *) (MCF_MBAR + MCFSIM_IPR))
130
131/****************************************************************************/
132#endif /* m5206sim_h */
diff --git a/include/asm-m68knommu/m5249sim.h b/include/asm-m68knommu/m5249sim.h
new file mode 100644
index 000000000000..9344f529bd8f
--- /dev/null
+++ b/include/asm-m68knommu/m5249sim.h
@@ -0,0 +1,209 @@
1/****************************************************************************/
2
3/*
4 * m5249sim.h -- ColdFire 5249 System Integration Module support.
5 *
6 * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
7 */
8
9/****************************************************************************/
10#ifndef m5249sim_h
11#define m5249sim_h
12/****************************************************************************/
13
14/*
15 * Define the 5249 SIM register set addresses.
16 */
17#define MCFSIM_RSR 0x00 /* Reset Status reg (r/w) */
18#define MCFSIM_SYPCR 0x01 /* System Protection reg (r/w)*/
19#define MCFSIM_SWIVR 0x02 /* SW Watchdog intr reg (r/w) */
20#define MCFSIM_SWSR 0x03 /* SW Watchdog service (r/w) */
21#define MCFSIM_PAR 0x04 /* Pin Assignment reg (r/w) */
22#define MCFSIM_IRQPAR 0x06 /* Interrupt Assignment reg (r/w) */
23#define MCFSIM_MPARK 0x0C /* BUS Master Control Reg*/
24#define MCFSIM_IPR 0x40 /* Interrupt Pend reg (r/w) */
25#define MCFSIM_IMR 0x44 /* Interrupt Mask reg (r/w) */
26#define MCFSIM_AVR 0x4b /* Autovector Ctrl reg (r/w) */
27#define MCFSIM_ICR0 0x4c /* Intr Ctrl reg 0 (r/w) */
28#define MCFSIM_ICR1 0x4d /* Intr Ctrl reg 1 (r/w) */
29#define MCFSIM_ICR2 0x4e /* Intr Ctrl reg 2 (r/w) */
30#define MCFSIM_ICR3 0x4f /* Intr Ctrl reg 3 (r/w) */
31#define MCFSIM_ICR4 0x50 /* Intr Ctrl reg 4 (r/w) */
32#define MCFSIM_ICR5 0x51 /* Intr Ctrl reg 5 (r/w) */
33#define MCFSIM_ICR6 0x52 /* Intr Ctrl reg 6 (r/w) */
34#define MCFSIM_ICR7 0x53 /* Intr Ctrl reg 7 (r/w) */
35#define MCFSIM_ICR8 0x54 /* Intr Ctrl reg 8 (r/w) */
36#define MCFSIM_ICR9 0x55 /* Intr Ctrl reg 9 (r/w) */
37#define MCFSIM_ICR10 0x56 /* Intr Ctrl reg 10 (r/w) */
38#define MCFSIM_ICR11 0x57 /* Intr Ctrl reg 11 (r/w) */
39
40#define MCFSIM_CSAR0 0x80 /* CS 0 Address 0 reg (r/w) */
41#define MCFSIM_CSMR0 0x84 /* CS 0 Mask 0 reg (r/w) */
42#define MCFSIM_CSCR0 0x8a /* CS 0 Control reg (r/w) */
43#define MCFSIM_CSAR1 0x8c /* CS 1 Address reg (r/w) */
44#define MCFSIM_CSMR1 0x90 /* CS 1 Mask reg (r/w) */
45#define MCFSIM_CSCR1 0x96 /* CS 1 Control reg (r/w) */
46#define MCFSIM_CSAR2 0x98 /* CS 2 Adress reg (r/w) */
47#define MCFSIM_CSMR2 0x9c /* CS 2 Mask reg (r/w) */
48#define MCFSIM_CSCR2 0xa2 /* CS 2 Control reg (r/w) */
49#define MCFSIM_CSAR3 0xa4 /* CS 3 Adress reg (r/w) */
50#define MCFSIM_CSMR3 0xa8 /* CS 3 Mask reg (r/w) */
51#define MCFSIM_CSCR3 0xae /* CS 3 Control reg (r/w) */
52
53#define MCFSIM_DCR 0x100 /* DRAM Control reg (r/w) */
54#define MCFSIM_DACR0 0x108 /* DRAM 0 Addr and Ctrl (r/w) */
55#define MCFSIM_DMR0 0x10c /* DRAM 0 Mask reg (r/w) */
56#define MCFSIM_DACR1 0x110 /* DRAM 1 Addr and Ctrl (r/w) */
57#define MCFSIM_DMR1 0x114 /* DRAM 1 Mask reg (r/w) */
58
59
60/*
61 * Some symbol defines for the above...
62 */
63#define MCFSIM_SWDICR MCFSIM_ICR0 /* Watchdog timer ICR */
64#define MCFSIM_TIMER1ICR MCFSIM_ICR1 /* Timer 1 ICR */
65#define MCFSIM_TIMER2ICR MCFSIM_ICR2 /* Timer 2 ICR */
66#define MCFSIM_UART1ICR MCFSIM_ICR4 /* UART 1 ICR */
67#define MCFSIM_UART2ICR MCFSIM_ICR5 /* UART 2 ICR */
68#define MCFSIM_DMA0ICR MCFSIM_ICR6 /* DMA 0 ICR */
69#define MCFSIM_DMA1ICR MCFSIM_ICR7 /* DMA 1 ICR */
70#define MCFSIM_DMA2ICR MCFSIM_ICR8 /* DMA 2 ICR */
71#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */
72
73/*
74 * General purpose IO registers (in MBAR2).
75 */
76#define MCFSIM2_GPIOREAD 0x0 /* GPIO read values */
77#define MCFSIM2_GPIOWRITE 0x4 /* GPIO write values */
78#define MCFSIM2_GPIOENABLE 0x8 /* GPIO enabled */
79#define MCFSIM2_GPIOFUNC 0xc /* GPIO function */
80#define MCFSIM2_GPIO1READ 0xb0 /* GPIO1 read values */
81#define MCFSIM2_GPIO1WRITE 0xb4 /* GPIO1 write values */
82#define MCFSIM2_GPIO1ENABLE 0xb8 /* GPIO1 enabled */
83#define MCFSIM2_GPIO1FUNC 0xbc /* GPIO1 function */
84
85#define MCFSIM2_GPIOINTSTAT 0xc0 /* GPIO interrupt status */
86#define MCFSIM2_GPIOINTCLEAR 0xc0 /* GPIO interrupt clear */
87#define MCFSIM2_GPIOINTENABLE 0xc4 /* GPIO interrupt enable */
88
89#define MCFSIM2_INTLEVEL1 0x140 /* Interrupt level reg 1 */
90#define MCFSIM2_INTLEVEL2 0x144 /* Interrupt level reg 2 */
91#define MCFSIM2_INTLEVEL3 0x148 /* Interrupt level reg 3 */
92#define MCFSIM2_INTLEVEL4 0x14c /* Interrupt level reg 4 */
93#define MCFSIM2_INTLEVEL5 0x150 /* Interrupt level reg 5 */
94#define MCFSIM2_INTLEVEL6 0x154 /* Interrupt level reg 6 */
95#define MCFSIM2_INTLEVEL7 0x158 /* Interrupt level reg 7 */
96#define MCFSIM2_INTLEVEL8 0x15c /* Interrupt level reg 8 */
97
98#define MCFSIM2_DMAROUTE 0x188 /* DMA routing */
99
100#define MCFSIM2_IDECONFIG1 0x18c /* IDEconfig1 */
101#define MCFSIM2_IDECONFIG2 0x190 /* IDEconfig2 */
102
103
104/*
105 * Macro to set IMR register. It is 32 bits on the 5249.
106 */
107#define MCFSIM_IMR_MASKALL 0x7fffe /* All SIM intr sources */
108
109#define mcf_getimr() \
110 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR))
111
112#define mcf_setimr(imr) \
113 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) = (imr);
114
115#define mcf_getipr() \
116 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IPR))
117
118/****************************************************************************/
119
120#ifdef __ASSEMBLER__
121
122/*
123 * The M5249C3 board needs a little help getting all its SIM devices
124 * initialized at kernel start time. dBUG doesn't set much up, so
125 * we need to do it manually.
126 */
127.macro m5249c3_setup
128 /*
129 * Set MBAR1 and MBAR2, just incase they are not set.
130 */
131 movel #0x10000001,%a0
132 movec %a0,%MBAR /* map MBAR region */
133 subql #1,%a0 /* get MBAR address in a0 */
134
135 movel #0x80000001,%a1
136 movec %a1,#3086 /* map MBAR2 region */
137 subql #1,%a1 /* get MBAR2 address in a1 */
138
139 /*
140 * Move secondary interrupts to base at 128.
141 */
142 moveb #0x80,%d0
143 moveb %d0,0x16b(%a1) /* interrupt base register */
144
145 /*
146 * Work around broken CSMR0/DRAM vector problem.
147 */
148 movel #0x001F0021,%d0 /* disable C/I bit */
149 movel %d0,0x84(%a0) /* set CSMR0 */
150
151 /*
152 * Disable the PLL firstly. (Who knows what state it is
153 * in here!).
154 */
155 movel 0x180(%a1),%d0 /* get current PLL value */
156 andl #0xfffffffe,%d0 /* PLL bypass first */
157 movel %d0,0x180(%a1) /* set PLL register */
158 nop
159
160#ifdef CONFIG_CLOCK_140MHz
161 /*
162 * Set initial clock frequency. This assumes M5249C3 board
163 * is fitted with 11.2896MHz crystal. It will program the
164 * PLL for 140MHz. Lets go fast :-)
165 */
166 movel #0x125a40f0,%d0 /* set for 140MHz */
167 movel %d0,0x180(%a1) /* set PLL register */
168 orl #0x1,%d0
169 movel %d0,0x180(%a1) /* set PLL register */
170#endif
171
172 /*
173 * Setup CS1 for ethernet controller.
174 * (Setup as per M5249C3 doco).
175 */
176 movel #0xe0000000,%d0 /* CS1 mapped at 0xe0000000 */
177 movel %d0,0x8c(%a0)
178 movel #0x001f0021,%d0 /* CS1 size of 1Mb */
179 movel %d0,0x90(%a0)
180 movew #0x0080,%d0 /* CS1 = 16bit port, AA */
181 movew %d0,0x96(%a0)
182
183 /*
184 * Setup CS2 for IDE interface.
185 */
186 movel #0x50000000,%d0 /* CS2 mapped at 0x50000000 */
187 movel %d0,0x98(%a0)
188 movel #0x001f0001,%d0 /* CS2 size of 1MB */
189 movel %d0,0x9c(%a0)
190 movew #0x0080,%d0 /* CS2 = 16bit, TA */
191 movew %d0,0xa2(%a0)
192
193 movel #0x00107000,%d0 /* IDEconfig1 */
194 movel %d0,0x18c(%a1)
195 movel #0x000c0400,%d0 /* IDEconfig2 */
196 movel %d0,0x190(%a1)
197
198 movel #0x00080000,%d0 /* GPIO19, IDE reset bit */
199 orl %d0,0xc(%a1) /* function GPIO19 */
200 orl %d0,0x8(%a1) /* enable GPIO19 as output */
201 orl %d0,0x4(%a1) /* de-assert IDE reset */
202.endm
203
204#define PLATFORM_SETUP m5249c3_setup
205
206#endif /* __ASSEMBLER__ */
207
208/****************************************************************************/
209#endif /* m5249sim_h */
diff --git a/include/asm-m68knommu/m5272sim.h b/include/asm-m68knommu/m5272sim.h
new file mode 100644
index 000000000000..b40875362f46
--- /dev/null
+++ b/include/asm-m68knommu/m5272sim.h
@@ -0,0 +1,79 @@
1/****************************************************************************/
2
3/*
4 * m5272sim.h -- ColdFire 5272 System Integration Module support.
5 *
6 * (C) Copyright 1999, Greg Ungerer (gerg@snapgear.com)
7 * (C) Copyright 2000, Lineo Inc. (www.lineo.com)
8 */
9
10/****************************************************************************/
11#ifndef m5272sim_h
12#define m5272sim_h
13/****************************************************************************/
14
15#include <linux/config.h>
16
17/*
18 * Define the 5272 SIM register set addresses.
19 */
20#define MCFSIM_SCR 0x04 /* SIM Config reg (r/w) */
21#define MCFSIM_SPR 0x06 /* System Protection reg (r/w)*/
22#define MCFSIM_PMR 0x08 /* Power Management reg (r/w) */
23#define MCFSIM_APMR 0x0e /* Active Low Power reg (r/w) */
24#define MCFSIM_DIR 0x10 /* Device Identity reg (r/w) */
25
26#define MCFSIM_ICR1 0x20 /* Intr Ctrl reg 1 (r/w) */
27#define MCFSIM_ICR2 0x24 /* Intr Ctrl reg 2 (r/w) */
28#define MCFSIM_ICR3 0x28 /* Intr Ctrl reg 3 (r/w) */
29#define MCFSIM_ICR4 0x2c /* Intr Ctrl reg 4 (r/w) */
30
31#define MCFSIM_ISR 0x30 /* Interrupt Source reg (r/w) */
32#define MCFSIM_PITR 0x34 /* Interrupt Transition (r/w) */
33#define MCFSIM_PIWR 0x38 /* Interrupt Wakeup reg (r/w) */
34#define MCFSIM_PIVR 0x3f /* Interrupt Vector reg (r/w( */
35
36#define MCFSIM_WRRR 0x280 /* Watchdog reference (r/w) */
37#define MCFSIM_WIRR 0x284 /* Watchdog interrupt (r/w) */
38#define MCFSIM_WCR 0x288 /* Watchdog counter (r/w) */
39#define MCFSIM_WER 0x28c /* Watchdog event (r/w) */
40
41#define MCFSIM_CSBR0 0x40 /* CS0 Base Address (r/w) */
42#define MCFSIM_CSOR0 0x44 /* CS0 Option (r/w) */
43#define MCFSIM_CSBR1 0x48 /* CS1 Base Address (r/w) */
44#define MCFSIM_CSOR1 0x4c /* CS1 Option (r/w) */
45#define MCFSIM_CSBR2 0x50 /* CS2 Base Address (r/w) */
46#define MCFSIM_CSOR2 0x54 /* CS2 Option (r/w) */
47#define MCFSIM_CSBR3 0x58 /* CS3 Base Address (r/w) */
48#define MCFSIM_CSOR3 0x5c /* CS3 Option (r/w) */
49#define MCFSIM_CSBR4 0x60 /* CS4 Base Address (r/w) */
50#define MCFSIM_CSOR4 0x64 /* CS4 Option (r/w) */
51#define MCFSIM_CSBR5 0x68 /* CS5 Base Address (r/w) */
52#define MCFSIM_CSOR5 0x6c /* CS5 Option (r/w) */
53#define MCFSIM_CSBR6 0x70 /* CS6 Base Address (r/w) */
54#define MCFSIM_CSOR6 0x74 /* CS6 Option (r/w) */
55#define MCFSIM_CSBR7 0x78 /* CS7 Base Address (r/w) */
56#define MCFSIM_CSOR7 0x7c /* CS7 Option (r/w) */
57
58#define MCFSIM_SDCR 0x180 /* SDRAM Configuration (r/w) */
59#define MCFSIM_SDTR 0x184 /* SDRAM Timing (r/w) */
60#define MCFSIM_DCAR0 0x4c /* DRAM 0 Address reg(r/w) */
61#define MCFSIM_DCMR0 0x50 /* DRAM 0 Mask reg (r/w) */
62#define MCFSIM_DCCR0 0x57 /* DRAM 0 Control reg (r/w) */
63#define MCFSIM_DCAR1 0x58 /* DRAM 1 Address reg (r/w) */
64#define MCFSIM_DCMR1 0x5c /* DRAM 1 Mask reg (r/w) */
65#define MCFSIM_DCCR1 0x63 /* DRAM 1 Control reg (r/w) */
66
67#define MCFSIM_PACNT 0x80 /* Port A Control (r/w) */
68#define MCFSIM_PADDR 0x84 /* Port A Direction (r/w) */
69#define MCFSIM_PADAT 0x86 /* Port A Data (r/w) */
70#define MCFSIM_PBCNT 0x88 /* Port B Control (r/w) */
71#define MCFSIM_PBDDR 0x8c /* Port B Direction (r/w) */
72#define MCFSIM_PBDAT 0x8e /* Port B Data (r/w) */
73#define MCFSIM_PCDDR 0x94 /* Port C Direction (r/w) */
74#define MCFSIM_PCDAT 0x96 /* Port C Data (r/w) */
75#define MCFSIM_PDCNT 0x98 /* Port D Control (r/w) */
76
77
78/****************************************************************************/
79#endif /* m5272sim_h */
diff --git a/include/asm-m68knommu/m527xsim.h b/include/asm-m68knommu/m527xsim.h
new file mode 100644
index 000000000000..d280d013da03
--- /dev/null
+++ b/include/asm-m68knommu/m527xsim.h
@@ -0,0 +1,58 @@
1/****************************************************************************/
2
3/*
4 * m527xsim.h -- ColdFire 5270/5271 System Integration Module support.
5 *
6 * (C) Copyright 2004, Greg Ungerer (gerg@snapgear.com)
7 */
8
9/****************************************************************************/
10#ifndef m527xsim_h
11#define m527xsim_h
12/****************************************************************************/
13
14#include <linux/config.h>
15
16/*
17 * Define the 5270/5271 SIM register set addresses.
18 */
19#define MCFICM_INTC0 0x0c00 /* Base for Interrupt Ctrl 0 */
20#define MCFICM_INTC1 0x0d00 /* Base for Interrupt Ctrl 1 */
21#define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */
22#define MCFINTC_IPRL 0x04 /* Interrupt pending 1-31 */
23#define MCFINTC_IMRH 0x08 /* Interrupt mask 32-63 */
24#define MCFINTC_IMRL 0x0c /* Interrupt mask 1-31 */
25#define MCFINTC_INTFRCH 0x10 /* Interrupt force 32-63 */
26#define MCFINTC_INTFRCL 0x14 /* Interrupt force 1-31 */
27#define MCFINTC_IRLR 0x18 /* */
28#define MCFINTC_IACKL 0x19 /* */
29#define MCFINTC_ICR0 0x40 /* Base ICR register */
30
31#define MCFINT_VECBASE 64 /* Vector base number */
32#define MCFINT_UART0 13 /* Interrupt number for UART0 */
33#define MCFINT_UART1 14 /* Interrupt number for UART1 */
34#define MCFINT_UART2 15 /* Interrupt number for UART2 */
35#define MCFINT_PIT1 36 /* Interrupt number for PIT1 */
36
37/*
38 * SDRAM configuration registers.
39 */
40#ifdef CONFIG_M5271EVB
41#define MCFSIM_DCR 0x40 /* SDRAM control */
42#define MCFSIM_DACR0 0x48 /* SDRAM base address 0 */
43#define MCFSIM_DMR0 0x4c /* SDRAM address mask 0 */
44#define MCFSIM_DACR1 0x50 /* SDRAM base address 1 */
45#define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */
46#else
47#define MCFSIM_DMR 0x40 /* SDRAM mode */
48#define MCFSIM_DCR 0x44 /* SDRAM control */
49#define MCFSIM_DCFG1 0x48 /* SDRAM configuration 1 */
50#define MCFSIM_DCFG2 0x4c /* SDRAM configuration 2 */
51#define MCFSIM_DBAR0 0x50 /* SDRAM base address 0 */
52#define MCFSIM_DMR0 0x54 /* SDRAM address mask 0 */
53#define MCFSIM_DBAR1 0x58 /* SDRAM base address 1 */
54#define MCFSIM_DMR1 0x5c /* SDRAM address mask 1 */
55#endif
56
57/****************************************************************************/
58#endif /* m527xsim_h */
diff --git a/include/asm-m68knommu/m528xsim.h b/include/asm-m68knommu/m528xsim.h
new file mode 100644
index 000000000000..371993a206ac
--- /dev/null
+++ b/include/asm-m68knommu/m528xsim.h
@@ -0,0 +1,45 @@
1/****************************************************************************/
2
3/*
4 * m528xsim.h -- ColdFire 5280/5282 System Integration Module support.
5 *
6 * (C) Copyright 2003, Greg Ungerer (gerg@snapgear.com)
7 */
8
9/****************************************************************************/
10#ifndef m528xsim_h
11#define m528xsim_h
12/****************************************************************************/
13
14#include <linux/config.h>
15
16/*
17 * Define the 5280/5282 SIM register set addresses.
18 */
19#define MCFICM_INTC0 0x0c00 /* Base for Interrupt Ctrl 0 */
20#define MCFICM_INTC1 0x0d00 /* Base for Interrupt Ctrl 0 */
21#define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */
22#define MCFINTC_IPRL 0x04 /* Interrupt pending 1-31 */
23#define MCFINTC_IMRH 0x08 /* Interrupt mask 32-63 */
24#define MCFINTC_IMRL 0x0c /* Interrupt mask 1-31 */
25#define MCFINTC_INTFRCH 0x10 /* Interrupt force 32-63 */
26#define MCFINTC_INTFRCL 0x14 /* Interrupt force 1-31 */
27#define MCFINTC_IRLR 0x18 /* */
28#define MCFINTC_IACKL 0x19 /* */
29#define MCFINTC_ICR0 0x40 /* Base ICR register */
30
31#define MCFINT_VECBASE 64 /* Vector base number */
32#define MCFINT_UART0 13 /* Interrupt number for UART0 */
33#define MCFINT_PIT1 55 /* Interrupt number for PIT1 */
34
35/*
36 * SDRAM configuration registers.
37 */
38#define MCFSIM_DCR 0x44 /* SDRAM control */
39#define MCFSIM_DACR0 0x48 /* SDRAM base address 0 */
40#define MCFSIM_DMR0 0x4c /* SDRAM address mask 0 */
41#define MCFSIM_DACR1 0x50 /* SDRAM base address 1 */
42#define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */
43
44/****************************************************************************/
45#endif /* m528xsim_h */
diff --git a/include/asm-m68knommu/m5307sim.h b/include/asm-m68knommu/m5307sim.h
new file mode 100644
index 000000000000..d3ce550f6ef4
--- /dev/null
+++ b/include/asm-m68knommu/m5307sim.h
@@ -0,0 +1,181 @@
1/****************************************************************************/
2
3/*
4 * m5307sim.h -- ColdFire 5307 System Integration Module support.
5 *
6 * (C) Copyright 1999, Moreton Bay Ventures Pty Ltd.
7 * (C) Copyright 1999, Lineo (www.lineo.com)
8 *
9 * Modified by David W. Miller for the MCF5307 Eval Board.
10 */
11
12/****************************************************************************/
13#ifndef m5307sim_h
14#define m5307sim_h
15/****************************************************************************/
16
17/*
18 * Define the 5307 SIM register set addresses.
19 */
20#define MCFSIM_RSR 0x00 /* Reset Status reg (r/w) */
21#define MCFSIM_SYPCR 0x01 /* System Protection reg (r/w)*/
22#define MCFSIM_SWIVR 0x02 /* SW Watchdog intr reg (r/w) */
23#define MCFSIM_SWSR 0x03 /* SW Watchdog service (r/w) */
24#define MCFSIM_PAR 0x04 /* Pin Assignment reg (r/w) */
25#define MCFSIM_IRQPAR 0x06 /* Interrupt Assignment reg (r/w) */
26#define MCFSIM_PLLCR 0x08 /* PLL Controll Reg*/
27#define MCFSIM_MPARK 0x0C /* BUS Master Control Reg*/
28#define MCFSIM_IPR 0x40 /* Interrupt Pend reg (r/w) */
29#define MCFSIM_IMR 0x44 /* Interrupt Mask reg (r/w) */
30#define MCFSIM_AVR 0x4b /* Autovector Ctrl reg (r/w) */
31#define MCFSIM_ICR0 0x4c /* Intr Ctrl reg 0 (r/w) */
32#define MCFSIM_ICR1 0x4d /* Intr Ctrl reg 1 (r/w) */
33#define MCFSIM_ICR2 0x4e /* Intr Ctrl reg 2 (r/w) */
34#define MCFSIM_ICR3 0x4f /* Intr Ctrl reg 3 (r/w) */
35#define MCFSIM_ICR4 0x50 /* Intr Ctrl reg 4 (r/w) */
36#define MCFSIM_ICR5 0x51 /* Intr Ctrl reg 5 (r/w) */
37#define MCFSIM_ICR6 0x52 /* Intr Ctrl reg 6 (r/w) */
38#define MCFSIM_ICR7 0x53 /* Intr Ctrl reg 7 (r/w) */
39#define MCFSIM_ICR8 0x54 /* Intr Ctrl reg 8 (r/w) */
40#define MCFSIM_ICR9 0x55 /* Intr Ctrl reg 9 (r/w) */
41#define MCFSIM_ICR10 0x56 /* Intr Ctrl reg 10 (r/w) */
42#define MCFSIM_ICR11 0x57 /* Intr Ctrl reg 11 (r/w) */
43
44#define MCFSIM_CSAR0 0x80 /* CS 0 Address 0 reg (r/w) */
45#define MCFSIM_CSMR0 0x84 /* CS 0 Mask 0 reg (r/w) */
46#define MCFSIM_CSCR0 0x8a /* CS 0 Control reg (r/w) */
47#define MCFSIM_CSAR1 0x8c /* CS 1 Address reg (r/w) */
48#define MCFSIM_CSMR1 0x90 /* CS 1 Mask reg (r/w) */
49#define MCFSIM_CSCR1 0x96 /* CS 1 Control reg (r/w) */
50
51#ifdef CONFIG_OLDMASK
52#define MCFSIM_CSBAR 0x98 /* CS Base Address reg (r/w) */
53#define MCFSIM_CSBAMR 0x9c /* CS Base Mask reg (r/w) */
54#define MCFSIM_CSMR2 0x9e /* CS 2 Mask reg (r/w) */
55#define MCFSIM_CSCR2 0xa2 /* CS 2 Control reg (r/w) */
56#define MCFSIM_CSMR3 0xaa /* CS 3 Mask reg (r/w) */
57#define MCFSIM_CSCR3 0xae /* CS 3 Control reg (r/w) */
58#define MCFSIM_CSMR4 0xb6 /* CS 4 Mask reg (r/w) */
59#define MCFSIM_CSCR4 0xba /* CS 4 Control reg (r/w) */
60#define MCFSIM_CSMR5 0xc2 /* CS 5 Mask reg (r/w) */
61#define MCFSIM_CSCR5 0xc6 /* CS 5 Control reg (r/w) */
62#define MCFSIM_CSMR6 0xce /* CS 6 Mask reg (r/w) */
63#define MCFSIM_CSCR6 0xd2 /* CS 6 Control reg (r/w) */
64#define MCFSIM_CSMR7 0xda /* CS 7 Mask reg (r/w) */
65#define MCFSIM_CSCR7 0xde /* CS 7 Control reg (r/w) */
66#else
67#define MCFSIM_CSAR2 0x98 /* CS 2 Adress reg (r/w) */
68#define MCFSIM_CSMR2 0x9c /* CS 2 Mask reg (r/w) */
69#define MCFSIM_CSCR2 0xa2 /* CS 2 Control reg (r/w) */
70#define MCFSIM_CSAR3 0xa4 /* CS 3 Adress reg (r/w) */
71#define MCFSIM_CSMR3 0xa8 /* CS 3 Mask reg (r/w) */
72#define MCFSIM_CSCR3 0xae /* CS 3 Control reg (r/w) */
73#define MCFSIM_CSAR4 0xb0 /* CS 4 Adress reg (r/w) */
74#define MCFSIM_CSMR4 0xb4 /* CS 4 Mask reg (r/w) */
75#define MCFSIM_CSCR4 0xba /* CS 4 Control reg (r/w) */
76#define MCFSIM_CSAR5 0xbc /* CS 5 Adress reg (r/w) */
77#define MCFSIM_CSMR5 0xc0 /* CS 5 Mask reg (r/w) */
78#define MCFSIM_CSCR5 0xc6 /* CS 5 Control reg (r/w) */
79#define MCFSIM_CSAR6 0xc8 /* CS 6 Adress reg (r/w) */
80#define MCFSIM_CSMR6 0xcc /* CS 6 Mask reg (r/w) */
81#define MCFSIM_CSCR6 0xd2 /* CS 6 Control reg (r/w) */
82#define MCFSIM_CSAR7 0xd4 /* CS 7 Adress reg (r/w) */
83#define MCFSIM_CSMR7 0xd8 /* CS 7 Mask reg (r/w) */
84#define MCFSIM_CSCR7 0xde /* CS 7 Control reg (r/w) */
85#endif /* CONFIG_OLDMASK */
86
87#define MCFSIM_DCR 0x100 /* DRAM Control reg (r/w) */
88#define MCFSIM_DACR0 0x108 /* DRAM 0 Addr and Ctrl (r/w) */
89#define MCFSIM_DMR0 0x10c /* DRAM 0 Mask reg (r/w) */
90#define MCFSIM_DACR1 0x110 /* DRAM 1 Addr and Ctrl (r/w) */
91#define MCFSIM_DMR1 0x114 /* DRAM 1 Mask reg (r/w) */
92
93#define MCFSIM_PADDR 0x244 /* Parallel Direction (r/w) */
94#define MCFSIM_PADAT 0x248 /* Parallel Data (r/w) */
95
96
97/* Definition offset address for CS2-7 -- old mask 5307 */
98
99#define MCF5307_CS2 (0x400000)
100#define MCF5307_CS3 (0x600000)
101#define MCF5307_CS4 (0x800000)
102#define MCF5307_CS5 (0xA00000)
103#define MCF5307_CS6 (0xC00000)
104#define MCF5307_CS7 (0xE00000)
105
106
107/*
108 * Some symbol defines for the above...
109 */
110#define MCFSIM_SWDICR MCFSIM_ICR0 /* Watchdog timer ICR */
111#define MCFSIM_TIMER1ICR MCFSIM_ICR1 /* Timer 1 ICR */
112#define MCFSIM_TIMER2ICR MCFSIM_ICR2 /* Timer 2 ICR */
113#define MCFSIM_UART1ICR MCFSIM_ICR4 /* UART 1 ICR */
114#define MCFSIM_UART2ICR MCFSIM_ICR5 /* UART 2 ICR */
115#define MCFSIM_DMA0ICR MCFSIM_ICR6 /* DMA 0 ICR */
116#define MCFSIM_DMA1ICR MCFSIM_ICR7 /* DMA 1 ICR */
117#define MCFSIM_DMA2ICR MCFSIM_ICR8 /* DMA 2 ICR */
118#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */
119
120#if defined(CONFIG_M5307)
121#define MCFSIM_IMR_MASKALL 0x3fffe /* All SIM intr sources */
122#endif
123
124/*
125 * Macro to set IMR register. It is 32 bits on the 5307.
126 */
127#define mcf_getimr() \
128 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR))
129
130#define mcf_setimr(imr) \
131 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) = (imr);
132
133#define mcf_getipr() \
134 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IPR))
135
136
137/*
138 * Some symbol defines for the Parallel Port Pin Assignment Register
139 */
140#define MCFSIM_PAR_DREQ0 0x40 /* Set to select DREQ0 input */
141 /* Clear to select par I/O */
142#define MCFSIM_PAR_DREQ1 0x20 /* Select DREQ1 input */
143 /* Clear to select par I/O */
144
145/*
146 * Defines for the IRQPAR Register
147 */
148#define IRQ5_LEVEL4 0x80
149#define IRQ3_LEVEL6 0x40
150#define IRQ1_LEVEL2 0x20
151
152
153/*
154 * Define the Cache register flags.
155 */
156#define CACR_EC (1<<31)
157#define CACR_ESB (1<<29)
158#define CACR_DPI (1<<28)
159#define CACR_HLCK (1<<27)
160#define CACR_CINVA (1<<24)
161#define CACR_DNFB (1<<10)
162#define CACR_DCM_WTHRU (0<<8)
163#define CACR_DCM_WBACK (1<<8)
164#define CACR_DCM_OFF_PRE (2<<8)
165#define CACR_DCM_OFF_IMP (3<<8)
166#define CACR_DW (1<<5)
167
168#define ACR_BASE_POS 24
169#define ACR_MASK_POS 16
170#define ACR_ENABLE (1<<15)
171#define ACR_USER (0<<13)
172#define ACR_SUPER (1<<13)
173#define ACR_ANY (2<<13)
174#define ACR_CM_WTHRU (0<<5)
175#define ACR_CM_WBACK (1<<5)
176#define ACR_CM_OFF_PRE (2<<5)
177#define ACR_CM_OFF_IMP (3<<5)
178#define ACR_WPROTECT (1<<2)
179
180/****************************************************************************/
181#endif /* m5307sim_h */
diff --git a/include/asm-m68knommu/m5407sim.h b/include/asm-m68knommu/m5407sim.h
new file mode 100644
index 000000000000..75dcdacdb298
--- /dev/null
+++ b/include/asm-m68knommu/m5407sim.h
@@ -0,0 +1,157 @@
1/****************************************************************************/
2
3/*
4 * m5407sim.h -- ColdFire 5407 System Integration Module support.
5 *
6 * (C) Copyright 2000, Lineo (www.lineo.com)
7 * (C) Copyright 1999, Moreton Bay Ventures Pty Ltd.
8 *
9 * Modified by David W. Miller for the MCF5307 Eval Board.
10 */
11
12/****************************************************************************/
13#ifndef m5407sim_h
14#define m5407sim_h
15/****************************************************************************/
16
17/*
18 * Define the 5407 SIM register set addresses.
19 */
20#define MCFSIM_RSR 0x00 /* Reset Status reg (r/w) */
21#define MCFSIM_SYPCR 0x01 /* System Protection reg (r/w)*/
22#define MCFSIM_SWIVR 0x02 /* SW Watchdog intr reg (r/w) */
23#define MCFSIM_SWSR 0x03 /* SW Watchdog service (r/w) */
24#define MCFSIM_PAR 0x04 /* Pin Assignment reg (r/w) */
25#define MCFSIM_IRQPAR 0x06 /* Interrupt Assignment reg (r/w) */
26#define MCFSIM_PLLCR 0x08 /* PLL Controll Reg*/
27#define MCFSIM_MPARK 0x0C /* BUS Master Control Reg*/
28#define MCFSIM_IPR 0x40 /* Interrupt Pend reg (r/w) */
29#define MCFSIM_IMR 0x44 /* Interrupt Mask reg (r/w) */
30#define MCFSIM_AVR 0x4b /* Autovector Ctrl reg (r/w) */
31#define MCFSIM_ICR0 0x4c /* Intr Ctrl reg 0 (r/w) */
32#define MCFSIM_ICR1 0x4d /* Intr Ctrl reg 1 (r/w) */
33#define MCFSIM_ICR2 0x4e /* Intr Ctrl reg 2 (r/w) */
34#define MCFSIM_ICR3 0x4f /* Intr Ctrl reg 3 (r/w) */
35#define MCFSIM_ICR4 0x50 /* Intr Ctrl reg 4 (r/w) */
36#define MCFSIM_ICR5 0x51 /* Intr Ctrl reg 5 (r/w) */
37#define MCFSIM_ICR6 0x52 /* Intr Ctrl reg 6 (r/w) */
38#define MCFSIM_ICR7 0x53 /* Intr Ctrl reg 7 (r/w) */
39#define MCFSIM_ICR8 0x54 /* Intr Ctrl reg 8 (r/w) */
40#define MCFSIM_ICR9 0x55 /* Intr Ctrl reg 9 (r/w) */
41#define MCFSIM_ICR10 0x56 /* Intr Ctrl reg 10 (r/w) */
42#define MCFSIM_ICR11 0x57 /* Intr Ctrl reg 11 (r/w) */
43
44#define MCFSIM_CSAR0 0x80 /* CS 0 Address 0 reg (r/w) */
45#define MCFSIM_CSMR0 0x84 /* CS 0 Mask 0 reg (r/w) */
46#define MCFSIM_CSCR0 0x8a /* CS 0 Control reg (r/w) */
47#define MCFSIM_CSAR1 0x8c /* CS 1 Address reg (r/w) */
48#define MCFSIM_CSMR1 0x90 /* CS 1 Mask reg (r/w) */
49#define MCFSIM_CSCR1 0x96 /* CS 1 Control reg (r/w) */
50
51#define MCFSIM_CSAR2 0x98 /* CS 2 Adress reg (r/w) */
52#define MCFSIM_CSMR2 0x9c /* CS 2 Mask reg (r/w) */
53#define MCFSIM_CSCR2 0xa2 /* CS 2 Control reg (r/w) */
54#define MCFSIM_CSAR3 0xa4 /* CS 3 Adress reg (r/w) */
55#define MCFSIM_CSMR3 0xa8 /* CS 3 Mask reg (r/w) */
56#define MCFSIM_CSCR3 0xae /* CS 3 Control reg (r/w) */
57#define MCFSIM_CSAR4 0xb0 /* CS 4 Adress reg (r/w) */
58#define MCFSIM_CSMR4 0xb4 /* CS 4 Mask reg (r/w) */
59#define MCFSIM_CSCR4 0xba /* CS 4 Control reg (r/w) */
60#define MCFSIM_CSAR5 0xbc /* CS 5 Adress reg (r/w) */
61#define MCFSIM_CSMR5 0xc0 /* CS 5 Mask reg (r/w) */
62#define MCFSIM_CSCR5 0xc6 /* CS 5 Control reg (r/w) */
63#define MCFSIM_CSAR6 0xc8 /* CS 6 Adress reg (r/w) */
64#define MCFSIM_CSMR6 0xcc /* CS 6 Mask reg (r/w) */
65#define MCFSIM_CSCR6 0xd2 /* CS 6 Control reg (r/w) */
66#define MCFSIM_CSAR7 0xd4 /* CS 7 Adress reg (r/w) */
67#define MCFSIM_CSMR7 0xd8 /* CS 7 Mask reg (r/w) */
68#define MCFSIM_CSCR7 0xde /* CS 7 Control reg (r/w) */
69
70#define MCFSIM_DCR 0x100 /* DRAM Control reg (r/w) */
71#define MCFSIM_DACR0 0x108 /* DRAM 0 Addr and Ctrl (r/w) */
72#define MCFSIM_DMR0 0x10c /* DRAM 0 Mask reg (r/w) */
73#define MCFSIM_DACR1 0x110 /* DRAM 1 Addr and Ctrl (r/w) */
74#define MCFSIM_DMR1 0x114 /* DRAM 1 Mask reg (r/w) */
75
76#define MCFSIM_PADDR 0x244 /* Parallel Direction (r/w) */
77#define MCFSIM_PADAT 0x248 /* Parallel Data (r/w) */
78
79
80/*
81 * Some symbol defines for the above...
82 */
83#define MCFSIM_SWDICR MCFSIM_ICR0 /* Watchdog timer ICR */
84#define MCFSIM_TIMER1ICR MCFSIM_ICR1 /* Timer 1 ICR */
85#define MCFSIM_TIMER2ICR MCFSIM_ICR2 /* Timer 2 ICR */
86#define MCFSIM_UART1ICR MCFSIM_ICR4 /* UART 1 ICR */
87#define MCFSIM_UART2ICR MCFSIM_ICR5 /* UART 2 ICR */
88#define MCFSIM_DMA0ICR MCFSIM_ICR6 /* DMA 0 ICR */
89#define MCFSIM_DMA1ICR MCFSIM_ICR7 /* DMA 1 ICR */
90#define MCFSIM_DMA2ICR MCFSIM_ICR8 /* DMA 2 ICR */
91#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */
92
93/*
94 * Macro to set IMR register. It is 32 bits on the 5407.
95 */
96#define mcf_getimr() \
97 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR))
98
99#define mcf_setimr(imr) \
100 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) = (imr);
101
102#define mcf_getipr() \
103 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IPR))
104
105
106/*
107 * Some symbol defines for the Parallel Port Pin Assignment Register
108 */
109#define MCFSIM_PAR_DREQ0 0x40 /* Set to select DREQ0 input */
110 /* Clear to select par I/O */
111#define MCFSIM_PAR_DREQ1 0x20 /* Select DREQ1 input */
112 /* Clear to select par I/O */
113
114/*
115 * Defines for the IRQPAR Register
116 */
117#define IRQ5_LEVEL4 0x80
118#define IRQ3_LEVEL6 0x40
119#define IRQ1_LEVEL2 0x20
120
121
122/*
123 * Define the Cache register flags.
124 */
125#define CACR_DEC 0x80000000 /* Enable data cache */
126#define CACR_DWP 0x40000000 /* Data write protection */
127#define CACR_DESB 0x20000000 /* Enable data store buffer */
128#define CACR_DDPI 0x10000000 /* Disable CPUSHL */
129#define CACR_DHCLK 0x08000000 /* Half data cache lock mode */
130#define CACR_DDCM_WT 0x00000000 /* Write through cache*/
131#define CACR_DDCM_CP 0x02000000 /* Copyback cache */
132#define CACR_DDCM_P 0x04000000 /* No cache, precise */
133#define CACR_DDCM_IMP 0x06000000 /* No cache, imprecise */
134#define CACR_DCINVA 0x01000000 /* Invalidate data cache */
135#define CACR_BEC 0x00080000 /* Enable branch cache */
136#define CACR_BCINVA 0x00040000 /* Invalidate branch cache */
137#define CACR_IEC 0x00008000 /* Enable instruction cache */
138#define CACR_DNFB 0x00002000 /* Inhibited fill buffer */
139#define CACR_IDPI 0x00001000 /* Disable CPUSHL */
140#define CACR_IHLCK 0x00000800 /* Intruction cache half lock */
141#define CACR_IDCM 0x00000400 /* Intruction cache inhibit */
142#define CACR_ICINVA 0x00000100 /* Invalidate instr cache */
143
144#define ACR_BASE_POS 24 /* Address Base */
145#define ACR_MASK_POS 16 /* Address Mask */
146#define ACR_ENABLE 0x00008000 /* Enable address */
147#define ACR_USER 0x00000000 /* User mode access only */
148#define ACR_SUPER 0x00002000 /* Supervisor mode only */
149#define ACR_ANY 0x00004000 /* Match any access mode */
150#define ACR_CM_WT 0x00000000 /* Write through mode */
151#define ACR_CM_CP 0x00000020 /* Copyback mode */
152#define ACR_CM_OFF_PRE 0x00000040 /* No cache, precise */
153#define ACR_CM_OFF_IMP 0x00000060 /* No cache, imprecise */
154#define ACR_WPROTECT 0x00000004 /* Write protect */
155
156/****************************************************************************/
157#endif /* m5407sim_h */
diff --git a/include/asm-m68knommu/m68360.h b/include/asm-m68knommu/m68360.h
new file mode 100644
index 000000000000..dd11b070884b
--- /dev/null
+++ b/include/asm-m68knommu/m68360.h
@@ -0,0 +1,5 @@
1#include "m68360_regs.h"
2#include "m68360_pram.h"
3#include "m68360_quicc.h"
4#include "m68360_enet.h"
5
diff --git a/include/asm-m68knommu/m68360_enet.h b/include/asm-m68knommu/m68360_enet.h
new file mode 100644
index 000000000000..c36f4d059203
--- /dev/null
+++ b/include/asm-m68knommu/m68360_enet.h
@@ -0,0 +1,177 @@
1/***********************************
2 * $Id: m68360_enet.h,v 1.1 2002/03/02 15:01:07 gerg Exp $
3 ***********************************
4 *
5 ***************************************
6 * Definitions for the ETHERNET controllers
7 ***************************************
8 */
9
10#ifndef __ETHER_H
11#define __ETHER_H
12
13#include "quicc_simple.h"
14
15/*
16 * transmit BD's
17 */
18#define T_R 0x8000 /* ready bit */
19#define E_T_PAD 0x4000 /* short frame padding */
20#define T_W 0x2000 /* wrap bit */
21#define T_I 0x1000 /* interrupt on completion */
22#define T_L 0x0800 /* last in frame */
23#define T_TC 0x0400 /* transmit CRC (when last) */
24
25#define T_DEF 0x0200 /* defer indication */
26#define T_HB 0x0100 /* heartbeat */
27#define T_LC 0x0080 /* error: late collision */
28#define T_RL 0x0040 /* error: retransmission limit */
29#define T_RC 0x003c /* retry count */
30#define T_UN 0x0002 /* error: underrun */
31#define T_CSL 0x0001 /* carier sense lost */
32#define T_ERROR (T_HB | T_LC | T_RL | T_UN | T_CSL)
33
34/*
35 * receive BD's
36 */
37#define R_E 0x8000 /* buffer empty */
38#define R_W 0x2000 /* wrap bit */
39#define R_I 0x1000 /* interrupt on reception */
40#define R_L 0x0800 /* last BD in frame */
41#define R_F 0x0400 /* first BD in frame */
42#define R_M 0x0100 /* received because of promisc. mode */
43
44#define R_LG 0x0020 /* frame too long */
45#define R_NO 0x0010 /* non-octet aligned */
46#define R_SH 0x0008 /* short frame */
47#define R_CR 0x0004 /* receive CRC error */
48#define R_OV 0x0002 /* receive overrun */
49#define R_CL 0x0001 /* collision */
50#define ETHER_R_ERROR (R_LG | R_NO | R_SH | R_CR | R_OV | R_CL)
51
52
53/*
54 * ethernet interrupts
55 */
56#define ETHERNET_GRA 0x0080 /* graceful stop complete */
57#define ETHERNET_TXE 0x0010 /* transmit error */
58#define ETHERNET_RXF 0x0008 /* receive frame */
59#define ETHERNET_BSY 0x0004 /* busy condition */
60#define ETHERNET_TXB 0x0002 /* transmit buffer */
61#define ETHERNET_RXB 0x0001 /* receive buffer */
62
63/*
64 * ethernet protocol specific mode register (PSMR)
65 */
66#define ETHER_HBC 0x8000 /* heartbeat checking */
67#define ETHER_FC 0x4000 /* force collision */
68#define ETHER_RSH 0x2000 /* receive short frames */
69#define ETHER_IAM 0x1000 /* individual address mode */
70#define ETHER_CRC_32 (0x2<<10) /* Enable CRC */
71#define ETHER_PRO 0x0200 /* promiscuous */
72#define ETHER_BRO 0x0100 /* broadcast address */
73#define ETHER_SBT 0x0080 /* stop backoff timer */
74#define ETHER_LPB 0x0040 /* Loop Back Mode */
75#define ETHER_SIP 0x0020 /* sample input pins */
76#define ETHER_LCW 0x0010 /* late collision window */
77#define ETHER_NIB_13 (0x0<<1) /* # of ignored bits 13 */
78#define ETHER_NIB_14 (0x1<<1) /* # of ignored bits 14 */
79#define ETHER_NIB_15 (0x2<<1) /* # of ignored bits 15 */
80#define ETHER_NIB_16 (0x3<<1) /* # of ignored bits 16 */
81#define ETHER_NIB_21 (0x4<<1) /* # of ignored bits 21 */
82#define ETHER_NIB_22 (0x5<<1) /* # of ignored bits 22 */
83#define ETHER_NIB_23 (0x6<<1) /* # of ignored bits 23 */
84#define ETHER_NIB_24 (0x7<<1) /* # of ignored bits 24 */
85
86/*
87 * ethernet specific parameters
88 */
89#define CRC_WORD 4 /* Length in bytes of CRC */
90#define C_PRES 0xffffffff /* preform 32 bit CRC */
91#define C_MASK 0xdebb20e3 /* comply with 32 bit CRC */
92#define CRCEC 0x00000000
93#define ALEC 0x00000000
94#define DISFC 0x00000000
95#define PADS 0x00000000
96#define RET_LIM 0x000f /* retry 15 times to send a frame before interrupt */
97#define ETH_MFLR 0x05ee /* 1518 max frame size */
98#define MINFLR 0x0040 /* Minimum frame size 64 */
99#define MAXD1 0x05ee /* Max dma count 1518 */
100#define MAXD2 0x05ee
101#define GADDR1 0x00000000 /* Clear group address */
102#define GADDR2 0x00000000
103#define GADDR3 0x00000000
104#define GADDR4 0x00000000
105#define P_PER 0x00000000 /*not used */
106#define IADDR1 0x00000000 /* Individual hash table not used */
107#define IADDR2 0x00000000
108#define IADDR3 0x00000000
109#define IADDR4 0x00000000
110#define TADDR_H 0x00000000 /* clear this regs */
111#define TADDR_M 0x00000000
112#define TADDR_L 0x00000000
113
114/* SCC Parameter Ram */
115#define RFCR 0x18 /* normal operation */
116#define TFCR 0x18 /* normal operation */
117#define E_MRBLR 1518 /* Max ethernet frame length */
118
119/*
120 * ethernet specific structure
121 */
122typedef union {
123 unsigned char b[6];
124 struct {
125 unsigned short high;
126 unsigned short middl;
127 unsigned short low;
128 } w;
129} ETHER_ADDR;
130
131typedef struct {
132 int max_frame_length;
133 int promisc_mode;
134 int reject_broadcast;
135 ETHER_ADDR phys_adr;
136} ETHER_SPECIFIC;
137
138typedef struct {
139 ETHER_ADDR dst_addr;
140 ETHER_ADDR src_addr;
141 unsigned short type_or_len;
142 unsigned char data[1];
143} ETHER_FRAME;
144
145#define MAX_DATALEN 1500
146typedef struct {
147 ETHER_ADDR dst_addr;
148 ETHER_ADDR src_addr;
149 unsigned short type_or_len;
150 unsigned char data[MAX_DATALEN];
151 unsigned char fcs[CRC_WORD];
152} ETHER_MAX_FRAME;
153
154
155/*
156 * Internal ethernet function prototypes
157 */
158void ether_interrupt(int scc_num);
159/* mleslie: debug */
160/* static void ethernet_rx_internal(int scc_num); */
161/* static void ethernet_tx_internal(int scc_num); */
162
163/*
164 * User callable routines prototypes (ethernet specific)
165 */
166void ethernet_init(int scc_number,
167 alloc_routine *alloc_buffer,
168 free_routine *free_buffer,
169 store_rx_buffer_routine *store_rx_buffer,
170 handle_tx_error_routine *handle_tx_error,
171 handle_rx_error_routine *handle_rx_error,
172 handle_lost_error_routine *handle_lost_error,
173 ETHER_SPECIFIC *ether_spec);
174int ethernet_tx(int scc_number, void *buf, int length);
175
176#endif
177
diff --git a/include/asm-m68knommu/m68360_pram.h b/include/asm-m68knommu/m68360_pram.h
new file mode 100644
index 000000000000..e6088bbce93d
--- /dev/null
+++ b/include/asm-m68knommu/m68360_pram.h
@@ -0,0 +1,431 @@
1/***********************************
2 * $Id: m68360_pram.h,v 1.1 2002/03/02 15:01:07 gerg Exp $
3 ***********************************
4 *
5 ***************************************
6 * Definitions of the parameter area RAM.
7 * Note that different structures are overlaid
8 * at the same offsets for the different modes
9 * of operation.
10 ***************************************
11 */
12
13#ifndef __PRAM_H
14#define __PRAM_H
15
16/* Time slot assignment table */
17#define VALID_SLOT 0x8000
18#define WRAP_SLOT 0x4000
19
20/*****************************************************************
21 Global Multichannel parameter RAM
22*****************************************************************/
23struct global_multi_pram {
24 /*
25 * Global Multichannel parameter RAM
26 */
27 unsigned long mcbase; /* Multichannel Base pointer */
28 unsigned short qmcstate; /* Multichannel Controller state */
29 unsigned short mrblr; /* Maximum Receive Buffer Length */
30 unsigned short tx_s_ptr; /* TSTATx Pointer */
31 unsigned short rxptr; /* Current Time slot entry in TSATRx */
32 unsigned short grfthr; /* Global Receive frame threshold */
33 unsigned short grfcnt; /* Global Receive Frame Count */
34 unsigned long intbase; /* Multichannel Base address */
35 unsigned long iintptr; /* Pointer to interrupt queue */
36 unsigned short rx_s_ptr; /* TSTARx Pointer */
37
38 unsigned short txptr; /* Current Time slot entry in TSATTx */
39 unsigned long c_mask32; /* CRC Constant (debb20e3) */
40 unsigned short tsatrx[32]; /* Time Slot Assignment Table Rx */
41 unsigned short tsattx[32]; /* Time Slot Assignment Table Tx */
42 unsigned short c_mask16; /* CRC Constant (f0b8) */
43};
44
45/*****************************************************************
46 Quicc32 HDLC parameter RAM
47*****************************************************************/
48struct quicc32_pram {
49
50 unsigned short tbase; /* Tx Buffer Descriptors Base Address */
51 unsigned short chamr; /* Channel Mode Register */
52 unsigned long tstate; /* Tx Internal State */
53 unsigned long txintr; /* Tx Internal Data Pointer */
54 unsigned short tbptr; /* Tx Buffer Descriptor Pointer */
55 unsigned short txcntr; /* Tx Internal Byte Count */
56 unsigned long tupack; /* (Tx Temp) */
57 unsigned long zistate; /* Zero Insertion machine state */
58 unsigned long tcrc; /* Temp Transmit CRC */
59 unsigned short intmask; /* Channel's interrupt mask flags */
60 unsigned short bdflags;
61 unsigned short rbase; /* Rx Buffer Descriptors Base Address */
62 unsigned short mflr; /* Max Frame Length Register */
63 unsigned long rstate; /* Rx Internal State */
64 unsigned long rxintr; /* Rx Internal Data Pointer */
65 unsigned short rbptr; /* Rx Buffer Descriptor Pointer */
66 unsigned short rxbyc; /* Rx Internal Byte Count */
67 unsigned long rpack; /* (Rx Temp) */
68 unsigned long zdstate; /* Zero Deletion machine state */
69 unsigned long rcrc; /* Temp Transmit CRC */
70 unsigned short maxc; /* Max_length counter */
71 unsigned short tmp_mb; /* Temp */
72};
73
74
75/*****************************************************************
76 HDLC parameter RAM
77*****************************************************************/
78
79struct hdlc_pram {
80 /*
81 * SCC parameter RAM
82 */
83 unsigned short rbase; /* RX BD base address */
84 unsigned short tbase; /* TX BD base address */
85 unsigned char rfcr; /* Rx function code */
86 unsigned char tfcr; /* Tx function code */
87 unsigned short mrblr; /* Rx buffer length */
88 unsigned long rstate; /* Rx internal state */
89 unsigned long rptr; /* Rx internal data pointer */
90 unsigned short rbptr; /* rb BD Pointer */
91 unsigned short rcount; /* Rx internal byte count */
92 unsigned long rtemp; /* Rx temp */
93 unsigned long tstate; /* Tx internal state */
94 unsigned long tptr; /* Tx internal data pointer */
95 unsigned short tbptr; /* Tx BD pointer */
96 unsigned short tcount; /* Tx byte count */
97 unsigned long ttemp; /* Tx temp */
98 unsigned long rcrc; /* temp receive CRC */
99 unsigned long tcrc; /* temp transmit CRC */
100
101 /*
102 * HDLC specific parameter RAM
103 */
104 unsigned char RESERVED1[4]; /* Reserved area */
105 unsigned long c_mask; /* CRC constant */
106 unsigned long c_pres; /* CRC preset */
107 unsigned short disfc; /* discarded frame counter */
108 unsigned short crcec; /* CRC error counter */
109 unsigned short abtsc; /* abort sequence counter */
110 unsigned short nmarc; /* nonmatching address rx cnt */
111 unsigned short retrc; /* frame retransmission cnt */
112 unsigned short mflr; /* maximum frame length reg */
113 unsigned short max_cnt; /* maximum length counter */
114 unsigned short rfthr; /* received frames threshold */
115 unsigned short rfcnt; /* received frames count */
116 unsigned short hmask; /* user defined frm addr mask */
117 unsigned short haddr1; /* user defined frm address 1 */
118 unsigned short haddr2; /* user defined frm address 2 */
119 unsigned short haddr3; /* user defined frm address 3 */
120 unsigned short haddr4; /* user defined frm address 4 */
121 unsigned short tmp; /* temp */
122 unsigned short tmp_mb; /* temp */
123};
124
125
126
127/*****************************************************************
128 UART parameter RAM
129*****************************************************************/
130
131/*
132 * bits in uart control characters table
133 */
134#define CC_INVALID 0x8000 /* control character is valid */
135#define CC_REJ 0x4000 /* don't store char in buffer */
136#define CC_CHAR 0x00ff /* control character */
137
138/* UART */
139struct uart_pram {
140 /*
141 * SCC parameter RAM
142 */
143 unsigned short rbase; /* RX BD base address */
144 unsigned short tbase; /* TX BD base address */
145 unsigned char rfcr; /* Rx function code */
146 unsigned char tfcr; /* Tx function code */
147 unsigned short mrblr; /* Rx buffer length */
148 unsigned long rstate; /* Rx internal state */
149 unsigned long rptr; /* Rx internal data pointer */
150 unsigned short rbptr; /* rb BD Pointer */
151 unsigned short rcount; /* Rx internal byte count */
152 unsigned long rx_temp; /* Rx temp */
153 unsigned long tstate; /* Tx internal state */
154 unsigned long tptr; /* Tx internal data pointer */
155 unsigned short tbptr; /* Tx BD pointer */
156 unsigned short tcount; /* Tx byte count */
157 unsigned long ttemp; /* Tx temp */
158 unsigned long rcrc; /* temp receive CRC */
159 unsigned long tcrc; /* temp transmit CRC */
160
161 /*
162 * UART specific parameter RAM
163 */
164 unsigned char RESERVED1[8]; /* Reserved area */
165 unsigned short max_idl; /* maximum idle characters */
166 unsigned short idlc; /* rx idle counter (internal) */
167 unsigned short brkcr; /* break count register */
168
169 unsigned short parec; /* Rx parity error counter */
170 unsigned short frmer; /* Rx framing error counter */
171 unsigned short nosec; /* Rx noise counter */
172 unsigned short brkec; /* Rx break character counter */
173 unsigned short brkln; /* Reaceive break length */
174
175 unsigned short uaddr1; /* address character 1 */
176 unsigned short uaddr2; /* address character 2 */
177 unsigned short rtemp; /* temp storage */
178 unsigned short toseq; /* Tx out of sequence char */
179 unsigned short cc[8]; /* Rx control characters */
180 unsigned short rccm; /* Rx control char mask */
181 unsigned short rccr; /* Rx control char register */
182 unsigned short rlbc; /* Receive last break char */
183};
184
185
186
187/*****************************************************************
188 BISYNC parameter RAM
189*****************************************************************/
190
191struct bisync_pram {
192 /*
193 * SCC parameter RAM
194 */
195 unsigned short rbase; /* RX BD base address */
196 unsigned short tbase; /* TX BD base address */
197 unsigned char rfcr; /* Rx function code */
198 unsigned char tfcr; /* Tx function code */
199 unsigned short mrblr; /* Rx buffer length */
200 unsigned long rstate; /* Rx internal state */
201 unsigned long rptr; /* Rx internal data pointer */
202 unsigned short rbptr; /* rb BD Pointer */
203 unsigned short rcount; /* Rx internal byte count */
204 unsigned long rtemp; /* Rx temp */
205 unsigned long tstate; /* Tx internal state */
206 unsigned long tptr; /* Tx internal data pointer */
207 unsigned short tbptr; /* Tx BD pointer */
208 unsigned short tcount; /* Tx byte count */
209 unsigned long ttemp; /* Tx temp */
210 unsigned long rcrc; /* temp receive CRC */
211 unsigned long tcrc; /* temp transmit CRC */
212
213 /*
214 * BISYNC specific parameter RAM
215 */
216 unsigned char RESERVED1[4]; /* Reserved area */
217 unsigned long crcc; /* CRC Constant Temp Value */
218 unsigned short prcrc; /* Preset Receiver CRC-16/LRC */
219 unsigned short ptcrc; /* Preset Transmitter CRC-16/LRC */
220 unsigned short parec; /* Receive Parity Error Counter */
221 unsigned short bsync; /* BISYNC SYNC Character */
222 unsigned short bdle; /* BISYNC DLE Character */
223 unsigned short cc[8]; /* Rx control characters */
224 unsigned short rccm; /* Receive Control Character Mask */
225};
226
227/*****************************************************************
228 IOM2 parameter RAM
229 (overlaid on tx bd[5] of SCC channel[2])
230*****************************************************************/
231struct iom2_pram {
232 unsigned short ci_data; /* ci data */
233 unsigned short monitor_data; /* monitor data */
234 unsigned short tstate; /* transmitter state */
235 unsigned short rstate; /* receiver state */
236};
237
238/*****************************************************************
239 SPI/SMC parameter RAM
240 (overlaid on tx bd[6,7] of SCC channel[2])
241*****************************************************************/
242
243#define SPI_R 0x8000 /* Ready bit in BD */
244
245struct spi_pram {
246 unsigned short rbase; /* Rx BD Base Address */
247 unsigned short tbase; /* Tx BD Base Address */
248 unsigned char rfcr; /* Rx function code */
249 unsigned char tfcr; /* Tx function code */
250 unsigned short mrblr; /* Rx buffer length */
251 unsigned long rstate; /* Rx internal state */
252 unsigned long rptr; /* Rx internal data pointer */
253 unsigned short rbptr; /* rb BD Pointer */
254 unsigned short rcount; /* Rx internal byte count */
255 unsigned long rtemp; /* Rx temp */
256 unsigned long tstate; /* Tx internal state */
257 unsigned long tptr; /* Tx internal data pointer */
258 unsigned short tbptr; /* Tx BD pointer */
259 unsigned short tcount; /* Tx byte count */
260 unsigned long ttemp; /* Tx temp */
261};
262
263struct smc_uart_pram {
264 unsigned short rbase; /* Rx BD Base Address */
265 unsigned short tbase; /* Tx BD Base Address */
266 unsigned char rfcr; /* Rx function code */
267 unsigned char tfcr; /* Tx function code */
268 unsigned short mrblr; /* Rx buffer length */
269 unsigned long rstate; /* Rx internal state */
270 unsigned long rptr; /* Rx internal data pointer */
271 unsigned short rbptr; /* rb BD Pointer */
272 unsigned short rcount; /* Rx internal byte count */
273 unsigned long rtemp; /* Rx temp */
274 unsigned long tstate; /* Tx internal state */
275 unsigned long tptr; /* Tx internal data pointer */
276 unsigned short tbptr; /* Tx BD pointer */
277 unsigned short tcount; /* Tx byte count */
278 unsigned long ttemp; /* Tx temp */
279 unsigned short max_idl; /* Maximum IDLE Characters */
280 unsigned short idlc; /* Temporary IDLE Counter */
281 unsigned short brkln; /* Last Rx Break Length */
282 unsigned short brkec; /* Rx Break Condition Counter */
283 unsigned short brkcr; /* Break Count Register (Tx) */
284 unsigned short r_mask; /* Temporary bit mask */
285};
286
287struct smc_trnsp_pram {
288 unsigned short rbase; /* rx BD Base Address */
289 unsigned short tbase; /* Tx BD Base Address */
290 unsigned char rfcr; /* Rx function code */
291 unsigned char tfcr; /* Tx function code */
292 unsigned short mrblr; /* Rx buffer length */
293 unsigned long rstate; /* Rx internal state */
294 unsigned long rptr; /* Rx internal data pointer */
295 unsigned short rbptr; /* rb BD Pointer */
296 unsigned short rcount; /* Rx internal byte count */
297 unsigned long rtemp; /* Rx temp */
298 unsigned long tstate; /* Tx internal state */
299 unsigned long tptr; /* Tx internal data pointer */
300 unsigned short tbptr; /* Tx BD pointer */
301 unsigned short tcount; /* Tx byte count */
302 unsigned long ttemp; /* Tx temp */
303 unsigned short reserved[5]; /* Reserved */
304};
305
306struct idma_pram {
307 unsigned short ibase; /* IDMA BD Base Address */
308 unsigned short ibptr; /* IDMA buffer descriptor pointer */
309 unsigned long istate; /* IDMA internal state */
310 unsigned long itemp; /* IDMA temp */
311};
312
313struct ethernet_pram {
314 /*
315 * SCC parameter RAM
316 */
317 unsigned short rbase; /* RX BD base address */
318 unsigned short tbase; /* TX BD base address */
319 unsigned char rfcr; /* Rx function code */
320 unsigned char tfcr; /* Tx function code */
321 unsigned short mrblr; /* Rx buffer length */
322 unsigned long rstate; /* Rx internal state */
323 unsigned long rptr; /* Rx internal data pointer */
324 unsigned short rbptr; /* rb BD Pointer */
325 unsigned short rcount; /* Rx internal byte count */
326 unsigned long rtemp; /* Rx temp */
327 unsigned long tstate; /* Tx internal state */
328 unsigned long tptr; /* Tx internal data pointer */
329 unsigned short tbptr; /* Tx BD pointer */
330 unsigned short tcount; /* Tx byte count */
331 unsigned long ttemp; /* Tx temp */
332 unsigned long rcrc; /* temp receive CRC */
333 unsigned long tcrc; /* temp transmit CRC */
334
335 /*
336 * ETHERNET specific parameter RAM
337 */
338 unsigned long c_pres; /* preset CRC */
339 unsigned long c_mask; /* constant mask for CRC */
340 unsigned long crcec; /* CRC error counter */
341 unsigned long alec; /* alighnment error counter */
342 unsigned long disfc; /* discard frame counter */
343 unsigned short pads; /* short frame PAD characters */
344 unsigned short ret_lim; /* retry limit threshold */
345 unsigned short ret_cnt; /* retry limit counter */
346 unsigned short mflr; /* maximum frame length reg */
347 unsigned short minflr; /* minimum frame length reg */
348 unsigned short maxd1; /* maximum DMA1 length reg */
349 unsigned short maxd2; /* maximum DMA2 length reg */
350 unsigned short maxd; /* rx max DMA */
351 unsigned short dma_cnt; /* rx dma counter */
352 unsigned short max_b; /* max bd byte count */
353 unsigned short gaddr1; /* group address filter 1 */
354 unsigned short gaddr2; /* group address filter 2 */
355 unsigned short gaddr3; /* group address filter 3 */
356 unsigned short gaddr4; /* group address filter 4 */
357 unsigned long tbuf0_data0; /* save area 0 - current frm */
358 unsigned long tbuf0_data1; /* save area 1 - current frm */
359 unsigned long tbuf0_rba0;
360 unsigned long tbuf0_crc;
361 unsigned short tbuf0_bcnt;
362 union {
363 unsigned char b[6];
364 struct {
365 unsigned short high;
366 unsigned short middl;
367 unsigned short low;
368 } w;
369 } paddr;
370 unsigned short p_per; /* persistence */
371 unsigned short rfbd_ptr; /* rx first bd pointer */
372 unsigned short tfbd_ptr; /* tx first bd pointer */
373 unsigned short tlbd_ptr; /* tx last bd pointer */
374 unsigned long tbuf1_data0; /* save area 0 - next frame */
375 unsigned long tbuf1_data1; /* save area 1 - next frame */
376 unsigned long tbuf1_rba0;
377 unsigned long tbuf1_crc;
378 unsigned short tbuf1_bcnt;
379 unsigned short tx_len; /* tx frame length counter */
380 unsigned short iaddr1; /* individual address filter 1*/
381 unsigned short iaddr2; /* individual address filter 2*/
382 unsigned short iaddr3; /* individual address filter 3*/
383 unsigned short iaddr4; /* individual address filter 4*/
384 unsigned short boff_cnt; /* back-off counter */
385 unsigned short taddr_h; /* temp address (MSB) */
386 unsigned short taddr_m; /* temp address */
387 unsigned short taddr_l; /* temp address (LSB) */
388};
389
390struct transparent_pram {
391 /*
392 * SCC parameter RAM
393 */
394 unsigned short rbase; /* RX BD base address */
395 unsigned short tbase; /* TX BD base address */
396 unsigned char rfcr; /* Rx function code */
397 unsigned char tfcr; /* Tx function code */
398 unsigned short mrblr; /* Rx buffer length */
399 unsigned long rstate; /* Rx internal state */
400 unsigned long rptr; /* Rx internal data pointer */
401 unsigned short rbptr; /* rb BD Pointer */
402 unsigned short rcount; /* Rx internal byte count */
403 unsigned long rtemp; /* Rx temp */
404 unsigned long tstate; /* Tx internal state */
405 unsigned long tptr; /* Tx internal data pointer */
406 unsigned short tbptr; /* Tx BD pointer */
407 unsigned short tcount; /* Tx byte count */
408 unsigned long ttemp; /* Tx temp */
409 unsigned long rcrc; /* temp receive CRC */
410 unsigned long tcrc; /* temp transmit CRC */
411
412 /*
413 * TRANSPARENT specific parameter RAM
414 */
415 unsigned long crc_p; /* CRC Preset */
416 unsigned long crc_c; /* CRC constant */
417};
418
419struct timer_pram {
420 /*
421 * RISC timers parameter RAM
422 */
423 unsigned short tm_base; /* RISC timer table base adr */
424 unsigned short tm_ptr; /* RISC timer table pointer */
425 unsigned short r_tmr; /* RISC timer mode register */
426 unsigned short r_tmv; /* RISC timer valid register */
427 unsigned long tm_cmd; /* RISC timer cmd register */
428 unsigned long tm_cnt; /* RISC timer internal cnt */
429};
430
431#endif
diff --git a/include/asm-m68knommu/m68360_quicc.h b/include/asm-m68knommu/m68360_quicc.h
new file mode 100644
index 000000000000..6d40f4d18e10
--- /dev/null
+++ b/include/asm-m68knommu/m68360_quicc.h
@@ -0,0 +1,362 @@
1/***********************************
2 * $Id: m68360_quicc.h,v 1.1 2002/03/02 15:01:07 gerg Exp $
3 ***********************************
4 *
5 ***************************************
6 * Definitions of QUICC memory structures
7 ***************************************
8 */
9
10#ifndef __M68360_QUICC_H
11#define __M68360_QUICC_H
12
13/*
14 * include registers and
15 * parameter ram definitions files
16 */
17#include <asm/m68360_regs.h>
18#include <asm/m68360_pram.h>
19
20
21
22/* Buffer Descriptors */
23typedef struct quicc_bd {
24 volatile unsigned short status;
25 volatile unsigned short length;
26 volatile unsigned char *buf; /* WARNING: This is only true if *char is 32 bits */
27} QUICC_BD;
28
29
30#ifdef MOTOROLA_ORIGINAL
31struct user_data {
32 /* BASE + 0x000: user data memory */
33 volatile unsigned char udata_bd_ucode[0x400]; /*user data bd's Ucode*/
34 volatile unsigned char udata_bd[0x200]; /*user data Ucode */
35 volatile unsigned char ucode_ext[0x100]; /*Ucode Extention ram */
36 volatile unsigned char RESERVED1[0x500]; /* Reserved area */
37};
38#else
39struct user_data {
40 /* BASE + 0x000: user data memory */
41 volatile unsigned char udata_bd_ucode[0x400]; /* user data, bds, Ucode*/
42 volatile unsigned char udata_bd1[0x200]; /* user, bds */
43 volatile unsigned char ucode_bd_scratch[0x100]; /* user, bds, ucode scratch */
44 volatile unsigned char udata_bd2[0x100]; /* user, bds */
45 volatile unsigned char RESERVED1[0x400]; /* Reserved area */
46};
47#endif
48
49
50/*
51 * internal ram
52 */
53typedef struct quicc {
54 union {
55 struct quicc32_pram ch_pram_tbl[32]; /* 32*64(bytes) per channel */
56 struct user_data u;
57 }ch_or_u; /* multipul or user space */
58
59 /* BASE + 0xc00: PARAMETER RAM */
60 union {
61 struct scc_pram {
62 union {
63 struct hdlc_pram h;
64 struct uart_pram u;
65 struct bisync_pram b;
66 struct transparent_pram t;
67 unsigned char RESERVED66[0x70];
68 } pscc; /* scc parameter area (protocol dependent) */
69 union {
70 struct {
71 unsigned char RESERVED70[0x10];
72 struct spi_pram spi;
73 unsigned char RESERVED72[0x8];
74 struct timer_pram timer;
75 } timer_spi;
76 struct {
77 struct idma_pram idma;
78 unsigned char RESERVED67[0x4];
79 union {
80 struct smc_uart_pram u;
81 struct smc_trnsp_pram t;
82 } psmc;
83 } idma_smc;
84 } pothers;
85 } scc;
86 struct ethernet_pram enet_scc;
87 struct global_multi_pram m;
88 unsigned char pr[0x100];
89 } pram[4];
90
91 /* reserved */
92
93 /* BASE + 0x1000: INTERNAL REGISTERS */
94 /* SIM */
95 volatile unsigned long sim_mcr; /* module configuration reg */
96 volatile unsigned short sim_simtr; /* module test register */
97 volatile unsigned char RESERVED2[0x2]; /* Reserved area */
98 volatile unsigned char sim_avr; /* auto vector reg */
99 volatile unsigned char sim_rsr; /* reset status reg */
100 volatile unsigned char RESERVED3[0x2]; /* Reserved area */
101 volatile unsigned char sim_clkocr; /* CLCO control register */
102 volatile unsigned char RESERVED62[0x3]; /* Reserved area */
103 volatile unsigned short sim_pllcr; /* PLL control register */
104 volatile unsigned char RESERVED63[0x2]; /* Reserved area */
105 volatile unsigned short sim_cdvcr; /* Clock devider control register */
106 volatile unsigned short sim_pepar; /* Port E pin assignment register */
107 volatile unsigned char RESERVED64[0xa]; /* Reserved area */
108 volatile unsigned char sim_sypcr; /* system protection control*/
109 volatile unsigned char sim_swiv; /* software interrupt vector*/
110 volatile unsigned char RESERVED6[0x2]; /* Reserved area */
111 volatile unsigned short sim_picr; /* periodic interrupt control reg */
112 volatile unsigned char RESERVED7[0x2]; /* Reserved area */
113 volatile unsigned short sim_pitr; /* periodic interrupt timing reg */
114 volatile unsigned char RESERVED8[0x3]; /* Reserved area */
115 volatile unsigned char sim_swsr; /* software service */
116 volatile unsigned long sim_bkar; /* breakpoint address register*/
117 volatile unsigned long sim_bkcr; /* breakpoint control register*/
118 volatile unsigned char RESERVED10[0x8]; /* Reserved area */
119 /* MEMC */
120 volatile unsigned long memc_gmr; /* Global memory register */
121 volatile unsigned short memc_mstat; /* MEMC status register */
122 volatile unsigned char RESERVED11[0xa]; /* Reserved area */
123 volatile unsigned long memc_br0; /* base register 0 */
124 volatile unsigned long memc_or0; /* option register 0 */
125 volatile unsigned char RESERVED12[0x8]; /* Reserved area */
126 volatile unsigned long memc_br1; /* base register 1 */
127 volatile unsigned long memc_or1; /* option register 1 */
128 volatile unsigned char RESERVED13[0x8]; /* Reserved area */
129 volatile unsigned long memc_br2; /* base register 2 */
130 volatile unsigned long memc_or2; /* option register 2 */
131 volatile unsigned char RESERVED14[0x8]; /* Reserved area */
132 volatile unsigned long memc_br3; /* base register 3 */
133 volatile unsigned long memc_or3; /* option register 3 */
134 volatile unsigned char RESERVED15[0x8]; /* Reserved area */
135 volatile unsigned long memc_br4; /* base register 3 */
136 volatile unsigned long memc_or4; /* option register 3 */
137 volatile unsigned char RESERVED16[0x8]; /* Reserved area */
138 volatile unsigned long memc_br5; /* base register 3 */
139 volatile unsigned long memc_or5; /* option register 3 */
140 volatile unsigned char RESERVED17[0x8]; /* Reserved area */
141 volatile unsigned long memc_br6; /* base register 3 */
142 volatile unsigned long memc_or6; /* option register 3 */
143 volatile unsigned char RESERVED18[0x8]; /* Reserved area */
144 volatile unsigned long memc_br7; /* base register 3 */
145 volatile unsigned long memc_or7; /* option register 3 */
146 volatile unsigned char RESERVED9[0x28]; /* Reserved area */
147 /* TEST */
148 volatile unsigned short test_tstmra; /* master shift a */
149 volatile unsigned short test_tstmrb; /* master shift b */
150 volatile unsigned short test_tstsc; /* shift count */
151 volatile unsigned short test_tstrc; /* repetition counter */
152 volatile unsigned short test_creg; /* control */
153 volatile unsigned short test_dreg; /* destributed register */
154 volatile unsigned char RESERVED58[0x404]; /* Reserved area */
155 /* IDMA1 */
156 volatile unsigned short idma_iccr; /* channel configuration reg*/
157 volatile unsigned char RESERVED19[0x2]; /* Reserved area */
158 volatile unsigned short idma1_cmr; /* dma mode reg */
159 volatile unsigned char RESERVED68[0x2]; /* Reserved area */
160 volatile unsigned long idma1_sapr; /* dma source addr ptr */
161 volatile unsigned long idma1_dapr; /* dma destination addr ptr */
162 volatile unsigned long idma1_bcr; /* dma byte count reg */
163 volatile unsigned char idma1_fcr; /* function code reg */
164 volatile unsigned char RESERVED20; /* Reserved area */
165 volatile unsigned char idma1_cmar; /* channel mask reg */
166 volatile unsigned char RESERVED21; /* Reserved area */
167 volatile unsigned char idma1_csr; /* channel status reg */
168 volatile unsigned char RESERVED22[0x3]; /* Reserved area */
169 /* SDMA */
170 volatile unsigned char sdma_sdsr; /* status reg */
171 volatile unsigned char RESERVED23; /* Reserved area */
172 volatile unsigned short sdma_sdcr; /* configuration reg */
173 volatile unsigned long sdma_sdar; /* address reg */
174 /* IDMA2 */
175 volatile unsigned char RESERVED69[0x2]; /* Reserved area */
176 volatile unsigned short idma2_cmr; /* dma mode reg */
177 volatile unsigned long idma2_sapr; /* dma source addr ptr */
178 volatile unsigned long idma2_dapr; /* dma destination addr ptr */
179 volatile unsigned long idma2_bcr; /* dma byte count reg */
180 volatile unsigned char idma2_fcr; /* function code reg */
181 volatile unsigned char RESERVED24; /* Reserved area */
182 volatile unsigned char idma2_cmar; /* channel mask reg */
183 volatile unsigned char RESERVED25; /* Reserved area */
184 volatile unsigned char idma2_csr; /* channel status reg */
185 volatile unsigned char RESERVED26[0x7]; /* Reserved area */
186 /* Interrupt Controller */
187 volatile unsigned long intr_cicr; /* CP interrupt configuration reg*/
188 volatile unsigned long intr_cipr; /* CP interrupt pending reg */
189 volatile unsigned long intr_cimr; /* CP interrupt mask reg */
190 volatile unsigned long intr_cisr; /* CP interrupt in service reg*/
191 /* Parallel I/O */
192 volatile unsigned short pio_padir; /* port A data direction reg */
193 volatile unsigned short pio_papar; /* port A pin assignment reg */
194 volatile unsigned short pio_paodr; /* port A open drain reg */
195 volatile unsigned short pio_padat; /* port A data register */
196 volatile unsigned char RESERVED28[0x8]; /* Reserved area */
197 volatile unsigned short pio_pcdir; /* port C data direction reg*/
198 volatile unsigned short pio_pcpar; /* port C pin assignment reg*/
199 volatile unsigned short pio_pcso; /* port C special options */
200 volatile unsigned short pio_pcdat; /* port C data register */
201 volatile unsigned short pio_pcint; /* port C interrupt cntrl reg */
202 volatile unsigned char RESERVED29[0x16]; /* Reserved area */
203 /* Timer */
204 volatile unsigned short timer_tgcr; /* timer global configuration reg */
205 volatile unsigned char RESERVED30[0xe]; /* Reserved area */
206 volatile unsigned short timer_tmr1; /* timer 1 mode reg */
207 volatile unsigned short timer_tmr2; /* timer 2 mode reg */
208 volatile unsigned short timer_trr1; /* timer 1 referance reg */
209 volatile unsigned short timer_trr2; /* timer 2 referance reg */
210 volatile unsigned short timer_tcr1; /* timer 1 capture reg */
211 volatile unsigned short timer_tcr2; /* timer 2 capture reg */
212 volatile unsigned short timer_tcn1; /* timer 1 counter reg */
213 volatile unsigned short timer_tcn2; /* timer 2 counter reg */
214 volatile unsigned short timer_tmr3; /* timer 3 mode reg */
215 volatile unsigned short timer_tmr4; /* timer 4 mode reg */
216 volatile unsigned short timer_trr3; /* timer 3 referance reg */
217 volatile unsigned short timer_trr4; /* timer 4 referance reg */
218 volatile unsigned short timer_tcr3; /* timer 3 capture reg */
219 volatile unsigned short timer_tcr4; /* timer 4 capture reg */
220 volatile unsigned short timer_tcn3; /* timer 3 counter reg */
221 volatile unsigned short timer_tcn4; /* timer 4 counter reg */
222 volatile unsigned short timer_ter1; /* timer 1 event reg */
223 volatile unsigned short timer_ter2; /* timer 2 event reg */
224 volatile unsigned short timer_ter3; /* timer 3 event reg */
225 volatile unsigned short timer_ter4; /* timer 4 event reg */
226 volatile unsigned char RESERVED34[0x8]; /* Reserved area */
227 /* CP */
228 volatile unsigned short cp_cr; /* command register */
229 volatile unsigned char RESERVED35[0x2]; /* Reserved area */
230 volatile unsigned short cp_rccr; /* main configuration reg */
231 volatile unsigned char RESERVED37; /* Reserved area */
232 volatile unsigned char cp_rmds; /* development support status reg */
233 volatile unsigned long cp_rmdr; /* development support control reg */
234 volatile unsigned short cp_rctr1; /* ram break register 1 */
235 volatile unsigned short cp_rctr2; /* ram break register 2 */
236 volatile unsigned short cp_rctr3; /* ram break register 3 */
237 volatile unsigned short cp_rctr4; /* ram break register 4 */
238 volatile unsigned char RESERVED59[0x2]; /* Reserved area */
239 volatile unsigned short cp_rter; /* RISC timers event reg */
240 volatile unsigned char RESERVED38[0x2]; /* Reserved area */
241 volatile unsigned short cp_rtmr; /* RISC timers mask reg */
242 volatile unsigned char RESERVED39[0x14]; /* Reserved area */
243 /* BRG */
244 union {
245 volatile unsigned long l;
246 struct {
247 volatile unsigned short BRGC_RESERV:14;
248 volatile unsigned short rst:1;
249 volatile unsigned short en:1;
250 volatile unsigned short extc:2;
251 volatile unsigned short atb:1;
252 volatile unsigned short cd:12;
253 volatile unsigned short div16:1;
254 } b;
255 } brgc[4]; /* BRG1-BRG4 configuration regs*/
256 /* SCC registers */
257 struct scc_regs {
258 union {
259 struct {
260 /* Low word. */
261 volatile unsigned short GSMR_RESERV2:1;
262 volatile unsigned short edge:2;
263 volatile unsigned short tci:1;
264 volatile unsigned short tsnc:2;
265 volatile unsigned short rinv:1;
266 volatile unsigned short tinv:1;
267 volatile unsigned short tpl:3;
268 volatile unsigned short tpp:2;
269 volatile unsigned short tend:1;
270 volatile unsigned short tdcr:2;
271 volatile unsigned short rdcr:2;
272 volatile unsigned short renc:3;
273 volatile unsigned short tenc:3;
274 volatile unsigned short diag:2;
275 volatile unsigned short enr:1;
276 volatile unsigned short ent:1;
277 volatile unsigned short mode:4;
278 /* High word. */
279 volatile unsigned short GSMR_RESERV1:14;
280 volatile unsigned short pri:1;
281 volatile unsigned short gde:1;
282 volatile unsigned short tcrc:2;
283 volatile unsigned short revd:1;
284 volatile unsigned short trx:1;
285 volatile unsigned short ttx:1;
286 volatile unsigned short cdp:1;
287 volatile unsigned short ctsp:1;
288 volatile unsigned short cds:1;
289 volatile unsigned short ctss:1;
290 volatile unsigned short tfl:1;
291 volatile unsigned short rfw:1;
292 volatile unsigned short txsy:1;
293 volatile unsigned short synl:2;
294 volatile unsigned short rtsm:1;
295 volatile unsigned short rsyn:1;
296 } b;
297 struct {
298 volatile unsigned long low;
299 volatile unsigned long high;
300 } w;
301 } scc_gsmr; /* SCC general mode reg */
302 volatile unsigned short scc_psmr; /* protocol specific mode reg */
303 volatile unsigned char RESERVED42[0x2]; /* Reserved area */
304 volatile unsigned short scc_todr; /* SCC transmit on demand */
305 volatile unsigned short scc_dsr; /* SCC data sync reg */
306 volatile unsigned short scc_scce; /* SCC event reg */
307 volatile unsigned char RESERVED43[0x2];/* Reserved area */
308 volatile unsigned short scc_sccm; /* SCC mask reg */
309 volatile unsigned char RESERVED44[0x1];/* Reserved area */
310 volatile unsigned char scc_sccs; /* SCC status reg */
311 volatile unsigned char RESERVED45[0x8]; /* Reserved area */
312 } scc_regs[4];
313 /* SMC */
314 struct smc_regs {
315 volatile unsigned char RESERVED46[0x2]; /* Reserved area */
316 volatile unsigned short smc_smcmr; /* SMC mode reg */
317 volatile unsigned char RESERVED60[0x2]; /* Reserved area */
318 volatile unsigned char smc_smce; /* SMC event reg */
319 volatile unsigned char RESERVED47[0x3]; /* Reserved area */
320 volatile unsigned char smc_smcm; /* SMC mask reg */
321 volatile unsigned char RESERVED48[0x5]; /* Reserved area */
322 } smc_regs[2];
323 /* SPI */
324 volatile unsigned short spi_spmode; /* SPI mode reg */
325 volatile unsigned char RESERVED51[0x4]; /* Reserved area */
326 volatile unsigned char spi_spie; /* SPI event reg */
327 volatile unsigned char RESERVED52[0x3]; /* Reserved area */
328 volatile unsigned char spi_spim; /* SPI mask reg */
329 volatile unsigned char RESERVED53[0x2]; /* Reserved area */
330 volatile unsigned char spi_spcom; /* SPI command reg */
331 volatile unsigned char RESERVED54[0x4]; /* Reserved area */
332 /* PIP */
333 volatile unsigned short pip_pipc; /* pip configuration reg */
334 volatile unsigned char RESERVED65[0x2]; /* Reserved area */
335 volatile unsigned short pip_ptpr; /* pip timing parameters reg */
336 volatile unsigned long pip_pbdir; /* port b data direction reg */
337 volatile unsigned long pip_pbpar; /* port b pin assignment reg */
338 volatile unsigned long pip_pbodr; /* port b open drain reg */
339 volatile unsigned long pip_pbdat; /* port b data reg */
340 volatile unsigned char RESERVED71[0x18]; /* Reserved area */
341 /* Serial Interface */
342 volatile unsigned long si_simode; /* SI mode register */
343 volatile unsigned char si_sigmr; /* SI global mode register */
344 volatile unsigned char RESERVED55; /* Reserved area */
345 volatile unsigned char si_sistr; /* SI status register */
346 volatile unsigned char si_sicmr; /* SI command register */
347 volatile unsigned char RESERVED56[0x4]; /* Reserved area */
348 volatile unsigned long si_sicr; /* SI clock routing */
349 volatile unsigned long si_sirp; /* SI ram pointers */
350 volatile unsigned char RESERVED57[0xc]; /* Reserved area */
351 volatile unsigned short si_siram[0x80]; /* SI routing ram */
352} QUICC;
353
354#endif
355
356/*
357 * Local variables:
358 * c-indent-level: 4
359 * c-basic-offset: 4
360 * tab-width: 4
361 * End:
362 */
diff --git a/include/asm-m68knommu/m68360_regs.h b/include/asm-m68knommu/m68360_regs.h
new file mode 100644
index 000000000000..a3f8cc8a4a84
--- /dev/null
+++ b/include/asm-m68knommu/m68360_regs.h
@@ -0,0 +1,408 @@
1/***********************************
2 * $Id: m68360_regs.h,v 1.2 2002/10/26 15:03:55 gerg Exp $
3 ***********************************
4 *
5 ***************************************
6 * Definitions of the QUICC registers
7 ***************************************
8 */
9
10#ifndef __REGISTERS_H
11#define __REGISTERS_H
12
13#define CLEAR_BIT(x, bit) x =bit
14
15/*****************************************************************
16 Command Register
17*****************************************************************/
18
19/* bit fields within command register */
20#define SOFTWARE_RESET 0x8000
21#define CMD_OPCODE 0x0f00
22#define CMD_CHANNEL 0x00f0
23#define CMD_FLAG 0x0001
24
25/* general command opcodes */
26#define INIT_RXTX_PARAMS 0x0000
27#define INIT_RX_PARAMS 0x0100
28#define INIT_TX_PARAMS 0x0200
29#define ENTER_HUNT_MODE 0x0300
30#define STOP_TX 0x0400
31#define GR_STOP_TX 0x0500
32#define RESTART_TX 0x0600
33#define CLOSE_RX_BD 0x0700
34#define SET_ENET_GROUP 0x0800
35#define RESET_ENET_GROUP 0x0900
36
37/* quicc32 CP commands */
38#define STOP_TX_32 0x0e00 /*add chan# bits 2-6 */
39#define ENTER_HUNT_MODE_32 0x1e00
40
41/* quicc32 mask/event SCC register */
42#define GOV 0x01
43#define GUN 0x02
44#define GINT 0x04
45#define IQOV 0x08
46
47
48/* Timer commands */
49#define SET_TIMER 0x0800
50
51/* Multi channel Interrupt structure */
52#define INTR_VALID 0x8000 /* Valid interrupt entry */
53#define INTR_WRAP 0x4000 /* Wrap bit in the interrupt entry table */
54#define INTR_CH_NU 0x07c0 /* Channel Num in interrupt table */
55#define INTR_MASK_BITS 0x383f
56
57/*
58 * General SCC mode register (GSMR)
59 */
60
61#define MODE_HDLC 0x0
62#define MODE_APPLE_TALK 0x2
63#define MODE_SS7 0x3
64#define MODE_UART 0x4
65#define MODE_PROFIBUS 0x5
66#define MODE_ASYNC_HDLC 0x6
67#define MODE_V14 0x7
68#define MODE_BISYNC 0x8
69#define MODE_DDCMP 0x9
70#define MODE_MULTI_CHANNEL 0xa
71#define MODE_ETHERNET 0xc
72
73#define DIAG_NORMAL 0x0
74#define DIAG_LOCAL_LPB 0x1
75#define DIAG_AUTO_ECHO 0x2
76#define DIAG_LBP_ECHO 0x3
77
78/* For RENC and TENC fields in GSMR */
79#define ENC_NRZ 0x0
80#define ENC_NRZI 0x1
81#define ENC_FM0 0x2
82#define ENC_MANCH 0x4
83#define ENC_DIFF_MANC 0x6
84
85/* For TDCR and RDCR fields in GSMR */
86#define CLOCK_RATE_1 0x0
87#define CLOCK_RATE_8 0x1
88#define CLOCK_RATE_16 0x2
89#define CLOCK_RATE_32 0x3
90
91#define TPP_00 0x0
92#define TPP_10 0x1
93#define TPP_01 0x2
94#define TPP_11 0x3
95
96#define TPL_NO 0x0
97#define TPL_8 0x1
98#define TPL_16 0x2
99#define TPL_32 0x3
100#define TPL_48 0x4
101#define TPL_64 0x5
102#define TPL_128 0x6
103
104#define TSNC_INFINITE 0x0
105#define TSNC_14_65 0x1
106#define TSNC_4_15 0x2
107#define TSNC_3_1 0x3
108
109#define EDGE_BOTH 0x0
110#define EDGE_POS 0x1
111#define EDGE_NEG 0x2
112#define EDGE_NO 0x3
113
114#define SYNL_NO 0x0
115#define SYNL_4 0x1
116#define SYNL_8 0x2
117#define SYNL_16 0x3
118
119#define TCRC_CCITT16 0x0
120#define TCRC_CRC16 0x1
121#define TCRC_CCITT32 0x2
122
123
124/*****************************************************************
125 TODR (Transmit on demand) Register
126*****************************************************************/
127#define TODR_TOD 0x8000 /* Transmit on demand */
128
129
130/*****************************************************************
131 CICR register settings
132*****************************************************************/
133
134/* note that relative irq priorities of the SCCs can be reordered
135 * if desired - see p. 7-377 of the MC68360UM */
136#define CICR_SCA_SCC1 ((uint)0x00000000) /* SCC1 @ SCCa */
137#define CICR_SCB_SCC2 ((uint)0x00040000) /* SCC2 @ SCCb */
138#define CICR_SCC_SCC3 ((uint)0x00200000) /* SCC3 @ SCCc */
139#define CICR_SCD_SCC4 ((uint)0x00c00000) /* SCC4 @ SCCd */
140
141#define CICR_IRL_MASK ((uint)0x0000e000) /* Core interrrupt */
142#define CICR_HP_MASK ((uint)0x00001f00) /* Hi-pri int. */
143#define CICR_VBA_MASK ((uint)0x000000e0) /* Vector Base Address */
144#define CICR_SPS ((uint)0x00000001) /* SCC Spread */
145
146
147/*****************************************************************
148 Interrupt bits for CIPR and CIMR (MC68360UM p. 7-379)
149*****************************************************************/
150
151#define INTR_PIO_PC0 0x80000000 /* parallel I/O C bit 0 */
152#define INTR_SCC1 0x40000000 /* SCC port 1 */
153#define INTR_SCC2 0x20000000 /* SCC port 2 */
154#define INTR_SCC3 0x10000000 /* SCC port 3 */
155#define INTR_SCC4 0x08000000 /* SCC port 4 */
156#define INTR_PIO_PC1 0x04000000 /* parallel i/o C bit 1 */
157#define INTR_TIMER1 0x02000000 /* timer 1 */
158#define INTR_PIO_PC2 0x01000000 /* parallel i/o C bit 2 */
159#define INTR_PIO_PC3 0x00800000 /* parallel i/o C bit 3 */
160#define INTR_SDMA_BERR 0x00400000 /* SDMA channel bus error */
161#define INTR_DMA1 0x00200000 /* idma 1 */
162#define INTR_DMA2 0x00100000 /* idma 2 */
163#define INTR_TIMER2 0x00040000 /* timer 2 */
164#define INTR_CP_TIMER 0x00020000 /* CP timer */
165#define INTR_PIP_STATUS 0x00010000 /* PIP status */
166#define INTR_PIO_PC4 0x00008000 /* parallel i/o C bit 4 */
167#define INTR_PIO_PC5 0x00004000 /* parallel i/o C bit 5 */
168#define INTR_TIMER3 0x00001000 /* timer 3 */
169#define INTR_PIO_PC6 0x00000800 /* parallel i/o C bit 6 */
170#define INTR_PIO_PC7 0x00000400 /* parallel i/o C bit 7 */
171#define INTR_PIO_PC8 0x00000200 /* parallel i/o C bit 8 */
172#define INTR_TIMER4 0x00000080 /* timer 4 */
173#define INTR_PIO_PC9 0x00000040 /* parallel i/o C bit 9 */
174#define INTR_SCP 0x00000020 /* SCP */
175#define INTR_SMC1 0x00000010 /* SMC 1 */
176#define INTR_SMC2 0x00000008 /* SMC 2 */
177#define INTR_PIO_PC10 0x00000004 /* parallel i/o C bit 10 */
178#define INTR_PIO_PC11 0x00000002 /* parallel i/o C bit 11 */
179#define INTR_ERR 0x00000001 /* error */
180
181
182/*****************************************************************
183 CPM Interrupt vector encodings (MC68360UM p. 7-376)
184*****************************************************************/
185
186#define CPMVEC_NR 32
187#define CPMVEC_PIO_PC0 0x1f
188#define CPMVEC_SCC1 0x1e
189#define CPMVEC_SCC2 0x1d
190#define CPMVEC_SCC3 0x1c
191#define CPMVEC_SCC4 0x1b
192#define CPMVEC_PIO_PC1 0x1a
193#define CPMVEC_TIMER1 0x19
194#define CPMVEC_PIO_PC2 0x18
195#define CPMVEC_PIO_PC3 0x17
196#define CPMVEC_SDMA_CB_ERR 0x16
197#define CPMVEC_IDMA1 0x15
198#define CPMVEC_IDMA2 0x14
199#define CPMVEC_RESERVED3 0x13
200#define CPMVEC_TIMER2 0x12
201#define CPMVEC_RISCTIMER 0x11
202#define CPMVEC_RESERVED2 0x10
203#define CPMVEC_PIO_PC4 0x0f
204#define CPMVEC_PIO_PC5 0x0e
205#define CPMVEC_TIMER3 0x0c
206#define CPMVEC_PIO_PC6 0x0b
207#define CPMVEC_PIO_PC7 0x0a
208#define CPMVEC_PIO_PC8 0x09
209#define CPMVEC_RESERVED1 0x08
210#define CPMVEC_TIMER4 0x07
211#define CPMVEC_PIO_PC9 0x06
212#define CPMVEC_SPI 0x05
213#define CPMVEC_SMC1 0x04
214#define CPMVEC_SMC2 0x03
215#define CPMVEC_PIO_PC10 0x02
216#define CPMVEC_PIO_PC11 0x01
217#define CPMVEC_ERROR 0x00
218
219/* #define CPMVEC_PIO_PC0 ((ushort)0x1f) */
220/* #define CPMVEC_SCC1 ((ushort)0x1e) */
221/* #define CPMVEC_SCC2 ((ushort)0x1d) */
222/* #define CPMVEC_SCC3 ((ushort)0x1c) */
223/* #define CPMVEC_SCC4 ((ushort)0x1b) */
224/* #define CPMVEC_PIO_PC1 ((ushort)0x1a) */
225/* #define CPMVEC_TIMER1 ((ushort)0x19) */
226/* #define CPMVEC_PIO_PC2 ((ushort)0x18) */
227/* #define CPMVEC_PIO_PC3 ((ushort)0x17) */
228/* #define CPMVEC_SDMA_CB_ERR ((ushort)0x16) */
229/* #define CPMVEC_IDMA1 ((ushort)0x15) */
230/* #define CPMVEC_IDMA2 ((ushort)0x14) */
231/* #define CPMVEC_RESERVED3 ((ushort)0x13) */
232/* #define CPMVEC_TIMER2 ((ushort)0x12) */
233/* #define CPMVEC_RISCTIMER ((ushort)0x11) */
234/* #define CPMVEC_RESERVED2 ((ushort)0x10) */
235/* #define CPMVEC_PIO_PC4 ((ushort)0x0f) */
236/* #define CPMVEC_PIO_PC5 ((ushort)0x0e) */
237/* #define CPMVEC_TIMER3 ((ushort)0x0c) */
238/* #define CPMVEC_PIO_PC6 ((ushort)0x0b) */
239/* #define CPMVEC_PIO_PC7 ((ushort)0x0a) */
240/* #define CPMVEC_PIO_PC8 ((ushort)0x09) */
241/* #define CPMVEC_RESERVED1 ((ushort)0x08) */
242/* #define CPMVEC_TIMER4 ((ushort)0x07) */
243/* #define CPMVEC_PIO_PC9 ((ushort)0x06) */
244/* #define CPMVEC_SPI ((ushort)0x05) */
245/* #define CPMVEC_SMC1 ((ushort)0x04) */
246/* #define CPMVEC_SMC2 ((ushort)0x03) */
247/* #define CPMVEC_PIO_PC10 ((ushort)0x02) */
248/* #define CPMVEC_PIO_PC11 ((ushort)0x01) */
249/* #define CPMVEC_ERROR ((ushort)0x00) */
250
251
252/*****************************************************************
253 * PIO control registers
254 *****************************************************************/
255
256/* Port A - See 360UM p. 7-358
257 *
258 * Note that most of these pins have alternate functions
259 */
260
261
262/* The macros are nice, but there are all sorts of references to 1-indexed
263 * facilities on the 68360... */
264/* #define PA_RXD(n) ((ushort)(0x01<<(2*n))) */
265/* #define PA_TXD(n) ((ushort)(0x02<<(2*n))) */
266
267#define PA_RXD1 ((ushort)0x0001)
268#define PA_TXD1 ((ushort)0x0002)
269#define PA_RXD2 ((ushort)0x0004)
270#define PA_TXD2 ((ushort)0x0008)
271#define PA_RXD3 ((ushort)0x0010)
272#define PA_TXD3 ((ushort)0x0020)
273#define PA_RXD4 ((ushort)0x0040)
274#define PA_TXD4 ((ushort)0x0080)
275
276#define PA_CLK1 ((ushort)0x0100)
277#define PA_CLK2 ((ushort)0x0200)
278#define PA_CLK3 ((ushort)0x0400)
279#define PA_CLK4 ((ushort)0x0800)
280#define PA_CLK5 ((ushort)0x1000)
281#define PA_CLK6 ((ushort)0x2000)
282#define PA_CLK7 ((ushort)0x4000)
283#define PA_CLK8 ((ushort)0x8000)
284
285
286/* Port B - See 360UM p. 7-362
287 */
288
289
290/* Port C - See 360UM p. 7-365
291 */
292
293#define PC_RTS1 ((ushort)0x0001)
294#define PC_RTS2 ((ushort)0x0002)
295#define PC__RTS3 ((ushort)0x0004) /* !RTS3 */
296#define PC__RTS4 ((ushort)0x0008) /* !RTS4 */
297
298#define PC_CTS1 ((ushort)0x0010)
299#define PC_CD1 ((ushort)0x0020)
300#define PC_CTS2 ((ushort)0x0040)
301#define PC_CD2 ((ushort)0x0080)
302#define PC_CTS3 ((ushort)0x0100)
303#define PC_CD3 ((ushort)0x0200)
304#define PC_CTS4 ((ushort)0x0400)
305#define PC_CD4 ((ushort)0x0800)
306
307
308
309/*****************************************************************
310 chip select option register
311*****************************************************************/
312#define DTACK 0xe000
313#define ADR_MASK 0x1ffc
314#define RDWR_MASK 0x0002
315#define FC_MASK 0x0001
316
317/*****************************************************************
318 tbase and rbase registers
319*****************************************************************/
320#define TBD_ADDR(quicc,pram) ((struct quicc_bd *) \
321 (quicc->ch_or_u.u.udata_bd_ucode + pram->tbase))
322#define RBD_ADDR(quicc,pram) ((struct quicc_bd *) \
323 (quicc->ch_or_u.u.udata_bd_ucode + pram->rbase))
324#define TBD_CUR_ADDR(quicc,pram) ((struct quicc_bd *) \
325 (quicc->ch_or_u.u.udata_bd_ucode + pram->tbptr))
326#define RBD_CUR_ADDR(quicc,pram) ((struct quicc_bd *) \
327 (quicc->ch_or_u.u.udata_bd_ucode + pram->rbptr))
328#define TBD_SET_CUR_ADDR(bd,quicc,pram) pram->tbptr = \
329 ((unsigned short)((char *)(bd) - (char *)(quicc->ch_or_u.u.udata_bd_ucode)))
330#define RBD_SET_CUR_ADDR(bd,quicc,pram) pram->rbptr = \
331 ((unsigned short)((char *)(bd) - (char *)(quicc->ch_or_u.u.udata_bd_ucode)))
332#define INCREASE_TBD(bd,quicc,pram) { \
333 if((bd)->status & T_W) \
334 (bd) = TBD_ADDR(quicc,pram); \
335 else \
336 (bd)++; \
337}
338#define DECREASE_TBD(bd,quicc,pram) { \
339 if ((bd) == TBD_ADDR(quicc, pram)) \
340 while (!((bd)->status & T_W)) \
341 (bd)++; \
342 else \
343 (bd)--; \
344}
345#define INCREASE_RBD(bd,quicc,pram) { \
346 if((bd)->status & R_W) \
347 (bd) = RBD_ADDR(quicc,pram); \
348 else \
349 (bd)++; \
350}
351#define DECREASE_RBD(bd,quicc,pram) { \
352 if ((bd) == RBD_ADDR(quicc, pram)) \
353 while (!((bd)->status & T_W)) \
354 (bd)++; \
355 else \
356 (bd)--; \
357}
358
359/*****************************************************************
360 Macros for Multi channel
361*****************************************************************/
362#define QMC_BASE(quicc,page) (struct global_multi_pram *)(&quicc->pram[page])
363#define MCBASE(quicc,page) (unsigned long)(quicc->pram[page].m.mcbase)
364#define CHANNEL_PRAM_BASE(quicc,channel) ((struct quicc32_pram *) \
365 (&(quicc->ch_or_u.ch_pram_tbl[channel])))
366#define TBD_32_ADDR(quicc,page,channel) ((struct quicc_bd *) \
367 (MCBASE(quicc,page) + (CHANNEL_PRAM_BASE(quicc,channel)->tbase)))
368#define RBD_32_ADDR(quicc,page,channel) ((struct quicc_bd *) \
369 (MCBASE(quicc,page) + (CHANNEL_PRAM_BASE(quicc,channel)->rbase)))
370#define TBD_32_CUR_ADDR(quicc,page,channel) ((struct quicc_bd *) \
371 (MCBASE(quicc,page) + (CHANNEL_PRAM_BASE(quicc,channel)->tbptr)))
372#define RBD_32_CUR_ADDR(quicc,page,channel) ((struct quicc_bd *) \
373 (MCBASE(quicc,page) + (CHANNEL_PRAM_BASE(quicc,channel)->rbptr)))
374#define TBD_32_SET_CUR_ADDR(bd,quicc,page,channel) \
375 CHANNEL_PRAM_BASE(quicc,channel)->tbptr = \
376 ((unsigned short)((char *)(bd) - (char *)(MCBASE(quicc,page))))
377#define RBD_32_SET_CUR_ADDR(bd,quicc,page,channel) \
378 CHANNEL_PRAM_BASE(quicc,channel)->rbptr = \
379 ((unsigned short)((char *)(bd) - (char *)(MCBASE(quicc,page))))
380
381#define INCREASE_TBD_32(bd,quicc,page,channel) { \
382 if((bd)->status & T_W) \
383 (bd) = TBD_32_ADDR(quicc,page,channel); \
384 else \
385 (bd)++; \
386}
387#define DECREASE_TBD_32(bd,quicc,page,channel) { \
388 if ((bd) == TBD_32_ADDR(quicc, page,channel)) \
389 while (!((bd)->status & T_W)) \
390 (bd)++; \
391 else \
392 (bd)--; \
393}
394#define INCREASE_RBD_32(bd,quicc,page,channel) { \
395 if((bd)->status & R_W) \
396 (bd) = RBD_32_ADDR(quicc,page,channel); \
397 else \
398 (bd)++; \
399}
400#define DECREASE_RBD_32(bd,quicc,page,channel) { \
401 if ((bd) == RBD_32_ADDR(quicc, page,channel)) \
402 while (!((bd)->status & T_W)) \
403 (bd)++; \
404 else \
405 (bd)--; \
406}
407
408#endif
diff --git a/include/asm-m68knommu/machdep.h b/include/asm-m68knommu/machdep.h
new file mode 100644
index 000000000000..5a9f9c297f79
--- /dev/null
+++ b/include/asm-m68knommu/machdep.h
@@ -0,0 +1,54 @@
1#ifndef _M68KNOMMU_MACHDEP_H
2#define _M68KNOMMU_MACHDEP_H
3
4#include <linux/seq_file.h>
5#include <linux/interrupt.h>
6
7struct pt_regs;
8struct kbd_repeat;
9struct mktime;
10struct hwclk_time;
11struct gendisk;
12struct buffer_head;
13
14extern void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *));
15/* machine dependent keyboard functions */
16extern int (*mach_keyb_init) (void);
17extern int (*mach_kbdrate) (struct kbd_repeat *);
18extern void (*mach_kbd_leds) (unsigned int);
19/* machine dependent irq functions */
20extern void (*mach_init_IRQ) (void);
21extern irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *);
22extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
23 unsigned long flags, const char *devname, void *dev_id);
24extern void (*mach_free_irq) (unsigned int irq, void *dev_id);
25extern void (*mach_get_model) (char *model);
26extern int (*mach_get_hardware_list) (char *buffer);
27extern int (*mach_get_irq_list) (struct seq_file *p, void *v);
28extern void (*mach_process_int) (int irq, struct pt_regs *fp);
29/* machine dependent timer functions */
30extern unsigned long (*mach_gettimeoffset)(void);
31extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour,
32 int *min, int *sec);
33extern int (*mach_hwclk)(int, struct hwclk_time*);
34extern int (*mach_set_clock_mmss)(unsigned long);
35extern void (*mach_reset)( void );
36extern void (*mach_halt)( void );
37extern void (*mach_power_off)( void );
38extern unsigned long (*mach_hd_init) (unsigned long, unsigned long);
39extern void (*mach_hd_setup)(char *, int *);
40extern long mach_max_dma_address;
41extern void (*mach_floppy_setup)(char *, int *);
42extern void (*mach_floppy_eject)(void);
43extern void (*mach_heartbeat) (int);
44extern void (*mach_l2_flush) (int);
45extern int mach_sysrq_key;
46extern int mach_sysrq_shift_state;
47extern int mach_sysrq_shift_mask;
48extern char *mach_sysrq_xlate;
49
50extern void config_BSP(char *command, int len);
51extern void (*mach_tick)(void);
52extern void (*mach_trap_init)(void);
53
54#endif /* _M68KNOMMU_MACHDEP_H */
diff --git a/include/asm-m68knommu/math-emu.h b/include/asm-m68knommu/math-emu.h
new file mode 100644
index 000000000000..7e7090517b72
--- /dev/null
+++ b/include/asm-m68knommu/math-emu.h
@@ -0,0 +1 @@
#include <asm-m68k/math-emu.h>
diff --git a/include/asm-m68knommu/mc146818rtc.h b/include/asm-m68knommu/mc146818rtc.h
new file mode 100644
index 000000000000..907a0481a140
--- /dev/null
+++ b/include/asm-m68knommu/mc146818rtc.h
@@ -0,0 +1,9 @@
1/*
2 * Machine dependent access functions for RTC registers.
3 */
4#ifndef _M68KNOMMU_MC146818RTC_H
5#define _M68KNOMMU_MC146818RTC_H
6
7/* empty include file to satisfy the include in genrtc.c/ide-geometry.c */
8
9#endif /* _M68KNOMMU_MC146818RTC_H */
diff --git a/include/asm-m68knommu/mcfcache.h b/include/asm-m68knommu/mcfcache.h
new file mode 100644
index 000000000000..bdd8c53ef34c
--- /dev/null
+++ b/include/asm-m68knommu/mcfcache.h
@@ -0,0 +1,125 @@
1/****************************************************************************/
2
3/*
4 * mcfcache.h -- ColdFire CPU cache support code
5 *
6 * (C) Copyright 2004, Greg Ungerer <gerg@snapgear.com>
7 */
8
9/****************************************************************************/
10#ifndef __M68KNOMMU_MCFCACHE_H
11#define __M68KNOMMU_MCFCACHE_H
12/****************************************************************************/
13
14#include <linux/config.h>
15
16/*
17 * The different ColdFire families have different cache arrangments.
18 * Everything from a small instruction only cache, to configurable
19 * data and/or instruction cache, to unified instruction/data, to
20 * harvard style separate instruction and data caches.
21 */
22
23#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || defined(CONFIG_M5272)
24/*
25 * Simple version 2 core cache. These have instruction cache only,
26 * we just need to invalidate it and enable it.
27 */
28.macro CACHE_ENABLE
29 movel #0x01000000,%d0 /* invalidate cache cmd */
30 movec %d0,%CACR /* do invalidate cache */
31 movel #0x80000100,%d0 /* setup cache mask */
32 movec %d0,%CACR /* enable cache */
33.endm
34#endif /* CONFIG_M5206 || CONFIG_M5206e || CONFIG_M5272 */
35
36#if defined(CONFIG_M527x)
37/*
38 * New version 2 cores have a configurable split cache arrangement.
39 * For now I am just enabling instruction cache - but ultimately I
40 * think a split instruction/data cache would be better.
41 */
42.macro CACHE_ENABLE
43 movel #0x01400000,%d0
44 movec %d0,%CACR /* invalidate cache */
45 nop
46 movel #0x0000c000,%d0 /* set SDRAM cached only */
47 movec %d0,%ACR0
48 movel #0x00000000,%d0 /* no other regions cached */
49 movec %d0,%ACR1
50 movel #0x80400100,%d0 /* configure cache */
51 movec %d0,%CACR /* enable cache */
52 nop
53.endm
54#endif /* CONFIG_M527x */
55
56#if defined(CONFIG_M528x)
57/*
58 * Cache is totally broken on early 5282 silicon. So far now we
59 * disable its cache all together.
60 */
61.macro CACHE_ENABLE
62 movel #0x01000000,%d0
63 movec %d0,%CACR /* invalidate cache */
64 nop
65 movel #0x0000c000,%d0 /* set SDRAM cached only */
66 movec %d0,%ACR0
67 movel #0x00000000,%d0 /* no other regions cached */
68 movec %d0,%ACR1
69 movel #0x00000000,%d0 /* configure cache */
70 movec %d0,%CACR /* enable cache */
71 nop
72.endm
73#endif /* CONFIG_M528x */
74
75#if defined(CONFIG_M5249) || defined(CONFIG_M5307)
76/*
77 * The version 3 core cache. Oddly enough the version 2 core 5249
78 * has the same SDRAM and cache setup as the version 3 cores.
79 * This is a single unified instruction/data cache.
80 */
81.macro CACHE_ENABLE
82 movel #0x01000000,%d0 /* invalidate whole cache */
83 movec %d0,%CACR
84 nop
85#if defined(DEBUGGER_COMPATIBLE_CACHE) || defined(CONFIG_SECUREEDGEMP3)
86 movel #0x0000c000,%d0 /* set SDRAM cached (write-thru) */
87#else
88 movel #0x0000c020,%d0 /* set SDRAM cached (copyback) */
89#endif
90 movec %d0,%ACR0
91 movel #0x00000000,%d0 /* no other regions cached */
92 movec %d0,%ACR1
93 movel #0xa0000200,%d0 /* enable cache */
94 movec %d0,%CACR
95 nop
96.endm
97#endif /* CONFIG_M5249 || CONFIG_M5307 */
98
99#if defined(CONFIG_M5407)
100/*
101 * Version 4 cores have a true harvard style separate instruction
102 * and data cache. Invalidate and enable cache, also enable write
103 * buffers and branch accelerator.
104 */
105.macro CACHE_ENABLE
106 movel #0x01040100,%d0 /* invalidate whole cache */
107 movec %d0,%CACR
108 nop
109 movel #0x000fc000,%d0 /* set SDRAM cached only */
110 movec %d0, %ACR0
111 movel #0x00000000,%d0 /* no other regions cached */
112 movec %d0, %ACR1
113 movel #0x000fc000,%d0 /* set SDRAM cached only */
114 movec %d0, %ACR2
115 movel #0x00000000,%d0 /* no other regions cached */
116 movec %d0, %ACR3
117 movel #0xb6088400,%d0 /* enable caches */
118 movec %d0,%CACR
119 nop
120.endm
121#endif /* CONFIG_M5407 */
122
123
124/****************************************************************************/
125#endif /* __M68KNOMMU_MCFCACHE_H */
diff --git a/include/asm-m68knommu/mcfdma.h b/include/asm-m68knommu/mcfdma.h
new file mode 100644
index 000000000000..350c6090b5c1
--- /dev/null
+++ b/include/asm-m68knommu/mcfdma.h
@@ -0,0 +1,145 @@
1/****************************************************************************/
2
3/*
4 * mcfdma.h -- Coldfire internal DMA support defines.
5 *
6 * (C) Copyright 1999, Rob Scott (rscott@mtrob.ml.org)
7 */
8
9/****************************************************************************/
10#ifndef mcfdma_h
11#define mcfdma_h
12/****************************************************************************/
13
14#include <linux/config.h>
15
16/*
17 * Get address specific defines for this Coldfire member.
18 */
19#if defined(CONFIG_M5206) || defined(CONFIG_M5206e)
20#define MCFDMA_BASE0 0x200 /* Base address of DMA 0 */
21#define MCFDMA_BASE1 0x240 /* Base address of DMA 1 */
22#elif defined(CONFIG_M5272)
23#define MCFDMA_BASE0 0x0e0 /* Base address of DMA 0 */
24#elif defined(CONFIG_M527x) || defined(CONFIG_M528x)
25/* These are relative to the IPSBAR, not MBAR */
26#define MCFDMA_BASE0 0x100 /* Base address of DMA 0 */
27#define MCFDMA_BASE1 0x140 /* Base address of DMA 1 */
28#define MCFDMA_BASE2 0x180 /* Base address of DMA 2 */
29#define MCFDMA_BASE3 0x1C0 /* Base address of DMA 3 */
30#elif defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407)
31#define MCFDMA_BASE0 0x300 /* Base address of DMA 0 */
32#define MCFDMA_BASE1 0x340 /* Base address of DMA 1 */
33#define MCFDMA_BASE2 0x380 /* Base address of DMA 2 */
34#define MCFDMA_BASE3 0x3C0 /* Base address of DMA 3 */
35#endif
36
37
38#if !defined(CONFIG_M5272)
39
40/*
41 * Define the DMA register set addresses.
42 * Note: these are longword registers, use unsigned long as data type
43 */
44#define MCFDMA_SAR 0x00 /* DMA source address (r/w) */
45#define MCFDMA_DAR 0x01 /* DMA destination adr (r/w) */
46/* these are word registers, use unsigned short data type */
47#define MCFDMA_DCR 0x04 /* DMA control reg (r/w) */
48#define MCFDMA_BCR 0x06 /* DMA byte count reg (r/w) */
49/* these are byte registers, use unsiged char data type */
50#define MCFDMA_DSR 0x10 /* DMA status reg (r/w) */
51#define MCFDMA_DIVR 0x14 /* DMA interrupt vec (r/w) */
52
53/*
54 * Bit definitions for the DMA Control Register (DCR).
55 */
56#define MCFDMA_DCR_INT 0x8000 /* Enable completion irq */
57#define MCFDMA_DCR_EEXT 0x4000 /* Enable external DMA req */
58#define MCFDMA_DCR_CS 0x2000 /* Enable cycle steal */
59#define MCFDMA_DCR_AA 0x1000 /* Enable auto alignment */
60#define MCFDMA_DCR_BWC_MASK 0x0E00 /* Bandwidth ctl mask */
61#define MCFDMA_DCR_BWC_512 0x0200 /* Bandwidth: 512 Bytes */
62#define MCFDMA_DCR_BWC_1024 0x0400 /* Bandwidth: 1024 Bytes */
63#define MCFDMA_DCR_BWC_2048 0x0600 /* Bandwidth: 2048 Bytes */
64#define MCFDMA_DCR_BWC_4096 0x0800 /* Bandwidth: 4096 Bytes */
65#define MCFDMA_DCR_BWC_8192 0x0a00 /* Bandwidth: 8192 Bytes */
66#define MCFDMA_DCR_BWC_16384 0x0c00 /* Bandwidth: 16384 Bytes */
67#define MCFDMA_DCR_BWC_32768 0x0e00 /* Bandwidth: 32768 Bytes */
68#define MCFDMA_DCR_SAA 0x0100 /* Single Address Access */
69#define MCFDMA_DCR_S_RW 0x0080 /* SAA read/write value */
70#define MCFDMA_DCR_SINC 0x0040 /* Source addr inc enable */
71#define MCFDMA_DCR_SSIZE_MASK 0x0030 /* Src xfer size */
72#define MCFDMA_DCR_SSIZE_LONG 0x0000 /* Src xfer size, 00 = longw */
73#define MCFDMA_DCR_SSIZE_BYTE 0x0010 /* Src xfer size, 01 = byte */
74#define MCFDMA_DCR_SSIZE_WORD 0x0020 /* Src xfer size, 10 = word */
75#define MCFDMA_DCR_SSIZE_LINE 0x0030 /* Src xfer size, 11 = line */
76#define MCFDMA_DCR_DINC 0x0008 /* Dest addr inc enable */
77#define MCFDMA_DCR_DSIZE_MASK 0x0006 /* Dest xfer size */
78#define MCFDMA_DCR_DSIZE_LONG 0x0000 /* Dest xfer size, 00 = long */
79#define MCFDMA_DCR_DSIZE_BYTE 0x0002 /* Dest xfer size, 01 = byte */
80#define MCFDMA_DCR_DSIZE_WORD 0x0004 /* Dest xfer size, 10 = word */
81#define MCFDMA_DCR_DSIZE_LINE 0x0006 /* Dest xfer size, 11 = line */
82#define MCFDMA_DCR_START 0x0001 /* Start transfer */
83
84/*
85 * Bit definitions for the DMA Status Register (DSR).
86 */
87#define MCFDMA_DSR_CE 0x40 /* Config error */
88#define MCFDMA_DSR_BES 0x20 /* Bus Error on source */
89#define MCFDMA_DSR_BED 0x10 /* Bus Error on dest */
90#define MCFDMA_DSR_REQ 0x04 /* Requests remaining */
91#define MCFDMA_DSR_BSY 0x02 /* Busy */
92#define MCFDMA_DSR_DONE 0x01 /* DMA transfer complete */
93
94#else /* This is an MCF5272 */
95
96#define MCFDMA_DMR 0x00 /* Mode Register (r/w) */
97#define MCFDMA_DIR 0x03 /* Interrupt trigger register (r/w) */
98#define MCFDMA_DSAR 0x03 /* Source Address register (r/w) */
99#define MCFDMA_DDAR 0x04 /* Destination Address register (r/w) */
100#define MCFDMA_DBCR 0x02 /* Byte Count Register (r/w) */
101
102/* Bit definitions for the DMA Mode Register (DMR) */
103#define MCFDMA_DMR_RESET 0x80000000L /* Reset bit */
104#define MCFDMA_DMR_EN 0x40000000L /* DMA enable */
105#define MCFDMA_DMR_RQM 0x000C0000L /* Request Mode Mask */
106#define MCFDMA_DMR_RQM_DUAL 0x000C0000L /* Dual address mode, the only valid mode */
107#define MCFDMA_DMR_DSTM 0x00002000L /* Destination addressing mask */
108#define MCFDMA_DMR_DSTM_SA 0x00000000L /* Destination uses static addressing */
109#define MCFDMA_DMR_DSTM_IA 0x00002000L /* Destination uses incremental addressing */
110#define MCFDMA_DMR_DSTT_UD 0x00000400L /* Destination is user data */
111#define MCFDMA_DMR_DSTT_UC 0x00000800L /* Destination is user code */
112#define MCFDMA_DMR_DSTT_SD 0x00001400L /* Destination is supervisor data */
113#define MCFDMA_DMR_DSTT_SC 0x00001800L /* Destination is supervisor code */
114#define MCFDMA_DMR_DSTS_OFF 0x8 /* offset to the destination size bits */
115#define MCFDMA_DMR_DSTS_LONG 0x00000000L /* Long destination size */
116#define MCFDMA_DMR_DSTS_BYTE 0x00000100L /* Byte destination size */
117#define MCFDMA_DMR_DSTS_WORD 0x00000200L /* Word destination size */
118#define MCFDMA_DMR_DSTS_LINE 0x00000300L /* Line destination size */
119#define MCFDMA_DMR_SRCM 0x00000020L /* Source addressing mask */
120#define MCFDMA_DMR_SRCM_SA 0x00000000L /* Source uses static addressing */
121#define MCFDMA_DMR_SRCM_IA 0x00000020L /* Source uses incremental addressing */
122#define MCFDMA_DMR_SRCT_UD 0x00000004L /* Source is user data */
123#define MCFDMA_DMR_SRCT_UC 0x00000008L /* Source is user code */
124#define MCFDMA_DMR_SRCT_SD 0x00000014L /* Source is supervisor data */
125#define MCFDMA_DMR_SRCT_SC 0x00000018L /* Source is supervisor code */
126#define MCFDMA_DMR_SRCS_OFF 0x0 /* Offset to the source size bits */
127#define MCFDMA_DMR_SRCS_LONG 0x00000000L /* Long source size */
128#define MCFDMA_DMR_SRCS_BYTE 0x00000001L /* Byte source size */
129#define MCFDMA_DMR_SRCS_WORD 0x00000002L /* Word source size */
130#define MCFDMA_DMR_SRCS_LINE 0x00000003L /* Line source size */
131
132/* Bit definitions for the DMA interrupt register (DIR) */
133#define MCFDMA_DIR_INVEN 0x1000 /* Invalid Combination interrupt enable */
134#define MCFDMA_DIR_ASCEN 0x0800 /* Address Sequence Complete (Completion) interrupt enable */
135#define MCFDMA_DIR_TEEN 0x0200 /* Transfer Error interrupt enable */
136#define MCFDMA_DIR_TCEN 0x0100 /* Transfer Complete (a bus transfer, that is) interrupt enable */
137#define MCFDMA_DIR_INV 0x1000 /* Invalid Combination */
138#define MCFDMA_DIR_ASC 0x0008 /* Address Sequence Complete (DMA Completion) */
139#define MCFDMA_DIR_TE 0x0002 /* Transfer Error */
140#define MCFDMA_DIR_TC 0x0001 /* Transfer Complete */
141
142#endif /* !defined(CONFIG_M5272) */
143
144/****************************************************************************/
145#endif /* mcfdma_h */
diff --git a/include/asm-m68knommu/mcfmbus.h b/include/asm-m68knommu/mcfmbus.h
new file mode 100644
index 000000000000..4762589e858a
--- /dev/null
+++ b/include/asm-m68knommu/mcfmbus.h
@@ -0,0 +1,78 @@
1/****************************************************************************/
2
3/*
4 * mcfmbus.h -- Coldfire MBUS support defines.
5 *
6 * (C) Copyright 1999, Martin Floeer (mfloeer@axcent.de)
7 */
8
9/****************************************************************************/
10
11
12#ifndef mcfmbus_h
13#define mcfmbus_h
14#include <linux/config.h>
15
16
17#define MCFMBUS_BASE 0x280
18#define MCFMBUS_IRQ_VECTOR 0x19
19#define MCFMBUS_IRQ 0x1
20#define MCFMBUS_CLK 0x3f
21#define MCFMBUS_IRQ_LEVEL 0x07 /*IRQ Level 1*/
22#define MCFMBUS_ADDRESS 0x01
23
24
25/*
26* Define the 5307 MBUS register set addresses
27*/
28
29#define MCFMBUS_MADR 0x00
30#define MCFMBUS_MFDR 0x04
31#define MCFMBUS_MBCR 0x08
32#define MCFMBUS_MBSR 0x0C
33#define MCFMBUS_MBDR 0x10
34
35
36#define MCFMBUS_MADR_ADDR(a) (((a)&0x7F)<<0x01) /*Slave Address*/
37
38#define MCFMBUS_MFDR_MBC(a) ((a)&0x3F) /*M-Bus Clock*/
39
40/*
41* Define bit flags in Controll Register
42*/
43
44#define MCFMBUS_MBCR_MEN (0x80) /* M-Bus Enable */
45#define MCFMBUS_MBCR_MIEN (0x40) /* M-Bus Interrupt Enable */
46#define MCFMBUS_MBCR_MSTA (0x20) /* Master/Slave Mode Select Bit */
47#define MCFMBUS_MBCR_MTX (0x10) /* Transmit/Rcv Mode Select Bit */
48#define MCFMBUS_MBCR_TXAK (0x08) /* Transmit Acknowledge Enable */
49#define MCFMBUS_MBCR_RSTA (0x04) /* Repeat Start */
50
51/*
52* Define bit flags in Status Register
53*/
54
55#define MCFMBUS_MBSR_MCF (0x80) /* Data Transfer Complete */
56#define MCFMBUS_MBSR_MAAS (0x40) /* Addressed as a Slave */
57#define MCFMBUS_MBSR_MBB (0x20) /* Bus Busy */
58#define MCFMBUS_MBSR_MAL (0x10) /* Arbitration Lost */
59#define MCFMBUS_MBSR_SRW (0x04) /* Slave Transmit */
60#define MCFMBUS_MBSR_MIF (0x02) /* M-Bus Interrupt */
61#define MCFMBUS_MBSR_RXAK (0x01) /* No Acknowledge Received */
62
63/*
64* Define bit flags in DATA I/O Register
65*/
66
67#define MCFMBUS_MBDR_READ (0x01) /* 1=read 0=write MBUS */
68
69#define MBUSIOCSCLOCK 1
70#define MBUSIOCGCLOCK 2
71#define MBUSIOCSADDR 3
72#define MBUSIOCGADDR 4
73#define MBUSIOCSSLADDR 5
74#define MBUSIOCGSLADDR 6
75#define MBUSIOCSSUBADDR 7
76#define MBUSIOCGSUBADDR 8
77
78#endif
diff --git a/include/asm-m68knommu/mcfne.h b/include/asm-m68knommu/mcfne.h
new file mode 100644
index 000000000000..045875651e4d
--- /dev/null
+++ b/include/asm-m68knommu/mcfne.h
@@ -0,0 +1,353 @@
1/****************************************************************************/
2
3/*
4 * mcfne.h -- NE2000 in ColdFire eval boards.
5 *
6 * (C) Copyright 1999-2000, Greg Ungerer (gerg@snapgear.com)
7 * (C) Copyright 2000, Lineo (www.lineo.com)
8 * (C) Copyright 2001, SnapGear (www.snapgear.com)
9 *
10 * 19990409 David W. Miller Converted from m5206ne.h for 5307 eval board
11 *
12 * Hacked support for m5206e Cadre III evaluation board
13 * Fred Stevens (fred.stevens@pemstar.com) 13 April 1999
14 */
15
16/****************************************************************************/
17#ifndef mcfne_h
18#define mcfne_h
19/****************************************************************************/
20
21#include <linux/config.h>
22
23/*
24 * Support for NE2000 clones devices in ColdFire based boards.
25 * Not all boards address these parts the same way, some use a
26 * direct addressing method, others use a side-band address space
27 * to access odd address registers, some require byte swapping
28 * others do not.
29 */
30#define BSWAP(w) (((w) << 8) | ((w) >> 8))
31#define RSWAP(w) (w)
32
33
34/*
35 * Define the basic hardware resources of NE2000 boards.
36 */
37
38#if defined(CONFIG_M5206) && defined(CONFIG_ARNEWSH)
39#define NE2000_ADDR 0x40000300
40#define NE2000_ODDOFFSET 0x00010000
41#define NE2000_IRQ_VECTOR 0xf0
42#define NE2000_IRQ_PRIORITY 2
43#define NE2000_IRQ_LEVEL 4
44#define NE2000_BYTE volatile unsigned short
45#endif
46
47#if defined(CONFIG_M5206e) && defined(CONFIG_MOTOROLA)
48#define NE2000_ADDR 0x40000300
49#define NE2000_ODDOFFSET 0x00010000
50#define NE2000_IRQ_VECTOR 0x1c
51#define NE2000_IRQ_PRIORITY 2
52#define NE2000_IRQ_LEVEL 4
53#define NE2000_BYTE volatile unsigned short
54#endif
55
56#if defined(CONFIG_M5206e) && defined(CONFIG_NETtel)
57#define NE2000_ADDR 0x30000300
58#define NE2000_IRQ_VECTOR 25
59#define NE2000_IRQ_PRIORITY 1
60#define NE2000_IRQ_LEVEL 3
61#define NE2000_BYTE volatile unsigned char
62#endif
63
64#if defined(CONFIG_M5206e) && defined(CONFIG_CFV240)
65#define NE2000_ADDR 0x40010000
66#define NE2000_ADDR1 0x40010001
67#define NE2000_ODDOFFSET 0x00000000
68#define NE2000_IRQ 1
69#define NE2000_IRQ_VECTOR 0x19
70#define NE2000_IRQ_PRIORITY 2
71#define NE2000_IRQ_LEVEL 1
72#define NE2000_BYTE volatile unsigned char
73#endif
74
75#if defined(CONFIG_M5307) && defined(CONFIG_MOTOROLA)
76#define NE2000_ADDR 0x40000300
77#define NE2000_ODDOFFSET 0x00010000
78#define NE2000_IRQ_VECTOR 0x1b
79#define NE2000_BYTE volatile unsigned short
80#endif
81
82#if defined(CONFIG_M5272) && defined(CONFIG_NETtel)
83#define NE2000_ADDR 0x30600300
84#define NE2000_ODDOFFSET 0x00008000
85#define NE2000_IRQ_VECTOR 67
86#undef BSWAP
87#define BSWAP(w) (w)
88#define NE2000_BYTE volatile unsigned short
89#undef RSWAP
90#define RSWAP(w) (((w) << 8) | ((w) >> 8))
91#endif
92
93#if defined(CONFIG_M5307) && defined(CONFIG_NETtel)
94#define NE2000_ADDR0 0x30600300
95#define NE2000_ADDR1 0x30800300
96#define NE2000_ODDOFFSET 0x00008000
97#define NE2000_IRQ_VECTOR0 27
98#define NE2000_IRQ_VECTOR1 29
99#undef BSWAP
100#define BSWAP(w) (w)
101#define NE2000_BYTE volatile unsigned short
102#undef RSWAP
103#define RSWAP(w) (((w) << 8) | ((w) >> 8))
104#endif
105
106#if defined(CONFIG_M5307) && defined(CONFIG_SECUREEDGEMP3)
107#define NE2000_ADDR 0x30600300
108#define NE2000_ODDOFFSET 0x00008000
109#define NE2000_IRQ_VECTOR 27
110#undef BSWAP
111#define BSWAP(w) (w)
112#define NE2000_BYTE volatile unsigned short
113#undef RSWAP
114#define RSWAP(w) (((w) << 8) | ((w) >> 8))
115#endif
116
117#if defined(CONFIG_M5307) && defined(CONFIG_ARNEWSH)
118#define NE2000_ADDR 0xfe600300
119#define NE2000_ODDOFFSET 0x00010000
120#define NE2000_IRQ_VECTOR 0x1b
121#define NE2000_IRQ_PRIORITY 2
122#define NE2000_IRQ_LEVEL 3
123#define NE2000_BYTE volatile unsigned short
124#endif
125
126#if defined(CONFIG_M5407)
127#define NE2000_ADDR 0x40000300
128#define NE2000_ODDOFFSET 0x00010000
129#define NE2000_IRQ_VECTOR 0x1b
130#define NE2000_BYTE volatile unsigned short
131#endif
132
133/****************************************************************************/
134
135/*
136 * Side-band address space for odd address requires re-mapping
137 * many of the standard ISA access functions.
138 */
139#ifdef NE2000_ODDOFFSET
140
141#undef outb
142#undef outb_p
143#undef inb
144#undef inb_p
145#undef outsb
146#undef outsw
147#undef insb
148#undef insw
149
150#define outb ne2000_outb
151#define inb ne2000_inb
152#define outb_p ne2000_outb
153#define inb_p ne2000_inb
154#define outsb ne2000_outsb
155#define outsw ne2000_outsw
156#define insb ne2000_insb
157#define insw ne2000_insw
158
159
160#ifndef COLDFIRE_NE2000_FUNCS
161
162void ne2000_outb(unsigned int val, unsigned int addr);
163int ne2000_inb(unsigned int addr);
164void ne2000_insb(unsigned int addr, void *vbuf, int unsigned long len);
165void ne2000_insw(unsigned int addr, void *vbuf, unsigned long len);
166void ne2000_outsb(unsigned int addr, void *vbuf, unsigned long len);
167void ne2000_outsw(unsigned int addr, void *vbuf, unsigned long len);
168
169#else
170
171/*
172 * This macro converts a conventional register address into the
173 * real memory pointer of the mapped NE2000 device.
174 * On most NE2000 implementations on ColdFire boards the chip is
175 * mapped in kinda funny, due to its ISA heritage.
176 */
177#ifdef CONFIG_CFV240
178#define NE2000_PTR(addr) (NE2000_ADDR + ((addr & 0x3f) << 1) + 1)
179#define NE2000_DATA_PTR(addr) (NE2000_ADDR + ((addr & 0x3f) << 1))
180#else
181#define NE2000_PTR(addr) ((addr&0x1)?(NE2000_ODDOFFSET+addr-1):(addr))
182#define NE2000_DATA_PTR(addr) (addr)
183#endif
184
185
186void ne2000_outb(unsigned int val, unsigned int addr)
187{
188 NE2000_BYTE *rp;
189
190 rp = (NE2000_BYTE *) NE2000_PTR(addr);
191 *rp = RSWAP(val);
192}
193
194int ne2000_inb(unsigned int addr)
195{
196 NE2000_BYTE *rp, val;
197
198 rp = (NE2000_BYTE *) NE2000_PTR(addr);
199 val = *rp;
200 return((int) ((NE2000_BYTE) RSWAP(val)));
201}
202
203void ne2000_insb(unsigned int addr, void *vbuf, int unsigned long len)
204{
205 NE2000_BYTE *rp, val;
206 unsigned char *buf;
207
208 buf = (unsigned char *) vbuf;
209 rp = (NE2000_BYTE *) NE2000_DATA_PTR(addr);
210 for (; (len > 0); len--) {
211 val = *rp;
212 *buf++ = RSWAP(val);
213 }
214}
215
216void ne2000_insw(unsigned int addr, void *vbuf, unsigned long len)
217{
218 volatile unsigned short *rp;
219 unsigned short w, *buf;
220
221 buf = (unsigned short *) vbuf;
222 rp = (volatile unsigned short *) NE2000_DATA_PTR(addr);
223 for (; (len > 0); len--) {
224 w = *rp;
225 *buf++ = BSWAP(w);
226 }
227}
228
229void ne2000_outsb(unsigned int addr, const void *vbuf, unsigned long len)
230{
231 NE2000_BYTE *rp, val;
232 unsigned char *buf;
233
234 buf = (unsigned char *) vbuf;
235 rp = (NE2000_BYTE *) NE2000_DATA_PTR(addr);
236 for (; (len > 0); len--) {
237 val = *buf++;
238 *rp = RSWAP(val);
239 }
240}
241
242void ne2000_outsw(unsigned int addr, const void *vbuf, unsigned long len)
243{
244 volatile unsigned short *rp;
245 unsigned short w, *buf;
246
247 buf = (unsigned short *) vbuf;
248 rp = (volatile unsigned short *) NE2000_DATA_PTR(addr);
249 for (; (len > 0); len--) {
250 w = *buf++;
251 *rp = BSWAP(w);
252 }
253}
254
255#endif /* COLDFIRE_NE2000_FUNCS */
256#endif /* NE2000_OFFOFFSET */
257
258/****************************************************************************/
259
260#ifdef COLDFIRE_NE2000_FUNCS
261
262/*
263 * Lastly the interrupt set up code...
264 * Minor differences between the different board types.
265 */
266
267#if defined(CONFIG_M5206) && defined(CONFIG_ARNEWSH)
268void ne2000_irqsetup(int irq)
269{
270 volatile unsigned char *icrp;
271
272 icrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_ICR4);
273 *icrp = MCFSIM_ICR_LEVEL4 | MCFSIM_ICR_PRI2;
274 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT4);
275}
276#endif
277
278#if defined(CONFIG_M5206e) && defined(CONFIG_MOTOROLA)
279void ne2000_irqsetup(int irq)
280{
281 volatile unsigned char *icrp;
282
283 icrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_ICR4);
284 *icrp = MCFSIM_ICR_LEVEL4 | MCFSIM_ICR_PRI2 | MCFSIM_ICR_AUTOVEC;
285 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT4);
286}
287#endif
288
289#if defined(CONFIG_M5206e) && defined(CONFIG_CFV240)
290void ne2000_irqsetup(int irq)
291{
292 volatile unsigned char *icrp;
293
294 icrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_ICR1);
295 *icrp = MCFSIM_ICR_LEVEL1 | MCFSIM_ICR_PRI2 | MCFSIM_ICR_AUTOVEC;
296 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT1);
297}
298#endif
299
300#if defined(CONFIG_M5206e) && defined(CONFIG_NETtel)
301void ne2000_irqsetup(int irq)
302{
303 mcf_autovector(irq);
304}
305#endif
306
307#if defined(CONFIG_M5272) && defined(CONFIG_NETtel)
308void ne2000_irqsetup(int irq)
309{
310 volatile unsigned long *icrp;
311 volatile unsigned long *pitr;
312
313 /* The NE2000 device uses external IRQ3 */
314 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
315 *icrp = (*icrp & 0x77077777) | 0x00d00000;
316
317 pitr = (volatile unsigned long *) (MCF_MBAR + MCFSIM_PITR);
318 *pitr = *pitr | 0x20000000;
319}
320
321void ne2000_irqack(int irq)
322{
323 volatile unsigned long *icrp;
324
325 /* The NE2000 device uses external IRQ3 */
326 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
327 *icrp = (*icrp & 0x77777777) | 0x00800000;
328}
329#endif
330
331#if defined(CONFIG_M5307) || defined(CONFIG_M5407)
332#if defined(CONFIG_NETtel) || defined(CONFIG_SECUREEDGEMP3)
333
334void ne2000_irqsetup(int irq)
335{
336 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT3);
337 mcf_autovector(irq);
338}
339
340#else
341
342void ne2000_irqsetup(int irq)
343{
344 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT3);
345}
346
347#endif /* ! CONFIG_NETtel || CONFIG_SECUREEDGEMP3 */
348#endif /* CONFIG_M5307 || CONFIG_M5407 */
349
350#endif /* COLDFIRE_NE2000_FUNCS */
351
352/****************************************************************************/
353#endif /* mcfne_h */
diff --git a/include/asm-m68knommu/mcfpci.h b/include/asm-m68knommu/mcfpci.h
new file mode 100644
index 000000000000..d6229047d06e
--- /dev/null
+++ b/include/asm-m68knommu/mcfpci.h
@@ -0,0 +1,120 @@
1/****************************************************************************/
2
3/*
4 * mcfpci.h -- PCI bridge on ColdFire eval boards.
5 *
6 * (C) Copyright 2000, Greg Ungerer (gerg@snapgear.com)
7 * (C) Copyright 2000, Lineo Inc. (www.lineo.com)
8 */
9
10/****************************************************************************/
11#ifndef mcfpci_h
12#define mcfpci_h
13/****************************************************************************/
14
15#include <linux/config.h>
16
17#ifdef CONFIG_PCI
18
19/*
20 * Address regions in the PCI address space are not mapped into the
21 * normal memory space of the ColdFire. They must be accessed via
22 * handler routines. This is easy for I/O space (inb/outb/etc) but
23 * needs some code changes to support ordinary memory. Interrupts
24 * also need to be vectored through the PCI handler first, then it
25 * will call the actual driver sub-handlers.
26 */
27
28/*
29 * Un-define all the standard I/O access routines.
30 */
31#undef inb
32#undef inw
33#undef inl
34#undef inb_p
35#undef inw_p
36#undef insb
37#undef insw
38#undef insl
39#undef outb
40#undef outw
41#undef outl
42#undef outb_p
43#undef outw_p
44#undef outsb
45#undef outsw
46#undef outsl
47
48#undef request_irq
49#undef free_irq
50
51#undef bus_to_virt
52#undef virt_to_bus
53
54
55/*
56 * Re-direct all I/O memory accesses functions to PCI specific ones.
57 */
58#define inb pci_inb
59#define inw pci_inw
60#define inl pci_inl
61#define inb_p pci_inb
62#define inw_p pci_inw
63#define insb pci_insb
64#define insw pci_insw
65#define insl pci_insl
66
67#define outb pci_outb
68#define outw pci_outw
69#define outl pci_outl
70#define outb_p pci_outb
71#define outw_p pci_outw
72#define outsb pci_outsb
73#define outsw pci_outsw
74#define outsl pci_outsl
75
76#define request_irq pci_request_irq
77#define free_irq pci_free_irq
78
79#define virt_to_bus pci_virt_to_bus
80#define bus_to_virt pci_bus_to_virt
81
82#define CONFIG_COMEMPCI 1
83
84
85/*
86 * Prototypes of the real PCI functions (defined in bios32.c).
87 */
88unsigned char pci_inb(unsigned int addr);
89unsigned short pci_inw(unsigned int addr);
90unsigned int pci_inl(unsigned int addr);
91void pci_insb(void *addr, void *buf, int len);
92void pci_insw(void *addr, void *buf, int len);
93void pci_insl(void *addr, void *buf, int len);
94
95void pci_outb(unsigned char val, unsigned int addr);
96void pci_outw(unsigned short val, unsigned int addr);
97void pci_outl(unsigned int val, unsigned int addr);
98void pci_outsb(void *addr, void *buf, int len);
99void pci_outsw(void *addr, void *buf, int len);
100void pci_outsl(void *addr, void *buf, int len);
101
102int pci_request_irq(unsigned int irq,
103 void (*handler)(int, void *, struct pt_regs *),
104 unsigned long flags,
105 const char *device,
106 void *dev_id);
107void pci_free_irq(unsigned int irq, void *dev_id);
108
109void *pci_bmalloc(int size);
110void pci_bmfree(void *bmp, int len);
111void pci_copytoshmem(unsigned long bmp, void *src, int size);
112void pci_copyfromshmem(void *dst, unsigned long bmp, int size);
113unsigned long pci_virt_to_bus(volatile void *address);
114void *pci_bus_to_virt(unsigned long address);
115void pci_bmcpyto(void *dst, void *src, int len);
116void pci_bmcpyfrom(void *dst, void *src, int len);
117
118#endif /* CONFIG_PCI */
119/****************************************************************************/
120#endif /* mcfpci_h */
diff --git a/include/asm-m68knommu/mcfpit.h b/include/asm-m68knommu/mcfpit.h
new file mode 100644
index 000000000000..4cc2e9fd6ad0
--- /dev/null
+++ b/include/asm-m68knommu/mcfpit.h
@@ -0,0 +1,63 @@
1/****************************************************************************/
2
3/*
4 * mcfpit.h -- ColdFire internal PIT timer support defines.
5 *
6 * (C) Copyright 2003, Greg Ungerer (gerg@snapgear.com)
7 */
8
9/****************************************************************************/
10#ifndef mcfpit_h
11#define mcfpit_h
12/****************************************************************************/
13
14#include <linux/config.h>
15
16/*
17 * Get address specific defines for the 5270/5271 and 5280/5282.
18 */
19#define MCFPIT_BASE1 0x00150000 /* Base address of TIMER1 */
20#define MCFPIT_BASE2 0x00160000 /* Base address of TIMER2 */
21#define MCFPIT_BASE3 0x00170000 /* Base address of TIMER3 */
22#define MCFPIT_BASE4 0x00180000 /* Base address of TIMER4 */
23
24
25/*
26 * Define the PIT timer register set addresses.
27 */
28struct mcfpit {
29 unsigned short pcsr; /* PIT control and status */
30 unsigned short pmr; /* PIT modulus register */
31 unsigned short pcntr; /* PIT count register */
32} __attribute__((packed));
33
34/*
35 * Bit definitions for the PIT Control and Status register.
36 */
37#define MCFPIT_PCSR_CLK1 0x0000 /* System clock divisor */
38#define MCFPIT_PCSR_CLK2 0x0100 /* System clock divisor */
39#define MCFPIT_PCSR_CLK4 0x0200 /* System clock divisor */
40#define MCFPIT_PCSR_CLK8 0x0300 /* System clock divisor */
41#define MCFPIT_PCSR_CLK16 0x0400 /* System clock divisor */
42#define MCFPIT_PCSR_CLK32 0x0500 /* System clock divisor */
43#define MCFPIT_PCSR_CLK64 0x0600 /* System clock divisor */
44#define MCFPIT_PCSR_CLK128 0x0700 /* System clock divisor */
45#define MCFPIT_PCSR_CLK256 0x0800 /* System clock divisor */
46#define MCFPIT_PCSR_CLK512 0x0900 /* System clock divisor */
47#define MCFPIT_PCSR_CLK1024 0x0a00 /* System clock divisor */
48#define MCFPIT_PCSR_CLK2048 0x0b00 /* System clock divisor */
49#define MCFPIT_PCSR_CLK4096 0x0c00 /* System clock divisor */
50#define MCFPIT_PCSR_CLK8192 0x0d00 /* System clock divisor */
51#define MCFPIT_PCSR_CLK16384 0x0e00 /* System clock divisor */
52#define MCFPIT_PCSR_CLK32768 0x0f00 /* System clock divisor */
53#define MCFPIT_PCSR_DOZE 0x0040 /* Clock run in doze mode */
54#define MCFPIT_PCSR_HALTED 0x0020 /* Clock run in halt mode */
55#define MCFPIT_PCSR_OVW 0x0010 /* Overwrite PIT counter now */
56#define MCFPIT_PCSR_PIE 0x0008 /* Enable PIT interrupt */
57#define MCFPIT_PCSR_PIF 0x0004 /* PIT interrupt flag */
58#define MCFPIT_PCSR_RLD 0x0002 /* Reload counter */
59#define MCFPIT_PCSR_EN 0x0001 /* Enable PIT */
60#define MCFPIT_PCSR_DISABLE 0x0000 /* Disable PIT */
61
62/****************************************************************************/
63#endif /* mcfpit_h */
diff --git a/include/asm-m68knommu/mcfsim.h b/include/asm-m68knommu/mcfsim.h
new file mode 100644
index 000000000000..522e513c2bc6
--- /dev/null
+++ b/include/asm-m68knommu/mcfsim.h
@@ -0,0 +1,109 @@
1/****************************************************************************/
2
3/*
4 * mcfsim.h -- ColdFire System Integration Module support.
5 *
6 * (C) Copyright 1999-2003, Greg Ungerer (gerg@snapgear.com)
7 * (C) Copyright 2000, Lineo Inc. (www.lineo.com)
8 */
9
10/****************************************************************************/
11#ifndef mcfsim_h
12#define mcfsim_h
13/****************************************************************************/
14
15#include <linux/config.h>
16
17/*
18 * Include 5204, 5206/e, 5249, 5270/5271, 5272, 5280/5282, 5307 or
19 * 5407 specific addresses.
20 */
21#if defined(CONFIG_M5204)
22#include <asm/m5204sim.h>
23#elif defined(CONFIG_M5206) || defined(CONFIG_M5206e)
24#include <asm/m5206sim.h>
25#elif defined(CONFIG_M5249)
26#include <asm/m5249sim.h>
27#elif defined(CONFIG_M527x)
28#include <asm/m527xsim.h>
29#elif defined(CONFIG_M5272)
30#include <asm/m5272sim.h>
31#elif defined(CONFIG_M528x)
32#include <asm/m528xsim.h>
33#elif defined(CONFIG_M5307)
34#include <asm/m5307sim.h>
35#elif defined(CONFIG_M5407)
36#include <asm/m5407sim.h>
37#endif
38
39
40/*
41 * Define the base address of the SIM within the MBAR address space.
42 */
43#define MCFSIM_BASE 0x0 /* Base address of SIM */
44
45
46/*
47 * Bit definitions for the ICR family of registers.
48 */
49#define MCFSIM_ICR_AUTOVEC 0x80 /* Auto-vectored intr */
50#define MCFSIM_ICR_LEVEL0 0x00 /* Level 0 intr */
51#define MCFSIM_ICR_LEVEL1 0x04 /* Level 1 intr */
52#define MCFSIM_ICR_LEVEL2 0x08 /* Level 2 intr */
53#define MCFSIM_ICR_LEVEL3 0x0c /* Level 3 intr */
54#define MCFSIM_ICR_LEVEL4 0x10 /* Level 4 intr */
55#define MCFSIM_ICR_LEVEL5 0x14 /* Level 5 intr */
56#define MCFSIM_ICR_LEVEL6 0x18 /* Level 6 intr */
57#define MCFSIM_ICR_LEVEL7 0x1c /* Level 7 intr */
58
59#define MCFSIM_ICR_PRI0 0x00 /* Priority 0 intr */
60#define MCFSIM_ICR_PRI1 0x01 /* Priority 1 intr */
61#define MCFSIM_ICR_PRI2 0x02 /* Priority 2 intr */
62#define MCFSIM_ICR_PRI3 0x03 /* Priority 3 intr */
63
64/*
65 * Bit definitions for the Interrupt Mask register (IMR).
66 */
67#define MCFSIM_IMR_EINT1 0x0002 /* External intr # 1 */
68#define MCFSIM_IMR_EINT2 0x0004 /* External intr # 2 */
69#define MCFSIM_IMR_EINT3 0x0008 /* External intr # 3 */
70#define MCFSIM_IMR_EINT4 0x0010 /* External intr # 4 */
71#define MCFSIM_IMR_EINT5 0x0020 /* External intr # 5 */
72#define MCFSIM_IMR_EINT6 0x0040 /* External intr # 6 */
73#define MCFSIM_IMR_EINT7 0x0080 /* External intr # 7 */
74
75#define MCFSIM_IMR_SWD 0x0100 /* Software Watchdog intr */
76#define MCFSIM_IMR_TIMER1 0x0200 /* TIMER 1 intr */
77#define MCFSIM_IMR_TIMER2 0x0400 /* TIMER 2 intr */
78#define MCFSIM_IMR_MBUS 0x0800 /* MBUS intr */
79#define MCFSIM_IMR_UART1 0x1000 /* UART 1 intr */
80#define MCFSIM_IMR_UART2 0x2000 /* UART 2 intr */
81
82#if defined(CONFIG_M5206e)
83#define MCFSIM_IMR_DMA1 0x4000 /* DMA 1 intr */
84#define MCFSIM_IMR_DMA2 0x8000 /* DMA 2 intr */
85#elif defined(CONFIG_M5249) || defined(CONFIG_M5307)
86#define MCFSIM_IMR_DMA0 0x4000 /* DMA 0 intr */
87#define MCFSIM_IMR_DMA1 0x8000 /* DMA 1 intr */
88#define MCFSIM_IMR_DMA2 0x10000 /* DMA 2 intr */
89#define MCFSIM_IMR_DMA3 0x20000 /* DMA 3 intr */
90#endif
91
92/*
93 * Mask for all of the SIM devices. Some parts have more or less
94 * SIM devices. This is a catchall for the sandard set.
95 */
96#ifndef MCFSIM_IMR_MASKALL
97#define MCFSIM_IMR_MASKALL 0x3ffe /* All intr sources */
98#endif
99
100
101#ifndef __ASSEMBLY__
102/*
103 * Definition for the interrupt auto-vectoring support.
104 */
105extern void mcf_autovector(unsigned int vec);
106#endif /* __ASSEMBLY__ */
107
108/****************************************************************************/
109#endif /* mcfsim_h */
diff --git a/include/asm-m68knommu/mcfsmc.h b/include/asm-m68knommu/mcfsmc.h
new file mode 100644
index 000000000000..2583900b9591
--- /dev/null
+++ b/include/asm-m68knommu/mcfsmc.h
@@ -0,0 +1,188 @@
1/****************************************************************************/
2
3/*
4 * mcfsmc.h -- SMC ethernet support for ColdFire environments.
5 *
6 * (C) Copyright 1999-2002, Greg Ungerer (gerg@snapgear.com)
7 * (C) Copyright 2000, Lineo Inc. (www.lineo.com)
8 */
9
10/****************************************************************************/
11#ifndef mcfsmc_h
12#define mcfsmc_h
13/****************************************************************************/
14
15/*
16 * None of the current ColdFire targets that use the SMC91x111
17 * allow 8 bit accesses. So this code is 16bit access only.
18 */
19
20#include <linux/config.h>
21
22#undef outb
23#undef inb
24#undef outw
25#undef outwd
26#undef inw
27#undef outl
28#undef inl
29
30#undef outsb
31#undef outsw
32#undef outsl
33#undef insb
34#undef insw
35#undef insl
36
37/*
38 * Re-defines for ColdFire environment... The SMC part is
39 * mapped into memory space, so remap the PC-style in/out
40 * routines to handle that.
41 */
42#define outb smc_outb
43#define inb smc_inb
44#define outw smc_outw
45#define outwd smc_outwd
46#define inw smc_inw
47#define outl smc_outl
48#define inl smc_inl
49
50#define outsb smc_outsb
51#define outsw smc_outsw
52#define outsl smc_outsl
53#define insb smc_insb
54#define insw smc_insw
55#define insl smc_insl
56
57
58static inline int smc_inb(unsigned int addr)
59{
60 register unsigned short w;
61 w = *((volatile unsigned short *) (addr & ~0x1));
62 return(((addr & 0x1) ? w : (w >> 8)) & 0xff);
63}
64
65static inline void smc_outw(unsigned int val, unsigned int addr)
66{
67 *((volatile unsigned short *) addr) = (val << 8) | (val >> 8);
68}
69
70static inline int smc_inw(unsigned int addr)
71{
72 register unsigned short w;
73 w = *((volatile unsigned short *) addr);
74 return(((w << 8) | (w >> 8)) & 0xffff);
75}
76
77static inline void smc_outl(unsigned long val, unsigned int addr)
78{
79 *((volatile unsigned long *) addr) =
80 ((val << 8) & 0xff000000) | ((val >> 8) & 0x00ff0000) |
81 ((val << 8) & 0x0000ff00) | ((val >> 8) & 0x000000ff);
82}
83
84static inline void smc_outwd(unsigned int val, unsigned int addr)
85{
86 *((volatile unsigned short *) addr) = val;
87}
88
89
90/*
91 * The rep* functions are used to feed the data port with
92 * raw data. So we do not byte swap them when copying.
93 */
94
95static inline void smc_insb(unsigned int addr, void *vbuf, int unsigned long len)
96{
97 volatile unsigned short *rp;
98 unsigned short *buf, *ebuf;
99
100 buf = (unsigned short *) vbuf;
101 rp = (volatile unsigned short *) addr;
102
103 /* Copy as words for as long as possible */
104 for (ebuf = buf + (len >> 1); (buf < ebuf); )
105 *buf++ = *rp;
106
107 /* Lastly, handle left over byte */
108 if (len & 0x1)
109 *((unsigned char *) buf) = (*rp >> 8) & 0xff;
110}
111
112static inline void smc_insw(unsigned int addr, void *vbuf, unsigned long len)
113{
114 volatile unsigned short *rp;
115 unsigned short *buf, *ebuf;
116
117 buf = (unsigned short *) vbuf;
118 rp = (volatile unsigned short *) addr;
119 for (ebuf = buf + len; (buf < ebuf); )
120 *buf++ = *rp;
121}
122
123static inline void smc_insl(unsigned int addr, void *vbuf, unsigned long len)
124{
125 volatile unsigned long *rp;
126 unsigned long *buf, *ebuf;
127
128 buf = (unsigned long *) vbuf;
129 rp = (volatile unsigned long *) addr;
130 for (ebuf = buf + len; (buf < ebuf); )
131 *buf++ = *rp;
132}
133
134static inline void smc_outsw(unsigned int addr, const void *vbuf, unsigned long len)
135{
136 volatile unsigned short *rp;
137 unsigned short *buf, *ebuf;
138
139 buf = (unsigned short *) vbuf;
140 rp = (volatile unsigned short *) addr;
141 for (ebuf = buf + len; (buf < ebuf); )
142 *rp = *buf++;
143}
144
145static inline void smc_outsl(unsigned int addr, void *vbuf, unsigned long len)
146{
147 volatile unsigned long *rp;
148 unsigned long *buf, *ebuf;
149
150 buf = (unsigned long *) vbuf;
151 rp = (volatile unsigned long *) addr;
152 for (ebuf = buf + len; (buf < ebuf); )
153 *rp = *buf++;
154}
155
156
157#ifdef CONFIG_NETtel
158/*
159 * Re-map the address space of at least one of the SMC ethernet
160 * parts. Both parts power up decoding the same address, so we
161 * need to move one of them first, before doing enything else.
162 *
163 * We also increase the number of wait states for this part by one.
164 */
165
166void smc_remap(unsigned int ioaddr)
167{
168 static int once = 0;
169 extern unsigned short ppdata;
170 if (once++ == 0) {
171 *((volatile unsigned short *)(MCF_MBAR+MCFSIM_PADDR)) = 0x00ec;
172 ppdata |= 0x0080;
173 *((volatile unsigned short *)(MCF_MBAR+MCFSIM_PADAT)) = ppdata;
174 outw(0x0001, ioaddr + BANK_SELECT);
175 outw(0x0001, ioaddr + BANK_SELECT);
176 outw(0x0067, ioaddr + BASE);
177
178 ppdata &= ~0x0080;
179 *((volatile unsigned short *)(MCF_MBAR+MCFSIM_PADAT)) = ppdata;
180 }
181
182 *((volatile unsigned short *)(MCF_MBAR+MCFSIM_CSCR3)) = 0x1180;
183}
184
185#endif
186
187/****************************************************************************/
188#endif /* mcfsmc_h */
diff --git a/include/asm-m68knommu/mcftimer.h b/include/asm-m68knommu/mcftimer.h
new file mode 100644
index 000000000000..0f47164c33a9
--- /dev/null
+++ b/include/asm-m68knommu/mcftimer.h
@@ -0,0 +1,85 @@
1/****************************************************************************/
2
3/*
4 * mcftimer.h -- ColdFire internal TIMER support defines.
5 *
6 * (C) Copyright 1999-2002, Greg Ungerer (gerg@snapgear.com)
7 * (C) Copyright 2000, Lineo Inc. (www.lineo.com)
8 */
9
10/****************************************************************************/
11#ifndef mcftimer_h
12#define mcftimer_h
13/****************************************************************************/
14
15#include <linux/config.h>
16
17/*
18 * Get address specific defines for this ColdFire member.
19 */
20#if defined(CONFIG_M5204) || defined(CONFIG_M5206) || defined(CONFIG_M5206e)
21#define MCFTIMER_BASE1 0x100 /* Base address of TIMER1 */
22#define MCFTIMER_BASE2 0x120 /* Base address of TIMER2 */
23#elif defined(CONFIG_M5272)
24#define MCFTIMER_BASE1 0x200 /* Base address of TIMER1 */
25#define MCFTIMER_BASE2 0x220 /* Base address of TIMER2 */
26#define MCFTIMER_BASE3 0x240 /* Base address of TIMER4 */
27#define MCFTIMER_BASE4 0x260 /* Base address of TIMER3 */
28#elif defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407)
29#define MCFTIMER_BASE1 0x140 /* Base address of TIMER1 */
30#define MCFTIMER_BASE2 0x180 /* Base address of TIMER2 */
31#endif
32
33
34/*
35 * Define the TIMER register set addresses.
36 */
37#define MCFTIMER_TMR 0x00 /* Timer Mode reg (r/w) */
38#define MCFTIMER_TRR 0x02 /* Timer Reference (r/w) */
39#define MCFTIMER_TCR 0x04 /* Timer Capture reg (r/w) */
40#define MCFTIMER_TCN 0x06 /* Timer Counter reg (r/w) */
41#define MCFTIMER_TER 0x11 /* Timer Event reg (r/w) */
42
43struct mcftimer {
44 unsigned short tmr; /* Timer Mode reg (r/w) */
45 unsigned short reserved1;
46 unsigned short trr; /* Timer Reference (r/w) */
47 unsigned short reserved2;
48 unsigned short tcr; /* Timer Capture reg (r/w) */
49 unsigned short reserved3;
50 unsigned short tcn; /* Timer Counter reg (r/w) */
51 unsigned short reserved4;
52 unsigned char reserved5;
53 unsigned char ter; /* Timer Event reg (r/w) */
54} __attribute__((packed));
55
56/*
57 * Bit definitions for the Timer Mode Register (TMR).
58 * Register bit flags are common accross ColdFires.
59 */
60#define MCFTIMER_TMR_PREMASK 0xff00 /* Prescalar mask */
61#define MCFTIMER_TMR_DISCE 0x0000 /* Disable capture */
62#define MCFTIMER_TMR_ANYCE 0x00c0 /* Capture any edge */
63#define MCFTIMER_TMR_FALLCE 0x0080 /* Capture fallingedge */
64#define MCFTIMER_TMR_RISECE 0x0040 /* Capture rising edge */
65#define MCFTIMER_TMR_ENOM 0x0020 /* Enable output toggle */
66#define MCFTIMER_TMR_DISOM 0x0000 /* Do single output pulse */
67#define MCFTIMER_TMR_ENORI 0x0010 /* Enable ref interrupt */
68#define MCFTIMER_TMR_DISORI 0x0000 /* Disable ref interrupt */
69#define MCFTIMER_TMR_RESTART 0x0008 /* Restart counter */
70#define MCFTIMER_TMR_FREERUN 0x0000 /* Free running counter */
71#define MCFTIMER_TMR_CLKTIN 0x0006 /* Input clock is TIN */
72#define MCFTIMER_TMR_CLK16 0x0004 /* Input clock is /16 */
73#define MCFTIMER_TMR_CLK1 0x0002 /* Input clock is /1 */
74#define MCFTIMER_TMR_CLKSTOP 0x0000 /* Stop counter */
75#define MCFTIMER_TMR_ENABLE 0x0001 /* Enable timer */
76#define MCFTIMER_TMR_DISABLE 0x0000 /* Disable timer */
77
78/*
79 * Bit definitions for the Timer Event Registers (TER).
80 */
81#define MCFTIMER_TER_CAP 0x01 /* Capture event */
82#define MCFTIMER_TER_REF 0x02 /* Refernece event */
83
84/****************************************************************************/
85#endif /* mcftimer_h */
diff --git a/include/asm-m68knommu/mcfuart.h b/include/asm-m68knommu/mcfuart.h
new file mode 100644
index 000000000000..54d4a85f4fdf
--- /dev/null
+++ b/include/asm-m68knommu/mcfuart.h
@@ -0,0 +1,200 @@
1/****************************************************************************/
2
3/*
4 * mcfuart.h -- ColdFire internal UART support defines.
5 *
6 * (C) Copyright 1999-2003, Greg Ungerer (gerg@snapgear.com)
7 * (C) Copyright 2000, Lineo Inc. (www.lineo.com)
8 */
9
10/****************************************************************************/
11#ifndef mcfuart_h
12#define mcfuart_h
13/****************************************************************************/
14
15#include <linux/config.h>
16
17/*
18 * Define the base address of the UARTS within the MBAR address
19 * space.
20 */
21#if defined(CONFIG_M5272)
22#define MCFUART_BASE1 0x100 /* Base address of UART1 */
23#define MCFUART_BASE2 0x140 /* Base address of UART2 */
24#elif defined(CONFIG_M5204) || defined(CONFIG_M5206) || defined(CONFIG_M5206e)
25#if defined(CONFIG_NETtel)
26#define MCFUART_BASE1 0x180 /* Base address of UART1 */
27#define MCFUART_BASE2 0x140 /* Base address of UART2 */
28#else
29#define MCFUART_BASE1 0x140 /* Base address of UART1 */
30#define MCFUART_BASE2 0x180 /* Base address of UART2 */
31#endif
32#elif defined(CONFIG_M527x) || defined(CONFIG_M528x)
33#define MCFUART_BASE1 0x200 /* Base address of UART1 */
34#define MCFUART_BASE2 0x240 /* Base address of UART2 */
35#define MCFUART_BASE3 0x280 /* Base address of UART3 */
36#elif defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407)
37#if defined(CONFIG_NETtel) || defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3)
38#define MCFUART_BASE1 0x200 /* Base address of UART1 */
39#define MCFUART_BASE2 0x1c0 /* Base address of UART2 */
40#else
41#define MCFUART_BASE1 0x1c0 /* Base address of UART1 */
42#define MCFUART_BASE2 0x200 /* Base address of UART2 */
43#endif
44#endif
45
46
47/*
48 * Define the ColdFire UART register set addresses.
49 */
50#define MCFUART_UMR 0x00 /* Mode register (r/w) */
51#define MCFUART_USR 0x04 /* Status register (r) */
52#define MCFUART_UCSR 0x04 /* Clock Select (w) */
53#define MCFUART_UCR 0x08 /* Command register (w) */
54#define MCFUART_URB 0x0c /* Receiver Buffer (r) */
55#define MCFUART_UTB 0x0c /* Transmit Buffer (w) */
56#define MCFUART_UIPCR 0x10 /* Input Port Change (r) */
57#define MCFUART_UACR 0x10 /* Auxiliary Control (w) */
58#define MCFUART_UISR 0x14 /* Interrup Status (r) */
59#define MCFUART_UIMR 0x14 /* Interrupt Mask (w) */
60#define MCFUART_UBG1 0x18 /* Baud Rate MSB (r/w) */
61#define MCFUART_UBG2 0x1c /* Baud Rate LSB (r/w) */
62#ifdef CONFIG_M5272
63#define MCFUART_UTF 0x28 /* Transmitter FIFO (r/w) */
64#define MCFUART_URF 0x2c /* Receiver FIFO (r/w) */
65#define MCFUART_UFPD 0x30 /* Frac Prec. Divider (r/w) */
66#else
67#define MCFUART_UIVR 0x30 /* Interrupt Vector (r/w) */
68#endif
69#define MCFUART_UIPR 0x34 /* Input Port (r) */
70#define MCFUART_UOP1 0x38 /* Output Port Bit Set (w) */
71#define MCFUART_UOP0 0x3c /* Output Port Bit Reset (w) */
72
73
74/*
75 * Define bit flags in Mode Register 1 (MR1).
76 */
77#define MCFUART_MR1_RXRTS 0x80 /* Auto RTS flow control */
78#define MCFUART_MR1_RXIRQFULL 0x40 /* RX IRQ type FULL */
79#define MCFUART_MR1_RXIRQRDY 0x00 /* RX IRQ type RDY */
80#define MCFUART_MR1_RXERRBLOCK 0x20 /* RX block error mode */
81#define MCFUART_MR1_RXERRCHAR 0x00 /* RX char error mode */
82
83#define MCFUART_MR1_PARITYNONE 0x10 /* No parity */
84#define MCFUART_MR1_PARITYEVEN 0x00 /* Even parity */
85#define MCFUART_MR1_PARITYODD 0x04 /* Odd parity */
86#define MCFUART_MR1_PARITYSPACE 0x08 /* Space parity */
87#define MCFUART_MR1_PARITYMARK 0x0c /* Mark parity */
88
89#define MCFUART_MR1_CS5 0x00 /* 5 bits per char */
90#define MCFUART_MR1_CS6 0x01 /* 6 bits per char */
91#define MCFUART_MR1_CS7 0x02 /* 7 bits per char */
92#define MCFUART_MR1_CS8 0x03 /* 8 bits per char */
93
94/*
95 * Define bit flags in Mode Register 2 (MR2).
96 */
97#define MCFUART_MR2_LOOPBACK 0x80 /* Loopback mode */
98#define MCFUART_MR2_REMOTELOOP 0xc0 /* Remote loopback mode */
99#define MCFUART_MR2_AUTOECHO 0x40 /* Automatic echo */
100#define MCFUART_MR2_TXRTS 0x20 /* Assert RTS on TX */
101#define MCFUART_MR2_TXCTS 0x10 /* Auto CTS flow control */
102
103#define MCFUART_MR2_STOP1 0x07 /* 1 stop bit */
104#define MCFUART_MR2_STOP15 0x08 /* 1.5 stop bits */
105#define MCFUART_MR2_STOP2 0x0f /* 2 stop bits */
106
107/*
108 * Define bit flags in Status Register (USR).
109 */
110#define MCFUART_USR_RXBREAK 0x80 /* Received BREAK */
111#define MCFUART_USR_RXFRAMING 0x40 /* Received framing error */
112#define MCFUART_USR_RXPARITY 0x20 /* Received parity error */
113#define MCFUART_USR_RXOVERRUN 0x10 /* Received overrun error */
114#define MCFUART_USR_TXEMPTY 0x08 /* Transmitter empty */
115#define MCFUART_USR_TXREADY 0x04 /* Transmitter ready */
116#define MCFUART_USR_RXFULL 0x02 /* Receiver full */
117#define MCFUART_USR_RXREADY 0x01 /* Receiver ready */
118
119#define MCFUART_USR_RXERR (MCFUART_USR_RXBREAK | MCFUART_USR_RXFRAMING | \
120 MCFUART_USR_RXPARITY | MCFUART_USR_RXOVERRUN)
121
122/*
123 * Define bit flags in Clock Select Register (UCSR).
124 */
125#define MCFUART_UCSR_RXCLKTIMER 0xd0 /* RX clock is timer */
126#define MCFUART_UCSR_RXCLKEXT16 0xe0 /* RX clock is external x16 */
127#define MCFUART_UCSR_RXCLKEXT1 0xf0 /* RX clock is external x1 */
128
129#define MCFUART_UCSR_TXCLKTIMER 0x0d /* TX clock is timer */
130#define MCFUART_UCSR_TXCLKEXT16 0x0e /* TX clock is external x16 */
131#define MCFUART_UCSR_TXCLKEXT1 0x0f /* TX clock is external x1 */
132
133/*
134 * Define bit flags in Command Register (UCR).
135 */
136#define MCFUART_UCR_CMDNULL 0x00 /* No command */
137#define MCFUART_UCR_CMDRESETMRPTR 0x10 /* Reset MR pointer */
138#define MCFUART_UCR_CMDRESETRX 0x20 /* Reset receiver */
139#define MCFUART_UCR_CMDRESETTX 0x30 /* Reset transmitter */
140#define MCFUART_UCR_CMDRESETERR 0x40 /* Reset error status */
141#define MCFUART_UCR_CMDRESETBREAK 0x50 /* Reset BREAK change */
142#define MCFUART_UCR_CMDBREAKSTART 0x60 /* Start BREAK */
143#define MCFUART_UCR_CMDBREAKSTOP 0x70 /* Stop BREAK */
144
145#define MCFUART_UCR_TXNULL 0x00 /* No TX command */
146#define MCFUART_UCR_TXENABLE 0x04 /* Enable TX */
147#define MCFUART_UCR_TXDISABLE 0x08 /* Disable TX */
148#define MCFUART_UCR_RXNULL 0x00 /* No RX command */
149#define MCFUART_UCR_RXENABLE 0x01 /* Enable RX */
150#define MCFUART_UCR_RXDISABLE 0x02 /* Disable RX */
151
152/*
153 * Define bit flags in Input Port Change Register (UIPCR).
154 */
155#define MCFUART_UIPCR_CTSCOS 0x10 /* CTS change of state */
156#define MCFUART_UIPCR_CTS 0x01 /* CTS value */
157
158/*
159 * Define bit flags in Input Port Register (UIP).
160 */
161#define MCFUART_UIPR_CTS 0x01 /* CTS value */
162
163/*
164 * Define bit flags in Output Port Registers (UOP).
165 * Clear bit by writing to UOP0, set by writing to UOP1.
166 */
167#define MCFUART_UOP_RTS 0x01 /* RTS set or clear */
168
169/*
170 * Define bit flags in the Auxiliary Control Register (UACR).
171 */
172#define MCFUART_UACR_IEC 0x01 /* Input enable control */
173
174/*
175 * Define bit flags in Interrupt Status Register (UISR).
176 * These same bits are used for the Interrupt Mask Register (UIMR).
177 */
178#define MCFUART_UIR_COS 0x80 /* Change of state (CTS) */
179#define MCFUART_UIR_DELTABREAK 0x04 /* Break start or stop */
180#define MCFUART_UIR_RXREADY 0x02 /* Receiver ready */
181#define MCFUART_UIR_TXREADY 0x01 /* Transmitter ready */
182
183#ifdef CONFIG_M5272
184/*
185 * Define bit flags in the Transmitter FIFO Register (UTF).
186 */
187#define MCFUART_UTF_TXB 0x1f /* Transmitter data level */
188#define MCFUART_UTF_FULL 0x20 /* Transmitter fifo full */
189#define MCFUART_UTF_TXS 0xc0 /* Transmitter status */
190
191/*
192 * Define bit flags in the Receiver FIFO Register (URF).
193 */
194#define MCFUART_URF_RXB 0x1f /* Receiver data level */
195#define MCFUART_URF_FULL 0x20 /* Receiver fifo full */
196#define MCFUART_URF_RXS 0xc0 /* Receiver status */
197#endif
198
199/****************************************************************************/
200#endif /* mcfuart_h */
diff --git a/include/asm-m68knommu/mcfwdebug.h b/include/asm-m68knommu/mcfwdebug.h
new file mode 100644
index 000000000000..c425dd568155
--- /dev/null
+++ b/include/asm-m68knommu/mcfwdebug.h
@@ -0,0 +1,119 @@
1/****************************************************************************/
2
3/*
4 * mcfdebug.h -- ColdFire Debug Module support.
5 *
6 * (C) Copyright 2001, Lineo Inc. (www.lineo.com)
7 */
8
9/****************************************************************************/
10#ifndef mcfdebug_h
11#define mcfdebug_h
12/****************************************************************************/
13#include <linux/config.h>
14
15/* Define the debug module registers */
16#define MCFDEBUG_CSR 0x0 /* Configuration status */
17#define MCFDEBUG_BAAR 0x5 /* BDM address attribute */
18#define MCFDEBUG_AATR 0x6 /* Address attribute trigger */
19#define MCFDEBUG_TDR 0x7 /* Trigger definition */
20#define MCFDEBUG_PBR 0x8 /* PC breakpoint */
21#define MCFDEBUG_PBMR 0x9 /* PC breakpoint mask */
22#define MCFDEBUG_ABHR 0xc /* High address breakpoint */
23#define MCFDEBUG_ABLR 0xd /* Low address breakpoint */
24#define MCFDEBUG_DBR 0xe /* Data breakpoint */
25#define MCFDEBUG_DBMR 0xf /* Data breakpoint mask */
26
27/* Define some handy constants for the trigger definition register */
28#define MCFDEBUG_TDR_TRC_DISP 0x00000000 /* display on DDATA only */
29#define MCFDEBUG_TDR_TRC_HALT 0x40000000 /* Processor halt on BP */
30#define MCFDEBUG_TDR_TRC_INTR 0x80000000 /* Debug intr on BP */
31#define MCFDEBUG_TDR_LXT1 0x00004000 /* TDR level 1 */
32#define MCFDEBUG_TDR_LXT2 0x00008000 /* TDR level 2 */
33#define MCFDEBUG_TDR_EBL1 0x00002000 /* Enable breakpoint level 1 */
34#define MCFDEBUG_TDR_EBL2 0x20000000 /* Enable breakpoint level 2 */
35#define MCFDEBUG_TDR_EDLW1 0x00001000 /* Enable data BP longword */
36#define MCFDEBUG_TDR_EDLW2 0x10000000
37#define MCFDEBUG_TDR_EDWL1 0x00000800 /* Enable data BP lower word */
38#define MCFDEBUG_TDR_EDWL2 0x08000000
39#define MCFDEBUG_TDR_EDWU1 0x00000400 /* Enable data BP upper word */
40#define MCFDEBUG_TDR_EDWU2 0x04000000
41#define MCFDEBUG_TDR_EDLL1 0x00000200 /* Enable data BP low low byte */
42#define MCFDEBUG_TDR_EDLL2 0x02000000
43#define MCFDEBUG_TDR_EDLM1 0x00000100 /* Enable data BP low mid byte */
44#define MCFDEBUG_TDR_EDLM2 0x01000000
45#define MCFDEBUG_TDR_EDUM1 0x00000080 /* Enable data BP up mid byte */
46#define MCFDEBUG_TDR_EDUM2 0x00800000
47#define MCFDEBUG_TDR_EDUU1 0x00000040 /* Enable data BP up up byte */
48#define MCFDEBUG_TDR_EDUU2 0x00400000
49#define MCFDEBUG_TDR_DI1 0x00000020 /* Data BP invert */
50#define MCFDEBUG_TDR_DI2 0x00200000
51#define MCFDEBUG_TDR_EAI1 0x00000010 /* Enable address BP inverted */
52#define MCFDEBUG_TDR_EAI2 0x00100000
53#define MCFDEBUG_TDR_EAR1 0x00000008 /* Enable address BP range */
54#define MCFDEBUG_TDR_EAR2 0x00080000
55#define MCFDEBUG_TDR_EAL1 0x00000004 /* Enable address BP low */
56#define MCFDEBUG_TDR_EAL2 0x00040000
57#define MCFDEBUG_TDR_EPC1 0x00000002 /* Enable PC BP */
58#define MCFDEBUG_TDR_EPC2 0x00020000
59#define MCFDEBUG_TDR_PCI1 0x00000001 /* PC BP invert */
60#define MCFDEBUG_TDR_PCI2 0x00010000
61
62/* Constants for the address attribute trigger register */
63#define MCFDEBUG_AAR_RESET 0x00000005
64/* Fields not yet implemented */
65
66/* And some definitions for the writable sections of the CSR */
67#define MCFDEBUG_CSR_RESET 0x00100000
68#define MCFDEBUG_CSR_PSTCLK 0x00020000 /* PSTCLK disable */
69#define MCFDEBUG_CSR_IPW 0x00010000 /* Inhibit processor writes */
70#define MCFDEBUG_CSR_MAP 0x00008000 /* Processor refs in emul mode */
71#define MCFDEBUG_CSR_TRC 0x00004000 /* Emul mode on trace exception */
72#define MCFDEBUG_CSR_EMU 0x00002000 /* Force emulation mode */
73#define MCFDEBUG_CSR_DDC_READ 0x00000800 /* Debug data control */
74#define MCFDEBUG_CSR_DDC_WRITE 0x00001000
75#define MCFDEBUG_CSR_UHE 0x00000400 /* User mode halt enable */
76#define MCFDEBUG_CSR_BTB0 0x00000000 /* Branch target 0 bytes */
77#define MCFDEBUG_CSR_BTB2 0x00000100 /* Branch target 2 bytes */
78#define MCFDEBUG_CSR_BTB3 0x00000200 /* Branch target 3 bytes */
79#define MCFDEBUG_CSR_BTB4 0x00000300 /* Branch target 4 bytes */
80#define MCFDEBUG_CSR_NPL 0x00000040 /* Non-pipelined mode */
81#define MCFDEBUG_CSR_SSM 0x00000010 /* Single step mode */
82
83/* Constants for the BDM address attribute register */
84#define MCFDEBUG_BAAR_RESET 0x00000005
85/* Fields not yet implemented */
86
87
88/* This routine wrappers up the wdebug asm instruction so that the register
89 * and value can be relatively easily specified. The biggest hassle here is
90 * that the debug module instructions (2 longs) must be long word aligned and
91 * some pointer fiddling is performed to ensure this.
92 */
93extern inline void wdebug(int reg, unsigned long data) {
94 unsigned short dbg_spc[6];
95 unsigned short *dbg;
96
97 // Force alignment to long word boundary
98 dbg = (unsigned short *)((((unsigned long)dbg_spc) + 3) & 0xfffffffc);
99
100 // Build up the debug instruction
101 dbg[0] = 0x2c80 | (reg & 0xf);
102 dbg[1] = (data >> 16) & 0xffff;
103 dbg[2] = data & 0xffff;
104 dbg[3] = 0;
105
106 // Perform the wdebug instruction
107#if 0
108 // This strain is for gas which doesn't have the wdebug instructions defined
109 asm( "move.l %0, %%a0\n\t"
110 ".word 0xfbd0\n\t"
111 ".word 0x0003\n\t"
112 :: "g" (dbg) : "a0");
113#else
114 // And this is for when it does
115 asm( "wdebug (%0)" :: "a" (dbg));
116#endif
117}
118
119#endif
diff --git a/include/asm-m68knommu/md.h b/include/asm-m68knommu/md.h
new file mode 100644
index 000000000000..d810c78de5ff
--- /dev/null
+++ b/include/asm-m68knommu/md.h
@@ -0,0 +1 @@
#include <asm-m68k/md.h>
diff --git a/include/asm-m68knommu/mman.h b/include/asm-m68knommu/mman.h
new file mode 100644
index 000000000000..4846c682efed
--- /dev/null
+++ b/include/asm-m68knommu/mman.h
@@ -0,0 +1 @@
#include <asm-m68k/mman.h>
diff --git a/include/asm-m68knommu/mmu.h b/include/asm-m68knommu/mmu.h
new file mode 100644
index 000000000000..5fa6b68353ba
--- /dev/null
+++ b/include/asm-m68knommu/mmu.h
@@ -0,0 +1,11 @@
1#ifndef __M68KNOMMU_MMU_H
2#define __M68KNOMMU_MMU_H
3
4/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
5
6typedef struct {
7 struct vm_list_struct *vmlist;
8 unsigned long end_brk;
9} mm_context_t;
10
11#endif /* __M68KNOMMU_MMU_H */
diff --git a/include/asm-m68knommu/mmu_context.h b/include/asm-m68knommu/mmu_context.h
new file mode 100644
index 000000000000..9bc0fd49b8aa
--- /dev/null
+++ b/include/asm-m68knommu/mmu_context.h
@@ -0,0 +1,33 @@
1#ifndef __M68KNOMMU_MMU_CONTEXT_H
2#define __M68KNOMMU_MMU_CONTEXT_H
3
4#include <linux/config.h>
5#include <asm/setup.h>
6#include <asm/page.h>
7#include <asm/pgalloc.h>
8
9static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
10{
11}
12
13extern inline int
14init_new_context(struct task_struct *tsk, struct mm_struct *mm)
15{
16 // mm->context = virt_to_phys(mm->pgd);
17 return(0);
18}
19
20#define destroy_context(mm) do { } while(0)
21
22static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
23{
24}
25
26#define deactivate_mm(tsk,mm) do { } while (0)
27
28extern inline void activate_mm(struct mm_struct *prev_mm,
29 struct mm_struct *next_mm)
30{
31}
32
33#endif
diff --git a/include/asm-m68knommu/module.h b/include/asm-m68knommu/module.h
new file mode 100644
index 000000000000..57e95cc01ad5
--- /dev/null
+++ b/include/asm-m68knommu/module.h
@@ -0,0 +1 @@
#include <asm-m68k/module.h>
diff --git a/include/asm-m68knommu/movs.h b/include/asm-m68knommu/movs.h
new file mode 100644
index 000000000000..81a16779e833
--- /dev/null
+++ b/include/asm-m68knommu/movs.h
@@ -0,0 +1 @@
#include <asm-m68k/movs.h>
diff --git a/include/asm-m68knommu/msgbuf.h b/include/asm-m68knommu/msgbuf.h
new file mode 100644
index 000000000000..bdfadec4d52d
--- /dev/null
+++ b/include/asm-m68knommu/msgbuf.h
@@ -0,0 +1 @@
#include <asm-m68k/msgbuf.h>
diff --git a/include/asm-m68knommu/namei.h b/include/asm-m68knommu/namei.h
new file mode 100644
index 000000000000..31a85d27b931
--- /dev/null
+++ b/include/asm-m68knommu/namei.h
@@ -0,0 +1 @@
#include <asm-m68k/namei.h>
diff --git a/include/asm-m68knommu/nettel.h b/include/asm-m68knommu/nettel.h
new file mode 100644
index 000000000000..9bda307e6544
--- /dev/null
+++ b/include/asm-m68knommu/nettel.h
@@ -0,0 +1,109 @@
1/****************************************************************************/
2
3/*
4 * nettel.h -- Lineo (formerly Moreton Bay) NETtel support.
5 *
6 * (C) Copyright 1999-2000, Moreton Bay (www.moretonbay.com)
7 * (C) Copyright 2000-2001, Lineo Inc. (www.lineo.com)
8 * (C) Copyright 2001-2002, SnapGear Inc., (www.snapgear.com)
9 */
10
11/****************************************************************************/
12#ifndef nettel_h
13#define nettel_h
14/****************************************************************************/
15
16#include <linux/config.h>
17
18/****************************************************************************/
19#ifdef CONFIG_NETtel
20/****************************************************************************/
21
22#ifdef CONFIG_COLDFIRE
23#include <asm/coldfire.h>
24#include <asm/mcfsim.h>
25#endif
26
27/*---------------------------------------------------------------------------*/
28#if defined(CONFIG_M5307)
29/*
30 * NETtel/5307 based hardware first. DTR/DCD lines are wired to
31 * GPIO lines. Most of the LED's are driver through a latch
32 * connected to CS2.
33 */
34#define MCFPP_DCD1 0x0001
35#define MCFPP_DCD0 0x0002
36#define MCFPP_DTR1 0x0004
37#define MCFPP_DTR0 0x0008
38
39#define NETtel_LEDADDR 0x30400000
40
41#ifndef __ASSEMBLY__
42
43extern volatile unsigned short ppdata;
44
45/*
46 * These functions defined to give quasi generic access to the
47 * PPIO bits used for DTR/DCD.
48 */
49static __inline__ unsigned int mcf_getppdata(void)
50{
51 volatile unsigned short *pp;
52 pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PADAT);
53 return((unsigned int) *pp);
54}
55
56static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)
57{
58 volatile unsigned short *pp;
59 pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PADAT);
60 ppdata = (ppdata & ~mask) | bits;
61 *pp = ppdata;
62}
63#endif
64
65/*---------------------------------------------------------------------------*/
66#elif defined(CONFIG_M5206e)
67/*
68 * NETtel/5206e based hardware has leds on latch on CS3.
69 * No support modem for lines??
70 */
71#define NETtel_LEDADDR 0x50000000
72
73/*---------------------------------------------------------------------------*/
74#elif defined(CONFIG_M5272)
75/*
76 * NETtel/5272 based hardware. DTR/DCD lines are wired to GPB lines.
77 */
78#define MCFPP_DCD0 0x0080
79#define MCFPP_DCD1 0x0000 /* Port 1 no DCD support */
80#define MCFPP_DTR0 0x0040
81#define MCFPP_DTR1 0x0000 /* Port 1 no DTR support */
82
83#ifndef __ASSEMBLY__
84/*
85 * These functions defined to give quasi generic access to the
86 * PPIO bits used for DTR/DCD.
87 */
88static __inline__ unsigned int mcf_getppdata(void)
89{
90 volatile unsigned short *pp;
91 pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT);
92 return((unsigned int) *pp);
93}
94
95static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)
96{
97 volatile unsigned short *pp;
98 pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT);
99 *pp = (*pp & ~mask) | bits;
100}
101#endif
102
103#endif
104/*---------------------------------------------------------------------------*/
105
106/****************************************************************************/
107#endif /* CONFIG_NETtel */
108/****************************************************************************/
109#endif /* nettel_h */
diff --git a/include/asm-m68knommu/openprom.h b/include/asm-m68knommu/openprom.h
new file mode 100644
index 000000000000..fdba7953ff9f
--- /dev/null
+++ b/include/asm-m68knommu/openprom.h
@@ -0,0 +1 @@
#include <asm-m68k/openprom.h>
diff --git a/include/asm-m68knommu/oplib.h b/include/asm-m68knommu/oplib.h
new file mode 100644
index 000000000000..ce079dc332d9
--- /dev/null
+++ b/include/asm-m68knommu/oplib.h
@@ -0,0 +1 @@
#include <asm-m68k/oplib.h>
diff --git a/include/asm-m68knommu/page.h b/include/asm-m68knommu/page.h
new file mode 100644
index 000000000000..05e03df0ec29
--- /dev/null
+++ b/include/asm-m68knommu/page.h
@@ -0,0 +1,95 @@
1#ifndef _M68KNOMMU_PAGE_H
2#define _M68KNOMMU_PAGE_H
3
4#include <linux/config.h>
5
6/* PAGE_SHIFT determines the page size */
7
8#define PAGE_SHIFT (12)
9#define PAGE_SIZE (1UL << PAGE_SHIFT)
10#define PAGE_MASK (~(PAGE_SIZE-1))
11
12#ifdef __KERNEL__
13
14#include <asm/setup.h>
15
16#ifndef __ASSEMBLY__
17
18#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
19#define free_user_page(page, addr) free_page(addr)
20
21#define clear_page(page) memset((page), 0, PAGE_SIZE)
22#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
23
24#define clear_user_page(page, vaddr, pg) clear_page(page)
25#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
26
27#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr)
28#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
29
30/*
31 * These are used to make use of C type-checking..
32 */
33typedef struct { unsigned long pte; } pte_t;
34typedef struct { unsigned long pmd[16]; } pmd_t;
35typedef struct { unsigned long pgd; } pgd_t;
36typedef struct { unsigned long pgprot; } pgprot_t;
37
38#define pte_val(x) ((x).pte)
39#define pmd_val(x) ((&x)->pmd[0])
40#define pgd_val(x) ((x).pgd)
41#define pgprot_val(x) ((x).pgprot)
42
43#define __pte(x) ((pte_t) { (x) } )
44#define __pmd(x) ((pmd_t) { (x) } )
45#define __pgd(x) ((pgd_t) { (x) } )
46#define __pgprot(x) ((pgprot_t) { (x) } )
47
48/* to align the pointer to the (next) page boundary */
49#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
50
51/* Pure 2^n version of get_order */
52extern __inline__ int get_order(unsigned long size)
53{
54 int order;
55
56 size = (size-1) >> (PAGE_SHIFT-1);
57 order = -1;
58 do {
59 size >>= 1;
60 order++;
61 } while (size);
62 return order;
63}
64
65extern unsigned long memory_start;
66extern unsigned long memory_end;
67
68#endif /* !__ASSEMBLY__ */
69
70#include <asm/page_offset.h>
71
72#define PAGE_OFFSET (PAGE_OFFSET_RAW)
73
74#ifndef __ASSEMBLY__
75
76#define __pa(vaddr) virt_to_phys((void *)vaddr)
77#define __va(paddr) phys_to_virt((unsigned long)paddr)
78
79#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
80#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
81
82#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
83#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
84
85#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn))
86#define page_to_pfn(page) virt_to_pfn(page_to_virt(page))
87
88#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
89 ((void *)(kaddr) < (void *)memory_end))
90
91#endif /* __ASSEMBLY__ */
92
93#endif /* __KERNEL__ */
94
95#endif /* _M68KNOMMU_PAGE_H */
diff --git a/include/asm-m68knommu/page_offset.h b/include/asm-m68knommu/page_offset.h
new file mode 100644
index 000000000000..2b45645e9b29
--- /dev/null
+++ b/include/asm-m68knommu/page_offset.h
@@ -0,0 +1,47 @@
1
2#include <linux/config.h>
3
4/* This handles the memory map.. */
5
6#ifdef CONFIG_COLDFIRE
7#if defined(CONFIG_SMALL)
8#define PAGE_OFFSET_RAW 0x30020000
9#elif defined(CONFIG_CFV240)
10#define PAGE_OFFSET_RAW 0x02000000
11#else
12#define PAGE_OFFSET_RAW 0x00000000
13#endif
14#endif
15
16#ifdef CONFIG_M68360
17#define PAGE_OFFSET_RAW 0x00000000
18#endif
19
20#ifdef CONFIG_PILOT
21#ifdef CONFIG_M68328
22#define PAGE_OFFSET_RAW 0x10000000
23#endif
24#ifdef CONFIG_M68EZ328
25#define PAGE_OFFSET_RAW 0x00000000
26#endif
27#endif
28#ifdef CONFIG_UCSIMM
29#define PAGE_OFFSET_RAW 0x00000000
30#endif
31
32#if defined(CONFIG_UCDIMM) || defined(CONFIG_DRAGEN2)
33#ifdef CONFIG_M68VZ328
34#define PAGE_OFFSET_RAW 0x00000000
35#endif /* CONFIG_M68VZ328 */
36#endif /* CONFIG_UCDIMM */
37
38#ifdef CONFIG_M68EZ328ADS
39#define PAGE_OFFSET_RAW 0x00000000
40#endif
41#ifdef CONFIG_ALMA_ANS
42#define PAGE_OFFSET_RAW 0x00000000
43#endif
44#ifdef CONFIG_M68EN302
45#define PAGE_OFFSET_RAW 0x00000000
46#endif
47
diff --git a/include/asm-m68knommu/param.h b/include/asm-m68knommu/param.h
new file mode 100644
index 000000000000..3f57d5db81f5
--- /dev/null
+++ b/include/asm-m68knommu/param.h
@@ -0,0 +1,26 @@
1#ifndef _M68KNOMMU_PARAM_H
2#define _M68KNOMMU_PARAM_H
3
4#include <linux/config.h>
5
6#if defined(CONFIG_CLEOPATRA)
7#define HZ 1000
8#endif
9#ifndef HZ
10#define HZ 100
11#endif
12
13#ifdef __KERNEL__
14#define USER_HZ HZ
15#define CLOCKS_PER_SEC (USER_HZ)
16#endif
17
18#define EXEC_PAGESIZE 4096
19
20#ifndef NOGROUP
21#define NOGROUP (-1)
22#endif
23
24#define MAXHOSTNAMELEN 64 /* max length of hostname */
25
26#endif /* _M68KNOMMU_PARAM_H */
diff --git a/include/asm-m68knommu/pci.h b/include/asm-m68knommu/pci.h
new file mode 100644
index 000000000000..e04c77e1184d
--- /dev/null
+++ b/include/asm-m68knommu/pci.h
@@ -0,0 +1,39 @@
1#ifndef M68KNOMMU_PCI_H
2#define M68KNOMMU_PCI_H
3
4#include <asm-m68k/pci.h>
5
6#ifdef CONFIG_COMEMPCI
7/*
8 * These are pretty much arbitary with the CoMEM implementation.
9 * We have the whole address space to ourselves.
10 */
11#define PCIBIOS_MIN_IO 0x100
12#define PCIBIOS_MIN_MEM 0x00010000
13
14#define pcibios_scan_all_fns(a, b) 0
15
16/*
17 * Return whether the given PCI device DMA address mask can
18 * be supported properly. For example, if your device can
19 * only drive the low 24-bits during PCI bus mastering, then
20 * you would pass 0x00ffffff as the mask to this function.
21 */
22static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
23{
24 return 1;
25}
26
27/*
28 * Not supporting more than 32-bit PCI bus addresses now, but
29 * must satisfy references to this function. Change if needed.
30 */
31#define pci_dac_dma_supported(pci_dev, mask) (0)
32
33static inline void pcibios_add_platform_entries(struct pci_dev *dev)
34{
35}
36
37#endif /* CONFIG_COMEMPCI */
38
39#endif /* M68KNOMMU_PCI_H */
diff --git a/include/asm-m68knommu/percpu.h b/include/asm-m68knommu/percpu.h
new file mode 100644
index 000000000000..5de72c327efd
--- /dev/null
+++ b/include/asm-m68knommu/percpu.h
@@ -0,0 +1,6 @@
1#ifndef __ARCH_M68KNOMMU_PERCPU__
2#define __ARCH_M68KNOMMU_PERCPU__
3
4#include <asm-generic/percpu.h>
5
6#endif /* __ARCH_M68KNOMMU_PERCPU__ */
diff --git a/include/asm-m68knommu/pgalloc.h b/include/asm-m68knommu/pgalloc.h
new file mode 100644
index 000000000000..d6352f671ec0
--- /dev/null
+++ b/include/asm-m68knommu/pgalloc.h
@@ -0,0 +1,8 @@
1#ifndef _M68KNOMMU_PGALLOC_H
2#define _M68KNOMMU_PGALLOC_H
3
4#include <asm/setup.h>
5
6#define check_pgt_cache() do { } while (0)
7
8#endif /* _M68KNOMMU_PGALLOC_H */
diff --git a/include/asm-m68knommu/pgtable.h b/include/asm-m68knommu/pgtable.h
new file mode 100644
index 000000000000..e2a69fffa370
--- /dev/null
+++ b/include/asm-m68knommu/pgtable.h
@@ -0,0 +1,76 @@
1#ifndef _M68KNOMMU_PGTABLE_H
2#define _M68KNOMMU_PGTABLE_H
3
4#include <asm-generic/4level-fixup.h>
5
6/*
7 * (C) Copyright 2000-2002, Greg Ungerer <gerg@snapgear.com>
8 */
9
10#include <linux/config.h>
11#include <linux/slab.h>
12#include <asm/processor.h>
13#include <asm/page.h>
14#include <asm/io.h>
15
16/*
17 * Trivial page table functions.
18 */
19#define pgd_present(pgd) (1)
20#define pgd_none(pgd) (0)
21#define pgd_bad(pgd) (0)
22#define pgd_clear(pgdp)
23#define kern_addr_valid(addr) (1)
24#define pmd_offset(a, b) ((void *)0)
25
26#define PAGE_NONE __pgprot(0)
27#define PAGE_SHARED __pgprot(0)
28#define PAGE_COPY __pgprot(0)
29#define PAGE_READONLY __pgprot(0)
30#define PAGE_KERNEL __pgprot(0)
31
32extern void paging_init(void);
33#define swapper_pg_dir ((pgd_t *) 0)
34
35#define __swp_type(x) (0)
36#define __swp_offset(x) (0)
37#define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) })
38#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
39#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
40
41static inline int pte_file(pte_t pte) { return 0; }
42
43/*
44 * ZERO_PAGE is a global shared page that is always zero: used
45 * for zero-mapped memory areas etc..
46 */
47#define ZERO_PAGE(vaddr) (virt_to_page(0))
48
49/*
50 * These would be in other places but having them here reduces the diffs.
51 */
52extern unsigned int kobjsize(const void *objp);
53extern int is_in_rom(unsigned long);
54
55/*
56 * No page table caches to initialise.
57 */
58#define pgtable_cache_init() do { } while (0)
59#define io_remap_page_range(vma, vaddr, paddr, size, prot) \
60 remap_pfn_range(vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot)
61
62#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
63 remap_pfn_range(vma, vaddr, pfn, size, prot)
64
65#define MK_IOSPACE_PFN(space, pfn) (pfn)
66#define GET_IOSPACE(pfn) 0
67#define GET_PFN(pfn) (pfn)
68
69/*
70 * All 32bit addresses are effectively valid for vmalloc...
71 * Sort of meaningless for non-VM targets.
72 */
73#define VMALLOC_START 0
74#define VMALLOC_END 0xffffffff
75
76#endif /* _M68KNOMMU_PGTABLE_H */
diff --git a/include/asm-m68knommu/poll.h b/include/asm-m68knommu/poll.h
new file mode 100644
index 000000000000..ee1b6cb549ca
--- /dev/null
+++ b/include/asm-m68knommu/poll.h
@@ -0,0 +1 @@
#include <asm-m68k/poll.h>
diff --git a/include/asm-m68knommu/posix_types.h b/include/asm-m68knommu/posix_types.h
new file mode 100644
index 000000000000..6205fb9392a3
--- /dev/null
+++ b/include/asm-m68knommu/posix_types.h
@@ -0,0 +1 @@
#include <asm-m68k/posix_types.h>
diff --git a/include/asm-m68knommu/processor.h b/include/asm-m68knommu/processor.h
new file mode 100644
index 000000000000..85a054e758b1
--- /dev/null
+++ b/include/asm-m68knommu/processor.h
@@ -0,0 +1,131 @@
1/*
2 * include/asm-m68k/processor.h
3 *
4 * Copyright (C) 1995 Hamish Macdonald
5 */
6
7#ifndef __ASM_M68K_PROCESSOR_H
8#define __ASM_M68K_PROCESSOR_H
9
10/*
11 * Default implementation of macro that returns current
12 * instruction pointer ("program counter").
13 */
14#define current_text_addr() ({ __label__ _l; _l: &&_l;})
15
16#include <linux/config.h>
17#include <linux/threads.h>
18#include <asm/types.h>
19#include <asm/segment.h>
20#include <asm/fpu.h>
21#include <asm/ptrace.h>
22#include <asm/current.h>
23
24extern inline unsigned long rdusp(void)
25{
26#ifdef CONFIG_COLDFIRE
27 extern unsigned int sw_usp;
28 return(sw_usp);
29#else
30 unsigned long usp;
31 __asm__ __volatile__("move %/usp,%0" : "=a" (usp));
32 return usp;
33#endif
34}
35
36extern inline void wrusp(unsigned long usp)
37{
38#ifdef CONFIG_COLDFIRE
39 extern unsigned int sw_usp;
40 sw_usp = usp;
41#else
42 __asm__ __volatile__("move %0,%/usp" : : "a" (usp));
43#endif
44}
45
46/*
47 * User space process size: 3.75GB. This is hardcoded into a few places,
48 * so don't change it unless you know what you are doing.
49 */
50#define TASK_SIZE (0xF0000000UL)
51
52/*
53 * This decides where the kernel will search for a free chunk of vm
54 * space during mmap's. We won't be using it
55 */
56#define TASK_UNMAPPED_BASE 0
57
58/*
59 * if you change this structure, you must change the code and offsets
60 * in m68k/machasm.S
61 */
62
63struct thread_struct {
64 unsigned long ksp; /* kernel stack pointer */
65 unsigned long usp; /* user stack pointer */
66 unsigned short sr; /* saved status register */
67 unsigned short fs; /* saved fs (sfc, dfc) */
68 unsigned long crp[2]; /* cpu root pointer */
69 unsigned long esp0; /* points to SR of stack frame */
70 unsigned long fp[8*3];
71 unsigned long fpcntl[3]; /* fp control regs */
72 unsigned char fpstate[FPSTATESIZE]; /* floating point state */
73};
74
75#define INIT_THREAD { \
76 sizeof(init_stack) + (unsigned long) init_stack, 0, \
77 PS_S, __KERNEL_DS, \
78 {0, 0}, 0, {0,}, {0, 0, 0}, {0,}, \
79}
80
81/*
82 * Do necessary setup to start up a newly executed thread.
83 *
84 * pass the data segment into user programs if it exists,
85 * it can't hurt anything as far as I can tell
86 */
87#define start_thread(_regs, _pc, _usp) \
88do { \
89 set_fs(USER_DS); /* reads from user space */ \
90 (_regs)->pc = (_pc); \
91 if (current->mm) \
92 (_regs)->d5 = current->mm->start_data; \
93 (_regs)->sr &= ~0x2000; \
94 wrusp(_usp); \
95} while(0)
96
97/* Forward declaration, a strange C thing */
98struct task_struct;
99
100/* Free all resources held by a thread. */
101static inline void release_thread(struct task_struct *dead_task)
102{
103}
104
105/* Prepare to copy thread state - unlazy all lazy status */
106#define prepare_to_copy(tsk) do { } while (0)
107
108extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
109
110/*
111 * Free current thread data structures etc..
112 */
113static inline void exit_thread(void)
114{
115}
116
117unsigned long thread_saved_pc(struct task_struct *tsk);
118unsigned long get_wchan(struct task_struct *p);
119
120#define KSTK_EIP(tsk) \
121 ({ \
122 unsigned long eip = 0; \
123 if ((tsk)->thread.esp0 > PAGE_SIZE && \
124 (virt_addr_valid((tsk)->thread.esp0))) \
125 eip = ((struct pt_regs *) (tsk)->thread.esp0)->pc; \
126 eip; })
127#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
128
129#define cpu_relax() do { } while (0)
130
131#endif
diff --git a/include/asm-m68knommu/ptrace.h b/include/asm-m68knommu/ptrace.h
new file mode 100644
index 000000000000..f65bd90749e6
--- /dev/null
+++ b/include/asm-m68knommu/ptrace.h
@@ -0,0 +1,91 @@
1#ifndef _M68K_PTRACE_H
2#define _M68K_PTRACE_H
3
4#define PT_D1 0
5#define PT_D2 1
6#define PT_D3 2
7#define PT_D4 3
8#define PT_D5 4
9#define PT_D6 5
10#define PT_D7 6
11#define PT_A0 7
12#define PT_A1 8
13#define PT_A2 9
14#define PT_A3 10
15#define PT_A4 11
16#define PT_A5 12
17#define PT_A6 13
18#define PT_D0 14
19#define PT_USP 15
20#define PT_ORIG_D0 16
21#define PT_SR 17
22#define PT_PC 18
23
24#ifndef __ASSEMBLY__
25
26/* this struct defines the way the registers are stored on the
27 stack during a system call. */
28
29struct pt_regs {
30 long d1;
31 long d2;
32 long d3;
33 long d4;
34 long d5;
35 long a0;
36 long a1;
37 long a2;
38 long d0;
39 long orig_d0;
40 long stkadj;
41#ifdef CONFIG_COLDFIRE
42 unsigned format : 4; /* frame format specifier */
43 unsigned vector : 12; /* vector offset */
44 unsigned short sr;
45 unsigned long pc;
46#else
47 unsigned short sr;
48 unsigned long pc;
49#ifndef NO_FORMAT_VEC
50 unsigned format : 4; /* frame format specifier */
51 unsigned vector : 12; /* vector offset */
52#endif
53#endif
54};
55
56/*
57 * This is the extended stack used by signal handlers and the context
58 * switcher: it's pushed after the normal "struct pt_regs".
59 */
60struct switch_stack {
61 unsigned long d6;
62 unsigned long d7;
63 unsigned long a3;
64 unsigned long a4;
65 unsigned long a5;
66 unsigned long a6;
67 unsigned long retpc;
68};
69
70/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
71#define PTRACE_GETREGS 12
72#define PTRACE_SETREGS 13
73#ifdef COFNIG_FPU
74#define PTRACE_GETFPREGS 14
75#define PTRACE_SETFPREGS 15
76#endif
77
78#ifdef __KERNEL__
79
80#ifndef PS_S
81#define PS_S (0x2000)
82#define PS_M (0x1000)
83#endif
84
85#define user_mode(regs) (!((regs)->sr & PS_S))
86#define instruction_pointer(regs) ((regs)->pc)
87#define profile_pc(regs) instruction_pointer(regs)
88extern void show_regs(struct pt_regs *);
89#endif /* __KERNEL__ */
90#endif /* __ASSEMBLY__ */
91#endif /* _M68K_PTRACE_H */
diff --git a/include/asm-m68knommu/quicc_simple.h b/include/asm-m68knommu/quicc_simple.h
new file mode 100644
index 000000000000..c3636932d4bc
--- /dev/null
+++ b/include/asm-m68knommu/quicc_simple.h
@@ -0,0 +1,52 @@
1/***********************************
2 * $Id: quicc_simple.h,v 1.1 2002/03/02 15:01:10 gerg Exp $
3 ***********************************
4 *
5 ***************************************
6 * Simple drivers common header
7 ***************************************
8 */
9
10#ifndef __SIMPLE_H
11#define __SIMPLE_H
12
13/* #include "quicc.h" */
14
15#define GLB_SCC_0 0
16#define GLB_SCC_1 1
17#define GLB_SCC_2 2
18#define GLB_SCC_3 3
19
20typedef void (int_routine)(unsigned short interrupt_event);
21typedef int_routine *int_routine_ptr;
22typedef void *(alloc_routine)(int length);
23typedef void (free_routine)(int scc_num, int channel_num, void *buf);
24typedef void (store_rx_buffer_routine)(int scc_num, int channel_num, void *buff, int length);
25typedef int (handle_tx_error_routine)(int scc_num, int channel_num, QUICC_BD *tbd);
26typedef void (handle_rx_error_routine)(int scc_num, int channel_num, QUICC_BD *rbd);
27typedef void (handle_lost_error_routine)(int scc_num, int channel_num);
28
29/* user defined functions for global errors */
30typedef void (handle_glob_overrun_routine)(int scc_number);
31typedef void (handle_glob_underrun_routine)(int scc_number);
32typedef void (glob_intr_q_overflow_routine)(int scc_number);
33
34/*
35 * General initialization and command routines
36 */
37void quicc_issue_cmd (unsigned short cmd, int scc_num);
38void quicc_init(void);
39void quicc_scc_init(int scc_number, int number_of_rx_buf, int number_of_tx_buf);
40void quicc_smc_init(int smc_number, int number_of_rx_buf, int number_of_tx_buf);
41void quicc_scc_start(int scc_num);
42void quicc_scc_loopback(int scc_num);
43
44/* Interrupt enable/disable routines for critical pieces of code*/
45unsigned short IntrDis(void);
46void IntrEna(unsigned short old_sr);
47
48/* For debugging */
49void print_rbd(int scc_num);
50void print_tbd(int scc_num);
51
52#endif
diff --git a/include/asm-m68knommu/resource.h b/include/asm-m68knommu/resource.h
new file mode 100644
index 000000000000..7fa63d5ea576
--- /dev/null
+++ b/include/asm-m68knommu/resource.h
@@ -0,0 +1 @@
#include <asm-m68k/resource.h>
diff --git a/include/asm-m68knommu/scatterlist.h b/include/asm-m68knommu/scatterlist.h
new file mode 100644
index 000000000000..230b8d56d17f
--- /dev/null
+++ b/include/asm-m68knommu/scatterlist.h
@@ -0,0 +1,13 @@
1#ifndef _M68KNOMMU_SCATTERLIST_H
2#define _M68KNOMMU_SCATTERLIST_H
3
4struct scatterlist {
5 struct page *page;
6 unsigned int offset;
7 dma_addr_t dma_address;
8 unsigned int length;
9};
10
11#define ISA_DMA_THRESHOLD (0xffffffff)
12
13#endif /* !(_M68KNOMMU_SCATTERLIST_H) */
diff --git a/include/asm-m68knommu/sections.h b/include/asm-m68knommu/sections.h
new file mode 100644
index 000000000000..dd0ecb98ec08
--- /dev/null
+++ b/include/asm-m68knommu/sections.h
@@ -0,0 +1,7 @@
1#ifndef _M68KNOMMU_SECTIONS_H
2#define _M68KNOMMU_SECTIONS_H
3
4/* nothing to see, move along */
5#include <asm-generic/sections.h>
6
7#endif
diff --git a/include/asm-m68knommu/segment.h b/include/asm-m68knommu/segment.h
new file mode 100644
index 000000000000..42318ebec7ec
--- /dev/null
+++ b/include/asm-m68knommu/segment.h
@@ -0,0 +1,51 @@
1#ifndef _M68K_SEGMENT_H
2#define _M68K_SEGMENT_H
3
4/* define constants */
5/* Address spaces (FC0-FC2) */
6#define USER_DATA (1)
7#ifndef __USER_DS
8#define __USER_DS (USER_DATA)
9#endif
10#define USER_PROGRAM (2)
11#define SUPER_DATA (5)
12#ifndef __KERNEL_DS
13#define __KERNEL_DS (SUPER_DATA)
14#endif
15#define SUPER_PROGRAM (6)
16#define CPU_SPACE (7)
17
18#ifndef __ASSEMBLY__
19
20typedef struct {
21 unsigned long seg;
22} mm_segment_t;
23
24#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
25#define USER_DS MAKE_MM_SEG(__USER_DS)
26#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
27
28/*
29 * Get/set the SFC/DFC registers for MOVES instructions
30 */
31
32static inline mm_segment_t get_fs(void)
33{
34 return USER_DS;
35}
36
37static inline mm_segment_t get_ds(void)
38{
39 /* return the supervisor data space code */
40 return KERNEL_DS;
41}
42
43static inline void set_fs(mm_segment_t val)
44{
45}
46
47#define segment_eq(a,b) ((a).seg == (b).seg)
48
49#endif /* __ASSEMBLY__ */
50
51#endif /* _M68K_SEGMENT_H */
diff --git a/include/asm-m68knommu/semaphore-helper.h b/include/asm-m68knommu/semaphore-helper.h
new file mode 100644
index 000000000000..a6586417c1c2
--- /dev/null
+++ b/include/asm-m68knommu/semaphore-helper.h
@@ -0,0 +1,83 @@
1#ifndef _M68K_SEMAPHORE_HELPER_H
2#define _M68K_SEMAPHORE_HELPER_H
3
4/*
5 * SMP- and interrupt-safe semaphores helper functions.
6 *
7 * (C) Copyright 1996 Linus Torvalds
8 *
9 * m68k version by Andreas Schwab
10 */
11
12#include <linux/config.h>
13
14/*
15 * These two _must_ execute atomically wrt each other.
16 */
17static inline void wake_one_more(struct semaphore * sem)
18{
19 atomic_inc(&sem->waking);
20}
21
22static inline int waking_non_zero(struct semaphore *sem)
23{
24 int ret;
25 unsigned long flags;
26
27 spin_lock_irqsave(&semaphore_wake_lock, flags);
28 ret = 0;
29 if (atomic_read(&sem->waking) > 0) {
30 atomic_dec(&sem->waking);
31 ret = 1;
32 }
33 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
34 return ret;
35}
36
37/*
38 * waking_non_zero_interruptible:
39 * 1 got the lock
40 * 0 go to sleep
41 * -EINTR interrupted
42 */
43static inline int waking_non_zero_interruptible(struct semaphore *sem,
44 struct task_struct *tsk)
45{
46 int ret;
47 unsigned long flags;
48
49 spin_lock_irqsave(&semaphore_wake_lock, flags);
50 ret = 0;
51 if (atomic_read(&sem->waking) > 0) {
52 atomic_dec(&sem->waking);
53 ret = 1;
54 } else if (signal_pending(tsk)) {
55 atomic_inc(&sem->count);
56 ret = -EINTR;
57 }
58 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
59 return ret;
60}
61
62/*
63 * waking_non_zero_trylock:
64 * 1 failed to lock
65 * 0 got the lock
66 */
67static inline int waking_non_zero_trylock(struct semaphore *sem)
68{
69 int ret;
70 unsigned long flags;
71
72 spin_lock_irqsave(&semaphore_wake_lock, flags);
73 ret = 1;
74 if (atomic_read(&sem->waking) > 0) {
75 atomic_dec(&sem->waking);
76 ret = 0;
77 } else
78 atomic_inc(&sem->count);
79 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
80 return ret;
81}
82
83#endif
diff --git a/include/asm-m68knommu/semaphore.h b/include/asm-m68knommu/semaphore.h
new file mode 100644
index 000000000000..febe85add509
--- /dev/null
+++ b/include/asm-m68knommu/semaphore.h
@@ -0,0 +1,157 @@
1#ifndef _M68K_SEMAPHORE_H
2#define _M68K_SEMAPHORE_H
3
4#define RW_LOCK_BIAS 0x01000000
5
6#ifndef __ASSEMBLY__
7
8#include <linux/linkage.h>
9#include <linux/wait.h>
10#include <linux/spinlock.h>
11#include <linux/rwsem.h>
12
13#include <asm/system.h>
14#include <asm/atomic.h>
15
16/*
17 * Interrupt-safe semaphores..
18 *
19 * (C) Copyright 1996 Linus Torvalds
20 *
21 * m68k version by Andreas Schwab
22 */
23
24
25struct semaphore {
26 atomic_t count;
27 atomic_t waking;
28 wait_queue_head_t wait;
29};
30
31#define __SEMAPHORE_INITIALIZER(name, n) \
32{ \
33 .count = ATOMIC_INIT(n), \
34 .waking = ATOMIC_INIT(0), \
35 .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
36}
37
38#define __MUTEX_INITIALIZER(name) \
39 __SEMAPHORE_INITIALIZER(name,1)
40
41#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
42 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
43
44#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
45#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
46
47extern inline void sema_init (struct semaphore *sem, int val)
48{
49 *sem = (struct semaphore)__SEMAPHORE_INITIALIZER(*sem, val);
50}
51
52static inline void init_MUTEX (struct semaphore *sem)
53{
54 sema_init(sem, 1);
55}
56
57static inline void init_MUTEX_LOCKED (struct semaphore *sem)
58{
59 sema_init(sem, 0);
60}
61
62asmlinkage void __down_failed(void /* special register calling convention */);
63asmlinkage int __down_failed_interruptible(void /* params in registers */);
64asmlinkage int __down_failed_trylock(void /* params in registers */);
65asmlinkage void __up_wakeup(void /* special register calling convention */);
66
67asmlinkage void __down(struct semaphore * sem);
68asmlinkage int __down_interruptible(struct semaphore * sem);
69asmlinkage int __down_trylock(struct semaphore * sem);
70asmlinkage void __up(struct semaphore * sem);
71
72extern spinlock_t semaphore_wake_lock;
73
74/*
75 * This is ugly, but we want the default case to fall through.
76 * "down_failed" is a special asm handler that calls the C
77 * routine that actually waits. See arch/m68k/lib/semaphore.S
78 */
79extern inline void down(struct semaphore * sem)
80{
81 might_sleep();
82 __asm__ __volatile__(
83 "| atomic down operation\n\t"
84 "movel %0, %%a1\n\t"
85 "lea %%pc@(1f), %%a0\n\t"
86 "subql #1, %%a1@\n\t"
87 "jmi __down_failed\n"
88 "1:"
89 : /* no outputs */
90 : "g" (sem)
91 : "cc", "%a0", "%a1", "memory");
92}
93
94extern inline int down_interruptible(struct semaphore * sem)
95{
96 int ret;
97
98 might_sleep();
99 __asm__ __volatile__(
100 "| atomic down operation\n\t"
101 "movel %1, %%a1\n\t"
102 "lea %%pc@(1f), %%a0\n\t"
103 "subql #1, %%a1@\n\t"
104 "jmi __down_failed_interruptible\n\t"
105 "clrl %%d0\n"
106 "1: movel %%d0, %0\n"
107 : "=d" (ret)
108 : "g" (sem)
109 : "cc", "%d0", "%a0", "%a1", "memory");
110 return(ret);
111}
112
113extern inline int down_trylock(struct semaphore * sem)
114{
115 register struct semaphore *sem1 __asm__ ("%a1") = sem;
116 register int result __asm__ ("%d0");
117
118 __asm__ __volatile__(
119 "| atomic down trylock operation\n\t"
120 "subql #1,%1@\n\t"
121 "jmi 2f\n\t"
122 "clrl %0\n"
123 "1:\n"
124 ".section .text.lock,\"ax\"\n"
125 ".even\n"
126 "2:\tpea 1b\n\t"
127 "jbra __down_failed_trylock\n"
128 ".previous"
129 : "=d" (result)
130 : "a" (sem1)
131 : "memory");
132 return result;
133}
134
135/*
136 * Note! This is subtle. We jump to wake people up only if
137 * the semaphore was negative (== somebody was waiting on it).
138 * The default case (no contention) will result in NO
139 * jumps for both down() and up().
140 */
141extern inline void up(struct semaphore * sem)
142{
143 __asm__ __volatile__(
144 "| atomic up operation\n\t"
145 "movel %0, %%a1\n\t"
146 "lea %%pc@(1f), %%a0\n\t"
147 "addql #1, %%a1@\n\t"
148 "jle __up_wakeup\n"
149 "1:"
150 : /* no outputs */
151 : "g" (sem)
152 : "cc", "%a0", "%a1", "memory");
153}
154
155#endif /* __ASSEMBLY__ */
156
157#endif
diff --git a/include/asm-m68knommu/sembuf.h b/include/asm-m68knommu/sembuf.h
new file mode 100644
index 000000000000..3a634f9ecf50
--- /dev/null
+++ b/include/asm-m68knommu/sembuf.h
@@ -0,0 +1 @@
#include <asm-m68k/sembuf.h>
diff --git a/include/asm-m68knommu/setup.h b/include/asm-m68knommu/setup.h
new file mode 100644
index 000000000000..d2b0fcce41b2
--- /dev/null
+++ b/include/asm-m68knommu/setup.h
@@ -0,0 +1,5 @@
1#include <asm-m68k/setup.h>
2
3/* We have a bigger command line buffer. */
4#undef COMMAND_LINE_SIZE
5#define COMMAND_LINE_SIZE 512
diff --git a/include/asm-m68knommu/shm.h b/include/asm-m68knommu/shm.h
new file mode 100644
index 000000000000..cc8e522d9050
--- /dev/null
+++ b/include/asm-m68knommu/shm.h
@@ -0,0 +1 @@
#include <asm-m68k/shm.h>
diff --git a/include/asm-m68knommu/shmbuf.h b/include/asm-m68knommu/shmbuf.h
new file mode 100644
index 000000000000..bc34cf8eefce
--- /dev/null
+++ b/include/asm-m68knommu/shmbuf.h
@@ -0,0 +1 @@
#include <asm-m68k/shmbuf.h>
diff --git a/include/asm-m68knommu/shmparam.h b/include/asm-m68knommu/shmparam.h
new file mode 100644
index 000000000000..d7ee69648ebf
--- /dev/null
+++ b/include/asm-m68knommu/shmparam.h
@@ -0,0 +1 @@
#include <asm-m68k/shmparam.h>
diff --git a/include/asm-m68knommu/sigcontext.h b/include/asm-m68knommu/sigcontext.h
new file mode 100644
index 000000000000..84bf36dc7a83
--- /dev/null
+++ b/include/asm-m68knommu/sigcontext.h
@@ -0,0 +1,16 @@
1#ifndef _ASM_M68KNOMMU_SIGCONTEXT_H
2#define _ASM_M68KNOMMU_SIGCONTEXT_H
3
4struct sigcontext {
5 unsigned long sc_mask; /* old sigmask */
6 unsigned long sc_usp; /* old user stack pointer */
7 unsigned long sc_d0;
8 unsigned long sc_d1;
9 unsigned long sc_a0;
10 unsigned long sc_a1;
11 unsigned short sc_sr;
12 unsigned long sc_pc;
13 unsigned short sc_formatvec;
14};
15
16#endif
diff --git a/include/asm-m68knommu/siginfo.h b/include/asm-m68knommu/siginfo.h
new file mode 100644
index 000000000000..b18e5f4064ae
--- /dev/null
+++ b/include/asm-m68knommu/siginfo.h
@@ -0,0 +1,6 @@
1#ifndef _M68KNOMMU_SIGINFO_H
2#define _M68KNOMMU_SIGINFO_H
3
4#include <asm-generic/siginfo.h>
5
6#endif
diff --git a/include/asm-m68knommu/signal.h b/include/asm-m68knommu/signal.h
new file mode 100644
index 000000000000..486cbb0dc088
--- /dev/null
+++ b/include/asm-m68knommu/signal.h
@@ -0,0 +1,183 @@
1#ifndef _M68KNOMMU_SIGNAL_H
2#define _M68KNOMMU_SIGNAL_H
3
4#include <linux/types.h>
5
6/* Avoid too many header ordering problems. */
7struct siginfo;
8
9#ifdef __KERNEL__
10/* Most things should be clean enough to redefine this at will, if care
11 is taken to make libc match. */
12
13#define _NSIG 64
14#define _NSIG_BPW 32
15#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
16
17typedef unsigned long old_sigset_t; /* at least 32 bits */
18
19typedef struct {
20 unsigned long sig[_NSIG_WORDS];
21} sigset_t;
22
23#else
24/* Here we must cater to libcs that poke about in kernel headers. */
25
26#define NSIG 32
27typedef unsigned long sigset_t;
28
29#endif /* __KERNEL__ */
30
31#define SIGHUP 1
32#define SIGINT 2
33#define SIGQUIT 3
34#define SIGILL 4
35#define SIGTRAP 5
36#define SIGABRT 6
37#define SIGIOT 6
38#define SIGBUS 7
39#define SIGFPE 8
40#define SIGKILL 9
41#define SIGUSR1 10
42#define SIGSEGV 11
43#define SIGUSR2 12
44#define SIGPIPE 13
45#define SIGALRM 14
46#define SIGTERM 15
47#define SIGSTKFLT 16
48#define SIGCHLD 17
49#define SIGCONT 18
50#define SIGSTOP 19
51#define SIGTSTP 20
52#define SIGTTIN 21
53#define SIGTTOU 22
54#define SIGURG 23
55#define SIGXCPU 24
56#define SIGXFSZ 25
57#define SIGVTALRM 26
58#define SIGPROF 27
59#define SIGWINCH 28
60#define SIGIO 29
61#define SIGPOLL SIGIO
62/*
63#define SIGLOST 29
64*/
65#define SIGPWR 30
66#define SIGSYS 31
67#define SIGUNUSED 31
68
69/* These should not be considered constants from userland. */
70#define SIGRTMIN 32
71#define SIGRTMAX _NSIG
72
73/*
74 * SA_FLAGS values:
75 *
76 * SA_ONSTACK indicates that a registered stack_t will be used.
77 * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
78 * SA_RESTART flag to get restarting signals (which were the default long ago)
79 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
80 * SA_RESETHAND clears the handler when the signal is delivered.
81 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
82 * SA_NODEFER prevents the current signal from being masked in the handler.
83 *
84 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
85 * Unix names RESETHAND and NODEFER respectively.
86 */
87#define SA_NOCLDSTOP 0x00000001
88#define SA_NOCLDWAIT 0x00000002
89#define SA_SIGINFO 0x00000004
90#define SA_ONSTACK 0x08000000
91#define SA_RESTART 0x10000000
92#define SA_NODEFER 0x40000000
93#define SA_RESETHAND 0x80000000
94
95#define SA_NOMASK SA_NODEFER
96#define SA_ONESHOT SA_RESETHAND
97#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
98
99/*
100 * sigaltstack controls
101 */
102#define SS_ONSTACK 1
103#define SS_DISABLE 2
104
105#define MINSIGSTKSZ 2048
106#define SIGSTKSZ 8192
107
108#ifdef __KERNEL__
109/*
110 * These values of sa_flags are used only by the kernel as part of the
111 * irq handling routines.
112 *
113 * SA_INTERRUPT is also used by the irq handling routines.
114 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
115 */
116#define SA_PROBE SA_ONESHOT
117#define SA_SAMPLE_RANDOM SA_RESTART
118#define SA_SHIRQ 0x04000000
119#endif
120
121#define SIG_BLOCK 0 /* for blocking signals */
122#define SIG_UNBLOCK 1 /* for unblocking signals */
123#define SIG_SETMASK 2 /* for setting the signal mask */
124
125/* Type of a signal handler. */
126typedef void (*__sighandler_t)(int);
127
128#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
129#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
130#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
131
132#ifdef __KERNEL__
133struct old_sigaction {
134 __sighandler_t sa_handler;
135 old_sigset_t sa_mask;
136 unsigned long sa_flags;
137 void (*sa_restorer)(void);
138};
139
140struct sigaction {
141 __sighandler_t sa_handler;
142 unsigned long sa_flags;
143 void (*sa_restorer)(void);
144 sigset_t sa_mask; /* mask last for extensibility */
145};
146
147struct k_sigaction {
148 struct sigaction sa;
149};
150#else
151/* Here we must cater to libcs that poke about in kernel headers. */
152
153struct sigaction {
154 union {
155 __sighandler_t _sa_handler;
156 void (*_sa_sigaction)(int, struct siginfo *, void *);
157 } _u;
158 sigset_t sa_mask;
159 unsigned long sa_flags;
160 void (*sa_restorer)(void);
161};
162
163#define sa_handler _u._sa_handler
164#define sa_sigaction _u._sa_sigaction
165
166#endif /* __KERNEL__ */
167
168typedef struct sigaltstack {
169 void *ss_sp;
170 int ss_flags;
171 size_t ss_size;
172} stack_t;
173
174#ifdef __KERNEL__
175
176#include <asm/sigcontext.h>
177#undef __HAVE_ARCH_SIG_BITOPS
178
179#define ptrace_signal_deliver(regs, cookie) do { } while (0)
180
181#endif /* __KERNEL__ */
182
183#endif /* _M68KNOMMU_SIGNAL_H */
diff --git a/include/asm-m68knommu/smp.h b/include/asm-m68knommu/smp.h
new file mode 100644
index 000000000000..9e9bd7e58922
--- /dev/null
+++ b/include/asm-m68knommu/smp.h
@@ -0,0 +1 @@
/* nothing required here yet */
diff --git a/include/asm-m68knommu/socket.h b/include/asm-m68knommu/socket.h
new file mode 100644
index 000000000000..ac5478bf6371
--- /dev/null
+++ b/include/asm-m68knommu/socket.h
@@ -0,0 +1 @@
#include <asm-m68k/socket.h>
diff --git a/include/asm-m68knommu/sockios.h b/include/asm-m68knommu/sockios.h
new file mode 100644
index 000000000000..dcc6a8900ce2
--- /dev/null
+++ b/include/asm-m68knommu/sockios.h
@@ -0,0 +1 @@
#include <asm-m68k/sockios.h>
diff --git a/include/asm-m68knommu/spinlock.h b/include/asm-m68knommu/spinlock.h
new file mode 100644
index 000000000000..6bb1f06c4781
--- /dev/null
+++ b/include/asm-m68knommu/spinlock.h
@@ -0,0 +1 @@
#include <asm-m68k/spinlock.h>
diff --git a/include/asm-m68knommu/stat.h b/include/asm-m68knommu/stat.h
new file mode 100644
index 000000000000..3d4b260e7c03
--- /dev/null
+++ b/include/asm-m68knommu/stat.h
@@ -0,0 +1 @@
#include <asm-m68k/stat.h>
diff --git a/include/asm-m68knommu/statfs.h b/include/asm-m68knommu/statfs.h
new file mode 100644
index 000000000000..2ce99eaf0970
--- /dev/null
+++ b/include/asm-m68knommu/statfs.h
@@ -0,0 +1 @@
#include <asm-m68k/statfs.h>
diff --git a/include/asm-m68knommu/string.h b/include/asm-m68knommu/string.h
new file mode 100644
index 000000000000..af09e17000fc
--- /dev/null
+++ b/include/asm-m68knommu/string.h
@@ -0,0 +1,126 @@
1#ifndef _M68KNOMMU_STRING_H_
2#define _M68KNOMMU_STRING_H_
3
4#ifdef __KERNEL__ /* only set these up for kernel code */
5
6#include <asm/setup.h>
7#include <asm/page.h>
8
9#define __HAVE_ARCH_STRCPY
10static inline char * strcpy(char * dest,const char *src)
11{
12 char *xdest = dest;
13
14 __asm__ __volatile__
15 ("1:\tmoveb %1@+,%0@+\n\t"
16 "jne 1b"
17 : "=a" (dest), "=a" (src)
18 : "0" (dest), "1" (src) : "memory");
19 return xdest;
20}
21
22#define __HAVE_ARCH_STRNCPY
23static inline char * strncpy(char *dest, const char *src, size_t n)
24{
25 char *xdest = dest;
26
27 if (n == 0)
28 return xdest;
29
30 __asm__ __volatile__
31 ("1:\tmoveb %1@+,%0@+\n\t"
32 "jeq 2f\n\t"
33 "subql #1,%2\n\t"
34 "jne 1b\n\t"
35 "2:"
36 : "=a" (dest), "=a" (src), "=d" (n)
37 : "0" (dest), "1" (src), "2" (n)
38 : "memory");
39 return xdest;
40}
41
42
43#ifndef CONFIG_COLDFIRE
44
45#define __HAVE_ARCH_STRCMP
46static inline int strcmp(const char * cs,const char * ct)
47{
48 char __res;
49
50 __asm__
51 ("1:\tmoveb %0@+,%2\n\t" /* get *cs */
52 "cmpb %1@+,%2\n\t" /* compare a byte */
53 "jne 2f\n\t" /* not equal, break out */
54 "tstb %2\n\t" /* at end of cs? */
55 "jne 1b\n\t" /* no, keep going */
56 "jra 3f\n\t" /* strings are equal */
57 "2:\tsubb %1@-,%2\n\t" /* *cs - *ct */
58 "3:"
59 : "=a" (cs), "=a" (ct), "=d" (__res)
60 : "0" (cs), "1" (ct));
61
62 return __res;
63}
64
65#define __HAVE_ARCH_STRNCMP
66static inline int strncmp(const char * cs,const char * ct,size_t count)
67{
68 char __res;
69
70 if (!count)
71 return 0;
72 __asm__
73 ("1:\tmovb %0@+,%3\n\t" /* get *cs */
74 "cmpb %1@+,%3\n\t" /* compare a byte */
75 "jne 3f\n\t" /* not equal, break out */
76 "tstb %3\n\t" /* at end of cs? */
77 "jeq 4f\n\t" /* yes, all done */
78 "subql #1,%2\n\t" /* no, adjust count */
79 "jne 1b\n\t" /* more to do, keep going */
80 "2:\tmoveq #0,%3\n\t" /* strings are equal */
81 "jra 4f\n\t"
82 "3:\tsubb %1@-,%3\n\t" /* *cs - *ct */
83 "4:"
84 : "=a" (cs), "=a" (ct), "=d" (count), "=d" (__res)
85 : "0" (cs), "1" (ct), "2" (count));
86 return __res;
87}
88
89#endif /* CONFIG_COLDFIRE */
90
91#define __HAVE_ARCH_MEMSET
92extern void * memset(void * s, int c, size_t count);
93
94#define __HAVE_ARCH_MEMCPY
95extern void * memcpy(void *d, const void *s, size_t count);
96
97#else /* KERNEL */
98
99/*
100 * let user libraries deal with these,
101 * IMHO the kernel has no place defining these functions for user apps
102 */
103
104#define __HAVE_ARCH_STRCPY 1
105#define __HAVE_ARCH_STRNCPY 1
106#define __HAVE_ARCH_STRCAT 1
107#define __HAVE_ARCH_STRNCAT 1
108#define __HAVE_ARCH_STRCMP 1
109#define __HAVE_ARCH_STRNCMP 1
110#define __HAVE_ARCH_STRNICMP 1
111#define __HAVE_ARCH_STRCHR 1
112#define __HAVE_ARCH_STRRCHR 1
113#define __HAVE_ARCH_STRSTR 1
114#define __HAVE_ARCH_STRLEN 1
115#define __HAVE_ARCH_STRNLEN 1
116#define __HAVE_ARCH_MEMSET 1
117#define __HAVE_ARCH_MEMCPY 1
118#define __HAVE_ARCH_MEMMOVE 1
119#define __HAVE_ARCH_MEMSCAN 1
120#define __HAVE_ARCH_MEMCMP 1
121#define __HAVE_ARCH_MEMCHR 1
122#define __HAVE_ARCH_STRTOK 1
123
124#endif /* KERNEL */
125
126#endif /* _M68K_STRING_H_ */
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h
new file mode 100644
index 000000000000..c341b66c147b
--- /dev/null
+++ b/include/asm-m68knommu/system.h
@@ -0,0 +1,286 @@
1#ifndef _M68KNOMMU_SYSTEM_H
2#define _M68KNOMMU_SYSTEM_H
3
4#include <linux/config.h> /* get configuration macros */
5#include <linux/linkage.h>
6#include <asm/segment.h>
7#include <asm/entry.h>
8
9/*
10 * switch_to(n) should switch tasks to task ptr, first checking that
11 * ptr isn't the current task, in which case it does nothing. This
12 * also clears the TS-flag if the task we switched to has used the
13 * math co-processor latest.
14 */
15/*
16 * switch_to() saves the extra registers, that are not saved
17 * automatically by SAVE_SWITCH_STACK in resume(), ie. d0-d5 and
18 * a0-a1. Some of these are used by schedule() and its predecessors
19 * and so we might get see unexpected behaviors when a task returns
20 * with unexpected register values.
21 *
22 * syscall stores these registers itself and none of them are used
23 * by syscall after the function in the syscall has been called.
24 *
25 * Beware that resume now expects *next to be in d1 and the offset of
26 * tss to be in a1. This saves a few instructions as we no longer have
27 * to push them onto the stack and read them back right after.
28 *
29 * 02/17/96 - Jes Sorensen (jds@kom.auc.dk)
30 *
31 * Changed 96/09/19 by Andreas Schwab
32 * pass prev in a0, next in a1, offset of tss in d1, and whether
33 * the mm structures are shared in d2 (to avoid atc flushing).
34 */
35asmlinkage void resume(void);
36#define switch_to(prev,next,last) \
37{ \
38 void *_last; \
39 __asm__ __volatile__( \
40 "movel %1, %%a0\n\t" \
41 "movel %2, %%a1\n\t" \
42 "jbsr resume\n\t" \
43 "movel %%d1, %0\n\t" \
44 : "=d" (_last) \
45 : "d" (prev), "d" (next) \
46 : "cc", "d0", "d1", "d2", "d3", "d4", "d5", "a0", "a1"); \
47 (last) = _last; \
48}
49
50#ifdef CONFIG_COLDFIRE
51#define local_irq_enable() __asm__ __volatile__ ( \
52 "move %/sr,%%d0\n\t" \
53 "andi.l #0xf8ff,%%d0\n\t" \
54 "move %%d0,%/sr\n" \
55 : /* no outputs */ \
56 : \
57 : "cc", "%d0", "memory")
58#define local_irq_disable() __asm__ __volatile__ ( \
59 "move %/sr,%%d0\n\t" \
60 "ori.l #0x0700,%%d0\n\t" \
61 "move %%d0,%/sr\n" \
62 : /* no inputs */ \
63 : \
64 : "cc", "%d0", "memory")
65#else
66
67/* portable version */ /* FIXME - see entry.h*/
68#define ALLOWINT 0xf8ff
69
70#define local_irq_enable() asm volatile ("andiw %0,%%sr": : "i" (ALLOWINT) : "memory")
71#define local_irq_disable() asm volatile ("oriw #0x0700,%%sr": : : "memory")
72#endif
73
74#define local_save_flags(x) asm volatile ("movew %%sr,%0":"=d" (x) : : "memory")
75#define local_irq_restore(x) asm volatile ("movew %0,%%sr": :"d" (x) : "memory")
76
77/* For spinlocks etc */
78#define local_irq_save(x) do { local_save_flags(x); local_irq_disable(); } while (0)
79
80#define irqs_disabled() \
81({ \
82 unsigned long flags; \
83 local_save_flags(flags); \
84 ((flags & 0x0700) == 0x0700); \
85})
86
87#define iret() __asm__ __volatile__ ("rte": : :"memory", "sp", "cc")
88
89/*
90 * Force strict CPU ordering.
91 * Not really required on m68k...
92 */
93#define nop() asm volatile ("nop"::)
94#define mb() asm volatile ("" : : :"memory")
95#define rmb() asm volatile ("" : : :"memory")
96#define wmb() asm volatile ("" : : :"memory")
97#define set_rmb(var, value) do { xchg(&var, value); } while (0)
98#define set_mb(var, value) set_rmb(var, value)
99#define set_wmb(var, value) do { var = value; wmb(); } while (0)
100
101#ifdef CONFIG_SMP
102#define smp_mb() mb()
103#define smp_rmb() rmb()
104#define smp_wmb() wmb()
105#define smp_read_barrier_depends() read_barrier_depends()
106#else
107#define smp_mb() barrier()
108#define smp_rmb() barrier()
109#define smp_wmb() barrier()
110#define smp_read_barrier_depends() do { } while(0)
111#endif
112
113#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
114#define tas(ptr) (xchg((ptr),1))
115
116struct __xchg_dummy { unsigned long a[100]; };
117#define __xg(x) ((volatile struct __xchg_dummy *)(x))
118
119#ifndef CONFIG_RMW_INSNS
120static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
121{
122 unsigned long tmp, flags;
123
124 local_irq_save(flags);
125
126 switch (size) {
127 case 1:
128 __asm__ __volatile__
129 ("moveb %2,%0\n\t"
130 "moveb %1,%2"
131 : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory");
132 break;
133 case 2:
134 __asm__ __volatile__
135 ("movew %2,%0\n\t"
136 "movew %1,%2"
137 : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory");
138 break;
139 case 4:
140 __asm__ __volatile__
141 ("movel %2,%0\n\t"
142 "movel %1,%2"
143 : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory");
144 break;
145 }
146 local_irq_restore(flags);
147 return tmp;
148}
149#else
150static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
151{
152 switch (size) {
153 case 1:
154 __asm__ __volatile__
155 ("moveb %2,%0\n\t"
156 "1:\n\t"
157 "casb %0,%1,%2\n\t"
158 "jne 1b"
159 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory");
160 break;
161 case 2:
162 __asm__ __volatile__
163 ("movew %2,%0\n\t"
164 "1:\n\t"
165 "casw %0,%1,%2\n\t"
166 "jne 1b"
167 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory");
168 break;
169 case 4:
170 __asm__ __volatile__
171 ("movel %2,%0\n\t"
172 "1:\n\t"
173 "casl %0,%1,%2\n\t"
174 "jne 1b"
175 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory");
176 break;
177 }
178 return x;
179}
180#endif
181
182/*
183 * Atomic compare and exchange. Compare OLD with MEM, if identical,
184 * store NEW in MEM. Return the initial value in MEM. Success is
185 * indicated by comparing RETURN with OLD.
186 */
187#define __HAVE_ARCH_CMPXCHG 1
188
189static __inline__ unsigned long
190cmpxchg(volatile int *p, int old, int new)
191{
192 unsigned long flags;
193 int prev;
194
195 local_irq_save(flags);
196 if ((prev = *p) == old)
197 *p = new;
198 local_irq_restore(flags);
199 return(prev);
200}
201
202
203#ifdef CONFIG_M68332
204#define HARD_RESET_NOW() ({ \
205 local_irq_disable(); \
206 asm(" \
207 movew #0x0000, 0xfffa6a; \
208 reset; \
209 /*movew #0x1557, 0xfffa44;*/ \
210 /*movew #0x0155, 0xfffa46;*/ \
211 moveal #0, %a0; \
212 movec %a0, %vbr; \
213 moveal 0, %sp; \
214 moveal 4, %a0; \
215 jmp (%a0); \
216 "); \
217})
218#endif
219
220#if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \
221 defined (CONFIG_M68360) || defined( CONFIG_M68VZ328 )
222#define HARD_RESET_NOW() ({ \
223 local_irq_disable(); \
224 asm(" \
225 moveal #0x10c00000, %a0; \
226 moveb #0, 0xFFFFF300; \
227 moveal 0(%a0), %sp; \
228 moveal 4(%a0), %a0; \
229 jmp (%a0); \
230 "); \
231})
232#endif
233
234#ifdef CONFIG_COLDFIRE
235#if defined(CONFIG_M5272) && defined(CONFIG_NETtel)
236/*
237 * Need to account for broken early mask of 5272 silicon. So don't
238 * jump through the original start address. Jump strait into the
239 * known start of the FLASH code.
240 */
241#define HARD_RESET_NOW() ({ \
242 asm(" \
243 movew #0x2700, %sr; \
244 jmp 0xf0000400; \
245 "); \
246})
247#elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA)
248#define HARD_RESET_NOW() ({ \
249 asm(" \
250 movew #0x2700, %sr; \
251 moveal #0x10000044, %a0; \
252 movel #0xffffffff, (%a0); \
253 moveal #0x10000001, %a0; \
254 moveb #0x00, (%a0); \
255 moveal #0xf0000004, %a0; \
256 moveal (%a0), %a0; \
257 jmp (%a0); \
258 "); \
259})
260#elif defined(CONFIG_M528x)
261/*
262 * The MCF528x has a bit (SOFTRST) in memory (Reset Control Register RCR),
263 * that when set, resets the MCF528x.
264 */
265#define HARD_RESET_NOW() \
266({ \
267 unsigned char volatile *reset; \
268 asm("move.w #0x2700, %sr"); \
269 reset = ((volatile unsigned short *)(MCF_IPSBAR + 0x110000)); \
270 while(1) \
271 *reset |= (0x01 << 7);\
272})
273#else
274#define HARD_RESET_NOW() ({ \
275 asm(" \
276 movew #0x2700, %sr; \
277 moveal #0x4, %a0; \
278 moveal (%a0), %a0; \
279 jmp (%a0); \
280 "); \
281})
282#endif
283#endif
284#define arch_align_stack(x) (x)
285
286#endif /* _M68KNOMMU_SYSTEM_H */
diff --git a/include/asm-m68knommu/termbits.h b/include/asm-m68knommu/termbits.h
new file mode 100644
index 000000000000..05dd6bc27285
--- /dev/null
+++ b/include/asm-m68knommu/termbits.h
@@ -0,0 +1 @@
#include <asm-m68k/termbits.h>
diff --git a/include/asm-m68knommu/termios.h b/include/asm-m68knommu/termios.h
new file mode 100644
index 000000000000..e7337881a985
--- /dev/null
+++ b/include/asm-m68knommu/termios.h
@@ -0,0 +1 @@
#include <asm-m68k/termios.h>
diff --git a/include/asm-m68knommu/thread_info.h b/include/asm-m68knommu/thread_info.h
new file mode 100644
index 000000000000..c8153b7c1f5c
--- /dev/null
+++ b/include/asm-m68knommu/thread_info.h
@@ -0,0 +1,106 @@
1/* thread_info.h: m68knommu low-level thread information
2 * adapted from the i386 and PPC versions by Greg Ungerer (gerg@snapgear.com)
3 *
4 * Copyright (C) 2002 David Howells (dhowells@redhat.com)
5 * - Incorporating suggestions made by Linus Torvalds and Dave Miller
6 */
7
8#ifndef _ASM_THREAD_INFO_H
9#define _ASM_THREAD_INFO_H
10
11#include <asm/page.h>
12
13#ifdef __KERNEL__
14
15#ifndef __ASSEMBLY__
16
17/*
18 * Size of kernel stack for each process. This must be a power of 2...
19 */
20#ifdef CONFIG_4KSTACKS
21#define THREAD_SIZE_ORDER (0)
22#else
23#define THREAD_SIZE_ORDER (1)
24#endif
25
26/*
27 * for asm files, THREAD_SIZE is now generated by asm-offsets.c
28 */
29#define THREAD_SIZE (PAGE_SIZE<<THREAD_SIZE_ORDER)
30
31/*
32 * low level task data.
33 */
34struct thread_info {
35 struct task_struct *task; /* main task structure */
36 struct exec_domain *exec_domain; /* execution domain */
37 unsigned long flags; /* low level flags */
38 int cpu; /* cpu we're on */
39 int preempt_count; /* 0 => preemptable, <0 => BUG*/
40 struct restart_block restart_block;
41};
42
43/*
44 * macros/functions for gaining access to the thread information structure
45 */
46#define INIT_THREAD_INFO(tsk) \
47{ \
48 .task = &tsk, \
49 .exec_domain = &default_exec_domain, \
50 .flags = 0, \
51 .cpu = 0, \
52 .restart_block = { \
53 .fn = do_no_restart_syscall, \
54 }, \
55}
56
57#define init_thread_info (init_thread_union.thread_info)
58#define init_stack (init_thread_union.stack)
59
60
61/* how to get the thread information struct from C */
62static inline struct thread_info *current_thread_info(void)
63{
64 struct thread_info *ti;
65 __asm__(
66 "move.l %%sp, %0 \n\t"
67 "and.l %1, %0"
68 : "=&d"(ti)
69 : "di" (~(THREAD_SIZE-1))
70 );
71 return ti;
72}
73
74/* thread information allocation */
75#define alloc_thread_info(tsk) ((struct thread_info *) \
76 __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER))
77#define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_SIZE_ORDER)
78#define get_thread_info(ti) get_task_struct((ti)->task)
79#define put_thread_info(ti) put_task_struct((ti)->task)
80#endif /* __ASSEMBLY__ */
81
82#define PREEMPT_ACTIVE 0x4000000
83
84/*
85 * thread information flag bit numbers
86 */
87#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
88#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
89#define TIF_SIGPENDING 2 /* signal pending */
90#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
91#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
92 TIF_NEED_RESCHED */
93#define TIF_MEMDIE 5
94
95/* as above, but as bit values */
96#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
97#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
98#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
99#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
100#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
101
102#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
103
104#endif /* __KERNEL__ */
105
106#endif /* _ASM_THREAD_INFO_H */
diff --git a/include/asm-m68knommu/timex.h b/include/asm-m68knommu/timex.h
new file mode 100644
index 000000000000..85069998db52
--- /dev/null
+++ b/include/asm-m68knommu/timex.h
@@ -0,0 +1 @@
#include <asm-m68k/timex.h>
diff --git a/include/asm-m68knommu/tlb.h b/include/asm-m68knommu/tlb.h
new file mode 100644
index 000000000000..77a7c51ca299
--- /dev/null
+++ b/include/asm-m68knommu/tlb.h
@@ -0,0 +1 @@
#include <asm-m68k/tlb.h>
diff --git a/include/asm-m68knommu/tlbflush.h b/include/asm-m68knommu/tlbflush.h
new file mode 100644
index 000000000000..bf7004e1afe0
--- /dev/null
+++ b/include/asm-m68knommu/tlbflush.h
@@ -0,0 +1,61 @@
1#ifndef _M68KNOMMU_TLBFLUSH_H
2#define _M68KNOMMU_TLBFLUSH_H
3
4/*
5 * Copyright (C) 2000 Lineo, David McCullough <davidm@uclinux.org>
6 * Copyright (C) 2000-2002, Greg Ungerer <gerg@snapgear.com>
7 */
8
9#include <asm/setup.h>
10
11/*
12 * flush all user-space atc entries.
13 */
14static inline void __flush_tlb(void)
15{
16 BUG();
17}
18
19static inline void __flush_tlb_one(unsigned long addr)
20{
21 BUG();
22}
23
24#define flush_tlb() __flush_tlb()
25
26/*
27 * flush all atc entries (both kernel and user-space entries).
28 */
29static inline void flush_tlb_all(void)
30{
31 BUG();
32}
33
34static inline void flush_tlb_mm(struct mm_struct *mm)
35{
36 BUG();
37}
38
39static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
40{
41 BUG();
42}
43
44static inline void flush_tlb_range(struct mm_struct *mm,
45 unsigned long start, unsigned long end)
46{
47 BUG();
48}
49
50extern inline void flush_tlb_kernel_page(unsigned long addr)
51{
52 BUG();
53}
54
55extern inline void flush_tlb_pgtables(struct mm_struct *mm,
56 unsigned long start, unsigned long end)
57{
58 BUG();
59}
60
61#endif /* _M68KNOMMU_TLBFLUSH_H */
diff --git a/include/asm-m68knommu/topology.h b/include/asm-m68knommu/topology.h
new file mode 100644
index 000000000000..ca173e9f26ff
--- /dev/null
+++ b/include/asm-m68knommu/topology.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_M68K_TOPOLOGY_H
2#define _ASM_M68K_TOPOLOGY_H
3
4#include <asm-generic/topology.h>
5
6#endif /* _ASM_M68K_TOPOLOGY_H */
diff --git a/include/asm-m68knommu/traps.h b/include/asm-m68knommu/traps.h
new file mode 100644
index 000000000000..f2a81317cc10
--- /dev/null
+++ b/include/asm-m68knommu/traps.h
@@ -0,0 +1,150 @@
1/*
2 * linux/include/asm/traps.h
3 *
4 * Copyright (C) 1993 Hamish Macdonald
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _M68KNOMMU_TRAPS_H
12#define _M68KNOMMU_TRAPS_H
13
14#ifndef __ASSEMBLY__
15
16typedef void (*e_vector)(void);
17
18extern e_vector vectors[];
19
20#endif
21
22#define VEC_BUSERR (2)
23#define VEC_ADDRERR (3)
24#define VEC_ILLEGAL (4)
25#define VEC_ZERODIV (5)
26#define VEC_CHK (6)
27#define VEC_TRAP (7)
28#define VEC_PRIV (8)
29#define VEC_TRACE (9)
30#define VEC_LINE10 (10)
31#define VEC_LINE11 (11)
32#define VEC_RESV1 (12)
33#define VEC_COPROC (13)
34#define VEC_FORMAT (14)
35#define VEC_UNINT (15)
36#define VEC_SPUR (24)
37#define VEC_INT1 (25)
38#define VEC_INT2 (26)
39#define VEC_INT3 (27)
40#define VEC_INT4 (28)
41#define VEC_INT5 (29)
42#define VEC_INT6 (30)
43#define VEC_INT7 (31)
44#define VEC_SYS (32)
45#define VEC_TRAP1 (33)
46#define VEC_TRAP2 (34)
47#define VEC_TRAP3 (35)
48#define VEC_TRAP4 (36)
49#define VEC_TRAP5 (37)
50#define VEC_TRAP6 (38)
51#define VEC_TRAP7 (39)
52#define VEC_TRAP8 (40)
53#define VEC_TRAP9 (41)
54#define VEC_TRAP10 (42)
55#define VEC_TRAP11 (43)
56#define VEC_TRAP12 (44)
57#define VEC_TRAP13 (45)
58#define VEC_TRAP14 (46)
59#define VEC_TRAP15 (47)
60#define VEC_FPBRUC (48)
61#define VEC_FPIR (49)
62#define VEC_FPDIVZ (50)
63#define VEC_FPUNDER (51)
64#define VEC_FPOE (52)
65#define VEC_FPOVER (53)
66#define VEC_FPNAN (54)
67#define VEC_FPUNSUP (55)
68#define VEC_UNIMPEA (60)
69#define VEC_UNIMPII (61)
70#define VEC_USER (64)
71
72#define VECOFF(vec) ((vec)<<2)
73
74#ifndef __ASSEMBLY__
75
76/* Status register bits */
77#define PS_T (0x8000)
78#define PS_S (0x2000)
79#define PS_M (0x1000)
80#define PS_C (0x0001)
81
82/* structure for stack frames */
83
84struct frame {
85 struct pt_regs ptregs;
86 union {
87 struct {
88 unsigned long iaddr; /* instruction address */
89 } fmt2;
90 struct {
91 unsigned long effaddr; /* effective address */
92 } fmt3;
93 struct {
94 unsigned long effaddr; /* effective address */
95 unsigned long pc; /* pc of faulted instr */
96 } fmt4;
97 struct {
98 unsigned long effaddr; /* effective address */
99 unsigned short ssw; /* special status word */
100 unsigned short wb3s; /* write back 3 status */
101 unsigned short wb2s; /* write back 2 status */
102 unsigned short wb1s; /* write back 1 status */
103 unsigned long faddr; /* fault address */
104 unsigned long wb3a; /* write back 3 address */
105 unsigned long wb3d; /* write back 3 data */
106 unsigned long wb2a; /* write back 2 address */
107 unsigned long wb2d; /* write back 2 data */
108 unsigned long wb1a; /* write back 1 address */
109 unsigned long wb1dpd0; /* write back 1 data/push data 0*/
110 unsigned long pd1; /* push data 1*/
111 unsigned long pd2; /* push data 2*/
112 unsigned long pd3; /* push data 3*/
113 } fmt7;
114 struct {
115 unsigned long iaddr; /* instruction address */
116 unsigned short int1[4]; /* internal registers */
117 } fmt9;
118 struct {
119 unsigned short int1;
120 unsigned short ssw; /* special status word */
121 unsigned short isc; /* instruction stage c */
122 unsigned short isb; /* instruction stage b */
123 unsigned long daddr; /* data cycle fault address */
124 unsigned short int2[2];
125 unsigned long dobuf; /* data cycle output buffer */
126 unsigned short int3[2];
127 } fmta;
128 struct {
129 unsigned short int1;
130 unsigned short ssw; /* special status word */
131 unsigned short isc; /* instruction stage c */
132 unsigned short isb; /* instruction stage b */
133 unsigned long daddr; /* data cycle fault address */
134 unsigned short int2[2];
135 unsigned long dobuf; /* data cycle output buffer */
136 unsigned short int3[4];
137 unsigned long baddr; /* stage B address */
138 unsigned short int4[2];
139 unsigned long dibuf; /* data cycle input buffer */
140 unsigned short int5[3];
141 unsigned ver : 4; /* stack frame version # */
142 unsigned int6:12;
143 unsigned short int7[18];
144 } fmtb;
145 } un;
146};
147
148#endif /* __ASSEMBLY__ */
149
150#endif /* _M68KNOMMU_TRAPS_H */
diff --git a/include/asm-m68knommu/types.h b/include/asm-m68knommu/types.h
new file mode 100644
index 000000000000..031238c2d180
--- /dev/null
+++ b/include/asm-m68knommu/types.h
@@ -0,0 +1 @@
#include <asm-m68k/types.h>
diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h
new file mode 100644
index 000000000000..f0be74bb353c
--- /dev/null
+++ b/include/asm-m68knommu/uaccess.h
@@ -0,0 +1,182 @@
1#ifndef __M68KNOMMU_UACCESS_H
2#define __M68KNOMMU_UACCESS_H
3
4/*
5 * User space memory access functions
6 */
7#include <linux/sched.h>
8#include <linux/mm.h>
9#include <linux/string.h>
10
11#include <asm/segment.h>
12
13#define VERIFY_READ 0
14#define VERIFY_WRITE 1
15
16#define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size))
17
18static inline int _access_ok(unsigned long addr, unsigned long size)
19{
20 extern unsigned long memory_start, memory_end;
21
22 return (((addr >= memory_start) && (addr+size < memory_end)) ||
23 (is_in_rom(addr) && is_in_rom(addr+size)));
24}
25
26/* this function will go away soon - use access_ok() instead */
27extern inline int __deprecated verify_area(int type, const void * addr, unsigned long size)
28{
29 return access_ok(type,addr,size)?0:-EFAULT;
30}
31
32/*
33 * The exception table consists of pairs of addresses: the first is the
34 * address of an instruction that is allowed to fault, and the second is
35 * the address at which the program should continue. No registers are
36 * modified, so it is entirely up to the continuation code to figure out
37 * what to do.
38 *
39 * All the routines below use bits of fixup code that are out of line
40 * with the main instruction path. This means when everything is well,
41 * we don't even have to jump over them. Further, they do not intrude
42 * on our cache or tlb entries.
43 */
44
45struct exception_table_entry
46{
47 unsigned long insn, fixup;
48};
49
50/* Returns 0 if exception not found and fixup otherwise. */
51extern unsigned long search_exception_table(unsigned long);
52
53
54/*
55 * These are the main single-value transfer routines. They automatically
56 * use the right size if we just have the right pointer type.
57 */
58
59#define put_user(x, ptr) \
60({ \
61 int __pu_err = 0; \
62 typeof(*(ptr)) __pu_val = (x); \
63 switch (sizeof (*(ptr))) { \
64 case 1: \
65 __put_user_asm(__pu_err, __pu_val, ptr, b); \
66 break; \
67 case 2: \
68 __put_user_asm(__pu_err, __pu_val, ptr, w); \
69 break; \
70 case 4: \
71 __put_user_asm(__pu_err, __pu_val, ptr, l); \
72 break; \
73 case 8: \
74 memcpy(ptr, &__pu_val, sizeof (*(ptr))); \
75 break; \
76 default: \
77 __pu_err = __put_user_bad(); \
78 break; \
79 } \
80 __pu_err; \
81})
82#define __put_user(x, ptr) put_user(x, ptr)
83
84extern int __put_user_bad(void);
85
86/*
87 * Tell gcc we read from memory instead of writing: this is because
88 * we do not write to any memory gcc knows about, so there are no
89 * aliasing issues.
90 */
91
92#define __ptr(x) ((unsigned long *)(x))
93
94#define __put_user_asm(err,x,ptr,bwl) \
95 __asm__ ("move" #bwl " %0,%1" \
96 : /* no outputs */ \
97 :"d" (x),"m" (*__ptr(ptr)) : "memory")
98
99#define get_user(x, ptr) \
100({ \
101 int __gu_err = 0; \
102 typeof(*(ptr)) __gu_val = 0; \
103 switch (sizeof(*(ptr))) { \
104 case 1: \
105 __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \
106 break; \
107 case 2: \
108 __get_user_asm(__gu_err, __gu_val, ptr, w, "=r"); \
109 break; \
110 case 4: \
111 __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \
112 break; \
113 case 8: \
114 memcpy(&__gu_val, ptr, sizeof (*(ptr))); \
115 break; \
116 default: \
117 __gu_val = 0; \
118 __gu_err = __get_user_bad(); \
119 break; \
120 } \
121 (x) = __gu_val; \
122 __gu_err; \
123})
124#define __get_user(x, ptr) get_user(x, ptr)
125
126extern int __get_user_bad(void);
127
128#define __get_user_asm(err,x,ptr,bwl,reg) \
129 __asm__ ("move" #bwl " %1,%0" \
130 : "=d" (x) \
131 : "m" (*__ptr(ptr)))
132
133#define copy_from_user(to, from, n) (memcpy(to, from, n), 0)
134#define copy_to_user(to, from, n) (memcpy(to, from, n), 0)
135
136#define __copy_from_user(to, from, n) copy_from_user(to, from, n)
137#define __copy_to_user(to, from, n) copy_to_user(to, from, n)
138#define __copy_to_user_inatomic __copy_to_user
139#define __copy_from_user_inatomic __copy_from_user
140
141#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; })
142
143#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; })
144
145/*
146 * Copy a null terminated string from userspace.
147 */
148
149static inline long
150strncpy_from_user(char *dst, const char *src, long count)
151{
152 char *tmp;
153 strncpy(dst, src, count);
154 for (tmp = dst; *tmp && count > 0; tmp++, count--)
155 ;
156 return(tmp - dst); /* DAVIDM should we count a NUL ? check getname */
157}
158
159/*
160 * Return the size of a string (including the ending 0)
161 *
162 * Return 0 on exception, a value greater than N if too long
163 */
164static inline long strnlen_user(const char *src, long n)
165{
166 return(strlen(src) + 1); /* DAVIDM make safer */
167}
168
169#define strlen_user(str) strnlen_user(str, 32767)
170
171/*
172 * Zero Userspace
173 */
174
175static inline unsigned long
176clear_user(void *to, unsigned long n)
177{
178 memset(to, 0, n);
179 return 0;
180}
181
182#endif /* _M68KNOMMU_UACCESS_H */
diff --git a/include/asm-m68knommu/ucontext.h b/include/asm-m68knommu/ucontext.h
new file mode 100644
index 000000000000..5d570cedbb02
--- /dev/null
+++ b/include/asm-m68knommu/ucontext.h
@@ -0,0 +1,38 @@
1#ifndef _M68KNOMMU_UCONTEXT_H
2#define _M68KNOMMU_UCONTEXT_H
3
4typedef int greg_t;
5#define NGREG 18
6typedef greg_t gregset_t[NGREG];
7
8#ifdef CONFIG_FPU
9typedef struct fpregset {
10 int f_pcr;
11 int f_psr;
12 int f_fpiaddr;
13 int f_fpregs[8][3];
14} fpregset_t;
15#endif
16
17struct mcontext {
18 int version;
19 gregset_t gregs;
20#ifdef CONFIG_FPU
21 fpregset_t fpregs;
22#endif
23};
24
25#define MCONTEXT_VERSION 2
26
27struct ucontext {
28 unsigned long uc_flags;
29 struct ucontext *uc_link;
30 stack_t uc_stack;
31 struct mcontext uc_mcontext;
32#ifdef CONFIG_FPU
33 unsigned long uc_filler[80];
34#endif
35 sigset_t uc_sigmask; /* mask last for extensibility */
36};
37
38#endif
diff --git a/include/asm-m68knommu/unaligned.h b/include/asm-m68knommu/unaligned.h
new file mode 100644
index 000000000000..8876f034ea64
--- /dev/null
+++ b/include/asm-m68knommu/unaligned.h
@@ -0,0 +1,24 @@
1#ifndef __M68K_UNALIGNED_H
2#define __M68K_UNALIGNED_H
3
4#include <linux/config.h>
5
6#ifdef CONFIG_COLDFIRE
7
8#include <asm-generic/unaligned.h>
9
10#else
11/*
12 * The m68k can do unaligned accesses itself.
13 *
14 * The strange macros are there to make sure these can't
15 * be misused in a way that makes them not work on other
16 * architectures where unaligned accesses aren't as simple.
17 */
18
19#define get_unaligned(ptr) (*(ptr))
20#define put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
21
22#endif
23
24#endif
diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h
new file mode 100644
index 000000000000..84b6fa14459f
--- /dev/null
+++ b/include/asm-m68knommu/unistd.h
@@ -0,0 +1,529 @@
1#ifndef _ASM_M68K_UNISTD_H_
2#define _ASM_M68K_UNISTD_H_
3
4/*
5 * This file contains the system call numbers.
6 */
7
8#define __NR_restart_syscall 0
9#define __NR_exit 1
10#define __NR_fork 2
11#define __NR_read 3
12#define __NR_write 4
13#define __NR_open 5
14#define __NR_close 6
15#define __NR_waitpid 7
16#define __NR_creat 8
17#define __NR_link 9
18#define __NR_unlink 10
19#define __NR_execve 11
20#define __NR_chdir 12
21#define __NR_time 13
22#define __NR_mknod 14
23#define __NR_chmod 15
24#define __NR_chown 16
25#define __NR_break 17
26#define __NR_oldstat 18
27#define __NR_lseek 19
28#define __NR_getpid 20
29#define __NR_mount 21
30#define __NR_umount 22
31#define __NR_setuid 23
32#define __NR_getuid 24
33#define __NR_stime 25
34#define __NR_ptrace 26
35#define __NR_alarm 27
36#define __NR_oldfstat 28
37#define __NR_pause 29
38#define __NR_utime 30
39#define __NR_stty 31
40#define __NR_gtty 32
41#define __NR_access 33
42#define __NR_nice 34
43#define __NR_ftime 35
44#define __NR_sync 36
45#define __NR_kill 37
46#define __NR_rename 38
47#define __NR_mkdir 39
48#define __NR_rmdir 40
49#define __NR_dup 41
50#define __NR_pipe 42
51#define __NR_times 43
52#define __NR_prof 44
53#define __NR_brk 45
54#define __NR_setgid 46
55#define __NR_getgid 47
56#define __NR_signal 48
57#define __NR_geteuid 49
58#define __NR_getegid 50
59#define __NR_acct 51
60#define __NR_umount2 52
61#define __NR_lock 53
62#define __NR_ioctl 54
63#define __NR_fcntl 55
64#define __NR_mpx 56
65#define __NR_setpgid 57
66#define __NR_ulimit 58
67#define __NR_oldolduname 59
68#define __NR_umask 60
69#define __NR_chroot 61
70#define __NR_ustat 62
71#define __NR_dup2 63
72#define __NR_getppid 64
73#define __NR_getpgrp 65
74#define __NR_setsid 66
75#define __NR_sigaction 67
76#define __NR_sgetmask 68
77#define __NR_ssetmask 69
78#define __NR_setreuid 70
79#define __NR_setregid 71
80#define __NR_sigsuspend 72
81#define __NR_sigpending 73
82#define __NR_sethostname 74
83#define __NR_setrlimit 75
84#define __NR_getrlimit 76
85#define __NR_getrusage 77
86#define __NR_gettimeofday 78
87#define __NR_settimeofday 79
88#define __NR_getgroups 80
89#define __NR_setgroups 81
90#define __NR_select 82
91#define __NR_symlink 83
92#define __NR_oldlstat 84
93#define __NR_readlink 85
94#define __NR_uselib 86
95#define __NR_swapon 87
96#define __NR_reboot 88
97#define __NR_readdir 89
98#define __NR_mmap 90
99#define __NR_munmap 91
100#define __NR_truncate 92
101#define __NR_ftruncate 93
102#define __NR_fchmod 94
103#define __NR_fchown 95
104#define __NR_getpriority 96
105#define __NR_setpriority 97
106#define __NR_profil 98
107#define __NR_statfs 99
108#define __NR_fstatfs 100
109#define __NR_ioperm 101
110#define __NR_socketcall 102
111#define __NR_syslog 103
112#define __NR_setitimer 104
113#define __NR_getitimer 105
114#define __NR_stat 106
115#define __NR_lstat 107
116#define __NR_fstat 108
117#define __NR_olduname 109
118#define __NR_iopl /* 110 */ not supported
119#define __NR_vhangup 111
120#define __NR_idle /* 112 */ Obsolete
121#define __NR_vm86 /* 113 */ not supported
122#define __NR_wait4 114
123#define __NR_swapoff 115
124#define __NR_sysinfo 116
125#define __NR_ipc 117
126#define __NR_fsync 118
127#define __NR_sigreturn 119
128#define __NR_clone 120
129#define __NR_setdomainname 121
130#define __NR_uname 122
131#define __NR_cacheflush 123
132#define __NR_adjtimex 124
133#define __NR_mprotect 125
134#define __NR_sigprocmask 126
135#define __NR_create_module 127
136#define __NR_init_module 128
137#define __NR_delete_module 129
138#define __NR_get_kernel_syms 130
139#define __NR_quotactl 131
140#define __NR_getpgid 132
141#define __NR_fchdir 133
142#define __NR_bdflush 134
143#define __NR_sysfs 135
144#define __NR_personality 136
145#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
146#define __NR_setfsuid 138
147#define __NR_setfsgid 139
148#define __NR__llseek 140
149#define __NR_getdents 141
150#define __NR__newselect 142
151#define __NR_flock 143
152#define __NR_msync 144
153#define __NR_readv 145
154#define __NR_writev 146
155#define __NR_getsid 147
156#define __NR_fdatasync 148
157#define __NR__sysctl 149
158#define __NR_mlock 150
159#define __NR_munlock 151
160#define __NR_mlockall 152
161#define __NR_munlockall 153
162#define __NR_sched_setparam 154
163#define __NR_sched_getparam 155
164#define __NR_sched_setscheduler 156
165#define __NR_sched_getscheduler 157
166#define __NR_sched_yield 158
167#define __NR_sched_get_priority_max 159
168#define __NR_sched_get_priority_min 160
169#define __NR_sched_rr_get_interval 161
170#define __NR_nanosleep 162
171#define __NR_mremap 163
172#define __NR_setresuid 164
173#define __NR_getresuid 165
174#define __NR_getpagesize 166
175#define __NR_query_module 167
176#define __NR_poll 168
177#define __NR_nfsservctl 169
178#define __NR_setresgid 170
179#define __NR_getresgid 171
180#define __NR_prctl 172
181#define __NR_rt_sigreturn 173
182#define __NR_rt_sigaction 174
183#define __NR_rt_sigprocmask 175
184#define __NR_rt_sigpending 176
185#define __NR_rt_sigtimedwait 177
186#define __NR_rt_sigqueueinfo 178
187#define __NR_rt_sigsuspend 179
188#define __NR_pread 180
189#define __NR_pwrite 181
190#define __NR_lchown 182
191#define __NR_getcwd 183
192#define __NR_capget 184
193#define __NR_capset 185
194#define __NR_sigaltstack 186
195#define __NR_sendfile 187
196#define __NR_getpmsg 188 /* some people actually want streams */
197#define __NR_putpmsg 189 /* some people actually want streams */
198#define __NR_vfork 190
199#define __NR_ugetrlimit 191
200#define __NR_mmap2 192
201#define __NR_truncate64 193
202#define __NR_ftruncate64 194
203#define __NR_stat64 195
204#define __NR_lstat64 196
205#define __NR_fstat64 197
206#define __NR_chown32 198
207#define __NR_getuid32 199
208#define __NR_getgid32 200
209#define __NR_geteuid32 201
210#define __NR_getegid32 202
211#define __NR_setreuid32 203
212#define __NR_setregid32 204
213#define __NR_getgroups32 205
214#define __NR_setgroups32 206
215#define __NR_fchown32 207
216#define __NR_setresuid32 208
217#define __NR_getresuid32 209
218#define __NR_setresgid32 210
219#define __NR_getresgid32 211
220#define __NR_lchown32 212
221#define __NR_setuid32 213
222#define __NR_setgid32 214
223#define __NR_setfsuid32 215
224#define __NR_setfsgid32 216
225#define __NR_pivot_root 217
226#define __NR_getdents64 220
227#define __NR_gettid 221
228#define __NR_tkill 222
229#define __NR_setxattr 223
230#define __NR_lsetxattr 224
231#define __NR_fsetxattr 225
232#define __NR_getxattr 226
233#define __NR_lgetxattr 227
234#define __NR_fgetxattr 228
235#define __NR_listxattr 229
236#define __NR_llistxattr 230
237#define __NR_flistxattr 231
238#define __NR_removexattr 232
239#define __NR_lremovexattr 233
240#define __NR_fremovexattr 234
241#define __NR_futex 235
242#define __NR_sendfile64 236
243#define __NR_mincore 237
244#define __NR_madvise 238
245#define __NR_fcntl64 239
246#define __NR_readahead 240
247#define __NR_io_setup 241
248#define __NR_io_destroy 242
249#define __NR_io_getevents 243
250#define __NR_io_submit 244
251#define __NR_io_cancel 245
252#define __NR_fadvise64 246
253#define __NR_exit_group 247
254#define __NR_lookup_dcookie 248
255#define __NR_epoll_create 249
256#define __NR_epoll_ctl 250
257#define __NR_epoll_wait 251
258#define __NR_remap_file_pages 252
259#define __NR_set_tid_address 253
260#define __NR_timer_create 254
261#define __NR_timer_settime 255
262#define __NR_timer_gettime 256
263#define __NR_timer_getoverrun 257
264#define __NR_timer_delete 258
265#define __NR_clock_settime 259
266#define __NR_clock_gettime 260
267#define __NR_clock_getres 261
268#define __NR_clock_nanosleep 262
269#define __NR_statfs64 263
270#define __NR_fstatfs64 264
271#define __NR_tgkill 265
272#define __NR_utimes 266
273#define __NR_fadvise64_64 267
274#define __NR_mbind 268
275#define __NR_get_mempolicy 269
276#define __NR_set_mempolicy 270
277#define __NR_mq_open 271
278#define __NR_mq_unlink 272
279#define __NR_mq_timedsend 273
280#define __NR_mq_timedreceive 274
281#define __NR_mq_notify 275
282#define __NR_mq_getsetattr 276
283#define __NR_waitid 277
284#define __NR_sys_setaltroot 278
285#define __NR_add_key 279
286#define __NR_request_key 280
287#define __NR_keyctl 281
288
289#define NR_syscalls 282
290
291/* user-visible error numbers are in the range -1 - -122: see
292 <asm-m68k/errno.h> */
293
294#define __syscall_return(type, res) \
295do { \
296 if ((unsigned long)(res) >= (unsigned long)(-125)) { \
297 /* avoid using res which is declared to be in register d0; \
298 errno might expand to a function call and clobber it. */ \
299 int __err = -(res); \
300 errno = __err; \
301 res = -1; \
302 } \
303 return (type) (res); \
304} while (0)
305
306#define _syscall0(type, name) \
307type name(void) \
308{ \
309 long __res; \
310 __asm__ __volatile__ ("movel %1, %%d0\n\t" \
311 "trap #0\n\t" \
312 "movel %%d0, %0" \
313 : "=g" (__res) \
314 : "i" (__NR_##name) \
315 : "cc", "%d0"); \
316 if ((unsigned long)(__res) >= (unsigned long)(-125)) { \
317 errno = -__res; \
318 __res = -1; \
319 } \
320 return (type)__res; \
321}
322
323#define _syscall1(type, name, atype, a) \
324type name(atype a) \
325{ \
326 long __res; \
327 __asm__ __volatile__ ("movel %2, %%d1\n\t" \
328 "movel %1, %%d0\n\t" \
329 "trap #0\n\t" \
330 "movel %%d0, %0" \
331 : "=g" (__res) \
332 : "i" (__NR_##name), \
333 "g" ((long)a) \
334 : "cc", "%d0", "%d1"); \
335 if ((unsigned long)(__res) >= (unsigned long)(-125)) { \
336 errno = -__res; \
337 __res = -1; \
338 } \
339 return (type)__res; \
340}
341
342#define _syscall2(type, name, atype, a, btype, b) \
343type name(atype a, btype b) \
344{ \
345 long __res; \
346 __asm__ __volatile__ ("movel %3, %%d2\n\t" \
347 "movel %2, %%d1\n\t" \
348 "movel %1, %%d0\n\t" \
349 "trap #0\n\t" \
350 "movel %%d0, %0" \
351 : "=g" (__res) \
352 : "i" (__NR_##name), \
353 "a" ((long)a), \
354 "g" ((long)b) \
355 : "cc", "%d0", "%d1", "%d2"); \
356 if ((unsigned long)(__res) >= (unsigned long)(-125)) { \
357 errno = -__res; \
358 __res = -1; \
359 } \
360 return (type)__res; \
361}
362
363#define _syscall3(type, name, atype, a, btype, b, ctype, c) \
364type name(atype a, btype b, ctype c) \
365{ \
366 long __res; \
367 __asm__ __volatile__ ("movel %4, %%d3\n\t" \
368 "movel %3, %%d2\n\t" \
369 "movel %2, %%d1\n\t" \
370 "movel %1, %%d0\n\t" \
371 "trap #0\n\t" \
372 "movel %%d0, %0" \
373 : "=g" (__res) \
374 : "i" (__NR_##name), \
375 "a" ((long)a), \
376 "a" ((long)b), \
377 "g" ((long)c) \
378 : "cc", "%d0", "%d1", "%d2", "%d3"); \
379 if ((unsigned long)(__res) >= (unsigned long)(-125)) { \
380 errno = -__res; \
381 __res = -1; \
382 } \
383 return (type)__res; \
384}
385
386#define _syscall4(type, name, atype, a, btype, b, ctype, c, dtype, d) \
387type name(atype a, btype b, ctype c, dtype d) \
388{ \
389 long __res; \
390 __asm__ __volatile__ ("movel %5, %%d4\n\t" \
391 "movel %4, %%d3\n\t" \
392 "movel %3, %%d2\n\t" \
393 "movel %2, %%d1\n\t" \
394 "movel %1, %%d0\n\t" \
395 "trap #0\n\t" \
396 "movel %%d0, %0" \
397 : "=g" (__res) \
398 : "i" (__NR_##name), \
399 "a" ((long)a), \
400 "a" ((long)b), \
401 "a" ((long)c), \
402 "g" ((long)d) \
403 : "cc", "%d0", "%d1", "%d2", "%d3", \
404 "%d4"); \
405 if ((unsigned long)(__res) >= (unsigned long)(-125)) { \
406 errno = -__res; \
407 __res = -1; \
408 } \
409 return (type)__res; \
410}
411
412#define _syscall5(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e) \
413type name(atype a, btype b, ctype c, dtype d, etype e) \
414{ \
415 long __res; \
416 __asm__ __volatile__ ("movel %6, %%d5\n\t" \
417 "movel %5, %%d4\n\t" \
418 "movel %4, %%d3\n\t" \
419 "movel %3, %%d2\n\t" \
420 "movel %2, %%d1\n\t" \
421 "movel %1, %%d0\n\t" \
422 "trap #0\n\t" \
423 "movel %%d0, %0" \
424 : "=g" (__res) \
425 : "i" (__NR_##name), \
426 "a" ((long)a), \
427 "a" ((long)b), \
428 "a" ((long)c), \
429 "a" ((long)d), \
430 "g" ((long)e) \
431 : "cc", "%d0", "%d1", "%d2", "%d3", \
432 "%d4", "%d5"); \
433 if ((unsigned long)(__res) >= (unsigned long)(-125)) { \
434 errno = -__res; \
435 __res = -1; \
436 } \
437 return (type)__res; \
438}
439
440#ifdef __KERNEL__
441#define __ARCH_WANT_IPC_PARSE_VERSION
442#define __ARCH_WANT_OLD_READDIR
443#define __ARCH_WANT_OLD_STAT
444#define __ARCH_WANT_STAT64
445#define __ARCH_WANT_SYS_ALARM
446#define __ARCH_WANT_SYS_GETHOSTNAME
447#define __ARCH_WANT_SYS_PAUSE
448#define __ARCH_WANT_SYS_SGETMASK
449#define __ARCH_WANT_SYS_SIGNAL
450#define __ARCH_WANT_SYS_TIME
451#define __ARCH_WANT_SYS_UTIME
452#define __ARCH_WANT_SYS_WAITPID
453#define __ARCH_WANT_SYS_SOCKETCALL
454#define __ARCH_WANT_SYS_FADVISE64
455#define __ARCH_WANT_SYS_GETPGRP
456#define __ARCH_WANT_SYS_LLSEEK
457#define __ARCH_WANT_SYS_NICE
458#define __ARCH_WANT_SYS_OLD_GETRLIMIT
459#define __ARCH_WANT_SYS_OLDUMOUNT
460#define __ARCH_WANT_SYS_SIGPENDING
461#define __ARCH_WANT_SYS_SIGPROCMASK
462#define __ARCH_WANT_SYS_RT_SIGACTION
463#endif
464
465#ifdef __KERNEL_SYSCALLS__
466
467#include <linux/compiler.h>
468#include <linux/interrupt.h>
469#include <linux/types.h>
470
471/*
472 * we need this inline - forking from kernel space will result
473 * in NO COPY ON WRITE (!!!), until an execve is executed. This
474 * is no problem, but for the stack. This is handled by not letting
475 * main() use the stack at all after fork(). Thus, no function
476 * calls - which means inline code for fork too, as otherwise we
477 * would use the stack upon exit from 'fork()'.
478 *
479 * Actually only pause and fork are needed inline, so that there
480 * won't be any messing with the stack from main(), but we define
481 * some others too.
482 */
483#define __NR__exit __NR_exit
484static inline _syscall0(int,pause)
485static inline _syscall0(int,sync)
486static inline _syscall0(pid_t,setsid)
487static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
488static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
489static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
490static inline _syscall1(int,dup,int,fd)
491static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
492static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
493static inline _syscall1(int,close,int,fd)
494static inline _syscall1(int,_exit,int,exitcode)
495static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
496static inline _syscall1(int,delete_module,const char *,name)
497
498static inline pid_t wait(int * wait_stat)
499{
500 return waitpid(-1,wait_stat,0);
501}
502asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
503 unsigned long prot, unsigned long flags,
504 unsigned long fd, unsigned long pgoff);
505asmlinkage int sys_execve(char *name, char **argv, char **envp);
506asmlinkage int sys_pipe(unsigned long *fildes);
507asmlinkage int sys_ptrace(long request, long pid, long addr, long data);
508struct pt_regs;
509int sys_request_irq(unsigned int,
510 irqreturn_t (*)(int, void *, struct pt_regs *),
511 unsigned long, const char *, void *);
512void sys_free_irq(unsigned int, void *);
513struct sigaction;
514asmlinkage long sys_rt_sigaction(int sig,
515 const struct sigaction __user *act,
516 struct sigaction __user *oact,
517 size_t sigsetsize);
518
519#endif
520
521/*
522 * "Conditional" syscalls
523 *
524 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
525 * but it doesn't work on all toolchains, so we just do it by hand
526 */
527#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
528
529#endif /* _ASM_M68K_UNISTD_H_ */
diff --git a/include/asm-m68knommu/user.h b/include/asm-m68knommu/user.h
new file mode 100644
index 000000000000..a5a555b761c4
--- /dev/null
+++ b/include/asm-m68knommu/user.h
@@ -0,0 +1 @@
#include <asm-m68k/user.h>