sbchipc.h
资源名称:bcm4702.rar [点击查看]
上传用户:yuanda199
上传日期:2022-06-26
资源大小:412k
文件大小:7k
源码类别:
VxWorks
开发平台:
C/C++
- /*
- Copyright 2001, Broadcom Corporation
- All Rights Reserved.
- This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
- the contents of this file may not be disclosed to third parties, copied or
- duplicated in any form, in whole or in part, without the prior written
- permission of Broadcom Corporation.
- */
- /*
- * Hardware-specific "chipcommon" core definitions
- * for the Broadcom HNBU family of SiliconBackplane-based chips.
- *
- * The chipcommon core provides chip identification, control and debugging.
- *
- * It includes 0, 1 or 2 uarts, a jtag port that allows direct access
- * to the silicon backplane and an interface for two different types of
- * serial flashes. It also contains clock frequency control, a watchdog
- * interrupt timer, and a GPIO interface.
- *
- * Copyright(c) 2002 Broadcom Corporation
- *
- * $Id: sbchipc.h,v 1.1 Broadcom SDK $
- */
- #ifndef _SBCHIPC_H
- #define _SBCHIPC_H
- /* cpp contortions to concatenate w/arg prescan */
- #ifndef PAD
- #define _PADLINE(line) pad ## line
- #define _XSTR(line) _PADLINE(line)
- #define PAD _XSTR(__LINE__)
- #endif /* PAD */
- typedef volatile struct {
- uint32 chipid;
- uint32 capabilities;
- uint32 corecontrol; /* corerev >= 1 */
- uint32 PAD[5];
- /* Interrupt control */
- uint32 intstatus;
- uint32 intmask;
- uint32 PAD[6];
- /* serial flash interface registers */
- uint32 flashcontrol;
- uint32 flashaddress;
- uint32 flashdata;
- uint32 PAD[1];
- /* Silicon backplane configuration broadcast control */
- uint32 broadcastaddress;
- uint32 broadcastdata;
- uint32 PAD[2];
- /* gpio - cleared only by power-on-reset */
- uint32 gpioin;
- uint32 gpioout;
- uint32 gpioouten;
- uint32 gpiocontrol;
- uint32 gpiointpolarity;
- uint32 gpiointmask;
- uint32 PAD[2];
- /* Watchdog timer */
- uint32 watchdog;
- uint32 PAD[3];
- /* clock control */
- uint32 clockcontrol_n;
- uint32 clockcontrol_sb;
- uint32 clockcontrol_pci;
- uint32 clockcontrol_uart;
- uint32 PAD[152];
- /* XXX little-endian only */
- /* uarts */
- uint8 uart0data;
- uint8 uart0imr;
- uint8 uart0fcr;
- uint8 uart0lcr;
- uint8 uart0mcr;
- uint8 uart0lsr;
- uint8 uart0msr;
- uint8 uart0scratch;
- uint8 PAD[248]; /* corerev >= 1 */
- uint8 uart1data;
- uint8 uart1imr;
- uint8 uart1fcr;
- uint8 uart1lcr;
- uint8 uart1mcr;
- uint8 uart1lsr;
- uint8 uart1msr;
- uint8 uart1scratch;
- } chipcregs_t;
- /* chipid */
- #define CID_ID_MASK 0x0000ffff /* Chip Id mask */
- #define CID_REV_MASK 0x000f0000 /* Chip Revision mask */
- #define CID_REV_SHIFT 16 /* Chip Revision shift */
- #define CID_PKG_MASK 0x00f00000 /* Package Option mask */
- #define CID_PKG_SHIFT 20 /* Package Option shift */
- /* capabilities */
- #define CAP_UARTS_MASK 0x00000003 /* Number of uarts */
- #define CAP_MIPSEB 0x00000004 /* MIPS is in big-endian mode */
- #define UCLK_INT 0x00000008 /* UART driven by internal divided clock */
- #define CAP_SFLASH_MASK 0x00000700 /* Type of Serial flash */
- #define CAP_PLL_MASK 0x00030000 /* Type of PLL */
- #define PLL_NONE 0x00000000
- #define PLL_N3M 0x00010000
- /* corecontrol */
- #define CC_UARTCLKO 0x00000001 /* Drive UART with internal clock */
- /* clockcontrol_n */
- #define CN_N1_MASK 0x3f /* n1 control */
- #define CN_N2_MASK 0x1f00 /* n2 control */
- #define CN_N2_SHIFT 8
- /* clockcontrol_sb/pci/uart */
- #define CC_M1_MASK 0x3f /* m1 control */
- #define CC_M2_MASK 0x1f00 /* m2 control */
- #define CC_M2_SHIFT 8
- #define CC_M3_MASK 0x3f0000 /* m3 control */
- #define CC_M3_SHIFT 16
- #define CC_MC_MASK 0x1f000000 /* mux control */
- #define CC_MC_SHIFT 24
- /* Clock control values for 125Mhz */
- #define CC_125_N 0x0802 /* Default values for bcm4310 */
- #define CC_125_M 0x04020009
- #define CC_125_M25 0x11090009
- #define CC_125_M33 0x11090005
- /* Clock control magic field values */
- #define CC_F6_2 0x02 /* A factor of 2 in */
- #define CC_F6_3 0x03 /* 6-bit fields like */
- #define CC_F6_4 0x05 /* N1, M1 or M3 */
- #define CC_F6_5 0x09
- #define CC_F6_6 0x11
- #define CC_F6_7 0x21
- #define CC_F5_BIAS 5 /* 5-bit fields get this added */
- #define CC_MC_BYPASS 0x08
- #define CC_MC_M1 0x04
- #define CC_MC_M1M2 0x02
- #define CC_MC_M1M2M3 0x01
- #define CC_MC_M1M3 0x11
- #define CC_CLOCK_BASE 24000000 /* Half the clock freq */
- /* Flash types in the chipcommon capabilities register */
- #define SFLASH_NONE 0x000
- #define SFLASH_ST 0x100
- #define SFLASH_AT 0x200
- /* Start/busy bit in flashcontrol */
- #define SFLASH_START 0x80000000
- #define SFLASH_BUSY SFLASH_START
- /* flashcontrol opcodes for ST flashes */
- #define SFLASH_ST_WREN 0x0006 /* Write Enable */
- #define SFLASH_ST_WRDIS 0x0004 /* Write Disable */
- #define SFLASH_ST_RDSR 0x0105 /* Read Status Register */
- #define SFLASH_ST_WRSR 0x0101 /* Write Status Register */
- #define SFLASH_ST_READ 0x0303 /* Read Data Bytes */
- #define SFLASH_ST_PP 0x0302 /* Page Program */
- #define SFLASH_ST_SE 0x02d8 /* Sector Erase */
- #define SFLASH_ST_BE 0x00c7 /* Bulk Erase */
- #define SFLASH_ST_DP 0x00b9 /* Deep Power-down */
- #define SFLASH_ST_RES 0x03ab /* Read Electronic Signature */
- /* Status register bits for ST flashes */
- #define SFLASH_ST_WIP 0x01 /* Write In Progress */
- #define SFLASH_ST_WEL 0x02 /* Write Enable Latch */
- #define SFLASH_ST_BP_MASK 0x1c /* Block Protect */
- #define SFLASH_ST_BP_SHIFT 2
- #define SFLASH_ST_SRWD 0x80 /* Status Register Write Disable */
- /* flashcontrol opcodes for Atmel flashes */
- #define SFLASH_AT_READ 0x07e8
- #define SFLASH_AT_PAGE_READ 0x07d2
- /* PR9631: impossible to specify Atmel Buffer Read command */
- #define SFLASH_AT_BUF1_READ
- #define SFLASH_AT_BUF2_READ
- #define SFLASH_AT_STATUS 0x01d7
- #define SFLASH_AT_BUF1_WRITE 0x0384
- #define SFLASH_AT_BUF2_WRITE 0x0387
- #define SFLASH_AT_BUF1_ERASE_PROGRAM 0x0283
- #define SFLASH_AT_BUF2_ERASE_PROGRAM 0x0286
- #define SFLASH_AT_BUF1_PROGRAM 0x0288
- #define SFLASH_AT_BUF2_PROGRAM 0x0289
- #define SFLASH_AT_PAGE_ERASE 0x0281
- #define SFLASH_AT_BLOCK_ERASE 0x0250
- #define SFLASH_AT_BUF1_WRITE_ERASE_PROGRAM 0x0382
- #define SFLASH_AT_BUF2_WRITE_ERASE_PROGRAM 0x0385
- #define SFLASH_AT_BUF1_LOAD 0x0253
- #define SFLASH_AT_BUF2_LOAD 0x0255
- #define SFLASH_AT_BUF1_COMPARE 0x0260
- #define SFLASH_AT_BUF2_COMPARE 0x0261
- #define SFLASH_AT_BUF1_REPROGRAM 0x0258
- #define SFLASH_AT_BUF2_REPROGRAM 0x0259
- /* Status register bits for Atmel flashes */
- #define SFLASH_AT_READY 0x80
- #define SFLASH_AT_MISMATCH 0x40
- #define SFLASH_AT_ID_MASK 0x38
- #define SFLASH_AT_ID_SHIFT 3
- #endif /* _SBCHIPC_H */