linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3 v6] hsdk: initial port for HSDK board
@ 2017-06-26 15:11 Eugeniy Paltsev
  2017-06-26 15:11 ` [PATCH 1/3 v6] ARC: Set IO-coherency aperture base to LINUX_LINK_BASE Eugeniy Paltsev
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Eugeniy Paltsev @ 2017-06-26 15:11 UTC (permalink / raw)
  To: linux-snps-arc
  Cc: linux-kernel, Vineet Gupta, Alexey Brodkin, Rob Herring,
	devicetree, Eugeniy Paltsev

This series introduces some required preparations and initial
port of ARC HS Development Kit board with some basic features such
as 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.

Note that two patches of this series ("ARC: Decouple linux kernel memory
address and link address" and "ARC: Set IO-coherency aperture base to 
LINUX_LINK_BASE") are prerequisites for HDSK support as its hardware
configuration differs quite a bit from what we used to have on other
ARC boards.

Alexey Brodkin (1):
  ARC: hsdk: initial port for HSDK board

Eugeniy Paltsev (2):
  ARC: Set IO-coherency aperture base to LINUX_LINK_BASE
  ARC: Decouple linux kernel memory address and link address

Changes v5 -> v6:
 * Add support of USB-to-HDMI adapter
 * Revert removing of reseting CREG_PAE bits.
   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.

Changes v4 -> v5:
 * Move DCCM outside of 0x8000_0000 adress at kernel boot time.
 * Decouple linux kernel memory address and link address.
 * Remove hardcoding of IO-coherency aperture base.
 * Remove reseting CREG_PAE bits as default value is suitable for us.

Changes v3 -> v4:
 * Removed senseless "ranges" property from "memory" node in .dts
 * Refined early-boot code:
    - ICCM relocation should be done on each and every core that sports ICCM
      so we leave it in init_per_cpu(). Even though init_per_cpu() gets called
      on the master core pretty late still it is way much earlier than that
      moment when it might affect us - as it only huts us when addresses in
      0x7z-0x7fff_ffff range are used, i.e. virtual addresses that we don't
      use during init. This also makes code much cleaner compared to
      additional check in case of master etc.

Changes v2 -> v3:
 * Added Rob to Cc-list for DT binding approval
 * Removed mention of prerequsite patch from commit message
 * Removed hsdk_early_init() as hsdk_init_per_cpu() is executed on
   all cores anyways including master
 * Cleaned-up board's .dts a little bit
 * Removed CONFIG_DP83867_PHY from defconfig as it was only used on
   FPGA prototype, on real board we use MICREL PHY which is still selected

Changes v1 -> v2:
 * Update copyright year from 2016 to more up to date 2017
 * Merge early UART clock with AXS10x as in both cases that's 33.3 MHz
 * Bump memory to 1Gb, we don't use more for now because it requires
   trickier IOC setup and usage
 * Update early platform init code:
    - Added missing fixup_pae_regs() to per-cpu init
    - Mark most of functions as "static __init"
    - Use writel_relaxed() for setting CREG_PAE, CREG_PAE_UPDATE is still
      written with stronger writel() since we don't want reordering to happen,
      otherwise value written to CREG_PAE won't be applied

 Documentation/devicetree/bindings/arc/hsdk.txt |   7 ++
 arch/arc/Kconfig                               |   6 +
 arch/arc/Makefile                              |   1 +
 arch/arc/boot/dts/hsdk.dts                     | 150 +++++++++++++++++++++++++
 arch/arc/boot/dts/include/dt-bindings          |   1 +
 arch/arc/configs/hsdk_defconfig                |  72 ++++++++++++
 arch/arc/include/asm/page.h                    |   2 +-
 arch/arc/kernel/devtree.c                      |   5 +-
 arch/arc/mm/cache.c                            |  33 ++++--
 arch/arc/mm/init.c                             |   6 +-
 arch/arc/plat-hsdk/Kconfig                     |  12 ++
 arch/arc/plat-hsdk/Makefile                    |   9 ++
 arch/arc/plat-hsdk/platform.c                  |  77 +++++++++++++
 13 files changed, 366 insertions(+), 15 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arc/hsdk.txt
 create mode 100644 arch/arc/boot/dts/hsdk.dts
 create mode 120000 arch/arc/boot/dts/include/dt-bindings
 create mode 100644 arch/arc/configs/hsdk_defconfig
 create mode 100644 arch/arc/plat-hsdk/Kconfig
 create mode 100644 arch/arc/plat-hsdk/Makefile
 create mode 100644 arch/arc/plat-hsdk/platform.c

-- 
2.9.3

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/3 v6] ARC: Set IO-coherency aperture base to LINUX_LINK_BASE
  2017-06-26 15:11 [PATCH 0/3 v6] hsdk: initial port for HSDK board Eugeniy Paltsev
@ 2017-06-26 15:11 ` Eugeniy Paltsev
  2017-06-26 15:11 ` [PATCH 2/3 v6] ARC: Decouple linux kernel memory address and link address Eugeniy Paltsev
  2017-06-26 15:11 ` [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board Eugeniy Paltsev
  2 siblings, 0 replies; 10+ messages in thread
From: Eugeniy Paltsev @ 2017-06-26 15:11 UTC (permalink / raw)
  To: linux-snps-arc
  Cc: linux-kernel, Vineet Gupta, Alexey Brodkin, Rob Herring,
	devicetree, Eugeniy Paltsev

Most of the time we indeed use the one and only LINUX_LINK_BASE
set to 0x8000_0000. But there might be good reasons to move
the kernel to another location like 0x9z etc.

And we want IOC aperture to cover entire area used by the kernel,
so let's make its base matching link base and add required asserts:
checking IOC aperture base address and size to be supported by IOC.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
 arch/arc/mm/cache.c | 33 ++++++++++++++++++++++++---------
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c
index a867575..383ff77 100644
--- a/arch/arc/mm/cache.c
+++ b/arch/arc/mm/cache.c
@@ -1083,7 +1083,8 @@ SYSCALL_DEFINE3(cacheflush, uint32_t, start, uint32_t, sz, uint32_t, flags)
  */
 noinline void __init arc_ioc_setup(void)
 {
-	unsigned int ap_sz;
+	unsigned int ap_base;
+	long ap_size;
 
 	/* Flush + invalidate + disable L1 dcache */
 	__dc_disable();
@@ -1092,18 +1093,32 @@ noinline void __init arc_ioc_setup(void)
 	if (read_aux_reg(ARC_REG_SLC_BCR))
 		slc_entire_op(OP_FLUSH_N_INV);
 
-	/* IOC Aperture start: TDB: handle non default CONFIG_LINUX_LINK_BASE */
-	write_aux_reg(ARC_REG_IO_COH_AP0_BASE, 0x80000);
-
 	/*
-	 * IOC Aperture size:
-	 *   decoded as 2 ^ (SIZE + 2) KB: so setting 0x11 implies 512M
-	 * TBD: fix for PGU + 1GB of low mem
+	 * IOC Aperture size is equal to memory size.
+	 * TBD: fix for PGU + 1GiB of low mem
 	 * TBD: fix for PAE
 	 */
-	ap_sz = order_base_2(arc_get_mem_sz()/1024) - 2;
-	write_aux_reg(ARC_REG_IO_COH_AP0_SIZE, ap_sz);
+	ap_size = arc_get_mem_sz();
+
+	if (!is_power_of_2(ap_size) || ap_size < 4096)
+		panic("IOC Aperture size must be power of 2 larger than 4KiB");
+
+	/*
+	 * IOC Aperture size decoded as 2 ^ (SIZE + 2) KiB,
+	 * so setting 0x11 implies 512MiB, 0x12 implies 1G...
+	 */
+	write_aux_reg(ARC_REG_IO_COH_AP0_SIZE, order_base_2(ap_size / 1024) - 2);
+
+	/*
+	 * For now we assume IOC aperture to cover all the memory used by the
+	 * kernel.
+	 */
+	ap_base = CONFIG_LINUX_LINK_BASE;
+
+	if (ap_base % ap_size != 0)
+		panic("IOC Aperture start must be aligned to the size of the aperture");
 
+	write_aux_reg(ARC_REG_IO_COH_AP0_BASE, ap_base >> 12);
 	write_aux_reg(ARC_REG_IO_COH_PARTIAL, 1);
 	write_aux_reg(ARC_REG_IO_COH_ENABLE, 1);
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/3 v6] ARC: Decouple linux kernel memory address and link address
  2017-06-26 15:11 [PATCH 0/3 v6] hsdk: initial port for HSDK board Eugeniy Paltsev
  2017-06-26 15:11 ` [PATCH 1/3 v6] ARC: Set IO-coherency aperture base to LINUX_LINK_BASE Eugeniy Paltsev
@ 2017-06-26 15:11 ` Eugeniy Paltsev
  2017-06-26 15:11 ` [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board Eugeniy Paltsev
  2 siblings, 0 replies; 10+ messages in thread
From: Eugeniy Paltsev @ 2017-06-26 15:11 UTC (permalink / raw)
  To: linux-snps-arc
  Cc: linux-kernel, Vineet Gupta, Alexey Brodkin, Rob Herring,
	devicetree, Eugeniy Paltsev

We faced with problem when we tried to utilize 1G DRAM by linux on
HSDK.

We can't use our usual kernel memory address (0x80000000) like on
AXS103 because of DCCM memory bank located at exactly same
address (0x80000000)
But we can't simply move kernel memory address to another address (like
0x90000000) because IOC base address must be aligned to the
size of the aperture as specified in the IOC size register.

So we had to use 1G aligned address for kernel memory.

We can't use 0x00000000 or 0x40000000 addresses because addresses
lover then 0x80000000 are MMU-translated.
We can't use 0xB0000000 address because we can define a volatile
uncached region only from AUX_NON_VOLATILE_LIMIT to the
0xFFFFFFFF. (the end of region is hardcoded)

So, the decision is to link kernel to 0x90000000, but use
0x80000000-0xBFFFFFFF memory region and reallocate DCCM in our platform
code.
This patch only makes possible to set kernel memory address not equal to
kernel link address.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
 arch/arc/Kconfig            | 5 +++++
 arch/arc/include/asm/page.h | 2 +-
 arch/arc/mm/cache.c         | 2 +-
 arch/arc/mm/init.c          | 6 +++---
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index a545969..75e5276 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -430,6 +430,11 @@ config LINUX_LINK_BASE
 	  However some customers have peripherals mapped at this addr, so
 	  Linux needs to be scooted a bit.
 	  If you don't know what the above means, leave this setting alone.
+
+config KERNEL_RAM_BASE_ADDRESS
+	hex "Linux ram base address"
+	default LINUX_LINK_BASE
+	help
 	  This needs to match memory start address specified in Device Tree
 
 config HIGHMEM
diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h
index 296c342..777f676 100644
--- a/arch/arc/include/asm/page.h
+++ b/arch/arc/include/asm/page.h
@@ -85,7 +85,7 @@ typedef pte_t * pgtable_t;
  */
 #define virt_to_pfn(kaddr)	(__pa(kaddr) >> PAGE_SHIFT)
 
-#define ARCH_PFN_OFFSET		virt_to_pfn(CONFIG_LINUX_LINK_BASE)
+#define ARCH_PFN_OFFSET		virt_to_pfn(CONFIG_KERNEL_RAM_BASE_ADDRESS)
 
 #ifdef CONFIG_FLATMEM
 #define pfn_valid(pfn)		(((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c
index 383ff77..f303274 100644
--- a/arch/arc/mm/cache.c
+++ b/arch/arc/mm/cache.c
@@ -1113,7 +1113,7 @@ noinline void __init arc_ioc_setup(void)
 	 * For now we assume IOC aperture to cover all the memory used by the
 	 * kernel.
 	 */
-	ap_base = CONFIG_LINUX_LINK_BASE;
+	ap_base = CONFIG_KERNEL_RAM_BASE_ADDRESS;
 
 	if (ap_base % ap_size != 0)
 		panic("IOC Aperture start must be aligned to the size of the aperture");
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index 8c9415e..f84cba2 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -26,7 +26,7 @@ pgd_t swapper_pg_dir[PTRS_PER_PGD] __aligned(PAGE_SIZE);
 char empty_zero_page[PAGE_SIZE] __aligned(PAGE_SIZE);
 EXPORT_SYMBOL(empty_zero_page);
 
-static const unsigned long low_mem_start = CONFIG_LINUX_LINK_BASE;
+static const unsigned long low_mem_start = CONFIG_KERNEL_RAM_BASE_ADDRESS;
 static unsigned long low_mem_sz;
 
 #ifdef CONFIG_HIGHMEM
@@ -63,7 +63,7 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
 
 	if (!low_mem_sz) {
 		if (base != low_mem_start)
-			panic("CONFIG_LINUX_LINK_BASE != DT memory { }");
+			panic("CONFIG_KERNEL_RAM_BASE_ADDRESS != DT memory { }");
 
 		low_mem_sz = size;
 		in_use = 1;
@@ -161,7 +161,7 @@ void __init setup_arch_memory(void)
 	 * We can't use the helper free_area_init(zones[]) because it uses
 	 * PAGE_OFFSET to compute the @min_low_pfn which would be wrong
 	 * when our kernel doesn't start at PAGE_OFFSET, i.e.
-	 * PAGE_OFFSET != CONFIG_LINUX_LINK_BASE
+	 * PAGE_OFFSET != CONFIG_KERNEL_RAM_BASE_ADDRESS
 	 */
 	free_area_init_node(0,			/* node-id */
 			    zones_size,		/* num pages per zone */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board
  2017-06-26 15:11 [PATCH 0/3 v6] hsdk: initial port for HSDK board Eugeniy Paltsev
  2017-06-26 15:11 ` [PATCH 1/3 v6] ARC: Set IO-coherency aperture base to LINUX_LINK_BASE Eugeniy Paltsev
  2017-06-26 15:11 ` [PATCH 2/3 v6] ARC: Decouple linux kernel memory address and link address Eugeniy Paltsev
@ 2017-06-26 15:11 ` Eugeniy Paltsev
  2017-06-26 15:51   ` Rob Herring
  2017-06-29  7:27   ` Vineet Gupta
  2 siblings, 2 replies; 10+ messages in thread
From: Eugeniy Paltsev @ 2017-06-26 15:11 UTC (permalink / raw)
  To: linux-snps-arc
  Cc: linux-kernel, Vineet Gupta, Alexey Brodkin, Rob Herring,
	devicetree, Eugeniy Paltsev

From: Alexey Brodkin <abrodkin@synopsys.com>

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.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
 Documentation/devicetree/bindings/arc/hsdk.txt |   7 ++
 arch/arc/Kconfig                               |   1 +
 arch/arc/Makefile                              |   1 +
 arch/arc/boot/dts/hsdk.dts                     | 150 +++++++++++++++++++++++++
 arch/arc/configs/hsdk_defconfig                |  75 +++++++++++++
 arch/arc/kernel/devtree.c                      |   5 +-
 arch/arc/plat-hsdk/Kconfig                     |  12 ++
 arch/arc/plat-hsdk/Makefile                    |   9 ++
 arch/arc/plat-hsdk/platform.c                  |  79 +++++++++++++
 9 files changed, 337 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arc/hsdk.txt
 create mode 100644 arch/arc/boot/dts/hsdk.dts
 create mode 100644 arch/arc/configs/hsdk_defconfig
 create mode 100644 arch/arc/plat-hsdk/Kconfig
 create mode 100644 arch/arc/plat-hsdk/Makefile
 create mode 100644 arch/arc/plat-hsdk/platform.c

diff --git a/Documentation/devicetree/bindings/arc/hsdk.txt b/Documentation/devicetree/bindings/arc/hsdk.txt
new file mode 100644
index 0000000..be50654
--- /dev/null
+++ b/Documentation/devicetree/bindings/arc/hsdk.txt
@@ -0,0 +1,7 @@
+Synopsys DesignWare ARC HS Development Kit Device Tree Bindings
+---------------------------------------------------------------------------
+
+ARC HSDK Board with quad-core ARC HS38x4 in silicon.
+
+Required root node properties:
+    - compatible = "snps,hsdk";
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 75e5276..825a112 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -101,6 +101,7 @@ source "arch/arc/plat-tb10x/Kconfig"
 source "arch/arc/plat-axs10x/Kconfig"
 #New platform adds here
 source "arch/arc/plat-eznps/Kconfig"
+source "arch/arc/plat-hsdk/Kconfig"
 
 endmenu
 
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index 44ef35d..55ca925 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -111,6 +111,7 @@ core-$(CONFIG_ARC_PLAT_SIM)	+= arch/arc/plat-sim/
 core-$(CONFIG_ARC_PLAT_TB10X)	+= arch/arc/plat-tb10x/
 core-$(CONFIG_ARC_PLAT_AXS10X)	+= arch/arc/plat-axs10x/
 core-$(CONFIG_ARC_PLAT_EZNPS)	+= arch/arc/plat-eznps/
+core-$(CONFIG_ARC_PLAT_HSDK)	+= arch/arc/plat-hsdk/
 
 ifdef CONFIG_ARC_PLAT_EZNPS
 KBUILD_CPPFLAGS += -I$(srctree)/arch/arc/plat-eznps/include
diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts
new file mode 100644
index 0000000..6a4e471
--- /dev/null
+++ b/arch/arc/boot/dts/hsdk.dts
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * Device Tree for ARC HS Development Kit
+ */
+/dts-v1/;
+
+/include/ "skeleton_hs_idu.dtsi"
+
+#include <dt-bindings/net/ti-dp83867.h>
+
+/ {
+       model = "snps,hsdk";
+       compatible = "snps,hsdk";
+
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       chosen {
+               bootargs = "earlycon=uart8250,mmio32,0xf0005000,115200n8 console=ttyS0,115200n8 debug print-fatal-signals=1";
+       };
+
+       cpu {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               interrupt-parent = <&core_intc>;
+
+               core_clk: core_clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <1000000000>;
+               };
+
+               core_intc: archs-intc@cpu {
+                       compatible = "snps,archs-intc";
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+               };
+
+               idu_intc: idu-interrupt-controller {
+                       compatible = "snps,archs-idu-intc";
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+               };
+
+               arcpct0: pct {
+                       compatible = "snps,archs-pct";
+               };
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               interrupt-parent = <&idu_intc>;
+
+               ranges = <0x00000000 0xf0000000 0x10000000>;
+
+               uart: dw-apb-uart@5000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x5000 0x100>;
+                       clock-frequency = <33330000>;
+                       interrupts = <6>;
+                       baud = <115200>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+               };
+
+               gmacclk: gmacclk {
+                       compatible = "fixed-clock";
+                       clock-frequency = <400000000>;
+                       #clock-cells = <0>;
+               };
+
+               mmcclk_ciu: mmcclk_ciu {
+                       compatible = "fixed-clock";
+                       clock-frequency = <100000000>;
+                       #clock-cells = <0>;
+               };
+
+               mmcclk_biu: mmcclk_biu {
+                       compatible = "fixed-clock";
+                       clock-frequency = <400000000>;
+                       #clock-cells = <0>;
+               };
+
+               ethernet@8000 {
+                       #interrupt-cells = <1>;
+                       compatible = "snps,dwmac";
+                       reg = <0x8000 0x2000>;
+                       interrupts = <10>;
+                       interrupt-names = "macirq";
+                       phy-mode = "rgmii";
+                       snps,pbl = <32>;
+                       clocks = <&gmacclk>;
+                       clock-names = "stmmaceth";
+                       phy-handle = <&phy0>;
+
+                       mdio0 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "snps,dwmac-mdio";
+                               phy0: ethernet-phy@0 {
+                                       reg = <0>;
+                                       ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
+                                       ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
+                                       ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
+                               };
+                       };
+               };
+
+               ohci@60000 {
+                       compatible = "generic-ohci";
+                       reg = <0x60000 0x100>;
+                       interrupts = <15>;
+               };
+
+               ehci@40000 {
+                       compatible = "generic-ehci";
+                       reg = <0x40000 0x100>;
+                       interrupts = <15>;
+               };
+
+               mmc@a000 {
+                       compatible = "altr,socfpga-dw-mshc";
+                       reg = <0xa000 0x400>;
+                       num-slots = <1>;
+                       fifo-depth = <16>;
+                       card-detect-delay = <200>;
+                       clocks = <&mmcclk_biu>, <&mmcclk_ciu>;
+                       clock-names = "biu", "ciu";
+                       interrupts = <12>;
+                       bus-width = <4>;
+               };
+       };
+
+       memory {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               device_type = "memory";
+               reg = <0x80000000 0x40000000>;  /* 1 GiB */
+       };
+};
diff --git a/arch/arc/configs/hsdk_defconfig b/arch/arc/configs/hsdk_defconfig
new file mode 100644
index 0000000..53bc9f3
--- /dev/null
+++ b/arch/arc/configs/hsdk_defconfig
@@ -0,0 +1,75 @@
+CONFIG_DEFAULT_HOSTNAME="ARCLinux"
+CONFIG_SYSVIPC=y
+# CONFIG_CROSS_MEMORY_ATTACH is not set
+CONFIG_NO_HZ_IDLE=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+# CONFIG_PID_NS is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/"
+CONFIG_EMBEDDED=y
+CONFIG_PERF_EVENTS=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+CONFIG_ARC_PLAT_HSDK=y
+CONFIG_ISA_ARCV2=y
+CONFIG_SMP=y
+CONFIG_LINUX_LINK_BASE=0x90000000
+CONFIG_KERNEL_RAM_BASE_ADDRESS=0x80000000
+CONFIG_ARC_BUILTIN_DTB_NAME="hsdk"
+CONFIG_PREEMPT=y
+# CONFIG_COMPACTION is not set
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_DEVTMPFS=y
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FIRMWARE_IN_KERNEL is not set
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_NETDEVICES=y
+CONFIG_STMMAC_ETH=y
+CONFIG_MICREL_PHY=y
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_DW=y
+CONFIG_SERIAL_OF_PLATFORM=y
+# CONFIG_HW_RANDOM is not set
+# CONFIG_HWMON is not set
+CONFIG_FB=y
+CONFIG_FB_UDL=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
+CONFIG_USB_STORAGE=y
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_PLTFM=y
+CONFIG_MMC_DW=y
+# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_EXT3_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_STRIP_ASM_SYMS=y
+CONFIG_LOCKUP_DETECTOR=y
+CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_PREEMPT is not set
+# CONFIG_FTRACE is not set
diff --git a/arch/arc/kernel/devtree.c b/arch/arc/kernel/devtree.c
index 3b67f53..521ef35 100644
--- a/arch/arc/kernel/devtree.c
+++ b/arch/arc/kernel/devtree.c
@@ -29,8 +29,9 @@ static void __init arc_set_early_base_baud(unsigned long dt_root)
 {
 	if (of_flat_dt_is_compatible(dt_root, "abilis,arc-tb10x"))
 		arc_base_baud = 166666666;	/* Fixed 166.6MHz clk (TB10x) */
-	else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp"))
-		arc_base_baud = 33333333;	/* Fixed 33MHz clk (AXS10x) */
+	else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp") ||
+		 of_flat_dt_is_compatible(dt_root, "snps,hsdk"))
+		arc_base_baud = 33333333;	/* Fixed 33MHz clk (AXS10x & HSDK) */
 	else if (of_flat_dt_is_compatible(dt_root, "ezchip,arc-nps"))
 		arc_base_baud = 800000000;      /* Fixed 800MHz clk (NPS) */
 	else
