18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _M68K_BVME6000HW_H_
38c2ecf20Sopenharmony_ci#define _M68K_BVME6000HW_H_
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <asm/irq.h>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci/*
88c2ecf20Sopenharmony_ci * PIT structure
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define BVME_PIT_BASE	0xffa00000
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_citypedef struct {
148c2ecf20Sopenharmony_ci	unsigned char
158c2ecf20Sopenharmony_ci	pad_a[3], pgcr,
168c2ecf20Sopenharmony_ci	pad_b[3], psrr,
178c2ecf20Sopenharmony_ci	pad_c[3], paddr,
188c2ecf20Sopenharmony_ci	pad_d[3], pbddr,
198c2ecf20Sopenharmony_ci	pad_e[3], pcddr,
208c2ecf20Sopenharmony_ci	pad_f[3], pivr,
218c2ecf20Sopenharmony_ci	pad_g[3], pacr,
228c2ecf20Sopenharmony_ci	pad_h[3], pbcr,
238c2ecf20Sopenharmony_ci	pad_i[3], padr,
248c2ecf20Sopenharmony_ci	pad_j[3], pbdr,
258c2ecf20Sopenharmony_ci	pad_k[3], paar,
268c2ecf20Sopenharmony_ci	pad_l[3], pbar,
278c2ecf20Sopenharmony_ci	pad_m[3], pcdr,
288c2ecf20Sopenharmony_ci	pad_n[3], psr,
298c2ecf20Sopenharmony_ci	pad_o[3], res1,
308c2ecf20Sopenharmony_ci	pad_p[3], res2,
318c2ecf20Sopenharmony_ci	pad_q[3], tcr,
328c2ecf20Sopenharmony_ci	pad_r[3], tivr,
338c2ecf20Sopenharmony_ci	pad_s[3], res3,
348c2ecf20Sopenharmony_ci	pad_t[3], cprh,
358c2ecf20Sopenharmony_ci	pad_u[3], cprm,
368c2ecf20Sopenharmony_ci	pad_v[3], cprl,
378c2ecf20Sopenharmony_ci	pad_w[3], res4,
388c2ecf20Sopenharmony_ci	pad_x[3], crh,
398c2ecf20Sopenharmony_ci	pad_y[3], crm,
408c2ecf20Sopenharmony_ci	pad_z[3], crl,
418c2ecf20Sopenharmony_ci	pad_A[3], tsr,
428c2ecf20Sopenharmony_ci	pad_B[3], res5;
438c2ecf20Sopenharmony_ci} PitRegs_t, *PitRegsPtr;
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define bvmepit   ((*(volatile PitRegsPtr)(BVME_PIT_BASE)))
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define BVME_RTC_BASE	0xff900000
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_citypedef struct {
508c2ecf20Sopenharmony_ci	unsigned char
518c2ecf20Sopenharmony_ci	pad_a[3], msr,
528c2ecf20Sopenharmony_ci	pad_b[3], t0cr_rtmr,
538c2ecf20Sopenharmony_ci	pad_c[3], t1cr_omr,
548c2ecf20Sopenharmony_ci	pad_d[3], pfr_icr0,
558c2ecf20Sopenharmony_ci	pad_e[3], irr_icr1,
568c2ecf20Sopenharmony_ci	pad_f[3], bcd_tenms,
578c2ecf20Sopenharmony_ci	pad_g[3], bcd_sec,
588c2ecf20Sopenharmony_ci	pad_h[3], bcd_min,
598c2ecf20Sopenharmony_ci	pad_i[3], bcd_hr,
608c2ecf20Sopenharmony_ci	pad_j[3], bcd_dom,
618c2ecf20Sopenharmony_ci	pad_k[3], bcd_mth,
628c2ecf20Sopenharmony_ci	pad_l[3], bcd_year,
638c2ecf20Sopenharmony_ci	pad_m[3], bcd_ujcc,
648c2ecf20Sopenharmony_ci	pad_n[3], bcd_hjcc,
658c2ecf20Sopenharmony_ci	pad_o[3], bcd_dow,
668c2ecf20Sopenharmony_ci	pad_p[3], t0lsb,
678c2ecf20Sopenharmony_ci	pad_q[3], t0msb,
688c2ecf20Sopenharmony_ci	pad_r[3], t1lsb,
698c2ecf20Sopenharmony_ci	pad_s[3], t1msb,
708c2ecf20Sopenharmony_ci	pad_t[3], cmp_sec,
718c2ecf20Sopenharmony_ci	pad_u[3], cmp_min,
728c2ecf20Sopenharmony_ci	pad_v[3], cmp_hr,
738c2ecf20Sopenharmony_ci	pad_w[3], cmp_dom,
748c2ecf20Sopenharmony_ci	pad_x[3], cmp_mth,
758c2ecf20Sopenharmony_ci	pad_y[3], cmp_dow,
768c2ecf20Sopenharmony_ci	pad_z[3], sav_sec,
778c2ecf20Sopenharmony_ci	pad_A[3], sav_min,
788c2ecf20Sopenharmony_ci	pad_B[3], sav_hr,
798c2ecf20Sopenharmony_ci	pad_C[3], sav_dom,
808c2ecf20Sopenharmony_ci	pad_D[3], sav_mth,
818c2ecf20Sopenharmony_ci	pad_E[3], ram,
828c2ecf20Sopenharmony_ci	pad_F[3], test;
838c2ecf20Sopenharmony_ci} RtcRegs_t, *RtcPtr_t;
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci#define BVME_I596_BASE	0xff100000
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#define BVME_ETHIRQ_REG	0xff20000b
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci#define BVME_LOCAL_IRQ_STAT  0xff20000f
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci#define BVME_ETHERR          0x02
938c2ecf20Sopenharmony_ci#define BVME_ABORT_STATUS    0x08
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci#define BVME_NCR53C710_BASE	0xff000000
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci#define BVME_SCC_A_ADDR	0xffb0000b
988c2ecf20Sopenharmony_ci#define BVME_SCC_B_ADDR	0xffb00003
998c2ecf20Sopenharmony_ci#define BVME_SCC_RTxC	7372800
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci#define BVME_CONFIG_REG	0xff500003
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci#define config_reg_ptr	(volatile unsigned char *)BVME_CONFIG_REG
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci#define BVME_CONFIG_SW1	0x08
1068c2ecf20Sopenharmony_ci#define BVME_CONFIG_SW2	0x04
1078c2ecf20Sopenharmony_ci#define BVME_CONFIG_SW3	0x02
1088c2ecf20Sopenharmony_ci#define BVME_CONFIG_SW4	0x01
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci#define BVME_IRQ_TYPE_PRIO	0
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci#define BVME_IRQ_PRN		(IRQ_USER+20)
1148c2ecf20Sopenharmony_ci#define BVME_IRQ_TIMER		(IRQ_USER+25)
1158c2ecf20Sopenharmony_ci#define BVME_IRQ_I596		IRQ_AUTO_2
1168c2ecf20Sopenharmony_ci#define BVME_IRQ_SCSI		IRQ_AUTO_3
1178c2ecf20Sopenharmony_ci#define BVME_IRQ_RTC		IRQ_AUTO_6
1188c2ecf20Sopenharmony_ci#define BVME_IRQ_ABORT		IRQ_AUTO_7
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci/* SCC interrupts */
1218c2ecf20Sopenharmony_ci#define BVME_IRQ_SCC_BASE		IRQ_USER
1228c2ecf20Sopenharmony_ci#define BVME_IRQ_SCCB_TX		IRQ_USER
1238c2ecf20Sopenharmony_ci#define BVME_IRQ_SCCB_STAT		(IRQ_USER+2)
1248c2ecf20Sopenharmony_ci#define BVME_IRQ_SCCB_RX		(IRQ_USER+4)
1258c2ecf20Sopenharmony_ci#define BVME_IRQ_SCCB_SPCOND		(IRQ_USER+6)
1268c2ecf20Sopenharmony_ci#define BVME_IRQ_SCCA_TX		(IRQ_USER+8)
1278c2ecf20Sopenharmony_ci#define BVME_IRQ_SCCA_STAT		(IRQ_USER+10)
1288c2ecf20Sopenharmony_ci#define BVME_IRQ_SCCA_RX		(IRQ_USER+12)
1298c2ecf20Sopenharmony_ci#define BVME_IRQ_SCCA_SPCOND		(IRQ_USER+14)
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci/* Address control registers */
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci#define BVME_ACR_A32VBA		0xff400003
1348c2ecf20Sopenharmony_ci#define BVME_ACR_A32MSK		0xff410003
1358c2ecf20Sopenharmony_ci#define BVME_ACR_A24VBA		0xff420003
1368c2ecf20Sopenharmony_ci#define BVME_ACR_A24MSK		0xff430003
1378c2ecf20Sopenharmony_ci#define BVME_ACR_A16VBA		0xff440003
1388c2ecf20Sopenharmony_ci#define BVME_ACR_A32LBA		0xff450003
1398c2ecf20Sopenharmony_ci#define BVME_ACR_A24LBA		0xff460003
1408c2ecf20Sopenharmony_ci#define BVME_ACR_ADDRCTL	0xff470003
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci#define bvme_acr_a32vba		*(volatile unsigned char *)BVME_ACR_A32VBA
1438c2ecf20Sopenharmony_ci#define bvme_acr_a32msk		*(volatile unsigned char *)BVME_ACR_A32MSK
1448c2ecf20Sopenharmony_ci#define bvme_acr_a24vba		*(volatile unsigned char *)BVME_ACR_A24VBA
1458c2ecf20Sopenharmony_ci#define bvme_acr_a24msk		*(volatile unsigned char *)BVME_ACR_A24MSK
1468c2ecf20Sopenharmony_ci#define bvme_acr_a16vba		*(volatile unsigned char *)BVME_ACR_A16VBA
1478c2ecf20Sopenharmony_ci#define bvme_acr_a32lba		*(volatile unsigned char *)BVME_ACR_A32LBA
1488c2ecf20Sopenharmony_ci#define bvme_acr_a24lba		*(volatile unsigned char *)BVME_ACR_A24LBA
1498c2ecf20Sopenharmony_ci#define bvme_acr_addrctl	*(volatile unsigned char *)BVME_ACR_ADDRCTL
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci#endif
152