1*d39a76e7Sxw161283 /* 2*d39a76e7Sxw161283 * CDDL HEADER START 3*d39a76e7Sxw161283 * 4*d39a76e7Sxw161283 * The contents of this file are subject to the terms of the 5*d39a76e7Sxw161283 * Common Development and Distribution License (the "License"). 6*d39a76e7Sxw161283 * You may not use this file except in compliance with the License. 7*d39a76e7Sxw161283 * 8*d39a76e7Sxw161283 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*d39a76e7Sxw161283 * or http://www.opensolaris.org/os/licensing. 10*d39a76e7Sxw161283 * See the License for the specific language governing permissions 11*d39a76e7Sxw161283 * and limitations under the License. 12*d39a76e7Sxw161283 * 13*d39a76e7Sxw161283 * When distributing Covered Code, include this CDDL HEADER in each 14*d39a76e7Sxw161283 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*d39a76e7Sxw161283 * If applicable, add the following below this CDDL HEADER, with the 16*d39a76e7Sxw161283 * fields enclosed by brackets "[]" replaced with your own identifying 17*d39a76e7Sxw161283 * information: Portions Copyright [yyyy] [name of copyright owner] 18*d39a76e7Sxw161283 * 19*d39a76e7Sxw161283 * CDDL HEADER END 20*d39a76e7Sxw161283 */ 21*d39a76e7Sxw161283 22*d39a76e7Sxw161283 /* 23*d39a76e7Sxw161283 * Copyright (C) 2003-2005 Chelsio Communications. All rights reserved. 24*d39a76e7Sxw161283 */ 25*d39a76e7Sxw161283 26*d39a76e7Sxw161283 #pragma ident "%Z%%M% %I% %E% SMI" /* elmer0.h */ 27*d39a76e7Sxw161283 28*d39a76e7Sxw161283 #ifndef CHELSIO_ELMER0_H 29*d39a76e7Sxw161283 #define CHELSIO_ELMER0_H 30*d39a76e7Sxw161283 31*d39a76e7Sxw161283 /* ELMER0 flavors */ 32*d39a76e7Sxw161283 enum { 33*d39a76e7Sxw161283 ELMER0_XC2S300E_6FT256_C, 34*d39a76e7Sxw161283 ELMER0_XC2S100E_6TQ144_C 35*d39a76e7Sxw161283 }; 36*d39a76e7Sxw161283 37*d39a76e7Sxw161283 /* ELMER0 registers */ 38*d39a76e7Sxw161283 #define A_ELMER0_VERSION 0x100000 39*d39a76e7Sxw161283 #define A_ELMER0_PHY_CFG 0x100004 40*d39a76e7Sxw161283 #define A_ELMER0_INT_ENABLE 0x100008 41*d39a76e7Sxw161283 #define A_ELMER0_INT_CAUSE 0x10000c 42*d39a76e7Sxw161283 #define A_ELMER0_GPI_CFG 0x100010 43*d39a76e7Sxw161283 #define A_ELMER0_GPI_STAT 0x100014 44*d39a76e7Sxw161283 #define A_ELMER0_GPO 0x100018 45*d39a76e7Sxw161283 #define A_ELMER0_PORT0_MI1_CFG 0x400000 46*d39a76e7Sxw161283 47*d39a76e7Sxw161283 #define S_MI1_MDI_ENABLE 0 48*d39a76e7Sxw161283 #define V_MI1_MDI_ENABLE(x) ((x) << S_MI1_MDI_ENABLE) 49*d39a76e7Sxw161283 #define F_MI1_MDI_ENABLE V_MI1_MDI_ENABLE(1U) 50*d39a76e7Sxw161283 51*d39a76e7Sxw161283 #define S_MI1_MDI_INVERT 1 52*d39a76e7Sxw161283 #define V_MI1_MDI_INVERT(x) ((x) << S_MI1_MDI_INVERT) 53*d39a76e7Sxw161283 #define F_MI1_MDI_INVERT V_MI1_MDI_INVERT(1U) 54*d39a76e7Sxw161283 55*d39a76e7Sxw161283 #define S_MI1_PREAMBLE_ENABLE 2 56*d39a76e7Sxw161283 #define V_MI1_PREAMBLE_ENABLE(x) ((x) << S_MI1_PREAMBLE_ENABLE) 57*d39a76e7Sxw161283 #define F_MI1_PREAMBLE_ENABLE V_MI1_PREAMBLE_ENABLE(1U) 58*d39a76e7Sxw161283 59*d39a76e7Sxw161283 #define S_MI1_SOF 3 60*d39a76e7Sxw161283 #define M_MI1_SOF 0x3 61*d39a76e7Sxw161283 #define V_MI1_SOF(x) ((x) << S_MI1_SOF) 62*d39a76e7Sxw161283 #define G_MI1_SOF(x) (((x) >> S_MI1_SOF) & M_MI1_SOF) 63*d39a76e7Sxw161283 64*d39a76e7Sxw161283 #define S_MI1_CLK_DIV 5 65*d39a76e7Sxw161283 #define M_MI1_CLK_DIV 0xff 66*d39a76e7Sxw161283 #define V_MI1_CLK_DIV(x) ((x) << S_MI1_CLK_DIV) 67*d39a76e7Sxw161283 #define G_MI1_CLK_DIV(x) (((x) >> S_MI1_CLK_DIV) & M_MI1_CLK_DIV) 68*d39a76e7Sxw161283 69*d39a76e7Sxw161283 #define A_ELMER0_PORT0_MI1_ADDR 0x400004 70*d39a76e7Sxw161283 71*d39a76e7Sxw161283 #define S_MI1_REG_ADDR 0 72*d39a76e7Sxw161283 #define M_MI1_REG_ADDR 0x1f 73*d39a76e7Sxw161283 #define V_MI1_REG_ADDR(x) ((x) << S_MI1_REG_ADDR) 74*d39a76e7Sxw161283 #define G_MI1_REG_ADDR(x) (((x) >> S_MI1_REG_ADDR) & M_MI1_REG_ADDR) 75*d39a76e7Sxw161283 76*d39a76e7Sxw161283 #define S_MI1_PHY_ADDR 5 77*d39a76e7Sxw161283 #define M_MI1_PHY_ADDR 0x1f 78*d39a76e7Sxw161283 #define V_MI1_PHY_ADDR(x) ((x) << S_MI1_PHY_ADDR) 79*d39a76e7Sxw161283 #define G_MI1_PHY_ADDR(x) (((x) >> S_MI1_PHY_ADDR) & M_MI1_PHY_ADDR) 80*d39a76e7Sxw161283 81*d39a76e7Sxw161283 #define A_ELMER0_PORT0_MI1_DATA 0x400008 82*d39a76e7Sxw161283 83*d39a76e7Sxw161283 #define S_MI1_DATA 0 84*d39a76e7Sxw161283 #define M_MI1_DATA 0xffff 85*d39a76e7Sxw161283 #define V_MI1_DATA(x) ((x) << S_MI1_DATA) 86*d39a76e7Sxw161283 #define G_MI1_DATA(x) (((x) >> S_MI1_DATA) & M_MI1_DATA) 87*d39a76e7Sxw161283 88*d39a76e7Sxw161283 #define A_ELMER0_PORT0_MI1_OP 0x40000c 89*d39a76e7Sxw161283 90*d39a76e7Sxw161283 #define S_MI1_OP 0 91*d39a76e7Sxw161283 #define M_MI1_OP 0x3 92*d39a76e7Sxw161283 #define V_MI1_OP(x) ((x) << S_MI1_OP) 93*d39a76e7Sxw161283 #define G_MI1_OP(x) (((x) >> S_MI1_OP) & M_MI1_OP) 94*d39a76e7Sxw161283 95*d39a76e7Sxw161283 #define S_MI1_ADDR_AUTOINC 2 96*d39a76e7Sxw161283 #define V_MI1_ADDR_AUTOINC(x) ((x) << S_MI1_ADDR_AUTOINC) 97*d39a76e7Sxw161283 #define F_MI1_ADDR_AUTOINC V_MI1_ADDR_AUTOINC(1U) 98*d39a76e7Sxw161283 99*d39a76e7Sxw161283 #define S_MI1_OP_BUSY 31 100*d39a76e7Sxw161283 #define V_MI1_OP_BUSY(x) ((x) << S_MI1_OP_BUSY) 101*d39a76e7Sxw161283 #define F_MI1_OP_BUSY V_MI1_OP_BUSY(1U) 102*d39a76e7Sxw161283 103*d39a76e7Sxw161283 #define A_ELMER0_PORT1_MI1_CFG 0x500000 104*d39a76e7Sxw161283 #define A_ELMER0_PORT1_MI1_ADDR 0x500004 105*d39a76e7Sxw161283 #define A_ELMER0_PORT1_MI1_DATA 0x500008 106*d39a76e7Sxw161283 #define A_ELMER0_PORT1_MI1_OP 0x50000c 107*d39a76e7Sxw161283 #define A_ELMER0_PORT2_MI1_CFG 0x600000 108*d39a76e7Sxw161283 #define A_ELMER0_PORT2_MI1_ADDR 0x600004 109*d39a76e7Sxw161283 #define A_ELMER0_PORT2_MI1_DATA 0x600008 110*d39a76e7Sxw161283 #define A_ELMER0_PORT2_MI1_OP 0x60000c 111*d39a76e7Sxw161283 #define A_ELMER0_PORT3_MI1_CFG 0x700000 112*d39a76e7Sxw161283 #define A_ELMER0_PORT3_MI1_ADDR 0x700004 113*d39a76e7Sxw161283 #define A_ELMER0_PORT3_MI1_DATA 0x700008 114*d39a76e7Sxw161283 #define A_ELMER0_PORT3_MI1_OP 0x70000c 115*d39a76e7Sxw161283 116*d39a76e7Sxw161283 /* Simple bit definition for GPI and GP0 registers. */ 117*d39a76e7Sxw161283 #define ELMER0_GP_BIT0 0x0001 118*d39a76e7Sxw161283 #define ELMER0_GP_BIT1 0x0002 119*d39a76e7Sxw161283 #define ELMER0_GP_BIT2 0x0004 120*d39a76e7Sxw161283 #define ELMER0_GP_BIT3 0x0008 121*d39a76e7Sxw161283 #define ELMER0_GP_BIT4 0x0010 122*d39a76e7Sxw161283 #define ELMER0_GP_BIT5 0x0020 123*d39a76e7Sxw161283 #define ELMER0_GP_BIT6 0x0040 124*d39a76e7Sxw161283 #define ELMER0_GP_BIT7 0x0080 125*d39a76e7Sxw161283 #define ELMER0_GP_BIT8 0x0100 126*d39a76e7Sxw161283 #define ELMER0_GP_BIT9 0x0200 127*d39a76e7Sxw161283 #define ELMER0_GP_BIT10 0x0400 128*d39a76e7Sxw161283 #define ELMER0_GP_BIT11 0x0800 129*d39a76e7Sxw161283 #define ELMER0_GP_BIT12 0x1000 130*d39a76e7Sxw161283 #define ELMER0_GP_BIT13 0x2000 131*d39a76e7Sxw161283 #define ELMER0_GP_BIT14 0x4000 132*d39a76e7Sxw161283 #define ELMER0_GP_BIT15 0x8000 133*d39a76e7Sxw161283 #define ELMER0_GP_BIT16 0x10000 134*d39a76e7Sxw161283 #define ELMER0_GP_BIT17 0x20000 135*d39a76e7Sxw161283 #define ELMER0_GP_BIT18 0x40000 136*d39a76e7Sxw161283 #define ELMER0_GP_BIT19 0x80000 137*d39a76e7Sxw161283 138*d39a76e7Sxw161283 #define MI1_OP_DIRECT_WRITE 1 139*d39a76e7Sxw161283 #define MI1_OP_DIRECT_READ 2 140*d39a76e7Sxw161283 141*d39a76e7Sxw161283 #define MI1_OP_INDIRECT_ADDRESS 0 142*d39a76e7Sxw161283 #define MI1_OP_INDIRECT_WRITE 1 143*d39a76e7Sxw161283 #define MI1_OP_INDIRECT_READ_INC 2 144*d39a76e7Sxw161283 #define MI1_OP_INDIRECT_READ 3 145*d39a76e7Sxw161283 146*d39a76e7Sxw161283 #endif 147