All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v9 0/2] Sigma Designs Tango4 port
@ 2015-11-18 15:09 Marc Gonzalez
  2015-11-18 15:10 ` [PATCH v9 1/2] arm-soc: Import initial tango4 device tree Marc Gonzalez
  2015-11-18 15:12 ` [PATCH v9 2/2] arm-soc: Add support for tango4 platforms Marc Gonzalez
  0 siblings, 2 replies; 19+ messages in thread
From: Marc Gonzalez @ 2015-11-18 15:09 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Gonzalez (2):
  arm-soc: Import initial tango4 device tree
  arm-soc: Add support for tango4 platforms

 arch/arm/Kconfig                          |   2 +
 arch/arm/Makefile                         |   1 +
 arch/arm/boot/dts/Makefile                |   2 +
 arch/arm/boot/dts/tango4-common.dtsi      | 121 ++++++++++++++++++++++++++++++
 arch/arm/boot/dts/tango4-smp8758.dtsi     |  31 ++++++++
 arch/arm/boot/dts/tango4-vantage-1172.dts |  29 +++++++
 arch/arm/mach-tangox/Kconfig              |  12 +++
 arch/arm/mach-tangox/Makefile             |   2 +
 arch/arm/mach-tangox/setup.c              |  32 ++++++++
 arch/arm/mach-tangox/smc.S                |   9 +++
 arch/arm/mach-tangox/smc.h                |   5 ++
 11 files changed, 246 insertions(+)
 create mode 100644 arch/arm/boot/dts/tango4-common.dtsi
 create mode 100644 arch/arm/boot/dts/tango4-smp8758.dtsi
 create mode 100644 arch/arm/boot/dts/tango4-vantage-1172.dts
 create mode 100644 arch/arm/mach-tangox/Kconfig
 create mode 100644 arch/arm/mach-tangox/Makefile
 create mode 100644 arch/arm/mach-tangox/setup.c
 create mode 100644 arch/arm/mach-tangox/smc.S
 create mode 100644 arch/arm/mach-tangox/smc.h

-- 
2.4.5

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

* [PATCH v9 1/2] arm-soc: Import initial tango4 device tree
  2015-11-18 15:09 [PATCH v9 0/2] Sigma Designs Tango4 port Marc Gonzalez
@ 2015-11-18 15:10 ` Marc Gonzalez
  2015-11-18 16:05   ` Måns Rullgård
  2015-11-18 15:12 ` [PATCH v9 2/2] arm-soc: Add support for tango4 platforms Marc Gonzalez
  1 sibling, 1 reply; 19+ messages in thread
From: Marc Gonzalez @ 2015-11-18 15:10 UTC (permalink / raw)
  To: linux-arm-kernel

This device tree was tested on a Sigma Designs SMP8758 Vantage-1172
development board.

Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
---
 arch/arm/boot/dts/Makefile                |   2 +
 arch/arm/boot/dts/tango4-common.dtsi      | 121 ++++++++++++++++++++++++++++++
 arch/arm/boot/dts/tango4-smp8758.dtsi     |  31 ++++++++
 arch/arm/boot/dts/tango4-vantage-1172.dts |  29 +++++++
 4 files changed, 183 insertions(+)
 create mode 100644 arch/arm/boot/dts/tango4-common.dtsi
 create mode 100644 arch/arm/boot/dts/tango4-smp8758.dtsi
 create mode 100644 arch/arm/boot/dts/tango4-vantage-1172.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 246473a244f6..2499295051d5 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -605,6 +605,8 @@ dtb-$(CONFIG_MACH_SUN8I) += \
 dtb-$(CONFIG_MACH_SUN9I) += \
 	sun9i-a80-optimus.dtb \
 	sun9i-a80-cubieboard4.dtb
+dtb-$(CONFIG_ARCH_TANGOX) += \
+	tango4-vantage-1172.dtb
 dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += \
 	tegra20-harmony.dtb \
 	tegra20-iris-512.dtb \
diff --git a/arch/arm/boot/dts/tango4-common.dtsi b/arch/arm/boot/dts/tango4-common.dtsi
new file mode 100644
index 000000000000..2a49aeea137f
--- /dev/null
+++ b/arch/arm/boot/dts/tango4-common.dtsi
@@ -0,0 +1,121 @@
+/*
+ * Based on Mans Rullgard's Tango3 DT
+ * https://github.com/mansr/linux-tangox
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+	interrupt-parent = <&gic>;
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	scu: scu at 20000000 {
+		compatible = "arm,cortex-a9-scu";
+		reg = <0x20000000 0x100>;
+	};
+
+	gic: interrupt-controller at 20001000 {
+		compatible = "arm,cortex-a9-gic";
+		interrupt-controller;
+		#interrupt-cells = <3>;
+		reg = <0x20001000 0x1000>, <0x20000100 0x0100>;
+	};
+
+	periphclk: periphclk {
+		compatible = "fixed-factor-clock";
+		clocks = <&clkgen 0>;
+		clock-mult = <1>;
+		clock-div  = <2>;
+		#clock-cells = <0>;
+	};
+
+	twd-timer at 20000600 {
+		compatible = "arm,cortex-a9-twd-timer";
+		reg = <0x20000600 0x10>;
+		interrupts = <GIC_PPI 13 0xf04>;
+		clocks = <&periphclk>;
+		always-on;
+	};
+
+	l2cc: l2-cache-controller at 20100000 {
+		compatible = "arm,pl310-cache";
+		reg = <0x20100000 0x1000>;
+		cache-level = <2>;
+		cache-unified;
+	};
+
+	soc {
+		compatible = "simple-bus";
+		interrupt-parent = <&irq0>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		xtal: xtal {
+			compatible = "fixed-clock";
+			clock-frequency = <27000000>;
+			#clock-cells = <0>;
+		};
+
+		clkgen: clkgen at 10000 {
+			compatible = "sigma,tango4-clkgen";
+			reg = <0x10000 0x40>;
+			clocks = <&xtal>;
+			clock-output-names = "cpuclk", "sysclk";
+			#clock-cells = <1>;
+		};
+
+		tick-counter at 10048 {
+			compatible = "sigma,tick-counter";
+			reg = <0x10048 0x4>;
+			clocks = <&xtal>;
+		};
+
+		uart: serial at 10700 {
+			compatible = "ralink,rt2880-uart";
+			reg = <0x10700 0x30>;
+			interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
+			clock-frequency = <7372800>;
+			reg-shift = <2>;
+		};
+
+		eth0: ethernet at 26000 {
+			compatible = "sigma,smp8734-ethernet";
+			reg = <0x26000 0x800>;
+			interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clkgen 1>;
+		};
+
+		intc: interrupt-controller at 6e000 {
+			compatible = "sigma,smp8642-intc";
+			reg = <0x6e000 0x400>;
+			ranges = <0 0x6e000 0x400>;
+			interrupt-parent = <&gic>;
+			interrupt-controller;
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			irq0: irq0 at 000 {
+				reg = <0x000 0x100>;
+				interrupt-controller;
+				#interrupt-cells = <2>;
+				interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
+			};
+
+			irq1: irq1 at 100 {
+				reg = <0x100 0x100>;
+				interrupt-controller;
+				#interrupt-cells = <2>;
+				interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
+			};
+
+			irq2: irq2 at 300 {
+				reg = <0x300 0x100>;
+				interrupt-controller;
+				#interrupt-cells = <2>;
+				interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+			};
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/tango4-smp8758.dtsi b/arch/arm/boot/dts/tango4-smp8758.dtsi
new file mode 100644
index 000000000000..7ed88ee629fb
--- /dev/null
+++ b/arch/arm/boot/dts/tango4-smp8758.dtsi
@@ -0,0 +1,31 @@
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		enable-method = "sigma,tango4-smp";
+
+		cpu0: cpu at 0 {
+			compatible = "arm,cortex-a9";
+			next-level-cache = <&l2cc>;
+			device_type = "cpu";
+			reg = <0>;
+		};
+
+		cpu1: cpu at 1 {
+			compatible = "arm,cortex-a9";
+			next-level-cache = <&l2cc>;
+			device_type = "cpu";
+			reg = <1>;
+		};
+	};
+
+	pmu {
+		compatible = "arm,cortex-a9-pmu";
+		interrupt-affinity = <&cpu0>, <&cpu1>;
+		interrupts =
+			<GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
+			<GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
+	};
+};
diff --git a/arch/arm/boot/dts/tango4-vantage-1172.dts b/arch/arm/boot/dts/tango4-vantage-1172.dts
new file mode 100644
index 000000000000..babe69a79c37
--- /dev/null
+++ b/arch/arm/boot/dts/tango4-vantage-1172.dts
@@ -0,0 +1,29 @@
+/dts-v1/;
+
+#include "tango4-smp8758.dtsi"
+#include "tango4-common.dtsi"
+
+/ {
+	model = "Sigma Designs SMP8758 Vantage-1172 Rev E1";
+	compatible = "sigma,vantage-1172", "sigma,smp8758", "sigma,tango4";
+
+	memory at 80000000 {
+		device_type = "memory";
+		reg = <0x80000000 0x80000000>; /* 2 GB */
+	};
+};
+
+&eth0 {
+	phy-connection-type = "rgmii";
+	phy-handle = <&eth0_phy>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+	/* Atheros AR8035 */
+	eth0_phy: ethernet-phy at 4 {
+		compatible = "ethernet-phy-id004d.d072",
+			     "ethernet-phy-ieee802.3-c22";
+		interrupts = <37 IRQ_TYPE_EDGE_RISING>;
+		reg = <4>;
+	};
+};
-- 
2.4.5

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

* [PATCH v9 2/2] arm-soc: Add support for tango4 platforms
  2015-11-18 15:09 [PATCH v9 0/2] Sigma Designs Tango4 port Marc Gonzalez
  2015-11-18 15:10 ` [PATCH v9 1/2] arm-soc: Import initial tango4 device tree Marc Gonzalez
