xref: /illumos-gate/usr/src/uts/sun/sys/obpdefs.h (revision fafb665d)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
52d7b546fSlq  * Common Development and Distribution License (the "License").
62d7b546fSlq  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
222d7b546fSlq  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_SYS_OBPDEFS_H
277c478bd9Sstevel@tonic-gate #define	_SYS_OBPDEFS_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
307c478bd9Sstevel@tonic-gate extern "C" {
317c478bd9Sstevel@tonic-gate #endif
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #define	OBP_PSEUDO_ROMVEC_VERSION	5555
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate typedef	int		ihandle_t;
367c478bd9Sstevel@tonic-gate typedef	int		phandle_t;
37fa9e4066Sahrens typedef	phandle_t	pnode_t;
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate /*
407c478bd9Sstevel@tonic-gate  * Device type matching
417c478bd9Sstevel@tonic-gate  */
427c478bd9Sstevel@tonic-gate 
43fa9e4066Sahrens #define	OBP_NONODE	((pnode_t)0)
44fa9e4066Sahrens #define	OBP_BADNODE	((pnode_t)-1)
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate /*
477c478bd9Sstevel@tonic-gate  * Property Defines
487c478bd9Sstevel@tonic-gate  */
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate #define	OBP_NAME		"name"
517c478bd9Sstevel@tonic-gate #define	OBP_REG			"reg"
527c478bd9Sstevel@tonic-gate #define	OBP_INTR		"intr"
537c478bd9Sstevel@tonic-gate #define	OBP_RANGES		"ranges"
547c478bd9Sstevel@tonic-gate #define	OBP_INTERRUPTS		"interrupts"
557c478bd9Sstevel@tonic-gate #define	OBP_COMPATIBLE		"compatible"
567c478bd9Sstevel@tonic-gate #define	OBP_STATUS		"status"
577c478bd9Sstevel@tonic-gate #define	OBP_BOARDNUM		"board#"
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate #define	OBP_MAC_ADDR		"mac-address"
607c478bd9Sstevel@tonic-gate #define	OBP_STDINPATH		"stdin-path"
617c478bd9Sstevel@tonic-gate #define	OBP_STDOUTPATH		"stdout-path"
627c478bd9Sstevel@tonic-gate #define	OBP_IDPROM		"idprom"
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate #define	OBP_DEVICETYPE		"device_type"
657c478bd9Sstevel@tonic-gate #define	OBP_DISPLAY		"display"
662d7b546fSlq #define	OBP_DISPLAY_CONSOLE	"console"
677c478bd9Sstevel@tonic-gate #define	OBP_NETWORK		"network"
687c478bd9Sstevel@tonic-gate #define	OBP_BYTE		"byte"
697c478bd9Sstevel@tonic-gate #define	OBP_BLOCK		"block"
707c478bd9Sstevel@tonic-gate #define	OBP_SERIAL		"serial"
717c478bd9Sstevel@tonic-gate #define	OBP_HIERARCHICAL	"hierarchical"
727c478bd9Sstevel@tonic-gate #define	OBP_IPI			"ipi3"
737c478bd9Sstevel@tonic-gate #define	OBP_CPU			"cpu"
747c478bd9Sstevel@tonic-gate #define	OBP_ADDRESS		"address"
75*986fd29aSsetje #define	OBP_SIZE		"size"
76*986fd29aSsetje #define	OBP_ALLOCSIZE		"alloc-size"
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate /*
797c478bd9Sstevel@tonic-gate  * OBP status values defines
807c478bd9Sstevel@tonic-gate  */
817c478bd9Sstevel@tonic-gate #define	OBP_ST_OKAY		"okay"
827c478bd9Sstevel@tonic-gate #define	OBP_ST_DISABLED		"disabled"
837c478bd9Sstevel@tonic-gate #define	OBP_ST_FAIL		"fail"
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate /*
867c478bd9Sstevel@tonic-gate  * Max size of a path component and a property name (not value)
877c478bd9Sstevel@tonic-gate  * These are standard definitions.
887c478bd9Sstevel@tonic-gate  */
897c478bd9Sstevel@tonic-gate #define	OBP_MAXDRVNAME		32	/* defined in P1275 */
907c478bd9Sstevel@tonic-gate #define	OBP_MAXPROPNAME		32	/* defined in P1275 */
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate /*
937c478bd9Sstevel@tonic-gate  * NB: Max pathname length is a platform-dependent parameter.
947c478bd9Sstevel@tonic-gate  * Also note that this parameter is used to define the crpconfig
957c478bd9Sstevel@tonic-gate  * structure in cpr.h. The cprconfig structure is currently
967c478bd9Sstevel@tonic-gate  * consumed by other consolidations. Care should be take before
977c478bd9Sstevel@tonic-gate  * changing this parameter value.
987c478bd9Sstevel@tonic-gate  */
997c478bd9Sstevel@tonic-gate #define	OBP_MAXPATHLEN		256	/* Platform dependent */
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate /*
1027c478bd9Sstevel@tonic-gate  *  Every OBP node must have a `/' followed by at least 2 chars,
1037c478bd9Sstevel@tonic-gate  *  so we can deduce the maxdepth of any OBP tree to be
1047c478bd9Sstevel@tonic-gate  *  OBP_MAXPATHNAME/3.  This is a good first swag.
1057c478bd9Sstevel@tonic-gate  */
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate #define	OBP_STACKDEPTH		(OBP_MAXPATHLEN/3)
1087c478bd9Sstevel@tonic-gate 
1097c478bd9Sstevel@tonic-gate #define	ROMVEC_BLKSIZE		512	/* XXX */
1107c478bd9Sstevel@tonic-gate 
1117c478bd9Sstevel@tonic-gate /*
1127c478bd9Sstevel@tonic-gate  *  OBP Module mailbox messages for MP's
1137c478bd9Sstevel@tonic-gate  *
1147c478bd9Sstevel@tonic-gate  *	00..7F	: power-on self test
1157c478bd9Sstevel@tonic-gate  *
1167c478bd9Sstevel@tonic-gate  *	80..8F	: active in boot prom (at the "ok" prompt)
1177c478bd9Sstevel@tonic-gate  *
1187c478bd9Sstevel@tonic-gate  *	90..EF  : idle in boot prom
1197c478bd9Sstevel@tonic-gate  *
1207c478bd9Sstevel@tonic-gate  *	F0	: active in application
1217c478bd9Sstevel@tonic-gate  *
1227c478bd9Sstevel@tonic-gate  *	F1..FA	: reserved for future use
1237c478bd9Sstevel@tonic-gate  *
1247c478bd9Sstevel@tonic-gate  *	FB	: One processor exited to the PROM via op_exit(),
1257c478bd9Sstevel@tonic-gate  *		  call to prom_stopcpu() requested.
1267c478bd9Sstevel@tonic-gate  *
1277c478bd9Sstevel@tonic-gate  *	FC	: One processor entered the PROM via op_enter(),
1287c478bd9Sstevel@tonic-gate  *		  call to prom_idlecpu() requested.
1297c478bd9Sstevel@tonic-gate  *
1307c478bd9Sstevel@tonic-gate  *	FD	: One processor hit a BREAKPOINT,
1317c478bd9Sstevel@tonic-gate  *		  call to prom_idlecpu() requested.
1327c478bd9Sstevel@tonic-gate  *
1337c478bd9Sstevel@tonic-gate  *	FE	: One processor got a WATCHDOG RESET
1347c478bd9Sstevel@tonic-gate  *		  call to prom_stopcpu() requested.
1357c478bd9Sstevel@tonic-gate  *
1367c478bd9Sstevel@tonic-gate  *	FF	: This processor not available.
1377c478bd9Sstevel@tonic-gate  *
1387c478bd9Sstevel@tonic-gate  */
1397c478bd9Sstevel@tonic-gate 
1407c478bd9Sstevel@tonic-gate #define	OBP_MB_IDLE_LOW		((unsigned char)(0x90))
1417c478bd9Sstevel@tonic-gate #define	OBP_MB_IDLE_HIGH	((unsigned char)(0xef))
1427c478bd9Sstevel@tonic-gate 
1437c478bd9Sstevel@tonic-gate #define	OBP_MB_IS_IDLE(s)	(((s) >= OBP_MB_IDLE_LOW) && \
1447c478bd9Sstevel@tonic-gate 				    ((s) <= OBP_MB_IDLE_HIGH))
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate #define	OBP_MB_ACTIVE		((unsigned char)(0xf0))
1477c478bd9Sstevel@tonic-gate #define	OBP_MB_EXIT_STOP	((unsigned char)(0xfb))
1487c478bd9Sstevel@tonic-gate #define	OBP_MB_ENTER_IDLE	((unsigned char)(0xfc))
1497c478bd9Sstevel@tonic-gate #define	OBP_MB_BRKPT_IDLE	((unsigned char)(0xfd))
1507c478bd9Sstevel@tonic-gate #define	OBP_MB_WATCHDOG_STOP	((unsigned char)(0xfe))
1517c478bd9Sstevel@tonic-gate 
1527c478bd9Sstevel@tonic-gate /*
1537c478bd9Sstevel@tonic-gate  * The possible values for "*romp->v_insource" and "*romp->v_outsink" are
1547c478bd9Sstevel@tonic-gate  * listed below.  These may be extended in the future.  Your program should
1557c478bd9Sstevel@tonic-gate  * cope with this gracefully (e.g. by continuing to vector through the ROM
1567c478bd9Sstevel@tonic-gate  * I/O routines if these are set in a way you don't understand).
1577c478bd9Sstevel@tonic-gate  */
1587c478bd9Sstevel@tonic-gate #define	INKEYB		0	/* Input from parallel keyboard. */
1597c478bd9Sstevel@tonic-gate #define	INUARTA		1	/* Input or output to Uart A.	*/
1607c478bd9Sstevel@tonic-gate #define	INUARTB		2	/* Input or output to Uart B.	*/
1617c478bd9Sstevel@tonic-gate #define	INUARTC		3	/* Input or output to Uart C.	*/
1627c478bd9Sstevel@tonic-gate #define	INUARTD		4	/* Input or output to Uart D.	*/
1637c478bd9Sstevel@tonic-gate #define	OUTSCREEN	0	/* Output to frame buffer.	*/
1647c478bd9Sstevel@tonic-gate #define	OUTUARTA	1	/* Input or output to Uart A.	*/
1657c478bd9Sstevel@tonic-gate #define	OUTUARTB	2	/* Input or output to Uart B.	*/
1667c478bd9Sstevel@tonic-gate #define	OUTUARTC	3	/* Input or output to Uart C.	*/
1677c478bd9Sstevel@tonic-gate #define	OUTUARTD	4	/* Input or output to Uart D.	*/
1687c478bd9Sstevel@tonic-gate 
1697c478bd9Sstevel@tonic-gate /*
1707c478bd9Sstevel@tonic-gate  * Structure set up by the boot command to pass arguments to the booted
1717c478bd9Sstevel@tonic-gate  * program.
1727c478bd9Sstevel@tonic-gate  */
1737c478bd9Sstevel@tonic-gate struct bootparam {
1747c478bd9Sstevel@tonic-gate 	char	*bp_argv[8];	/* String arguments.			*/
1757c478bd9Sstevel@tonic-gate 	char	bp_strings[100]; /* String table for string arguments.	*/
1767c478bd9Sstevel@tonic-gate 	char	bp_dev[2];	/* Device name.				*/
1777c478bd9Sstevel@tonic-gate 	int	bp_ctlr;	/* Controller Number.			*/
1787c478bd9Sstevel@tonic-gate 	int	bp_unit;	/* Unit Number.				*/
1797c478bd9Sstevel@tonic-gate 	int	bp_part;	/* Partition/file Number.		*/
1807c478bd9Sstevel@tonic-gate 	char	*bp_name;	/* File name.  Points into "bp_strings"	*/
1817c478bd9Sstevel@tonic-gate 	struct boottab *bp_boottab; /* Points to table entry for device	*/
1827c478bd9Sstevel@tonic-gate };
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1857c478bd9Sstevel@tonic-gate }
1867c478bd9Sstevel@tonic-gate #endif
1877c478bd9Sstevel@tonic-gate 
1887c478bd9Sstevel@tonic-gate #endif	/* _SYS_OBPDEFS_H */
189