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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  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. @@ -717,7 +717,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. @@ -386,9 +400,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. @@ -411,6 +427,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. @@ -37,7 +37,7 @@ static __init void bcm63xx_spi_regs_init
  249. if (BCMCPU_IS_6338() || BCMCPU_IS_6348())
  250. bcm63xx_regs_spi = bcm6348_regs_spi;
  251. if (BCMCPU_IS_3368() || BCMCPU_IS_6358() ||
  252. - BCMCPU_IS_6362() || BCMCPU_IS_6368())
  253. + BCMCPU_IS_6362() || BCMCPU_IS_6368() || BCMCPU_IS_63268())
  254. bcm63xx_regs_spi = bcm6358_regs_spi;
  255. }
  256. @@ -85,7 +85,7 @@ int __init bcm63xx_spi_register(void)
  257. }
  258. if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6362() ||
  259. - BCMCPU_IS_6368()) {
  260. + BCMCPU_IS_6368() || BCMCPU_IS_63268()) {
  261. spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1;
  262. spi_pdata.fifo_size = SPI_6358_MSG_DATA_SIZE;
  263. spi_pdata.msg_type_shift = SPI_6358_MSG_TYPE_SHIFT;
  264. --- a/arch/mips/bcm63xx/irq.c
  265. +++ b/arch/mips/bcm63xx/irq.c
  266. @@ -150,6 +150,20 @@ static void bcm63xx_init_irq(void)
  267. ext_irqs[5] = BCM_6368_EXT_IRQ5;
  268. ext_shift = 4;
  269. break;
  270. + case BCM63268_CPU_ID:
  271. + periph_bases[0] += PERF_IRQMASK_63268_REG(0);
  272. + periph_bases[1] += PERF_IRQMASK_63268_REG(1);
  273. + periph_irq_count = 2;
  274. + periph_width = 4;
  275. +
  276. + ext_intc_bases[0] += PERF_EXTIRQ_CFG_REG_63268;
  277. + ext_irq_count = 4;
  278. + ext_irqs[0] = BCM_63268_EXT_IRQ0;
  279. + ext_irqs[1] = BCM_63268_EXT_IRQ1;
  280. + ext_irqs[2] = BCM_63268_EXT_IRQ2;
  281. + ext_irqs[3] = BCM_63268_EXT_IRQ3;
  282. + ext_shift = 4;
  283. + break;
  284. default:
  285. BUG();
  286. }
  287. --- a/arch/mips/bcm63xx/reset.c
  288. +++ b/arch/mips/bcm63xx/reset.c
  289. @@ -125,6 +125,20 @@
  290. #define BCM6368_RESET_PCIE 0
  291. #define BCM6368_RESET_PCIE_EXT 0
  292. +#define BCM63268_RESET_SPI SOFTRESET_63268_SPI_MASK
  293. +#define BCM63268_RESET_ENET 0
  294. +#define BCM63268_RESET_USBH SOFTRESET_63268_USBH_MASK
  295. +#define BCM63268_RESET_USBD SOFTRESET_63268_USBS_MASK
  296. +#define BCM63268_RESET_DSL 0
  297. +#define BCM63268_RESET_SAR SOFTRESET_63268_SAR_MASK
  298. +#define BCM63268_RESET_EPHY 0
  299. +#define BCM63268_RESET_ENETSW SOFTRESET_63268_ENETSW_MASK
  300. +#define BCM63268_RESET_PCM SOFTRESET_63268_PCM_MASK
  301. +#define BCM63268_RESET_MPI 0
  302. +#define BCM63268_RESET_PCIE (SOFTRESET_63268_PCIE_MASK | \
  303. + SOFTRESET_63268_PCIE_CORE_MASK)
  304. +#define BCM63268_RESET_PCIE_EXT SOFTRESET_63268_PCIE_EXT_MASK
  305. +
  306. /*
  307. * core reset bits
  308. */
  309. @@ -156,6 +170,10 @@ static const u32 bcm6368_reset_bits[] =
  310. __GEN_RESET_BITS_TABLE(6368)
  311. };
  312. +static const u32 bcm63268_reset_bits[] = {
  313. + __GEN_RESET_BITS_TABLE(63268)
  314. +};
  315. +
  316. const u32 *bcm63xx_reset_bits;
  317. static int reset_reg;
  318. @@ -182,6 +200,9 @@ static int __init bcm63xx_reset_bits_ini
  319. } else if (BCMCPU_IS_6368()) {
  320. reset_reg = PERF_SOFTRESET_6368_REG;
  321. bcm63xx_reset_bits = bcm6368_reset_bits;
  322. + } else if (BCMCPU_IS_63268()) {
  323. + reset_reg = PERF_SOFTRESET_63268_REG;
  324. + bcm63xx_reset_bits = bcm63268_reset_bits;
  325. }
  326. return 0;
  327. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
  328. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
  329. @@ -21,6 +21,10 @@
  330. #define BCM6362_CPU_ID 0x6362
  331. #define BCM6368_CPU_ID 0x6368
  332. #define BCM6369_CPU_ID 0x6369
  333. +#define BCM63168_CPU_ID 0x63168
  334. +#define BCM63169_CPU_ID 0x63169
  335. +#define BCM63268_CPU_ID 0x63268
  336. +#define BCM63269_CPU_ID 0x63269
  337. void __init bcm63xx_cpu_init(void);
  338. u32 bcm63xx_get_cpu_variant(void);
  339. @@ -61,6 +65,10 @@ static inline u32 __pure __bcm63xx_get_c
  340. #ifdef CONFIG_BCM63XX_CPU_6368
  341. case BCM6368_CPU_ID:
  342. #endif
  343. +
  344. +#ifdef CONFIG_BCM63XX_CPU_63268
  345. + case BCM63268_CPU_ID:
  346. +#endif
  347. break;
  348. default:
  349. unreachable();
  350. @@ -86,6 +94,7 @@ static inline u32 __pure bcm63xx_get_cpu
  351. #define BCMCPU_IS_6358() (bcm63xx_get_cpu_id() == BCM6358_CPU_ID)
  352. #define BCMCPU_IS_6362() (bcm63xx_get_cpu_id() == BCM6362_CPU_ID)
  353. #define BCMCPU_IS_6368() (bcm63xx_get_cpu_id() == BCM6368_CPU_ID)
  354. +#define BCMCPU_IS_63268() (bcm63xx_get_cpu_id() == BCM63268_CPU_ID)
  355. #define BCMCPU_VARIANT_IS_3368() \
  356. (bcm63xx_get_cpu_variant() == BCM3368_CPU_ID)
  357. @@ -109,6 +118,14 @@ static inline u32 __pure bcm63xx_get_cpu
  358. (bcm63xx_get_cpu_variant() == BCM6368_CPU_ID)
  359. #define BCMCPU_VARIANT_IS_6369() \
  360. (bcm63xx_get_cpu_variant() == BCM6369_CPU_ID)
  361. +#define BCMCPU_VARIANT_IS_63168() \
  362. + (bcm63xx_get_cpu_variant() == BCM63168_CPU_ID)
  363. +#define BCMCPU_VARIANT_IS_63169() \
  364. + (bcm63xx_get_cpu_variant() == BCM63169_CPU_ID)
  365. +#define BCMCPU_VARIANT_IS_63268() \
  366. + (bcm63xx_get_cpu_variant() == BCM63268_CPU_ID)
  367. +#define BCMCPU_VARIANT_IS_63269() \
  368. + (bcm63xx_get_cpu_variant() == BCM63269_CPU_ID)
  369. /*
  370. * While registers sets are (mostly) the same across 63xx CPU, base
  371. @@ -573,6 +590,52 @@ enum bcm63xx_regs_set {
  372. #define BCM_6368_RNG_BASE (0xb0004180)
  373. #define BCM_6368_MISC_BASE (0xdeadbeef)
  374. +/*
  375. + * 63268 register sets base address
  376. + */
  377. +#define BCM_63268_DSL_LMEM_BASE (0xdeadbeef)
  378. +#define BCM_63268_PERF_BASE (0xb0000000)
  379. +#define BCM_63268_TIMER_BASE (0xb0000080)
  380. +#define BCM_63268_WDT_BASE (0xb000009c)
  381. +#define BCM_63268_UART0_BASE (0xb0000180)
  382. +#define BCM_63268_UART1_BASE (0xb00001a0)
  383. +#define BCM_63268_GPIO_BASE (0xb00000c0)
  384. +#define BCM_63268_SPI_BASE (0xb0000800)
  385. +#define BCM_63268_HSSPI_BASE (0xb0001000)
  386. +#define BCM_63268_UDC0_BASE (0xdeadbeef)
  387. +#define BCM_63268_USBDMA_BASE (0xb000c800)
  388. +#define BCM_63268_OHCI0_BASE (0xb0002600)
  389. +#define BCM_63268_OHCI_PRIV_BASE (0xdeadbeef)
  390. +#define BCM_63268_USBH_PRIV_BASE (0xb0002700)
  391. +#define BCM_63268_USBD_BASE (0xb0002400)
  392. +#define BCM_63268_MPI_BASE (0xdeadbeef)
  393. +#define BCM_63268_PCMCIA_BASE (0xdeadbeef)
  394. +#define BCM_63268_PCIE_BASE (0xb06e0000)
  395. +#define BCM_63268_SDRAM_REGS_BASE (0xdeadbeef)
  396. +#define BCM_63268_DSL_BASE (0xdeadbeef)
  397. +#define BCM_63268_UBUS_BASE (0xdeadbeef)
  398. +#define BCM_63268_ENET0_BASE (0xdeadbeef)
  399. +#define BCM_63268_ENET1_BASE (0xdeadbeef)
  400. +#define BCM_63268_ENETDMA_BASE (0xb000d800)
  401. +#define BCM_63268_ENETDMAC_BASE (0xb000da00)
  402. +#define BCM_63268_ENETDMAS_BASE (0xb000dc00)
  403. +#define BCM_63268_ENETSW_BASE (0xb0700000)
  404. +#define BCM_63268_EHCI0_BASE (0xb0002500)
  405. +#define BCM_63268_SDRAM_BASE (0xdeadbeef)
  406. +#define BCM_63268_MEMC_BASE (0xdeadbeef)
  407. +#define BCM_63268_DDR_BASE (0xb0003000)
  408. +#define BCM_63268_M2M_BASE (0xdeadbeef)
  409. +#define BCM_63268_ATM_BASE (0xdeadbeef)
  410. +#define BCM_63268_XTM_BASE (0xb0007000)
  411. +#define BCM_63268_XTMDMA_BASE (0xb000b800)
  412. +#define BCM_63268_XTMDMAC_BASE (0xdeadbeef)
  413. +#define BCM_63268_XTMDMAS_BASE (0xdeadbeef)
  414. +#define BCM_63268_PCM_BASE (0xb000b000)
  415. +#define BCM_63268_PCMDMA_BASE (0xb000b800)
  416. +#define BCM_63268_PCMDMAC_BASE (0xdeadbeef)
  417. +#define BCM_63268_PCMDMAS_BASE (0xdeadbeef)
  418. +#define BCM_63268_RNG_BASE (0xdeadbeef)
  419. +#define BCM_63268_MISC_BASE (0xb0001800)
  420. extern const unsigned long *bcm63xx_regs_base;
  421. @@ -1041,6 +1104,73 @@ enum bcm63xx_irq {
  422. #define BCM_6368_EXT_IRQ4 (IRQ_INTERNAL_BASE + 24)
  423. #define BCM_6368_EXT_IRQ5 (IRQ_INTERNAL_BASE + 25)
  424. +/*
  425. + * 63268 irqs
  426. + */
  427. +#define BCM_63268_HIGH_IRQ_BASE (IRQ_INTERNAL_BASE + 32)
  428. +#define BCM_63268_VERY_HIGH_IRQ_BASE (BCM_63268_HIGH_IRQ_BASE + 32)
  429. +
  430. +#define BCM_63268_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
  431. +#define BCM_63268_SPI_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 16)
  432. +#define BCM_63268_UART0_IRQ (IRQ_INTERNAL_BASE + 5)
  433. +#define BCM_63268_UART1_IRQ (BCM_63268_HIGH_IRQ_BASE + 2)
  434. +#define BCM_63268_DSL_IRQ (IRQ_INTERNAL_BASE + 23)
  435. +#define BCM_63268_UDC0_IRQ 0
  436. +#define BCM_63268_ENET0_IRQ 0
  437. +#define BCM_63268_ENET1_IRQ 0
  438. +#define BCM_63268_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 13)
  439. +#define BCM_63268_HSSPI_IRQ (IRQ_INTERNAL_BASE + 6)
  440. +#define BCM_63268_OHCI0_IRQ (IRQ_INTERNAL_BASE + 9)
  441. +#define BCM_63268_EHCI0_IRQ (IRQ_INTERNAL_BASE + 10)
  442. +#define BCM_63268_USBD_IRQ (IRQ_INTERNAL_BASE + 11)
  443. +#define BCM_63268_USBD_RXDMA0_IRQ (IRQ_INTERNAL_BASE + 19)
  444. +#define BCM_63268_USBD_TXDMA0_IRQ (BCM_63268_HIGH_IRQ_BASE + 4)
  445. +#define BCM_63268_USBD_RXDMA1_IRQ (IRQ_INTERNAL_BASE + 20)
  446. +#define BCM_63268_USBD_TXDMA1_IRQ (BCM_63268_HIGH_IRQ_BASE + 5)
  447. +#define BCM_63268_USBD_RXDMA2_IRQ (IRQ_INTERNAL_BASE + 21)
  448. +#define BCM_63268_USBD_TXDMA2_IRQ (BCM_63268_HIGH_IRQ_BASE + 6)
  449. +#define BCM_63268_PCMCIA_IRQ 0
  450. +#define BCM_63268_ENET0_RXDMA_IRQ 0
  451. +#define BCM_63268_ENET0_TXDMA_IRQ 0
  452. +#define BCM_63268_ENET1_RXDMA_IRQ 0
  453. +#define BCM_63268_ENET1_TXDMA_IRQ 0
  454. +#define BCM_63268_PCI_IRQ (BCM_63268_HIGH_IRQ_BASE + 8)
  455. +#define BCM_63268_ATM_IRQ 0
  456. +#define BCM_63268_ENETSW_RXDMA0_IRQ (IRQ_INTERNAL_BASE + 1)
  457. +#define BCM_63268_ENETSW_RXDMA1_IRQ (IRQ_INTERNAL_BASE + 2)
  458. +#define BCM_63268_ENETSW_RXDMA2_IRQ (IRQ_INTERNAL_BASE + 3)
  459. +#define BCM_63268_ENETSW_RXDMA3_IRQ (IRQ_INTERNAL_BASE + 4)
  460. +#define BCM_63268_ENETSW_TXDMA0_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 0)
  461. +#define BCM_63268_ENETSW_TXDMA1_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 1)
  462. +#define BCM_63268_ENETSW_TXDMA2_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 2)
  463. +#define BCM_63268_ENETSW_TXDMA3_IRQ (BCM_63268_VERY_HIGH_IRQ_BASE + 3)
  464. +#define BCM_63268_XTM_IRQ (BCM_63268_HIGH_IRQ_BASE + 17)
  465. +#define BCM_63268_XTM_DMA0_IRQ (IRQ_INTERNAL_BASE + 26)
  466. +
  467. +#define BCM_63268_RING_OSC_IRQ (BCM_63268_HIGH_IRQ_BASE + 20)
  468. +#define BCM_63268_WLAN_GPIO_IRQ (BCM_63268_HIGH_IRQ_BASE + 3)
  469. +#define BCM_63268_WLAN_IRQ (IRQ_INTERNAL_BASE + 7)
  470. +#define BCM_63268_IPSEC_IRQ (IRQ_INTERNAL_BASE + 8)
  471. +#define BCM_63268_NAND_IRQ (BCM_63268_HIGH_IRQ_BASE + 18)
  472. +#define BCM_63268_PCM_IRQ (IRQ_INTERNAL_BASE + 13)
  473. +#define BCM_63268_DG_IRQ (IRQ_INTERNAL_BASE + 15)
  474. +#define BCM_63268_EPHY_ENERGY0_IRQ (IRQ_INTERNAL_BASE + 16)
  475. +#define BCM_63268_EPHY_ENERGY1_IRQ (IRQ_INTERNAL_BASE + 17)
  476. +#define BCM_63268_EPHY_ENERGY2_IRQ (IRQ_INTERNAL_BASE + 18)
  477. +#define BCM_63268_EPHY_ENERGY3_IRQ (IRQ_INTERNAL_BASE + 19)
  478. +#define BCM_63268_IPSEC_DMA0_IRQ (IRQ_INTERNAL_BASE + 22)
  479. +#define BCM_63268_IPSEC_DMA1_IRQ (BCM_63268_HIGH_IRQ_BASE + 7)
  480. +#define BCM_63268_FAP0_IRQ (IRQ_INTERNAL_BASE + 24)
  481. +#define BCM_63268_FAP1_IRQ (IRQ_INTERNAL_BASE + 25)
  482. +#define BCM_63268_PCM_DMA0_IRQ (BCM_63268_HIGH_IRQ_BASE + 10)
  483. +#define BCM_63268_PCM_DMA1_IRQ (BCM_63268_HIGH_IRQ_BASE + 11)
  484. +#define BCM_63268_DECT0_IRQ (BCM_63268_HIGH_IRQ_BASE + 0)
  485. +#define BCM_63268_DECT1_IRQ (BCM_63268_HIGH_IRQ_BASE + 1)
  486. +#define BCM_63268_EXT_IRQ0 (BCM_63268_HIGH_IRQ_BASE + 12)
  487. +#define BCM_63268_EXT_IRQ1 (BCM_63268_HIGH_IRQ_BASE + 13)
  488. +#define BCM_63268_EXT_IRQ2 (BCM_63268_HIGH_IRQ_BASE + 14)
  489. +#define BCM_63268_EXT_IRQ3 (BCM_63268_HIGH_IRQ_BASE + 15)
  490. +
  491. extern const int *bcm63xx_irqs;
  492. #define __GEN_CPU_IRQ_TABLE(__cpu) \
  493. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
  494. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
  495. @@ -22,6 +22,8 @@ static inline unsigned long bcm63xx_gpio
  496. return 48;
  497. case BCM6368_CPU_ID:
  498. return 38;
  499. + case BCM63268_CPU_ID:
  500. + return 52;
  501. case BCM6348_CPU_ID:
  502. default:
  503. return 37;
  504. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
  505. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
  506. @@ -9,6 +9,8 @@
  507. #define PERF_REV_REG 0x0
  508. #define REV_CHIPID_SHIFT 16
  509. #define REV_CHIPID_MASK (0xffff << REV_CHIPID_SHIFT)
  510. +#define REV_LONG_CHIPID_SHIFT 12
  511. +#define REV_LONG_CHIPID_MASK (0xfffff << REV_LONG_CHIPID_SHIFT)
  512. #define REV_VARID_SHIFT 12
  513. #define REV_VARID_MASK (0xf << REV_VARID_SHIFT)
  514. #define REV_REVID_SHIFT 0
  515. @@ -211,6 +213,52 @@
  516. CKCTL_6368_NAND_EN | \
  517. CKCTL_6368_IPSEC_EN)
  518. +#define CKCTL_63268_DISABLE_GLESS (1 << 0)
  519. +#define CKCTL_63268_VDSL_QPROC_EN (1 << 1)
  520. +#define CKCTL_63268_VDSL_AFE_EN (1 << 2)
  521. +#define CKCTL_63268_VDSL_EN (1 << 3)
  522. +#define CKCTL_63268_MIPS_EN (1 << 4)
  523. +#define CKCTL_63268_WLAN_OCP_EN (1 << 5)
  524. +#define CKCTL_63268_DECT_EN (1 << 6)
  525. +#define CKCTL_63268_FAP0_EN (1 << 7)
  526. +#define CKCTL_63268_FAP1_EN (1 << 8)
  527. +#define CKCTL_63268_SAR_EN (1 << 9)
  528. +#define CKCTL_63268_ROBOSW_EN (1 << 10)
  529. +#define CKCTL_63268_PCM_EN (1 << 11)
  530. +#define CKCTL_63268_USBD_EN (1 << 12)
  531. +#define CKCTL_63268_USBH_EN (1 << 13)
  532. +#define CKCTL_63268_IPSEC_EN (1 << 14)
  533. +#define CKCTL_63268_SPI_EN (1 << 15)
  534. +#define CKCTL_63268_HSSPI_EN (1 << 16)
  535. +#define CKCTL_63268_PCIE_EN (1 << 17)
  536. +#define CKCTL_63268_PHYMIPS_EN (1 << 18)
  537. +#define CKCTL_63268_GMAC_EN (1 << 19)
  538. +#define CKCTL_63268_NAND_EN (1 << 20)
  539. +#define CKCTL_63268_TBUS_EN (1 << 27)
  540. +#define CKCTL_63268_ROBOSW250_EN (1 << 31)
  541. +
  542. +#define CKCTL_63268_ALL_SAFE_EN (CKCTL_63268_VDSL_QPROC_EN | \
  543. + CKCTL_63268_VDSL_AFE_EN | \
  544. + CKCTL_63268_VDSL_EN | \
  545. + CKCTL_63268_WLAN_OCP_EN | \
  546. + CKCTL_63268_DECT_EN | \
  547. + CKCTL_63268_FAP0_EN | \
  548. + CKCTL_63268_FAP1_EN | \
  549. + CKCTL_63268_SAR_EN | \
  550. + CKCTL_63268_ROBOSW_EN | \
  551. + CKCTL_63268_PCM_EN | \
  552. + CKCTL_63268_USBD_EN | \
  553. + CKCTL_63268_USBH_EN | \
  554. + CKCTL_63268_IPSEC_EN | \
  555. + CKCTL_63268_SPI_EN | \
  556. + CKCTL_63268_HSSPI_EN | \
  557. + CKCTL_63268_PCIE_EN | \
  558. + CKCTL_63268_PHYMIPS_EN | \
  559. + CKCTL_63268_GMAC_EN | \
  560. + CKCTL_63268_NAND_EN | \
  561. + CKCTL_63268_TBUS_EN | \
  562. + CKCTL_63268_ROBOSW250_EN)
  563. +
  564. /* System PLL Control register */
  565. #define PERF_SYS_PLL_CTL_REG 0x8
  566. #define SYS_PLL_SOFT_RESET 0x1
  567. @@ -224,6 +272,7 @@
  568. #define PERF_IRQMASK_6358_REG(x) (0xc + (x) * 0x2c)
  569. #define PERF_IRQMASK_6362_REG(x) (0x20 + (x) * 0x10)
  570. #define PERF_IRQMASK_6368_REG(x) (0x20 + (x) * 0x10)
  571. +#define PERF_IRQMASK_63268_REG(x) (0x20 + (x) * 0x20)
  572. /* Interrupt Status register */
  573. #define PERF_IRQSTAT_3368_REG 0x10
  574. @@ -234,6 +283,7 @@
  575. #define PERF_IRQSTAT_6358_REG(x) (0x10 + (x) * 0x2c)
  576. #define PERF_IRQSTAT_6362_REG(x) (0x28 + (x) * 0x10)
  577. #define PERF_IRQSTAT_6368_REG(x) (0x28 + (x) * 0x10)
  578. +#define PERF_IRQSTAT_63268_REG(x) (0x30 + (x) * 0x20)
  579. /* External Interrupt Configuration register */
  580. #define PERF_EXTIRQ_CFG_REG_3368 0x14
  581. @@ -244,6 +294,7 @@
  582. #define PERF_EXTIRQ_CFG_REG_6358 0x14
  583. #define PERF_EXTIRQ_CFG_REG_6362 0x18
  584. #define PERF_EXTIRQ_CFG_REG_6368 0x18
  585. +#define PERF_EXTIRQ_CFG_REG_63268 0x18
  586. #define PERF_EXTIRQ_CFG_REG2_6358 0x1c
  587. #define PERF_EXTIRQ_CFG_REG2_6368 0x1c
  588. @@ -274,6 +325,7 @@
  589. #define PERF_SOFTRESET_6358_REG 0x34
  590. #define PERF_SOFTRESET_6362_REG 0x10
  591. #define PERF_SOFTRESET_6368_REG 0x10
  592. +#define PERF_SOFTRESET_63268_REG 0x10
  593. #define SOFTRESET_3368_SPI_MASK (1 << 0)
  594. #define SOFTRESET_3368_ENET_MASK (1 << 2)
  595. @@ -367,6 +419,26 @@
  596. #define SOFTRESET_6368_USBH_MASK (1 << 12)
  597. #define SOFTRESET_6368_PCM_MASK (1 << 13)
  598. +#define SOFTRESET_63268_SPI_MASK (1 << 0)
  599. +#define SOFTRESET_63268_IPSEC_MASK (1 << 1)
  600. +#define SOFTRESET_63268_EPHY_MASK (1 << 2)
  601. +#define SOFTRESET_63268_SAR_MASK (1 << 3)
  602. +#define SOFTRESET_63268_ENETSW_MASK (1 << 4)
  603. +#define SOFTRESET_63268_USBS_MASK (1 << 5)
  604. +#define SOFTRESET_63268_USBH_MASK (1 << 6)
  605. +#define SOFTRESET_63268_PCM_MASK (1 << 7)
  606. +#define SOFTRESET_63268_PCIE_CORE_MASK (1 << 8)
  607. +#define SOFTRESET_63268_PCIE_MASK (1 << 9)
  608. +#define SOFTRESET_63268_PCIE_EXT_MASK (1 << 10)
  609. +#define SOFTRESET_63268_WLAN_SHIM_MASK (1 << 11)
  610. +#define SOFTRESET_63268_DDR_PHY_MASK (1 << 12)
  611. +#define SOFTRESET_63268_FAP0_MASK (1 << 13)
  612. +#define SOFTRESET_63268_WLAN_UBUS_MASK (1 << 14)
  613. +#define SOFTRESET_63268_DECT_MASK (1 << 15)
  614. +#define SOFTRESET_63268_FAP1_MASK (1 << 16)
  615. +#define SOFTRESET_63268_PCIE_HARD_MASK (1 << 17)
  616. +#define SOFTRESET_63268_GPHY_MASK (1 << 18)
  617. +
  618. /* MIPS PLL control register */
  619. #define PERF_MIPSPLLCTL_REG 0x34
  620. #define MIPSPLLCTL_N1_SHIFT 20
  621. @@ -1380,6 +1452,13 @@
  622. #define STRAPBUS_6362_BOOT_SEL_SERIAL (1 << 15)
  623. #define STRAPBUS_6362_BOOT_SEL_NAND (0 << 15)
  624. +#define MISC_STRAPBUS_63268_REG 0x14
  625. +#define STRAPBUS_63268_HSSPI_CLK_FAST (1 << 9)
  626. +#define STRAPBUS_63268_BOOT_SEL_SERIAL (1 << 11)
  627. +#define STRAPBUS_63268_BOOT_SEL_NAND (0 << 11)
  628. +#define STRAPBUS_63268_FCVO_SHIFT 21
  629. +#define STRAPBUS_63268_FCVO_MASK (0xf << STRAPBUS_63268_FCVO_SHIFT)
  630. +
  631. #define MISC_STRAPBUS_6328_REG 0x240
  632. #define STRAPBUS_6328_FCVO_SHIFT 7
  633. #define STRAPBUS_6328_FCVO_MASK (0x1f << STRAPBUS_6328_FCVO_SHIFT)
  634. --- a/arch/mips/include/asm/mach-bcm63xx/ioremap.h
  635. +++ b/arch/mips/include/asm/mach-bcm63xx/ioremap.h
  636. @@ -25,6 +25,7 @@ static inline int is_bcm63xx_internal_re
  637. case BCM6328_CPU_ID:
  638. case BCM6362_CPU_ID:
  639. case BCM6368_CPU_ID:
  640. + case BCM63268_CPU_ID:
  641. if (offset >= 0xb0000000 && offset < 0xb1000000)
  642. return 1;
  643. break;
  644. --- a/arch/mips/bcm63xx/dev-hsspi.c
  645. +++ b/arch/mips/bcm63xx/dev-hsspi.c
  646. @@ -35,7 +35,7 @@ static struct platform_device bcm63xx_hs
  647. int __init bcm63xx_hsspi_register(void)
  648. {
  649. - if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362())
  650. + if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362() && !BCMCPU_IS_63268())
  651. return -ENODEV;
  652. spi_resources[0].start = bcm63xx_regset_address(RSET_HSSPI);
  653. --- a/arch/mips/bcm63xx/dev-enet.c
  654. +++ b/arch/mips/bcm63xx/dev-enet.c
  655. @@ -176,7 +176,8 @@ static int __init register_shared(void)
  656. else
  657. shared_res[0].end += (RSET_ENETDMA_SIZE) - 1;
  658. - if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_6368())
  659. + if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_6368() ||
  660. + BCMCPU_IS_63268())
  661. chan_count = 32;
  662. else if (BCMCPU_IS_6345())
  663. chan_count = 8;
  664. @@ -276,7 +277,8 @@ bcm63xx_enetsw_register(const struct bcm
  665. {
  666. int ret;
  667. - if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362() && !BCMCPU_IS_6368())
  668. + if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362() && !BCMCPU_IS_6368() &&
  669. + !BCMCPU_IS_63268())
  670. return -ENODEV;
  671. ret = register_shared();
  672. @@ -297,6 +299,8 @@ bcm63xx_enetsw_register(const struct bcm
  673. enetsw_pd.num_ports = ENETSW_PORTS_6328;
  674. else if (BCMCPU_IS_6362() || BCMCPU_IS_6368())
  675. enetsw_pd.num_ports = ENETSW_PORTS_6368;
  676. + else if (BCMCPU_IS_63268())
  677. + enetsw_pd.num_ports = ENETSW_PORTS_63268;
  678. enetsw_pd.dma_has_sram = true;
  679. enetsw_pd.dma_chan_width = ENETDMA_CHAN_WIDTH;
  680. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
  681. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
  682. @@ -62,6 +62,7 @@ struct bcm63xx_enet_platform_data {
  683. #define ENETSW_MAX_PORT 8
  684. #define ENETSW_PORTS_6328 5 /* 4 FE PHY + 1 RGMII */
  685. #define ENETSW_PORTS_6368 6 /* 4 FE PHY + 2 RGMII */
  686. +#define ENETSW_PORTS_63268 8 /* 3 FE PHY + 1 GE PHY + 4 RGMII */
  687. #define ENETSW_RGMII_PORT0 4