@ 2015-11-18 15:12 ` Marc Gonzalez
  2015-11-18 18:04   ` Kevin Hilman
  2015-11-19 19:49   ` Kevin Hilman
  1 sibling, 2 replies; 19+ messages in thread
From: Marc Gonzalez @ 2015-11-18 15:12 UTC (permalink / raw)
  To: linux-arm-kernel

Add support for Sigma Designs ARM-based Tango4 "Secure Media Processor"
platforms (i.e. smp8734, smp8756, smp8758, smp8759) built around the
Cortex-A9 MPCore r3p0 (all dual-core, except the 8756).

Support for older MIPS-based platforms can be found elsewhere:
https://github.com/mansr/linux-tangox

Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
---
 arch/arm/Kconfig              |  2 ++
 arch/arm/Makefile             |  1 +
 arch/arm/mach-tangox/Kconfig  | 12 ++++++++++++
 arch/arm/mach-tangox/Makefile |  2 ++
 arch/arm/mach-tangox/setup.c  | 32 ++++++++++++++++++++++++++++++++
 arch/arm/mach-tangox/smc.S    |  9 +++++++++
 arch/arm/mach-tangox/smc.h    |  5 +++++
 7 files changed, 63 insertions(+)
 create mode 100644 arch/arm/mach-tangox/Kconfig
 create mode 100644 arch/arm/mach-tangox/Makefile
 create mode 100644 arch/arm/mach-tangox/setup.c
 create mode 100644 arch/arm/mach-tangox/smc.S
 create mode 100644 arch/arm/mach-tangox/smc.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 774dc59650c5..d8f0c31f521f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -934,6 +934,8 @@ source "arch/arm/mach-sunxi/Kconfig"
 
 source "arch/arm/mach-prima2/Kconfig"
 
+source "arch/arm/mach-tangox/Kconfig"
+
 source "arch/arm/mach-tegra/Kconfig"
 
 source "arch/arm/mach-u300/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 7451b447cc2d..7fcb4c63cdf7 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -203,6 +203,7 @@ machine-$(CONFIG_ARCH_SOCFPGA)		+= socfpga
 machine-$(CONFIG_ARCH_STI)		+= sti
 machine-$(CONFIG_ARCH_STM32)		+= stm32
 machine-$(CONFIG_ARCH_SUNXI)		+= sunxi
+machine-$(CONFIG_ARCH_TANGOX)		+= tangox
 machine-$(CONFIG_ARCH_TEGRA)		+= tegra
 machine-$(CONFIG_ARCH_U300)		+= u300
 machine-$(CONFIG_ARCH_U8500)		+= ux500
diff --git a/arch/arm/mach-tangox/Kconfig b/arch/arm/mach-tangox/Kconfig
new file mode 100644
index 000000000000..cf814d7336f3
--- /dev/null
+++ b/arch/arm/mach-tangox/Kconfig
@@ -0,0 +1,12 @@
+config ARCH_TANGOX
+	bool "Sigma Designs Tango4 (SMP87xx)" if ARCH_MULTI_V7
+	# Cortex-A9 MPCore r3p0, PL310 r3p2
+	select ARCH_HAS_HOLES_MEMORYMODEL
+	select ARM_ERRATA_754322
+	select ARM_ERRATA_764369 if SMP
+	select ARM_ERRATA_775420
+	select ARM_GIC
+	select CLKSRC_TANGO_XTAL
+	select GENERIC_IRQ_CHIP
+	select HAVE_ARM_SCU
+	select HAVE_ARM_TWD
diff --git a/arch/arm/mach-tangox/Makefile b/arch/arm/mach-tangox/Makefile
new file mode 100644
index 000000000000..0d7e2b5976e3
--- /dev/null
+++ b/arch/arm/mach-tangox/Makefile
@@ -0,0 +1,2 @@
+asflags-y += -mcpu=cortex-a9
+obj-y += setup.o smc.o
diff --git a/arch/arm/mach-tangox/setup.c b/arch/arm/mach-tangox/setup.c
new file mode 100644
index 000000000000..09b7540df14b
--- /dev/null
+++ b/arch/arm/mach-tangox/setup.c
@@ -0,0 +1,32 @@
+#include <linux/smp.h>
+#include <asm/mach/arch.h>
+#include <asm/hardware/cache-l2x0.h>
+#include "smc.h"
+
+static int tango4_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+	tango_set_aux_boot_addr(virt_to_phys(secondary_startup));
+	tango_start_aux_core(cpu);
+	return 0;
+}
+
+static struct smp_operations tango4_smp_ops __initdata = {
+	.smp_boot_secondary	= tango4_boot_secondary,
+};
+
+CPU_METHOD_OF_DECLARE(tango4_smp, "sigma,tango4-smp", &tango4_smp_ops);
+
+static void tango_l2c_write(unsigned long val, unsigned int reg)
+{
+	pr_debug("%s: reg=0x%x val=0x%lx\n", __func__, reg, val);
+	if (reg == L2X0_CTRL)
+		tango_set_l2_control(val);
+}
+
+static const char *tango_dt_compat[] = { "sigma,tango4", NULL };
+
+DT_MACHINE_START(TANGO_DT, "Sigma Tango DT")
+	.dt_compat	= tango_dt_compat,
+	.l2c_aux_mask	= ~0,
+	.l2c_write_sec	= tango_l2c_write,
+MACHINE_END
diff --git a/arch/arm/mach-tangox/smc.S b/arch/arm/mach-tangox/smc.S
new file mode 100644
index 000000000000..5d932ce3c1bd
--- /dev/null
+++ b/arch/arm/mach-tangox/smc.S
@@ -0,0 +1,9 @@
+#include <linux/linkage.h>
+
+ENTRY(tango_smc)
+	push	{lr}
+	mov	ip, r1
+	dsb	/* This barrier is probably unnecessary */
+	smc	#0
+	pop	{pc}
+ENDPROC(tango_smc)
diff --git a/arch/arm/mach-tangox/smc.h b/arch/arm/mach-tangox/smc.h
new file mode 100644
index 000000000000..7a4af35cc390
--- /dev/null
+++ b/arch/arm/mach-tangox/smc.h
@@ -0,0 +1,5 @@
+extern int tango_smc(unsigned int val, unsigned int service);
+
+#define tango_set_l2_control(val)	tango_smc(val, 0x102)
+#define tango_start_aux_core(val)	tango_smc(val, 0x104)
+#define tango_set_aux_boot_addr(val)	tango_smc((unsigned int)val, 0x105)
-- 
2.4.5

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

* [PATCH v9 1/2] arm-soc: Import initial tango4 device tree
  2015-11-18 15:10 ` [PATCH v9 1/2] arm-soc: Import initial tango4 device tree Marc Gonzalez
