Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alessio Igor Bogani and committed by
Scott Wood
97493e2e ae9ac1d3

+365 -4
+4
arch/powerpc/boot/Makefile
··· 113 113 src-plat-$(CONFIG_PPC_PSERIES) += pseries-head.S 114 114 src-plat-$(CONFIG_PPC_POWERNV) += pseries-head.S 115 115 src-plat-$(CONFIG_PPC_IBM_CELL_BLADE) += pseries-head.S 116 + src-plat-$(CONFIG_MVME7100) += motload-head.S mvme7100.c 116 117 117 118 src-wlib := $(sort $(src-wlib-y)) 118 119 src-plat := $(sort $(src-plat-y)) ··· 296 295 image-$(CONFIG_TQM8560) += cuImage.tqm8560 297 296 image-$(CONFIG_SBC8548) += cuImage.sbc8548 298 297 image-$(CONFIG_KSI8560) += cuImage.ksi8560 298 + 299 + # Board ports in arch/powerpc/platform/86xx/Kconfig 300 + image-$(CONFIG_MVME7100) += dtbImage.mvme7100 299 301 300 302 # Board ports in arch/powerpc/platform/embedded6xx/Kconfig 301 303 image-$(CONFIG_STORCENTER) += cuImage.storcenter
+153
arch/powerpc/boot/dts/fsl/mvme7100.dts
··· 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"
+11
arch/powerpc/boot/motload-head.S
··· 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
+59
arch/powerpc/boot/mvme7100.c
··· 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 + 25 + static bd_t bd; 26 + 27 + BSS_STACK(16384); 28 + 29 + static 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 + 52 + void 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 + }
+1 -1
arch/powerpc/boot/ppcboot.h
··· 43 43 unsigned long bi_sramstart; /* start of SRAM memory */ 44 44 unsigned long bi_sramsize; /* size of SRAM memory */ 45 45 #if defined(TARGET_8xx) || defined(TARGET_CPM2) || defined(TARGET_85xx) ||\ 46 - defined(TARGET_83xx) 46 + defined(TARGET_83xx) || defined(TARGET_86xx) 47 47 unsigned long bi_immr_base; /* base of IMMR register */ 48 48 #endif 49 49 #if defined(TARGET_PPC_MPC52xx)
+5
arch/powerpc/boot/wrapper
··· 302 302 platformo="$object/fixed-head.o $object/mvme5100.o" 303 303 binary=y 304 304 ;; 305 + mvme7100) 306 + platformo="$object/motload-head.o $object/mvme7100.o" 307 + link_address='0x4000000' 308 + binary=y 309 + ;; 305 310 esac 306 311 307 312 vmz="$tmpdir/`basename \"$kernel\"`.$ext"
+2 -2
arch/powerpc/configs/86xx-hw.config
··· 74 74 CONFIG_SERIAL_8250_DETECT_IRQ=y 75 75 CONFIG_SERIAL_8250_EXTENDED=y 76 76 CONFIG_SERIAL_8250_MANY_PORTS=y 77 - CONFIG_SERIAL_8250_NR_UARTS=2 77 + CONFIG_SERIAL_8250_NR_UARTS=5 78 78 CONFIG_SERIAL_8250_RSA=y 79 - CONFIG_SERIAL_8250_RUNTIME_UARTS=2 79 + CONFIG_SERIAL_8250_RUNTIME_UARTS=5 80 80 CONFIG_SERIAL_8250_SHARE_IRQ=y 81 81 CONFIG_SERIAL_8250=y 82 82 CONFIG_SERIO_LIBPS2=y
+1
arch/powerpc/configs/mpc86xx_basic_defconfig
··· 8 8 CONFIG_MPC8610_HPCD=y 9 9 CONFIG_MPC8641_HPCN=y 10 10 CONFIG_SBC8641D=y 11 + CONFIG_MVME7100=y
+7 -1
arch/powerpc/platforms/86xx/Kconfig
··· 61 61 help 62 62 This option enables support for the GE SBC610. 63 63 64 + config MVME7100 65 + bool "Artesyn MVME7100" 66 + help 67 + This option enables support for the Emerson/Artesyn MVME7100 board. 68 + 64 69 endif 65 70 66 71 config MPC8641 ··· 74 69 select FSL_PCI if PCI 75 70 select PPC_UDBG_16550 76 71 select MPIC 77 - default y if MPC8641_HPCN || SBC8641D || GEF_SBC610 || GEF_SBC310 || GEF_PPC9A 72 + default y if MPC8641_HPCN || SBC8641D || GEF_SBC610 || GEF_SBC310 || GEF_PPC9A \ 73 + || MVME7100 78 74 79 75 config MPC8610 80 76 bool
+1
arch/powerpc/platforms/86xx/Makefile
··· 10 10 obj-$(CONFIG_GEF_SBC610) += gef_sbc610.o 11 11 obj-$(CONFIG_GEF_SBC310) += gef_sbc310.o 12 12 obj-$(CONFIG_GEF_PPC9A) += gef_ppc9a.o 13 + obj-$(CONFIG_MVME7100) += mvme7100.o
+121
arch/powerpc/platforms/86xx/mvme7100.c
··· 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 + */ 44 + static 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 + */ 82 + static 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 + 89 + static 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 + } 103 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB, 104 + mvme7100_usb_host_fixup); 105 + 106 + machine_arch_initcall(mvme7100, mpc86xx_common_publish_devices); 107 + 108 + define_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 + };