18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *	6522 Versatile Interface Adapter (VIA)
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *	There are two of these on the Mac II. Some IRQ's are vectored
68c2ecf20Sopenharmony_ci *	via them as are assorted bits and bobs - eg rtc, adb. The picture
78c2ecf20Sopenharmony_ci *	is a bit incomplete as the Mac documentation doesn't cover this well
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef _ASM_MAC_VIA_H_
118c2ecf20Sopenharmony_ci#define _ASM_MAC_VIA_H_
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci/*
148c2ecf20Sopenharmony_ci * Base addresses for the VIAs. There are two in every machine,
158c2ecf20Sopenharmony_ci * although on some machines the second is an RBV or an OSS.
168c2ecf20Sopenharmony_ci * The OSS is different enough that it's handled separately.
178c2ecf20Sopenharmony_ci *
188c2ecf20Sopenharmony_ci * Do not use these values directly; use the via1 and via2 variables
198c2ecf20Sopenharmony_ci * instead (and don't forget to check rbv_present when using via2!)
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define VIA1_BASE	(0x50F00000)
238c2ecf20Sopenharmony_ci#define VIA2_BASE	(0x50F02000)
248c2ecf20Sopenharmony_ci#define  RBV_BASE	(0x50F26000)
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci/*
278c2ecf20Sopenharmony_ci *	Not all of these are true post MacII I think.
288c2ecf20Sopenharmony_ci *      CSA: probably the ones CHRP marks as 'unused' change purposes
298c2ecf20Sopenharmony_ci *      when the IWM becomes the SWIM.
308c2ecf20Sopenharmony_ci *      http://www.rs6000.ibm.com/resource/technology/chrpio/via5.mak.html
318c2ecf20Sopenharmony_ci *      ftp://ftp.austin.ibm.com/pub/technology/spec/chrp/inwork/CHRP_IORef_1.0.pdf
328c2ecf20Sopenharmony_ci *
338c2ecf20Sopenharmony_ci * also, http://developer.apple.com/technotes/hw/hw_09.html claims the
348c2ecf20Sopenharmony_ci * following changes for IIfx:
358c2ecf20Sopenharmony_ci * VIA1A_vSccWrReq not available and that VIA1A_vSync has moved to an IOP.
368c2ecf20Sopenharmony_ci * Also, "All of the functionality of VIA2 has been moved to other chips".
378c2ecf20Sopenharmony_ci */
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#define VIA1A_vSccWrReq	0x80	/* SCC write. (input)
408c2ecf20Sopenharmony_ci				 * [CHRP] SCC WREQ: Reflects the state of the
418c2ecf20Sopenharmony_ci				 * Wait/Request pins from the SCC.
428c2ecf20Sopenharmony_ci				 * [Macintosh Family Hardware]
438c2ecf20Sopenharmony_ci				 * as CHRP on SE/30,II,IIx,IIcx,IIci.
448c2ecf20Sopenharmony_ci				 * on IIfx, "0 means an active request"
458c2ecf20Sopenharmony_ci				 */
468c2ecf20Sopenharmony_ci#define VIA1A_vRev8	0x40	/* Revision 8 board ???
478c2ecf20Sopenharmony_ci                                 * [CHRP] En WaitReqB: Lets the WaitReq_L
488c2ecf20Sopenharmony_ci				 * signal from port B of the SCC appear on
498c2ecf20Sopenharmony_ci				 * the PA7 input pin. Output.
508c2ecf20Sopenharmony_ci				 * [Macintosh Family] On the SE/30, this
518c2ecf20Sopenharmony_ci				 * is the bit to flip screen buffers.
528c2ecf20Sopenharmony_ci				 * 0=alternate, 1=main.
538c2ecf20Sopenharmony_ci				 * on II,IIx,IIcx,IIci,IIfx this is a bit
548c2ecf20Sopenharmony_ci				 * for Rev ID. 0=II,IIx, 1=IIcx,IIci,IIfx
558c2ecf20Sopenharmony_ci				 */
568c2ecf20Sopenharmony_ci#define VIA1A_vHeadSel	0x20	/* Head select for IWM.
578c2ecf20Sopenharmony_ci				 * [CHRP] unused.
588c2ecf20Sopenharmony_ci				 * [Macintosh Family] "Floppy disk
598c2ecf20Sopenharmony_ci				 * state-control line SEL" on all but IIfx
608c2ecf20Sopenharmony_ci				 */
618c2ecf20Sopenharmony_ci#define VIA1A_vOverlay	0x10    /* [Macintosh Family] On SE/30,II,IIx,IIcx
628c2ecf20Sopenharmony_ci				 * this bit enables the "Overlay" address
638c2ecf20Sopenharmony_ci				 * map in the address decoders as it is on
648c2ecf20Sopenharmony_ci				 * reset for mapping the ROM over the reset
658c2ecf20Sopenharmony_ci				 * vector. 1=use overlay map.
668c2ecf20Sopenharmony_ci				 * On the IIci,IIfx it is another bit of the
678c2ecf20Sopenharmony_ci				 * CPU ID: 0=normal IIci, 1=IIci with parity
688c2ecf20Sopenharmony_ci				 * feature or IIfx.
698c2ecf20Sopenharmony_ci				 * [CHRP] En WaitReqA: Lets the WaitReq_L
708c2ecf20Sopenharmony_ci				 * signal from port A of the SCC appear
718c2ecf20Sopenharmony_ci				 * on the PA7 input pin (CHRP). Output.
728c2ecf20Sopenharmony_ci				 * [MkLinux] "Drive Select"
738c2ecf20Sopenharmony_ci				 *  (with 0x20 being 'disk head select')
748c2ecf20Sopenharmony_ci				 */
758c2ecf20Sopenharmony_ci#define VIA1A_vSync	0x08    /* [CHRP] Sync Modem: modem clock select:
768c2ecf20Sopenharmony_ci                                 * 1: select the external serial clock to
778c2ecf20Sopenharmony_ci				 *    drive the SCC's /RTxCA pin.
788c2ecf20Sopenharmony_ci				 * 0: Select the 3.6864MHz clock to drive
798c2ecf20Sopenharmony_ci				 *    the SCC cell.
808c2ecf20Sopenharmony_ci				 * [Macintosh Family] Correct on all but IIfx
818c2ecf20Sopenharmony_ci				 */
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci/* Macintosh Family Hardware sez: bits 0-2 of VIA1A are volume control
848c2ecf20Sopenharmony_ci * on Macs which had the PWM sound hardware.  Reserved on newer models.
858c2ecf20Sopenharmony_ci * On IIci,IIfx, bits 1-2 are the rest of the CPU ID:
868c2ecf20Sopenharmony_ci * bit 2: 1=IIci, 0=IIfx
878c2ecf20Sopenharmony_ci * bit 1: 1 on both IIci and IIfx.
888c2ecf20Sopenharmony_ci * MkLinux sez bit 0 is 'burnin flag' in this case.
898c2ecf20Sopenharmony_ci * CHRP sez: VIA1A bits 0-2 and 5 are 'unused': if programmed as
908c2ecf20Sopenharmony_ci * inputs, these bits will read 0.
918c2ecf20Sopenharmony_ci */
928c2ecf20Sopenharmony_ci#define VIA1A_vVolume	0x07	/* Audio volume mask for PWM */
938c2ecf20Sopenharmony_ci#define VIA1A_CPUID0	0x02	/* CPU id bit 0 on RBV, others */
948c2ecf20Sopenharmony_ci#define VIA1A_CPUID1	0x04	/* CPU id bit 0 on RBV, others */
958c2ecf20Sopenharmony_ci#define VIA1A_CPUID2	0x10	/* CPU id bit 0 on RBV, others */
968c2ecf20Sopenharmony_ci#define VIA1A_CPUID3	0x40	/* CPU id bit 0 on RBV, others */
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci/* Info on VIA1B is from Macintosh Family Hardware & MkLinux.
998c2ecf20Sopenharmony_ci * CHRP offers no info. */
1008c2ecf20Sopenharmony_ci#define VIA1B_vSound	0x80	/* Sound enable (for compatibility with
1018c2ecf20Sopenharmony_ci				 * PWM hardware) 0=enabled.
1028c2ecf20Sopenharmony_ci				 * Also, on IIci w/parity, shows parity error
1038c2ecf20Sopenharmony_ci				 * 0=error, 1=OK. */
1048c2ecf20Sopenharmony_ci#define VIA1B_vMystery	0x40    /* On IIci, parity enable. 0=enabled,1=disabled
1058c2ecf20Sopenharmony_ci				 * On SE/30, vertical sync interrupt enable.
1068c2ecf20Sopenharmony_ci				 * 0=enabled. This vSync interrupt shows up
1078c2ecf20Sopenharmony_ci				 * as a slot $E interrupt. */
1088c2ecf20Sopenharmony_ci#define VIA1B_vADBS2	0x20	/* ADB state input bit 1 (unused on IIfx) */
1098c2ecf20Sopenharmony_ci#define VIA1B_vADBS1	0x10	/* ADB state input bit 0 (unused on IIfx) */
1108c2ecf20Sopenharmony_ci#define VIA1B_vADBInt	0x08	/* ADB interrupt 0=interrupt (unused on IIfx)*/
1118c2ecf20Sopenharmony_ci#define VIA1B_vRTCEnb	0x04	/* Enable Real time clock. 0=enabled. */
1128c2ecf20Sopenharmony_ci#define VIA1B_vRTCClk	0x02    /* Real time clock serial-clock line. */
1138c2ecf20Sopenharmony_ci#define VIA1B_vRTCData	0x01    /* Real time clock serial-data line. */
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci/* MkLinux defines the following "VIA1 Register B contents where they
1168c2ecf20Sopenharmony_ci * differ from standard VIA1".  From the naming scheme, we assume they
1178c2ecf20Sopenharmony_ci * correspond to a VIA work-alike named 'EVR'. */
1188c2ecf20Sopenharmony_ci#define	EVRB_XCVR	0x08	/* XCVR_SESSION* */
1198c2ecf20Sopenharmony_ci#define	EVRB_FULL	0x10	/* VIA_FULL */
1208c2ecf20Sopenharmony_ci#define	EVRB_SYSES	0x20	/* SYS_SESSION */
1218c2ecf20Sopenharmony_ci#define	EVRB_AUXIE	0x00	/* Enable A/UX Interrupt Scheme */
1228c2ecf20Sopenharmony_ci#define	EVRB_AUXID	0x40	/* Disable A/UX Interrupt Scheme */
1238c2ecf20Sopenharmony_ci#define	EVRB_SFTWRIE	0x00	/* Software Interrupt ReQuest */
1248c2ecf20Sopenharmony_ci#define	EVRB_SFTWRID	0x80	/* Software Interrupt ReQuest */
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci/*
1278c2ecf20Sopenharmony_ci *	VIA2 A register is the interrupt lines raised off the nubus
1288c2ecf20Sopenharmony_ci *	slots.
1298c2ecf20Sopenharmony_ci *      The below info is from 'Macintosh Family Hardware.'
1308c2ecf20Sopenharmony_ci *      MkLinux calls the 'IIci internal video IRQ' below the 'RBV slot 0 irq.'
1318c2ecf20Sopenharmony_ci *      It also notes that the slot $9 IRQ is the 'Ethernet IRQ' and
1328c2ecf20Sopenharmony_ci *      defines the 'Video IRQ' as 0x40 for the 'EVR' VIA work-alike.
1338c2ecf20Sopenharmony_ci *      Perhaps OSS uses vRAM1 and vRAM2 for ADB.
1348c2ecf20Sopenharmony_ci */
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci#define VIA2A_vRAM1	0x80	/* RAM size bit 1 (IIci: reserved) */
1378c2ecf20Sopenharmony_ci#define VIA2A_vRAM0	0x40	/* RAM size bit 0 (IIci: internal video IRQ) */
1388c2ecf20Sopenharmony_ci#define VIA2A_vIRQE	0x20	/* IRQ from slot $E */
1398c2ecf20Sopenharmony_ci#define VIA2A_vIRQD	0x10	/* IRQ from slot $D */
1408c2ecf20Sopenharmony_ci#define VIA2A_vIRQC	0x08	/* IRQ from slot $C */
1418c2ecf20Sopenharmony_ci#define VIA2A_vIRQB	0x04	/* IRQ from slot $B */
1428c2ecf20Sopenharmony_ci#define VIA2A_vIRQA	0x02	/* IRQ from slot $A */
1438c2ecf20Sopenharmony_ci#define VIA2A_vIRQ9	0x01	/* IRQ from slot $9 */
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci/* RAM size bits decoded as follows:
1468c2ecf20Sopenharmony_ci * bit1 bit0  size of ICs in bank A
1478c2ecf20Sopenharmony_ci *  0    0    256 kbit
1488c2ecf20Sopenharmony_ci *  0    1    1 Mbit
1498c2ecf20Sopenharmony_ci *  1    0    4 Mbit
1508c2ecf20Sopenharmony_ci *  1    1   16 Mbit
1518c2ecf20Sopenharmony_ci */
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci/*
1548c2ecf20Sopenharmony_ci *	Register B has the fun stuff in it
1558c2ecf20Sopenharmony_ci */
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci#define VIA2B_vVBL	0x80	/* VBL output to VIA1 (60.15Hz) driven by
1588c2ecf20Sopenharmony_ci				 * timer T1.
1598c2ecf20Sopenharmony_ci				 * on IIci, parity test: 0=test mode.
1608c2ecf20Sopenharmony_ci				 * [MkLinux] RBV_PARODD: 1=odd,0=even. */
1618c2ecf20Sopenharmony_ci#define VIA2B_vSndJck	0x40	/* External sound jack status.
1628c2ecf20Sopenharmony_ci				 * 0=plug is inserted.  On SE/30, always 0 */
1638c2ecf20Sopenharmony_ci#define VIA2B_vTfr0	0x20	/* Transfer mode bit 0 ack from NuBus */
1648c2ecf20Sopenharmony_ci#define VIA2B_vTfr1	0x10	/* Transfer mode bit 1 ack from NuBus */
1658c2ecf20Sopenharmony_ci#define VIA2B_vMode32	0x08	/* 24/32bit switch - doubles as cache flush
1668c2ecf20Sopenharmony_ci				 * on II, AMU/PMMU control.
1678c2ecf20Sopenharmony_ci				 *   if AMU, 0=24bit to 32bit translation
1688c2ecf20Sopenharmony_ci				 *   if PMMU, 1=PMMU is accessing page table.
1698c2ecf20Sopenharmony_ci				 * on SE/30 tied low.
1708c2ecf20Sopenharmony_ci				 * on IIx,IIcx,IIfx, unused.
1718c2ecf20Sopenharmony_ci				 * on IIci/RBV, cache control. 0=flush cache.
1728c2ecf20Sopenharmony_ci				 */
1738c2ecf20Sopenharmony_ci#define VIA2B_vPower	0x04	/* Power off, 0=shut off power.
1748c2ecf20Sopenharmony_ci				 * on SE/30 this signal sent to PDS card. */
1758c2ecf20Sopenharmony_ci#define VIA2B_vBusLk	0x02	/* Lock NuBus transactions, 0=locked.
1768c2ecf20Sopenharmony_ci				 * on SE/30 sent to PDS card. */
1778c2ecf20Sopenharmony_ci#define VIA2B_vCDis	0x01	/* Cache control. On IIci, 1=disable cache card
1788c2ecf20Sopenharmony_ci				 * on others, 0=disable processor's instruction
1798c2ecf20Sopenharmony_ci				 * and data caches. */
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci/* Apple sez: http://developer.apple.com/technotes/ov/ov_04.html
1828c2ecf20Sopenharmony_ci * Another example of a valid function that has no ROM support is the use
1838c2ecf20Sopenharmony_ci * of the alternate video page for page-flipping animation. Since there
1848c2ecf20Sopenharmony_ci * is no ROM call to flip pages, it is necessary to go play with the
1858c2ecf20Sopenharmony_ci * right bit in the VIA chip (6522 Versatile Interface Adapter).
1868c2ecf20Sopenharmony_ci * [CSA: don't know which one this is, but it's one of 'em!]
1878c2ecf20Sopenharmony_ci */
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci/*
1908c2ecf20Sopenharmony_ci *	6522 registers - see databook.
1918c2ecf20Sopenharmony_ci * CSA: Assignments for VIA1 confirmed from CHRP spec.
1928c2ecf20Sopenharmony_ci */
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci/* partial address decode.  0xYYXX : XX part for RBV, YY part for VIA */
1958c2ecf20Sopenharmony_ci/* Note: 15 VIA regs, 8 RBV regs */
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci#define vBufB	0x0000	/* [VIA/RBV]  Register B */
1988c2ecf20Sopenharmony_ci#define vBufAH	0x0200  /* [VIA only] Buffer A, with handshake. DON'T USE! */
1998c2ecf20Sopenharmony_ci#define vDirB	0x0400  /* [VIA only] Data Direction Register B. */
2008c2ecf20Sopenharmony_ci#define vDirA	0x0600  /* [VIA only] Data Direction Register A. */
2018c2ecf20Sopenharmony_ci#define vT1CL	0x0800  /* [VIA only] Timer one counter low. */
2028c2ecf20Sopenharmony_ci#define vT1CH	0x0a00  /* [VIA only] Timer one counter high. */
2038c2ecf20Sopenharmony_ci#define vT1LL	0x0c00  /* [VIA only] Timer one latches low. */
2048c2ecf20Sopenharmony_ci#define vT1LH	0x0e00  /* [VIA only] Timer one latches high. */
2058c2ecf20Sopenharmony_ci#define vT2CL	0x1000  /* [VIA only] Timer two counter low. */
2068c2ecf20Sopenharmony_ci#define vT2CH	0x1200  /* [VIA only] Timer two counter high. */
2078c2ecf20Sopenharmony_ci#define vSR	0x1400  /* [VIA only] Shift register. */
2088c2ecf20Sopenharmony_ci#define vACR	0x1600  /* [VIA only] Auxiliary control register. */
2098c2ecf20Sopenharmony_ci#define vPCR	0x1800  /* [VIA only] Peripheral control register. */
2108c2ecf20Sopenharmony_ci                        /*            CHRP sez never ever to *write* this.
2118c2ecf20Sopenharmony_ci			 *            Mac family says never to *change* this.
2128c2ecf20Sopenharmony_ci			 * In fact we need to initialize it once at start. */
2138c2ecf20Sopenharmony_ci#define vIFR	0x1a00  /* [VIA/RBV]  Interrupt flag register. */
2148c2ecf20Sopenharmony_ci#define vIER	0x1c00  /* [VIA/RBV]  Interrupt enable register. */
2158c2ecf20Sopenharmony_ci#define vBufA	0x1e00  /* [VIA/RBV] register A (no handshake) */
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ci/* The RBV only decodes the bottom eight address lines; the VIA doesn't
2188c2ecf20Sopenharmony_ci * decode the bottom eight -- so vBufB | rBufB will always get you BufB */
2198c2ecf20Sopenharmony_ci/* CSA: in fact, only bits 0,1, and 4 seem to be decoded.
2208c2ecf20Sopenharmony_ci * BUT note the values for rIER and rIFR, where the top 8 bits *do* seem
2218c2ecf20Sopenharmony_ci * to matter.  In fact *all* of the top 8 bits seem to matter;
2228c2ecf20Sopenharmony_ci * setting rIER=0x1813 and rIFR=0x1803 doesn't work, either.
2238c2ecf20Sopenharmony_ci * Perhaps some sort of 'compatibility mode' is built-in? [21-May-1999]
2248c2ecf20Sopenharmony_ci */
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_ci#define rBufB   0x0000  /* [VIA/RBV]  Register B */
2278c2ecf20Sopenharmony_ci#define rExp	0x0001	/* [RBV only] RBV future expansion (always 0) */
2288c2ecf20Sopenharmony_ci#define rSIFR	0x0002  /* [RBV only] RBV slot interrupts register. */
2298c2ecf20Sopenharmony_ci#define rIFR	0x1a03  /* [VIA/RBV]  RBV interrupt flag register. */
2308c2ecf20Sopenharmony_ci#define rMonP   0x0010  /* [RBV only] RBV video monitor type. */
2318c2ecf20Sopenharmony_ci#define rChpT   0x0011  /* [RBV only] RBV test mode register (reads as 0). */
2328c2ecf20Sopenharmony_ci#define rSIER   0x0012  /* [RBV only] RBV slot interrupt enables. */
2338c2ecf20Sopenharmony_ci#define rIER    0x1c13  /* [VIA/RBV]  RBV interrupt flag enable register. */
2348c2ecf20Sopenharmony_ci#define rBufA	rSIFR   /* the 'slot interrupts register' is BufA on a VIA */
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci/*
2378c2ecf20Sopenharmony_ci * Video monitor parameters, for rMonP:
2388c2ecf20Sopenharmony_ci */
2398c2ecf20Sopenharmony_ci#define RBV_DEPTH  0x07	/* bits per pixel: 000=1,001=2,010=4,011=8 */
2408c2ecf20Sopenharmony_ci#define RBV_MONID  0x38	/* monitor type, as below. */
2418c2ecf20Sopenharmony_ci#define RBV_VIDOFF 0x40	/* 1 turns off onboard video */
2428c2ecf20Sopenharmony_ci/* Supported monitor types: */
2438c2ecf20Sopenharmony_ci#define MON_15BW   (1<<3) /* 15" BW portrait. */
2448c2ecf20Sopenharmony_ci#define MON_IIGS   (2<<3) /* 12" color (modified IIGS monitor). */
2458c2ecf20Sopenharmony_ci#define MON_15RGB  (5<<3) /* 15" RGB portrait. */
2468c2ecf20Sopenharmony_ci#define MON_12OR13 (6<<3) /* 12" BW or 13" RGB. */
2478c2ecf20Sopenharmony_ci#define MON_NONE   (7<<3) /* No monitor attached. */
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ci/* To clarify IER manipulations */
2508c2ecf20Sopenharmony_ci#define IER_SET_BIT(b) (0x80 | (1<<(b)) )
2518c2ecf20Sopenharmony_ci#define IER_CLR_BIT(b) (0x7F & (1<<(b)) )
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
2548c2ecf20Sopenharmony_ci
2558c2ecf20Sopenharmony_ciextern volatile __u8 *via1,*via2;
2568c2ecf20Sopenharmony_ciextern int rbv_present,via_alt_mapping;
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_cistruct irq_desc;
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ciextern void via_l2_flush(int writeback);
2618c2ecf20Sopenharmony_ciextern void via_register_interrupts(void);
2628c2ecf20Sopenharmony_ciextern void via_irq_enable(int);
2638c2ecf20Sopenharmony_ciextern void via_irq_disable(int);
2648c2ecf20Sopenharmony_ciextern void via_nubus_irq_startup(int irq);
2658c2ecf20Sopenharmony_ciextern void via_nubus_irq_shutdown(int irq);
2668c2ecf20Sopenharmony_ciextern void via1_irq(struct irq_desc *desc);
2678c2ecf20Sopenharmony_ciextern void via1_set_head(int);
2688c2ecf20Sopenharmony_ciextern int via2_scsi_drq_pending(void);
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_cistatic inline int rbv_set_video_bpp(int bpp)
2718c2ecf20Sopenharmony_ci{
2728c2ecf20Sopenharmony_ci	char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1;
2738c2ecf20Sopenharmony_ci	if (!rbv_present || val<0) return -1;
2748c2ecf20Sopenharmony_ci	via2[rMonP] = (via2[rMonP] & ~RBV_DEPTH) | val;
2758c2ecf20Sopenharmony_ci	return 0;
2768c2ecf20Sopenharmony_ci}
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci#endif /* __ASSEMBLY__ */
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ci#endif /* _ASM_MAC_VIA_H_ */
281