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

ARC: [plat-hsdk] initial port for HSDK board

This initial port adds support of ARC HS Development Kit board with some
basic features such serial port, USB, SD/MMC and Ethernet.

Essentially we run Linux kernel on all 4 cores (i.e. utilize SMP) and
heavily use IO Coherency for speeding-up DMA-aware peripherals.

Note as opposed to other ARC boards we link Linux kernel to
0x9000_0000 intentionally because cores 1 and 3 configured with DCCM
situated at our more usual link base 0x8000_0000. We still can use
memory region starting at 0x8000_0000 as we reallocate DCCM in our
platform code.

Note that PAE remapping for DMA clients does not work due to an RTL bug,
so CREG_PAE register must be programmed to all zeroes, otherwise it will
cause problems with DMA to/from peripherals even if PAE40 is not used.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

authored by

Alexey Brodkin and committed by
Vineet Gupta
a518d637 9ed68785

+365 -2
+7
Documentation/devicetree/bindings/arc/hsdk.txt
··· 1 + Synopsys DesignWare ARC HS Development Kit Device Tree Bindings 2 + --------------------------------------------------------------------------- 3 + 4 + ARC HSDK Board with quad-core ARC HS38x4 in silicon. 5 + 6 + Required root node properties: 7 + - compatible = "snps,hsdk";
+1
arch/arc/Kconfig
··· 100 100 source "arch/arc/plat-axs10x/Kconfig" 101 101 #New platform adds here 102 102 source "arch/arc/plat-eznps/Kconfig" 103 + source "arch/arc/plat-hsdk/Kconfig" 103 104 104 105 endmenu 105 106
+1
arch/arc/Makefile
··· 111 111 core-$(CONFIG_ARC_PLAT_TB10X) += arch/arc/plat-tb10x/ 112 112 core-$(CONFIG_ARC_PLAT_AXS10X) += arch/arc/plat-axs10x/ 113 113 core-$(CONFIG_ARC_PLAT_EZNPS) += arch/arc/plat-eznps/ 114 + core-$(CONFIG_ARC_SOC_HSDK) += arch/arc/plat-hsdk/ 114 115 115 116 ifdef CONFIG_ARC_PLAT_EZNPS 116 117 KBUILD_CPPFLAGS += -I$(srctree)/arch/arc/plat-eznps/include
+189
arch/arc/boot/dts/hsdk.dts
··· 1 + /* 2 + * Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com) 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + 9 + /* 10 + * Device Tree for ARC HS Development Kit 11 + */ 12 + /dts-v1/; 13 + 14 + #include <dt-bindings/net/ti-dp83867.h> 15 + 16 + / { 17 + model = "snps,hsdk"; 18 + compatible = "snps,hsdk"; 19 + 20 + #address-cells = <1>; 21 + #size-cells = <1>; 22 + 23 + chosen { 24 + bootargs = "earlycon=uart8250,mmio32,0xf0005000,115200n8 console=ttyS0,115200n8 debug print-fatal-signals=1"; 25 + }; 26 + 27 + cpus { 28 + #address-cells = <1>; 29 + #size-cells = <0>; 30 + 31 + cpu@0 { 32 + device_type = "cpu"; 33 + compatible = "snps,archs38"; 34 + reg = <0>; 35 + clocks = <&core_clk>; 36 + }; 37 + 38 + cpu@1 { 39 + device_type = "cpu"; 40 + compatible = "snps,archs38"; 41 + reg = <1>; 42 + clocks = <&core_clk>; 43 + }; 44 + 45 + cpu@2 { 46 + device_type = "cpu"; 47 + compatible = "snps,archs38"; 48 + reg = <2>; 49 + clocks = <&core_clk>; 50 + }; 51 + 52 + cpu@3 { 53 + device_type = "cpu"; 54 + compatible = "snps,archs38"; 55 + reg = <3>; 56 + clocks = <&core_clk>; 57 + }; 58 + }; 59 + 60 + core_clk: core-clk { 61 + #clock-cells = <0>; 62 + compatible = "fixed-clock"; 63 + clock-frequency = <500000000>; 64 + }; 65 + 66 + cpu_intc: cpu-interrupt-controller { 67 + compatible = "snps,archs-intc"; 68 + interrupt-controller; 69 + #interrupt-cells = <1>; 70 + }; 71 + 72 + idu_intc: idu-interrupt-controller { 73 + compatible = "snps,archs-idu-intc"; 74 + interrupt-controller; 75 + #interrupt-cells = <1>; 76 + interrupt-parent = <&cpu_intc>; 77 + }; 78 + 79 + arcpct: pct { 80 + compatible = "snps,archs-pct"; 81 + }; 82 + 83 + /* TIMER0 with interrupt for clockevent */ 84 + timer { 85 + compatible = "snps,arc-timer"; 86 + interrupts = <16>; 87 + interrupt-parent = <&cpu_intc>; 88 + clocks = <&core_clk>; 89 + }; 90 + 91 + /* 64-bit Global Free Running Counter */ 92 + gfrc { 93 + compatible = "snps,archs-timer-gfrc"; 94 + clocks = <&core_clk>; 95 + }; 96 + 97 + soc { 98 + compatible = "simple-bus"; 99 + #address-cells = <1>; 100 + #size-cells = <1>; 101 + interrupt-parent = <&idu_intc>; 102 + 103 + ranges = <0x00000000 0xf0000000 0x10000000>; 104 + 105 + serial: serial@5000 { 106 + compatible = "snps,dw-apb-uart"; 107 + reg = <0x5000 0x100>; 108 + clock-frequency = <33330000>; 109 + interrupts = <6>; 110 + baud = <115200>; 111 + reg-shift = <2>; 112 + reg-io-width = <4>; 113 + }; 114 + 115 + gmacclk: gmacclk { 116 + compatible = "fixed-clock"; 117 + clock-frequency = <400000000>; 118 + #clock-cells = <0>; 119 + }; 120 + 121 + mmcclk_ciu: mmcclk-ciu { 122 + compatible = "fixed-clock"; 123 + clock-frequency = <100000000>; 124 + #clock-cells = <0>; 125 + }; 126 + 127 + mmcclk_biu: mmcclk-biu { 128 + compatible = "fixed-clock"; 129 + clock-frequency = <400000000>; 130 + #clock-cells = <0>; 131 + }; 132 + 133 + ethernet@8000 { 134 + #interrupt-cells = <1>; 135 + compatible = "snps,dwmac"; 136 + reg = <0x8000 0x2000>; 137 + interrupts = <10>; 138 + interrupt-names = "macirq"; 139 + phy-mode = "rgmii"; 140 + snps,pbl = <32>; 141 + clocks = <&gmacclk>; 142 + clock-names = "stmmaceth"; 143 + phy-handle = <&phy0>; 144 + 145 + mdio { 146 + #address-cells = <1>; 147 + #size-cells = <0>; 148 + compatible = "snps,dwmac-mdio"; 149 + phy0: ethernet-phy@0 { 150 + reg = <0>; 151 + ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>; 152 + ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>; 153 + ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>; 154 + }; 155 + }; 156 + }; 157 + 158 + ohci@60000 { 159 + compatible = "snps,hsdk-v1.0-ohci", "generic-ohci"; 160 + reg = <0x60000 0x100>; 161 + interrupts = <15>; 162 + }; 163 + 164 + ehci@40000 { 165 + compatible = "snps,hsdk-v1.0-ehci", "generic-ehci"; 166 + reg = <0x40000 0x100>; 167 + interrupts = <15>; 168 + }; 169 + 170 + mmc@a000 { 171 + compatible = "altr,socfpga-dw-mshc"; 172 + reg = <0xa000 0x400>; 173 + num-slots = <1>; 174 + fifo-depth = <16>; 175 + card-detect-delay = <200>; 176 + clocks = <&mmcclk_biu>, <&mmcclk_ciu>; 177 + clock-names = "biu", "ciu"; 178 + interrupts = <12>; 179 + bus-width = <4>; 180 + }; 181 + }; 182 + 183 + memory@80000000 { 184 + #address-cells = <1>; 185 + #size-cells = <1>; 186 + device_type = "memory"; 187 + reg = <0x80000000 0x40000000>; /* 1 GiB */ 188 + }; 189 + };
+80
arch/arc/configs/hsdk_defconfig
··· 1 + CONFIG_DEFAULT_HOSTNAME="ARCLinux" 2 + CONFIG_SYSVIPC=y 3 + # CONFIG_CROSS_MEMORY_ATTACH is not set 4 + CONFIG_NO_HZ_IDLE=y 5 + CONFIG_HIGH_RES_TIMERS=y 6 + CONFIG_IKCONFIG=y 7 + CONFIG_IKCONFIG_PROC=y 8 + CONFIG_NAMESPACES=y 9 + # CONFIG_UTS_NS is not set 10 + # CONFIG_PID_NS is not set 11 + CONFIG_BLK_DEV_INITRD=y 12 + CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" 13 + CONFIG_EMBEDDED=y 14 + CONFIG_PERF_EVENTS=y 15 + # CONFIG_VM_EVENT_COUNTERS is not set 16 + # CONFIG_COMPAT_BRK is not set 17 + CONFIG_SLAB=y 18 + CONFIG_MODULES=y 19 + CONFIG_MODULE_UNLOAD=y 20 + CONFIG_ARC_SOC_HSDK=y 21 + CONFIG_ISA_ARCV2=y 22 + CONFIG_SMP=y 23 + CONFIG_LINUX_LINK_BASE=0x90000000 24 + CONFIG_LINUX_RAM_BASE=0x80000000 25 + CONFIG_ARC_BUILTIN_DTB_NAME="hsdk" 26 + CONFIG_PREEMPT=y 27 + # CONFIG_COMPACTION is not set 28 + CONFIG_NET=y 29 + CONFIG_PACKET=y 30 + CONFIG_UNIX=y 31 + CONFIG_INET=y 32 + CONFIG_DEVTMPFS=y 33 + # CONFIG_STANDALONE is not set 34 + # CONFIG_PREVENT_FIRMWARE_BUILD is not set 35 + # CONFIG_FIRMWARE_IN_KERNEL is not set 36 + CONFIG_SCSI=y 37 + CONFIG_BLK_DEV_SD=y 38 + CONFIG_NETDEVICES=y 39 + CONFIG_STMMAC_ETH=y 40 + CONFIG_MICREL_PHY=y 41 + CONFIG_INPUT_EVDEV=y 42 + # CONFIG_INPUT_KEYBOARD is not set 43 + # CONFIG_INPUT_MOUSE is not set 44 + # CONFIG_SERIO is not set 45 + # CONFIG_LEGACY_PTYS is not set 46 + CONFIG_SERIAL_8250=y 47 + CONFIG_SERIAL_8250_CONSOLE=y 48 + CONFIG_SERIAL_8250_DW=y 49 + CONFIG_SERIAL_OF_PLATFORM=y 50 + # CONFIG_HW_RANDOM is not set 51 + # CONFIG_HWMON is not set 52 + CONFIG_FB=y 53 + CONFIG_FB_UDL=y 54 + CONFIG_FRAMEBUFFER_CONSOLE=y 55 + CONFIG_USB=y 56 + CONFIG_USB_EHCI_HCD=y 57 + CONFIG_USB_EHCI_HCD_PLATFORM=y 58 + CONFIG_USB_OHCI_HCD=y 59 + CONFIG_USB_OHCI_HCD_PLATFORM=y 60 + CONFIG_USB_STORAGE=y 61 + CONFIG_MMC=y 62 + CONFIG_MMC_SDHCI=y 63 + CONFIG_MMC_SDHCI_PLTFM=y 64 + CONFIG_MMC_DW=y 65 + # CONFIG_IOMMU_SUPPORT is not set 66 + CONFIG_EXT3_FS=y 67 + CONFIG_VFAT_FS=y 68 + CONFIG_TMPFS=y 69 + CONFIG_NFS_FS=y 70 + CONFIG_NLS_CODEPAGE_437=y 71 + CONFIG_NLS_ISO8859_1=y 72 + # CONFIG_ENABLE_WARN_DEPRECATED is not set 73 + # CONFIG_ENABLE_MUST_CHECK is not set 74 + CONFIG_STRIP_ASM_SYMS=y 75 + CONFIG_LOCKUP_DETECTOR=y 76 + CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10 77 + # CONFIG_SCHED_DEBUG is not set 78 + # CONFIG_DEBUG_PREEMPT is not set 79 + # CONFIG_FTRACE is not set 80 + CONFIG_CRYPTO_ECHAINIV=y
+3 -2
arch/arc/kernel/devtree.c
··· 29 29 { 30 30 if (of_flat_dt_is_compatible(dt_root, "abilis,arc-tb10x")) 31 31 arc_base_baud = 166666666; /* Fixed 166.6MHz clk (TB10x) */ 32 - else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp")) 33 - arc_base_baud = 33333333; /* Fixed 33MHz clk (AXS10x) */ 32 + else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp") || 33 + of_flat_dt_is_compatible(dt_root, "snps,hsdk")) 34 + arc_base_baud = 33333333; /* Fixed 33MHz clk (AXS10x & HSDK) */ 34 35 else if (of_flat_dt_is_compatible(dt_root, "ezchip,arc-nps")) 35 36 arc_base_baud = 800000000; /* Fixed 800MHz clk (NPS) */ 36 37 else
+9
arch/arc/plat-hsdk/Kconfig
··· 1 + # Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com) 2 + # 3 + # This program is free software; you can redistribute it and/or modify 4 + # it under the terms of the GNU General Public License version 2 as 5 + # published by the Free Software Foundation. 6 + # 7 + 8 + menuconfig ARC_SOC_HSDK 9 + bool "ARC HS Development Kit SOC"
+9
arch/arc/plat-hsdk/Makefile
··· 1 + # 2 + # Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com) 3 + # 4 + # This program is free software; you can redistribute it and/or modify 5 + # it under the terms of the GNU General Public License version 2 as 6 + # published by the Free Software Foundation. 7 + # 8 + 9 + obj-y := platform.o
+66
arch/arc/plat-hsdk/platform.c
··· 1 + /* 2 + * ARC HSDK Platform support code 3 + * 4 + * Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com) 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + #include <linux/init.h> 12 + #include <linux/smp.h> 13 + #include <asm/arcregs.h> 14 + #include <asm/io.h> 15 + #include <asm/mach_desc.h> 16 + 17 + #define ARC_CCM_UNUSED_ADDR 0x60000000 18 + 19 + static void __init hsdk_init_per_cpu(unsigned int cpu) 20 + { 21 + /* 22 + * By default ICCM is mapped to 0x7z while this area is used for 23 + * kernel virtual mappings, so move it to currently unused area. 24 + */ 25 + if (cpuinfo_arc700[cpu].iccm.sz) 26 + write_aux_reg(ARC_REG_AUX_ICCM, ARC_CCM_UNUSED_ADDR); 27 + 28 + /* 29 + * By default DCCM is mapped to 0x8z while this area is used by kernel, 30 + * so move it to currently unused area. 31 + */ 32 + if (cpuinfo_arc700[cpu].dccm.sz) 33 + write_aux_reg(ARC_REG_AUX_DCCM, ARC_CCM_UNUSED_ADDR); 34 + } 35 + 36 + #define ARC_PERIPHERAL_BASE 0xf0000000 37 + #define CREG_BASE (ARC_PERIPHERAL_BASE + 0x1000) 38 + #define CREG_PAE (CREG_BASE + 0x180) 39 + #define CREG_PAE_UPDATE (CREG_BASE + 0x194) 40 + 41 + static void __init hsdk_init_early(void) 42 + { 43 + /* 44 + * PAE remapping for DMA clients does not work due to an RTL bug, so 45 + * CREG_PAE register must be programmed to all zeroes, otherwise it 46 + * will cause problems with DMA to/from peripherals even if PAE40 is 47 + * not used. 48 + */ 49 + 50 + /* Default is 1, which means "PAE offset = 4GByte" */ 51 + writel_relaxed(0, (void __iomem *) CREG_PAE); 52 + 53 + /* Really apply settings made above */ 54 + writel(1, (void __iomem *) CREG_PAE_UPDATE); 55 + } 56 + 57 + static const char *hsdk_compat[] __initconst = { 58 + "snps,hsdk", 59 + NULL, 60 + }; 61 + 62 + MACHINE_START(SIMULATION, "hsdk") 63 + .dt_compat = hsdk_compat, 64 + .init_early = hsdk_init_early, 65 + .init_per_cpu = hsdk_init_per_cpu, 66 + MACHINE_END