103831d3stevel/*
203831d3stevel * CDDL HEADER START
303831d3stevel *
403831d3stevel * The contents of this file are subject to the terms of the
503831d3stevel * Common Development and Distribution License (the "License").
603831d3stevel * You may not use this file except in compliance with the License.
703831d3stevel *
803831d3stevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
903831d3stevel * or http://www.opensolaris.org/os/licensing.
1003831d3stevel * See the License for the specific language governing permissions
1103831d3stevel * and limitations under the License.
1203831d3stevel *
1303831d3stevel * When distributing Covered Code, include this CDDL HEADER in each
1403831d3stevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1503831d3stevel * If applicable, add the following below this CDDL HEADER, with the
1603831d3stevel * fields enclosed by brackets "[]" replaced with your own identifying
1703831d3stevel * information: Portions Copyright [yyyy] [name of copyright owner]
1803831d3stevel *
1903831d3stevel * CDDL HEADER END
2003831d3stevel */
2103831d3stevel
2203831d3stevel/*
2303831d3stevel * Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
2403831d3stevel * Use is subject to license terms.
2503831d3stevel */
2603831d3stevel
2703831d3stevel#ifndef _RMC_COMM_DP_BOOT_H
2803831d3stevel#define	_RMC_COMM_DP_BOOT_H
2903831d3stevel
3003831d3stevel#pragma ident	"%Z%%M%	%I%	%E% SMI"
3103831d3stevel
3203831d3stevel#ifdef __cplusplus
3303831d3stevelextern "C" {
3403831d3stevel#endif
3503831d3stevel
3603831d3stevel/* Boot protocol message types */
3703831d3stevel
3803831d3stevel#define	BP_OBP_TEST		0xC0
3903831d3stevel#define	BP_OBP_INIT		0xC1
4003831d3stevel#define	BP_OBP_ENQUIRE		0xC2
4103831d3stevel#define	BP_OBP_BOOTINIT		0xC3
4203831d3stevel#define	BP_OBP_RESET		0xC4
4303831d3stevel#define	BP_OBP_MACADDR		0xC5
4403831d3stevel#define	BP_OBP_BOOTMODE		0xC6
4503831d3stevel#define	BP_OBP_HOST_MACADDR	0xC7
4603831d3stevel#define	BP_OBP_SOFT_GPIO 	0xC8
4703831d3stevel
4803831d3stevel#define	BP_RSC_TESTACK		0xD0
4903831d3stevel#define	BP_RSC_DIAG		0xD1
5003831d3stevel#define	BP_RSC_OK		0xD2
5103831d3stevel#define	BP_RSC_STATUS		0xD3
5203831d3stevel#define	BP_RSC_MACADDRACK	0xD5
5303831d3stevel#define	BP_RSC_BOOTMODEACK	0xD6
5403831d3stevel#define	BP_RSC_BOOTREQ		0xD8
5503831d3stevel#define	BP_RSC_BOOTACK		0xD9
5603831d3stevel#define	BP_RSC_BOOTFAIL		0xDA
5703831d3stevel#define	BP_RSC_BOOTOK		0xDB
5803831d3stevel#define	BP_RSC_SOFTGPIOACK	0xDD
5903831d3stevel
6003831d3stevel#define	BP_MIN_CMD		0xC0
6103831d3stevel#define	BP_MAX_CMD		0xDF
6203831d3stevel
6303831d3stevel/*
6403831d3stevel * A boot protocol message consists of one (or more) synchronizing
6503831d3stevel * bytes, a command byte, and two data bytes.  The following structure
6603831d3stevel * defines how a boot message is passed around.  Hopefully the C
6703831d3stevel * compiler will be smart enough to pass this in a register...
6803831d3stevel */
6903831d3stevel
7003831d3stevel#define	BP_SYNC		0x80
7103831d3stevel
7203831d3steveltypedef struct bp_msg {
7303831d3stevel	uint8_t pad;	/* make it 4 bytes long */
7403831d3stevel	uint8_t cmd;
7503831d3stevel	uint8_t dat1;
7603831d3stevel	uint8_t dat2;
7703831d3stevel} bp_msg_t;
7803831d3stevel
7903831d3stevel/* Test numbers used in the OBP_TEST message: */
8003831d3stevel#define	BP_DAT1_MIN_TEST	0
8103831d3stevel#define	BP_DAT1_TTYC_ECHO_ON	0
8203831d3stevel#define	BP_DAT1_TTYC_ECHO_OFF	1
8303831d3stevel#define	BP_DAT1_TTYD_ECHO_ON	2
8403831d3stevel#define	BP_DAT1_TTYD_ECHO_OFF	3
8503831d3stevel#define	BP_DAT1_TTYCD_ECHO_ON	4
8603831d3stevel#define	BP_DAT1_TTYCD_ECHO_OFF	5
8703831d3stevel#define	BP_DAT1_ENET_INT_LB	6
8803831d3stevel#define	BP_DAT1_ENET_EXT_LB	7
8903831d3stevel#define	BP_DAT1_TTYU_INT_LB	8
9003831d3stevel#define	BP_DAT1_TTYU_EXT_LB	9
9103831d3stevel#define	BP_DAT1_SEEPROM_CKSUM	10
9203831d3stevel#define	BP_DAT1_DUMMY_TEST	11
9303831d3stevel#define	BP_DAT1_FRU_CKSUM	12
9403831d3stevel#define	BP_DAT1_FLASH_CKSUM	13
9503831d3stevel#define	BP_DAT1_TOD_TEST	14
9603831d3stevel#define	BP_DAT1_MODEM_TEST	15
9703831d3stevel#define	BP_DAT1_MAX_TEST	15
9803831d3stevel
9903831d3stevel/*
10003831d3stevel * This bit should be set in the RSC_STATUS message to indicate to the
10103831d3stevel * host that there is an interesting bootmode.
10203831d3stevel */
10303831d3stevel#define	BP_DAT1_VALID_BOOTMODE	0x40
10403831d3stevel
10503831d3stevel/*
10603831d3stevel * Bit definitions for the OBP_INIT and RSC_OK messages.
10703831d3stevel */
10803831d3stevel
10903831d3stevel#define	BP_DAT1_MENUS	0x80
11003831d3stevel#define	BP_DAT1_MAX	0x40
11103831d3stevel#define	BP_DAT1_MED	0x20
11203831d3stevel#define	BP_DAT1_MIN	0x10
11303831d3stevel#define	BP_DAT1_MBO	0x01
11403831d3stevel
11503831d3stevel#define	BP_DAT2_DIAGSW	0x01
11603831d3stevel
11703831d3stevel/* Bit definitions for OBP_BOOTINIT message. */
11803831d3stevel
11903831d3stevel#define	BP_DAT2_FLASH_PDAT	0x04
12003831d3stevel#define	BP_DAT2_FLASH_MAIN	0x02
12103831d3stevel#define	BP_DAT2_FLASH_BOOT	0x01
12203831d3stevel
12303831d3stevel/*
12403831d3stevel * For bit definitions for the RSC_STATUS message, see the post word bit
12503831d3stevel * definitions in "postword.h".
12603831d3stevel */
12703831d3stevel
12803831d3stevel/* Bit definitions for RSC_BOOTFAIL message. */
12903831d3stevel
13003831d3stevel#define	BP_DAT1_REJECTED	0x40
13103831d3stevel#define	BP_DAT1_RANGE_ERR	0x20
13203831d3stevel#define	BP_DAT1_VERIFY_ERR	0x10
13303831d3stevel#define	BP_DAT1_ERASE_ERR	0x08
13403831d3stevel#define	BP_DAT1_INT_WP_ERR	0x04
13503831d3stevel#define	BP_DAT1_WP_ERR		0x02
13603831d3stevel#define	BP_DAT1_VPP_ERR		0x01
13703831d3stevel
13803831d3stevel/* For lower 8 bits, see the lower 8 bits of the post word in "postword.h". */
13903831d3stevel
14003831d3stevel#define	KANTH_SRECORD_ACK
14103831d3stevel
14203831d3stevel/*
14303831d3stevel * When downloading S-records, a RSC:bootack is sent with the following
14403831d3stevel * value in dat1 to indicate whether the S-record checksum was OK or not.
14503831d3stevel */
14603831d3stevel
14703831d3stevel#define	BP_DAT1_BOOTINIT_ACK	0x00
14803831d3stevel#define	BP_DAT1_SRECORD_ACK	0x01
14903831d3stevel#define	BP_DAT1_SRECORD_NAK	0x02
15003831d3stevel
15103831d3stevel/* Definitions for OBP_BOOTMODE message: */
15203831d3stevel#define	BP_DAT2_BOOTMODE_CLEAR		1
15303831d3stevel
15403831d3stevel/* Definitions for RSC_BOOTMODE message: */
15503831d3stevel#define	BP_BAT1_BOOTMODE_DATAMSB	0x10
15603831d3stevel#define	BP_DAT1_BOOTMODE_OFFSET_MASK	0x07
15703831d3stevel
15803831d3stevel#define	BP_DAT2_BOOTMODE_DATA_MASK	0x7F
15903831d3stevel
16003831d3stevel/* Definitions for RSC_BOOTMODEACK message: */
16103831d3stevel#define	BP_DAT1_BOOTMODE_NORMAL		0
16203831d3stevel#define	BP_DAT1_BOOTMODE_FORTH		1
16303831d3stevel#define	BP_DAT1_BOOTMODE_RESET_NVRAM	2
16403831d3stevel#define	BP_DAT1_BOOTMODE_DIAG		3
16503831d3stevel#define	BP_DAT1_BOOTMODE_SKIP_DIAG	4
16603831d3stevel
16703831d3stevel#define	BP_DAT2_BOOTOPT_CONSOLE_RSC	1
16803831d3stevel
16903831d3stevel/* Definitions for RSC_MACADDRACK message: */
17003831d3stevel#define	BP_DAT2_MACADDRACK_OK		0
17103831d3stevel#define	BP_DAT2_MACADDRACK_DONE		1
17203831d3stevel#define	BP_DAT2_MACADDRACK_BADOFFSET	2
17303831d3stevel#define	BP_DAT2_MACADDRACK_NOTREADY	3
17403831d3stevel#define	BP_DAT2_MACADDRACK_NVERR	4
17503831d3stevel
17603831d3stevel/* Definitions for RSC_SOFTGPIOACK message */
17703831d3stevel#define	BP_DAT2_HOST_TYPE_OK		0
17803831d3stevel#define	BP_DAT2_HOST_TYPE_NVERR		1
17903831d3stevel
18003831d3stevel#ifdef __cplusplus
18103831d3stevel}
18203831d3stevel#endif
18303831d3stevel
18403831d3stevel#endif /* _RMC_COMM_DP_BOOT_H */
185