/* Copyright 2000-2010 Broadcom Corporation Unless you and Broadcom execute a separate written software license agreement governing use of this software, this software is licensed to you under the terms of the GNU General Public License version 2 (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, with the following added to such license: As a special exception, the copyright holders of this software give you permission to link this software with independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from this software. The special exception does not apply to any modifications of the software. Notwithstanding the above, under no circumstances may you combine this software in any way with any other Broadcom software provided under a license other than the GPL, without Broadcom's express prior written consent. */ #ifndef __BCM6362_MAP_H #define __BCM6362_MAP_H #ifdef __cplusplus extern "C" { #endif #include "bcmtypes.h" #define PERF_BASE 0xb0000000 /* chip control registers */ #define TIMR_BASE 0xb0000040 /* timer registers */ #define GPIO_BASE 0xb0000080 /* gpio registers */ #define UART_BASE 0xb0000100 /* uart registers */ #define UART1_BASE 0xb0000120 /* uart registers */ #define NAND_REG_BASE 0xb0000200 /* NAND registers */ #define NAND_CACHE_BASE 0xb0000600 #define SPI_BASE 0xb0000800 /* SPI master controller registers */ #define HSSPIM_BASE 0xb0001000 /* High-Speed SPI registers */ #define MISC_BASE 0xb0001800 /* Miscellaneous Registers */ #define LED_BASE 0xb0001900 /* LED control registers */ #define USB_CTL_BASE 0xb0002400 /* USB 2.0 device control registers */ #define USB_EHCI_BASE 0x10002500 /* USB host registers */ #define USB_OHCI_BASE 0x10002600 /* USB host registers */ #define USBH_CFG_BASE 0xb0002700 #define IPSEC_BASE 0xb0002800 #define DDR_BASE 0xb0003000 /* Memory control registers */ #define WLAN_CHIPC_BASE 0x10004000 /* WLAN ChipCommon registers, use 1xxx for ioremap */ #define WLAN_MAC_BASE 0x10005000 /* WLAN d11mac registers */ #define WLAN_SHIM_BASE 0xb0007000 /* shim interface to WLAN */ #define SAR_DMA_BASE 0xb000b800 /* ATM SAR DMA control registers */ #define PCIE_BASE 0xb0e40000 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 */ uint32 unused; /* 0x0c */ uint32 VDL_OVERRIDE_0; /* 0x10 */ uint32 VDL_OVERRIDE_1; /* 0x14 */ uint32 VDL_OVERRIDE_2; /* 0x18 */ uint32 VDL_OVERRIDE_3; /* 0x1c */ uint32 VDL_OVERRIDE_4; /* 0x20 */ uint32 VDL_OVERRIDE_5; /* 0x24 */ uint32 VDL_OVERRIDE_6; /* 0x28 */ uint32 VDL_OVERRIDE_7; /* 0x2c */ uint32 READ_CONTROL; /* 0x30 */ uint32 READ_FIFO_STATUS; /* 0x34 */ uint32 READ_FIFO_CLEAR; /* 0x38 */ uint32 IDLE_PAD_CONTROL; /* 0x3c */ uint32 DRIVE_PAD_CTL; /* 0x40 */ uint32 CLOCK_PAD_DISABLE; /* 0x44 */ uint32 WR_PREAMBLE_MODE; /* 0x48 */ uint32 CLOCK_REG_CONTROL; /* 0x4C */ uint32 unused0[44]; } DDRPhyByteLaneControl; typedef struct DDRControl { uint32 CNFG; /* 0x000 */ uint32 CSST; /* 0x004 */ uint32 CSEND; /* 0x008 */ uint32 unused; /* 0x00c */ uint32 ROW00_0; /* 0x010 */ uint32 ROW00_1; /* 0x014 */ uint32 ROW01_0; /* 0x018 */ uint32 ROW01_1; /* 0x01c */ uint32 unused0[4]; uint32 ROW20_0; /* 0x030 */ uint32 ROW20_1; /* 0x034 */ uint32 ROW21_0; /* 0x038 */ uint32 ROW21_1; /* 0x03c */ uint32 unused1[4]; uint32 COL00_0; /* 0x050 */ uint32 COL00_1; /* 0x054 */ uint32 COL01_0; /* 0x058 */ uint32 COL01_1; /* 0x05c */ uint32 unused2[4]; uint32 COL20_0; /* 0x070 */ uint32 COL20_1; /* 0x074 */ uint32 COL21_0; /* 0x078 */ uint32 COL21_1; /* 0x07c */ uint32 unused3[4]; uint32 BNK10; /* 0x090 */ uint32 BNK32; /* 0x094 */ uint32 unused4[26]; uint32 DCMD; /* 0x100 */ #define DCMD_CS1 (1 << 5) #define DCMD_CS0 (1 << 4) #define DCMD_SET_SREF 4 uint32 DMODE_0; /* 0x104 */ uint32 DMODE_1; /* 0x108 */ #define DMODE_1_DRAMSLEEP (1 << 11) uint32 CLKS; /* 0x10c */ uint32 ODT; /* 0x110 */ uint32 TIM1_0; /* 0x114 */ uint32 TIM1_1; /* 0x118 */ uint32 TIM2; /* 0x11c */ uint32 CTL_CRC; /* 0x120 */ uint32 DOUT_CRC; /* 0x124 */ uint32 DIN_CRC; /* 0x128 */ uint32 unused5[53]; DDRPhyControl PhyControl; /* 0x200 */ DDRPhyByteLaneControl PhyByteLane0Control; /* 0x300 */ DDRPhyByteLaneControl PhyByteLane1Control; /* 0x400 */ DDRPhyByteLaneControl PhyByteLane2Control; /* 0x500 */ DDRPhyByteLaneControl PhyByteLane3Control; /* 0x600 */ uint32 unused6[64]; uint32 GCFG; /* 0x800 */ uint32 LBIST_CFG; /* 0x804 */ uint32 LBIST_SEED; /* 0x808 */ uint32 ARB; /* 0x80c */ uint32 PI_GCF; /* 0x810 */ uint32 PI_UBUS_CTL; /* 0x814 */ uint32 PI_MIPS_CTL; /* 0x818 */ uint32 PI_DSL_MIPS_CTL; /* 0x81c */ uint32 PI_DSL_PHY_CTL; /* 0x820 */ uint32 PI_UBUS_ST; /* 0x824 */ uint32 PI_MIPS_ST; /* 0x828 */ uint32 PI_DSL_MIPS_ST; /* 0x82c */ uint32 PI_DSL_PHY_ST; /* 0x830 */ uint32 PI_UBUS_SMPL; /* 0x834 */ uint32 TESTMODE; /* 0x838 */ uint32 TEST_CFG1; /* 0x83c */ uint32 TEST_PAT; /* 0x840 */ uint32 TEST_COUNT; /* 0x844 */ uint32 TEST_CURR_COUNT; /* 0x848 */ uint32 TEST_ADDR_UPDT; /* 0x84c */ uint32 TEST_ADDR; /* 0x850 */ uint32 TEST_DATA0; /* 0x854 */ uint32 TEST_DATA1; /* 0x858 */ uint32 TEST_DATA2; /* 0x85c */ uint32 TEST_DATA3; /* 0x860 */ } DDRControl; #define DDR ((volatile DDRControl * const) DDR_BASE) /* ** Peripheral Controller */ #define IRQ_BITS 64 typedef struct { uint64 IrqMask; uint64 IrqStatus; } IrqControl_t; typedef struct PerfControl { uint32 RevID; /* (00) word 0 */ uint32 blkEnables; /* (04) word 1 */ #define NAND_CLK_EN (1 << 20) #define PHYMIPS_CLK_EN (1 << 19) #define FAP_CLK_EN (1 << 18) #define PCIE_CLK_EN (1 << 17) #define HS_SPI_CLK_EN (1 << 16) #define SPI_CLK_EN (1 << 15) #define IPSEC_CLK_EN (1 << 14) #define USBH_CLK_EN (1 << 13) #define USBD_CLK_EN (1 << 12) #define PCM_CLK_EN (1 << 11) #define ROBOSW_CLK_EN (1 << 10) #define SAR_CLK_EN (1 << 9) #define SWPKT_SAR_CLK_EN (1 << 8) #define SWPKT_USB_CLK_EN (1 << 7) #define WLAN_OCP_CLK_EN (1 << 5) #define MIPS_CLK_EN (1 << 4) #define ADSL_CLK_EN (1 << 3) #define ADSL_AFE_EN (1 << 2) #define ADSL_QPROC_EN (1 << 1) #define DISABLE_GLESS (1 << 0) uint32 pll_control; /* (08) word 2 */ #define SOFT_RESET 0x00000001 // 0 uint32 deviceTimeoutEn; /* (0c) word 3 */ uint32 softResetB; /* (10) word 4 */ #define SOFT_RST_WLAN_SHIM_UBUS (1 << 14) #define SOFT_RST_FAP (1 << 13) #define SOFT_RST_DDR_PHY (1 << 12) #define SOFT_RST_WLAN_SHIM (1 << 11) #define SOFT_RST_PCIE_EXT (1 << 10) #define SOFT_RST_PCIE (1 << 9) #define SOFT_RST_PCIE_CORE (1 << 8) #define SOFT_RST_PCM (1 << 7) #define SOFT_RST_USBH (1 << 6) #define SOFT_RST_USBD (1 << 5) #define SOFT_RST_SWITCH (1 << 4) #define SOFT_RST_SAR (1 << 3) #define SOFT_RST_EPHY (1 << 2) #define SOFT_RST_IPSEC (1 << 1) #define SOFT_RST_SPI (1 << 0) uint32 diagControl; /* (14) word 5 */ uint32 ExtIrqCfg; /* (18) word 6*/ uint32 unused1; /* (1c) word 7 */ #define EI_SENSE_SHFT 0 #define EI_STATUS_SHFT 4 #define EI_CLEAR_SHFT 8 #define EI_MASK_SHFT 12 #define EI_INSENS_SHFT 16 #define EI_LEVEL_SHFT 20 IrqControl_t IrqControl[2]; } PerfControl; #define PERF ((volatile PerfControl * const) PERF_BASE) /* ** Timer */ typedef struct Timer { uint16 unused0; byte TimerMask; #define TIMER0EN 0x01 #define TIMER1EN 0x02 #define TIMER2EN 0x04 byte TimerInts; #define TIMER0 0x01 #define TIMER1 0x02 #define TIMER2 0x04 #define WATCHDOG 0x08 uint32 TimerCtl0; uint32 TimerCtl1; uint32 TimerCtl2; #define TIMERENABLE 0x80000000 #define RSTCNTCLR 0x40000000 uint32 TimerCnt0; uint32 TimerCnt1; uint32 TimerCnt2; uint32 WatchDogDefCount; /* Write 0xff00 0x00ff to Start timer * Write 0xee00 0x00ee to Stop and re-load default count * Read from this register returns current watch dog count */ uint32 WatchDogCtl; /* Number of 50-MHz ticks for WD Reset pulse to last */ uint32 WDResetCount; } Timer; #define TIMER ((volatile Timer * const) TIMR_BASE) /* ** UART */ typedef struct UartChannel { byte unused0; byte control; #define BRGEN 0x80 /* Control register bit defs */ #define TXEN 0x40 #define RXEN 0x20 #define LOOPBK 0x10 #define TXPARITYEN 0x08 #define TXPARITYEVEN 0x04 #define RXPARITYEN 0x02 #define RXPARITYEVEN 0x01 byte config; #define XMITBREAK 0x40 #define BITS5SYM 0x00 #define BITS6SYM 0x10 #define BITS7SYM 0x20 #define BITS8SYM 0x30 #define ONESTOP 0x07 #define TWOSTOP 0x0f /* 4-LSBS represent STOP bits/char * in 1/8 bit-time intervals. Zero * represents 1/8 stop bit interval. * Fifteen represents 2 stop bits. */ byte fifoctl; #define RSTTXFIFOS 0x80 #define RSTRXFIFOS 0x40 /* 5-bit TimeoutCnt is in low bits of this register. * This count represents the number of characters * idle times before setting receive Irq when below threshold */ uint32 baudword; /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate */ byte txf_levl; /* Read-only fifo depth */ byte rxf_levl; /* Read-only fifo depth */ byte fifocfg; /* Upper 4-bits are TxThresh, Lower are * RxThreshold. Irq can be asserted * when rx fifo> thresh, txfifo