Skip to contentSkip to conversation

support Hisilicon HiP04

PATCH Superseded Haojian Zhuang 4 participants 13 messages Apr 1, 2014 – Apr 6, 2014

Subsystems (7)

v1 of 17 Superseded Latest is v17 →

lore
Share & tools
lore
#0 lore raw

cover support Hisilicon HiP04

Support HiP04 SoC with MCPM implementation.

Haojian Zhuang (8):
ARM: debug: add HiP04 debug uart
ARM: hisi: add ARCH_HISI
irq: gic: use mask field in GICC_IAR
irq: gic: extends the cpu interface to 16
ARM: mcpm: change max clusters to 4
ARM: hisi: add hip04 SoC support
ARM: dts: add hip04-d01 dts file
ARM: config: append hip04_defconfig

 arch/arm/Kconfig                 |   2 +-
 arch/arm/Kconfig.debug           |  10 ++
 arch/arm/Makefile                |   2 +-
 arch/arm/boot/dts/Makefile       |   1 +
 arch/arm/boot/dts/hip04-d01.dts  |  74 +++++++++++
 arch/arm/boot/dts/hip04.dtsi     | 240 ++++++++++++++++++++++++++++++++++++
 arch/arm/configs/hip04_defconfig |  64 ++++++++++
 arch/arm/include/asm/mcpm.h      |   2 +-
 arch/arm/mach-hisi/Kconfig       |  26 +++-
 arch/arm/mach-hisi/core.h        |   6 +
 arch/arm/mach-hisi/hisilicon.c   |  17 +++
 arch/arm/mach-hisi/platsmp.c     | 257 +++++++++++++++++++++++++++++++++++++++
 drivers/irqchip/irq-gic.c        |  80 +++++++-----
 include/linux/irqchip/arm-gic.h  |   2 +
 14 files changed, 746 insertions(+), 37 deletions(-)
 create mode 100644 arch/arm/boot/dts/hip04-d01.dts
 create mode 100644 arch/arm/boot/dts/hip04.dtsi
 create mode 100644 arch/arm/configs/hip04_defconfig
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/8 ARM: debug: add HiP04 debug uart

Add the support of Hisilicon HiP04 debug uart.

---
 arch/arm/Kconfig.debug | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/Kconfig.debug +10 -0
index 9326c4c..a1d3c44 100644
@@ -223,6 +223,14 @@ choice
 		  Say Y here if you want kernel low-level debugging support
 		  on HI3716 UART.
 
+	config DEBUG_HIP04_UART
+		bool "Hisilicon HiP01 Debug UART"
+		depends on ARCH_HIP04
+		select DEBUG_UART_8250
+		help
+		  Say Y here if you want kernel low-level debugging support
+		  on HIP04 UART.
+
 	config DEBUG_HIGHBANK_UART
 		bool "Kernel low-level debugging messages via Highbank UART"
 		depends on ARCH_HIGHBANK
@@ -1053,6 +1061,7 @@ config DEBUG_UART_PHYS
 	default 0xd4017000 if DEBUG_MMP_UART2
 	default 0xd4018000 if DEBUG_MMP_UART3
 	default 0xe0000000 if ARCH_SPEAR13XX
+	default 0xe4007000 if DEBUG_HIP04_UART
 	default 0xf0000be0 if ARCH_EBSA110
 	default 0xf1012000 if DEBUG_MVEBU_UART_ALTERNATE
 	default 0xf1012000 if ARCH_DOVE || ARCH_KIRKWOOD || ARCH_MV78XX0 || \
@@ -1085,6 +1094,7 @@ config DEBUG_UART_VIRT
 	default 0xf4090000 if ARCH_LPC32XX
 	default 0xf4200000 if ARCH_GEMINI
 	default 0xf7fc9000 if DEBUG_BERLIN_UART
+	default 0xf8007000 if DEBUG_HIP04_UART
 	default 0xf8009000 if DEBUG_VEXPRESS_UART0_CA9
 	default 0xf8090000 if DEBUG_VEXPRESS_UART0_RS1
 	default 0xfb009000 if DEBUG_REALVIEW_STD_PORT
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 2/8 ARM: hisi: add ARCH_HISI

In reply to Haojian Zhuang

