Sigma Designs Tango4 port
Subsystems (4)
v9 cover Sigma Designs Tango4 port
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
Signature · 1 line
2.4.5
PATCH v9 1/2 arm-soc: Import initial tango4 device tree
This device tree was tested on a Sigma Designs SMP8758 Vantage-1172 development board.
--- 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
arch/arm/boot/dts/Makefile +2 -0
@@ -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 \
arch/arm/boot/dts/tango4-common.dtsi new file +121 -0
121 lines not on this page · raw message
arch/arm/boot/dts/tango4-smp8758.dtsi new file +31 -0
@@ -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>; + }; +};
arch/arm/boot/dts/tango4-vantage-1172.dts new file +29 -0
@@ -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 */ + }; +}; + +ð0 { + phy-connection-type = "rgmii"; + phy-handle = <ð0_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>; + }; +};
Signature · 1 line
2.4.5
PATCH v9 2/2 arm-soc: Add support for tango4 platforms
In reply to Marc GonzalezAdd 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
--- 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
arch/arm/Kconfig +2 -0
@@ -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"
arch/arm/Makefile +1 -0
@@ -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
arch/arm/mach-tangox/Kconfig new file +12 -0
@@ -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
arch/arm/mach-tangox/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +asflags-y += -mcpu=cortex-a9 +obj-y += setup.o smc.o
arch/arm/mach-tangox/setup.c new file +32 -0
@@ -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
arch/arm/mach-tangox/smc.S new file +9 -0
@@ -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)
arch/arm/mach-tangox/smc.h new file +5 -0
@@ -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)
Signature · 1 line
2.4.5
PATCH v9 1/2 arm-soc: Import initial tango4 device tree
In reply to Marc Gonzalezarch/arm/boot/dts/tango4-common.dtsi line 67
Quoted 7 lines · Marc Gonzalez
arch/arm/boot/dts/tango4-common.dtsi new file +7
-0+ 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?
Signature · 2 lines
M?ns Rullg?rd mans at mansr.com
PATCH v9 1/2 arm-soc: Import initial tango4 device tree
Quoted 13 lines · M?ns Rullg?rd
arch/arm/boot/dts/tango4-common.dtsi line 67
Quoted 7 lines · Marc Gonzalez
arch/arm/boot/dts/tango4-common.dtsi new file +7
-0+ 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.
PATCH v9 1/2 arm-soc: Import initial tango4 device tree
Quoted 16 lines · Marc Gonzalez
Quoted 13 lines · M?ns Rullg?rd
arch/arm/boot/dts/tango4-common.dtsi line 67
Quoted 7 lines · Marc Gonzalez
arch/arm/boot/dts/tango4-common.dtsi new file +7
-0+ 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?
Quoted 6 lines
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?
Quoted 3 lines
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.
Signature · 2 lines
M?ns Rullg?rd mans at mansr.com
PATCH v9 1/2 arm-soc: Import initial tango4 device tree
Quoted 18 lines · M?ns Rullg?rd
Quoted 16 lines · Marc Gonzalez
Quoted 13 lines · M?ns Rullg?rd
arch/arm/boot/dts/tango4-common.dtsi line 67
Quoted 7 lines · Marc Gonzalez
arch/arm/boot/dts/tango4-common.dtsi new file +7
-0+ 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?
Quoted 8 lines
Quoted 6 lines
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
PATCH v9 1/2 arm-soc: Import initial tango4 device tree
Quoted 23 lines · Olof Johansson
Quoted 22 lines · M?ns Rullg?rd
Quoted 20 lines · Marc Gonzalez
Quoted 10 lines · M?ns Rullg?rd
arch/arm/boot/dts/tango4-common.dtsi line 67
Quoted 7 lines · Marc Gonzalez
arch/arm/boot/dts/tango4-common.dtsi new file +7
-0+ clkgen: clkgen at 10000 { + compatible = "sigma,tango4-clkgen"; + reg = <0x10000 0x40>; + clocks = <&xtal>; + clock-output-names = "cpuclk", "sysclk"; + #clock-cells = <1>; + };Quoted 3 lines
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.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
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.
Quoted 2 lines
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.
Quoted 2 lines
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.
Signature · 2 lines
M?ns Rullg?rd mans at mansr.com
PATCH v9 2/2 arm-soc: Add support for tango4 platforms
In reply to Marc GonzalezQuoted 8 lines · Marc Gonzalez
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-tangoxSigned-off-by Marc Gonzalez <[email protected]>
Quoted 8 lines
--- 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
PATCH v9 2/2 arm-soc: Add support for tango4 platforms
Quoted 19 lines · Kevin Hilman
Quoted 8 lines · Marc Gonzalez
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-tangoxSigned-off-by Marc Gonzalez <[email protected]>Quoted 8 lines
--- 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 +++++
Quoted 5 lines
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.
Signature · 2 lines
M?ns Rullg?rd mans at mansr.com
PATCH v9 2/2 arm-soc: Add support for tango4 platforms
Quoted 24 lines · M?ns Rullg?rd
Quoted 22 lines · Kevin Hilman
Quoted 8 lines · Marc Gonzalez
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-tangoxSigned-off-by Marc Gonzalez <[email protected]>Quoted 8 lines
--- 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.)
Quoted 7 lines
Quoted 2 lines
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.
Quoted 4 lines
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.
Quoted 2 lines
Most of the drivers support both tango3 and tango4, but apparently some changes are planned for tango5.
Thanks for the clarification,
Kevin
PATCH v9 1/2 arm-soc: Import initial tango4 device tree
In reply to Måns RullgårdQuoted 22 lines · M?ns Rullg?rd
Quoted 20 lines · Olof Johansson
Quoted 18 lines · M?ns Rullg?rd
Quoted 16 lines · Marc Gonzalez
Quoted 13 lines · M?ns Rullg?rd
arch/arm/boot/dts/tango4-common.dtsi line 67
Quoted 7 lines · Marc Gonzalez
arch/arm/boot/dts/tango4-common.dtsi new file +7
-0+ 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?
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
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?)
Quoted 4 lines
Quoted 1 line
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 :-(
Quoted 5 lines
Quoted 2 lines
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?
Quoted 4 lines
Quoted 2 lines
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.
PATCH v9 1/2 arm-soc: Import initial tango4 device tree
Quoted 31 lines · Marc Gonzalez
Quoted 29 lines · M?ns Rullg?rd
Quoted 27 lines · Olof Johansson
Quoted 25 lines · M?ns Rullg?rd
Quoted 22 lines · Marc Gonzalez
Quoted 10 lines · M?ns Rullg?rd
Review
Quoted 7 lines · Marc Gonzalez
(quoted diff) +7
-0+ clkgen: clkgen at 10000 { + compatible = "sigma,tango4-clkgen"; + reg = <0x10000 0x40>; + clocks = <&xtal>; + clock-output-names = "cpuclk", "sysclk"; + #clock-cells = <1>; + };Quoted 3 lines
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.
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
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 drivessys_clk, PLL2 drivescd_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.
Quoted 4 lines
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.
Quoted 3 lines
(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.
Quoted 12 lines
Quoted 4 lines
Quoted 1 line
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
Quoted 5 lines
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.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
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.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
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.
Signature · 2 lines
M?ns Rullg?rd mans at mansr.com
PATCH v9 2/2 arm-soc: Add support for tango4 platforms
In reply to Kevin HilmanQuoted 19 lines · Kevin Hilman
Quoted 8 lines · Marc Gonzalez
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-tangoxSigned-off-by Marc Gonzalez <[email protected]>Quoted 8 lines
--- 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 +++++
Quoted 5 lines
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?
Quoted 2 lines
Also a
MAINTAINERSfile entry is appropriate for this new platform support (asscripts/checkpatch.plshould have told you.)
Thanks for pointing that out. I'll send a v10.
Are these the only issues in your opinion?
Regards.
PATCH v9 2/2 arm-soc: Add support for tango4 platforms
Quoted 21 lines · Marc Gonzalez
Quoted 19 lines · Kevin Hilman
Quoted 16 lines · Marc Gonzalez
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-tangoxSigned-off-by Marc Gonzalez <[email protected]>--- 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 +++++
Quoted 7 lines
Quoted 5 lines
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.
Quoted 2 lines
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.
Quoted 5 lines
Quoted 2 lines
Also a
MAINTAINERSfile entry is appropriate for this new platform support (asscripts/checkpatch.plshould 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
PATCH v9 2/2 arm-soc: Add support for tango4 platforms
In reply to Marc GonzalezQuoted 8 lines · Marc Gonzalez
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-tangoxSigned-off-by Marc Gonzalez <[email protected]>
[...]
arch/arm/mach-tangox/setup.c line 21
Quoted 3 lines
arch/arm/mach-tangox/setup.c new file +3
-0+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?
Quoted 4 lines
arch/arm/mach-tangox/setup.c new file +4
-0+if (reg ==L2X0_CTRL ) +tango_set_l2_control (val); +} +
[...]
arch/arm/mach-tangox/smc.S line 6
Quoted 12 lines
arch/arm/mach-tangox/smc.S new file +6
-0@@ -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?
arch/arm/mach-tangox/smc.S line 9
Quoted 3 lines
arch/arm/mach-tangox/smc.S new file +3
-0+ 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
PATCH v9 2/2 arm-soc: Add support for tango4 platforms
Quoted 7 lines · Kevin Hilman
arch/arm/mach-tangox/setup.c line 21
Quoted 3 lines · Marc Gonzalez
arch/arm/mach-tangox/setup.c new file +3
-0+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?)
Quoted 6 lines
arch/arm/mach-tangox/smc.S line 6
Quoted 4 lines
arch/arm/mach-tangox/smc.S new file +4
-0+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.
Tango4 clkgen block
In reply to a message not in the archiveQuoted 10 lines · Marc Gonzalez
Quoted 7 lines · M?ns Rullg?rd
Quoted 2 lines · Marc Gonzalez
For example, what is the point of not ignoring
sysclk_premux, when the boot loader has always hard-coded "PLL1 drivessys_clk, PLL2 drivescd_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.
Quoted 7 lines
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.
Signature · 2 lines
M?ns Rullg?rd mans at mansr.com
PATCH v9 2/2 arm-soc: Add support for tango4 platforms
In reply to Marc GonzalezQuoted 10 lines · Marc Gonzalez
Quoted 7 lines · Kevin Hilman
arch/arm/mach-tangox/setup.c line 21
Quoted 3 lines · Marc Gonzalez
arch/arm/mach-tangox/setup.c new file +3
-0+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?
Quoted 3 lines
I'll remove it.
(For my education, we're not supposed to use any
pr_debugcalls?)
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.
Quoted 11 lines
Quoted 6 lines
arch/arm/mach-tangox/smc.S line 6
Quoted 4 lines
arch/arm/mach-tangox/smc.S new file +4
-0+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