/* <:copyright-BRCM:2013:DUAL/GPL:standard Copyright (c) 2013 Broadcom All Rights Reserved 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 __BCM63148_MAP_PART_H #define __BCM63148_MAP_PART_H #ifdef __cplusplus extern "C" { #endif #include "bcmtypes.h" #include "bcm_io_map.h" #if !defined(REG_BASE) #define REG_BASE 0x80000000 #endif #if !defined(PER_BASE) #define PER_BASE 0xfffe0000 #endif #define CHIP_FAMILY_ID_HEX 0x63148 #define PERF_PHYS_BASE (PER_BASE + 0x00008000) /* chip control */ #define TIMR_PHYS_BASE (PER_BASE + 0x00008080) /* timer registers */ #define NAND_INTR_PHYS_BASE (PER_BASE + 0x000080f0) /* NAND int register */ #define GPIO_PHYS_BASE (PER_BASE + 0x00008100) /* gpio registers */ #define I2C_BASE (PER_BASE + 0x0000be00) /* I2C regsiters */ #define MISC_PHYS_BASE (PER_BASE + 0x00008180) /* Miscellaneous Registers */ #define SOTP_PHYS_BASE (PER_BASE + 0x00008200) /* SOTP register */ #define PKA_PHYS_BASE (PER_BASE + 0x00008280) #define RNG_PHYS_BASE (PER_BASE + 0x00008300) #define UART0_PHYS_BASE (PER_BASE + 0x00008600) /* uart registers */ #define UART_PHYS_BASE UART0_PHYS_BASE #define UART1_PHYS_BASE (PER_BASE + 0x00008620) /* uart registers */ #define LED_PHYS_BASE (PER_BASE + 0x00008700) /* LED control registers */ #define I2S_PHYS_BASE (PER_BASE + 0x00008900) #define AES0_PHYS_BASE (PER_BASE + 0x00008980) #define AES1_PHYS_BASE (PER_BASE + 0x00008a00) #define HSSPIM_PHYS_BASE (PER_BASE + 0x00009000) /* High-Speed SPI registers */ #define NAND_REG_PHYS_BASE (PER_BASE + 0x0000a000) /* nand interrupt control */ #define NAND_CACHE_PHYS_BASE (PER_BASE + 0x0000a400) #define JTAG_OTP_PHYS_BASE (PER_BASE + 0x0000bb00) #define JTAG_IOTP_PHYS_BASE (PER_BASE + 0x0000bd00) #define BOOTLUT_PHYS_BASE (PER_BASE + 0x00010000) /*TODO change the naming of usbdevice regs to USB20D */ #define USB_CTL_PHYS_BASE (REG_BASE + 0x00001000) /* USB 2.0 device control */ #define USB_DMA_PHYS_BASE (REG_BASE + 0x00001800) /* USB 2.0 device DMA registers */ #define MEMC_PHYS_BASE (REG_BASE + 0x00002000) /* DDR IO Buf Control */ #define MEMC_BASE_OFF_4K (MEMC_PHYS_BASE + 0x00001000) #define DDRPHY_PHYS_BASE (REG_BASE + 0x00003000) #define SAR_PHYS_BASE (REG_BASE + 0x00004000) #define SAR_DMA_PHYS_BASE (REG_BASE + 0x00007800) /* ATM SAR DMA control */ #define SATA_PHYS_BASE (REG_BASE + 0x00008000) #define USBH_PHYS_BASE (REG_BASE + 0x0000c000) #define USBH_CFG_PHYS_BASE (REG_BASE + 0x0000c200) #define USB_EHCI_PHYS_BASE (REG_BASE + 0x0000c300) /* USB host registers */ #define USB_OHCI_PHYS_BASE (REG_BASE + 0x0000c400) /* USB host registers */ #define USB_XHCI_PHYS_BASE (REG_BASE + 0x0000d000) /* USB host registers */ #define USB_XHCI1_PHYS_BASE (REG_BASE + 0x0000e000) /* USB host registers */ #define ERROR_PORT_PHYS_BASE (REG_BASE + 0x00010000) #define AIP_PHYS_BASE (REG_BASE + 0x00018000) #define B15_CTRL_PHYS_BASE (REG_BASE + 0x00020000) #define B15_PHYS_BASE (REG_BASE + 0x00030000) #define GICD_PHYS_BASE (REG_BASE + 0x00031000) #define GICC_PHYS_BASE (REG_BASE + 0x00032000) #define DECT_PHYS_BASE (REG_BASE + 0x00040000) #define DECT_AHB_REG_PHYS_BASE DECT_PHYS_BASE #define DECT_SHIM_CTRL_PHYS_BASE (REG_BASE + 0x00050000) #define DECT_SHIM_DMA_CTRL_PHYS_BASE (REG_BASE + 0x00050050) #define DECT_APB_REG_PHYS_BASE (REG_BASE + 0x00050800) #define PCIE0_PHYS_BASE (REG_BASE + 0x00060000) #define PCIE1_PHYS_BASE (REG_BASE + 0x00070000) #define SF2_PHYS_BASE (REG_BASE + 0x00080000) #define SWITCH_PHYS_BASE SF2_PHYS_BASE #define APM_PHYS_BASE (REG_BASE + 0x00100000) #define RDP_PHYS_BASE (REG_BASE + 0x00200000) #define PMC_PHYS_BASE (REG_BASE + 0x00400000) #define PROC_MON_PHYS_BASE (REG_BASE + 0x00480000) #define DSLPHY_PHYS_BASE (REG_BASE + 0x00600000) #define DSLPHY_PHYS_TXPAF_BASE (REG_BASE + 0x00656800) #define DSLPHY_AFE_PHYS_BASE (REG_BASE + 0x00657300) #define DSLLMEM_PHYS_BASE (REG_BASE + 0x00700000) #define PCIE0_MEM_PHYS_BASE 0x90000000 #define PCIE1_MEM_PHYS_BASE 0xa0000000 /* Physical address for all the registers */ #define SPIFLASH_PHYS_BASE 0xffd00000 /* spi flash direct access address */ #define NANDFLASH_PHYS_BASE 0xffe00000 /* nand flash direct access address */ /* Physical and access(could be virtual or physical) bases address for * all the registers */ #define SPIFLASH_BASE BCM_IO_ADDR(SPIFLASH_PHYS_BASE) #define NANDFLASH_BASE BCM_IO_ADDR(NANDFLASH_PHYS_BASE) #define PERF_BASE BCM_IO_ADDR(PERF_PHYS_BASE) #define TIMR_BASE BCM_IO_ADDR(TIMR_PHYS_BASE) #define NAND_INTR_BASE BCM_IO_ADDR(NAND_INTR_PHYS_BASE) #define GPIO_BASE BCM_IO_ADDR(GPIO_PHYS_BASE) #define MISC_BASE BCM_IO_ADDR(MISC_PHYS_BASE) #define SOTP_BASE BCM_IO_ADDR(SOTP_PHYS_BASE) #define PKA_BASE BCM_IO_ADDR(PKA_PHYS_BASE) #define RNG_BASE BCM_IO_ADDR(RNG_PHYS_BASE) #define UART0_BASE BCM_IO_ADDR(UART0_PHYS_BASE) #define UART_BASE UART0_BASE #define UART1_BASE BCM_IO_ADDR(UART1_PHYS_BASE) #define LED_BASE BCM_IO_ADDR(LED_PHYS_BASE) #define I2S_BASE BCM_IO_ADDR(I2S_PHYS_BASE) #define AES0_BASE BCM_IO_ADDR(AES0_PHYS_BASE) #define AES1_BASE BCM_IO_ADDR(AES1_PHYS_BASE) #define HSSPIM_BASE BCM_IO_ADDR(HSSPIM_PHYS_BASE) #define NAND_REG_BASE BCM_IO_ADDR(NAND_REG_PHYS_BASE) #define NAND_CACHE_BASE BCM_IO_ADDR(NAND_CACHE_PHYS_BASE) #define BROM_SEC_BASE BCM_IO_ADDR(BROM_SEC_PHYS_BASE) #define SRAM_SEC_BASE BCM_IO_ADDR(SRAM_SEC_PHYS_BASE) #define PER_SEC_BASE BCM_IO_ADDR(PER_SEC_PHYS_BASE) #define JTAG_OTP_BASE BCM_IO_ADDR(JTAG_OTP_PHYS_BASE) #define JTAG_IOTP_BASE BCM_IO_ADDR(JTAG_IOTP_PHYS_BASE) #define BOOTLUT_BASE BCM_IO_ADDR(BOOTLUT_PHYS_BASE) /*TODO keep the naming convention same as RDB */ #define USB_CTL_BASE BCM_IO_ADDR(USB_CTL_PHYS_BASE) #define USB_DMA_BASE BCM_IO_ADDR(USB_DMA_PHYS_BASE) #define MEMC_BASE BCM_IO_ADDR(MEMC_PHYS_BASE) #define DDRPHY_BASE BCM_IO_ADDR(DDRPHY_PHYS_BASE) #define SAR_BASE BCM_IO_ADDR(SAR_PHYS_BASE) #define SAR_DMA_BASE BCM_IO_ADDR(SAR_DMA_PHYS_BASE) #define SATA_BASE BCM_IO_ADDR(SATA_PHYS_BASE) #define USBH_BASE BCM_IO_ADDR(USBH_PHYS_BASE) #define USBH_CFG_BASE BCM_IO_ADDR(USBH_CFG_PHYS_BASE) #define USB_EHCI_BASE BCM_IO_ADDR(USB_EHCI_PHYS_BASE) #define USB_OHCI_BASE BCM_IO_ADDR(USB_OHCI_PHYS_BASE) #define USB_XHCI_BASE BCM_IO_ADDR(USB_XHCI_PHYS_BASE) #define USB_XHCI1_BASE BCM_IO_ADDR(USB_XHCI1_PHYS_BASE) #define ERROR_PORT_BASE BCM_IO_ADDR(ERROR_PORT_PHYS_BASE) #define B15_CTRL_BASE BCM_IO_ADDR(B15_CTRL_PHYS_BASE) #define B15_BASE BCM_IO_ADDR(B15_PHYS_BASE) #define GICC_BASE BCM_IO_ADDR(GICC_PHYS_BASE) #define GICD_BASE BCM_IO_ADDR(GICD_PHYS_BASE) #define SWITCH_BASE BCM_IO_ADDR(SF2_PHYS_BASE) #define SWITCH_REG_BASE (SWITCH_BASE + 0x40000UL) #define SWITCH_DIRECT_DATA_WR_REG (SWITCH_REG_BASE + 0x00008UL) #define SWITCH_DIRECT_DATA_RD_REG (SWITCH_REG_BASE + 0x0000cUL) #define SWITCH_CROSSBAR_REG (SWITCH_REG_BASE + 0x000acUL) #define SWITCH_MDIO_BASE (SWITCH_BASE + SWITCH_MDIO_OFFSET) #define SWITCH_ACB_BASE (SWITCH_BASE + 0x40600UL) #define APM_BASE BCM_IO_ADDR(APM_PHYS_BASE) #define RDP_BASE BCM_IO_ADDR(RDP_PHYS_BASE) #define PMC_BASE BCM_IO_ADDR(PMC_PHYS_BASE) #define PROC_MON_BASE BCM_IO_ADDR(PROC_MON_PHYS_BASE) #define DSLPHY_BASE BCM_IO_ADDR(DSLPHY_PHYS_BASE) #define DSLPHY_AFE_BASE BCM_IO_ADDR(DSLPHY_AFE_PHYS_BASE) #define DSLLMEM_BASE BCM_IO_ADDR(DSLLMEM_PHYS_BASE) #define TXPAF_PROCESSOR_BASE BCM_IO_ADDR(DSLPHY_PHYS_TXPAF_BASE) #ifndef __ASSEMBLER__ typedef struct UBUSInterface { uint32 CFG; /* 0x00 */ #define UBUSIF_CFG_WRITE_REPLY_MODE_SHIFT 0x0 #define UBUSIF_CFG_WRITE_REPLY_MODE_MASK (0x1<< UBUSIF_CFG_WRITE_REPLY_MODE_SHIFT) #define UBUSIF_CFG_WRITE_BURST_MODE_SHIFT 0x1 #define UBUSIF_CFG_WRITE_BURST_MODE_MASK (0x1<< UBUSIF_CFG_WRITE_BURST_MODE_SHIFT) #define UBUSIF_CFG_INBAND_ERR_MASK_SHIFT 0x2 #define UBUSIF_CFG_INBAND_ERR_MASK_MASK (0x1<< UBUSIF_CFG_INBAND_ERR_MASK_SHIFT) #define UBUSIF_CFG_OOB_ERR_MASK_SHIFT 0x3 #define UBUSIF_CFG_OOB_ERR_MASK_MASK (0x1<< UBUSIF_CFG_OOB_ERR_MASK_SHIFT) uint32 SRC_QUEUE_CTRL_0; /* 0x04 */ uint32 SRC_QUEUE_CTRL_1; /* 0x08 */ uint32 SRC_QUEUE_CTRL_2; /* 0x0c */ uint32 SRC_QUEUE_CTRL_3; /* 0x10 */ uint32 REP_ARB_MODE; /* 0x14 */ #define UBUSIF_REP_ARB_MODE_FIFO_MODE_SHIFT 0x0 #define UBUSIF_REP_ARB_MODE_FIFO_MODE_MASK (0x1<> 5) & 0x07) : (0)) #define GPIO_NUM_TO_MASK(X) ((((X) & BP_GPIO_NUM_MASK) < GPIO_NUM_MAX) ? (1 << (((X) & BP_GPIO_NUM_MASK) & 0x1f)) : (0)) #define GPIO_NUM_TO_ARRAY_SHIFT(X) (((X) & BP_GPIO_NUM_MASK) & 0x1f) /* * Misc Register Set Definitions. */ typedef struct Misc { #define MISC_PCIE_CTRL_CORE_SOFT_RESET_MASK (0x3) uint32 miscPCIECtrl; /* 0x00 */ uint32 miscStrapBus; /* 0x04 */ #define MISC_STRAP_BUS_SW_RESERVE_1 (0x3 << 24) #define MISC_STRAP_BUS_BISR_MEM_REPAIR (1 << 23) #define MISC_STRAP_BUS_RESET_OUT_DELAY_SHIFT 22 #define MISC_STRAP_BUS_RESET_OUT_DELAY_MASK (1 << MISC_STRAP_BUS_RESET_OUT_DELAY_SHIFT) #define MISC_STRAP_BUS_RESET_OUT_DELAY_100MS (1 << MISC_STRAP_BUS_RESET_OUT_DELAY_SHIFT) #define MISC_STRAP_BUS_RESET_OUT_DELAY_50MS (0x0 << MISC_STRAP_BUS_RESET_OUT_DELAY_SHIFT) #define MISC_STRAP_BUS_SYS_BUS_FREQ (0x3 << 20) #define MISC_STRAP_BUS_A9_CORE0_BOOT (1 << 19) #define MISC_STRAP_BUS_PMC_BOOT_FLASH_N (1 << 18) #define MISC_STRAP_BUS_PMC_BOOT_AVS (1 << 17) #define MISC_STRAP_BUS_HS_SPIM_24B_N_32B_ADDR (1 << 16) #define MISC_STRAP_BUS_HS_SPIM_CLK_SLOW_N_FAST (1 << 15) #define MISC_STRAP_BUS_SW_RESERVE_0 (0x7 << 12) #define MISC_STRAP_BUS_B15_START_SLOW_FREQ (1 << 11) #define MISC_STRAP_BUS_PMC_ROM_BOOT_SHIFT 10 #define MISC_STRAP_BUS_PMC_ROM_BOOT (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; #define GMAC_EEE (volatile GmacEEE_t *const) ((unsigned char *)GMAC_INTF + 0x50) #endif /* defined(CONFIG_BCM_GMAC) */ #endif typedef struct { unsigned int led_f; unsigned int reserved; } LED_F; typedef struct EthernetSwitchCore { unsigned int port_traffic_ctrl[9]; /* 0x00 - 0x08 */ unsigned int reserved1[2]; /* 0x09 - 0x0a */ unsigned int switch_mode; /* 0x0b */ #define ETHSW_SM_RETRY_LIMIT_DIS 0x04 #define ETHSW_SM_FORWARDING_EN 0x02 #define ETHSW_SM_MANAGED_MODE 0x01 unsigned int pause_quanta; /* 0x0c */ unsigned int reserved33; unsigned int imp_port_state; /*0x0e */ #define ETHSW_IPS_USE_MII_HW_STS 0x00 #define ETHSW_IPS_USE_REG_CONTENTS 0x80 #define ETHSW_IPS_GMII_SPEED_UP_NORMAL 0x00 #define ETHSW_IPS_GMII_SPEED_UP_2G 0x40 #define ETHSW_IPS_TXFLOW_NOT_PAUSE_CAPABLE 0x00 #define ETHSW_IPS_TXFLOW_PAUSE_CAPABLE 0x20 #define ETHSW_IPS_RXFLOW_NOT_PAUSE_CAPABLE 0x00 #define ETHSW_IPS_RXFLOW_PAUSE_CAPABLE 0x10 #define ETHSW_IPS_SW_PORT_SPEED_1000M_2000M 0x08 #define ETHSW_IPS_DUPLEX_MODE 0x02 #define ETHSW_IPS_LINK_FAIL 0x00 #define ETHSW_IPS_LINK_PASS 0x01 unsigned int led_refresh; /* 0x0f */ LED_F led_function[2]; /* 0x10 */ unsigned int led_function_map; /* 0x14 */ unsigned int reserved14; unsigned int led_enable_map; /* 0x16 */ unsigned int reserved15; unsigned int led_mode_map0; /* 0x18 */ unsigned int reserved16; unsigned int led_function_map1; /* 0x1a */ unsigned int reserved17; unsigned int reserved2[5]; /* 0x1c - 0x20 */ unsigned int port_forward_ctrl; /* 0x21 */ unsigned int switch_ctrl; /* 0x22 */ #define ETHSW_SC_MII_DUMP_FORWARDING_EN 0x40 #define ETHSW_SC_MII2_VOL_SEL 0x02 unsigned int reserved3; /* 0x23 */ unsigned int protected_port_selection; /* 0x24 */ unsigned int reserved18; unsigned int wan_port_select; /* 0x26 */ unsigned int reserved19; unsigned int pause_capability; /* 0x28 */ unsigned int reserved20[3]; unsigned int reserved4[3]; /* 0x2c - 0x2e */ unsigned int reserved_multicast_control; /* 0x2f */ unsigned int reserved5; /* 0x30 */ unsigned int txq_flush_mode_control; /* 0x31 */ unsigned int ulf_forward_map; /* 0x32 */ unsigned int reserved21; unsigned int mlf_forward_map; /* 0x34 */ unsigned int reserved22; unsigned int mlf_impc_forward_map; /* 0x36 */ unsigned int reserved23; unsigned int pause_pass_through_for_rx; /* 0x38 */ unsigned int reserved24; unsigned int pause_pass_through_for_tx; /* 0x3a */ unsigned int reserved25; unsigned int disable_learning; /* 0x3c */ unsigned int reserved26; unsigned int reserved6[26]; /* 0x3e - 0x57 */ unsigned int port_state_override[8]; /* 0x58 - 0x5f */ #define ETHSW_PS_SW_OVERRIDE 0x40 #define ETHSW_PS_SW_TX_FLOW_CTRL_EN 0x20 #define ETHSW_PS_SW_RX_FLOW_CTRL_EN 0x10 #define ETHSW_PS_SW_PORT_SPEED_1000M 0x80 #define ETHSW_PS_SW_PORT_SPEED_100M 0x40 #define ETHSW_PS_SW_PORT_SPEED_10M 0x00 #define ETHSW_PS_DUPLEX_MODE 0x02 #define ETHSW_PS_LINK_DOWN 0x00 #define ETHSW_PS_LINK_UP 0x01 unsigned int reserved7[4]; /* 0x60 - 0x63 */ unsigned int imp_rgmii_ctrl_p4; /* 0x64 */ unsigned int imp_rgmii_ctrl_p5; /* 0x65 */ unsigned int reserved8[6]; /* 0x66 - 0x6b */ unsigned int rgmii_timing_delay_p4; /* 0x6c */ unsigned int gmii_timing_delay_p5; /* 0x6d */ unsigned int reserved9[11]; /* 0x6e - 0x78 */ unsigned int software_reset; /* 0x79 */ unsigned int reserved13[6]; /* 0x7a - 0x7f */ unsigned int pause_frame_detection; /* 0x80 */ unsigned int reserved10[7]; /* 0x81 - 0x87 */ unsigned int fast_aging_ctrl; /* 0x88 */ unsigned int fast_aging_port; /* 0x89 */ unsigned int fast_aging_vid; /* 0x8a */ unsigned int anonymous1[376]; /* 0x8b */ unsigned int brcm_hdr_ctrl; /* 0x203 */ unsigned int anonymous2[0x2efc]; /* 0x204 */ unsigned int port_vlan_ctrl[9*2]; /* 0x3100 */ } EthernetSwitchCore; #define PBMAP_MIPS 0x100 #define ETHSW_CORE ((volatile EthernetSwitchCore * const) SWITCH_BASE) typedef struct EthernetSwitchReg { uint32 switch_ctrl; /* 0x0000 */ uint32 switch_status; /* 0x0004 */ uint32 dir_data_write_reg; /* 0x0008 */ uint32 dir_data_read_reg; /* 0x000c */ uint32 led_serial_refresh_time_unit; /* 0x0010 */ uint32 reserved1; /* 0x0014 */ uint32 switch_rev; /* 0x0018 */ uint32 phy_rev; /* 0x001c */ uint32 phy_test_ctrl; /* 0x0020 */ uint32 qphy_ctrl; /* 0x0024 */ #define ETHSW_QPHY_CTRL_PHYAD_BASE_SHIFT 12 #define ETHSW_QPHY_CTRL_PHYAD_BASE_MASK (0x1f<phy_test_ctrl)) #define SPHY_CNTRL ((volatile unsigned int*)(ÐSW_REG->sphy_ctrl)) #define QPHY_CNTRL ((volatile unsigned int*)(ÐSW_REG->qphy_ctrl)) typedef struct EthernetSwitchMDIO { uint32 mdio_cmd; /* 0x0000 */ #define ETHSW_MDIO_BUSY (1 << 29) #define ETHSW_MDIO_FAIL (1 << 28) #define ETHSW_MDIO_CMD_SHIFT 26 #define ETHSW_MDIO_CMD_MASK (0x3<status3) + (x)/32) >> ((x) % 32) & 1) #define BTRM_OTP_READ_TIMEOUT_CNT 0x10000 /* row 17 */ #define OTP_BRCM_BTRM_BOOT_ENABLE_ROW 17 #define OTP_BRCM_BTRM_BOOT_ENABLE_SHIFT 3 #define OTP_BRCM_BTRM_BOOT_ENABLE_MASK (1 << OTP_BRCM_BTRM_BOOT_ENABLE_SHIFT) #define OTP_BRCM_MEK_MIV_ROW 17 #define OTP_BRCM_MEK_MIV_SHIFT 7 #define OTP_BRCM_MEK_MIV_MASK (7 << OTP_BRCM_MEK_MIV_SHIFT) /* row 18 */ #define OTP_CUST_BTRM_BOOT_ENABLE_ROW 18 #define OTP_CUST_BTRM_BOOT_ENABLE_SHIFT 15 #define OTP_CUST_BTRM_BOOT_ENABLE_MASK (7 << OTP_CUST_BTRM_BOOT_ENABLE_SHIFT) /* row 24 */ #define OTP_CUST_MFG_MRKTID_ROW 24 #define OTP_CUST_MFG_MRKTID_SHIFT 0 #define OTP_CUST_MFG_MRKTID_MASK (0xffff << OTP_CUST_MFG_MRKTID_SHIFT) #define OTP_CUST_OP_INUSE_ROW 24 #define OTP_CUST_OP_INUSE_SHIFT 16 #define OTP_CUST_OP_INUSE_MASK (1 << OTP_CUST_OP_INUSE_SHIFT) /* row 25 */ #define OTP_CUST_OP_MRKTID_ROW 25 #define OTP_CUST_OP_MRKTID_SHIFT 0 #define OTP_CUST_OP_MRKTID_MASK (0xffff << OTP_CUST_OP_MRKTID_SHIFT) #endif #endif