/* <:copyright-BRCM:2012:DUAL/GPL:standard Copyright (c) 2012 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 __BCM63381_MAP_PART_H #define __BCM63381_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 0x63381 #define PERF_BASE (REG_BASE + 0x00000000) /* chip control */ #define TIMR_BASE (REG_BASE + 0x000000c0) /* timer registers */ #define GPIO_BASE (REG_BASE + 0x00000180) /* gpio registers */ #define MISC_BASE (REG_BASE + 0x00000200) /* Miscellaneous Registers */ #define UART_BASE (REG_BASE + 0x00000280) /* uart registers */ #define UART1_BASE (REG_BASE + 0x000002a0) /* uart1 registers */ #define LED_BASE (REG_BASE + 0x00000300) /* LED control registers */ #define HSSPIM_BASE (REG_BASE + 0x00001000) /* High-Speed SPI registers */ #define NAND_REG_BASE (REG_BASE + 0x00002000) /* nand control register */ #define NAND_CACHE_BASE (REG_BASE + 0x00002400) /* nand cache register */ #define NAND_INTR_BASE (REG_BASE + 0x00000100) /* nand interrupt register */ #define JTAG_OTP_BASE (REG_BASE + 0x00004000) /* OTP control registers */ #define MISC_REG_BASE (REG_BASE + 0x00005080) /* Misc control register */ #define PAD_CTL_BASE (REG_BASE + 0x00005100) /* Pad control register */ #define USB_CTL_BASE (REG_BASE + 0x00009000) /* USB 2.0 device control */ #define USB_DMA_BASE (REG_BASE + 0x00009800) /* USB 2.0 device DMA control */ #define MEMC_BASE (REG_BASE + 0x0000a000) /* SDRAM Control */ #define USBH_CFG_BASE (REG_BASE + 0x0000c200) #ifdef __KERNEL__ #define USB_EHCI_BASE 0x1000c300 /* USB host registers */ #define USB_OHCI_BASE 0x1000c400 /* USB host registers */ #endif #define SAR_BASE (REG_BASE + 0x00014000) #define SAR_DMA_BASE (REG_BASE + 0x00017800) /* XTM SAR DMA control */ #define PCIE_BASE (REG_BASE + 0x00020000) #define USB30H_CFG_BASE (REG_BASE + 0x00034200) /* USB3 host control register */ #ifdef __KERNEL__ #define USB_XHCI_BASE 0x10035000 /* USB3 host registers */ #endif #define SWITCH_BASE (REG_BASE + 0x00080000) /* Robo Switch control */ #define SWITCH_DMA_BASE (REG_BASE + 0x00088000) /* Robo Switch DMA control */ #define PMC_BASE (REG_BASE + 0x00200000) /* PMC register */ #define PROC_MON_BASE (REG_BASE + 0x00280000) /* Process Monitor register */ #define DSLPHY_BASE (REG_BASE + 0x00400000) /* VDSL PHY register */ #define DSLPHY_AFE_BASE (REG_BASE + 0x00457200) /* VDSL PHY AFE register */ #define DSLLMEM_BASE (REG_BASE + 0x00500000) /* VDSL PHY Memoryr */ #ifndef __ASSEMBLER__ /* ** Peripheral Controller */ #define IRQ_BITS 64 typedef struct { uint64 IrqMask; uint64 ExtIrqMask; uint64 reserved[2]; } IrqControl_t; typedef struct PerfControl { uint32 RevID; /* (00) word 0 */ #define CHIP_ID_SHIFT 12 #define CHIP_ID_MASK (0xfffff << CHIP_ID_SHIFT) #define CHIP_VAR_SHIFT 8 #define CHIP_VAR_MASK (0xf << CHIP_VAR_SHIFT) #define REV_ID_MASK 0xff uint32 diagControl; /* (04) word 1 */ uint32 ExtIrqCfg; /* (08) word 2*/ #define EI_CLEAR_SHFT 0 #define EI_SENSE_SHFT 8 #define EI_INSENS_SHFT 16 #define EI_LEVEL_SHFT 24 uint32 ExtIrqSts; /* (0c) word 3 */ #define EI_STATUS_SHFT 0 #define EI_MASK_SHFT 16 uint64 IrqStatus; /* (10) word 4 */ uint64 ExtIrqStatus; /* (18) word 6 */ IrqControl_t IrqControl[4]; /* (20) */ } PerfControl; #define PERF ((volatile PerfControl * const) PERF_BASE) /* ** Timer */ typedef struct Timer { uint32 TimerCtl0; uint32 TimerCtl1; uint32 TimerCtl2; uint32 TimerCtl3; #define TIMERENABLE 0x80000000 #define RSTCNTCLR 0x40000000 uint32 TimerCnt0; uint32 TimerCnt1; uint32 TimerCnt2; uint32 TimerCnt3; #define TIMER_COUNT_MASK 0x3FFFFFFF uint32 TimerMask; #define TIMER0EN 0x01 #define TIMER1EN 0x02 #define TIMER2EN 0x04 #define TIMER3EN 0x08 uint32 TimerInts; #define TIMER0 0x01 #define TIMER1 0x02 #define TIMER2 0x04 #define TIMER3 0x08 #define WATCHDOG 0x10 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; uint32 SoftRst; #define SOFT_RESET 0x00000001 // 0 uint32 ResetStatus; #define PCIE_RESET_STATUS 0x10000000 #define SW_RESET_STATUS 0x20000000 #define HW_RESET_STATUS 0x40000000 #define POR_RESET_STATUS 0x80000000 #define RESET_STATUS_MASK 0xF0000000 } 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> 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 { uint32 miscPCIECtrl; /* 0x00 */ uint32 miscStrapBus; /* 0x04 */ #define MISC_STRAP_BUS_SPI_NAND_DISABLE (1<<24) #define MISC_STRAP_BUS_RESET_DELAY_N_SHORT (1<<23) #define MISC_STRAP_BUS_BOOT_SEL_SHIFT 18 #define MISC_STRAP_BUS_BOOT_SEL_MASK (0x1f << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_SPI_NOR (0x18 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_SPI_NOR_1_24MHZ (0x0 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_SPI_NOR_2_54MHZ (0x1 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_SPI_NOR_2_81MHZ (0x2 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_SPI_NOR_4_81MHZ (0x3 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_EMMC (0x1e << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_NAND_2K_PAGE (0x00 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_NAND_4K_PAGE (0x08 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_NAND_8K_PAGE (0x10 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_SEL_ECC_MASK (0x7 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_NAND_ECC_DISABLE (0x0 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_NAND_ECC_1_BIT (0x1 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_NAND_ECC_4_BIT (0x2 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_NAND_ECC_8_BIT (0x3 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_NAND_ECC_12_BIT (0x4 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_NAND_ECC_24_BIT (0x5 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_NAND_ECC_40_BIT (0x6 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_BOOT_NAND_ECC_60_BIT (0x7 << MISC_STRAP_BUS_BOOT_SEL_SHIFT) #define MISC_STRAP_BUS_DDR_N_SDRAM_SELECT (1<<17) #define MISC_STRAP_BUS_UBUS_FREQ_SHIFT 15 #define MISC_STRAP_BUS_UBUS_FREQ_MASK (0x3<