Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* apollohw.h : some structures to access apollo HW */ |
| 2 | |
| 3 | #ifndef _ASMm68k_APOLLOHW_H_ |
| 4 | #define _ASMm68k_APOLLOHW_H_ |
| 5 | |
Roman Zippel | 0aa7810 | 2006-06-25 05:47:02 -0700 | [diff] [blame] | 6 | #include <linux/types.h> |
| 7 | |
Geert Uytterhoeven | 7678e77 | 2013-10-03 11:31:08 +0200 | [diff] [blame] | 8 | #include <asm/bootinfo-apollo.h> |
| 9 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | |
| 11 | extern u_long apollo_model; |
| 12 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
| 14 | /* |
| 15 | see scn2681 data sheet for more info. |
| 16 | member names are read_write. |
| 17 | */ |
| 18 | |
| 19 | #define DECLARE_2681_FIELD(x) unsigned char x; unsigned char dummy##x |
| 20 | |
| 21 | struct SCN2681 { |
| 22 | |
| 23 | DECLARE_2681_FIELD(mra); |
| 24 | DECLARE_2681_FIELD(sra_csra); |
| 25 | DECLARE_2681_FIELD(BRGtest_cra); |
| 26 | DECLARE_2681_FIELD(rhra_thra); |
| 27 | DECLARE_2681_FIELD(ipcr_acr); |
| 28 | DECLARE_2681_FIELD(isr_imr); |
| 29 | DECLARE_2681_FIELD(ctu_ctur); |
| 30 | DECLARE_2681_FIELD(ctl_ctlr); |
| 31 | DECLARE_2681_FIELD(mrb); |
| 32 | DECLARE_2681_FIELD(srb_csrb); |
| 33 | DECLARE_2681_FIELD(tst_crb); |
| 34 | DECLARE_2681_FIELD(rhrb_thrb); |
| 35 | DECLARE_2681_FIELD(reserved); |
| 36 | DECLARE_2681_FIELD(ip_opcr); |
| 37 | DECLARE_2681_FIELD(startCnt_setOutBit); |
| 38 | DECLARE_2681_FIELD(stopCnt_resetOutBit); |
| 39 | |
| 40 | }; |
| 41 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | struct mc146818 { |
| 43 | unsigned char second, alarm_second; |
| 44 | unsigned char minute, alarm_minute; |
| 45 | unsigned char hours, alarm_hours; |
| 46 | unsigned char day_of_week, day_of_month; |
| 47 | unsigned char month, year; |
| 48 | }; |
| 49 | |
| 50 | |
| 51 | #define IO_BASE 0x80000000 |
| 52 | |
| 53 | extern u_long sio01_physaddr; |
| 54 | extern u_long sio23_physaddr; |
| 55 | extern u_long rtc_physaddr; |
| 56 | extern u_long pica_physaddr; |
| 57 | extern u_long picb_physaddr; |
| 58 | extern u_long cpuctrl_physaddr; |
| 59 | extern u_long timer_physaddr; |
| 60 | |
| 61 | #define SAU7_SIO01_PHYSADDR 0x10400 |
| 62 | #define SAU7_SIO23_PHYSADDR 0x10500 |
| 63 | #define SAU7_RTC_PHYSADDR 0x10900 |
| 64 | #define SAU7_PICA 0x11000 |
| 65 | #define SAU7_PICB 0x11100 |
| 66 | #define SAU7_CPUCTRL 0x10100 |
| 67 | #define SAU7_TIMER 0x010800 |
| 68 | |
| 69 | #define SAU8_SIO01_PHYSADDR 0x8400 |
| 70 | #define SAU8_RTC_PHYSADDR 0x8900 |
| 71 | #define SAU8_PICA 0x9400 |
| 72 | #define SAU8_PICB 0x9500 |
| 73 | #define SAU8_CPUCTRL 0x8100 |
| 74 | #define SAU8_TIMER 0x8800 |
| 75 | |
| 76 | #define sio01 ((*(volatile struct SCN2681 *)(IO_BASE + sio01_physaddr))) |
| 77 | #define sio23 ((*(volatile struct SCN2681 *)(IO_BASE + sio23_physaddr))) |
| 78 | #define rtc (((volatile struct mc146818 *)(IO_BASE + rtc_physaddr))) |
| 79 | #define cpuctrl (*(volatile unsigned int *)(IO_BASE + cpuctrl_physaddr)) |
| 80 | #define pica (IO_BASE + pica_physaddr) |
| 81 | #define picb (IO_BASE + picb_physaddr) |
Geert Uytterhoeven | 1525e06 | 2012-07-20 21:54:29 +0200 | [diff] [blame] | 82 | #define apollo_timer (IO_BASE + timer_physaddr) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | #define addr_xlat_map ((unsigned short *)(IO_BASE + 0x17000)) |
| 84 | |
| 85 | #define isaIO2mem(x) (((((x) & 0x3f8) << 7) | (((x) & 0xfc00) >> 6) | ((x) & 0x7)) + 0x40000 + IO_BASE) |
| 86 | |
Roman Zippel | 0aa7810 | 2006-06-25 05:47:02 -0700 | [diff] [blame] | 87 | #define IRQ_APOLLO IRQ_USER |
| 88 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | #endif |