@ 2015-11-18 16:05   ` Måns Rullgård
  2015-11-18 16:34     ` Marc Gonzalez
  0 siblings, 1 reply; 19+ messages in thread
From: Måns Rullgård @ 2015-11-18 16:05 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Gonzalez <marc_gonzalez@sigmadesigns.com> writes:

> +		clkgen: clkgen at 10000 {
> +			compatible = "sigma,tango4-clkgen";
> +			reg = <0x10000 0x40>;
> +			clocks = <&xtal>;
> +			clock-output-names = "cpuclk", "sysclk";
> +			#clock-cells = <1>;
> +		};

Would you please consider using my clock driver that matches the actual
hardware, supports all the clock outputs required for USB, SATA, etc,
and works on tango3 as well?

-- 
M?ns Rullg?rd
mans at mansr.com

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

* [PATCH v9 1/2] arm-soc: Import initial tango4 device tree
  2015-11-18 16:05   ` Måns Rullgård
@ 2015-11-18 16:34     ` Marc Gonzalez
  2015-11-18 16:38       ` Måns Rullgård
  0 siblings, 1 reply; 19+ messages in thread
From: Marc Gonzalez @ 2015-11-18 16:34 UTC (permalink / raw)
  To: linux-arm-kernel

On 18/11/2015 17:05, M?ns Rullg?rd wrote:

> Marc Gonzalez wrote:
> 
>> +		clkgen: clkgen at 10000 {
>> +			compatible = "sigma,tango4-clkgen";
>> +			reg = <0x10000 0x40>;
>> +			clocks = <&xtal>;
>> +			clock-output-names = "cpuclk", "sysclk";
>> +			#clock-cells = <1>;
>> +		};
> 
> Would you please consider using my clock driver that matches the actual
> hardware, supports all the clock outputs required for USB, SATA, etc,
> and works on tango3 as well?

I was hoping to take baby steps to work up to a fully-functional port.
The first step (in my mind) is this submission: a minimal port which
only requires the two "main" clocks.

The next step will add to the minimal port by supporting as many
peripherals as possible, as well as their required clocks.

Would you agree to discuss the clkgen driver in a few weeks, when I can
concentrate full-time on the subject? Working on other drivers will give
me a better understanding of the required clocks. I've also been talking
internally with our firmware writers, and with the clk maintainers to
get a better picture of the whole mess. (Note that the next chip will
come with a brand new clkgen block, much more sane.)

Regards.

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

* [PATCH v9 1/2] arm-soc: Import initial tango4 device tree
  2015-11-18 16:34     ` Marc Gonzalez
@ 2015-11-18 16:38       ` Måns Rullgård
  2015-11-18 17:11         ` Olof Johansson
  0 siblings, 1 reply; 19+ messages in thread