diff --git a/arch/arc/plat-hsdk/Kconfig b/arch/arc/plat-hsdk/Kconfig
new file mode 100644
index 0000000..29dffed
--- /dev/null
+++ b/arch/arc/plat-hsdk/Kconfig
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+
+menuconfig ARC_PLAT_HSDK
+       bool "ARC HS Development Kit board"
+       help
+         Support for ARC HS Development Kit board
diff --git a/arch/arc/plat-hsdk/Makefile b/arch/arc/plat-hsdk/Makefile
new file mode 100644
index 0000000..9a50c51
--- /dev/null
+++ b/arch/arc/plat-hsdk/Makefile
@@ -0,0 +1,9 @@
+#
+# Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+
+obj-y := platform.o
diff --git a/arch/arc/plat-hsdk/platform.c b/arch/arc/plat-hsdk/platform.c
new file mode 100644
index 0000000..5943d23
--- /dev/null
+++ b/arch/arc/plat-hsdk/platform.c
@@ -0,0 +1,79 @@
+/*
+ * ARC HSDK Platform support code
+ *
+ * Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/smp.h>
+#include <asm/arcregs.h>
+#include <asm/io.h>
+#include <asm/mach_desc.h>
+
+#define ARC_CCM_UNUSED_ADDR	0x60000000
+
+/*
+ * By default ICCM is mapped to 0x7z while this area is used for
+ * Virtual kernel mappings, so move it to currently unused area.
+ */
+static void __init relocate_iccm(void)
+{
+	if (cpuinfo_arc700[smp_processor_id()].iccm.sz)
+		write_aux_reg(ARC_REG_AUX_ICCM, ARC_CCM_UNUSED_ADDR);
+}
+
+/*
+ * By default DCCM is mapped to 0x8z while this area is used by kernel,
+ * so move it to currently unused area.
+ */
+static void __init relocate_dccm(void)
+{
+	if (cpuinfo_arc700[smp_processor_id()].dccm.sz)
+		write_aux_reg(ARC_REG_AUX_DCCM, ARC_CCM_UNUSED_ADDR);
+}
+
+static void __init hsdk_init_per_cpu(unsigned int cpu)
+{
+	relocate_iccm();
+	relocate_dccm();
+}
+
+/*
+ * 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.
+ */
+static void __init fixup_pae_regs(void)
+{
+#define ARC_PERIPHERAL_BASE	0xf0000000
+#define	CREG_BASE		(ARC_PERIPHERAL_BASE + 0x1000)
+#define	CREG_PAE		(CREG_BASE + 0x180)
+#define	CREG_PAE_UPDATE		(CREG_BASE + 0x194)
+
+	/* Default is 1, which means "PAE offset = 4GByte" */
+	writel_relaxed(0, (void __iomem *) CREG_PAE);
+
+	/* Really apply settings made above */
+	writel(1, (void __iomem *) CREG_PAE_UPDATE);
+}
+
+static void __init hsdk_early_init(void)
+{
+	fixup_pae_regs();
+}
+
+static const char *hsdk_compat[] __initconst = {
+	"snps,hsdk",
+	NULL,
+};
+
+MACHINE_START(SIMULATION, "hsdk")
+	.dt_compat	= hsdk_compat,
+	.init_early     = hsdk_early_init,
+	.init_per_cpu	= hsdk_init_per_cpu,
+MACHINE_END
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board
  2017-06-26 15:11 ` [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board Eugeniy Paltsev
@ 2017-06-26 15:51   ` Rob Herring
  2017-06-26 16:25     ` Alexey Brodkin
  2017-06-29  7:27   ` Vineet Gupta
  1 sibling, 1 reply; 10+ messages in thread
