18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _M68K_MVME16xHW_H_
38c2ecf20Sopenharmony_ci#define _M68K_MVME16xHW_H_
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <asm/irq.h>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_citypedef struct {
98c2ecf20Sopenharmony_ci	u_char	ack_icr,
108c2ecf20Sopenharmony_ci		flt_icr,
118c2ecf20Sopenharmony_ci		sel_icr,
128c2ecf20Sopenharmony_ci		pe_icr,
138c2ecf20Sopenharmony_ci		bsy_icr,
148c2ecf20Sopenharmony_ci		spare1,
158c2ecf20Sopenharmony_ci		isr,
168c2ecf20Sopenharmony_ci		cr,
178c2ecf20Sopenharmony_ci		spare2,
188c2ecf20Sopenharmony_ci		spare3,
198c2ecf20Sopenharmony_ci		spare4,
208c2ecf20Sopenharmony_ci		data;
218c2ecf20Sopenharmony_ci} MVMElp, *MVMElpPtr;
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#define MVME_LPR_BASE	0xfff42030
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#define mvmelp   ((*(volatile MVMElpPtr)(MVME_LPR_BASE)))
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_citypedef struct {
288c2ecf20Sopenharmony_ci	unsigned char
298c2ecf20Sopenharmony_ci		ctrl,
308c2ecf20Sopenharmony_ci		bcd_sec,
318c2ecf20Sopenharmony_ci		bcd_min,
328c2ecf20Sopenharmony_ci		bcd_hr,
338c2ecf20Sopenharmony_ci		bcd_dow,
348c2ecf20Sopenharmony_ci		bcd_dom,
358c2ecf20Sopenharmony_ci		bcd_mth,
368c2ecf20Sopenharmony_ci		bcd_year;
378c2ecf20Sopenharmony_ci} MK48T08_t, *MK48T08ptr_t;
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#define RTC_WRITE	0x80
408c2ecf20Sopenharmony_ci#define RTC_READ	0x40
418c2ecf20Sopenharmony_ci#define RTC_STOP	0x20
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#define MVME_RTC_BASE	0xfffc1ff8
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define MVME_I596_BASE	0xfff46000
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define MVME_SCC_A_ADDR	0xfff45005
488c2ecf20Sopenharmony_ci#define MVME_SCC_B_ADDR	0xfff45001
498c2ecf20Sopenharmony_ci#define MVME_SCC_PCLK	10000000
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#define MVME162_IRQ_TYPE_PRIO	0
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#define MVME167_IRQ_PRN		(IRQ_USER+20)
548c2ecf20Sopenharmony_ci#define MVME16x_IRQ_I596	(IRQ_USER+23)
558c2ecf20Sopenharmony_ci#define MVME16x_IRQ_SCSI	(IRQ_USER+21)
568c2ecf20Sopenharmony_ci#define MVME16x_IRQ_FLY		(IRQ_USER+63)
578c2ecf20Sopenharmony_ci#define MVME167_IRQ_SER_ERR	(IRQ_USER+28)
588c2ecf20Sopenharmony_ci#define MVME167_IRQ_SER_MODEM	(IRQ_USER+29)
598c2ecf20Sopenharmony_ci#define MVME167_IRQ_SER_TX	(IRQ_USER+30)
608c2ecf20Sopenharmony_ci#define MVME167_IRQ_SER_RX	(IRQ_USER+31)
618c2ecf20Sopenharmony_ci#define MVME16x_IRQ_TIMER	(IRQ_USER+25)
628c2ecf20Sopenharmony_ci#define MVME167_IRQ_ABORT	(IRQ_USER+46)
638c2ecf20Sopenharmony_ci#define MVME162_IRQ_ABORT	(IRQ_USER+30)
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci/* SCC interrupts, for MVME162 */
668c2ecf20Sopenharmony_ci#define MVME162_IRQ_SCC_BASE		(IRQ_USER+0)
678c2ecf20Sopenharmony_ci#define MVME162_IRQ_SCCB_TX		(IRQ_USER+0)
688c2ecf20Sopenharmony_ci#define MVME162_IRQ_SCCB_STAT		(IRQ_USER+2)
698c2ecf20Sopenharmony_ci#define MVME162_IRQ_SCCB_RX		(IRQ_USER+4)
708c2ecf20Sopenharmony_ci#define MVME162_IRQ_SCCB_SPCOND		(IRQ_USER+6)
718c2ecf20Sopenharmony_ci#define MVME162_IRQ_SCCA_TX		(IRQ_USER+8)
728c2ecf20Sopenharmony_ci#define MVME162_IRQ_SCCA_STAT		(IRQ_USER+10)
738c2ecf20Sopenharmony_ci#define MVME162_IRQ_SCCA_RX		(IRQ_USER+12)
748c2ecf20Sopenharmony_ci#define MVME162_IRQ_SCCA_SPCOND		(IRQ_USER+14)
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci/* MVME162 version register */
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci#define MVME162_VERSION_REG	0xfff4202e
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ciextern unsigned short mvme16x_config;
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci/* Lower 8 bits must match the revision register in the MC2 chip */
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci#define MVME16x_CONFIG_SPEED_32		0x0001
858c2ecf20Sopenharmony_ci#define MVME16x_CONFIG_NO_VMECHIP2	0x0002
868c2ecf20Sopenharmony_ci#define MVME16x_CONFIG_NO_SCSICHIP	0x0004
878c2ecf20Sopenharmony_ci#define MVME16x_CONFIG_NO_ETHERNET	0x0008
888c2ecf20Sopenharmony_ci#define MVME16x_CONFIG_GOT_FPU		0x0010
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci#define MVME16x_CONFIG_GOT_LP		0x0100
918c2ecf20Sopenharmony_ci#define MVME16x_CONFIG_GOT_CD2401	0x0200
928c2ecf20Sopenharmony_ci#define MVME16x_CONFIG_GOT_SCCA		0x0400
938c2ecf20Sopenharmony_ci#define MVME16x_CONFIG_GOT_SCCB		0x0800
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci#endif
96