/*
 * $Header: /smsa/bsd:include/arm/mc_type.h:bsd  1.5  $
 * $Source: /smsa/bsd:include/arm/mc_type.h: $
 *
 * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
 *
 */

#ifndef	__arm_mc_type_h
#define	__arm_mc_type_h
#define	__machine_mc_type_h	"arm"

/* mc_type.h
 *
 * Values for machine_type
 *
 */

extern int machine_type;
#define	MC_A500_ARCH	1	/* Either a A500 or an ARCH, cmos clock will decide */
#define	MC_A500		2
#define	MC_ARCH		3
#define MC_R140		3	/* R140s are basically the same as A440s. */
#define	MC_M4		4
#define	MC_A680		5
#define MC_FOX		6

/*
 * categorise features that differ between the various
 * types of machine supported by the kernel
 */

/*
 * serial chips: some machines use Zilog chip, others 
 * use a 65C51 driver. Some have versions of RISC OS
 * which fail to leave the serial driver in a clean state
 * therefore need initialisation during kernel boot.
 */
#define MC_SET_ZILOG_SERIAL	(1 << MC_A680)
#define MC_SET_INIT_SERIAL	((1 << MC_A500) | (1 << MC_ARCH) | \
				 (1 << MC_FOX))

/*
 * Real Time Clocks: two varieties currently
 * supported - at the moment it is A500 vs.
 * the rest of the world
 */
#define MC_SET_A500RTC		(1 << MC_A500)
#define MC_SET_ARCHRTC		((1 << MC_ARCH) | (1 << MC_A680) | \
				 (1 << MC_FOX))

/*
 * Centronics ports: the world is divided into
 * two groups - the Centronics interface first
 * seen on an A500, and that which made its
 * debut on the A680
 */
#define MC_SET_A500CP		((1 << MC_A500) | (1 << MC_ARCH) | \
				 (1 << MC_FOX))
#define MC_SET_A680CP		(1 << MC_A680)

/*
 * different flavours of floppy drives: currently
 * have three different flavours:
 *
 * FDA500: first seen in A500 machines
 * FDA680: first seen in A680 machines
 * FDARCH: first seen in Archimedes machines
 */
#define MC_SET_A500FD		(1 << MC_A500)
#define MC_SET_A680FD		(1 << MC_A680)
#define MC_SET_ARCHFD		((1 << MC_ARCH) | (1 << MC_FOX))

/*
 * Internal disc drives: define the set of machines which
 * have an internal st506 winchester, and the subset of these
 * machines which have discrete interrupt lines for command and
 * data interrupts. Define which machines have an internal SCSI
 * controller
 */
#define MC_SET_INT_ST506	((1 << MC_A500) | (1 << MC_ARCH))
#define MC_SET_DISCRETE_ST_INTS	(1 << MC_A500)
#define MC_SET_INT_SCSI		(1 << MC_A680)

/*
 * miscellaneous bits & pieces: machines which support
 * expansion cards with separate interrupt masking;
 * machines that have a sound mute bit in IOC; which
 * machines have VIDC1s, and which have VIDC2s.
 */
#define MC_SET_XCB_MASK		((1 << MC_ARCH) | (1 << MC_A680) | \
				 (1 << MC_FOX))
#define MC_SET_IOC_SMUTE	((1 << MC_A500) | (1 << MC_ARCH) | \
				 (1 << MC_FOX))
#define MC_SET_VIDC1		(1 << MC_A500)
#define MC_SET_VIDC2		((1 << MC_ARCH) | (1 << MC_A680) | \
				 (1 << MC_FOX))

/*
 * default root devices for machine types: can
 * currently choose from st506, internal SCSI
 * and expansion card SCSI
 */
#define MC_SET_DEF_ST506	((1 << MC_A500) | (1 << MC_ARCH))
#define MC_SET_DEF_INTSCSI	(1 << MC_A680)
#define MC_SET_DEF_PSSCSI	(1 << MC_FOX)

/*
 * macros to examine which machine types belong in
 * which sets
 */
#define MC_IN_SET(x, y)		(MC_SET_/**/x & (1 << y))

#define MC_HAVE_ZILOG_SERIAL(x)	(MC_IN_SET(ZILOG_SERIAL, (x)))
#define MC_SERIAL_NEEDS_INIT(x)	(MC_IN_SET(INIT_SERIAL, (x)))

#define MC_RTCA500(x)		(MC_IN_SET(A500RTC, (x)))
#define MC_RTCARCH(x)		(MC_IN_SET(ARCHRTC, (x)))

#define MC_CPA500(x)		(MC_IN_SET(A500CP, (x)))
#define MC_CPA680(x)		(MC_IN_SET(A680CP, (x)))

#define MC_FDA500(x)		(MC_IN_SET(A500FD, (x)))
#define MC_FDA680(x)		(MC_IN_SET(A680FD, (x)))
#define MC_FDARCH(x)		(MC_IN_SET(ARCHFD, (x)))

#define MC_HAVE_ST506(x)       	(MC_IN_SET(INT_ST506, (x)))
#define MC_ST506_2INTS(x)	(MC_IN_SET(DISCRETE_ST_INTS, (x)))
#define MC_HAVE_INTSCSI(x)	(MC_IN_SET(INT_SCSI, (x)))

#define MC_HAVE_XCB_MASK(x)	(MC_IN_SET(XCB_MASK, (x)))
#define MC_HAVE_SMUTE(x)	(MC_IN_SET(IOC_SMUTE, (x)))
#define MC_HAVE_VIDC1(x)	(MC_IN_SET(VIDC1, (x)))
#define MC_HAVE_VIDC2(x)	(MC_IN_SET(VIDC2, (x)))

#define MC_ST506_ROOT(x)       	(MC_IN_SET(DEF_ST506, (x)))
#define MC_INTSCSI_ROOT(x)	(MC_IN_SET(DEF_INTSCSI, (x)))
#define MC_PSSCSI_ROOT(x)	(MC_IN_SET(DEF_PSSCSI, (x)))

#endif/*__arm_mc_type_h*/

/* EOF mc_type.h */