Since multiple ARCH configuration will be appended into mach-hisi directory, add ARCH_HISI as common configuration for different ARCH in mach-hisi.

---
 arch/arm/Makefile          |  2 +-
 arch/arm/mach-hisi/Kconfig | 16 ++++++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)
arch/arm/Makefile +1 -1
index 41c1931..4c2798a 100644
@@ -154,7 +154,7 @@ machine-$(CONFIG_ARCH_EP93XX)		+= ep93xx
 machine-$(CONFIG_ARCH_EXYNOS)		+= exynos
 machine-$(CONFIG_ARCH_GEMINI)		+= gemini
 machine-$(CONFIG_ARCH_HIGHBANK)		+= highbank
-machine-$(CONFIG_ARCH_HI3xxx)		+= hisi
+machine-$(CONFIG_ARCH_HISI)		+= hisi
 machine-$(CONFIG_ARCH_INTEGRATOR)	+= integrator
 machine-$(CONFIG_ARCH_IOP13XX)		+= iop13xx
 machine-$(CONFIG_ARCH_IOP32X)		+= iop32x
arch/arm/mach-hisi/Kconfig +14 -2
index feee4db..da16efd 100644
@@ -1,8 +1,16 @@
-config ARCH_HI3xxx
-	bool "Hisilicon Hi36xx/Hi37xx family" if ARCH_MULTI_V7
+config ARCH_HISI
+	bool "Hisilicon SoC Support"
+	depends on ARCH_MULTIPLATFORM
 	select ARM_AMBA
 	select ARM_GIC
 	select ARM_TIMER_SP804
+
+if ARCH_HISI
+
+menu "Hisilicon platform type"
+
+config ARCH_HI3xxx
+	bool "Hisilicon Hi36xx/Hi37xx family" if ARCH_MULTI_V7
 	select CACHE_L2X0
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
@@ -10,3 +18,7 @@ config ARCH_HI3xxx
 	select PINCTRL_SINGLE
 	help
 	  Support for Hisilicon Hi36xx/Hi37xx processor family
+
+endmenu
+
+endif
Signature · 1 line
1.8.3.2
#3 lore raw

PATCH 3/8 irq: gic: use mask field in GICC_IAR

In reply to Haojian Zhuang

Bit[9:0] is interrupt ID field in GICC_IAR. Bit[12:10] is CPU ID field, and others are reserved.

So we should use GICC_IAR_INTID to get interrupt ID. It's not a good way to use ~0x1c00 (CPU ID field) to get interrupt ID.

---
 drivers/irqchip/irq-gic.c       | 2 +-
 include/linux/irqchip/arm-gic.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/irqchip/irq-gic.c +1 -1
