0001-Arcturus-uCP1020-BSP-support.patch 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. From a243628639e12a4bd0a737eac78a12ed240cd137 Mon Sep 17 00:00:00 2001
  2. From: Oleksandr G Zhadan <oleks@arcturusnetworks.com>
  3. Date: Mon, 18 Jul 2016 10:40:16 -0400
  4. Subject: [PATCH] Arcturus uCP1020 BSP support
  5. The uCP1020 product family (ucp1020) is an Arcturus Networks Inc.
  6. System on Modules product featuring a NXP QorIQ P1020 CPU,
  7. optionally populated with 1 or 2 Gig-Ethernet PHYs,
  8. DDR3, NOR Flash, eMMC NAND Flash and/or SPI Flash.
  9. Signed-off-by: Oleksandr G Zhadan <oleks@arcturusnetworks.com>
  10. Signed-off-by: Michael Durrant <arcsupport@arcturusnetworks.com>
  11. ---
  12. arch/powerpc/boot/dts/ucp1020.dts | 87 ++++++++++++
  13. arch/powerpc/boot/dts/ucp1020.dtsi | 211 ++++++++++++++++++++++++++++++
  14. arch/powerpc/platforms/85xx/Kconfig | 7 +
  15. arch/powerpc/platforms/85xx/Makefile | 1 +
  16. arch/powerpc/platforms/85xx/ucp1020_som.c | 92 +++++++++++++
  17. 5 files changed, 398 insertions(+)
  18. create mode 100644 arch/powerpc/boot/dts/ucp1020.dts
  19. create mode 100644 arch/powerpc/boot/dts/ucp1020.dtsi
  20. create mode 100644 arch/powerpc/platforms/85xx/ucp1020_som.c
  21. diff --git a/arch/powerpc/boot/dts/ucp1020.dts b/arch/powerpc/boot/dts/ucp1020.dts
  22. new file mode 100644
  23. index 0000000..291e70a
  24. --- /dev/null
  25. +++ b/arch/powerpc/boot/dts/ucp1020.dts
  26. @@ -0,0 +1,87 @@
  27. +/*
  28. + * uCP1020 Tree Source (32-bit address map)
  29. + *
  30. + * Copyright 2013-2016 Arcturus Networks Inc.
  31. + *
  32. + * Redistribution and use in source and binary forms, with or without
  33. + * modification, are permitted provided that the following conditions are met:
  34. + * * Redistributions of source code must retain the above copyright
  35. + * notice, this list of conditions and the following disclaimer.
  36. + * * Redistributions in binary form must reproduce the above copyright
  37. + * notice, this list of conditions and the following disclaimer in the
  38. + * documentation and/or other materials provided with the distribution.
  39. + * * Neither the name of Freescale Semiconductor nor the
  40. + * names of its contributors may be used to endorse or promote products
  41. + * derived from this software without specific prior written permission.
  42. + *
  43. + *
  44. + * ALTERNATIVELY, this software may be distributed under the terms of the
  45. + * GNU General Public License ("GPL") as published by the Free Software
  46. + * Foundation, either version 2 of that License or (at your option) any
  47. + * later version.
  48. + *
  49. + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
  50. + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  51. + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  52. + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
  53. + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  54. + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  55. + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  56. + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  57. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  58. + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  59. + */
  60. +
  61. +/include/ "fsl/p1020si-pre.dtsi"
  62. +/ {
  63. + model = "arcturus,uCP1020";
  64. + compatible = "arcturus,uCP1020";
  65. +
  66. + memory {
  67. + device_type = "memory";
  68. + };
  69. +
  70. + lbc: localbus@ffe05000 {
  71. + reg = <0 0xffe05000 0 0x1000>;
  72. +
  73. + /* NOR Flash */
  74. + ranges = <0x0 0x0 0x0 0xec000000 0x04000000>;
  75. + };
  76. +
  77. + soc: soc@ffe00000 {
  78. + ranges = <0x0 0x0 0xffe00000 0x100000>;
  79. + };
  80. +
  81. + pci0: pcie@ffe09000 {
  82. + ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
  83. + 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
  84. + reg = <0 0xffe09000 0 0x1000>;
  85. + pcie@0 {
  86. + ranges = <0x2000000 0x0 0xa0000000
  87. + 0x2000000 0x0 0xa0000000
  88. + 0x0 0x20000000
  89. +
  90. + 0x1000000 0x0 0x0
  91. + 0x1000000 0x0 0x0
  92. + 0x0 0x100000>;
  93. + };
  94. + };
  95. +
  96. + pci1: pcie@ffe0a000 {
  97. + reg = <0 0xffe0a000 0 0x1000>;
  98. + ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
  99. + 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
  100. + pcie@0 {
  101. + ranges = <0x2000000 0x0 0x80000000
  102. + 0x2000000 0x0 0x80000000
  103. + 0x0 0x20000000
  104. +
  105. + 0x1000000 0x0 0x0
  106. + 0x1000000 0x0 0x0
  107. + 0x0 0x100000>;
  108. + };
  109. + };
  110. +};
  111. +
  112. +/include/ "ucp1020.dtsi"
  113. +/include/ "fsl/p1020si-post.dtsi"
  114. diff --git a/arch/powerpc/boot/dts/ucp1020.dtsi b/arch/powerpc/boot/dts/ucp1020.dtsi
  115. new file mode 100644
  116. index 0000000..7cff949
  117. --- /dev/null
  118. +++ b/arch/powerpc/boot/dts/ucp1020.dtsi
  119. @@ -0,0 +1,211 @@
  120. +/*
  121. + * uCP1020 Device Tree Source stub (no addresses or top-level ranges)
  122. + *
  123. + * Copyright 2013-2016 Arcturus Networks Inc.
  124. + *
  125. + * Redistribution and use in source and binary forms, with or without
  126. + * modification, are permitted provided that the following conditions are met:
  127. + * * Redistributions of source code must retain the above copyright
  128. + * notice, this list of conditions and the following disclaimer.
  129. + * * Redistributions in binary form must reproduce the above copyright
  130. + * notice, this list of conditions and the following disclaimer in the
  131. + * documentation and/or other materials provided with the distribution.
  132. + * * Neither the name of Freescale Semiconductor nor the
  133. + * names of its contributors may be used to endorse or promote products
  134. + * derived from this software without specific prior written permission.
  135. + *
  136. + *
  137. + * ALTERNATIVELY, this software may be distributed under the terms of the
  138. + * GNU General Public License ("GPL") as published by the Free Software
  139. + * Foundation, either version 2 of that License or (at your option) any
  140. + * later version.
  141. + *
  142. + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
  143. + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  144. + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  145. + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
  146. + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  147. + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  148. + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  149. + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  150. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  151. + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  152. + */
  153. +
  154. +&lbc {
  155. + nor@0,0 {
  156. + #address-cells = <1>;
  157. + #size-cells = <1>;
  158. + compatible = "cfi-flash";
  159. + reg = <0x0 0x0 0x04000000>;
  160. + bank-width = <2>;
  161. + device-width = <1>;
  162. +
  163. + partition@100000 {
  164. + /* 7MB - PART 0 */
  165. + reg = <0x00100000 0x00700000>;
  166. + label = "0";
  167. + };
  168. +
  169. + partition@800000 {
  170. + /* 32MB - PART 1 */
  171. + reg = <0x0800000 0x02000000>;
  172. + label = "1";
  173. + };
  174. +
  175. + partition@2800000 {
  176. + /* 8MB - PART 2 */
  177. + reg = <0x02800000 0x00800000>;
  178. + label = "2";
  179. + };
  180. +
  181. + partition@3000000 {
  182. + /* (16MB - 512K) - PART 3 JFFS 2 */
  183. + reg = <0x03000000 0x00f80000>;
  184. + label = "3";
  185. + };
  186. +
  187. + partition@0 {
  188. + /* 512KB - bootloader[u-boot, uCbootloader] */
  189. + reg = <0x0 0x00080000>;
  190. + label = "BOOT_SPI";
  191. + };
  192. +
  193. + partition@3f80000 {
  194. + /* 512KB - bootloade NOR r[u-boot, uCbootloader] */
  195. + reg = <0x03f80000 0x00080000>;
  196. + label = "B";
  197. + };
  198. +
  199. + partition@80000 {
  200. + /* 256KB - bootloaders environment (uCenv) */
  201. + reg = <0x00080000 0x00040000>;
  202. +
  203. + label = "E";
  204. + };
  205. +
  206. + partition@C0000 {
  207. + /* 256KB - bootloaders environment (u-boot) */
  208. + reg = <0x000C0000 0x00040000>;
  209. + label = "UENV";
  210. + };
  211. + };
  212. +};
  213. +
  214. +&soc {
  215. + i2c@3000 {
  216. + spoc@14 {
  217. + compatible = "conexant,cx2070x";
  218. + reg = <0x14>;
  219. + };
  220. + };
  221. +
  222. + i2c@3100 {
  223. + dtt@4C {
  224. + compatible = "national,lm90";
  225. + reg = <0x4C>;
  226. + };
  227. + };
  228. +
  229. + spi@7000 {
  230. + flash@0 {
  231. + #address-cells = <1>;
  232. + #size-cells = <1>;
  233. + compatible = "winbond,w25q80bl";
  234. + reg = <0>;
  235. + spi-max-frequency = <40000000>; /* input clock */
  236. +
  237. + partition@0 {
  238. + label = "SPI MBR";
  239. + reg = <0x00000000 0x00002000>;
  240. + read-only;
  241. + };
  242. + partition@2000 {
  243. + label = "SPI ENV";
  244. + reg = <0x00002000 0x00006000>;
  245. + read-only;
  246. + };
  247. + partition@8000 {
  248. + label = "SPI FS";
  249. + reg = <0x00008000 0x000F8000>;
  250. + };
  251. + };
  252. + flash@3 {
  253. + #address-cells = <1>;
  254. + #size-cells = <1>;
  255. + compatible = "spansion,s25fl008k";
  256. + reg = <3>;
  257. + spi-max-frequency = <40000000>; /* input clock */
  258. + partition@0 {
  259. + label = "SPI USER";
  260. + reg = <0x00000000 0x00100000>;
  261. + };
  262. + };
  263. + };
  264. +
  265. + usb@22000 {
  266. + phy_type = "ulpi";
  267. + dr_mode = "host";
  268. + };
  269. +
  270. + mdio@24000 {
  271. + phy0: ethernet-phy@4 {
  272. + interrupt-parent = <&mpic>;
  273. + interrupts = <4 1>;
  274. + reg = <0x04>;
  275. + };
  276. +
  277. + phy1: ethernet-phy@6 {
  278. + interrupt-parent = <&mpic>;
  279. + interrupts = <8 1>;
  280. + reg = <0x6>;
  281. + };
  282. + };
  283. +
  284. + enet0: ethernet@b0000 {
  285. + phy-handle = <&phy0>;
  286. + phy-connection-type = "rgmii-id";
  287. + };
  288. +
  289. + enet1: ethernet@b1000 {
  290. + status = "disabled";
  291. + };
  292. +
  293. + enet2: ethernet@b2000 {
  294. + phy-handle = <&phy1>;
  295. + phy-connection-type = "rgmii-id";
  296. + };
  297. +
  298. + gpio0: gpio@f000 {
  299. + compatible = "fsl,mpc8572-gpio", "fsl,pq3-gpio";
  300. + reg = <0xf000 0x1000>;
  301. + interrupts = <47 2>;
  302. + interrupt-parent = <&mpic>;
  303. + #gpio-cells = <2>;
  304. + gpio-controller;
  305. + };
  306. +
  307. + gpio-leds {
  308. + compatible = "gpio-leds";
  309. + gpio5 {
  310. + label = "led1"; /* LED15 */
  311. + gpios = <&gpio0 5 0>;
  312. + };
  313. + gpio12 {
  314. + label = "led2"; /* LED16 */
  315. + gpios = <&gpio0 12 0>;
  316. + };
  317. + gpio13 {
  318. + label = "led3"; /* LED17 */
  319. + gpios = <&gpio0 13 0>;
  320. + };
  321. + gpio7 {
  322. + label = "led4"; /* LED18 */
  323. + gpios = <&gpio0 7 0>;
  324. + };
  325. + gpio6 {
  326. + label = "led5"; /* LED19 */
  327. + gpios = <&gpio0 6 0>;
  328. + };
  329. + };
  330. +};
  331. diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
  332. index 2fb4b24..81a944f 100644
  333. --- a/arch/powerpc/platforms/85xx/Kconfig
  334. +++ b/arch/powerpc/platforms/85xx/Kconfig
  335. @@ -241,6 +241,13 @@ config SGY_CTS1000
  336. help
  337. Enable this to support functionality in Servergy's CTS-1000 systems.
  338. +config UCP1020_SOM
  339. + bool "Arcturus uCP1020 Rev.1.3 System on Module"
  340. + select DEFAULT_UIMAGE
  341. + help
  342. + This option enables support for the Arcturus Networks Inc.
  343. + uCP1020 System on Module.
  344. +
  345. config MVME2500
  346. bool "Artesyn MVME2500"
  347. select DEFAULT_UIMAGE
  348. diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
  349. index 1fe7fb9..84f2b9a 100644
  350. --- a/arch/powerpc/platforms/85xx/Makefile
  351. +++ b/arch/powerpc/platforms/85xx/Makefile
  352. @@ -31,4 +31,5 @@ obj-$(CONFIG_XES_MPC85xx) += xes_mpc85xx.o
  353. obj-$(CONFIG_GE_IMP3A) += ge_imp3a.o
  354. obj-$(CONFIG_PPC_QEMU_E500) += qemu_e500.o
  355. obj-$(CONFIG_SGY_CTS1000) += sgy_cts1000.o
  356. +obj-$(CONFIG_UCP1020_SOM) += ucp1020_som.o
  357. obj-$(CONFIG_MVME2500) += mvme2500.o
  358. diff --git a/arch/powerpc/platforms/85xx/ucp1020_som.c b/arch/powerpc/platforms/85xx/ucp1020_som.c
  359. new file mode 100644
  360. index 0000000..777e8ad
  361. --- /dev/null
  362. +++ b/arch/powerpc/platforms/85xx/ucp1020_som.c
  363. @@ -0,0 +1,92 @@
  364. +/*
  365. + * Arcturus Networks Inc. uCP1020 module Setup
  366. + *
  367. + * Copyright 2014-2016 Arcturus Networks Inc.
  368. + *
  369. + * by Oleksandr G Zhadan & Michael Durrant (www.ArcturusNetworks.com)
  370. + *
  371. + * This program is free software; you can redistribute it and/or modify it
  372. + * under the terms of the GNU General Public License as published by the
  373. + * Free Software Foundation; either version 2 of the License, or (at your
  374. + * option) any later version.
  375. + */
  376. +
  377. +#include <linux/stddef.h>
  378. +#include <linux/kernel.h>
  379. +#include <linux/pci.h>
  380. +#include <linux/kdev_t.h>
  381. +#include <linux/delay.h>
  382. +#include <linux/seq_file.h>
  383. +#include <linux/interrupt.h>
  384. +#include <linux/of_platform.h>
  385. +
  386. +#include <asm/time.h>
  387. +#include <asm/machdep.h>
  388. +#include <asm/pci-bridge.h>
  389. +#include <mm/mmu_decl.h>
  390. +#include <asm/prom.h>
  391. +#include <asm/udbg.h>
  392. +#include <asm/mpic.h>
  393. +#include <asm/fsl_guts.h>
  394. +
  395. +#include <sysdev/fsl_soc.h>
  396. +#include <sysdev/fsl_pci.h>
  397. +#include "smp.h"
  398. +
  399. +#include "mpc85xx.h"
  400. +
  401. +void __init ucp1020_som_pic_init(void)
  402. +{
  403. + struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |
  404. + MPIC_SINGLE_DEST_CPU,
  405. + 0, 256, " OpenPIC ");
  406. +
  407. + BUG_ON(mpic == NULL);
  408. +
  409. + mpic_init(mpic);
  410. +}
  411. +
  412. +/*
  413. + * Setup the architecture
  414. + */
  415. +static void __init ucp1020_som_setup_arch(void)
  416. +{
  417. + if (ppc_md.progress)
  418. + ppc_md.progress("uCP1020_SoM_setup_arch()", 0);
  419. +
  420. + mpc85xx_smp_init();
  421. +
  422. + fsl_pci_assign_primary();
  423. + pr_info("\n\t%s (http://www.arcturusnetworks.com)\n", ppc_md.name);
  424. +}
  425. +
  426. +machine_arch_initcall(ucp1020, mpc85xx_common_publish_devices);
  427. +machine_arch_initcall(ucp1020, swiotlb_setup_bus_notifier);
  428. +
  429. +/*
  430. + * Called very early, device-tree isn't unflattened
  431. + */
  432. +static int __init ucp1020_probe(void)
  433. +{
  434. + unsigned long root = of_get_flat_dt_root();
  435. +
  436. + if (of_flat_dt_is_compatible(root, "arcturus,uCP1020"))
  437. + return 1;
  438. + return 0;
  439. +}
  440. +
  441. +define_machine(ucp1020) {
  442. + .name = "uCP1020 SoM - Arcturus Networks Inc.",
  443. + .probe = ucp1020_probe,
  444. + .setup_arch = ucp1020_som_setup_arch,
  445. + .init_IRQ = ucp1020_som_pic_init,
  446. +#ifdef CONFIG_PCI
  447. + .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  448. +#endif
  449. + .get_irq = mpic_get_irq,
  450. + .restart = fsl_rstcr_restart,
  451. + .calibrate_decr = generic_calibrate_decr,
  452. +#ifdef DEBUG
  453. + .progress = udbg_progress,
  454. +#endif
  455. +};
  456. --
  457. 2.1.4