From: Rob Herring @ 2017-06-26 15:51 UTC (permalink / raw)
  To: Eugeniy Paltsev
  Cc: arcml, linux-kernel, Vineet Gupta, Alexey Brodkin, devicetree

On Mon, Jun 26, 2017 at 10:11 AM, Eugeniy Paltsev
<Eugeniy.Paltsev@synopsys.com> wrote:
> From: Alexey Brodkin <abrodkin@synopsys.com>
>
> 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.
>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
> ---
>  Documentation/devicetree/bindings/arc/hsdk.txt |   7 ++
>  arch/arc/Kconfig                               |   1 +
>  arch/arc/Makefile                              |   1 +
>  arch/arc/boot/dts/hsdk.dts                     | 150 +++++++++++++++++++++++++
>  arch/arc/configs/hsdk_defconfig                |  75 +++++++++++++
>  arch/arc/kernel/devtree.c                      |   5 +-
>  arch/arc/plat-hsdk/Kconfig                     |  12 ++
>  arch/arc/plat-hsdk/Makefile                    |   9 ++
>  arch/arc/plat-hsdk/platform.c                  |  79 +++++++++++++
>  9 files changed, 337 insertions(+), 2 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/arc/hsdk.txt
>  create mode 100644 arch/arc/boot/dts/hsdk.dts
>  create mode 100644 arch/arc/configs/hsdk_defconfig
>  create mode 100644 arch/arc/plat-hsdk/Kconfig
>  create mode 100644 arch/arc/plat-hsdk/Makefile
>  create mode 100644 arch/arc/plat-hsdk/platform.c
>
> diff --git a/Documentation/devicetree/bindings/arc/hsdk.txt b/Documentation/devicetree/bindings/arc/hsdk.txt
> new file mode 100644
> index 0000000..be50654
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arc/hsdk.txt
> @@ -0,0 +1,7 @@
> +Synopsys DesignWare ARC HS Development Kit Device Tree Bindings
> +---------------------------------------------------------------------------
> +
> +ARC HSDK Board with quad-core ARC HS38x4 in silicon.
> +
> +Required root node properties:
> +    - compatible = "snps,hsdk";
> diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
> index 75e5276..825a112 100644
> --- a/arch/arc/Kconfig
> +++ b/arch/arc/Kconfig
> @@ -101,6 +101,7 @@ source "arch/arc/plat-tb10x/Kconfig"
>  source "arch/arc/plat-axs10x/Kconfig"
>  #New platform adds here
>  source "arch/arc/plat-eznps/Kconfig"
> +source "arch/arc/plat-hsdk/Kconfig"
>
>  endmenu
>
> diff --git a/arch/arc/Makefile b/arch/arc/Makefile
> index 44ef35d..55ca925 100644
> --- a/arch/arc/Makefile
> +++ b/arch/arc/Makefile
> @@ -111,6 +111,7 @@ core-$(CONFIG_ARC_PLAT_SIM) += arch/arc/plat-sim/
>  core-$(CONFIG_ARC_PLAT_TB10X)  += arch/arc/plat-tb10x/
>  core-$(CONFIG_ARC_PLAT_AXS10X) += arch/arc/plat-axs10x/
>  core-$(CONFIG_ARC_PLAT_EZNPS)  += arch/arc/plat-eznps/
> +core-$(CONFIG_ARC_PLAT_HSDK)   += arch/arc/plat-hsdk/
>
>  ifdef CONFIG_ARC_PLAT_EZNPS
>  KBUILD_CPPFLAGS += -I$(srctree)/arch/arc/plat-eznps/include
> diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts
> new file mode 100644
> index 0000000..6a4e471
> --- /dev/null
> +++ b/arch/arc/boot/dts/hsdk.dts
> @@ -0,0 +1,150 @@
> +/*
> + * Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com)
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +/*
> + * Device Tree for ARC HS Development Kit
> + */
> +/dts-v1/;
> +
> +/include/ "skeleton_hs_idu.dtsi"
> +
> +#include <dt-bindings/net/ti-dp83867.h>
> +
> +/ {
> +       model = "snps,hsdk";
> +       compatible = "snps,hsdk";
> +
> +       #address-cells = <1>;
> +       #size-cells = <1>;
> +
> +       chosen {
> +               bootargs = "earlycon=uart8250,mmio32,0xf0005000,115200n8 console=ttyS0,115200n8 debug print-fatal-signals=1";

Use stdout-path for the console. Really, the bootargs should be blank
and populated by the bootloader especially debug options.

> +       };
> +
> +       cpu {

'cpu' is for cpu nodes, so need something different.

> +               compatible = "simple-bus";
> +               #address-cells = <1>;
> +               #size-cells = <1>;

There are no reg properties, so these aren't needed. This doesn't look
like a simple-bus either.

Probably these child nodes should just be moved up to root level.

> +               interrupt-parent = <&core_intc>;
> +
> +               core_clk: core_clk {

core-clk {

> +                       #clock-cells = <0>;
> +                       compatible = "fixed-clock";
> +                       clock-frequency = <1000000000>;
> +               };
> +
> +               core_intc: archs-intc@cpu {

cpu is not a valid unit-address. How are these interrupt controllers addressed?

> +                       compatible = "snps,archs-intc";
> +                       interrupt-controller;
> +                       #interrupt-cells = <1>;
> +               };
> +
> +               idu_intc: idu-interrupt-controller {
> +                       compatible = "snps,archs-idu-intc";
> +                       interrupt-controller;
> +                       #interrupt-cells = <1>;
> +               };
> +
> +               arcpct0: pct {
> +                       compatible = "snps,archs-pct";
> +               };
> +       };
> +
> +       soc {
> +               compatible = "simple-bus";
> +               #address-cells = <1>;
> +               #size-cells = <1>;
> +               interrupt-parent = <&idu_intc>;
> +
> +               ranges = <0x00000000 0xf0000000 0x10000000>;
> +
> +               uart: dw-apb-uart@5000 {

serial@...

> +                       compatible = "snps,dw-apb-uart";
> +                       reg = <0x5000 0x100>;
> +                       clock-frequency = <33330000>;
> +                       interrupts = <6>;
> +                       baud = <115200>;
> +                       reg-shift = <2>;
> +                       reg-io-width = <4>;
> +               };
> +
> +               gmacclk: gmacclk {
> +                       compatible = "fixed-clock";
> +                       clock-frequency = <400000000>;
> +                       #clock-cells = <0>;
> +               };
> +
> +               mmcclk_ciu: mmcclk_ciu {

Don't use underscores in node names.

> +                       compatible = "fixed-clock";
> +                       clock-frequency = <100000000>;
> +                       #clock-cells = <0>;
> +               };
> +
> +               mmcclk_biu: mmcclk_biu {
> +                       compatible = "fixed-clock";
> +                       clock-frequency = <400000000>;
> +                       #clock-cells = <0>;
> +               };
> +
> +               ethernet@8000 {
> +                       #interrupt-cells = <1>;
> +                       compatible = "snps,dwmac";
> +                       reg = <0x8000 0x2000>;
> +                       interrupts = <10>;
> +                       interrupt-names = "macirq";
> +                       phy-mode = "rgmii";
> +                       snps,pbl = <32>;
> +                       clocks = <&gmacclk>;
> +                       clock-names = "stmmaceth";
> +                       phy-handle = <&phy0>;
> +
> +                       mdio0 {

mdio {

> +                               #address-cells = <1>;
> +                               #size-cells = <0>;
> +                               compatible = "snps,dwmac-mdio";
> +                               phy0: ethernet-phy@0 {
> +                                       reg = <0>;
> +                                       ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
> +                                       ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
> +                                       ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
> +                               };
> +                       };
> +               };
> +
> +               ohci@60000 {
> +                       compatible = "generic-ohci";

This should have an SoC specific compatible.

> +                       reg = <0x60000 0x100>;
> +                       interrupts = <15>;
> +               };
> +
> +               ehci@40000 {
> +                       compatible = "generic-ehci";

This should have an SoC specific compatible.

> +                       reg = <0x40000 0x100>;
> +                       interrupts = <15>;
> +               };
> +
> +               mmc@a000 {
> +                       compatible = "altr,socfpga-dw-mshc";
> +                       reg = <0xa000 0x400>;
> +                       num-slots = <1>;
> +                       fifo-depth = <16>;
> +                       card-detect-delay = <200>;
> +                       clocks = <&mmcclk_biu>, <&mmcclk_ciu>;
> +                       clock-names = "biu", "ciu";
> +                       interrupts = <12>;
> +                       bus-width = <4>;
> +               };
> +       };
> +
> +       memory {

memory@80000000

> +               #address-cells = <1>;
> +               #size-cells = <1>;
> +               device_type = "memory";
> +               reg = <0x80000000 0x40000000>;  /* 1 GiB */
> +       };
> +};
> diff --git a/arch/arc/configs/hsdk_defconfig b/arch/arc/configs/hsdk_defconfig
> new file mode 100644
> index 0000000..53bc9f3
> --- /dev/null
> +++ b/arch/arc/configs/hsdk_defconfig
> @@ -0,0 +1,75 @@
> +CONFIG_DEFAULT_HOSTNAME="ARCLinux"
> +CONFIG_SYSVIPC=y
> +# CONFIG_CROSS_MEMORY_ATTACH is not set
> +CONFIG_NO_HZ_IDLE=y
> +CONFIG_HIGH_RES_TIMERS=y
> +CONFIG_IKCONFIG=y
> +CONFIG_IKCONFIG_PROC=y
> +CONFIG_NAMESPACES=y
> +# CONFIG_UTS_NS is not set
> +# CONFIG_PID_NS is not set
> +CONFIG_BLK_DEV_INITRD=y
> +CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/"
> +CONFIG_EMBEDDED=y
> +CONFIG_PERF_EVENTS=y
> +# CONFIG_VM_EVENT_COUNTERS is not set
> +# CONFIG_COMPAT_BRK is not set
> +CONFIG_SLAB=y
> +CONFIG_ARC_PLAT_HSDK=y
> +CONFIG_ISA_ARCV2=y
> +CONFIG_SMP=y
> +CONFIG_LINUX_LINK_BASE=0x90000000
> +CONFIG_KERNEL_RAM_BASE_ADDRESS=0x80000000
> +CONFIG_ARC_BUILTIN_DTB_NAME="hsdk"
> +CONFIG_PREEMPT=y
> +# CONFIG_COMPACTION is not set
> +CONFIG_NET=y
> +CONFIG_PACKET=y
> +CONFIG_UNIX=y
> +CONFIG_INET=y
> +CONFIG_DEVTMPFS=y
> +# CONFIG_STANDALONE is not set
> +# CONFIG_PREVENT_FIRMWARE_BUILD is not set
> +# CONFIG_FIRMWARE_IN_KERNEL is not set
> +CONFIG_SCSI=y
> +CONFIG_BLK_DEV_SD=y
> +CONFIG_NETDEVICES=y
> +CONFIG_STMMAC_ETH=y
> +CONFIG_MICREL_PHY=y
> +# CONFIG_INPUT_KEYBOARD is not set
> +# CONFIG_INPUT_MOUSE is not set
> +# CONFIG_SERIO is not set
> +# CONFIG_LEGACY_PTYS is not set
> +CONFIG_SERIAL_8250=y
> +CONFIG_SERIAL_8250_CONSOLE=y
> +CONFIG_SERIAL_8250_DW=y
> +CONFIG_SERIAL_OF_PLATFORM=y
> +# CONFIG_HW_RANDOM is not set
> +# CONFIG_HWMON is not set
> +CONFIG_FB=y
> +CONFIG_FB_UDL=y
> +CONFIG_FRAMEBUFFER_CONSOLE=y
> +CONFIG_USB=y
> +CONFIG_USB_EHCI_HCD=y
> +CONFIG_USB_EHCI_HCD_PLATFORM=y
> +CONFIG_USB_OHCI_HCD=y
> +CONFIG_USB_OHCI_HCD_PLATFORM=y
> +CONFIG_USB_STORAGE=y
> +CONFIG_MMC=y
> +CONFIG_MMC_SDHCI=y
> +CONFIG_MMC_SDHCI_PLTFM=y
> +CONFIG_MMC_DW=y
> +# CONFIG_IOMMU_SUPPORT is not set
> +CONFIG_EXT3_FS=y
> +CONFIG_VFAT_FS=y
> +CONFIG_TMPFS=y
> +CONFIG_NLS_CODEPAGE_437=y
> +CONFIG_NLS_ISO8859_1=y
> +# CONFIG_ENABLE_WARN_DEPRECATED is not set
> +# CONFIG_ENABLE_MUST_CHECK is not set
> +CONFIG_STRIP_ASM_SYMS=y
> +CONFIG_LOCKUP_DETECTOR=y
> +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
> +# CONFIG_SCHED_DEBUG is not set
> +# CONFIG_DEBUG_PREEMPT is not set
> +# CONFIG_FTRACE is not set
> diff --git a/arch/arc/kernel/devtree.c b/arch/arc/kernel/devtree.c
> index 3b67f53..521ef35 100644
> --- a/arch/arc/kernel/devtree.c
> +++ b/arch/arc/kernel/devtree.c
> @@ -29,8 +29,9 @@ static void __init arc_set_early_base_baud(unsigned long dt_root)
>  {
>         if (of_flat_dt_is_compatible(dt_root, "abilis,arc-tb10x"))
>                 arc_base_baud = 166666666;      /* Fixed 166.6MHz clk (TB10x) */
> -       else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp"))
> -               arc_base_baud = 33333333;       /* Fixed 33MHz clk (AXS10x) */
> +       else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp") ||
> +                of_flat_dt_is_compatible(dt_root, "snps,hsdk"))
> +               arc_base_baud = 33333333;       /* Fixed 33MHz clk (AXS10x & HSDK) */

You should get this info from DT. You don't need to address that now though.

>         else if (of_flat_dt_is_compatible(dt_root, "ezchip,arc-nps"))
>                 arc_base_baud = 800000000;      /* Fixed 800MHz clk (NPS) */
>         else
> diff --git a/arch/arc/plat-hsdk/Kconfig b/arch/arc/plat-hsdk/Kconfig
> new file mode 100644
> index 0000000..29dffed
> --- /dev/null
> +++ b/arch/arc/plat-hsdk/Kconfig
> @@ -0,0 +1,12 @@
> +#
> +# Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com)
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License version 2 as
> +# published by the Free Software Foundation.
> +#
> +
> +menuconfig ARC_PLAT_HSDK
> +       bool "ARC HS Development Kit board"

Per board config options don't scale and shouldn't be necessary with DT...

Rob

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board
  2017-06-26 15:51   ` Rob Herring
@ 2017-06-26 16:25     ` Alexey Brodkin
  2017-06-27  4:25       ` stdout-path (was Re: [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board) Vineet Gupta
  2017-06-28 22:50       ` [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board Rob Herring
  0 siblings, 2 replies; 10+ messages in thread
From: Alexey Brodkin @ 2017-06-26 16:25 UTC (permalink / raw)
  To: robh+dt
  Cc: linux-kernel, Vineet.Gupta1, Alexey.Brodkin, Eugeniy.Paltsev,
	linux-snps-arc, devicetree

Hi Rob,

On Mon, 2017-06-26 at 10:51 -0500, Rob Herring wrote:
> On Mon, Jun 26, 2017 at 10:11 AM, Eugeniy Paltsev
> <Eugeniy.Paltsev@synopsys.com> wrote:
> > 
> > From: Alexey Brodkin <abrodkin@synopsys.com>
> > 

[snip]

> > +
> > +       chosen {
> > +               bootargs = "earlycon=uart8250,mmio32,0xf0005000,115200n8 console=ttyS0,115200n8 debug print-fatal-signals=1";
> 
> Use stdout-path for the console. Really, the bootargs should be blank
> and populated by the bootloader especially debug options.

Agree but in case of devboards we quite often disable bootloader and
load Linux image in memory via JTAG. So in that case bootargs make perfect sense IMHO. 

> > 
> > +       };
> > +
> > +       cpu {
> 
> 'cpu' is for cpu nodes, so need something different.

Agree.

> > 
> > +               compatible = "simple-bus";
> > +               #address-cells = <1>;
> > +               #size-cells = <1>;
> 
> There are no reg properties, so these aren't needed. This doesn't look
> like a simple-bus either.
> 
> Probably these child nodes should just be moved up to root level.

Looks like that. Thanks.

> > 
> > +               interrupt-parent = <&core_intc>;
> > +
> > +               core_clk: core_clk {
> 
> core-clk {

Ok.

> > 
> > +                       #clock-cells = <0>;
> > +                       compatible = "fixed-clock";
> > +                       clock-frequency = <1000000000>;
> > +               };
> > +
> > +               core_intc: archs-intc@cpu {
> 
> cpu is not a valid unit-address. How are these interrupt controllers addressed?

We have per-core INTC so each core communicates to its own INTC and there's no way
for any core to talk with INTC of another core.

But then we have the next level INTC which is IDU (Interrupt Distribution Unit)
which dispatches "common" IRQs to different upstream per-core INTC, see below its node. 

> > 
> > +                       compatible = "snps,archs-intc";
> > +                       interrupt-controller;
> > +                       #interrupt-cells = <1>;
> > +               };
> > +
> > +               idu_intc: idu-interrupt-controller {
> > +                       compatible = "snps,archs-idu-intc";
> > +                       interrupt-controller;
> > +                       #interrupt-cells = <1>;
> > +               };
> > +
> > +               arcpct0: pct {
> > +                       compatible = "snps,archs-pct";
> > +               };
> > +       };
> > +
> > +       soc {
> > +               compatible = "simple-bus";
> > +               #address-cells = <1>;
> > +               #size-cells = <1>;
> > +               interrupt-parent = <&idu_intc>;
> > +
> > +               ranges = <0x00000000 0xf0000000 0x10000000>;
> > +
> > +               uart: dw-apb-uart@5000 {
> 
> serial@...

Yep.

> > 
> > +                       compatible = "snps,dw-apb-uart";
> > +                       reg = <0x5000 0x100>;
> > +                       clock-frequency = <33330000>;
> > +                       interrupts = <6>;
> > +                       baud = <115200>;
> > +                       reg-shift = <2>;
> > +                       reg-io-width = <4>;
> > +               };
> > +
> > +               gmacclk: gmacclk {
> > +                       compatible = "fixed-clock";
> > +                       clock-frequency = <400000000>;
> > +                       #clock-cells = <0>;
> > +               };
> > +
> > +               mmcclk_ciu: mmcclk_ciu {
> 
> Don't use underscores in node names.

Ok.

> > 
> > +                       compatible = "fixed-clock";
> > +                       clock-frequency = <100000000>;
> > +                       #clock-cells = <0>;
> > +               };
> > +
> > +               mmcclk_biu: mmcclk_biu {
> > +                       compatible = "fixed-clock";
> > +                       clock-frequency = <400000000>;
> > +                       #clock-cells = <0>;
> > +               };
> > +
> > +               ethernet@8000 {
> > +                       #interrupt-cells = <1>;
> > +                       compatible = "snps,dwmac";
> > +                       reg = <0x8000 0x2000>;
> > +                       interrupts = <10>;
> > +                       interrupt-names = "macirq";
> > +                       phy-mode = "rgmii";
> > +                       snps,pbl = <32>;
> > +                       clocks = <&gmacclk>;
> > +                       clock-names = "stmmaceth";
> > +                       phy-handle = <&phy0>;
> > +
> > +                       mdio0 {
> 
> mdio {
> 
> > 
> > +                               #address-cells = <1>;
> > +                               #size-cells = <0>;
> > +                               compatible = "snps,dwmac-mdio";
> > +                               phy0: ethernet-phy@0 {
> > +                                       reg = <0>;
> > +                                       ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
> > +                                       ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
> > +                                       ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
> > +                               };
> > +                       };
> > +               };
> > +
> > +               ohci@60000 {
> > +                       compatible = "generic-ohci";
> 
> This should have an SoC specific compatible.

But why? We don't have any SoC-specific extensions.
This essentially applies to EHCI as well.

> > 
> > +                       reg = <0x60000 0x100>;
> > +                       interrupts = <15>;
> > +               };
> > +
> > +               ehci@40000 {
> > +                       compatible = "generic-ehci";
> 
> This should have an SoC specific compatible.
> 
> > 
> > +                       reg = <0x40000 0x100>;
> > +                       interrupts = <15>;
> > +               };
> > +
> > +               mmc@a000 {
> > +                       compatible = "altr,socfpga-dw-mshc";
> > +                       reg = <0xa000 0x400>;
> > +                       num-slots = <1>;
> > +                       fifo-depth = <16>;
> > +                       card-detect-delay = <200>;
> > +                       clocks = <&mmcclk_biu>, <&mmcclk_ciu>;
> > +                       clock-names = "biu", "ciu";
> > +                       interrupts = <12>;
> > +                       bus-width = <4>;
> > +               };
> > +       };
> > +
> > +       memory {
> 
> memory@80000000

Ok.

> 
> > 
> > +               #address-cells = <1>;
> > +               #size-cells = <1>;
> > +               device_type = "memory";
> > +               reg = <0x80000000 0x40000000>;  /* 1 GiB */
> > +       };
> > +};
> > diff --git a/arch/arc/configs/hsdk_defconfig b/arch/arc/configs/hsdk_defconfig
> > new file mode 100644
> > index 0000000..53bc9f3
> > --- /dev/null
> > +++ b/arch/arc/configs/hsdk_defconfig
> > @@ -0,0 +1,75 @@
> > +CONFIG_DEFAULT_HOSTNAME="ARCLinux"
> > +CONFIG_SYSVIPC=y
> > +# CONFIG_CROSS_MEMORY_ATTACH is not set
> > +CONFIG_NO_HZ_IDLE=y
> > +CONFIG_HIGH_RES_TIMERS=y
> > +CONFIG_IKCONFIG=y
> > +CONFIG_IKCONFIG_PROC=y
> > +CONFIG_NAMESPACES=y
> > +# CONFIG_UTS_NS is not set
> > +# CONFIG_PID_NS is not set
> > +CONFIG_BLK_DEV_INITRD=y
> > +CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/"
> > +CONFIG_EMBEDDED=y
> > +CONFIG_PERF_EVENTS=y
> > +# CONFIG_VM_EVENT_COUNTERS is not set
> > +# CONFIG_COMPAT_BRK is not set
> > +CONFIG_SLAB=y
> > +CONFIG_ARC_PLAT_HSDK=y
> > +CONFIG_ISA_ARCV2=y
> > +CONFIG_SMP=y
> > +CONFIG_LINUX_LINK_BASE=0x90000000
> > +CONFIG_KERNEL_RAM_BASE_ADDRESS=0x80000000
> > +CONFIG_ARC_BUILTIN_DTB_NAME="hsdk"
> > +CONFIG_PREEMPT=y
> > +# CONFIG_COMPACTION is not set
> > +CONFIG_NET=y
> > +CONFIG_PACKET=y
> > +CONFIG_UNIX=y
> > +CONFIG_INET=y
> > +CONFIG_DEVTMPFS=y
> > +# CONFIG_STANDALONE is not set
> > +# CONFIG_PREVENT_FIRMWARE_BUILD is not set
> > +# CONFIG_FIRMWARE_IN_KERNEL is not set
> > +CONFIG_SCSI=y
> > +CONFIG_BLK_DEV_SD=y
> > +CONFIG_NETDEVICES=y
> > +CONFIG_STMMAC_ETH=y
> > +CONFIG_MICREL_PHY=y
> > +# CONFIG_INPUT_KEYBOARD is not set
> > +# CONFIG_INPUT_MOUSE is not set
> > +# CONFIG_SERIO is not set
> > +# CONFIG_LEGACY_PTYS is not set
> > +CONFIG_SERIAL_8250=y
> > +CONFIG_SERIAL_8250_CONSOLE=y
> > +CONFIG_SERIAL_8250_DW=y
> > +CONFIG_SERIAL_OF_PLATFORM=y
> > +# CONFIG_HW_RANDOM is not set
> > +# CONFIG_HWMON is not set
> > +CONFIG_FB=y
> > +CONFIG_FB_UDL=y
> > +CONFIG_FRAMEBUFFER_CONSOLE=y
> > +CONFIG_USB=y
> > +CONFIG_USB_EHCI_HCD=y
> > +CONFIG_USB_EHCI_HCD_PLATFORM=y
> > +CONFIG_USB_OHCI_HCD=y
> > +CONFIG_USB_OHCI_HCD_PLATFORM=y
> > +CONFIG_USB_STORAGE=y
> > +CONFIG_MMC=y
> > +CONFIG_MMC_SDHCI=y
> > +CONFIG_MMC_SDHCI_PLTFM=y
> > +CONFIG_MMC_DW=y
> > +# CONFIG_IOMMU_SUPPORT is not set
> > +CONFIG_EXT3_FS=y
> > +CONFIG_VFAT_FS=y
> > +CONFIG_TMPFS=y
> > +CONFIG_NLS_CODEPAGE_437=y
> > +CONFIG_NLS_ISO8859_1=y
> > +# CONFIG_ENABLE_WARN_DEPRECATED is not set
> > +# CONFIG_ENABLE_MUST_CHECK is not set
> > +CONFIG_STRIP_ASM_SYMS=y
> > +CONFIG_LOCKUP_DETECTOR=y
> > +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
> > +# CONFIG_SCHED_DEBUG is not set
> > +# CONFIG_DEBUG_PREEMPT is not set
> > +# CONFIG_FTRACE is not set
> > diff --git a/arch/arc/kernel/devtree.c b/arch/arc/kernel/devtree.c
> > index 3b67f53..521ef35 100644
> > --- a/arch/arc/kernel/devtree.c
> > +++ b/arch/arc/kernel/devtree.c
> > @@ -29,8 +29,9 @@ static void __init arc_set_early_base_baud(unsigned long dt_root)
> >  {
> >         if (of_flat_dt_is_compatible(dt_root, "abilis,arc-tb10x"))
> >                 arc_base_baud = 166666666;      /* Fixed 166.6MHz clk (TB10x) */
> > -       else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp"))
> > -               arc_base_baud = 33333333;       /* Fixed 33MHz clk (AXS10x) */
> > +       else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp") ||
> > +                of_flat_dt_is_compatible(dt_root, "snps,hsdk"))
> > +               arc_base_baud = 33333333;       /* Fixed 33MHz clk (AXS10x & HSDK) */
> 
> You should get this info from DT. You don't need to address that now though.

For normal UART we indeed don't need that. But this is really required for early
console otherwise how may we start outputting stuff even before we have .dtb
unflattened.

The only thing I may think of early platform code that extracts this value from .dtb
image but:
 1) I'm not sure it is more elegant
 2) Still it will be a bit too late - now we start printing very-very early.

> > 
> >         else if (of_flat_dt_is_compatible(dt_root, "ezchip,arc-nps"))
> >                 arc_base_baud = 800000000;      /* Fixed 800MHz clk (NPS) */
> >         else
> > diff --git a/arch/arc/plat-hsdk/Kconfig b/arch/arc/plat-hsdk/Kconfig
> > new file mode 100644
> > index 0000000..29dffed
> > --- /dev/null
> > +++ b/arch/arc/plat-hsdk/Kconfig
> > @@ -0,0 +1,12 @@
> > +#
> > +# Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com)
> > +#
> > +# This program is free software; you can redistribute it and/or modify
> > +# it under the terms of the GNU General Public License version 2 as
> > +# published by the Free Software Foundation.
> > +#
> > +
> > +menuconfig ARC_PLAT_HSDK
> > +       bool "ARC HS Development Kit board"
> 
> Per board config options don't scale and shouldn't be necessary with DT...

Not sure if I understand that completely.
Could you please explain in a bit more details?

-Alexey

^ permalink raw reply	[flat|nested] 10+ messages in thread

* stdout-path (was Re: [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board)
  2017-06-26 16:25     ` Alexey Brodkin
@ 2017-06-27  4:25       ` Vineet Gupta
  2017-06-28 22:50       ` [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board Rob Herring
  1 sibling, 0 replies; 10+ messages in thread
From: Vineet Gupta @ 2017-06-27  4:25 UTC (permalink / raw)
  To: Alexey Brodkin, robh+dt
  Cc: linux-kernel, Alexey.Brodkin, Eugeniy.Paltsev, linux-snps-arc,
	devicetree, Arnd Bergmann

On 06/26/2017 07:25 PM, Alexey Brodkin wrote:
>>> +
>>> +       chosen {
>>> +               bootargs = "earlycon=uart8250,mmio32,0xf0005000,115200n8 console=ttyS0,115200n8 debug print-fatal-signals=1";
>> Use stdout-path for the console. Really, the bootargs should be blank
>> and populated by the bootloader especially debug options.
> Agree but in case of devboards we quite often disable bootloader and
> load Linux image in memory via JTAG. So in that case bootargs make perfect sense IMH

FWIW, I tried this 2 years ago (v4.1 ish) per pestering by Arnd but at the time I 
had to add some hacks in early 8250 driver to get this working for ARC.

See,
http://www.spinics.net/lists/linux-serial/msg17742.html
http://www.spinics.net/lists/linux-serial/msg17747.html

We can certainly revisit this now.

-Vineet

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board
  2017-06-26 16:25     ` Alexey Brodkin
  2017-06-27  4:25       ` stdout-path (was Re: [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board) Vineet Gupta
@ 2017-06-28 22:50       ` Rob Herring
  2017-06-29 16:39         ` Eugeniy Paltsev
  1 sibling, 1 reply; 10+ messages in thread
From: Rob Herring @ 2017-06-28 22:50 UTC (permalink / raw)
  To: Alexey Brodkin
  Cc: linux-kernel, Vineet.Gupta1, Eugeniy.Paltsev, linux-snps-arc, devicetree

On Mon, Jun 26, 2017 at 04:25:35PM +0000, Alexey Brodkin wrote:
> Hi Rob,
> 
> On Mon, 2017-06-26 at 10:51 -0500, Rob Herring wrote:
> > On Mon, Jun 26, 2017 at 10:11 AM, Eugeniy Paltsev
> > <Eugeniy.Paltsev@synopsys.com> wrote:
> > > 
> > > From: Alexey Brodkin <abrodkin@synopsys.com>
> > > 
> 
> [snip]
> 
> > > +
> > > +       chosen {
> > > +               bootargs = "earlycon=uart8250,mmio32,0xf0005000,115200n8 console=ttyS0,115200n8 debug print-fatal-signals=1";
> > 
> > Use stdout-path for the console. Really, the bootargs should be blank
> > and populated by the bootloader especially debug options.
> 
> Agree but in case of devboards we quite often disable bootloader and
> load Linux image in memory via JTAG. So in that case bootargs make perfect sense IMHO. 

Okay if you want to leave debug options, but regardless you should use 
stdout-path instead.

[...]

> > > +                       #clock-cells = <0>;
> > > +                       compatible = "fixed-clock";
> > > +                       clock-frequency = <1000000000>;
> > > +               };
> > > +
> > > +               core_intc: archs-intc@cpu {
> > 
> > cpu is not a valid unit-address. How are these interrupt controllers addressed?
> 
> We have per-core INTC so each core communicates to its own INTC and there's no way
> for any core to talk with INTC of another core.
> 
> But then we have the next level INTC which is IDU (Interrupt Distribution Unit)
> which dispatches "common" IRQs to different upstream per-core INTC, see below its node. 

Okay, I'd just do "cpu-interrupt-controller" for the node name then. 
There doesn't seem to be an easy way to use just "interrupt-controller" 
since you have 2 nodes at the same level and no unit-address (i.e. a 
reg property).

[...]

> > > +               ohci@60000 {
> > > +                       compatible = "generic-ohci";
> > 
> > This should have an SoC specific compatible.
> 
> But why? We don't have any SoC-specific extensions.
> This essentially applies to EHCI as well.

Because they are all broken in unique ways across different 
implementations and SoC integrations. Even IP licensed from the same 
vendor has differences.

> > > +++ b/arch/arc/kernel/devtree.c
> > > @@ -29,8 +29,9 @@ static void __init arc_set_early_base_baud(unsigned long dt_root)
> > >  {
> > >         if (of_flat_dt_is_compatible(dt_root, "abilis,arc-tb10x"))
> > >                 arc_base_baud = 166666666;      /* Fixed 166.6MHz clk (TB10x) */
> > > -       else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp"))
> > > -               arc_base_baud = 33333333;       /* Fixed 33MHz clk (AXS10x) */
> > > +       else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp") ||
> > > +                of_flat_dt_is_compatible(dt_root, "snps,hsdk"))
> > > +               arc_base_baud = 33333333;       /* Fixed 33MHz clk (AXS10x & HSDK) */
> > 
> > You should get this info from DT. You don't need to address that now though.
> 
> For normal UART we indeed don't need that. But this is really required for early
> console otherwise how may we start outputting stuff even before we have .dtb
> unflattened.

earlycon gets the register address from the flattened tree. You could 
get the clock frequency too using the "clock-frequency" property.

> 
> The only thing I may think of early platform code that extracts this value from .dtb
> image but:
>  1) I'm not sure it is more elegant
>  2) Still it will be a bit too late - now we start printing very-very early.

You are running C code here and reading the FDT, it's not that early.

For 5 boards, what you have works fine. When you have 10? 100? 1000? Not 
so much.

> 
> > > 
> > >         else if (of_flat_dt_is_compatible(dt_root, "ezchip,arc-nps"))
> > >                 arc_base_baud = 800000000;      /* Fixed 800MHz clk (NPS) */
> > >         else
> > > diff --git a/arch/arc/plat-hsdk/Kconfig b/arch/arc/plat-hsdk/Kconfig
> > > new file mode 100644
> > > index 0000000..29dffed
> > > --- /dev/null
> > > +++ b/arch/arc/plat-hsdk/Kconfig
> > > @@ -0,0 +1,12 @@
> > > +#
> > > +# Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com)
> > > +#
> > > +# This program is free software; you can redistribute it and/or modify
> > > +# it under the terms of the GNU General Public License version 2 as
> > > +# published by the Free Software Foundation.
> > > +#
> > > +
> > > +menuconfig ARC_PLAT_HSDK
> > > +       bool "ARC HS Development Kit board"
> > 
> > Per board config options don't scale and shouldn't be necessary with DT...
> 
> Not sure if I understand that completely.
> Could you please explain in a bit more details?

The point of DT is to remove board specifics (and SoC specifics to some 
extent) from the kernel. Having board kconfig options is adding board 
specifics. This doesn't scale when you have hundreds of or a thousand 
boards (as the ARM world does).

Rob

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board
  2017-06-26 15:11 ` [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board Eugeniy Paltsev
  2017-06-26 15:51   ` Rob Herring
@ 2017-06-29  7:27   ` Vineet Gupta
  1 sibling, 0 replies; 10+ messages in thread
From: Vineet Gupta @ 2017-06-29  7:27 UTC (permalink / raw)
  To: Eugeniy Paltsev, linux-snps-arc
  Cc: devicetree, Vineet Gupta, Alexey Brodkin, linux-kernel, Rob Herring

On 06/26/2017 06:11 PM, Eugeniy Paltsev wrote:
> From: Alexey Brodkin <abrodkin@synopsys.com>

> diff --git a/arch/arc/configs/hsdk_defconfig b/arch/arc/configs/hsdk_defconfig
> new file mode 100644
> index 0000000..53bc9f3
> --- /dev/null
> +++ b/arch/arc/configs/hsdk_defconfig
> @@ -0,0 +1,75 @@
> +CONFIG_DEFAULT_HOSTNAME="ARCLinux"
> +CONFIG_SYSVIPC=y
> +# CONFIG_CROSS_MEMORY_ATTACH is not set
> +CONFIG_NO_HZ_IDLE=y
> +CONFIG_HIGH_RES_TIMERS=y
> +CONFIG_IKCONFIG=y
> +CONFIG_IKCONFIG_PROC=y
> +CONFIG_NAMESPACES=y
> +# CONFIG_UTS_NS is not set
> +# CONFIG_PID_NS is not set
> +CONFIG_BLK_DEV_INITRD=y
> +CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/"
> +CONFIG_EMBEDDED=y
> +CONFIG_PERF_EVENTS=y
> +# CONFIG_VM_EVENT_COUNTERS is not set
> +# CONFIG_COMPAT_BRK is not set
> +CONFIG_SLAB=y
> +CONFIG_ARC_PLAT_HSDK=y
> +CONFIG_ISA_ARCV2=y
> +CONFIG_SMP=y
> +CONFIG_LINUX_LINK_BASE=0x90000000
> +CONFIG_KERNEL_RAM_BASE_ADDRESS=0x80000000
> +CONFIG_ARC_BUILTIN_DTB_NAME="hsdk"
> +CONFIG_PREEMPT=y
> +# CONFIG_COMPACTION is not set
> +CONFIG_NET=y
> +CONFIG_PACKET=y
> +CONFIG_UNIX=y
> +CONFIG_INET=y
> +CONFIG_DEVTMPFS=y
> +# CONFIG_STANDALONE is not set
> +# CONFIG_PREVENT_FIRMWARE_BUILD is not set
> +# CONFIG_FIRMWARE_IN_KERNEL is not set
> +CONFIG_SCSI=y
> +CONFIG_BLK_DEV_SD=y
> +CONFIG_NETDEVICES=y
> +CONFIG_STMMAC_ETH=y
> +CONFIG_MICREL_PHY=y
> +# CONFIG_INPUT_KEYBOARD is not set
> +# CONFIG_INPUT_MOUSE is not set
> +# CONFIG_SERIO is not set
> +# CONFIG_LEGACY_PTYS is not set
> +CONFIG_SERIAL_8250=y
> +CONFIG_SERIAL_8250_CONSOLE=y
> +CONFIG_SERIAL_8250_DW=y
> +CONFIG_SERIAL_OF_PLATFORM=y
> +# CONFIG_HW_RANDOM is not set
> +# CONFIG_HWMON is not set
> +CONFIG_FB=y
> +CONFIG_FB_UDL=y
> +CONFIG_FRAMEBUFFER_CONSOLE=y
> +CONFIG_USB=y
> +CONFIG_USB_EHCI_HCD=y
> +CONFIG_USB_EHCI_HCD_PLATFORM=y
> +CONFIG_USB_OHCI_HCD=y
> +CONFIG_USB_OHCI_HCD_PLATFORM=y
> +CONFIG_USB_STORAGE=y
> +CONFIG_MMC=y
> +CONFIG_MMC_SDHCI=y
> +CONFIG_MMC_SDHCI_PLTFM=y
> +CONFIG_MMC_DW=y
> +# CONFIG_IOMMU_SUPPORT is not set
> +CONFIG_EXT3_FS=y
> +CONFIG_VFAT_FS=y
> +CONFIG_TMPFS=y
> +CONFIG_NLS_CODEPAGE_437=y
> +CONFIG_NLS_ISO8859_1=y
> +# CONFIG_ENABLE_WARN_DEPRECATED is not set
> +# CONFIG_ENABLE_MUST_CHECK is not set
> +CONFIG_STRIP_ASM_SYMS=y
> +CONFIG_LOCKUP_DETECTOR=y
> +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
> +# CONFIG_SCHED_DEBUG is not set
> +# CONFIG_DEBUG_PREEMPT is not set
> +# CONFIG_FTRACE is not set

For the next iteration please also enable loadable modules, module unloading and 
NFS client as defaults !

Thx,
-Vineet

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board
  2017-06-28 22:50       ` [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board Rob Herring
@ 2017-06-29 16:39         ` Eugeniy Paltsev
  0 siblings, 0 replies; 10+ messages in thread
From: Eugeniy Paltsev @ 2017-06-29 16:39 UTC (permalink / raw)
  To: robh
  Cc: linux-kernel, Vineet.Gupta1, Eugeniy.Paltsev, Alexey.Brodkin,
	linux-snps-arc, devicetree

On Wed, 2017-06-28 at 17:50 -0500, Rob Herring wrote:
> > > > +                       #clock-cells = <0>;
> > > > +                       compatible = "fixed-clock";
> > > > +                       clock-frequency = <1000000000>;
> > > > +               };
> > > > +
> > > > +               core_intc: archs-intc@cpu {
> > > 
> > > cpu is not a valid unit-address. How are these interrupt
> > > controllers addressed?
> > 
> > We have per-core INTC so each core communicates to its own INTC and
> > there's no way
> > for any core to talk with INTC of another core.
> > 
> > But then we have the next level INTC which is IDU (Interrupt
> > Distribution Unit)
> > which dispatches "common" IRQs to different upstream per-core INTC,
> > see below its node. 
> 
> Okay, I'd just do "cpu-interrupt-controller" for the node name then. 
> There doesn't seem to be an easy way to use just "interrupt-
> controller" 
> since you have 2 nodes at the same level and no unit-address (i.e. a 
> reg property).
> 

To be more clarify, what is better way do describe such hardware in
device tree?

-------------    -------------  
| cpu core 0|    | cpu core 1|  
-------------    -------------  
| interrupt |    | interrupt |  
| controller|    | controller|  
|     0     |    |     1     |  
-------------    -------------  
      ^                ^
      |                |
             -----------
      |      |
----------------
|   interrupt  |
| distribution |
|     unit     |
----------------
      ^
      |
      |<--other devices interrupt lines

We can't just create a node for each core interrupt controller because
we wouldn't able to specify which one is parent for interrupt
distribution unit:

------------>>>-------------
cpus {
    cpu@0 { intc@0 };
    cpu@1 { intc@1 };
};

interrupt-distribution-unit {
    interrupt-parent = ????
};
------------>>>-------------

Should we simply create one core interrupt controller node for all cpus
(instead of one per each cpu core), or where is a better option?

-- 
 Eugeniy Paltsev

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-06-29 16:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-26 15:11 [PATCH 0/3 v6] hsdk: initial port for HSDK board Eugeniy Paltsev
2017-06-26 15:11 ` [PATCH 1/3 v6] ARC: Set IO-coherency aperture base to LINUX_LINK_BASE Eugeniy Paltsev
2017-06-26 15:11 ` [PATCH 2/3 v6] ARC: Decouple linux kernel memory address and link address Eugeniy Paltsev
2017-06-26 15:11 ` [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board Eugeniy Paltsev
2017-06-26 15:51   ` Rob Herring
2017-06-26 16:25     ` Alexey Brodkin
2017-06-27  4:25       ` stdout-path (was Re: [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board) Vineet Gupta
2017-06-28 22:50       ` [PATCH 3/3 v6] ARC: hsdk: initial port for HSDK board Rob Herring
2017-06-29 16:39         ` Eugeniy Paltsev
2017-06-29  7:27   ` Vineet Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).