index 4300b66..8fd27bf 100644
@@ -287,7 +287,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
 
 	do {
 		irqstat = readl_relaxed(cpu_base + GIC_CPU_INTACK);
-		irqnr = irqstat & ~0x1c00;
+		irqnr = irqstat & GICC_IAR_INTID;
 
 		if (likely(irqnr > 15 && irqnr < 1021)) {
 			irqnr = irq_find_mapping(gic->domain, irqnr);
include/linux/irqchip/arm-gic.h +2 -0
index 7ed92d0..55933aa 100644
@@ -21,6 +21,8 @@
 #define GIC_CPU_ACTIVEPRIO		0xd0
 #define GIC_CPU_IDENT			0xfc
 
+#define GICC_IAR_INTID			0x3ff
+
 #define GIC_DIST_CTRL			0x000
 #define GIC_DIST_CTR			0x004
 #define GIC_DIST_IGROUP			0x080
Signature · 1 line
1.8.3.2
#4 lore raw

PATCH 4/8 irq: gic: extends the cpu interface to 16

In reply to Haojian Zhuang

In order to support 16 CPUs, Hisilicon extends the GIC to support the number of CPU interfaces from 8 to 16.

---
 drivers/irqchip/irq-gic.c | 78 ++++++++++++++++++++++++++++-------------------
 1 file changed, 47 insertions(+), 31 deletions(-)
drivers/irqchip/irq-gic.c +47 -31
index 8fd27bf..44eff46 100644
@@ -76,9 +76,12 @@ static DEFINE_RAW_SPINLOCK(irq_controller_lock);
  * The GIC mapping of CPU interfaces does not necessarily match
  * the logical CPU numbering.  Let's use a mapping as returned
  * by the GIC itself.
+ *
+ * Hisilicon HiP04 extends the number of CPU interface from 8 to 16.
  */
-#define NR_GIC_CPU_IF 8
-static u8 gic_cpu_map[NR_GIC_CPU_IF] __read_mostly;
+#define MAX_NR_GIC_CPU_IF 16
+static u16 gic_cpu_map[MAX_NR_GIC_CPU_IF] __read_mostly;
+static int nr_gic_cpu_if = 8;	/* The standard GIC supports 8 CPUs */
 
 /*
  * Supported arch specific GIC irq extension.
@@ -245,16 +248,19 @@ static int gic_retrigger(struct irq_data *d)
 static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
 			    bool force)
 {
-	void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
-	unsigned int shift = (gic_irq(d) % 4) * 8;
+	void __iomem *reg;
+	unsigned int shift, step;
 	unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask);
 	u32 val, mask, bit;
-
-	if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
+	if (cpu >= nr_gic_cpu_if || cpu >= nr_cpu_ids)
 		return -EINVAL;
 
+	step = BITS_PER_LONG / nr_gic_cpu_if;
+	shift = (gic_irq(d) % step) * nr_gic_cpu_if;
+	reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) / step * 4);
+
 	raw_spin_lock(&irq_controller_lock);
-	mask = 0xff << shift;
+	mask = ((1 << nr_gic_cpu_if) - 1) << shift;
 	bit = gic_cpu_map[cpu] << shift;
 	val = readl_relaxed(reg) & ~mask;
 	writel_relaxed(val | bit, reg);
@@ -354,15 +360,17 @@ void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
 	irq_set_chained_handler(irq, gic_handle_cascade_irq);
 }
 
-static u8 gic_get_cpumask(struct gic_chip_data *gic)
+static u16 gic_get_cpumask(struct gic_chip_data *gic)
 {
 	void __iomem *base = gic_data_dist_base(gic);
-	u32 mask, i;
-
-	for (i = mask = 0; i < 32; i += 4) {
-		mask = readl_relaxed(base + GIC_DIST_TARGET + i);
-		mask |= mask >> 16;
-		mask |= mask >> 8;
+	u32 mask, i, j, step;
+
+	/* get the number of CPU fields in GIC_DIST_TARGET register */
+	step = BITS_PER_LONG / nr_gic_cpu_if;
+	for (i = mask = 0; i < 32; i += step) {
+		mask = readl_relaxed(base + GIC_DIST_TARGET + i / step * 4);
+		for (j = BITS_PER_LONG >> 1; j >= nr_gic_cpu_if; j >>= 1)
+			mask |= mask >> j;
 		if (mask)
 			break;
 	}
@@ -375,7 +383,7 @@ static u8 gic_get_cpumask(struct gic_chip_data *gic)
 
 static void __init gic_dist_init(struct gic_chip_data *gic)
 {
-	unsigned int i;
+	unsigned int i, step;
 	u32 cpumask;
 	unsigned int gic_irqs = gic->gic_irqs;
 	void __iomem *base = gic_data_dist_base(gic);
@@ -392,10 +400,11 @@ static void __init gic_dist_init(struct gic_chip_data *gic)
 	 * Set all global interrupts to this CPU only.
 	 */
 	cpumask = gic_get_cpumask(gic);
-	cpumask |= cpumask << 8;
-	cpumask |= cpumask << 16;
-	for (i = 32; i < gic_irqs; i += 4)
-		writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4);
+	for (i = nr_gic_cpu_if; i < BITS_PER_LONG; i <<= 1)
+		cpumask |= cpumask << i;
+	step = BITS_PER_LONG / nr_gic_cpu_if;
+	for (i = 32; i < gic_irqs; i += step)
+		writel_relaxed(cpumask, base + GIC_DIST_TARGET + i / step * 4);
 
 	/*
 	 * Set priority on all global interrupts.
@@ -423,7 +432,7 @@ static void gic_cpu_init(struct gic_chip_data *gic)
 	/*
 	 * Get what the GIC says our CPU mask is.
 	 */
-	BUG_ON(cpu >= NR_GIC_CPU_IF);
+	BUG_ON(cpu >= nr_gic_cpu_if);
 	cpu_mask = gic_get_cpumask(gic);
 	gic_cpu_map[cpu] = cpu_mask;
 
@@ -431,7 +440,7 @@ static void gic_cpu_init(struct gic_chip_data *gic)
 	 * Clear our mask from the other map entries in case they're
 	 * still undefined.
 	 */
-	for (i = 0; i < NR_GIC_CPU_IF; i++)
+	for (i = 0; i < nr_gic_cpu_if; i++)
 		if (i != cpu)
 			gic_cpu_map[i] &= ~cpu_mask;
 
@@ -469,7 +478,7 @@ static void gic_dist_save(unsigned int gic_nr)
 {
 	unsigned int gic_irqs;
 	void __iomem *dist_base;
-	int i;
+	int i, step;
 
 	if (gic_nr >= MAX_GIC_NR)
 		BUG();
@@ -484,7 +493,8 @@ static void gic_dist_save(unsigned int gic_nr)
 		gic_data[gic_nr].saved_spi_conf[i] =
 			readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);
 
-	for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
+	step = BITS_PER_LONG / nr_gic_cpu_if;
+	for (i = 0; i < DIV_ROUND_UP(gic_irqs, step); i++)
 		gic_data[gic_nr].saved_spi_target[i] =
 			readl_relaxed(dist_base + GIC_DIST_TARGET + i * 4);
 
@@ -503,7 +513,7 @@ static void gic_dist_save(unsigned int gic_nr)
 static void gic_dist_restore(unsigned int gic_nr)
 {
 	unsigned int gic_irqs;
-	unsigned int i;
+	unsigned int i, step;
 	void __iomem *dist_base;
 
 	if (gic_nr >= MAX_GIC_NR)
@@ -525,7 +535,8 @@ static void gic_dist_restore(unsigned int gic_nr)
 		writel_relaxed(0xa0a0a0a0,
 			dist_base + GIC_DIST_PRI + i * 4);
 
-	for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
+	step = BITS_PER_LONG / nr_gic_cpu_if;
+	for (i = 0; i < DIV_ROUND_UP(gic_irqs, step); i++)
 		writel_relaxed(gic_data[gic_nr].saved_spi_target[i],
 			dist_base + GIC_DIST_TARGET + i * 4);
 
@@ -666,8 +677,8 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
 	dmb(ishst);
 
 	/* this always happens on GIC0 */
-	writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
-
+	writel_relaxed(map << (8 + 16 - nr_gic_cpu_if) | irq,
+		       gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
 	raw_spin_unlock_irqrestore(&irq_controller_lock, flags);
 }
 #endif
@@ -681,7 +692,7 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
  */
 void gic_send_sgi(unsigned int cpu_id, unsigned int irq)
 {
-	BUG_ON(cpu_id >= NR_GIC_CPU_IF);
+	BUG_ON(cpu_id >= nr_gic_cpu_if);
 	cpu_id = 1 << cpu_id;
 	/* this always happens on GIC0 */
 	writel_relaxed((cpu_id << 16) | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
@@ -700,7 +711,7 @@ int gic_get_cpu_id(unsigned int cpu)
 {
 	unsigned int cpu_bit;
 
-	if (cpu >= NR_GIC_CPU_IF)
+	if (cpu >= nr_gic_cpu_if)
 		return -1;
 	cpu_bit = gic_cpu_map[cpu];
 	if (cpu_bit & (cpu_bit - 1))
@@ -971,8 +982,8 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,
 	 * Initialize the CPU interface map to all CPUs.
 	 * It will be refined as each CPU probes its ID.
 	 */
-	for (i = 0; i < NR_GIC_CPU_IF; i++)
-		gic_cpu_map[i] = 0xff;
+	for (i = 0; i < nr_gic_cpu_if; i++)
+		gic_cpu_map[i] = (1 << MAX_NR_GIC_CPU_IF) - 1;
 
 	/*
 	 * For primary GICs, skip over SGIs.
@@ -1047,6 +1058,10 @@ gic_of_init(struct device_node *node, struct device_node *parent)
 	if (WARN_ON(!node))
 		return -ENODEV;
 
+	/* HiP04 supports 16 CPUs@most */
+	if (of_device_is_compatible(node, "hisilicon,hip04-gic"))
+		nr_gic_cpu_if = 16;
+
 	dist_base = of_iomap(node, 0);
 	WARN(!dist_base, "unable to map gic dist registers\n");
 
@@ -1069,6 +1084,7 @@ gic_of_init(struct device_node *node, struct device_node *parent)
 }
 IRQCHIP_DECLARE(cortex_a15_gic, "arm,cortex-a15-gic", gic_of_init);
 IRQCHIP_DECLARE(cortex_a9_gic, "arm,cortex-a9-gic", gic_of_init);
+IRQCHIP_DECLARE(hip04_gic, "hisilicon,hip04-gic", gic_of_init);
 IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init);
 IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init);
 
Signature · 1 line
1.8.3.2
#5 lore raw

PATCH 5/8 ARM: mcpm: change max clusters to 4

In reply to Haojian Zhuang

In order to support 4 clusters with 4 Cortex A15 Cores in each cluster, enlarge maximum clusters from 2 to 4 in MCPM.

---
 arch/arm/include/asm/mcpm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/include/asm/mcpm.h +1 -1
index 608516e..68f82cf 100644
@@ -20,7 +20,7 @@
  * to consider dynamic allocation.
  */
 #define MAX_CPUS_PER_CLUSTER	4
-#define MAX_NR_CLUSTERS		2
+#define MAX_NR_CLUSTERS		4
 
 #ifndef __ASSEMBLY__
 
Signature · 1 line
1.8.3.2
#6 lore raw

PATCH 6/8 ARM: hisi: add hip04 SoC support

In reply to Haojian Zhuang

Hisilicon Hi3xxx is based on Cortex A9 Core. Now HiP04 SoC is based on Cortex A15 Core. And HiP04 supports LPAE to support large memory.

---
 arch/arm/Kconfig               |   2 +-
 arch/arm/mach-hisi/Kconfig     |  10 ++
 arch/arm/mach-hisi/core.h      |   6 +
 arch/arm/mach-hisi/hisilicon.c |  17 +++
 arch/arm/mach-hisi/platsmp.c   | 257 +++++++++++++++++++++++++++++++++++++++++
 5 files changed, 291 insertions(+), 1 deletion(-)
arch/arm/Kconfig +1 -1
index a48712e..3f2e973 100644
@@ -1107,7 +1107,7 @@ source arch/arm/mm/Kconfig
 
 config ARM_NR_BANKS
 	int
-	default 16 if ARCH_EP93XX
+	default 16 if ARCH_EP93XX || ARCH_HIP04
 	default 8
 
 config IWMMXT
arch/arm/mach-hisi/Kconfig +10 -0
index da16efd..707abfe 100644
@@ -19,6 +19,16 @@ config ARCH_HI3xxx
 	help
 	  Support for Hisilicon Hi36xx/Hi37xx processor family
 
+config ARCH_HIP04
+	bool "Hisilicon HiP04 Cortex A15 family" if ARCH_MULTI_V7
+	select ARM_LPAE
+	select HAVE_ARM_ARCH_TIMER
+	select HAVE_SMP
+	select MCPM
+	select SMP
+	help
+	  Support for Hisilicon HiP04 processor family
+
 endmenu
 
 endif
arch/arm/mach-hisi/core.h +6 -0
index af23ec2..e008c7a 100644
@@ -12,4 +12,10 @@ extern void hi3xxx_cpu_die(unsigned int cpu);
 extern int hi3xxx_cpu_kill(unsigned int cpu);
 extern void hi3xxx_set_cpu(int cpu, bool enable);
 
+#define HIP04_BOOTWRAPPER_PHYS		0x10c00000
+#define HIP04_BOOTWRAPPER_MAGIC		0xa5a5a5a5
+#define HIP04_BOOTWRAPPER_SIZE		0x00010000
+
+extern bool __init hip04_smp_init_ops(void);
+
 #endif
arch/arm/mach-hisi/hisilicon.c +17 -0
index 741faf3..ca277de 100644
@@ -14,6 +14,7 @@
 #include <linux/clk-provider.h>
 #include <linux/clocksource.h>
 #include <linux/irqchip.h>
+#include <linux/memblock.h>
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
 
@@ -88,3 +89,19 @@ DT_MACHINE_START(HI3620, "Hisilicon Hi3620 (Flattened Device Tree)")
 	.smp		= smp_ops(hi3xxx_smp_ops),
 	.restart	= hi3xxx_restart,
 MACHINE_END
+
+static const char *hip04_compat[] __initconst = {
+	"hisilicon,hip04-d01",
+	NULL,
+};
+
+static void __init hip04_reserve(void)
+{
+	memblock_reserve(HIP04_BOOTWRAPPER_PHYS, HIP04_BOOTWRAPPER_SIZE);
+}
+
+DT_MACHINE_START(HIP04, "Hisilicon HiP04 (Flattened Device Tree)")
+	.dt_compat	= hip04_compat,
+	.smp_init	= smp_init_ops(hip04_smp_init_ops),
+	.reserve	= hip04_reserve,
+MACHINE_END
arch/arm/mach-hisi/platsmp.c +257 -0

269 lines not on this page · raw message

Signature · 1 line
1.8.3.2
#7 lore raw

PATCH 6/8 ARM: hisi: add hip04 SoC support

Quoted 4 lines · Haojian Zhuang

Hisilicon Hi3xxx is based on Cortex A9 Core. Now HiP04 SoC is based on Cortex A15 Core. And HiP04 supports LPAE to support large memory.

[...]

arch/arm/mach-hisi/Kconfig config ARCH_HI3xxx · line 24

Quoted 11 lines
arch/arm/mach-hisi/Kconfig +3 -0
index da16efd..707abfe 100644
@@ -19,6 +19,16 @@ config ARCH_HI3xxx
 	help
 	  Support for Hisilicon Hi36xx/Hi37xx processor family
 
+config ARCH_HIP04
+	bool "Hisilicon HiP04 Cortex A15 family" if ARCH_MULTI_V7
+	select ARM_LPAE

Presumably this SoC can support non-LPAE also, correct? If so, LPAE should't be selected here, or else it will force LPAE on in a multi_v7 build also.

Also, please run this patch through scripts/checkpatch.pl and fix the issues reported there.

Kevin

maintainer
#8 lore raw

PATCH 6/8 ARM: hisi: add hip04 SoC support

Quoted 17 lines · On Friday 04 April 2014 07:57:36 Kevin Hilman wrote:
Quoted 4 lines · Haojian Zhuang

Hisilicon Hi3xxx is based on Cortex A9 Core. Now HiP04 SoC is based on Cortex A15 Core. And HiP04 supports LPAE to support large memory.

[...]

Quoted 8 lines
arch/arm/mach-hisi/Kconfig +0 -0
index da16efd..707abfe 100644
@@ -19,6 +19,16 @@ config ARCH_HI3xxx
      help
        Support for Hisilicon Hi36xx/Hi37xx processor family
 
Quoted 7 lines

arch/arm/mach-hisi/Kconfig config ARCH_HI3xxx · line 24

Quoted 3 lines
arch/arm/mach-hisi/Kconfig +3 -0
+config ARCH_HIP04
+     bool "Hisilicon HiP04 Cortex A15 family" if ARCH_MULTI_V7
+     select ARM_LPAE

Presumably this SoC can support non-LPAE also, correct? If so, LPAE should't be selected here, or else it will force LPAE on in a multi_v7 build also.

Actually even if it doesn't support non-LPAE, using "select" is still wrong for the same reason.

I think we should actually extend the CPU selection phase for multiplatform, so we have separate symbols for ARCH_MULTI_V7 (non-LPAE) and ARCH_MULTI_V7_LPAE. These would still be selectable at the same time, but you should only be able to turn on CONFIG_LPAE if ARCH_MULTI_V7 is disabled.

A platform that cannot run without LPAE conversely would have to depend on (ARCH_MULTI_V7_LPAE && !ARCH_MULTI_V7 && !ARCH_MULTI_V6). Once it does this, it can 'select LPAE' without breaking other platforms.

Arnd

#9 lore raw

PATCH 6/8 ARM: hisi: add hip04 SoC support

Quoted 35 lines · Arnd Bergmann
Quoted 17 lines · On Friday 04 April 2014 07:57:36 Kevin Hilman wrote:
Quoted 4 lines · Haojian Zhuang

Hisilicon Hi3xxx is based on Cortex A9 Core. Now HiP04 SoC is based on Cortex A15 Core. And HiP04 supports LPAE to support large memory.

[...]

Quoted 8 lines
arch/arm/mach-hisi/Kconfig +0 -0
index da16efd..707abfe 100644
@@ -19,6 +19,16 @@ config ARCH_HI3xxx
      help
        Support for Hisilicon Hi36xx/Hi37xx processor family
 
Quoted 7 lines

arch/arm/mach-hisi/Kconfig config ARCH_HI3xxx · line 24

Quoted 3 lines
arch/arm/mach-hisi/Kconfig +3 -0
+config ARCH_HIP04
+     bool "Hisilicon HiP04 Cortex A15 family" if ARCH_MULTI_V7
+     select ARM_LPAE

Presumably this SoC can support non-LPAE also, correct? If so, LPAE should't be selected here, or else it will force LPAE on in a multi_v7 build also.

Actually even if it doesn't support non-LPAE, using "select" is still wrong for the same reason.

I think we should actually extend the CPU selection phase for multiplatform, so we have separate symbols for ARCH_MULTI_V7 (non-LPAE) and ARCH_MULTI_V7_LPAE. These would still be selectable at the same time, but you should only be able to turn on CONFIG_LPAE if ARCH_MULTI_V7 is disabled.

Quoted 3 lines

A platform that cannot run without LPAE conversely would have to depend on (ARCH_MULTI_V7_LPAE && !ARCH_MULTI_V7 && !ARCH_MULTI_V6). Once it does this, it can 'select LPAE' without breaking other platforms.

Why not just have it depend on ARCH_MULTI_V7 && LPAE? LPAE shouldn't be possible to enable if MULTI_V6 is enabled.

So, you'd have:

MULTI_V6
MULTI_V6 + V7
MULTI_V7 + LPAE

as valid options.

We'd need to annotate existing non-LPAE platforms with depends on !LPAE, but that shouldn't be a big deal.

And, we should probably change the multi defconfigs to be:

multi_v6_v7_defconfig which contains what v7_defconfig does today, plus the v6 platforms
multi_lpae_defconfig which contains only v7+lpae platforms (and would enable kvm, etc).

-Olof

maintainer
#10 lore raw

PATCH 6/8 ARM: hisi: add hip04 SoC support

Quoted 17 lines · On Saturday 05 April 2014 19:01:16 Olof Johansson wrote:
Quoted 9 lines · Arnd Bergmann

I think we should actually extend the CPU selection phase for multiplatform, so we have separate symbols for ARCH_MULTI_V7 (non-LPAE) and ARCH_MULTI_V7_LPAE. These would still be selectable at the same time, but you should only be able to turn on CONFIG_LPAE if ARCH_MULTI_V7 is disabled.

A platform that cannot run without LPAE conversely would have to depend on (ARCH_MULTI_V7_LPAE && !ARCH_MULTI_V7 && !ARCH_MULTI_V6). Once it does this, it can 'select LPAE' without breaking other platforms.

Why not just have it depend on ARCH_MULTI_V7 && LPAE? LPAE shouldn't be possible to enable if MULTI_V6 is enabled.

So, you'd have:

Quoted 8 lines

MULTI_V6
MULTI_V6 + V7
MULTI_V7 + LPAE

as valid options.

We'd need to annotate existing non-LPAE platforms with depends on !LPAE, but that shouldn't be a big deal.

That would work, too. It really depends on how we treat global options like MMU, SMP, LPAE, SPARSEMEM, etc in combination with multiplatform kernels. At the moment we are rather inconsistent, and so far I have always thought we should have them ordered in the Kconfig menu in the same way as the dependency flow:

1. Pick a platform type (normally ARCH_MULTIPLATFORM)
2. (if ARCH_MULTIPLATFORM), pick architecture level(s): V4, V4T, V5, V6, V6K, V6K+SMP, V7, V7+LPAE, V7-M. We may decide to skip some of these.
3. Pick global features that are allowed based on 1. and 2.:
MMU, SMP, LPAE, SPARSEMEM
4. (again, if MULTIPLATFORM) Pick SoC families, based on 1. and 2.
5. (if necessary) Pick boards.

I'd like to keep steps 3 and 4 independent of one another, possibly doing them in the opposite order.

An idea I just had was to essentially always imply compatibility to later architectures where possible, e.g. selecting v4 would always enable v4t and v5, and selecting v6k would always enable support for v6+smp, v7 and v7+lpae, but not to v6. If we do this, the matrix of possible combinations becomes much simpler, and for all I can tell we only lose the ones that are not interesting anyway. The cost of enabling support for a later architecture level is usually much lower than the cost for enabling an earlier level.

The architecture level selection at that point becomes a simple 'choice' statement, rather than the complex logic I introduced for multiplatform initially. It would also simplify adding new levels for v7-m and v7-r.

Quoted 6 lines

And, we should probably change the multi defconfigs to be:

multi_v6_v7_defconfig which contains what v7_defconfig does today, plus the v6 platforms
multi_lpae_defconfig which contains only v7+lpae platforms (and would enable kvm, etc).

I like this part.

Arnd

#11 lore raw

PATCH 7/8 ARM: dts: add hip04-d01 dts file

In reply to Haojian Zhuang

Add hip04.dtsi & hip04-d01.dts file to support HiP04 SoC platform.

---
 arch/arm/boot/dts/Makefile      |   1 +
 arch/arm/boot/dts/hip04-d01.dts |  74 +++++++++++++
 arch/arm/boot/dts/hip04.dtsi    | 240 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 315 insertions(+)
 create mode 100644 arch/arm/boot/dts/hip04-d01.dts
 create mode 100644 arch/arm/boot/dts/hip04.dtsi
arch/arm/boot/dts/Makefile +1 -0
index 8f68a0a..e02ad21 100644
@@ -80,6 +80,7 @@ dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \
 dtb-$(CONFIG_ARCH_HI3xxx) += hi3620-hi4511.dtb
 dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb \
 	ecx-2000.dtb
+dtb-$(CONFIG_ARCH_HIP04) += hip04-d01.dtb
 dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \
 	integratorcp.dtb
 dtb-$(CONFIG_ARCH_KEYSTONE) += k2hk-evm.dtb \
arch/arm/boot/dts/hip04-d01.dts new file +74 -0

74 lines not on this page · raw message

arch/arm/boot/dts/hip04.dtsi new file +240 -0

240 lines not on this page · raw message

Signature · 1 line
1.8.3.2
#12 lore raw

PATCH 8/8 ARM: config: append hip04_defconfig

In reply to Haojian Zhuang

Select HiP04 SoC configuration by hip04_defconfig.

---
 arch/arm/configs/hip04_defconfig | 64 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 arch/arm/configs/hip04_defconfig
arch/arm/configs/hip04_defconfig new file +64 -0
new file mode 100644
index 0000000..5222547
@@ -0,0 +1,64 @@
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_IRQ_DOMAIN_DEBUG=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_RD_GZIP=y
+CONFIG_ARCH_HISI=y
+CONFIG_ARCH_HIP04=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=16
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
+CONFIG_HIGHMEM=y
+CONFIG_VFP=y
+CONFIG_NEON=y
+CONFIG_NET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_BLK_DEV=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_SD=y
+CONFIG_ATA=y
+CONFIG_SATA_AHCI_PLATFORM=y
+CONFIG_NETDEVICES=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=2
+CONFIG_SERIAL_8250_RUNTIME_UARTS=2
+CONFIG_SERIAL_8250_DW=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_I2C_DESIGNWARE_PLATFORM=y
+CONFIG_PINCTRL_SINGLE=y
+CONFIG_GPIO_GENERIC_PLATFORM=y
+CONFIG_REGULATOR_GPIO=y
+CONFIG_DRM=y
+CONFIG_FB_SIMPLE=y
+CONFIG_RTC_CLASS=y
+CONFIG_EXT4_FS=y
+CONFIG_TMPFS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_FS=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DEBUG_LL=y
+CONFIG_DEBUG_UART_8250=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_LOCKUP_DETECTOR=y
+CONFIG_DEBUG_USER=y
Signature · 1 line
1.8.3.2