Import 2.3.18pre1
[davej-history.git] / include / asm-m68k / apollohw.h
blob54177aa3de957da612ea5b8004176b6a3e8c140d
1 /* apollohw.h : some structures to access apollo HW */
3 #ifndef _ASMm68k_APOLLOHW_H_
4 #define _ASMm68k_APOLLOHW_H_
7 /*
8 see scn2681 data sheet for more info.
9 member names are read_write.
12 #define DECLARE_2681_FIELD(x) unsigned char x; unsigned char dummy##x
14 struct SCN2681 {
16 DECLARE_2681_FIELD(mra);
17 DECLARE_2681_FIELD(sra_csra);
18 DECLARE_2681_FIELD(BRGtest_cra);
19 DECLARE_2681_FIELD(rhra_thra);
20 DECLARE_2681_FIELD(ipcr_acr);
21 DECLARE_2681_FIELD(isr_imr);
22 DECLARE_2681_FIELD(ctu_ctur);
23 DECLARE_2681_FIELD(ctl_ctlr);
24 DECLARE_2681_FIELD(mrb);
25 DECLARE_2681_FIELD(srb_csrb);
26 DECLARE_2681_FIELD(tst_crb);
27 DECLARE_2681_FIELD(rhrb_thrb);
28 DECLARE_2681_FIELD(reserved);
29 DECLARE_2681_FIELD(ip_opcr);
30 DECLARE_2681_FIELD(startCnt_setOutBit);
31 DECLARE_2681_FIELD(stopCnt_resetOutBit);
35 #if 0
36 struct mc146818 {
38 unsigned int second1:4, second2:4, alarm_second1:4, alarm_second2:4,
39 minute1:4, minute2:4, alarm_minute1:4, alarm_minute2:4;
40 unsigned int hours1:4, hours2:4, alarm_hours1:4, alarm_hours2:4,
41 day_of_week1:4, day_of_week2:4, day_of_month1:4, day_of_month2:4;
42 unsigned int month1:4, month2:4, year1:4, year2:4, :16;
45 #endif
47 struct mc146818 {
48 unsigned char second, alarm_second;
49 unsigned char minute, alarm_minute;
50 unsigned char hours, alarm_hours;
51 unsigned char day_of_week, day_of_month;
52 unsigned char month, year;
55 #define IO_BASE 0x80000000
57 #define SIO01_PHYSADDR 0x10400
58 #define SIO23_PHYSADDR 0x10500
59 #define RTC_PHYSADDR 0x10900
60 #define PICA 0x11000
61 #define PICB 0x11100
62 #define sio01 ((*(volatile struct SCN2681 *)(IO_BASE + SIO01_PHYSADDR)))
63 #define sio23 ((*(volatile struct SCN2681 *)(IO_BASE + SIO01_PHYSADDR)))
64 #define rtc (((volatile struct mc146818 *)(IO_BASE + RTC_PHYSADDR)))
66 #define inb(addr) (*((volatile unsigned char *)(addr)))
67 #define outb(val,addr) (*((volatile unsigned char *)(addr)) = (val))
68 #define inw(addr) (*((volatile unsigned short *)(addr)))
69 #define outw(val,addr) (*((volatile unsigned short *)(addr)) = (val))
71 #endif