339-MIPS-BCM63XX-add-support-for-BCM63268.patch 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. From 98f63141190ac02c58b78d58f771bd263c61d756 Mon Sep 17 00:00:00 2001
  2. From: Jonas Gorski <jogo@openwrt.org>
  3. Date: Sat, 7 Dec 2013 17:14:17 +0100
  4. Subject: [PATCH 48/56] MIPS: BCM63XX: add support for BCM63268
  5. Signed-off-by: Jonas Gorski <jogo@openwrt.org>
  6. ---
  7. arch/mips/bcm63xx/Kconfig | 5 +
  8. arch/mips/bcm63xx/boards/board_bcm963xx.c | 2 +-
  9. arch/mips/bcm63xx/clk.c | 25 ++++-
  10. arch/mips/bcm63xx/cpu.c | 59 +++++++++-
  11. arch/mips/bcm63xx/dev-flash.c | 6 +
  12. arch/mips/bcm63xx/dev-spi.c | 4 +-
  13. arch/mips/bcm63xx/irq.c | 20 +++-
  14. arch/mips/bcm63xx/reset.c | 21 ++++
  15. arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h | 130 ++++++++++++++++++++++
  16. arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h | 2 +
  17. arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h | 79 +++++++++++++
  18. arch/mips/include/asm/mach-bcm63xx/ioremap.h | 1 +
  19. 12 files changed, 342 insertions(+), 12 deletions(-)
  20. --- a/arch/mips/bcm63xx/Kconfig
  21. +++ b/arch/mips/bcm63xx/Kconfig
  22. @@ -60,6 +60,11 @@ config BCM63XX_CPU_6368
  23. select HW_HAS_PCI
  24. select BCM63XX_OHCI
  25. select BCM63XX_EHCI
  26. +
  27. +config BCM63XX_CPU_63268
  28. + bool "support 63268 CPU"
  29. + select SYS_HAS_CPU_BMIPS4350
  30. + select HW_HAS_PCI
  31. endmenu
  32. source "arch/mips/bcm63xx/boards/Kconfig"
  33. --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
  34. +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
  35. @@ -713,7 +713,7 @@ void __init board_prom_init(void)
  36. /* read base address of boot chip select (0)
  37. * 6328/6362 do not have MPI but boot from a fixed address
  38. */
  39. - if (BCMCPU_IS_6328() || BCMCPU_IS_6362()) {
  40. + if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) {
  41. val = 0x18000000;
  42. } else {
  43. val = bcm_mpi_readl(MPI_CSBASE_REG(0));
  44. --- a/arch/mips/bcm63xx/clk.c
  45. +++ b/arch/mips/bcm63xx/clk.c
  46. @@ -133,6 +133,8 @@ static void enetsw_set(struct clk *clk,
  47. CKCTL_6368_SWPKT_USB_EN |
  48. CKCTL_6368_SWPKT_SAR_EN,
  49. enable);
  50. + else if (BCMCPU_IS_63268())
  51. + bcm_hwclock_set(CKCTL_63268_ROBOSW_EN, enable);
  52. else
  53. return;
  54. @@ -177,6 +179,8 @@ static void usbh_set(struct clk *clk, in
  55. bcm_hwclock_set(CKCTL_6362_USBH_EN, enable);
  56. else if (BCMCPU_IS_6368())
  57. bcm_hwclock_set(CKCTL_6368_USBH_EN, enable);
  58. + else if (BCMCPU_IS_63268())
  59. + bcm_hwclock_set(CKCTL_63268_USBH_EN, enable);
  60. else
  61. return;
  62. @@ -199,6 +203,8 @@ static void usbd_set(struct clk *clk, in
  63. bcm_hwclock_set(CKCTL_6362_USBD_EN, enable);
  64. else if (BCMCPU_IS_6368())
  65. bcm_hwclock_set(CKCTL_6368_USBD_EN, enable);
  66. + else if (BCMCPU_IS_63268())
  67. + bcm_hwclock_set(CKCTL_63268_USBD_EN, enable);
  68. else
  69. return;
  70. @@ -225,9 +231,13 @@ static void spi_set(struct clk *clk, int
  71. mask = CKCTL_6358_SPI_EN;
  72. else if (BCMCPU_IS_6362())
  73. mask = CKCTL_6362_SPI_EN;
  74. - else
  75. - /* BCMCPU_IS_6368 */
  76. + else if (BCMCPU_IS_6368())
  77. mask = CKCTL_6368_SPI_EN;
  78. + else if (BCMCPU_IS_63268())
  79. + mask = CKCTL_63268_SPI_EN;
  80. + else
  81. + return;
  82. +
  83. bcm_hwclock_set(mask, enable);
  84. }
  85. @@ -246,6 +256,8 @@ static void hsspi_set(struct clk *clk, i
  86. mask = CKCTL_6328_HSSPI_EN;
  87. else if (BCMCPU_IS_6362())
  88. mask = CKCTL_6362_HSSPI_EN;
  89. + else if (BCMCPU_IS_63268())
  90. + mask = CKCTL_63268_HSSPI_EN;
  91. else
  92. return;
  93. @@ -307,6 +319,8 @@ static void pcie_set(struct clk *clk, in
  94. bcm_hwclock_set(CKCTL_6328_PCIE_EN, enable);
  95. else if (BCMCPU_IS_6362())
  96. bcm_hwclock_set(CKCTL_6362_PCIE_EN, enable);
  97. + else if (BCMCPU_IS_63268())
  98. + bcm_hwclock_set(CKCTL_63268_PCIE_EN, enable);
  99. }
  100. static struct clk clk_pcie = {
  101. @@ -389,9 +403,11 @@ struct clk *clk_get(struct device *dev,
  102. return &clk_periph;
  103. if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm"))
  104. return &clk_pcm;
  105. - if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec"))
  106. + if ((BCMCPU_IS_6362() || BCMCPU_IS_6368() || BCMCPU_IS_63268()) &&
  107. + !strcmp(id, "ipsec"))
  108. return &clk_ipsec;
  109. - if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie"))
  110. + if ((BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) &&
  111. + !strcmp(id, "pcie"))
  112. return &clk_pcie;
  113. return ERR_PTR(-ENOENT);
  114. }
  115. @@ -414,6 +430,7 @@ static int __init bcm63xx_clk_init(void)
  116. clk_hsspi.rate = HSSPI_PLL_HZ_6328;
  117. break;
  118. case BCM6362_CPU_ID:
  119. + case BCM63268_CPU_ID:
  120. clk_hsspi.rate = HSSPI_PLL_HZ_6362;
  121. break;
  122. }
  123. --- a/arch/mips/bcm63xx/cpu.c
  124. +++ b/arch/mips/bcm63xx/cpu.c
  125. @@ -101,6 +101,15 @@ static const int bcm6368_irqs[] = {
  126. };
  127. +static const unsigned long bcm63268_regs_base[] = {
  128. + __GEN_CPU_REGS_TABLE(63268)
  129. +};
  130. +
  131. +static const int bcm63268_irqs[] = {
  132. + __GEN_CPU_IRQ_TABLE(63268)
  133. +
  134. +};
  135. +
  136. u32 bcm63xx_get_cpu_variant(void)
  137. {
  138. return bcm63xx_cpu_variant;
  139. @@ -253,6 +262,27 @@ static unsigned int detect_cpu_clock(voi
  140. return (((64 * 1000000) / p1) * p2 * ndiv) / m1;
  141. }
  142. + case BCM63268_CPU_ID:
  143. + {
  144. + unsigned int tmp, mips_pll_fcvo;
  145. +
  146. + tmp = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
  147. + mips_pll_fcvo = (tmp & STRAPBUS_63268_FCVO_MASK) >>
  148. + STRAPBUS_63268_FCVO_SHIFT;
  149. + switch (mips_pll_fcvo) {
  150. + case 0x3:
  151. + case 0xe:
  152. + return 320000000;
  153. + case 0xa:
  154. + return 333000000;
  155. + case 0x2:
  156. + case 0xb:
  157. + case 0xf:
  158. + return 400000000;
  159. + default:
  160. + return 0;
  161. + }
  162. + }
  163. default:
  164. panic("Failed to detect clock for CPU with id=%04X\n", cpu_id);
  165. @@ -267,7 +297,7 @@ static unsigned int detect_memory_size(v
  166. unsigned int cols = 0, rows = 0, is_32bits = 0, banks = 0;
  167. u32 val;
  168. - if (BCMCPU_IS_6328() || BCMCPU_IS_6362())
  169. + if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268())
  170. return bcm_ddr_readl(DDR_CSEND_REG) << 24;
  171. if (BCMCPU_IS_6345()) {
  172. @@ -305,6 +335,7 @@ void __init bcm63xx_cpu_init(void)
  173. unsigned int tmp;
  174. unsigned int cpu = smp_processor_id();
  175. u32 chipid_reg;
  176. + bool long_chipid = false;
  177. u8 __maybe_unused varid = 0;
  178. /* soc registers location depends on cpu type */
  179. @@ -326,6 +357,9 @@ void __init bcm63xx_cpu_init(void)
  180. case 0x10:
  181. chipid_reg = BCM_6345_PERF_BASE;
  182. break;
  183. + case 0x80:
  184. + long_chipid = true;
  185. + /* fall-through */
  186. default:
  187. chipid_reg = BCM_6368_PERF_BASE;
  188. break;
  189. @@ -333,6 +367,7 @@ void __init bcm63xx_cpu_init(void)
  190. break;
  191. }
  192. +
  193. /*
  194. * really early to panic, but delaying panic would not help since we
  195. * will never get any working console
  196. @@ -342,10 +377,17 @@ void __init bcm63xx_cpu_init(void)
  197. /* read out CPU type */
  198. tmp = bcm_readl(chipid_reg);
  199. - bcm63xx_cpu_id = (tmp & REV_CHIPID_MASK) >> REV_CHIPID_SHIFT;
  200. - bcm63xx_cpu_variant = bcm63xx_cpu_id;
  201. +
  202. + if (long_chipid) {
  203. + bcm63xx_cpu_id = tmp & REV_LONG_CHIPID_MASK;
  204. + bcm63xx_cpu_id >>= REV_LONG_CHIPID_SHIFT;
  205. + } else {
  206. + bcm63xx_cpu_id = (tmp & REV_CHIPID_MASK) >> REV_CHIPID_SHIFT;
  207. + varid = (tmp & REV_VARID_MASK) >> REV_VARID_SHIFT;
  208. + }
  209. +
  210. bcm63xx_cpu_rev = (tmp & REV_REVID_MASK) >> REV_REVID_SHIFT;
  211. - varid = (tmp & REV_VARID_MASK) >> REV_VARID_SHIFT;
  212. + bcm63xx_cpu_variant = bcm63xx_cpu_id;
  213. switch (bcm63xx_cpu_id) {
  214. case BCM3368_CPU_ID:
  215. @@ -400,6 +442,15 @@ void __init bcm63xx_cpu_init(void)
  216. /* BCM6369 is a BCM6368 without xDSL, so treat it the same */
  217. bcm63xx_cpu_id = BCM6368_CPU_ID;
  218. break;
  219. + case BCM63168_CPU_ID:
  220. + case BCM63169_CPU_ID:
  221. + case BCM63268_CPU_ID:
  222. + case BCM63269_CPU_ID:
  223. + bcm63xx_regs_base = bcm63268_regs_base;
  224. + bcm63xx_irqs = bcm63268_irqs;
  225. +
  226. + bcm63xx_cpu_id = BCM63268_CPU_ID;
  227. + break;
  228. default:
  229. panic("unsupported broadcom CPU %x", bcm63xx_cpu_id);
  230. break;
  231. --- a/arch/mips/bcm63xx/dev-flash.c
  232. +++ b/arch/mips/bcm63xx/dev-flash.c
  233. @@ -94,6 +94,12 @@ static int __init bcm63xx_detect_flash_t
  234. case STRAPBUS_6368_BOOT_SEL_PARALLEL:
  235. return BCM63XX_FLASH_TYPE_PARALLEL;
  236. }
  237. + case BCM63268_CPU_ID:
  238. + val = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
  239. + if (val & STRAPBUS_63268_BOOT_SEL_SERIAL)
  240. + return BCM63XX_FLASH_TYPE_SERIAL;
  241. + else
  242. + return BCM63XX_FLASH_TYPE_NAND;
  243. default:
  244. return -EINVAL;
  245. }
  246. --- a/arch/mips/bcm63xx/dev-spi.c
  247. +++ b/arch/mips/bcm63xx/dev-spi.c
  248. @@ -51,7 +51,7 @@ int __init bcm63xx_spi_register(void)
  249. }
  250. if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6362() ||
  251. - BCMCPU_IS_6368()) {
  252. + BCMCPU_IS_6368() || BCMCPU_IS_63268()) {
  253. bcm63xx_spi_device.name = "bcm6358-spi",
  254. spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1;
  255. }
  256. --- a/arch/mips/bcm63xx/irq.c
  257. +++ b/arch/mips/bcm63xx/irq.c
  258. @@ -150,6 +150,20 @@ void __init arch_init_irq(void)
  259. ext_irqs[5] = BCM_6368_EXT_IRQ5;
  260. ext_shift = 4;
  261. break;
  262. + case BCM63268_CPU_ID:
  263. + periph_bases[0] += PERF_IRQMASK_63268_REG(0);
  264. + periph_bases[1] += PERF_IRQMASK_63268_REG(1);
  265. + periph_irq_count = 2;
  266. + periph_width = 4;
  267. +
  268. + ext_intc_bases[0] += PERF_EXTIRQ_CFG_REG_63268;
  269. + ext_irq_count = 4;
  270. + ext_irqs[0] = BCM_63268_EXT_IRQ0;
  271. + ext_irqs[1] = BCM_63268_EXT_IRQ1;
  272. + ext_irqs[2] = BCM_63268_EXT_IRQ2;
  273. + ext_irqs[3] = BCM_63268_EXT_IRQ3;
  274. + ext_shift = 4;
  275. + break;
  276. default:
  277. BUG();
  278. }
  279. --- a/arch/mips/bcm63xx/reset.c
  280. +++ b/arch/mips/bcm63xx/reset.c
  281. @@ -125,6 +125,20 @@
  282. #define BCM6368_RESET_PCIE 0
  283. #define BCM6368_RESET_PCIE_EXT 0
  284. +#define BCM63268_RESET_SPI SOFTRESET_63268_SPI_MASK
  285. +#define BCM63268_RESET_ENET 0
  286. +#define BCM63268_RESET_USBH SOFTRESET_63268_USBH_MASK
  287. +#define BCM63268_RESET_USBD SOFTRESET_63268_USBS_MASK
  288. +#define BCM63268_RESET_DSL 0
  289. +#define BCM63268_RESET_SAR SOFTRESET_63268_SAR_MASK
  290. +#define BCM63268_RESET_EPHY 0
  291. +#define BCM63268_RESET_ENETSW SOFTRESET_63268_ENETSW_MASK
  292. +#define BCM63268_RESET_PCM SOFTRESET_63268_PCM_MASK
  293. +#define BCM63268_RESET_MPI 0
  294. +#define BCM63268_RESET_PCIE (SOFTRESET_63268_PCIE_MASK | \
  295. + SOFTRESET_63268_PCIE_CORE_MASK)
  296. +#define BCM63268_RESET_PCIE_EXT SOFTRESET_63268_PCIE_EXT_MASK
  297. +
  298. /*
  299. * core reset bits
  300. */
  301. @@ -156,6 +170,10 @@ static const u32 bcm6368_reset_bits[] =
  302. __GEN_RESET_BITS_TABLE(6368)
  303. };
  304. +static const u32 bcm63268_reset_bits[] = {
  305. + __GEN_RESET_BITS_TABLE(63268)
  306. +};
  307. +
  308. const u32 *bcm63xx_reset_bits;
  309. static int reset_reg;
  310. @@ -182,6 +200,9 @@ static int __init bcm63xx_reset_bits_ini
  311. } else if (BCMCPU_IS_6368()) {
  312. reset_reg = PERF_SOFTRESET_6368_REG;
  313. bcm63xx_reset_bits = bcm6368_reset_bits;
  314. + } else if (BCMCPU_IS_63268()) {
  315. + reset_reg = PERF_SOFTRESET_63268_REG;
  316. + bcm63xx_reset_bits = bcm63268_reset_bits;
  317. }
  318. return 0;
  319. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
  320. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
  321. @@ -21,6 +21,10 @@
  322. #define BCM6362_CPU_ID 0x6362
  323. #define BCM6368_CPU_ID 0x6368
  324. #define BCM6369_CPU_ID 0x6369
  325. +#define BCM63168_CPU_ID 0x63168
  326. +#define BCM63169_CPU_ID 0x63169
  327. +#define BCM63268_CPU_ID 0x63268
  328. +#define BCM63269_CPU_ID 0x63269
  329. void __init bcm63xx_cpu_init(void);
  330. u32 bcm63xx_get_cpu_variant(void);
  331. @@ -61,6 +65,10 @@ static inline u32 __pure __bcm63xx_get_c
  332. #ifdef CONFIG_BCM63XX_CPU_6368
  333. case BCM6368_CPU_ID:
  334. #endif
  335. +
  336. +#ifdef CONFIG_BCM63XX_CPU_63268
  337. + case BCM63268_CPU_ID:
  338. +#endif
  339. break;
  340. default:
  341. unreachable();
  342. @@ -86,6 +94,7 @@ static inline u32 __pure bcm63xx_get_cpu
  343. #define BCMCPU_IS_6358() (bcm63xx_get_cpu_id() == BCM6358_CPU_ID)
  344. #define BCMCPU_IS_6362() (bcm63xx_get_cpu_id() == BCM6362_CPU_ID)
  345. #define BCMCPU_IS_6368() (bcm63xx_get_cpu_id() == BCM6368_CPU_ID)
  346. +#define BCMCPU_IS_63268() (bcm63xx_get_cpu_id() == BCM63268_CPU_ID)
  347. #define BCMCPU_VARIANT_IS_3368() \
  348. (bcm63xx_get_cpu_variant() == BCM3368_CPU_ID)
  349. @@ -109,6 +118,14 @@ static inline u32 __pure bcm63xx_get_cpu
  350. (bcm63xx_get_cpu_variant() == BCM6368_CPU_ID)
  351. #define BCMCPU_VARIANT_IS_6369() \
  352. (bcm63xx_get_cpu_variant() == BCM6369_CPU_ID)
  353. +#define BCMCPU_VARIANT_IS_63168() \
  354. + (bcm63xx_get_cpu_variant() == BCM63168_CPU_ID)
  355. +#define BCMCPU_VARIANT_IS_63169() \
  356. + (bcm63xx_get_cpu_variant() == BCM63169_CPU_ID)
  357. +#define BCMCPU_VARIANT_IS_63268() \
  358. + (bcm63xx_get_cpu_variant() == BCM63268_CPU_ID)
  359. +#define BCMCPU_VARIANT_IS_63269() \
  360. + (bcm63xx_get_cpu_variant() == BCM63269_CPU_ID)
  361. /*
  362. * While registers sets are (mostly) the same across 63xx CPU, base
  363. @@ -573,6 +590,52 @@ enum bcm63xx_regs_set {
  364. #define BCM_6368_RNG_BASE (0xb0004180)
  365. #define BCM_6368_MISC_BASE (0xdeadbeef)
  366. +/*
  367. + * 63268 register sets base address
  368. + */
  369. +#define BCM_63268_DSL_LMEM_BASE (0xdeadbeef)
  370. +#define BCM_63268_PERF_BASE (0xb0000000)
  371. +#define BCM_63268_TIMER_BASE (0xb0000080)
  372. +#define BCM_63268_WDT_BASE (0xb000009c)
  373. +#define BCM_63268_UART0_BASE (0xb0000180)
  374. +#define BCM_63268_UART1_BASE (0xb00001a0)
  375. +#define BCM_63268_GPIO_BASE (0xb00000c0)
  376. +#define BCM_63268_SPI_BASE (0xb0000800)
  377. +#define BCM_63268_HSSPI_BASE (0xb0001000)
  378. +#define BCM_63268_UDC0_BASE (0xdeadbeef)
  379. +#define BCM_63268_USBDMA_BASE (0xb000c800)
  380. +#define BCM_63268_OHCI0_BASE (0xb0002600)
  381. +#define BCM_63268_OHCI_PRIV_BASE (0xdeadbeef)
  382. +#define BCM_63268_USBH_PRIV_BASE (0xb0002700)
  383. +#define BCM_63268_USBD_BASE (0xb0002400)
  384. +#define BCM_63268_MPI_BASE (0xdeadbeef)
  385. +#define BCM_63268_PCMCIA_BASE (0xdeadbeef)
  386. +#define BCM_63268_PCIE_BASE (0xb06e0000)
  387. +#define BCM_63268_SDRAM_REGS_BASE (0xdeadbeef)
  388. +#define BCM_63268_DSL_BASE (0xdeadbeef)
  389. +#define BCM_63268_UBUS_BASE (0xdeadbeef)
  390. +#define BCM_63268_ENET0_BASE (0xdeadbeef)
  391. +#define BCM_63268_ENET1_BASE (0xdeadbeef)
  392. +#define BCM_63268_ENETDMA_BASE (0xb000d800)
  393. +#define BCM_63268_ENETDMAC_BASE (0xb000da00)
  394. +#define BCM_63268_ENETDMAS_BASE (0xb000dc00)
  395. +#define BCM_63268_ENETSW_BASE (0xb0700000)
  396. +#define BCM_63268_EHCI0_BASE (0xb0002500)
  397. +#define BCM_63268_SDRAM_BASE (0xdeadbeef)
  398. +#define BCM_63268_MEMC_BASE (0xdeadbeef)
  399. +#define BCM_63268_DDR_BASE (0xb0003000)
  400. +#define BCM_63268_M2M_BASE (0xdeadbeef)
  401. +#define BCM_63268_ATM_BASE (0xdeadbeef)
  402. +#define BCM_63268_XTM_BASE (0xb0007000)
  403. +#define BCM_63268_XTMDMA_BASE (0xb000b800)
  404. +#define BCM_63268_XTMDMAC_BASE (0xdeadbeef)
  405. +#define BCM_63268_XTMDMAS_BASE (0xdeadbeef)
  406. +#define BCM_63268_PCM_BASE (0xb000b000)
  407. +#define BCM_63268_PCMDMA_BASE (0xb000b800)
  408. +#define BCM_63268_PCMDMAC_BASE (0xdeadbeef)
  409. +#define BCM_63268_PCMDMAS_BASE (0xdeadbeef)
  410. +#define BCM_63268_RNG_BASE (0xdeadbeef)
  411. +#define BCM_63268_MISC_BASE (0xb0001800)
  412. extern const unsigned long *bcm63xx_regs_base;
  413. @@ -1041,6 +1104,73 @@ enum bcm63xx_irq {
  414. #define BCM_6368_EXT_IRQ4 (IRQ_INTERNAL_BASE + 24)
  415. #define BCM_6368_EXT_IRQ5 (IRQ_INTERNAL_BASE + 25)
  416. +/*
  417. + * 63268 irqs
  418. + */
  419. +#define BCM_63268_HIGH_IRQ_BASE (IRQ_INTERNAL_BASE + 32)
  420. +#define BCM_63268_VERY_HIGH_IRQ_BASE (BCM_63268_HIGH_IRQ_BASE + 32)
  421. +
  422. +#define BCM_63268_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
  423. +#define BCM_63268_SPI_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 16)
  424. +#define BCM_63268_UART0_IRQ (IRQ_INTERNAL_BASE + 5)
  425. +#define BCM_63268_UART1_IRQ (BCM_63268_HIGH_IRQ_BASE + 2)
  426. +#define BCM_63268_DSL_IRQ (IRQ_INTERNAL_BASE + 23)
  427. +#define BCM_63268_UDC0_IRQ 0
  428. +#define BCM_63268_ENET0_IRQ 0
  429. +#define BCM_63268_ENET1_IRQ 0
  430. +#define BCM_63268_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 13)
  431. +#define BCM_63268_HSSPI_IRQ (IRQ_INTERNAL_BASE + 6)
  432. +#define BCM_63268_OHCI0_IRQ (IRQ_INTERNAL_BASE + 9)
  433. +#define BCM_63268_EHCI0_IRQ (IRQ_INTERNAL_BASE + 10)
  434. +#define BCM_63268_USBD_IRQ (IRQ_INTERNAL_BASE + 11)
  435. +#define BCM_63268_USBD_RXDMA0_IRQ (IRQ_INTERNAL_BASE + 19)
  436. +#define BCM_63268_USBD_TXDMA0_IRQ (BCM_63268_HIGH_IRQ_BASE + 4)
  437. +#define BCM_63268_USBD_RXDMA1_IRQ (IRQ_INTERNAL_BASE + 20)
  438. +#define BCM_63268_USBD_TXDMA1_IRQ (BCM_63268_HIGH_IRQ_BASE + 5)
  439. +#define BCM_63268_USBD_RXDMA2_IRQ (IRQ_INTERNAL_BASE + 21)
  440. +#define BCM_63268_USBD_TXDMA2_IRQ (BCM_63268_HIGH_IRQ_BASE + 6)
  441. +#define BCM_63268_PCMCIA_IRQ 0
  442. +#define BCM_63268_ENET0_RXDMA_IRQ 0
  443. +#define BCM_63268_ENET0_TXDMA_IRQ 0
  444. +#define BCM_63268_ENET1_RXDMA_IRQ 0
  445. +#define BCM_63268_ENET1_TXDMA_IRQ 0
  446. +#define BCM_63268_PCI_IRQ (BCM_63268_HIGH_IRQ_BASE + 8)
  447. +#define BCM_63268_ATM_IRQ 0
  448. +#define BCM_63268_ENETSW_RXDMA0_IRQ (IRQ_INTERNAL_BASE + 1)
  449. +#define BCM_63268_ENETSW_RXDMA1_IRQ (IRQ_INTERNAL_BASE + 2)
  450. +#define BCM_63268_ENETSW_RXDMA2_IRQ (IRQ_INTERNAL_BASE + 3)
  451. +#define BCM_63268_ENETSW_RXDMA3_IRQ (IRQ_INTERNAL_BASE + 4)
  452. +#define BCM_63268_ENETSW_TXDMA0_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 0)
  453. +#define BCM_63268_ENETSW_TXDMA1_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 1)
  454. +#define BCM_63268_ENETSW_TXDMA2_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 2)
  455. +#define BCM_63268_ENETSW_TXDMA3_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 3)
  456. +#define BCM_63268_XTM_IRQ (BCM_63268_HIGH_IRQ_BASE + 17)
  457. +#define BCM_63268_XTM_DMA0_IRQ (IRQ_INTERNAL_BASE + 26)
  458. +
  459. +#define BCM_63268_RING_OSC_IRQ (BCM_63268_HIGH_IRQ_BASE + 20)
  460. +#define BCM_63268_WLAN_GPIO_IRQ (BCM_63268_HIGH_IRQ_BASE + 3)
  461. +#define BCM_63268_WLAN_IRQ (IRQ_INTERNAL_BASE + 7)
  462. +#define BCM_63268_IPSEC_IRQ (IRQ_INTERNAL_BASE + 8)
  463. +#define BCM_63268_NAND_IRQ (BCM_63268_HIGH_IRQ_BASE + 18)
  464. +#define BCM_63268_PCM_IRQ (IRQ_INTERNAL_BASE + 13)
  465. +#define BCM_63268_DG_IRQ (IRQ_INTERNAL_BASE + 15)
  466. +#define BCM_63268_EPHY_ENERGY0_IRQ (IRQ_INTERNAL_BASE + 16)
  467. +#define BCM_63268_EPHY_ENERGY1_IRQ (IRQ_INTERNAL_BASE + 17)
  468. +#define BCM_63268_EPHY_ENERGY2_IRQ (IRQ_INTERNAL_BASE + 18)
  469. +#define BCM_63268_EPHY_ENERGY3_IRQ (IRQ_INTERNAL_BASE + 19)
  470. +#define BCM_63268_IPSEC_DMA0_IRQ (IRQ_INTERNAL_BASE + 22)
  471. +#define BCM_63268_IPSEC_DMA1_IRQ (BCM_63268_HIGH_IRQ_BASE + 7)
  472. +#define BCM_63268_FAP0_IRQ (IRQ_INTERNAL_BASE + 24)
  473. +#define BCM_63268_FAP1_IRQ (IRQ_INTERNAL_BASE + 25)
  474. +#define BCM_63268_PCM_DMA0_IRQ (BCM_63268_HIGH_IRQ_BASE + 10)
  475. +#define BCM_63268_PCM_DMA1_IRQ (BCM_63268_HIGH_IRQ_BASE + 11)
  476. +#define BCM_63268_DECT0_IRQ (BCM_63268_HIGH_IRQ_BASE + 0)
  477. +#define BCM_63268_DECT1_IRQ (BCM_63268_HIGH_IRQ_BASE + 1)
  478. +#define BCM_63268_EXT_IRQ0 (BCM_63268_HIGH_IRQ_BASE + 12)
  479. +#define BCM_63268_EXT_IRQ1 (BCM_63268_HIGH_IRQ_BASE + 13)
  480. +#define BCM_63268_EXT_IRQ2 (BCM_63268_HIGH_IRQ_BASE + 14)
  481. +#define BCM_63268_EXT_IRQ3 (BCM_63268_HIGH_IRQ_BASE + 15)
  482. +
  483. extern const int *bcm63xx_irqs;
  484. #define __GEN_CPU_IRQ_TABLE(__cpu) \
  485. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
  486. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
  487. @@ -22,6 +22,8 @@ static inline unsigned long bcm63xx_gpio
  488. return 48;
  489. case BCM6368_CPU_ID:
  490. return 38;
  491. + case BCM63268_CPU_ID:
  492. + return 52;
  493. case BCM6348_CPU_ID:
  494. default:
  495. return 37;
  496. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
  497. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
  498. @@ -9,6 +9,8 @@
  499. #define PERF_REV_REG 0x0
  500. #define REV_CHIPID_SHIFT 16
  501. #define REV_CHIPID_MASK (0xffff << REV_CHIPID_SHIFT)
  502. +#define REV_LONG_CHIPID_SHIFT 12
  503. +#define REV_LONG_CHIPID_MASK (0xfffff << REV_LONG_CHIPID_SHIFT)
  504. #define REV_VARID_SHIFT 12
  505. #define REV_VARID_MASK (0xf << REV_VARID_SHIFT)
  506. #define REV_REVID_SHIFT 0
  507. @@ -211,6 +213,52 @@
  508. CKCTL_6368_NAND_EN | \
  509. CKCTL_6368_IPSEC_EN)
  510. +#define CKCTL_63268_DISABLE_GLESS (1 << 0)
  511. +#define CKCTL_63268_VDSL_QPROC_EN (1 << 1)
  512. +#define CKCTL_63268_VDSL_AFE_EN (1 << 2)
  513. +#define CKCTL_63268_VDSL_EN (1 << 3)
  514. +#define CKCTL_63268_MIPS_EN (1 << 4)
  515. +#define CKCTL_63268_WLAN_OCP_EN (1 << 5)
  516. +#define CKCTL_63268_DECT_EN (1 << 6)
  517. +#define CKCTL_63268_FAP0_EN (1 << 7)
  518. +#define CKCTL_63268_FAP1_EN (1 << 8)
  519. +#define CKCTL_63268_SAR_EN (1 << 9)
  520. +#define CKCTL_63268_ROBOSW_EN (1 << 10)
  521. +#define CKCTL_63268_PCM_EN (1 << 11)
  522. +#define CKCTL_63268_USBD_EN (1 << 12)
  523. +#define CKCTL_63268_USBH_EN (1 << 13)
  524. +#define CKCTL_63268_IPSEC_EN (1 << 14)
  525. +#define CKCTL_63268_SPI_EN (1 << 15)
  526. +#define CKCTL_63268_HSSPI_EN (1 << 16)
  527. +#define CKCTL_63268_PCIE_EN (1 << 17)
  528. +#define CKCTL_63268_PHYMIPS_EN (1 << 18)
  529. +#define CKCTL_63268_GMAC_EN (1 << 19)
  530. +#define CKCTL_63268_NAND_EN (1 << 20)
  531. +#define CKCTL_63268_TBUS_EN (1 << 27)
  532. +#define CKCTL_63268_ROBOSW250_EN (1 << 31)
  533. +
  534. +#define CKCTL_63268_ALL_SAFE_EN (CKCTL_63268_VDSL_QPROC_EN | \
  535. + CKCTL_63268_VDSL_AFE_EN | \
  536. + CKCTL_63268_VDSL_EN | \
  537. + CKCTL_63268_WLAN_OCP_EN | \
  538. + CKCTL_63268_DECT_EN | \
  539. + CKCTL_63268_FAP0_EN | \
  540. + CKCTL_63268_FAP1_EN | \
  541. + CKCTL_63268_SAR_EN | \
  542. + CKCTL_63268_ROBOSW_EN | \
  543. + CKCTL_63268_PCM_EN | \
  544. + CKCTL_63268_USBD_EN | \
  545. + CKCTL_63268_USBH_EN | \
  546. + CKCTL_63268_IPSEC_EN | \
  547. + CKCTL_63268_SPI_EN | \
  548. + CKCTL_63268_HSSPI_EN | \
  549. + CKCTL_63268_PCIE_EN | \
  550. + CKCTL_63268_PHYMIPS_EN | \
  551. + CKCTL_63268_GMAC_EN | \
  552. + CKCTL_63268_NAND_EN | \
  553. + CKCTL_63268_TBUS_EN | \
  554. + CKCTL_63268_ROBOSW250_EN)
  555. +
  556. /* System PLL Control register */
  557. #define PERF_SYS_PLL_CTL_REG 0x8
  558. #define SYS_PLL_SOFT_RESET 0x1
  559. @@ -224,6 +272,7 @@
  560. #define PERF_IRQMASK_6358_REG(x) (0xc + (x) * 0x2c)
  561. #define PERF_IRQMASK_6362_REG(x) (0x20 + (x) * 0x10)
  562. #define PERF_IRQMASK_6368_REG(x) (0x20 + (x) * 0x10)
  563. +#define PERF_IRQMASK_63268_REG(x) (0x20 + (x) * 0x20)
  564. /* Interrupt Status register */
  565. #define PERF_IRQSTAT_3368_REG 0x10
  566. @@ -234,6 +283,7 @@
  567. #define PERF_IRQSTAT_6358_REG(x) (0x10 + (x) * 0x2c)
  568. #define PERF_IRQSTAT_6362_REG(x) (0x28 + (x) * 0x10)
  569. #define PERF_IRQSTAT_6368_REG(x) (0x28 + (x) * 0x10)
  570. +#define PERF_IRQSTAT_63268_REG(x) (0x30 + (x) * 0x20)
  571. /* External Interrupt Configuration register */
  572. #define PERF_EXTIRQ_CFG_REG_3368 0x14
  573. @@ -244,6 +294,7 @@
  574. #define PERF_EXTIRQ_CFG_REG_6358 0x14
  575. #define PERF_EXTIRQ_CFG_REG_6362 0x18
  576. #define PERF_EXTIRQ_CFG_REG_6368 0x18
  577. +#define PERF_EXTIRQ_CFG_REG_63268 0x18
  578. #define PERF_EXTIRQ_CFG_REG2_6358 0x1c
  579. #define PERF_EXTIRQ_CFG_REG2_6368 0x1c
  580. @@ -274,6 +325,7 @@
  581. #define PERF_SOFTRESET_6358_REG 0x34
  582. #define PERF_SOFTRESET_6362_REG 0x10
  583. #define PERF_SOFTRESET_6368_REG 0x10
  584. +#define PERF_SOFTRESET_63268_REG 0x10
  585. #define SOFTRESET_3368_SPI_MASK (1 << 0)
  586. #define SOFTRESET_3368_ENET_MASK (1 << 2)
  587. @@ -367,6 +419,26 @@
  588. #define SOFTRESET_6368_USBH_MASK (1 << 12)
  589. #define SOFTRESET_6368_PCM_MASK (1 << 13)
  590. +#define SOFTRESET_63268_SPI_MASK (1 << 0)
  591. +#define SOFTRESET_63268_IPSEC_MASK (1 << 1)
  592. +#define SOFTRESET_63268_EPHY_MASK (1 << 2)
  593. +#define SOFTRESET_63268_SAR_MASK (1 << 3)
  594. +#define SOFTRESET_63268_ENETSW_MASK (1 << 4)
  595. +#define SOFTRESET_63268_USBS_MASK (1 << 5)
  596. +#define SOFTRESET_63268_USBH_MASK (1 << 6)
  597. +#define SOFTRESET_63268_PCM_MASK (1 << 7)
  598. +#define SOFTRESET_63268_PCIE_CORE_MASK (1 << 8)
  599. +#define SOFTRESET_63268_PCIE_MASK (1 << 9)
  600. +#define SOFTRESET_63268_PCIE_EXT_MASK (1 << 10)
  601. +#define SOFTRESET_63268_WLAN_SHIM_MASK (1 << 11)
  602. +#define SOFTRESET_63268_DDR_PHY_MASK (1 << 12)
  603. +#define SOFTRESET_63268_FAP0_MASK (1 << 13)
  604. +#define SOFTRESET_63268_WLAN_UBUS_MASK (1 << 14)
  605. +#define SOFTRESET_63268_DECT_MASK (1 << 15)
  606. +#define SOFTRESET_63268_FAP1_MASK (1 << 16)
  607. +#define SOFTRESET_63268_PCIE_HARD_MASK (1 << 17)
  608. +#define SOFTRESET_63268_GPHY_MASK (1 << 18)
  609. +
  610. /* MIPS PLL control register */
  611. #define PERF_MIPSPLLCTL_REG 0x34
  612. #define MIPSPLLCTL_N1_SHIFT 20
  613. @@ -1366,6 +1438,13 @@
  614. #define STRAPBUS_6362_BOOT_SEL_SERIAL (1 << 15)
  615. #define STRAPBUS_6362_BOOT_SEL_NAND (0 << 15)
  616. +#define MISC_STRAPBUS_63268_REG 0x14
  617. +#define STRAPBUS_63268_HSSPI_CLK_FAST (1 << 9)
  618. +#define STRAPBUS_63268_BOOT_SEL_SERIAL (1 << 11)
  619. +#define STRAPBUS_63268_BOOT_SEL_NAND (0 << 11)
  620. +#define STRAPBUS_63268_FCVO_SHIFT 21
  621. +#define STRAPBUS_63268_FCVO_MASK (0xf << STRAPBUS_63268_FCVO_SHIFT)
  622. +
  623. #define MISC_STRAPBUS_6328_REG 0x240
  624. #define STRAPBUS_6328_FCVO_SHIFT 7
  625. #define STRAPBUS_6328_FCVO_MASK (0x1f << STRAPBUS_6328_FCVO_SHIFT)
  626. --- a/arch/mips/include/asm/mach-bcm63xx/ioremap.h
  627. +++ b/arch/mips/include/asm/mach-bcm63xx/ioremap.h
  628. @@ -25,6 +25,7 @@ static inline int is_bcm63xx_internal_re
  629. case BCM6328_CPU_ID:
  630. case BCM6362_CPU_ID:
  631. case BCM6368_CPU_ID:
  632. + case BCM63268_CPU_ID:
  633. if (offset >= 0xb0000000 && offset < 0xb1000000)
  634. return 1;
  635. break;
  636. --- a/arch/mips/bcm63xx/dev-hsspi.c
  637. +++ b/arch/mips/bcm63xx/dev-hsspi.c
  638. @@ -35,7 +35,7 @@ static struct platform_device bcm63xx_hs
  639. int __init bcm63xx_hsspi_register(void)
  640. {
  641. - if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362())
  642. + if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362() && !BCMCPU_IS_63268())
  643. return -ENODEV;
  644. spi_resources[0].start = bcm63xx_regset_address(RSET_HSSPI);
  645. --- a/arch/mips/bcm63xx/dev-enet.c
  646. +++ b/arch/mips/bcm63xx/dev-enet.c
  647. @@ -176,7 +176,8 @@ static int __init register_shared(void)
  648. else
  649. shared_res[0].end += (RSET_ENETDMA_SIZE) - 1;
  650. - if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_6368())
  651. + if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_6368() ||
  652. + BCMCPU_IS_63268())
  653. chan_count = 32;
  654. else if (BCMCPU_IS_6345())
  655. chan_count = 8;
  656. @@ -276,7 +277,8 @@ bcm63xx_enetsw_register(const struct bcm
  657. {
  658. int ret;
  659. - if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362() && !BCMCPU_IS_6368())
  660. + if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362() && !BCMCPU_IS_6368() &&
  661. + !BCMCPU_IS_63268())
  662. return -ENODEV;
  663. ret = register_shared();
  664. @@ -297,6 +299,8 @@ bcm63xx_enetsw_register(const struct bcm
  665. enetsw_pd.num_ports = ENETSW_PORTS_6328;
  666. else if (BCMCPU_IS_6362() || BCMCPU_IS_6368())
  667. enetsw_pd.num_ports = ENETSW_PORTS_6368;
  668. + else if (BCMCPU_IS_63268())
  669. + enetsw_pd.num_ports = ENETSW_PORTS_63268;
  670. enetsw_pd.dma_has_sram = true;
  671. enetsw_pd.dma_chan_width = ENETDMA_CHAN_WIDTH;
  672. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
  673. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
  674. @@ -62,6 +62,7 @@ struct bcm63xx_enet_platform_data {
  675. #define ENETSW_MAX_PORT 8
  676. #define ENETSW_PORTS_6328 5 /* 4 FE PHY + 1 RGMII */
  677. #define ENETSW_PORTS_6368 6 /* 4 FE PHY + 2 RGMII */
  678. +#define ENETSW_PORTS_63268 8 /* 3 FE PHY + 1 GE PHY + 4 RGMII */
  679. #define ENETSW_RGMII_PORT0 4