/* <:copyright-broadcom Copyright (c) 2007 Broadcom Corporation All Rights Reserved No portions of this material may be reproduced in any form without the written permission of: Broadcom Corporation 16215 Alton Parkway Irvine, California 92619 All information contained in this document is Broadcom Corporation company private, proprietary, and trade secret. :> */ /***********************************************************************/ /* */ /* MODULE: 6816_map.h */ /* DATE: 05/30/08 */ /* PURPOSE: Define addresses of major hardware components of */ /* BCM6816 */ /* */ /***********************************************************************/ #ifndef __BCM6816_MAP_H #define __BCM6816_MAP_H #ifdef __cplusplus extern "C" { #endif #include "bcmtypes.h" #include "6816_common.h" #include "6816_intr.h" /* macro to convert logical data addresses to physical */ /* DMA hardware must see physical address */ #define LtoP( x ) ( (uint32)x & 0x1fffffff ) #define PtoL( x ) ( LtoP(x) | 0xa0000000 ) 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 ACP_A_CLK_EN (1 << 25) #define ACP_B_CLK_EN (1 << 24) #define NTP_CLK_EN (1 << 23) #define PCM_CLK_EN (1 << 22) #define BMU_CLK_EN (1 << 21) #define PCIE_CLK_EN (1 << 20) #define GPON_SER_CLK_EN (1 << 19) #define IPSEC_CLK_EN (1 << 18) #define NAND_CLK_EN (1 << 17) #define DISABLE_GLESS (1 << 16) #define USBH_CLK_EN (1 << 15) #define APM_CLK_EN (1 << 14) #define ROBOSW_CLK_EN (1 << 12) #define USBD_CLK_EN (1 << 10) #define SPI_CLK_EN (1 << 9) #define SWPKT_GPON_CLK_EN (1 << 8) #define SWPKT_USB_CLK_EN (1 << 7) #define GPON_CLK_EN (1 << 6) uint32 pll_control; /* (08) word 2 */ #define SOFT_RESET 0x00000001 // 0 uint32 deviceTimeoutEn; /* (0c) word 3 */ uint32 softResetB; /* (10) word 4 */ #define SOFT_RST_SERDES_DIG (1 << 23) #define SOFT_RST_SERDES (1 << 22) #define SOFT_RST_SERDES_MDIO (1 << 21) #define SOFT_RST_SERDES_PLL (1 << 20) #define SOFT_RST_SERDES_HW (1 << 19) #define SOFT_RST_GPON (1 << 18) #define SOFT_RST_BMU (1 << 17) #define SOFT_RST_HVG (1 << 16) #define SOFT_RST_APM (1 << 15) #define SOFT_RST_ACP (1 << 14) #define SOFT_RST_PCM (1 << 13) #define SOFT_RST_USBH (1 << 12) #define SOFT_RST_USBD (1 << 11) #define SOFT_RST_SWITCH (1 << 10) #define SOFT_RST_MOCA_CPU (1 << 9) #define SOFT_RST_MOCA_SYS (1 << 8) #define SOFT_RST_MOCA (1 << 7) #define SOFT_RST_EPHY (1 << 6) #define SOFT_RST_PCIE (1 << 5) #define SOFT_RST_IPSEC (1 << 4) #define SOFT_RST_MPI (1 << 3) #define SOFT_RST_PCIE_EXT (1 << 2) #define SOFT_RST_PCIE_CORE (1 << 1) #define SOFT_RST_SPI (1 << 0) uint32 diagControl; /* (14) word 5 */ uint32 ExtIrqCfg; /* (18) word 6*/ uint32 ExtIrqCfg1; /* (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>8)&0xf) #define UDC20_INTF(x) ((x>>4)&0xf) #define UDC20_CFG(x) ((x>>0)&0xf) uint32 usbd_status; #define USBD_LINK (0x1<<10) #define USBD_SET_CSRS 0x40 #define USBD_SUSPEND 0x20 #define USBD_EARLY_SUSPEND 0x10 #define USBD_SOF 0x08 #define USBD_ENUMON 0x04 #define USBD_SETUP 0x02 #define USBD_USBRESET 0x01 uint32 usbd_events; uint32 usbd_events_irq; #define UPPER(x) (16+x) #define ENABLE(x) (1<