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

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