From: Måns Rullgård @ 2015-11-18 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Gonzalez <marc_gonzalez@sigmadesigns.com> writes:

> On 18/11/2015 17:05, M?ns Rullg?rd wrote:
>
>> Marc Gonzalez wrote:
>> 
>>> +		clkgen: clkgen at 10000 {
>>> +			compatible = "sigma,tango4-clkgen";
>>> +			reg = <0x10000 0x40>;
>>> +			clocks = <&xtal>;
>>> +			clock-output-names = "cpuclk", "sysclk";
>>> +			#clock-cells = <1>;
>>> +		};
>> 
>> Would you please consider using my clock driver that matches the actual
>> hardware, supports all the clock outputs required for USB, SATA, etc,
>> and works on tango3 as well?
>
> I was hoping to take baby steps to work up to a fully-functional port.
> The first step (in my mind) is this submission: a minimal port which
> only requires the two "main" clocks.
>
> The next step will add to the minimal port by supporting as many
> peripherals as possible, as well as their required clocks.

But the code already exists.  Why start over?

> Would you agree to discuss the clkgen driver in a few weeks, when I can
> concentrate full-time on the subject? Working on other drivers will give
> me a better understanding of the required clocks.

Perhaps it's premature to be pushing this as anything more than an RFC
at this stage.

-- 
M?ns Rullg?rd
mans at mansr.com

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

* [PATCH v9 1/2] arm-soc: Import initial tango4 device tree
  2015-11-18 16:38       ` Måns Rullgård
@ 2015-11-18 17:11         ` Olof Johansson
  2015-11-18 17:18           ` Måns Rullgård
  0 siblings, 1 reply; 19+ messages in thread
From: Olof Johansson @ 2015-11-18 17:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 18, 2015 at 8:38 AM, M?ns Rullg?rd <mans@mansr.com> wrote:
> Marc Gonzalez <marc_gonzalez@sigmadesigns.com> writes:
>
>> On 18/11/2015 17:05, M?ns Rullg?rd wrote:
>>
>>> Marc Gonzalez wrote:
>>>
>>>> +           clkgen: clkgen at 10000 {
>>>> +                   compatible = "sigma,tango4-clkgen";
>>>> +                   reg = <0x10000 0x40>;
>>>> +                   clocks = <&xtal>;
>>>> +                   clock-output-names = "cpuclk", "sysclk";
>>>> +                   #clock-cells = <1>;
>>>> +           };
>>>
>>> Would you please consider using my clock driver that matches the actual
>>> hardware, supports all the clock outputs required for USB, SATA, etc,
>>> and works on tango3 as well?
>>
>> I was hoping to take baby steps to work up to a fully-functional port.
>> The first step (in my mind) is this submission: a minimal port which
>> only requires the two "main" clocks.
>>
>> The next step will add to the minimal port by supporting as many
>> peripherals as possible, as well as their required clocks.
>
> But the code already exists.  Why start over?

M?ns, I don't understand your role in this. Can you clarify?

If you've already done a port, why haven't you contributed it
yourself? Why are you driving Marc's work from the back seat like this
instead of submitting your own work?

If Marc prefers to start with a minimal implementation, that's just
fine with me.


-Olof

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

* [PATCH v9 1/2] arm-soc: Import initial tango4 device tree
  2015-11-18 17:11         ` Olof Johansson
@ 2015-11-18 17:18           ` Måns Rullgård
  2015-11-19 13:53             ` Marc Gonzalez
  0 siblings, 1 reply; 19+ messages in thread
From: Måns Rullgård @ 2015-11-18 17:18 UTC (permalink / raw)
  To: linux-arm-kernel

Olof Johansson <olof@lixom.net> writes:

> On Wed, Nov 18, 2015 at 8:38 AM, M?ns Rullg?rd <mans@mansr.com> wrote:
>> Marc Gonzalez <marc_gonzalez@sigmadesigns.com> writes:
>>
>>> On 18/11/2015 17:05, M?ns Rullg?rd wrote:
>>>
>>>> Marc Gonzalez wrote:
>>>>
>>>>> +           clkgen: clkgen at 10000 {
>>>>> +                   compatible = "sigma,tango4-clkgen";
>>>>> +                   reg = <0x10000 0x40>;
>>>>> +                   clocks = <&xtal>;
>>>>> +                   clock-output-names = "cpuclk", "sysclk";
>>>>> +                   #clock-cells = <1>;
>>>>> +           };
>>>>
>>>> Would you please consider using my clock driver that matches the actual
>>>> hardware, supports all the clock outputs required for USB, SATA, etc,
>>>> and works on tango3 as well?
>>>
>>> I was hoping to take baby steps to work up to a fully-functional port.
>>> The first step (in my mind) is this submission: a minimal port which
>>> only requires the two "main" clocks.
>>>
>>> The next step will add to the minimal port by supporting as many
>>> peripherals as possible, as well as their required clocks.
>>
>> But the code already exists.  Why start over?
>
> M?ns, I don't understand your role in this. Can you clarify?

Oh, I'm just the guy who did all the work and then got screwed over by
Sigma.

> If you've already done a port, why haven't you contributed it
> yourself?

Because it's not yet in a shape to be contributed, just like Marc's
isn't.

> Why are you driving Marc's work from the back seat like this instead
> of submitting your own work?

I have submitted bits and pieces.  It's a slow process.

-- 
M?ns Rullg?rd
mans at mansr.com

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

* [PATCH v9 2/2] arm-soc: Add support for tango4 platforms
  2015-11-18 15:12 ` [PATCH v9 2/2] arm-soc: Add support for tango4 platforms Marc Gonzalez
@ 2015-11-18 18:04   ` Kevin Hilman
  2015-11-18 18:16     ` Måns Rullgård
  2015-11-19 17:24     ` Marc Gonzalez
  2015-11-19 19:49   ` Kevin Hilman
  1 sibling, 2 replies; 19+ messages in thread
From: Kevin Hilman @ 2015-11-18 18:04 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Gonzalez <marc_gonzalez@sigmadesigns.com> writes:

> Add support for Sigma Designs ARM-based Tango4 "Secure Media Processor"
> platforms (i.e. smp8734, smp8756, smp8758, smp8759) built around the
> Cortex-A9 MPCore r3p0 (all dual-core, except the 8756).
>
> Support for older MIPS-based platforms can be found elsewhere:
> https://github.com/mansr/linux-tangox
>
> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
> ---
>  arch/arm/Kconfig              |  2 ++
>  arch/arm/Makefile             |  1 +
>  arch/arm/mach-tangox/Kconfig  | 12 ++++++++++++
>  arch/arm/mach-tangox/Makefile |  2 ++
>  arch/arm/mach-tangox/setup.c  | 32 ++++++++++++++++++++++++++++++++
>  arch/arm/mach-tangox/smc.S    |  9 +++++++++
>  arch/arm/mach-tangox/smc.h    |  5 +++++

Potential bike-shed fodder, but, a dumb question: is the family name
actually "tangox" or is the "x" for the number (tango3, tango4, etc.)

Assuming it's the later based on usage throughout the patch, I think
it'd be better to just use "tango" throughout instead of tangox.

Also a MAINTAINERS file entry is appropriate for this new platform
support (as scripts/checkpatch.pl should have told you.)

Kevin

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

* [PATCH v9 2/2] arm-soc: Add support for tango4 platforms
  2015-11-18 18:04   ` Kevin Hilman
