aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorAlessio Igor Bogani <alessio.bogani@elettra.eu>2016-05-30 05:47:16 -0400
committerScott Wood <oss@buserror.net>2016-07-08 21:01:27 -0400
commit97493e2e9eeddfecaca741454f97a689d8141dcf (patch)
treef025cf7b2151a8dee405eafa1d3f31f13d8cff92 /arch/powerpc
parentae9ac1d3299ab8334f0b5293ddb77e18f2a9c9e5 (diff)
powerpc/86xx: Add support for Emerson/Artesyn MVME7100
Add support for the Artesyn MVME7100 Single Board Computer. The MVME7100 is a 6U form factor VME64 computer with: - A two e600 cores Freescale MPC8641D CPU - 2 GB of DDR2 onboard memory - Four Gigabit Ethernets - Five 16550 compatible UARTs - One USB 2.0 port - Two PCI/PCI eXpress Mezzanine Card (PMC/XMC) Slots - A DS1375 Real Time Clock (RTC) - 512 KB of Non-Volatile Memory (NVRAM) - Two 64 KB EEPROMs - 128 MB NOR and 4/8 GB NAND Flash This patch is based on linux-4.7-rc1 and has been only boot tested. Limitations: This patch covers only models 171 and 173 No plans to support CPLD timers Know issues: All four PHYs work in polling mode Configuration is missing for: PCI IDSEL and PCI Interrupt definition Support is missing for: Cache and memory controllers (which are very similar to the 85xx ones but right now I don't know if we can re-use their support) Watchdog, USB, NVRAM, NOR, NAND, EEPROMs, VME, PMC/XMC and RTC Signed-off-by: Alessio Igor Bogani <alessio.bogani@elettra.eu> Signed-off-by: Scott Wood <oss@buserror.net>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/boot/Makefile4
-rw-r--r--arch/powerpc/boot/dts/fsl/mvme7100.dts153
-rw-r--r--arch/powerpc/boot/motload-head.S11
-rw-r--r--arch/powerpc/boot/mvme7100.c59
-rw-r--r--arch/powerpc/boot/ppcboot.h2
-rwxr-xr-xarch/powerpc/boot/wrapper5
-rw-r--r--arch/powerpc/configs/86xx-hw.config4
-rw-r--r--arch/powerpc/configs/mpc86xx_basic_defconfig1
-rw-r--r--arch/powerpc/platforms/86xx/Kconfig8
-rw-r--r--arch/powerpc/platforms/86xx/Makefile1
-rw-r--r--arch/powerpc/platforms/86xx/mvme7100.c121
11 files changed, 365 insertions, 4 deletions
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 00cf88aa9a23..4cd612a6e272 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -113,6 +113,7 @@ src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr-wrapper.c
113src-plat-$(CONFIG_PPC_PSERIES) += pseries-head.S 113src-plat-$(CONFIG_PPC_PSERIES) += pseries-head.S
114src-plat-$(CONFIG_PPC_POWERNV) += pseries-head.S 114src-plat-$(CONFIG_PPC_POWERNV) += pseries-head.S
115src-plat-$(CONFIG_PPC_IBM_CELL_BLADE) += pseries-head.S 115src-plat-$(CONFIG_PPC_IBM_CELL_BLADE) += pseries-head.S
116src-plat-$(CONFIG_MVME7100) += motload-head.S mvme7100.c
116 117
117src-wlib := $(sort $(src-wlib-y)) 118src-wlib := $(sort $(src-wlib-y))
118src-plat := $(sort $(src-plat-y)) 119src-plat := $(sort $(src-plat-y))
@@ -296,6 +297,9 @@ image-$(CONFIG_TQM8560) += cuImage.tqm8560
296image-$(CONFIG_SBC8548) += cuImage.sbc8548 297image-$(CONFIG_SBC8548) += cuImage.sbc8548
297image-$(CONFIG_KSI8560) += cuImage.ksi8560 298image-$(CONFIG_KSI8560) += cuImage.ksi8560
298 299
300# Board ports in arch/powerpc/platform/86xx/Kconfig
301image-$(CONFIG_MVME7100) += dtbImage.mvme7100
302
299# Board ports in arch/powerpc/platform/embedded6xx/Kconfig 303# Board ports in arch/powerpc/platform/embedded6xx/Kconfig
300image-$(CONFIG_STORCENTER) += cuImage.storcenter 304image-$(CONFIG_STORCENTER) += cuImage.storcenter
301image-$(CONFIG_MPC7448HPC2) += cuImage.mpc7448hpc2 305image-$(CONFIG_MPC7448HPC2) += cuImage.mpc7448hpc2
diff --git a/arch/powerpc/boot/dts/fsl/mvme7100.dts b/arch/powerpc/boot/dts/fsl/mvme7100.dts
new file mode 100644
index 000000000000..e2d306ad37a6
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/mvme7100.dts
@@ -0,0 +1,153 @@
1/*
2 * Device tree source for the Emerson/Artesyn MVME7100
3 *
4 * Copyright 2016 Elettra-Sincrotrone Trieste S.C.p.A.
5 *
6 * Author: Alessio Igor Bogani <alessio.bogani@elettra.eu>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15/include/ "mpc8641si-pre.dtsi"
16
17/ {
18 model = "MVME7100";
19 compatible = "artesyn,MVME7100";
20
21 memory {
22 device_type = "memory";
23 reg = <0x00000000 0x80000000>;
24 };
25
26 soc: soc@f1000000 {
27 ranges = <0x00000000 0xf1000000 0x00100000>;
28
29 i2c@3000 {
30 hwmon@4c {
31 compatible = "dallas,max6649";
32 reg = <0x4c>;
33 };
34
35 rtc@68 {
36 status = "disabled";
37 };
38 };
39
40
41 enet0: ethernet@24000 {
42 phy-handle = <&phy0>;
43 phy-connection-type = "rgmii-id";
44 };
45
46 mdio@24520 {
47 phy0: ethernet-phy@1 {
48 reg = <1>;
49 };
50 phy1: ethernet-phy@2 {
51 reg = <2>;
52 };
53 phy2: ethernet-phy@3 {
54 reg = <3>;
55 };
56 phy3: ethernet-phy@4 {
57 reg = <4>;
58 };
59 };
60
61 enet1: ethernet@25000 {
62 phy-handle = <&phy1>;
63 phy-connection-type = "rgmii-id";
64 };
65
66 mdio@25520 {
67 status = "disabled";
68 };
69
70 enet2: ethernet@26000 {
71 phy-handle = <&phy2>;
72 phy-connection-type = "rgmii-id";
73 };
74
75 mdio@26520 {
76 status = "disabled";
77 };
78
79 enet3: ethernet@27000 {
80 phy-handle = <&phy3>;
81 phy-connection-type = "rgmii-id";
82 };
83
84 mdio@27520 {
85 status = "disabled";
86 };
87
88 serial1: serial@4600 {
89 status = "disabled";
90 };
91 };
92
93 lbc: localbus@f1005000 {
94 reg = <0xf1005000 0x1000>;
95
96 ranges = <0 0 0xf8000000 0x08000000 // NOR Flash (128MB)
97 2 0 0xf2030000 0x00010000 // NAND Flash (8GB)
98 3 0 0xf2400000 0x00080000 // MRAM (512KB)
99 4 0 0xf2000000 0x00010000 // BCSR
100 5 0 0xf2010000 0x00010000>; // QUART
101
102 bcsr@4,0 {
103 compatible = "artesyn,mvme7100-bcsr";
104 reg = <4 0 0x10000>;
105 };
106
107 serial@5,1000 {
108 device_type = "serial";
109 compatible = "ns16550";
110 reg = <5 0x1000 0x100>;
111 clock-frequency = <1843200>;
112 interrupts = <11 1 0 0>;
113 };
114
115 serial@5,2000 {
116 device_type = "serial";
117 compatible = "ns16550";
118 reg = <5 0x2000 0x100>;
119 clock-frequency = <1843200>;
120 interrupts = <11 1 0 0>;
121 };
122
123 serial@5,3000 {
124 device_type = "serial";
125 compatible = "ns16550";
126 reg = <5 0x3000 0x100>;
127 clock-frequency = <1843200>;
128 interrupts = <11 1 0 0>;
129 };
130
131 serial@5,4000 {
132 device_type = "serial";
133 compatible = "ns16550";
134 reg = <5 0x4000 0x100>;
135 clock-frequency = <1843200>;
136 interrupts = <11 1 0 0>;
137 };
138 };
139
140 pci0: pcie@f1008000 {
141 status = "disabled";
142 };
143
144 pci1: pcie@f1009000 {
145 status = "disabled";
146 };
147
148 chosen {
149 linux,stdout-path = &serial0;
150 };
151};
152
153/include/ "mpc8641si-post.dtsi"
diff --git a/arch/powerpc/boot/motload-head.S b/arch/powerpc/boot/motload-head.S
new file mode 100644
index 000000000000..41cabb4b63fa
--- /dev/null
+++ b/arch/powerpc/boot/motload-head.S
@@ -0,0 +1,11 @@
1#include "ppc_asm.h"
2
3 .text
4 .globl _zimage_start
5_zimage_start:
6 mfmsr r10
7 rlwinm r10,r10,0,~(1<<15) /* Clear MSR_EE */
8 sync
9 mtmsr r10
10 isync
11 b _zimage_start_lib
diff --git a/arch/powerpc/boot/mvme7100.c b/arch/powerpc/boot/mvme7100.c
new file mode 100644
index 000000000000..8b0a932311af
--- /dev/null
+++ b/arch/powerpc/boot/mvme7100.c
@@ -0,0 +1,59 @@
1/*
2 * Motload compatibility for the Emerson/Artesyn MVME7100
3 *
4 * Copyright 2016 Elettra-Sincrotrone Trieste S.C.p.A.
5 *
6 * Author: Alessio Igor Bogani <alessio.bogani@elettra.eu>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#include "ops.h"
16#include "stdio.h"
17#include "cuboot.h"
18
19#define TARGET_86xx
20#define TARGET_HAS_ETH1
21#define TARGET_HAS_ETH2
22#define TARGET_HAS_ETH3
23#include "ppcboot.h"
24
25static bd_t bd;
26
27BSS_STACK(16384);
28
29static void mvme7100_fixups(void)
30{
31 void *devp;
32 unsigned long busfreq = bd.bi_busfreq * 1000000;
33
34 dt_fixup_cpu_clocks(bd.bi_intfreq * 1000000, busfreq / 4, busfreq);
35
36 devp = finddevice("/soc@f1000000");
37 if (devp)
38 setprop(devp, "bus-frequency", &busfreq, sizeof(busfreq));
39
40 devp = finddevice("/soc/serial@4500");
41 if (devp)
42 setprop(devp, "clock-frequency", &busfreq, sizeof(busfreq));
43
44 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
45
46 dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
47 dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
48 dt_fixup_mac_address_by_alias("ethernet2", bd.bi_enet2addr);
49 dt_fixup_mac_address_by_alias("ethernet3", bd.bi_enet3addr);
50}
51
52void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
53 unsigned long r6, unsigned long r7)
54{
55 CUBOOT_INIT();
56 fdt_init(_dtb_start);
57 serial_console_init();
58 platform_ops.fixups = mvme7100_fixups;
59}
diff --git a/arch/powerpc/boot/ppcboot.h b/arch/powerpc/boot/ppcboot.h
index 6ae6f9063952..453df429d5d0 100644
--- a/arch/powerpc/boot/ppcboot.h
+++ b/arch/powerpc/boot/ppcboot.h
@@ -43,7 +43,7 @@ typedef struct bd_info {
43 unsigned long bi_sramstart; /* start of SRAM memory */ 43 unsigned long bi_sramstart; /* start of SRAM memory */
44 unsigned long bi_sramsize; /* size of SRAM memory */ 44 unsigned long bi_sramsize; /* size of SRAM memory */
45#if defined(TARGET_8xx) || defined(TARGET_CPM2) || defined(TARGET_85xx) ||\ 45#if defined(TARGET_8xx) || defined(TARGET_CPM2) || defined(TARGET_85xx) ||\
46 defined(TARGET_83xx) 46 defined(TARGET_83xx) || defined(TARGET_86xx)
47 unsigned long bi_immr_base; /* base of IMMR register */ 47 unsigned long bi_immr_base; /* base of IMMR register */
48#endif 48#endif
49#if defined(TARGET_PPC_MPC52xx) 49#if defined(TARGET_PPC_MPC52xx)
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 6a19fcef5596..6681ec3625c9 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -302,6 +302,11 @@ mvme5100)
302 platformo="$object/fixed-head.o $object/mvme5100.o" 302 platformo="$object/fixed-head.o $object/mvme5100.o"
303 binary=y 303 binary=y
304 ;; 304 ;;
305mvme7100)
306 platformo="$object/motload-head.o $object/mvme7100.o"
307 link_address='0x4000000'
308 binary=y
309 ;;
305esac 310esac
306 311
307vmz="$tmpdir/`basename \"$kernel\"`.$ext" 312vmz="$tmpdir/`basename \"$kernel\"`.$ext"
diff --git a/arch/powerpc/configs/86xx-hw.config b/arch/powerpc/configs/86xx-hw.config
index f91f8895fc93..d3dd6b8865c0 100644
--- a/arch/powerpc/configs/86xx-hw.config
+++ b/arch/powerpc/configs/86xx-hw.config
@@ -74,9 +74,9 @@ CONFIG_SERIAL_8250_CONSOLE=y
74CONFIG_SERIAL_8250_DETECT_IRQ=y 74CONFIG_SERIAL_8250_DETECT_IRQ=y
75CONFIG_SERIAL_8250_EXTENDED=y 75CONFIG_SERIAL_8250_EXTENDED=y
76CONFIG_SERIAL_8250_MANY_PORTS=y 76CONFIG_SERIAL_8250_MANY_PORTS=y
77CONFIG_SERIAL_8250_NR_UARTS=2 77CONFIG_SERIAL_8250_NR_UARTS=5
78CONFIG_SERIAL_8250_RSA=y 78CONFIG_SERIAL_8250_RSA=y
79CONFIG_SERIAL_8250_RUNTIME_UARTS=2 79CONFIG_SERIAL_8250_RUNTIME_UARTS=5
80CONFIG_SERIAL_8250_SHARE_IRQ=y 80CONFIG_SERIAL_8250_SHARE_IRQ=y
81CONFIG_SERIAL_8250=y 81CONFIG_SERIAL_8250=y
82CONFIG_SERIO_LIBPS2=y 82CONFIG_SERIO_LIBPS2=y
diff --git a/arch/powerpc/configs/mpc86xx_basic_defconfig b/arch/powerpc/configs/mpc86xx_basic_defconfig
index 33af5c5de105..3283f0586e11 100644
--- a/arch/powerpc/configs/mpc86xx_basic_defconfig
+++ b/arch/powerpc/configs/mpc86xx_basic_defconfig
@@ -8,3 +8,4 @@ CONFIG_GEF_SBC610=y
8CONFIG_MPC8610_HPCD=y 8CONFIG_MPC8610_HPCD=y
9CONFIG_MPC8641_HPCN=y 9CONFIG_MPC8641_HPCN=y
10CONFIG_SBC8641D=y 10CONFIG_SBC8641D=y
11CONFIG_MVME7100=y
diff --git a/arch/powerpc/platforms/86xx/Kconfig b/arch/powerpc/platforms/86xx/Kconfig
index 1afd1e4a2dd2..37b166ebc729 100644
--- a/arch/powerpc/platforms/86xx/Kconfig
+++ b/arch/powerpc/platforms/86xx/Kconfig
@@ -61,6 +61,11 @@ config GEF_SBC610
61 help 61 help
62 This option enables support for the GE SBC610. 62 This option enables support for the GE SBC610.
63 63
64config MVME7100
65 bool "Artesyn MVME7100"
66 help
67 This option enables support for the Emerson/Artesyn MVME7100 board.
68
64endif 69endif
65 70
66config MPC8641 71config MPC8641
@@ -69,7 +74,8 @@ config MPC8641
69 select FSL_PCI if PCI 74 select FSL_PCI if PCI
70 select PPC_UDBG_16550 75 select PPC_UDBG_16550
71 select MPIC 76 select MPIC
72 default y if MPC8641_HPCN || SBC8641D || GEF_SBC610 || GEF_SBC310 || GEF_PPC9A 77 default y if MPC8641_HPCN || SBC8641D || GEF_SBC610 || GEF_SBC310 || GEF_PPC9A \
78 || MVME7100
73 79
74config MPC8610 80config MPC8610
75 bool 81 bool
diff --git a/arch/powerpc/platforms/86xx/Makefile b/arch/powerpc/platforms/86xx/Makefile
index 2d889ad7dc89..01958fedc3f2 100644
--- a/arch/powerpc/platforms/86xx/Makefile
+++ b/arch/powerpc/platforms/86xx/Makefile
@@ -10,3 +10,4 @@ obj-$(CONFIG_MPC8610_HPCD) += mpc8610_hpcd.o
10obj-$(CONFIG_GEF_SBC610) += gef_sbc610.o 10obj-$(CONFIG_GEF_SBC610) += gef_sbc610.o
11obj-$(CONFIG_GEF_SBC310) += gef_sbc310.o 11obj-$(CONFIG_GEF_SBC310) += gef_sbc310.o
12obj-$(CONFIG_GEF_PPC9A) += gef_ppc9a.o 12obj-$(CONFIG_GEF_PPC9A) += gef_ppc9a.o
13obj-$(CONFIG_MVME7100) += mvme7100.o
diff --git a/arch/powerpc/platforms/86xx/mvme7100.c b/arch/powerpc/platforms/86xx/mvme7100.c
new file mode 100644
index 000000000000..addb41e7cd14
--- /dev/null
+++ b/arch/powerpc/platforms/86xx/mvme7100.c
@@ -0,0 +1,121 @@
1/*
2 * Board setup routines for the Emerson/Artesyn MVME7100
3 *
4 * Copyright 2016 Elettra-Sincrotrone Trieste S.C.p.A.
5 *
6 * Author: Alessio Igor Bogani <alessio.bogani@elettra.eu>
7 *
8 * Based on earlier code by:
9 *
10 * Ajit Prem <ajit.prem@emerson.com>
11 * Copyright 2008 Emerson
12 *
13 * USB host fixup is borrowed by:
14 *
15 * Martyn Welch <martyn.welch@ge.com>
16 * Copyright 2008 GE Intelligent Platforms Embedded Systems, Inc.
17 *
18 * This program is free software; you can redistribute it and/or modify it
19 * under the terms of the GNU General Public License as published by the
20 * Free Software Foundation; either version 2 of the License, or (at your
21 * option) any later version.
22 *
23 */
24
25#include <linux/pci.h>
26#include <linux/of.h>
27#include <linux/of_platform.h>
28#include <linux/of_address.h>
29#include <asm/udbg.h>
30#include <asm/mpic.h>
31#include <sysdev/fsl_soc.h>
32#include <sysdev/fsl_pci.h>
33
34#include "mpc86xx.h"
35
36#define MVME7100_INTERRUPT_REG_2_OFFSET 0x05
37#define MVME7100_DS1375_MASK 0x40
38#define MVME7100_MAX6649_MASK 0x20
39#define MVME7100_ABORT_MASK 0x10
40
41/*
42 * Setup the architecture
43 */
44static void __init mvme7100_setup_arch(void)
45{
46 struct device_node *bcsr_node;
47 void __iomem *mvme7100_regs = NULL;
48 u8 reg;
49
50 if (ppc_md.progress)
51 ppc_md.progress("mvme7100_setup_arch()", 0);
52
53#ifdef CONFIG_SMP
54 mpc86xx_smp_init();
55#endif
56
57 fsl_pci_assign_primary();
58
59 /* Remap BCSR registers */
60 bcsr_node = of_find_compatible_node(NULL, NULL,
61 "artesyn,mvme7100-bcsr");
62 if (bcsr_node) {
63 mvme7100_regs = of_iomap(bcsr_node, 0);
64 of_node_put(bcsr_node);
65 }
66
67 if (mvme7100_regs) {
68 /* Disable ds1375, max6649, and abort interrupts */
69 reg = readb(mvme7100_regs + MVME7100_INTERRUPT_REG_2_OFFSET);
70 reg |= MVME7100_DS1375_MASK | MVME7100_MAX6649_MASK
71 | MVME7100_ABORT_MASK;
72 writeb(reg, mvme7100_regs + MVME7100_INTERRUPT_REG_2_OFFSET);
73 } else
74 pr_warn("Unable to map board registers\n");
75
76 pr_info("MVME7100 board from Artesyn\n");
77}
78
79/*
80 * Called very early, device-tree isn't unflattened
81 */
82static int __init mvme7100_probe(void)
83{
84 unsigned long root = of_get_flat_dt_root();
85
86 return of_flat_dt_is_compatible(root, "artesyn,MVME7100");
87}
88
89static void mvme7100_usb_host_fixup(struct pci_dev *pdev)
90{
91 unsigned int val;
92
93 if (!machine_is(mvme7100))
94 return;
95
96 /* Ensure only ports 1 & 2 are enabled */
97 pci_read_config_dword(pdev, 0xe0, &val);
98 pci_write_config_dword(pdev, 0xe0, (val & ~7) | 0x2);
99
100 /* System clock is 48-MHz Oscillator and EHCI Enabled. */
101 pci_write_config_dword(pdev, 0xe4, 1 << 5);
102}
103DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB,
104 mvme7100_usb_host_fixup);
105
106machine_arch_initcall(mvme7100, mpc86xx_common_publish_devices);
107
108define_machine(mvme7100) {
109 .name = "MVME7100",
110 .probe = mvme7100_probe,
111 .setup_arch = mvme7100_setup_arch,
112 .init_IRQ = mpc86xx_init_irq,
113 .get_irq = mpic_get_irq,
114 .restart = fsl_rstcr_restart,
115 .time_init = mpc86xx_time_init,
116 .calibrate_decr = generic_calibrate_decr,
117 .progress = udbg_progress,
118#ifdef CONFIG_PCI
119 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
120#endif
121};