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
6 The uCP1020 product family (ucp1020) is an Arcturus Networks Inc.
7 System on Modules product featuring a NXP QorIQ P1020 CPU,
8 optionally populated with 1 or 2 Gig-Ethernet PHYs,
9 DDR3, NOR Flash, eMMC NAND Flash and/or SPI Flash.
11 Signed-off-by: Oleksandr G Zhadan <oleks@arcturusnetworks.com>
12 Signed-off-by: Michael Durrant <arcsupport@arcturusnetworks.com>
14 arch/powerpc/boot/dts/ucp1020.dts | 87 ++++++++++++
15 arch/powerpc/boot/dts/ucp1020.dtsi | 211 ++++++++++++++++++++++++++++++
16 arch/powerpc/platforms/85xx/Kconfig | 7 +
17 arch/powerpc/platforms/85xx/Makefile | 1 +
18 arch/powerpc/platforms/85xx/ucp1020_som.c | 92 +++++++++++++
19 5 files changed, 398 insertions(+)
20 create mode 100644 arch/powerpc/boot/dts/ucp1020.dts
21 create mode 100644 arch/powerpc/boot/dts/ucp1020.dtsi
22 create mode 100644 arch/powerpc/platforms/85xx/ucp1020_som.c
24 diff --git a/arch/powerpc/boot/dts/ucp1020.dts b/arch/powerpc/boot/dts/ucp1020.dts
26 index 0000000..291e70a
28 +++ b/arch/powerpc/boot/dts/ucp1020.dts
31 + * uCP1020 Tree Source (32-bit address map)
33 + * Copyright 2013-2016 Arcturus Networks Inc.
35 + * Redistribution and use in source and binary forms, with or without
36 + * modification, are permitted provided that the following conditions are met:
37 + * * Redistributions of source code must retain the above copyright
38 + * notice, this list of conditions and the following disclaimer.
39 + * * Redistributions in binary form must reproduce the above copyright
40 + * notice, this list of conditions and the following disclaimer in the
41 + * documentation and/or other materials provided with the distribution.
42 + * * Neither the name of Freescale Semiconductor nor the
43 + * names of its contributors may be used to endorse or promote products
44 + * derived from this software without specific prior written permission.
47 + * ALTERNATIVELY, this software may be distributed under the terms of the
48 + * GNU General Public License ("GPL") as published by the Free Software
49 + * Foundation, either version 2 of that License or (at your option) any
52 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
53 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
54 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
55 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
56 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
57 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
58 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
59 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
61 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
64 +/include/ "fsl/p1020si-pre.dtsi"
66 + model = "arcturus,uCP1020";
67 + compatible = "arcturus,uCP1020";
70 + device_type = "memory";
73 + lbc: localbus@ffe05000 {
74 + reg = <0 0xffe05000 0 0x1000>;
77 + ranges = <0x0 0x0 0x0 0xec000000 0x04000000>;
81 + ranges = <0x0 0x0 0xffe00000 0x100000>;
84 + pci0: pcie@ffe09000 {
85 + ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
86 + 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
87 + reg = <0 0xffe09000 0 0x1000>;
89 + ranges = <0x2000000 0x0 0xa0000000
90 + 0x2000000 0x0 0xa0000000
99 + pci1: pcie@ffe0a000 {
100 + reg = <0 0xffe0a000 0 0x1000>;
101 + ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
102 + 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
104 + ranges = <0x2000000 0x0 0x80000000
105 + 0x2000000 0x0 0x80000000
115 +/include/ "ucp1020.dtsi"
116 +/include/ "fsl/p1020si-post.dtsi"
117 diff --git a/arch/powerpc/boot/dts/ucp1020.dtsi b/arch/powerpc/boot/dts/ucp1020.dtsi
119 index 0000000..7cff949
121 +++ b/arch/powerpc/boot/dts/ucp1020.dtsi
124 + * uCP1020 Device Tree Source stub (no addresses or top-level ranges)
126 + * Copyright 2013-2016 Arcturus Networks Inc.
128 + * Redistribution and use in source and binary forms, with or without
129 + * modification, are permitted provided that the following conditions are met:
130 + * * Redistributions of source code must retain the above copyright
131 + * notice, this list of conditions and the following disclaimer.
132 + * * Redistributions in binary form must reproduce the above copyright
133 + * notice, this list of conditions and the following disclaimer in the
134 + * documentation and/or other materials provided with the distribution.
135 + * * Neither the name of Freescale Semiconductor nor the
136 + * names of its contributors may be used to endorse or promote products
137 + * derived from this software without specific prior written permission.
140 + * ALTERNATIVELY, this software may be distributed under the terms of the
141 + * GNU General Public License ("GPL") as published by the Free Software
142 + * Foundation, either version 2 of that License or (at your option) any
145 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
146 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
147 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
148 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
149 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
150 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
151 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
152 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
153 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
154 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
159 + #address-cells = <1>;
161 + compatible = "cfi-flash";
162 + reg = <0x0 0x0 0x04000000>;
164 + device-width = <1>;
168 + reg = <0x00100000 0x00700000>;
173 + /* 32MB - PART 1 */
174 + reg = <0x0800000 0x02000000>;
178 + partition@2800000 {
180 + reg = <0x02800000 0x00800000>;
184 + partition@3000000 {
185 + /* (16MB - 512K) - PART 3 JFFS 2 */
186 + reg = <0x03000000 0x00f80000>;
191 + /* 512KB - bootloader[u-boot, uCbootloader] */
192 + reg = <0x0 0x00080000>;
193 + label = "BOOT_SPI";
196 + partition@3f80000 {
197 + /* 512KB - bootloade NOR r[u-boot, uCbootloader] */
198 + reg = <0x03f80000 0x00080000>;
203 + /* 256KB - bootloaders environment (uCenv) */
204 + reg = <0x00080000 0x00040000>;
210 + /* 256KB - bootloaders environment (u-boot) */
211 + reg = <0x000C0000 0x00040000>;
220 + compatible = "conexant,cx2070x";
227 + compatible = "national,lm90";
234 + #address-cells = <1>;
236 + compatible = "winbond,w25q80bl";
238 + spi-max-frequency = <40000000>; /* input clock */
242 + reg = <0x00000000 0x00002000>;
247 + reg = <0x00002000 0x00006000>;
252 + reg = <0x00008000 0x000F8000>;
256 + #address-cells = <1>;
258 + compatible = "spansion,s25fl008k";
260 + spi-max-frequency = <40000000>; /* input clock */
262 + label = "SPI USER";
263 + reg = <0x00000000 0x00100000>;
274 + phy0: ethernet-phy@4 {
275 + interrupt-parent = <&mpic>;
276 + interrupts = <4 1>;
280 + phy1: ethernet-phy@6 {
281 + interrupt-parent = <&mpic>;
282 + interrupts = <8 1>;
287 + enet0: ethernet@b0000 {
288 + phy-handle = <&phy0>;
289 + phy-connection-type = "rgmii-id";
292 + enet1: ethernet@b1000 {
293 + status = "disabled";
296 + enet2: ethernet@b2000 {
297 + phy-handle = <&phy1>;
298 + phy-connection-type = "rgmii-id";
302 + compatible = "fsl,mpc8572-gpio", "fsl,pq3-gpio";
303 + reg = <0xf000 0x1000>;
304 + interrupts = <47 2>;
305 + interrupt-parent = <&mpic>;
311 + compatible = "gpio-leds";
313 + label = "led1"; /* LED15 */
314 + gpios = <&gpio0 5 0>;
317 + label = "led2"; /* LED16 */
318 + gpios = <&gpio0 12 0>;
321 + label = "led3"; /* LED17 */
322 + gpios = <&gpio0 13 0>;
325 + label = "led4"; /* LED18 */
326 + gpios = <&gpio0 7 0>;
329 + label = "led5"; /* LED19 */
330 + gpios = <&gpio0 6 0>;
334 diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
335 index 2fb4b24..81a944f 100644
336 --- a/arch/powerpc/platforms/85xx/Kconfig
337 +++ b/arch/powerpc/platforms/85xx/Kconfig
338 @@ -241,6 +241,13 @@ config SGY_CTS1000
340 Enable this to support functionality in Servergy's CTS-1000 systems.
343 + bool "Arcturus uCP1020 Rev.1.3 System on Module"
344 + select DEFAULT_UIMAGE
346 + This option enables support for the Arcturus Networks Inc.
347 + uCP1020 System on Module.
350 bool "Artesyn MVME2500"
351 select DEFAULT_UIMAGE
352 diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
353 index 1fe7fb9..84f2b9a 100644
354 --- a/arch/powerpc/platforms/85xx/Makefile
355 +++ b/arch/powerpc/platforms/85xx/Makefile
356 @@ -31,4 +31,5 @@ obj-$(CONFIG_XES_MPC85xx) += xes_mpc85xx.o
357 obj-$(CONFIG_GE_IMP3A) += ge_imp3a.o
358 obj-$(CONFIG_PPC_QEMU_E500) += qemu_e500.o
359 obj-$(CONFIG_SGY_CTS1000) += sgy_cts1000.o
360 +obj-$(CONFIG_UCP1020_SOM) += ucp1020_som.o
361 obj-$(CONFIG_MVME2500) += mvme2500.o
362 diff --git a/arch/powerpc/platforms/85xx/ucp1020_som.c b/arch/powerpc/platforms/85xx/ucp1020_som.c
364 index 0000000..777e8ad
366 +++ b/arch/powerpc/platforms/85xx/ucp1020_som.c
369 + * Arcturus Networks Inc. uCP1020 module Setup
371 + * Copyright 2014-2016 Arcturus Networks Inc.
373 + * by Oleksandr G Zhadan & Michael Durrant (www.ArcturusNetworks.com)
375 + * This program is free software; you can redistribute it and/or modify it
376 + * under the terms of the GNU General Public License as published by the
377 + * Free Software Foundation; either version 2 of the License, or (at your
378 + * option) any later version.
381 +#include <linux/stddef.h>
382 +#include <linux/kernel.h>
383 +#include <linux/pci.h>
384 +#include <linux/kdev_t.h>
385 +#include <linux/delay.h>
386 +#include <linux/seq_file.h>
387 +#include <linux/interrupt.h>
388 +#include <linux/of_platform.h>
390 +#include <asm/time.h>
391 +#include <asm/machdep.h>
392 +#include <asm/pci-bridge.h>
393 +#include <mm/mmu_decl.h>
394 +#include <asm/prom.h>
395 +#include <asm/udbg.h>
396 +#include <asm/mpic.h>
397 +#include <asm/fsl_guts.h>
399 +#include <sysdev/fsl_soc.h>
400 +#include <sysdev/fsl_pci.h>
403 +#include "mpc85xx.h"
405 +void __init ucp1020_som_pic_init(void)
407 + struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |
408 + MPIC_SINGLE_DEST_CPU,
409 + 0, 256, " OpenPIC ");
411 + BUG_ON(mpic == NULL);
417 + * Setup the architecture
419 +static void __init ucp1020_som_setup_arch(void)
421 + if (ppc_md.progress)
422 + ppc_md.progress("uCP1020_SoM_setup_arch()", 0);
424 + mpc85xx_smp_init();
426 + fsl_pci_assign_primary();
427 + pr_info("\n\t%s (http://www.arcturusnetworks.com)\n", ppc_md.name);
430 +machine_arch_initcall(ucp1020, mpc85xx_common_publish_devices);
431 +machine_arch_initcall(ucp1020, swiotlb_setup_bus_notifier);
434 + * Called very early, device-tree isn't unflattened
436 +static int __init ucp1020_probe(void)
438 + unsigned long root = of_get_flat_dt_root();
440 + if (of_flat_dt_is_compatible(root, "arcturus,uCP1020"))
445 +define_machine(ucp1020) {
446 + .name = "uCP1020 SoM - Arcturus Networks Inc.",
447 + .probe = ucp1020_probe,
448 + .setup_arch = ucp1020_som_setup_arch,
449 + .init_IRQ = ucp1020_som_pic_init,
451 + .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
453 + .get_irq = mpic_get_irq,
454 + .restart = fsl_rstcr_restart,
455 + .calibrate_decr = generic_calibrate_decr,
457 + .progress = udbg_progress,