@ 2015-11-18 18:16     ` Måns Rullgård
  2015-11-18 19:39       ` Kevin Hilman
  2015-11-19 17:24     ` Marc Gonzalez
  1 sibling, 1 reply; 19+ messages in thread
From: Måns Rullgård @ 2015-11-18 18:16 UTC (permalink / raw)
  To: linux-arm-kernel

Kevin Hilman <khilman@kernel.org> writes:

> Marc Gonzalez <marc_gonzalez@sigmadesigns.com> writes:
>
>> Add support for Sigma Designs ARM-based Tango4 "Secure Media Processor"
>> platforms (i.e. smp8734, smp8756, smp8758, smp8759) built around the
>> Cortex-A9 MPCore r3p0 (all dual-core, except the 8756).
>>
>> Support for older MIPS-based platforms can be found elsewhere:
>> https://github.com/mansr/linux-tangox
>>
>> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
>> ---
>>  arch/arm/Kconfig              |  2 ++
>>  arch/arm/Makefile             |  1 +
>>  arch/arm/mach-tangox/Kconfig  | 12 ++++++++++++
>>  arch/arm/mach-tangox/Makefile |  2 ++
>>  arch/arm/mach-tangox/setup.c  | 32 ++++++++++++++++++++++++++++++++
>>  arch/arm/mach-tangox/smc.S    |  9 +++++++++
>>  arch/arm/mach-tangox/smc.h    |  5 +++++
>
> Potential bike-shed fodder, but, a dumb question: is the family name
> actually "tangox" or is the "x" for the number (tango3, tango4, etc.)
>
> Assuming it's the later based on usage throughout the patch, I think
> it'd be better to just use "tango" throughout instead of tangox.

The x indeed stands for a number.  I have no idea what tango1 was or if
it ever existed.  Tango2 (SMP863x) and tango3 (SMP86[457]x) were MIPS
based.  Tango4 is ARM based (mostly, the SMP8910 is MIPS) but otherwise
very similar to tango3.  Since we don't know what tango5 will look like,
mach-tango4 might be more suitable here.  If tango5 turns out to be
sufficiently similar, there's no harm from adding support for that to
the mach-tango4 code (just look at mach-omap2).

Most of the drivers support both tango3 and tango4, but apparently some
changes are planned for tango5.

-- 
M?ns Rullg?rd
mans at mansr.com

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

* [PATCH v9 2/2] arm-soc: Add support for tango4 platforms
  2015-11-18 18:16     ` Måns Rullgård
@ 2015-11-18 19:39       ` Kevin Hilman
  0 siblings, 0 replies; 19+ messages in thread
From: Kevin Hilman @ 2015-11-18 19:39 UTC (permalink / raw)
  To: linux-arm-kernel

M?ns Rullg?rd <mans@mansr.com> writes:

> Kevin Hilman <khilman@kernel.org> writes:
>
>> Marc Gonzalez <marc_gonzalez@sigmadesigns.com> writes:
>>
>>> Add support for Sigma Designs ARM-based Tango4 "Secure Media Processor"
>>> platforms (i.e. smp8734, smp8756, smp8758, smp8759) built around the
>>> Cortex-A9 MPCore r3p0 (all dual-core, except the 8756).
>>>
>>> Support for older MIPS-based platforms can be found elsewhere:
>>> https://github.com/mansr/linux-tangox
>>>
>>> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
>>> ---
>>>  arch/arm/Kconfig              |  2 ++
>>>  arch/arm/Makefile             |  1 +
>>>  arch/arm/mach-tangox/Kconfig  | 12 ++++++++++++
>>>  arch/arm/mach-tangox/Makefile |  2 ++
>>>  arch/arm/mach-tangox/setup.c  | 32 ++++++++++++++++++++++++++++++++
>>>  arch/arm/mach-tangox/smc.S    |  9 +++++++++
>>>  arch/arm/mach-tangox/smc.h    |  5 +++++
>>
>> Potential bike-shed fodder, but, a dumb question: is the family name
>> actually "tangox" or is the "x" for the number (tango3, tango4, etc.)
>>
>> Assuming it's the later based on usage throughout the patch, I think
>> it'd be better to just use "tango" throughout instead of tangox.
>
> The x indeed stands for a number.  I have no idea what tango1 was or if
> it ever existed.  Tango2 (SMP863x) and tango3 (SMP86[457]x) were MIPS
> based.  Tango4 is ARM based (mostly, the SMP8910 is MIPS) but otherwise
> very similar to tango3.

Thanks for the clarification.

> Since we don't know what tango5 will look like,
> mach-tango4 might be more suitable here.  If tango5 turns out to be
> sufficiently similar, there's no harm from adding support for that to
> the mach-tango4 code (just look at mach-omap2).

Well, mach-omap2 leads to enough confusion that I don't think we need to
use that as a model. ;)  IMO, mach-tango is a better starting point.

> Most of the drivers support both tango3 and tango4, but apparently some
> changes are planned for tango5.

Thanks for the clarification,

Kevin

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

* [PATCH v9 1/2] arm-soc: Import initial tango4 device tree
  2015-11-18 17:18           ` Måns Rullgård
@ 2015-11-19 13:53             ` Marc Gonzalez
  2015-11-19 14:43               ` Måns Rullgård
  0 siblings, 1 reply; 19+ messages in thread
From: Marc Gonzalez @ 2015-11-19 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

M?ns Rullg?rd wrote:

> Olof Johansson wrote:
> 
>> M?ns Rullg?rd wrote:
>>
>>> Marc Gonzalez wrote:
>>>
>>>> M?ns Rullg?rd wrote:
>>>>
>>>>> Marc Gonzalez wrote:
>>>>>
>>>>>> +           clkgen: clkgen at 10000 {
>>>>>> +                   compatible = "sigma,tango4-clkgen";
>>>>>> +                   reg = <0x10000 0x40>;
>>>>>> +                   clocks = <&xtal>;
>>>>>> +                   clock-output-names = "cpuclk", "sysclk";
>>>>>> +                   #clock-cells = <1>;
>>>>>> +           };
>>>>>
>>>>> Would you please consider using my clock driver that matches the actual
>>>>> hardware, supports all the clock outputs required for USB, SATA, etc,
>>>>> and works on tango3 as well?
>>>>
>>>> I was hoping to take baby steps to work up to a fully-functional port.
>>>> The first step (in my mind) is this submission: a minimal port which
>>>> only requires the two "main" clocks.
>>>>
>>>> The next step will add to the minimal port by supporting as many
>>>> peripherals as possible, as well as their required clocks.
>>>
>>> But the code already exists.  Why start over?

"La perfection est atteinte, non pas lorsqu'il n'y a plus rien ? ajouter,
mais lorsqu'il n'y a plus rien ? retirer."

For example, what is the point of not ignoring sysclk_premux, when the boot
loader has always hard-coded "PLL1 drives sys_clk, PLL2 drives cd_clk".

Having one clk driver for tango3, and another for tango4 allows you to
submit your own tango3 clk driver, and I can then ignore all the insane
tango3 clk legacy, and focus on the tango4 clean-ups. Would that work
for you?

(BTW, are you aware that the clk maintainers will NAK your clk driver in
its current form, based on the fact that they insist on a single node
for the entire clkgen block?)

>> M?ns, I don't understand your role in this. Can you clarify?
> 
> Oh, I'm just the guy who did all the work and then got screwed over by
> Sigma.

Here's the sequence of events, to the best of my recollection.

In 2010, you hacked the Popcorn Hour C-200 (Tango3 SoC)
In 2014-11, I mentioned on LAKML that I planned to upstream Sigma's kernel
In 2014-12, you pushed your tango3 port to github (3.18 at the time IIRC)
	https://github.com/mansr/linux-tangox
In late 2015-02, you blogged about your work
	http://hardwarebug.org/2015/02/26/popcorn-hour-revisited/
