/* Copyright 2000-2010 Broadcom Corp. All Rights Reserved. <:label-BRCM:2011:DUAL/GPL:standard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation (the "GPL"). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A copy of the GPL is available at http://www.broadcom.com/licenses/GPLv2.php, or by writing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. :> */ #ifndef __BCM63268_MAP_PART_H #define __BCM63268_MAP_PART_H #ifdef __cplusplus extern "C" { #endif #include "bcmtypes.h" #if !defined(REG_BASE) #define REG_BASE 0xb0000000 #endif #define CHIP_FAMILY_ID_HEX 0x63268 #define PERF_BASE (REG_BASE + 0x00000000) /* chip control */ #define TIMR_BASE (REG_BASE + 0x00000080) /* timer registers */ #define GPIO_BASE (REG_BASE + 0x000000c0) /* gpio registers */ #define UART_BASE (REG_BASE + 0x00000180) /* uart registers */ #define UART1_BASE (REG_BASE + 0x000001a0) /* uart registers */ #define NAND_REG_BASE (REG_BASE + 0x00000200) /* nand interrupt control */ #define NAND_CACHE_BASE (REG_BASE + 0x00000600) #define SPI_BASE (REG_BASE + 0x00000800) /* SPI master controller */ #define HSSPIM_BASE (REG_BASE + 0x00001000) /* High-Speed SPI registers */ #define MISC_BASE (REG_BASE + 0x00001800) /* Miscellaneous Registers */ #define LED_BASE (REG_BASE + 0x00001900) /* LED control registers */ #ifdef __KERNEL__ #define USB_EHCI_BASE 0x10002500 /* USB host registers */ #define USB_OHCI_BASE 0x10002600 /* USB host registers */ #endif #define USBH_CFG_BASE (REG_BASE + 0x00002700) #define IPSEC_BASE (REG_BASE + 0x00002800) #define IPSEC_DMA_BASE (REG_BASE + 0x0000d000) #define MEMC_BASE (REG_BASE + 0x00003000) /* DDR IO Buf Control */ #ifdef __KERNEL__ #define WLAN_CHIPC_BASE 0x10004000 /* WLAN ChipCommon registers, use 1xxx for ioremap */ #define WLAN_MAC_BASE 0x10005000 /* WLAN d11mac registers */ #endif #define WLAN_SHIM_BASE (REG_BASE + 0x00007000) #define SAR_DMA_BASE (REG_BASE + 0x0000c000) /* ATM SAR DMA control */ #define SWITCH_DMA_BASE (REG_BASE + 0x0000d800) #define GMAC_BASE (REG_BASE + 0x0000e000) #define GMAC_DMA_BASE (REG_BASE + 0x0000e000) #define PCIE_BASE (REG_BASE + 0x006e0000) #define SWITCH_BASE (REG_BASE + 0x00700000) #define SAR_BASE (REG_BASE + 0x00007800) #define FAP0_BASE (REG_BASE + 0x00800000) #define FAP0_QSM_UBUS_BASE (REG_BASE + 0x00804000) #define FAP0_QSM_SMI_BASE (REG_BASE + 0x00c04000) #define FAP0_PSM_BASE (REG_BASE + 0x00820000) #define FAP1_BASE (REG_BASE + 0x00a00000) #define FAP1_QSM_UBUS_BASE (REG_BASE + 0x00a04000) #define FAP1_QSM_SMI_BASE (REG_BASE + 0x00e04000) #define FAP1_PSM_BASE (REG_BASE + 0x00a20000) #define OTP_BASE (REG_BASE + 0x00000400) #ifndef __ASSEMBLER__ typedef struct OtpRegs_S { uint32 unused0[16]; /* 0x0 - 0x3c */ uint32 BrcmCtrl[4]; /* 0x40 - 0x4c */ #define OTP_DECT_DISABLE 29 uint32 unused1[32]; /* 0x50 - 0xcc */ uint32 RAMRepair[24]; /* 0xd0 - 0x12c */ } OtpRegs_S; #define OTP_REGS ((volatile OtpRegs_S * const) OTP_BASE) #define OTP_REGS_GET_USER_BIT(x) ((OTP_REGS->BrcmCtrl[((x)/32)] >> ((x) % 32)) & 1) typedef struct DDRPhyControl { uint32 REVISION; /* 0x00 */ uint32 CLK_PM_CTRL; /* 0x04 */ uint32 unused0[2]; /* 0x08-0x10 */ uint32 PLL_STATUS; /* 0x10 */ uint32 PLL_CONFIG; /* 0x14 */ uint32 PLL_PRE_DIVIDER; /* 0x18 */ uint32 PLL_DIVIDER; /* 0x1c */ uint32 PLL_CONTROL1; /* 0x20 */ uint32 PLL_CONTROL2; /* 0x24 */ uint32 PLL_SS_EN; /* 0x28 */ uint32 PLL_SS_CFG; /* 0x2c */ uint32 STATIC_VDL_OVERRIDE; /* 0x30 */ uint32 DYNAMIC_VDL_OVERRIDE; /* 0x34 */ uint32 IDLE_PAD_CONTROL; /* 0x38 */ uint32 ZQ_PVT_COMP_CTL; /* 0x3c */ uint32 DRIVE_PAD_CTL; /* 0x40 */ uint32 CLOCK_REG_CONTROL; /* 0x44 */ uint32 unused1[46]; } DDRPhyControl; typedef struct DDRPhyByteLaneControl { uint32 REVISION; /* 0x00 */ uint32 VDL_CALIBRATE; /* 0x04 */ uint32 VDL_STATUS; /* 0x08 */ #define VDL_STATUS_CALIB_FSM_IDLE_SHIFT 0 #define VDL_STATUS_CALIB_FSM_IDLE_MASK (1< thresh, txfifo> (32-(rightbitindex+length))) ) typedef union MibCtrlReg_s { uint32 word; struct { uint32 unused: 31; uint32 clrMib: 1; }; } MibCtrlReg_t; typedef union MibMaxPktSizeReg_s { uint32 word; struct { uint32 unused : 18; uint32 max_pkt_size: 14; }; } MibMaxPktSizeReg_t; typedef union RxBpThreshReg_s { uint32 word; struct { uint32 unused : 21; uint32 rx_thresh : 11; }; } RxBpThreshReg_t; typedef union RxFlowCtrlReg_s { uint32 word; struct { uint32 unused : 20; uint32 pause_en : 1; uint32 fc_en : 1; }; } RxFlowCtrlReg_t; typedef union BpForceReg_s { uint32 word; struct { uint32 unused: 31; uint32 force : 1; }; } BpForceReg_t; typedef union IrqEnableReg_s { uint32 word; struct { uint32 unused: 31; uint32 ovfl : 1; }; } IrqEnableReg_t; typedef union IrqStatusReg_s { uint32 word; struct { uint32 unused: 31; uint32 ovfl : 1; }; } IrqStatusReg_t; typedef union GmacStatusReg_s { uint32 word; struct { uint32 unused :27; uint32 link_up : 1; uint32 auto_cfg_en : 1; uint32 hd : 1; uint32 eth_speed : 2; #define GMAC_STATUS_SPEED_10 0 #define GMAC_STATUS_SPEED_100 1 #define GMAC_STATUS_SPEED_1000 2 }; } GmacStatusReg_t; typedef union MacSwResetReg_s { uint32 word; struct { uint32 unused :29; uint32 txfifo_flush : 1; uint32 rxfifo_flush : 1; uint32 mac_sw_reset : 1; }; } MacSwResetReg_t; typedef union DmaRxStatusSelReg_s { uint32 word; struct { uint32 unused :23; uint32 runt_det : 1; uint32 frm_trunc : 1; uint32 ucast_det : 1; uint32 vlan : 1; uint32 ctrl_frm : 1; uint32 bcast_det : 1; uint32 mcast_det : 1; uint32 crc_err : 1; uint32 rx_err : 1; }; } DmaRxStatusSelReg_t; typedef union DmaRxOkToSendCountReg_s { uint32 word; struct { uint32 unused :28; uint32 ok_to_send_count : 4; }; } DmaRxOkToSendCountReg_t; typedef struct GmacIntf { /*0x00*/ uint32 Control; /*0x04*/ MibCtrlReg_t MibCtrl; /*0x08*/ uint32 unused; /*0x0C*/ MibMaxPktSizeReg_t MibMaxPktSize; /*0x10*/ RxBpThreshReg_t RxBpThreshLo; /*0x14*/ RxBpThreshReg_t RxBpThreshHi; /*0x18*/ RxFlowCtrlReg_t RxFlowCtrl; /*0x1C*/ uint32 DiagOut; /*0x20*/ BpForceReg_t BpForce; /*0x24*/ IrqEnableReg_t IrqEnable; /*0x28*/ GmacStatusReg_t GmacStatus; /*0x2C*/ IrqStatusReg_t IrqStatus; /*0x30*/ uint32 OverFlowCounter; /*0x34*/ uint32 BackPressCounter; /*0x38*/ MacSwResetReg_t MacSwReset; /*0x3C*/ DmaRxStatusSelReg_t DmaRxStatusSel; /*0x40*/ DmaRxOkToSendCountReg_t DmaRxOkToSendCount; } GmacIntf; #define GMAC_INTF ((volatile GmacIntf * const) (GMAC_BASE+0x800)) typedef struct GmacMIBRegs { /*0x00*/ unsigned int RxFCSErrs; /*0x04*/ unsigned int RxCtrlFrame; /*0x08*/ unsigned int RxPausePkts; /*0x0c*/ unsigned int RxUnknown; /*0x10*/ unsigned int RxAlignErrs; /*0x14*/ unsigned int RxExcessSizeDisc; /* TODO not sure about counter */ /*0x18*/ unsigned int RxSymbolError; /*0x1c*/ unsigned int RxCarrierSenseErrs; /*0x20*/ unsigned int RxOversizePkts; /*0x24*/ unsigned int RxJabbers; /*0x28*/ unsigned int RxMtuErrs; /*0x2c*/ unsigned int RxRuntPkts; /* RxUnderSizePkts + RxFragments */ /*0x30*/ unsigned int RxUndersizePkts; /*0x34*/ unsigned int RxFragments; /*0x38*/ unsigned int RxRuntOctets; /*0x3c*/ unsigned int RxMulticastPkts; /*0x40*/ unsigned int RxBroadcastPkts; /*0x44*/ unsigned int Pkts64Octets; /*0x48*/ unsigned int Pkts65to127Octets; /*0x4c*/ unsigned int Pkts128to255Octets; /*0x50*/ unsigned int Pkts256to511Octets; /*0x54*/ unsigned int Pkts512to1023Octets; /*TODO mapping to ROBO */ /*0x58*/ unsigned int Pkts1024to1518Octets; /*0x5c*/ unsigned int Pkts1519to1522; /*0x60*/ unsigned int Pkts1523to2047; /*0x64*/ unsigned int Pkts2048to4095; /*0x68*/ unsigned int Pkts4096to8191; /* Actually it is upto 9216 */ /*0x6c*/ unsigned int RxPkts; /*0x70*/ unsigned int RxOctetsLo; /*0x74*/ unsigned int RxUnicastPkts; /*0x78*/ unsigned int RxGoodPkts; /*0x7c*/ unsigned int RxPPPPkts; /*0x80*/ unsigned int RxCRCMatchPkts; /*0x84*/ unsigned int TxPausePkts; /*0x88*/ unsigned int TxJabber; /*0x8c*/ unsigned int TxFCSErrs; /*0x90*/ unsigned int TxCtrlFrame; /*0x94*/ unsigned int TxOversizePkts; /*0x98*/ unsigned int TxDeferredTx; /*0x9c*/ unsigned int TxExcessiveDef; /*0xa0*/ unsigned int TxSingleCol; /*0xa4*/ unsigned int TxMultipleCol; /*0xa8*/ unsigned int TxLateCol; /*0xac*/ unsigned int TxExcessiveCol; /*0xb0*/ unsigned int TxFragments; /*0xb4*/ unsigned int TxCol; /*0xb8*/ unsigned int TxMulticastPkts; /*0xbc*/ unsigned int TxBroadcastPkts; /* No mapping in ROBO for TX octet counters */ /*0xc0*/ unsigned int TxPkts64Octets; /*0xc4*/ unsigned int TxPkts65to127Octets; /*0xc8*/ unsigned int TxPkts128to255Octets; /*0xcc*/ unsigned int TxPkts256to511Octets; /*0xd0*/ unsigned int TxPkts512to1023Octets; /*0xd4*/ unsigned int TxPkts1024to1518Octets; /*0xd8*/ unsigned int TxPkts1519to1522; /*0xdc*/ unsigned int TxPkts1523to2047; /*0xe0*/ unsigned int TxPkts2048to4095; /*0xe4*/ unsigned int TxPkts4096to8191; /* Actually it is upto 9216 */ /*0xe8*/ unsigned int TxPkts; /*0xec*/ unsigned int TxOctetsLo; /*0xf0*/ unsigned int TxUnicastPkts; /*0xf4*/ unsigned int TxGoodPkts; /* * Need to map GMAC counters to these ROBO counters unsigned int TxDropPkts; unsigned int TxQoSPkts; unsigned int TxFrameInDisc; unsigned int TxQoSOctetsLo; unsigned int TxQoSOctetsHi; unsigned int RxGoodOctetsLo; unsigned int RxGoodOctetsHi; unsigned int RxDropPkts; unsigned int RxSAChanges; unsigned int RxQoSOctetsLo; unsigned int RxQoSOctetsHi; */ } GmacMIBRegs; #define GMAC_MIB ((volatile GmacMac * const) (GMAC_BASE + 0xA00)) typedef union CmdReg_s { uint32 word; struct { uint32 unused3 : 1; /* bit 31 */ uint32 runt_filt_dis : 1; /* bit 30 */ uint32 txrx_en_cfg : 1; /* bit 29 */ uint32 tx_pause_ign : 1; /* bit 28 */ uint32 prbl_ena : 1; /* bit 27 */ uint32 rx_err_disc : 1; /* bit 26 */ uint32 rmt_loop_ena : 1; /* bit 25 */ uint32 len_chk_dis : 1; /* bit 24 */ uint32 ctrl_frm_ena : 1; /* bit 23 */ uint32 ena_ext_cfg : 1; /* bit 22 */ uint32 unused2 : 6; /* bit 21:16 */ uint32 lcl_loop_ena : 1; /* bit 15 */ uint32 unused1 : 1; /* bit 14 */ uint32 sw_reset : 1; /* bit 13 */ uint32 unused0 : 2; /* bit 12:11 */ uint32 hd_ena : 1; /* bit 10 */ uint32 tx_addr_ins : 1; /* bit 9 */ uint32 rx_pause_ign : 1; /* bit 8 */ uint32 pause_fwd : 1; /* bit 7 */ uint32 crc_fwd : 1; /* bit 6 */ uint32 pad_rem_en : 1; /* bit 5 */ uint32 promis_en : 1; /* bit 4 */ uint32 eth_speed : 2; /* bit 3:2 */ #define CMD_ETH_SPEED_10 0 #define CMD_ETH_SPEED_100 1 #define CMD_ETH_SPEED_1000 2 #define CMD_ETH_SPEED_2500 3 uint32 rx_ena : 1; /* bit 1 */ uint32 tx_ena : 1; /* bit 0 */ }; } CmdReg_t; typedef union FrmLenReg_s { uint32 word; struct { uint32 unused : 18; uint32 frm_len : 14; /* bit 13:0 */ }; } FrmLenReg_t; typedef union PauseQuantaReg_s { uint32 word; struct { uint32 unused : 16; uint32 pause_quanta : 16; /* bit 15:0 */ }; } PauseQuantaReg_t; typedef union ModeReg_s { uint32 word; struct { uint32 unused : 26; uint32 mac_link_up : 1; /* bit 5 */ uint32 mac_tx_pause : 1; /* bit 4 */ uint32 mac_rx_pause : 1; /* bit 3 */ uint32 mac_dplx : 1; /* bit 2 */ uint32 mac_speed : 2; /* bit 1:0 */ }; } ModeReg_t; typedef union FrmTagReg_s { uint32 word; struct { uint32 unused : 15; uint32 tpid_en : 1; /* bit 16 */ uint32 tag : 16; /* bit 15:0 */ }; } FrmTagReg_t; typedef union TxIpgLenReg_s { uint32 word; struct { uint32 unused :27; uint32 tx_ipg_len : 5; /* bit 4:0 */ }; } TxIpgLenReg_t; typedef union RxIpgInvReg_s { uint32 word; struct { uint32 unused :31; uint32 rx_ipg_inv : 1; /* bit 0 */ }; } RxIpgInvReg_t; typedef union RepPauseCtrlReg_s { uint32 word; struct { uint32 unused :14; uint32 pause_en : 1; /* bit 17 */ uint32 pause_timer :17; /* bit 16:0 */ }; } RepPauseCtrlReg_t; typedef union TxFifoFlushReg_s { uint32 word; struct { uint32 unused :31; uint32 tx_flush : 1; /* bit 0 */ }; } TxFifoFlushReg_t; typedef struct RxFifoStatusReg_s { uint32 word; struct { uint32 unused :30; uint32 rxfifo_overrun : 1; /* bit 1 */ uint32 rxfifo_underrun : 1; /* bit 0 */ }; } RxFifoStatusReg_t; typedef union TxFifoStatusReg_s { uint32 word; struct { uint32 unused :30; uint32 txfifo_overrun : 1; /* bit 1 */ uint32 txfifo_underrun : 1; /* bit 0 */ }; } TxFifoStatusReg_t; typedef struct GmacMac { uint32 UmacDummy; /* 0x00 */ uint32 HdBkpCntl; /* 0x04 */ CmdReg_t Cmd; /* 0x08 */ uint32 Mac0; /* 0x0c */ uint32 Mac1; /* 0x10 */ FrmLenReg_t FrmLen; /* 0x14 */ PauseQuantaReg_t PauseQuanta; /* 0x18 */ uint32 unused1[9]; /* 0x1c - 0x3c */ uint32 SfdOffset; /* 0x40 */ ModeReg_t Mode; /* 0x44 */ FrmTagReg_t FrmTag0; /* 0x48 */ FrmTagReg_t FrmTag1; /* 0x4c */ uint32 unused2[3]; /* 0x50 - 0x58 */ TxIpgLenReg_t TxIpgLen; /* 0x5c */ uint32 unused3[6]; /* 0x60 - 0x74 */ RxIpgInvReg_t RxIpgInv; /* 0x78 */ uint32 unused4[165]; /* 0x7c - 0x30c */ uint32 MacsecProgTxCrc; /* 0x310 */ uint32 MacsecCtrl; /* 0x314 */ uint32 unused5[6]; /* 0x318 - 0x32c */ RepPauseCtrlReg_t PauseCtrl; /* 0x330 */ TxFifoFlushReg_t TxFifoFlush; /* 0x334 */ RxFifoStatusReg_t RxFifoStatus; /* 0x338 */ TxFifoStatusReg_t TxFifoStatus; /* 0x33c */ } GmacMac; #define GMAC_MAC ((volatile GmacMac * const) (GMAC_BASE + 0xC00)) typedef struct gmacEEECtrl { uint32 unused1 : 16; uint32 softReset : 1; uint32 unused2 : 10; uint32 linkUp : 1; uint32 lpiCntrSnap : 1; uint32 lpiCntrClr : 1; uint32 halt : 1; uint32 enable : 1; } gmacEEECtrl_t; typedef struct gmacEEEStat { uint32 idle : 1; uint32 halt : 1; uint32 enable : 1; uint32 softReset : 1; uint32 pktFull : 1; uint32 pktEmpty : 1; uint32 fifoFull : 1; uint32 fifoEmpty : 1; uint32 fullDplx : 1; uint32 speed : 2; uint32 unused1 : 1; uint32 currState : 4; uint32 lpiCntr : 16; } gmacEEEStat_t; typedef struct GmacEEE { gmacEEECtrl_t eeeCtrl; /* @ 0x1000e850 */ gmacEEEStat_t eeeStat; uint32 eeeT1000WakeTime; uint32 eeeTx100WakeTime; uint32 eeeLPIWaitTime; } GmacEEE_t; /* Use this address if alias is disabled for lowmem */ #define HIGH_MEM_PHYS_ADDRESS 0x20000000 /*Use this if alias is ON for lowmem; Note: on mips linux it may not work*/ #define HIGH_MEM_PHYS_ADDRESS_LOWMEM_ALIAS 0x30000000 #define GMAC_EEE (volatile GmacEEE_t *const) ((unsigned char *)GMAC_INTF + 0x50) #endif /* Bootrom specifics */ #define BTRM_SBI_UNAUTH_MGC_NUM_1 112233 #define BTRM_SBI_UNAUTH_MGC_NUM_2 445566 #define OTP_SHADOW_ADDR_BTRM_ENABLE_CUST_ROW 0x80 #define OTP_CUST_BTRM_BOOT_ENABLE_SHIFT 1 #define OTP_CUST_BTRM_BOOT_ENABLE_MASK (0x1 << OTP_CUST_BTRM_BOOT_ENABLE_SHIFT) #define OTP_SHADOW_ADDR_MARKET_ID_CUST_ROW 0x84 #define OTP_MFG_MRKTID_OTP_BITS_SHIFT 16 #define OTP_MFG_MRKTID_OTP_BITS_MASK (0xffff << OTP_MFG_MRKTID_OTP_BITS_SHIFT) #endif #ifdef __cplusplus } #endif #endif