1*1708Sstevel /* 2*1708Sstevel * CDDL HEADER START 3*1708Sstevel * 4*1708Sstevel * The contents of this file are subject to the terms of the 5*1708Sstevel * Common Development and Distribution License (the "License"). 6*1708Sstevel * You may not use this file except in compliance with the License. 7*1708Sstevel * 8*1708Sstevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*1708Sstevel * or http://www.opensolaris.org/os/licensing. 10*1708Sstevel * See the License for the specific language governing permissions 11*1708Sstevel * and limitations under the License. 12*1708Sstevel * 13*1708Sstevel * When distributing Covered Code, include this CDDL HEADER in each 14*1708Sstevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*1708Sstevel * If applicable, add the following below this CDDL HEADER, with the 16*1708Sstevel * fields enclosed by brackets "[]" replaced with your own identifying 17*1708Sstevel * information: Portions Copyright [yyyy] [name of copyright owner] 18*1708Sstevel * 19*1708Sstevel * CDDL HEADER END 20*1708Sstevel */ 21*1708Sstevel 22*1708Sstevel /* 23*1708Sstevel * Copyright 2002 Sun Microsystems, Inc. All rights reserved. 24*1708Sstevel * Use is subject to license terms. 25*1708Sstevel */ 26*1708Sstevel 27*1708Sstevel #ifndef _RMC_COMM_DP_BOOT_H 28*1708Sstevel #define _RMC_COMM_DP_BOOT_H 29*1708Sstevel 30*1708Sstevel #pragma ident "%Z%%M% %I% %E% SMI" 31*1708Sstevel 32*1708Sstevel #ifdef __cplusplus 33*1708Sstevel extern "C" { 34*1708Sstevel #endif 35*1708Sstevel 36*1708Sstevel /* Boot protocol message types */ 37*1708Sstevel 38*1708Sstevel #define BP_OBP_TEST 0xC0 39*1708Sstevel #define BP_OBP_INIT 0xC1 40*1708Sstevel #define BP_OBP_ENQUIRE 0xC2 41*1708Sstevel #define BP_OBP_BOOTINIT 0xC3 42*1708Sstevel #define BP_OBP_RESET 0xC4 43*1708Sstevel #define BP_OBP_MACADDR 0xC5 44*1708Sstevel #define BP_OBP_BOOTMODE 0xC6 45*1708Sstevel #define BP_OBP_HOST_MACADDR 0xC7 46*1708Sstevel #define BP_OBP_SOFT_GPIO 0xC8 47*1708Sstevel 48*1708Sstevel #define BP_RSC_TESTACK 0xD0 49*1708Sstevel #define BP_RSC_DIAG 0xD1 50*1708Sstevel #define BP_RSC_OK 0xD2 51*1708Sstevel #define BP_RSC_STATUS 0xD3 52*1708Sstevel #define BP_RSC_MACADDRACK 0xD5 53*1708Sstevel #define BP_RSC_BOOTMODEACK 0xD6 54*1708Sstevel #define BP_RSC_BOOTREQ 0xD8 55*1708Sstevel #define BP_RSC_BOOTACK 0xD9 56*1708Sstevel #define BP_RSC_BOOTFAIL 0xDA 57*1708Sstevel #define BP_RSC_BOOTOK 0xDB 58*1708Sstevel #define BP_RSC_SOFTGPIOACK 0xDD 59*1708Sstevel 60*1708Sstevel #define BP_MIN_CMD 0xC0 61*1708Sstevel #define BP_MAX_CMD 0xDF 62*1708Sstevel 63*1708Sstevel /* 64*1708Sstevel * A boot protocol message consists of one (or more) synchronizing 65*1708Sstevel * bytes, a command byte, and two data bytes. The following structure 66*1708Sstevel * defines how a boot message is passed around. Hopefully the C 67*1708Sstevel * compiler will be smart enough to pass this in a register... 68*1708Sstevel */ 69*1708Sstevel 70*1708Sstevel #define BP_SYNC 0x80 71*1708Sstevel 72*1708Sstevel typedef struct bp_msg { 73*1708Sstevel uint8_t pad; /* make it 4 bytes long */ 74*1708Sstevel uint8_t cmd; 75*1708Sstevel uint8_t dat1; 76*1708Sstevel uint8_t dat2; 77*1708Sstevel } bp_msg_t; 78*1708Sstevel 79*1708Sstevel /* Test numbers used in the OBP_TEST message: */ 80*1708Sstevel #define BP_DAT1_MIN_TEST 0 81*1708Sstevel #define BP_DAT1_TTYC_ECHO_ON 0 82*1708Sstevel #define BP_DAT1_TTYC_ECHO_OFF 1 83*1708Sstevel #define BP_DAT1_TTYD_ECHO_ON 2 84*1708Sstevel #define BP_DAT1_TTYD_ECHO_OFF 3 85*1708Sstevel #define BP_DAT1_TTYCD_ECHO_ON 4 86*1708Sstevel #define BP_DAT1_TTYCD_ECHO_OFF 5 87*1708Sstevel #define BP_DAT1_ENET_INT_LB 6 88*1708Sstevel #define BP_DAT1_ENET_EXT_LB 7 89*1708Sstevel #define BP_DAT1_TTYU_INT_LB 8 90*1708Sstevel #define BP_DAT1_TTYU_EXT_LB 9 91*1708Sstevel #define BP_DAT1_SEEPROM_CKSUM 10 92*1708Sstevel #define BP_DAT1_DUMMY_TEST 11 93*1708Sstevel #define BP_DAT1_FRU_CKSUM 12 94*1708Sstevel #define BP_DAT1_FLASH_CKSUM 13 95*1708Sstevel #define BP_DAT1_TOD_TEST 14 96*1708Sstevel #define BP_DAT1_MODEM_TEST 15 97*1708Sstevel #define BP_DAT1_MAX_TEST 15 98*1708Sstevel 99*1708Sstevel /* 100*1708Sstevel * This bit should be set in the RSC_STATUS message to indicate to the 101*1708Sstevel * host that there is an interesting bootmode. 102*1708Sstevel */ 103*1708Sstevel #define BP_DAT1_VALID_BOOTMODE 0x40 104*1708Sstevel 105*1708Sstevel /* 106*1708Sstevel * Bit definitions for the OBP_INIT and RSC_OK messages. 107*1708Sstevel */ 108*1708Sstevel 109*1708Sstevel #define BP_DAT1_MENUS 0x80 110*1708Sstevel #define BP_DAT1_MAX 0x40 111*1708Sstevel #define BP_DAT1_MED 0x20 112*1708Sstevel #define BP_DAT1_MIN 0x10 113*1708Sstevel #define BP_DAT1_MBO 0x01 114*1708Sstevel 115*1708Sstevel #define BP_DAT2_DIAGSW 0x01 116*1708Sstevel 117*1708Sstevel /* Bit definitions for OBP_BOOTINIT message. */ 118*1708Sstevel 119*1708Sstevel #define BP_DAT2_FLASH_PDAT 0x04 120*1708Sstevel #define BP_DAT2_FLASH_MAIN 0x02 121*1708Sstevel #define BP_DAT2_FLASH_BOOT 0x01 122*1708Sstevel 123*1708Sstevel /* 124*1708Sstevel * For bit definitions for the RSC_STATUS message, see the post word bit 125*1708Sstevel * definitions in "postword.h". 126*1708Sstevel */ 127*1708Sstevel 128*1708Sstevel /* Bit definitions for RSC_BOOTFAIL message. */ 129*1708Sstevel 130*1708Sstevel #define BP_DAT1_REJECTED 0x40 131*1708Sstevel #define BP_DAT1_RANGE_ERR 0x20 132*1708Sstevel #define BP_DAT1_VERIFY_ERR 0x10 133*1708Sstevel #define BP_DAT1_ERASE_ERR 0x08 134*1708Sstevel #define BP_DAT1_INT_WP_ERR 0x04 135*1708Sstevel #define BP_DAT1_WP_ERR 0x02 136*1708Sstevel #define BP_DAT1_VPP_ERR 0x01 137*1708Sstevel 138*1708Sstevel /* For lower 8 bits, see the lower 8 bits of the post word in "postword.h". */ 139*1708Sstevel 140*1708Sstevel #define KANTH_SRECORD_ACK 141*1708Sstevel 142*1708Sstevel /* 143*1708Sstevel * When downloading S-records, a RSC:bootack is sent with the following 144*1708Sstevel * value in dat1 to indicate whether the S-record checksum was OK or not. 145*1708Sstevel */ 146*1708Sstevel 147*1708Sstevel #define BP_DAT1_BOOTINIT_ACK 0x00 148*1708Sstevel #define BP_DAT1_SRECORD_ACK 0x01 149*1708Sstevel #define BP_DAT1_SRECORD_NAK 0x02 150*1708Sstevel 151*1708Sstevel /* Definitions for OBP_BOOTMODE message: */ 152*1708Sstevel #define BP_DAT2_BOOTMODE_CLEAR 1 153*1708Sstevel 154*1708Sstevel /* Definitions for RSC_BOOTMODE message: */ 155*1708Sstevel #define BP_BAT1_BOOTMODE_DATAMSB 0x10 156*1708Sstevel #define BP_DAT1_BOOTMODE_OFFSET_MASK 0x07 157*1708Sstevel 158*1708Sstevel #define BP_DAT2_BOOTMODE_DATA_MASK 0x7F 159*1708Sstevel 160*1708Sstevel /* Definitions for RSC_BOOTMODEACK message: */ 161*1708Sstevel #define BP_DAT1_BOOTMODE_NORMAL 0 162*1708Sstevel #define BP_DAT1_BOOTMODE_FORTH 1 163*1708Sstevel #define BP_DAT1_BOOTMODE_RESET_NVRAM 2 164*1708Sstevel #define BP_DAT1_BOOTMODE_DIAG 3 165*1708Sstevel #define BP_DAT1_BOOTMODE_SKIP_DIAG 4 166*1708Sstevel 167*1708Sstevel #define BP_DAT2_BOOTOPT_CONSOLE_RSC 1 168*1708Sstevel 169*1708Sstevel /* Definitions for RSC_MACADDRACK message: */ 170*1708Sstevel #define BP_DAT2_MACADDRACK_OK 0 171*1708Sstevel #define BP_DAT2_MACADDRACK_DONE 1 172*1708Sstevel #define BP_DAT2_MACADDRACK_BADOFFSET 2 173*1708Sstevel #define BP_DAT2_MACADDRACK_NOTREADY 3 174*1708Sstevel #define BP_DAT2_MACADDRACK_NVERR 4 175*1708Sstevel 176*1708Sstevel /* Definitions for RSC_SOFTGPIOACK message */ 177*1708Sstevel #define BP_DAT2_HOST_TYPE_OK 0 178*1708Sstevel #define BP_DAT2_HOST_TYPE_NVERR 1 179*1708Sstevel 180*1708Sstevel #ifdef __cplusplus 181*1708Sstevel } 182*1708Sstevel #endif 183*1708Sstevel 184*1708Sstevel #endif /* _RMC_COMM_DP_BOOT_H */ 185