I contacted you the next day, and you offered your services.
You met management in late March.
Then radio silence for several months.
Sometime in July, I was told the deal had fallen apart :-(

>> If you've already done a port, why haven't you contributed it
>> yourself?
> 
> Because it's not yet in a shape to be contributed, just like Marc's
> isn't.

Are you saying the DT needs to be perfect on the first submission?
Has this been true for other mach?

>> Why are you driving Marc's work from the back seat like this instead
>> of submitting your own work?
> 
> I have submitted bits and pieces.  It's a slow process.

Indeed. Especially when a maintainer NAKs a patch because one used
'unsigned' instead of 'unsigned int'.

Regards.

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

* [PATCH v9 1/2] arm-soc: Import initial tango4 device tree
  2015-11-19 13:53             ` Marc Gonzalez
@ 2015-11-19 14:43               ` Måns Rullgård
       [not found]                 ` <564EFB18.3050104@sigmadesigns.com>
  0 siblings, 1 reply; 19+ messages in thread
From: Måns Rullgård @ 2015-11-19 14:43 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Gonzalez <marc_gonzalez@sigmadesigns.com> writes:

> M?ns Rullg?rd wrote:
>
>> Olof Johansson wrote:
>> 
>>> M?ns Rullg?rd wrote:
>>>
>>>> Marc Gonzalez wrote:
>>>>
>>>>> M?ns Rullg?rd wrote:
>>>>>
>>>>>> Marc Gonzalez wrote:
>>>>>>
>>>>>>> +           clkgen: clkgen at 10000 {
>>>>>>> +                   compatible = "sigma,tango4-clkgen";
>>>>>>> +                   reg = <0x10000 0x40>;
>>>>>>> +                   clocks = <&xtal>;
>>>>>>> +                   clock-output-names = "cpuclk", "sysclk";
>>>>>>> +                   #clock-cells = <1>;
>>>>>>> +           };
>>>>>>
>>>>>> Would you please consider using my clock driver that matches the actual
>>>>>> hardware, supports all the clock outputs required for USB, SATA, etc,
>>>>>> and works on tango3 as well?
>>>>>
>>>>> I was hoping to take baby steps to work up to a fully-functional port.
>>>>> The first step (in my mind) is this submission: a minimal port which
>>>>> only requires the two "main" clocks.
>>>>>
>>>>> The next step will add to the minimal port by supporting as many
>>>>> peripherals as possible, as well as their required clocks.
>>>>
>>>> But the code already exists.  Why start over?
>
> "La perfection est atteinte, non pas lorsqu'il n'y a plus rien ? ajouter,
> mais lorsqu'il n'y a plus rien ? retirer."
>
> For example, what is the point of not ignoring sysclk_premux, when the boot
> loader has always hard-coded "PLL1 drives sys_clk, PLL2 drives cd_clk".

What if the boot loader changes?  Since we know the structure of the
clock tree, it's safer to check how it is actually configured.

> Having one clk driver for tango3, and another for tango4 allows you to
> submit your own tango3 clk driver, and I can then ignore all the insane
> tango3 clk legacy, and focus on the tango4 clean-ups. Would that work
> for you?

That would be a complete waste.

> (BTW, are you aware that the clk maintainers will NAK your clk driver in
> its current form, based on the fact that they insist on a single node
> for the entire clkgen block?)

Yes, I know that.  It's the third or fourth time they've completely
changed the preferred way of doing clocks.

>>> M?ns, I don't understand your role in this. Can you clarify?
>> 
>> Oh, I'm just the guy who did all the work and then got screwed over by
>> Sigma.
>
> Here's the sequence of events, to the best of my recollection.
>
> In 2010, you hacked the Popcorn Hour C-200 (Tango3 SoC)
> In 2014-11, I mentioned on LAKML that I planned to upstream Sigma's kernel
> In 2014-12, you pushed your tango3 port to github (3.18 at the time IIRC)
> 	https://github.com/mansr/linux-tangox
> In late 2015-02, you blogged about your work
> 	http://hardwarebug.org/2015/02/26/popcorn-hour-revisited/
> I contacted you the next day, and you offered your services.
> You met management in late March.
> Then radio silence for several months.
> Sometime in July, I was told the deal had fallen apart :-(

Something like that, yes.  I'd be less upset with them if there hadn't
been promises made only to be followed by lame excuses and stonewalling.

>>> If you've already done a port, why haven't you contributed it
>>> yourself?
>> 
>> Because it's not yet in a shape to be contributed, just like Marc's
>> isn't.
>
> Are you saying the DT needs to be perfect on the first submission?
> Has this been true for other mach?

There's this notion of "DT is ABI" and must be stable.  Changing
existing bindings is strongly frowned upon.

>>> Why are you driving Marc's work from the back seat like this instead
>>> of submitting your own work?
>> 
>> I have submitted bits and pieces.  It's a slow process.
>
> Indeed. Especially when a maintainer NAKs a patch because one used
> 'unsigned' instead of 'unsigned int'.

That I can live with.  It's more frustrating to have at least a day of
turnaround time for each nitpick like that.  Oh well.

At least the serial port support is upstream.  That's a start.

-- 
M?ns Rullg?rd
mans at mansr.com

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

* [PATCH v9 2/2] arm-soc: Add support for tango4 platforms
  2015-11-18 18:04   ` Kevin Hilman
  2015-11-18 18:16     ` Måns Rullgård
@ 2015-11-19 17:24     ` Marc Gonzalez
  2015-11-19 19:32       ` Kevin Hilman
  1 sibling, 1 reply; 19+ messages in thread
From: Marc Gonzalez @ 2015-11-19 17:24 UTC (permalink / raw)
  To: linux-arm-kernel

Kevin Hilman wrote:

> Marc Gonzalez wrote:
> 
>> Add support for Sigma Designs ARM-based Tango4 "Secure Media Processor"
>> platforms (i.e. smp8734, smp8756, smp8758, smp8759) built around the
>> Cortex-A9 MPCore r3p0 (all dual-core, except the 8756).
>>
>> Support for older MIPS-based platforms can be found elsewhere:
>> https://github.com/mansr/linux-tangox
>>
>> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
>> ---
>>  arch/arm/Kconfig              |  2 ++
>>  arch/arm/Makefile             |  1 +
>>  arch/arm/mach-tangox/Kconfig  | 12 ++++++++++++
>>  arch/arm/mach-tangox/Makefile |  2 ++
>>  arch/arm/mach-tangox/setup.c  | 32 ++++++++++++++++++++++++++++++++
>>  arch/arm/mach-tangox/smc.S    |  9 +++++++++
>>  arch/arm/mach-tangox/smc.h    |  5 +++++
> 
> Potential bike-shed fodder, but, a dumb question: is the family name
> actually "tangox" or is the "x" for the number (tango3, tango4, etc.)
> 
> Assuming it's the later based on usage throughout the patch, I think
> it'd be better to just use "tango" throughout instead of tangox.

I should just change tangox to tango everywhere?

This port supports tango4. I will submit a tango5 port in 2016.
Does that change anything?

> Also a MAINTAINERS file entry is appropriate for this new platform
> support (as scripts/checkpatch.pl should have told you.)

Thanks for pointing that out. I'll send a v10.
Are these the only issues in your opinion?

Regards.

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

* [PATCH v9 2/2] arm-soc: Add support for tango4 platforms
  2015-11-19 17:24     ` Marc Gonzalez
@ 2015-11-19 19:32       ` Kevin Hilman
  0 siblings, 0 replies; 19+ messages in thread
From: Kevin Hilman @ 2015-11-19 19:32 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Gonzalez <marc_gonzalez@sigmadesigns.com> writes:

> Kevin Hilman wrote:
>
>> Marc Gonzalez wrote:
>> 
>>> Add support for Sigma Designs ARM-based Tango4 "Secure Media Processor"
>>> platforms (i.e. smp8734, smp8756, smp8758, smp8759) built around the
>>> Cortex-A9 MPCore r3p0 (all dual-core, except the 8756).
>>>
>>> Support for older MIPS-based platforms can be found elsewhere:
>>> https://github.com/mansr/linux-tangox
>>>
>>> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
>>> ---
>>>  arch/arm/Kconfig              |  2 ++
>>>  arch/arm/Makefile             |  1 +
>>>  arch/arm/mach-tangox/Kconfig  | 12 ++++++++++++
>>>  arch/arm/mach-tangox/Makefile |  2 ++
>>>  arch/arm/mach-tangox/setup.c  | 32 ++++++++++++++++++++++++++++++++
>>>  arch/arm/mach-tangox/smc.S    |  9 +++++++++
>>>  arch/arm/mach-tangox/smc.h    |  5 +++++
>> 
>> Potential bike-shed fodder, but, a dumb question: is the family name
>> actually "tangox" or is the "x" for the number (tango3, tango4, etc.)
>> 
>> Assuming it's the later based on usage throughout the patch, I think
>> it'd be better to just use "tango" throughout instead of tangox.
>
> I should just change tangox to tango everywhere?

IMO, yes.

> This port supports tango4. I will submit a tango5 port in 2016.
> Does that change anything?

Probably not.  I'm assuming it's an SoC in the same family, so the goal
should be to support both from the same mach dir.  Most of the "real"
support should end up in drivers/* and DT descriptions, so the mach
directory should stay very small.

>> Also a MAINTAINERS file entry is appropriate for this new platform
>> support (as scripts/checkpatch.pl should have told you.)
>
> Thanks for pointing that out. I'll send a v10.
> Are these the only issues in your opinion?

I have a couple comments, I'll reply separately.

Kevin

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

* [PATCH v9 2/2] arm-soc: Add support for tango4 platforms
  2015-11-18 15:12 ` [PATCH v9 2/2] arm-soc: Add support for tango4 platforms Marc Gonzalez
  2015-11-18 18:04   ` Kevin Hilman
@ 2015-11-19 19:49   ` Kevin Hilman
  2015-11-20 10:04     ` Marc Gonzalez
  1 sibling, 1 reply; 19+ messages in thread
From: Kevin Hilman @ 2015-11-19 19:49 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Gonzalez <marc_gonzalez@sigmadesigns.com> writes:

> Add support for Sigma Designs ARM-based Tango4 "Secure Media Processor"
> platforms (i.e. smp8734, smp8756, smp8758, smp8759) built around the
> Cortex-A9 MPCore r3p0 (all dual-core, except the 8756).
>
> Support for older MIPS-based platforms can be found elsewhere:
> https://github.com/mansr/linux-tangox
>
> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>

[...]

> +static void tango_l2c_write(unsigned long val, unsigned int reg)
> +{
> +	pr_debug("%s: reg=0x%x val=0x%lx\n", __func__, reg, val);

leftover debugging aid?

> +	if (reg == L2X0_CTRL)
> +		tango_set_l2_control(val);
> +}
> +

[...]

> diff --git a/arch/arm/mach-tangox/smc.S b/arch/arm/mach-tangox/smc.S
> new file mode 100644
> index 000000000000..5d932ce3c1bd
> --- /dev/null
> +++ b/arch/arm/mach-tangox/smc.S
> @@ -0,0 +1,9 @@
> +#include <linux/linkage.h>
> +
> +ENTRY(tango_smc)
> +	push	{lr}
> +	mov	ip, r1
> +	dsb	/* This barrier is probably unnecessary */

Then remove it?

> +	smc	#0
> +	pop	{pc}
> +ENDPROC(tango_smc)

Otherwise looks pretty simple and straight forward to me.

FWIW, one of the benefits of starting with the small/minimum set and
adding as you go is that it's much easier on reviewers.

Kevin

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

* [PATCH v9 2/2] arm-soc: Add support for tango4 platforms
  2015-11-19 19:49   ` Kevin Hilman
@ 2015-11-20 10:04     ` Marc Gonzalez
  2015-11-24 18:05       ` Kevin Hilman
  0 siblings, 1 reply; 19+ messages in thread
From: Marc Gonzalez @ 2015-11-20 10:04 UTC (permalink / raw)
  To: linux-arm-kernel

On 19/11/2015 20:49, Kevin Hilman wrote:

> Marc Gonzalez wrote:
> 
>> +static void tango_l2c_write(unsigned long val, unsigned int reg)
>> +{
>> +	pr_debug("%s: reg=0x%x val=0x%lx\n", __func__, reg, val);
> 
> leftover debugging aid?

I'll remove it.

(For my education, we're not supposed to use any pr_debug calls?)


>> +ENTRY(tango_smc)
>> +	push	{lr}
>> +	mov	ip, r1
>> +	dsb	/* This barrier is probably unnecessary */
> 
> Then remove it?

This was discussed in v8. It's probably cargo cult from OMAP,
but the performance hit is negligible, and I don't have time
to properly analyze the code path. I just wanted to add the
comment in case someone copied my code.

Regards.

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

* Tango4 clkgen block
       [not found]                 ` <564EFB18.3050104@sigmadesigns.com>
@ 2015-11-20 12:08                   ` Måns Rullgård
  0 siblings, 0 replies; 19+ messages in thread
From: Måns Rullgård @ 2015-11-20 12:08 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Gonzalez <marc_gonzalez@sigmadesigns.com> writes:

> M?ns Rullg?rd wrote:
>
>> Marc Gonzalez wrote:
>> 
>>> For example, what is the point of not ignoring sysclk_premux, when the boot
>>> loader has always hard-coded "PLL1 drives sys_clk, PLL2 drives cd_clk".
>> 
>> What if the boot loader changes?  Since we know the structure of the
>> clock tree, it's safer to check how it is actually configured.
>
> In my opinion, this might be the problem.
>
> You think you grok the clkgen block, based on
>
> 1) buggy driver code written by Sigma
> 2) obsolete and/or incorrect documentation (it mentions tango1 for crying out loud)
> 3) limited testing on 8642 and 8759

