0001
0002
0003
0004
0005
0006 #ifndef _SBCHIPC_H
0007 #define _SBCHIPC_H
0008
0009 #include "defs.h" /* for PAD macro */
0010
0011 #define CHIPCREGOFFS(field) offsetof(struct chipcregs, field)
0012
0013 struct chipcregs {
0014 u32 chipid;
0015 u32 capabilities;
0016 u32 corecontrol;
0017 u32 bist;
0018
0019
0020 u32 otpstatus;
0021 u32 otpcontrol;
0022 u32 otpprog;
0023 u32 otplayout;
0024
0025
0026 u32 intstatus;
0027 u32 intmask;
0028
0029
0030 u32 chipcontrol;
0031 u32 chipstatus;
0032
0033
0034 u32 jtagcmd;
0035 u32 jtagir;
0036 u32 jtagdr;
0037 u32 jtagctrl;
0038
0039
0040 u32 flashcontrol;
0041 u32 flashaddress;
0042 u32 flashdata;
0043 u32 PAD[1];
0044
0045
0046 u32 broadcastaddress;
0047 u32 broadcastdata;
0048
0049
0050 u32 gpiopullup;
0051 u32 gpiopulldown;
0052 u32 gpioin;
0053 u32 gpioout;
0054 u32 gpioouten;
0055 u32 gpiocontrol;
0056 u32 gpiointpolarity;
0057 u32 gpiointmask;
0058
0059
0060 u32 gpioevent;
0061 u32 gpioeventintmask;
0062
0063
0064 u32 watchdog;
0065
0066
0067 u32 gpioeventintpolarity;
0068
0069
0070 u32 gpiotimerval;
0071 u32 gpiotimeroutmask;
0072
0073
0074 u32 clockcontrol_n;
0075 u32 clockcontrol_sb;
0076 u32 clockcontrol_pci;
0077 u32 clockcontrol_m2;
0078 u32 clockcontrol_m3;
0079 u32 clkdiv;
0080 u32 gpiodebugsel;
0081 u32 capabilities_ext;
0082
0083
0084 u32 pll_on_delay;
0085 u32 fref_sel_delay;
0086 u32 slow_clk_ctl;
0087 u32 PAD;
0088
0089
0090 u32 system_clk_ctl;
0091 u32 clkstatestretch;
0092 u32 PAD[2];
0093
0094
0095 u32 bp_addrlow;
0096 u32 bp_addrhigh;
0097 u32 bp_data;
0098 u32 PAD;
0099 u32 bp_indaccess;
0100 u32 PAD[3];
0101
0102
0103 u32 clkdiv2;
0104 u32 PAD[2];
0105
0106
0107 u32 eromptr;
0108
0109
0110 u32 pcmcia_config;
0111 u32 pcmcia_memwait;
0112 u32 pcmcia_attrwait;
0113 u32 pcmcia_iowait;
0114 u32 ide_config;
0115 u32 ide_memwait;
0116 u32 ide_attrwait;
0117 u32 ide_iowait;
0118 u32 prog_config;
0119 u32 prog_waitcount;
0120 u32 flash_config;
0121 u32 flash_waitcount;
0122 u32 SECI_config;
0123 u32 PAD[3];
0124
0125
0126 u32 eci_output;
0127 u32 eci_control;
0128 u32 eci_inputlo;
0129 u32 eci_inputmi;
0130 u32 eci_inputhi;
0131 u32 eci_inputintpolaritylo;
0132 u32 eci_inputintpolaritymi;
0133 u32 eci_inputintpolarityhi;
0134 u32 eci_intmasklo;
0135 u32 eci_intmaskmi;
0136 u32 eci_intmaskhi;
0137 u32 eci_eventlo;
0138 u32 eci_eventmi;
0139 u32 eci_eventhi;
0140 u32 eci_eventmasklo;
0141 u32 eci_eventmaskmi;
0142 u32 eci_eventmaskhi;
0143 u32 PAD[3];
0144
0145
0146 u32 sromcontrol;
0147 u32 sromaddress;
0148 u32 sromdata;
0149 u32 PAD[17];
0150
0151
0152 u32 clk_ctl_st;
0153 u32 hw_war;
0154 u32 PAD[70];
0155
0156
0157 u8 uart0data;
0158 u8 uart0imr;
0159 u8 uart0fcr;
0160 u8 uart0lcr;
0161 u8 uart0mcr;
0162 u8 uart0lsr;
0163 u8 uart0msr;
0164 u8 uart0scratch;
0165 u8 PAD[248];
0166
0167 u8 uart1data;
0168 u8 uart1imr;
0169 u8 uart1fcr;
0170 u8 uart1lcr;
0171 u8 uart1mcr;
0172 u8 uart1lsr;
0173 u8 uart1msr;
0174 u8 uart1scratch;
0175 u32 PAD[62];
0176
0177
0178 u32 sr_capability;
0179 u32 sr_control0;
0180 u32 sr_control1;
0181 u32 gpio_control;
0182 u32 PAD[60];
0183
0184
0185 u32 pmucontrol;
0186 u32 pmucapabilities;
0187 u32 pmustatus;
0188 u32 res_state;
0189 u32 res_pending;
0190 u32 pmutimer;
0191 u32 min_res_mask;
0192 u32 max_res_mask;
0193 u32 res_table_sel;
0194 u32 res_dep_mask;
0195 u32 res_updn_timer;
0196 u32 res_timer;
0197 u32 clkstretch;
0198 u32 pmuwatchdog;
0199 u32 gpiosel;
0200 u32 gpioenable;
0201 u32 res_req_timer_sel;
0202 u32 res_req_timer;
0203 u32 res_req_mask;
0204 u32 pmucapabilities_ext;
0205 u32 chipcontrol_addr;
0206 u32 chipcontrol_data;
0207 u32 regcontrol_addr;
0208 u32 regcontrol_data;
0209 u32 pllcontrol_addr;
0210 u32 pllcontrol_data;
0211 u32 pmustrapopt;
0212 u32 pmu_xtalfreq;
0213 u32 retention_ctl;
0214 u32 PAD[3];
0215 u32 retention_grpidx;
0216 u32 retention_grpctl;
0217 u32 PAD[94];
0218 u16 sromotp[768];
0219 };
0220
0221
0222 #define CID_ID_MASK 0x0000ffff
0223 #define CID_REV_MASK 0x000f0000
0224 #define CID_REV_SHIFT 16
0225 #define CID_PKG_MASK 0x00f00000
0226 #define CID_PKG_SHIFT 20
0227 #define CID_CC_MASK 0x0f000000
0228 #define CID_CC_SHIFT 24
0229 #define CID_TYPE_MASK 0xf0000000
0230 #define CID_TYPE_SHIFT 28
0231
0232
0233 #define CC_CAP_UARTS_MASK 0x00000003
0234 #define CC_CAP_MIPSEB 0x00000004
0235 #define CC_CAP_UCLKSEL 0x00000018
0236
0237 #define CC_CAP_UINTCLK 0x00000008
0238 #define CC_CAP_UARTGPIO 0x00000020
0239 #define CC_CAP_EXTBUS_MASK 0x000000c0
0240 #define CC_CAP_EXTBUS_NONE 0x00000000
0241 #define CC_CAP_EXTBUS_FULL 0x00000040
0242 #define CC_CAP_EXTBUS_PROG 0x00000080
0243 #define CC_CAP_FLASH_MASK 0x00000700
0244 #define CC_CAP_PLL_MASK 0x00038000
0245 #define CC_CAP_PWR_CTL 0x00040000
0246 #define CC_CAP_OTPSIZE 0x00380000
0247 #define CC_CAP_OTPSIZE_SHIFT 19
0248 #define CC_CAP_OTPSIZE_BASE 5
0249 #define CC_CAP_JTAGP 0x00400000
0250 #define CC_CAP_ROM 0x00800000
0251 #define CC_CAP_BKPLN64 0x08000000
0252 #define CC_CAP_PMU 0x10000000
0253 #define CC_CAP_SROM 0x40000000
0254
0255 #define CC_CAP_NFLASH 0x80000000
0256
0257 #define CC_CAP2_SECI 0x00000001
0258
0259 #define CC_CAP2_GSIO 0x00000002
0260
0261
0262 #define CC_SR_CTL0_ENABLE_MASK BIT(0)
0263 #define CC_SR_CTL0_ENABLE_SHIFT 0
0264 #define CC_SR_CTL0_EN_SR_ENG_CLK_SHIFT 1
0265 #define CC_SR_CTL0_RSRC_TRIGGER_SHIFT 2
0266
0267
0268 #define CC_SR_CTL0_MIN_DIV_SHIFT 6
0269
0270
0271 #define CC_SR_CTL0_EN_SBC_STBY_SHIFT 16
0272 #define CC_SR_CTL0_EN_SR_ALP_CLK_MASK_SHIFT 18
0273 #define CC_SR_CTL0_EN_SR_HT_CLK_SHIFT 19
0274 #define CC_SR_CTL0_ALLOW_PIC_SHIFT 20
0275
0276
0277 #define CC_SR_CTL0_MAX_SR_LQ_CLK_CNT_SHIFT 25
0278 #define CC_SR_CTL0_EN_MEM_DISABLE_FOR_SLEEP 30
0279
0280
0281 #define PCAP_REV_MASK 0x000000ff
0282 #define PCAP_RC_MASK 0x00001f00
0283 #define PCAP_RC_SHIFT 8
0284 #define PCAP_TC_MASK 0x0001e000
0285 #define PCAP_TC_SHIFT 13
0286 #define PCAP_PC_MASK 0x001e0000
0287 #define PCAP_PC_SHIFT 17
0288 #define PCAP_VC_MASK 0x01e00000
0289 #define PCAP_VC_SHIFT 21
0290 #define PCAP_CC_MASK 0x1e000000
0291 #define PCAP_CC_SHIFT 25
0292 #define PCAP5_PC_MASK 0x003e0000
0293 #define PCAP5_PC_SHIFT 17
0294 #define PCAP5_VC_MASK 0x07c00000
0295 #define PCAP5_VC_SHIFT 22
0296 #define PCAP5_CC_MASK 0xf8000000
0297 #define PCAP5_CC_SHIFT 27
0298
0299 #define PCAPEXT_SR_SUPPORTED_MASK (1 << 1)
0300
0301 #define PMU_RCTL_MACPHY_DISABLE_MASK (1 << 26)
0302 #define PMU_RCTL_LOGIC_DISABLE_MASK (1 << 27)
0303
0304
0305
0306
0307
0308
0309 #define PMU_MAX_TRANSITION_DLY 15000
0310
0311 #endif