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