I also have documentation for SMP8654 that I found on some Chinese web
site.  I've played around with most of the controls, and things behave
as expected.  Where the Sigma code and documentation are ambiguous or
disagree, I have tested what the hardware actually does for various
values.

-- 
M?ns Rullg?rd
mans at mansr.com

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

* [PATCH v9 2/2] arm-soc: Add support for tango4 platforms
  2015-11-20 10:04     ` Marc Gonzalez
@ 2015-11-24 18:05       ` Kevin Hilman
  0 siblings, 0 replies; 19+ messages in thread
From: Kevin Hilman @ 2015-11-24 18:05 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Gonzalez <marc_gonzalez@sigmadesigns.com> writes:

> On 19/11/2015 20:49, Kevin Hilman wrote:
>
>> Marc Gonzalez wrote:
>> 
>>> +static void tango_l2c_write(unsigned long val, unsigned int reg)
>>> +{
>>> +	pr_debug("%s: reg=0x%x val=0x%lx\n", __func__, reg, val);
>> 
>> leftover debugging aid?
>
> I'll remove it.
>
> (For my education, we're not supposed to use any pr_debug calls?)

pr_debug() are fine to leave if you want them, but I assumed it was just
a leftover as it didn't seem generally useful.

>>> +ENTRY(tango_smc)
>>> +	push	{lr}
>>> +	mov	ip, r1
>>> +	dsb	/* This barrier is probably unnecessary */
>> 
>> Then remove it?
>
> This was discussed in v8. It's probably cargo cult from OMAP,
> but the performance hit is negligible, and I don't have time
> to properly analyze the code path. I just wanted to add the
> comment in case someone copied my code.

Sure,

Kevin

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

end of thread, other threads:[~2015-11-24 18:05 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18 15:09 [PATCH v9 0/2] Sigma Designs Tango4 port Marc Gonzalez
2015-11-18 15:10 ` [PATCH v9 1/2] arm-soc: Import initial tango4 device tree Marc Gonzalez
2015-11-18 16:05   ` Måns Rullgård
2015-11-18 16:34     ` Marc Gonzalez
2015-11-18 16:38       ` Måns Rullgård
2015-11-18 17:11         ` Olof Johansson
2015-11-18 17:18           ` Måns Rullgård
2015-11-19 13:53             ` Marc Gonzalez
2015-11-19 14:43               ` Måns Rullgård
     [not found]                 ` <564EFB18.3050104@sigmadesigns.com>
2015-11-20 12:08                   ` Tango4 clkgen block Måns Rullgård
2015-11-18 15:12 ` [PATCH v9 2/2] arm-soc: Add support for tango4 platforms Marc Gonzalez
2015-11-18 18:04   ` Kevin Hilman
2015-11-18 18:16     ` Måns Rullgård
2015-11-18 19:39       ` Kevin Hilman
2015-11-19 17:24     ` Marc Gonzalez
2015-11-19 19:32       ` Kevin Hilman
2015-11-19 19:49   ` Kevin Hilman
2015-11-20 10:04     ` Marc Gonzalez
2015-11-24 18:05       ` Kevin Hilman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.