• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Broadcom HND chip & on-chip-interconnect-related definitions.
3  *
4  * Copyright (C) 1999-2019, Broadcom.
5  *
6  *      Unless you and Broadcom execute a separate written software license
7  * agreement governing use of this software, this software is licensed to you
8  * under the terms of the GNU General Public License version 2 (the "GPL"),
9  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10  * following added to such license:
11  *
12  *      As a special exception, the copyright holders of this software give you
13  * permission to link this software with independent modules, and to copy and
14  * distribute the resulting executable under terms of your choice, provided that
15  * you also meet, for each linked independent module, the terms and conditions
16  * of the license of that module.  An independent module is a module which is
17  * not derived from this software.  The special exception does not apply to any
18  * modifications of the software.
19  *
20  *      Notwithstanding the above, under no circumstances may you combine this
21  * software in any way with any other Broadcom software provided under a license
22  * other than the GPL, without Broadcom's express prior written consent.
23  *
24  *
25  * <<Broadcom-WL-IPTag/Open:>>
26  *
27  * $Id: hndsoc.h 795345 2018-12-18 16:52:03Z $
28  */
29 
30 #ifndef _HNDSOC_H
31 #define _HNDSOC_H
32 
33 /* Include the soci specific files */
34 #include <sbconfig.h>
35 #include <aidmp.h>
36 
37 /*
38  * SOC Interconnect Address Map.
39  * All regions may not exist on all chips.
40  */
41 #define SI_SDRAM_BASE 0x00000000 /* Physical SDRAM */
42 #define SI_PCI_MEM 0x08000000    /* Host Mode sb2pcitranslation0 (64 MB) */
43 #define SI_PCI_MEM_SZ (64 * 1024 * 1024)
44 #define SI_PCI_CFG 0x0c000000       /* Host Mode sb2pcitranslation1 (64 MB) */
45 #define SI_SDRAM_SWAPPED 0x10000000 /* Byteswapped Physical SDRAM */
46 #define SI_SDRAM_R2 0x80000000      /* Region 2 for sdram (512 MB) */
47 
48 #ifdef STB_SOC_WIFI
49 #define SI_REG_BASE_SIZE 0xB000 /* size from 0xf1800000 to 0xf180AFFF (44KB)   \
50                                  */
51 #define SI_ENUM_BASE_DEFAULT 0xF1800000 /* Enumeration space base */
52 #define SI_WRAP_BASE_DEFAULT 0xF1900000 /* Wrapper space base */
53 #endif                                  /* STB_SOC_WIFI */
54 
55 #ifndef SI_ENUM_BASE_DEFAULT
56 #define SI_ENUM_BASE_DEFAULT 0x18000000 /* Enumeration space base */
57 #endif                                  // endif
58 
59 #ifndef SI_WRAP_BASE_DEFAULT
60 #define SI_WRAP_BASE_DEFAULT 0x18100000 /* Wrapper space base */
61 #endif                                  // endif
62 
63 /** new(er) chips started locating their chipc core at a different BP address
64  * than 0x1800_0000 */
65 // NIC and DHD driver binaries should support both old(er) and new(er) chips at
66 // the same time
67 #define SI_ENUM_BASE(sih) ((sih)->enum_base)
68 #define SI_WRAP_BASE(sih) (SI_ENUM_BASE(sih) + 0x00100000)
69 
70 #define SI_CORE_SIZE 0x1000 /* each core gets 4Kbytes for registers */
71 
72 #define SI_NIC400_GPV_BASE                                                     \
73     0x18200000                    /* NIC-400 Global Programmers View (GPV) */
74 #define SI_GPV_WR_CAP_ADDR 0x4008 /* WR-CAP offset */
75 #define SI_GPV_RD_CAP_EN 0x1      /* issue read */
76 #define SI_GPV_WR_CAP_EN 0x2      /* issue write */
77 
78 #ifndef SI_MAXCORES
79 #define SI_MAXCORES 32 /* NorthStar has more cores */
80 #endif                 /* SI_MAXCORES */
81 
82 #define SI_MAXBR                                                               \
83     4 /* Max bridges (this is arbitrary, for software                          \
84        * convenience and could be changed if we                                \
85        * make any larger chips                                                 \
86        */
87 
88 #define SI_FASTRAM 0x19000000 /* On-chip RAM on chips that also have DDR */
89 #define SI_FASTRAM_SWAPPED 0x19800000
90 
91 #define SI_FLASH2 0x1c000000       /* Flash Region 2 (region 1 shadowed here) */
92 #define SI_FLASH2_SZ 0x02000000    /* Size of Flash Region 2 */
93 #define SI_ARMCM3_ROM 0x1e000000   /* ARM Cortex-M3 ROM */
94 #define SI_FLASH1 0x1fc00000       /* MIPS Flash Region 1 */
95 #define SI_FLASH1_SZ 0x00400000    /* MIPS Size of Flash Region 1 */
96 #define SI_FLASH_WINDOW 0x01000000 /* Flash XIP Window */
97 
98 #define SI_NS_NANDFLASH 0x1c000000    /* NorthStar NAND flash base */
99 #define SI_NS_NORFLASH 0x1e000000     /* NorthStar NOR flash base */
100 #define SI_NS_ROM 0xfffd0000          /* NorthStar ROM */
101 #define SI_NS_FLASH_WINDOW 0x02000000 /* Flash XIP Window */
102 
103 #define SI_ARM7S_ROM 0x20000000    /* ARM7TDMI-S ROM */
104 #define SI_ARMCR4_ROM 0x000f0000   /* ARM Cortex-R4 ROM */
105 #define SI_ARMCM3_SRAM2 0x60000000 /* ARM Cortex-M3 SRAM Region 2 */
106 #define SI_ARM7S_SRAM2 0x80000000  /* ARM7TDMI-S SRAM Region 2 */
107 #define SI_ARMCA7_ROM 0x00000000   /* ARM Cortex-A7 ROM */
108 #ifndef SI_ARMCA7_RAM
109 #define SI_ARMCA7_RAM 0x00200000    /* ARM Cortex-A7 RAM */
110 #endif                              // endif
111 #define SI_ARM_FLASH1 0xffff0000    /* ARM Flash Region 1 */
112 #define SI_ARM_FLASH1_SZ 0x00010000 /* ARM Size of Flash Region 1 */
113 
114 #define SI_SFLASH 0x14000000
115 #define SI_PCI_DMA 0x40000000  /* Client Mode sb2pcitranslation2 (1 GB) */
116 #define SI_PCI_DMA2 0x80000000 /* Client Mode sb2pcitranslation2 (1 GB) */
117 #define SI_PCI_DMA_SZ                                                          \
118     0x40000000 /* Client Mode sb2pcitranslation2 size in bytes */
119 #define SI_PCIE_DMA_L32                                                        \
120     0x00000000 /* PCIE Client Mode sb2pcitranslation2                          \
121                 * (2 ZettaBytes), low 32 bits                                  \
122                 */
123 #define SI_PCIE_DMA_H32                                                        \
124     0x80000000 /* PCIE Client Mode sb2pcitranslation2                          \
125                 * (2 ZettaBytes), high 32 bits                                 \
126                 */
127 
128 #define SI_BCM53573_NANDFLASH 0x30000000 /* 53573 NAND flash base */
129 #define SI_BCM53573_NORFLASH 0x1c000000  /* 53573 NOR flash base */
130 #define SI_BCM53573_FLASH2_SZ 0x04000000 /* 53573 NOR flash2 size */
131 
132 #define SI_BCM53573_NORFLASH_WINDOW                                            \
133     0x01000000 /* only support 16M direct access for                           \
134                 * 3-byte address modes in spi flash                            \
135                 */
136 #define SI_BCM53573_BOOTDEV_MASK 0x3
137 #define SI_BCM53573_BOOTDEV_NOR 0x0
138 
139 #define SI_BCM53573_NAND_PRE_MASK 0x100 /* 53573 NAND present mask */
140 
141 #define SI_BCM53573_DDRTYPE_MASK 0x10
142 #define SI_BCM53573_DDRTYPE_DDR3 0x10
143 
144 #define SI_BCM47189_RGMII_VDD_MASK 0x3
145 #define SI_BCM47189_RGMII_VDD_SHIFT 21
146 #define SI_BCM47189_RGMII_VDD_3_3V 0
147 #define SI_BCM47189_RGMII_VDD_2_5V 1
148 #define SI_BCM47189_RGMII_VDD_1_5V 1
149 
150 #define SI_BCM53573_LOCKED_CPUPLL 0x1
151 
152 /* APB bridge code */
153 #define APB_BRIDGE_ID 0x135 /* APB Bridge 0, 1, etc. */
154 
155 /* core codes */
156 #define NODEV_CORE_ID 0x700    /* Invalid coreid */
157 #define CC_CORE_ID 0x800       /* chipcommon core */
158 #define ILINE20_CORE_ID 0x801  /* iline20 core */
159 #define SRAM_CORE_ID 0x802     /* sram core */
160 #define SDRAM_CORE_ID 0x803    /* sdram core */
161 #define PCI_CORE_ID 0x804      /* pci core */
162 #define MIPS_CORE_ID 0x805     /* mips core */
163 #define ENET_CORE_ID 0x806     /* enet mac core */
164 #define CODEC_CORE_ID 0x807    /* v90 codec core */
165 #define USB_CORE_ID 0x808      /* usb 1.1 host/device core */
166 #define ADSL_CORE_ID 0x809     /* ADSL core */
167 #define ILINE100_CORE_ID 0x80a /* iline100 core */
168 #define IPSEC_CORE_ID 0x80b    /* ipsec core */
169 #define UTOPIA_CORE_ID 0x80c   /* utopia core */
170 #define PCMCIA_CORE_ID 0x80d   /* pcmcia core */
171 #define SOCRAM_CORE_ID 0x80e   /* internal memory core */
172 #define MEMC_CORE_ID 0x80f     /* memc sdram core */
173 #define OFDM_CORE_ID 0x810     /* OFDM phy core */
174 #define EXTIF_CORE_ID 0x811    /* external interface core */
175 #define D11_CORE_ID 0x812      /* 802.11 MAC core */
176 #define APHY_CORE_ID 0x813     /* 802.11a phy core */
177 #define BPHY_CORE_ID 0x814     /* 802.11b phy core */
178 #define GPHY_CORE_ID 0x815     /* 802.11g phy core */
179 #define MIPS33_CORE_ID 0x816   /* mips3302 core */
180 #define USB11H_CORE_ID 0x817   /* usb 1.1 host core */
181 #define USB11D_CORE_ID 0x818   /* usb 1.1 device core */
182 #define USB20H_CORE_ID 0x819   /* usb 2.0 host core */
183 #define USB20D_CORE_ID 0x81a   /* usb 2.0 device core */
184 #define SDIOH_CORE_ID 0x81b    /* sdio host core */
185 #define ROBO_CORE_ID 0x81c     /* roboswitch core */
186 #define ATA100_CORE_ID 0x81d   /* parallel ATA core */
187 #define SATAXOR_CORE_ID 0x81e  /* serial ATA & XOR DMA core */
188 #define GIGETH_CORE_ID 0x81f   /* gigabit ethernet core */
189 #define PCIE_CORE_ID 0x820     /* pci express core */
190 #define NPHY_CORE_ID 0x821     /* 802.11n 2x2 phy core */
191 #define SRAMC_CORE_ID 0x822    /* SRAM controller core */
192 #define MINIMAC_CORE_ID 0x823  /* MINI MAC/phy core */
193 #define ARM11_CORE_ID 0x824    /* ARM 1176 core */
194 #define ARM7S_CORE_ID 0x825    /* ARM7tdmi-s core */
195 #define LPPHY_CORE_ID 0x826    /* 802.11a/b/g phy core */
196 #define PMU_CORE_ID 0x827      /* PMU core */
197 #define SSNPHY_CORE_ID 0x828   /* 802.11n single-stream phy core */
198 #define SDIOD_CORE_ID 0x829    /* SDIO device core */
199 #define ARMCM3_CORE_ID 0x82a   /* ARM Cortex M3 core */
200 #define HTPHY_CORE_ID 0x82b    /* 802.11n 4x4 phy core */
201 #define MIPS74K_CORE_ID 0x82c  /* mips 74k core */
202 #define GMAC_CORE_ID 0x82d     /* Gigabit MAC core */
203 #define DMEMC_CORE_ID 0x82e    /* DDR1/2 memory controller core */
204 #define PCIERC_CORE_ID 0x82f   /* PCIE Root Complex core */
205 #define OCP_CORE_ID 0x830      /* OCP2OCP bridge core */
206 #define SC_CORE_ID 0x831       /* shared common core */
207 #define AHB_CORE_ID 0x832      /* OCP2AHB bridge core */
208 #define SPIH_CORE_ID 0x833     /* SPI host core */
209 #define I2S_CORE_ID 0x834      /* I2S core */
210 #define DMEMS_CORE_ID 0x835    /* SDR/DDR1 memory controller core */
211 #define DEF_SHIM_COMP 0x837    /* SHIM component in ubus/6362 */
212 
213 #define ACPHY_CORE_ID 0x83b      /* Dot11 ACPHY */
214 #define PCIE2_CORE_ID 0x83c      /* pci express Gen2 core */
215 #define USB30D_CORE_ID 0x83d     /* usb 3.0 device core */
216 #define ARMCR4_CORE_ID 0x83e     /* ARM CR4 CPU */
217 #define GCI_CORE_ID 0x840        /* GCI Core */
218 #define SR_CORE_ID 0x841         /* SR_CORE ID */
219 #define M2MDMA_CORE_ID 0x844     /* memory to memory dma */
220 #define CMEM_CORE_ID 0x846       /* CNDS DDR2/3 memory controller */
221 #define ARMCA7_CORE_ID 0x847     /* ARM CA7 CPU */
222 #define SYSMEM_CORE_ID 0x849     /* System memory core */
223 #define HUB_CORE_ID 0x84b        /* Hub core ID */
224 #define HND_OOBR_CORE_ID 0x85c   /* Hnd oob router core ID */
225 #define APB_BRIDGE_CORE_ID 0x135 /* APB bridge core ID */
226 #define AXI_CORE_ID 0x301        /* AXI/GPV core ID */
227 #define EROM_CORE_ID 0x366       /* EROM core ID */
228 #define OOB_ROUTER_CORE_ID 0x367 /* OOB router core ID */
229 #define DEF_AI_COMP                                                            \
230     0xfff /* Default component, in ai chips it maps all                        \
231            * unused address ranges                                             \
232            */
233 
234 #define NS_PCIEG2_CORE_ID 0x501         /* PCIE Gen 2 core */
235 #define NS_DMA_CORE_ID 0x502            /* DMA core */
236 #define NS_SDIO3_CORE_ID 0x503          /* SDIO3 core */
237 #define NS_USB20_CORE_ID 0x504          /* USB2.0 core */
238 #define NS_USB30_CORE_ID 0x505          /* USB3.0 core */
239 #define NS_A9JTAG_CORE_ID 0x506         /* ARM Cortex A9 JTAG core */
240 #define NS_DDR23_CORE_ID 0x507          /* Denali DDR2/DDR3 memory controller */
241 #define NS_ROM_CORE_ID 0x508            /* ROM core */
242 #define NS_NAND_CORE_ID 0x509           /* NAND flash controller core */
243 #define NS_QSPI_CORE_ID 0x50a           /* SPI flash controller core */
244 #define NS_CCB_CORE_ID 0x50b            /* ChipcommonB core */
245 #define NS_SOCRAM_CORE_ID 0x50e         /* internal memory core */
246 #define ARMCA9_CORE_ID 0x510            /* ARM Cortex A9 core (ihost) */
247 #define NS_IHOST_CORE_ID ARMCA9_CORE_ID /* ARM Cortex A9 core (ihost) */
248 #define AMEMC_CORE_ID 0x52e             /* DDR1/2 memory controller core */
249 #define ALTA_CORE_ID 0x534              /* I2S core */
250 #define DDR23_PHY_CORE_ID 0x5dd
251 
252 #define SI_PCI1_MEM 0x40000000 /* Host Mode sb2pcitranslation0 (64 MB) */
253 #define SI_PCI1_CFG 0x44000000 /* Host Mode sb2pcitranslation1 (64 MB) */
254 #define SI_PCIE1_DMA_H32                                                       \
255     0xc0000000                    /* PCIE Client Mode sb2pcitranslation2       \
256                                    * (2 ZettaBytes), high 32 bits              \
257                                    */
258 #define NS_PCIEG2_CORE_REV_B0 0x7 /* NS-B0 PCIE Gen 2 core rev */
259 
260 /* There are TWO constants on all HND chips: SI_ENUM_BASE_DEFAULT above,
261  * and chipcommon being the first core:
262  */
263 #define SI_CC_IDX 0
264 /* SOC Interconnect types (aka chip types) */
265 #define SOCI_SB 0
266 #define SOCI_AI 1
267 #define SOCI_UBUS 2
268 #define SOCI_NAI 3
269 #define SOCI_DVTBUS 4 /* BCM7XXX Digital Video Tech bus */
270 
271 /* Common core control flags */
272 #define SICF_BIST_EN 0x8000
273 #define SICF_PME_EN 0x4000
274 #define SICF_CORE_BITS 0x3ffc
275 #define SICF_FGC 0x0002
276 #define SICF_CLOCK_EN 0x0001
277 
278 /* Common core status flags */
279 #define SISF_BIST_DONE 0x8000
280 #define SISF_BIST_ERROR 0x4000
281 #define SISF_GATED_CLK 0x2000
282 #define SISF_DMA64 0x1000
283 #define SISF_CORE_BITS 0x0fff
284 
285 /* Norstar core status flags */
286 #define SISF_NS_BOOTDEV_MASK 0x0003    /* ROM core */
287 #define SISF_NS_BOOTDEV_NOR 0x0000     /* ROM core */
288 #define SISF_NS_BOOTDEV_NAND 0x0001    /* ROM core */
289 #define SISF_NS_BOOTDEV_ROM 0x0002     /* ROM core */
290 #define SISF_NS_BOOTDEV_OFFLOAD 0x0003 /* ROM core */
291 #define SISF_NS_SKUVEC_MASK 0x000c     /* ROM core */
292 
293 /* dot11 core-specific status flags */
294 #define SISF_MINORREV_D11_SHIFT 16
295 #define SISF_MINORREV_D11_MASK 0xF /**< minor corerev (corerev == 61) */
296 
297 /* A register that is common to all cores to
298  * communicate w/PMU regarding clock control.
299  */
300 #define SI_CLK_CTL_ST 0x1e0 /* clock control and status */
301 #define SI_PWR_CTL_ST 0x1e8 /* For memory clock gating */
302 
303 /* clk_ctl_st register */
304 #define CCS_FORCEALP 0x00000001        /* force ALP request */
305 #define CCS_FORCEHT 0x00000002         /* force HT request */
306 #define CCS_FORCEILP 0x00000004        /* force ILP request */
307 #define CCS_ALPAREQ 0x00000008         /* ALP Avail Request */
308 #define CCS_HTAREQ 0x00000010          /* HT Avail Request */
309 #define CCS_FORCEHWREQOFF 0x00000020   /* Force HW Clock Request Off */
310 #define CCS_HQCLKREQ 0x00000040        /* HQ Clock Required */
311 #define CCS_USBCLKREQ 0x00000100       /* USB Clock Req */
312 #define CCS_SECICLKREQ 0x00000100      /* SECI Clock Req */
313 #define CCS_ARMFASTCLOCKREQ 0x00000100 /* ARM CR4/CA7 fast clock request */
314 #define CCS_SFLASH_CLKREQ 0x00000200   /* Sflash clk request */
315 #define CCS_AVBCLKREQ 0x00000400       /* AVB Clock enable request */
316 #define CCS_ERSRC_REQ_MASK 0x00000700  /* external resource requests */
317 #define CCS_ERSRC_REQ_SHIFT 8
318 #define CCS_ALPAVAIL 0x00010000  /* ALP is available */
319 #define CCS_HTAVAIL 0x00020000   /* HT is available */
320 #define CCS_BP_ON_APL 0x00040000 /* RO: Backplane is running on ALP clock */
321 #define CCS_BP_ON_HT 0x00080000  /* RO: Backplane is running on HT clock */
322 #define CCS_ARMFASTCLOCKSTATUS 0x01000000 /* Fast CPU clock is running */
323 #define CCS_ERSRC_STS_MASK 0x07000000     /* external resource status */
324 #define CCS_ERSRC_STS_SHIFT 24
325 #define CCS_SECI_AVAIL 0x01000000 /* RO: SECI is available  */
326 
327 /* Not really related to SOC Interconnect, but a couple of software
328  * conventions for the use the flash space:
329  */
330 
331 /* Minumum amount of flash we support */
332 #define FLASH_MIN 0x00020000 /* Minimum flash size */
333 
334 /* A boot/binary may have an embedded block that describes its size  */
335 #define BISZ_OFFSET 0x3e0     /* At this offset into the binary */
336 #define BISZ_MAGIC 0x4249535a /* Marked with this value: 'BISZ' */
337 #define BISZ_MAGIC_IDX 0      /* Word 0: magic */
338 #define BISZ_TXTST_IDX 1      /*	1: text start */
339 #define BISZ_TXTEND_IDX 2     /*	2: text end */
340 #define BISZ_DATAST_IDX 3     /*	3: data start */
341 #define BISZ_DATAEND_IDX 4    /*	4: data end */
342 #define BISZ_BSSST_IDX 5      /*	5: bss start */
343 #define BISZ_BSSEND_IDX 6     /*	6: bss end */
344 #define BISZ_SIZE 7           /* descriptor size in 32-bit integers */
345 
346 /* Boot/Kernel related defintion and functions */
347 #define SOC_BOOTDEV_ROM 0x00000001
348 #define SOC_BOOTDEV_PFLASH 0x00000002
349 #define SOC_BOOTDEV_SFLASH 0x00000004
350 #define SOC_BOOTDEV_NANDFLASH 0x00000008
351 
352 #define SOC_KNLDEV_NORFLASH 0x00000002
353 #define SOC_KNLDEV_NANDFLASH 0x00000004
354 
355 #if !defined(_LANGUAGE_ASSEMBLY) && !defined(__ASSEMBLY__)
356 int soc_boot_dev(void *sih);
357 int soc_knl_dev(void *sih);
358 #endif /* !defined(_LANGUAGE_ASSEMBLY) && !defined(__ASSEMBLY__) */
359 
360 #define PMU_BASE_OFFSET 0x00012000 /* PMU offset is changed for ccrev >= 56 */
361 #endif                             /* _HNDSOC_H */
362