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