Skip to contentSkip to conversation

arm/dt: tegra devicetree support

PATCH In review Grant Likely 5 participants 13 messages Jul 19, 2011 – Jul 20, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm/dt: tegra devicetree support

Everything required to populate NVIDIA Tegra devices from the device tree. This patch adds a new DT_MACHINE_DESC() which matches against a tegra20 device tree. So far it only registers the on-chip devices, but it will be refined in follow on patches to configure clocks and pin IO from the device tree also.

---

Hi all,

Similar to the versatile patch I just posted, this is certainly not complete board support, but it is enough to be useful. I'd like to merge this for v3.1. It should not break any existing board support.

g.

 arch/arm/boot/dts/tegra-harmony.dts  |   70 ++++++++++++++++
 arch/arm/boot/dts/tegra-seaboard.dts |   28 ++++++
 arch/arm/boot/dts/tegra20.dtsi       |  148 ++++++++++++++++++++++++++++++++++
 arch/arm/mach-tegra/Kconfig          |    6 +
 arch/arm/mach-tegra/Makefile         |    3 +
 arch/arm/mach-tegra/Makefile.boot    |    3 +
 arch/arm/mach-tegra/board-dt.c       |  117 +++++++++++++++++++++++++++
 7 files changed, 375 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/tegra-harmony.dts
 create mode 100644 arch/arm/boot/dts/tegra-seaboard.dts
 create mode 100644 arch/arm/boot/dts/tegra20.dtsi
 create mode 100644 arch/arm/mach-tegra/board-dt.c
arch/arm/boot/dts/tegra-harmony.dts new file +70 -0
new file mode 100644
index 0000000..4c05334
@@ -0,0 +1,70 @@
+/dts-v1/;
+
+/memreserve/ 0x1c000000 0x04000000;
+/include/ "tegra20.dtsi"
+
+/ {
+	model = "NVIDIA Tegra2 Harmony evaluation board";
+	compatible = "nvidia,harmony", "nvidia,tegra20";
+
+	chosen {
+		bootargs = "vmalloc=192M video=tegrafb console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw rootwait";
+	};
+
+	memory at 0 {
+		reg = < 0x00000000 0x40000000 >;
+	};
+
+	i2c at 7000c000 {
+		clock-frequency = <400000>;
+
+		codec: wm8903 at 1a {
+			compatible = "wlf,wm8903";
+			reg = <0x1a>;
+			interrupts = < 347 >;
+
+			gpio-controller;
+			#gpio-cells = <2>;
+
+			/* 0x8000 = Not configured */
+			gpio-cfg = < 0x8000 0x8000 0 0x8000 0x8000 >;
+		};
+	};
+
+	i2c at 7000c400 {
+		clock-frequency = <400000>;
+	};
+
+	i2c at 7000c500 {
+		clock-frequency = <400000>;
+	};
+
+	i2c at 7000d000 {
+		clock-frequency = <400000>;
+	};
+
+	sound {
+		compatible = "nvidia,harmony-sound", "nvidia,tegra-wm8903";
+
+		spkr-en-gpios = <&codec 2 0>;
+		hp-det-gpios = <&gpio 178 0>;
+		int-mic-en-gpios = <&gpio 184 0>;
+		ext-mic-en-gpios = <&gpio 185 0>;
+	};
+
+	serial at 70006300 {
+		clock-frequency = < 216000000 >;
+	};
+
+	sdhci at c8000200 {
+		gpios = <&gpio 69 0>, /* cd, gpio PI5 */
+			<&gpio 57 0>, /* wp, gpio PH1 */
+			<&gpio 155 0>; /* power, gpio PT3 */
+	};
+
+	sdhci at c8000600 {
+		gpios = <&gpio 58 0>, /* cd, gpio PH2 */
+			<&gpio 59 0>, /* wp, gpio PH3 */
+			<&gpio 70 0>; /* power, gpio PI6 */
+	};
+};
arch/arm/boot/dts/tegra-seaboard.dts new file +28 -0
new file mode 100644
index 0000000..1940cae
@@ -0,0 +1,28 @@
+/dts-v1/;
+
+/memreserve/ 0x1c000000 0x04000000;
+/include/ "tegra20.dtsi"
+
+/ {
+	model = "NVIDIA Seaboard";
+	compatible = "nvidia,seaboard", "nvidia,tegra20";
+
+	chosen {
+		bootargs = "vmalloc=192M video=tegrafb console=ttyS0,115200n8 root=/dev/mmcblk1p3 rw rootwait";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = < 0x00000000 0x40000000 >;
+	};
+
+	serial at 70006300 {
+		clock-frequency = < 216000000 >;
+	};
+
+	sdhci at c8000400 {
+		gpios = <&gpio 69 0>, /* cd, gpio PI5 */
+			<&gpio 57 0>, /* wp, gpio PH1 */
+			<&gpio 70 0>; /* power, gpio PI6 */
+	};
+};
arch/arm/boot/dts/tegra20.dtsi new file +148 -0

148 lines not on this page · raw message

arch/arm/mach-tegra/Kconfig +6 -0
index 5ec1846..4b8abf9 100644
@@ -51,6 +51,12 @@ config MACH_SEABOARD
 	 also be included for some of the derivative boards that
 	 have large similarities with the seaboard design.
 
+config MACH_TEGRA_DT
+	bool "Generic Tegra board (FDT support)"
+	select USE_OF
+	help
+	  Support for generic nVidia Tegra boards using Flattened Device Tree
+
 config MACH_TRIMSLICE
        bool "TrimSlice board"
        select TEGRA_PCI
arch/arm/mach-tegra/Makefile +3 -0
index 823c703..6d3d695 100644
@@ -30,5 +30,8 @@ obj-${CONFIG_MACH_PAZ00}		+= board-paz00-pinmux.o
 obj-${CONFIG_MACH_SEABOARD}             += board-seaboard.o
 obj-${CONFIG_MACH_SEABOARD}             += board-seaboard-pinmux.o
 
+obj-${CONFIG_MACH_TEGRA_DT}             += board-dt.o
+obj-${CONFIG_MACH_TEGRA_DT}             += board-harmony-pinmux.o
+
 obj-${CONFIG_MACH_TRIMSLICE}            += board-trimslice.o
 obj-${CONFIG_MACH_TRIMSLICE}            += board-trimslice-pinmux.o
arch/arm/mach-tegra/Makefile.boot +3 -0
index db52d61..428ad12 100644
@@ -1,3 +1,6 @@
 zreladdr-$(CONFIG_ARCH_TEGRA_2x_SOC)	:= 0x00008000
 params_phys-$(CONFIG_ARCH_TEGRA_2x_SOC)	:= 0x00000100
 initrd_phys-$(CONFIG_ARCH_TEGRA_2x_SOC)	:= 0x00800000
+
+dtb-$(CONFIG_MACH_HARMONY) += tegra-harmony.dtb
+dtb-$(CONFIG_MACH_SEABOARD) += tegra-seaboard.dtb
arch/arm/mach-tegra/board-dt.c new file +117 -0

117 lines not on this page · raw message

Acked-by on v1 1/1
#1 lore raw

Nice!

Quoted 7 lines · Grant Likely

Everything required to populate NVIDIA Tegra devices from the device tree. ?This patch adds a new DT_MACHINE_DESC() which matches against a tegra20 device tree. ?So far it only registers the on-chip devices, but it will be refined in follow on patches to configure clocks and pin IO from the device tree also.

Minor nit:

arch/arm/boot/dts/tegra20.dtsi line 4

Quoted 6 lines

+++ b/arch/arm/boot/dts/tegra20.dtsi

arch/arm/boot/dts/tegra20.dtsi new file +4 -0
@@ -0,0 +1,148 @@
+/include/ "skeleton.dtsi"
+
+/ {
+ ? ? ? model = "NVIDIA Tegra 250";

NVIDIA Tegra2 or Tegra20 to be more in line with the recent 250->20 conversion (and Harmony)

#2 lore raw
Quoted 17 lines · Olof Johansson

Nice!

Quoted 7 lines · Grant Likely

Everything required to populate NVIDIA Tegra devices from the device tree. ?This patch adds a new DT_MACHINE_DESC() which matches against a tegra20 device tree. ?So far it only registers the on-chip devices, but it will be refined in follow on patches to configure clocks and pin IO from the device tree also.

Minor nit:

Quoted 9 lines

arch/arm/boot/dts/tegra20.dtsi line 4

Quoted 6 lines

+++ b/arch/arm/boot/dts/tegra20.dtsi

arch/arm/boot/dts/tegra20.dtsi new file +4 -0
@@ -0,0 +1,148 @@
+/include/ "skeleton.dtsi"
+
+/ {
+ ? ? ? model = "NVIDIA Tegra 250";

NVIDIA Tegra2 or Tegra20 to be more in line with the recent 250->20 conversion (and Harmony)

I'll remove the model property entirely. It doesn't make any sense for the soc include file since "model" describes the system.

g.

#3 lore raw
In reply to Grant Likely

Grant Likely wrote at Tuesday, July 19, 2011 5:43 PM:

arch/arm/boot/dts/tegra-harmony.dts

Quoted 16 lines

Everything required to populate NVIDIA Tegra devices from the device tree. This patch adds a new DT_MACHINE_DESC() which matches against a tegra20 device tree. So far it only registers the on-chip devices, but it will be refined in follow on patches to configure clocks and pin IO from the device tree also.

---

Hi all,

Similar to the versatile patch I just posted, this is certainly not complete board support, but it is enough to be useful. I'd like to merge this for v3.1. It should not break any existing board support.

arch/arm/boot/dts/tegra-harmony.dts +0 -0

tegra-*.dts don't include status="disable" for all the unused controllers. Should that be added?

arch/arm/boot/dts/tegra-harmony.dts line 47

Quoted 2 lines
arch/arm/boot/dts/tegra-harmony.dts +2 -0
+	sound {
+		compatible = "nvidia,harmony-sound", "nvidia,tegra-wm8903";

I thought the sound bindings were still somewhat experimental and not completely agreed upon. One issue I see is that Device Tree is supposed to represent pure HW, rather than driver-required abstractions, and at least the compatible name here is pretty Linux-driver-specific.

I think there are some devices missing from the DT file for audio too, e.g. the ALSA "PCM" (DMA) driver.

Also, the bindings for this aren't documented IIRC.

I'd suggest dropping the audio part of the DT file until the audio side is more mature.

arch/arm/boot/dts/tegra-harmony.dts line 49

Quoted 1 line
arch/arm/boot/dts/tegra-harmony.dts +1 -0
+		spkr-en-gpios = <&codec 2 0>;

Should that be "gpio" not "gpios", since there is only one?

Quoted 6 lines
arch/arm/boot/dts/tegra-harmony.dts +4 -0
+		hp-det-gpios = <&gpio 178 0>;
+		int-mic-en-gpios = <&gpio 184 0>;
+		ext-mic-en-gpios = <&gpio 185 0>;
+	};
arch/arm/boot/dts/tegra20.dtsi +0 -0

...

Quoted 1 line

+/ {

...

Quoted 2 lines
arch/arm/boot/dts/tegra20.dtsi +2 -0
+	amba {
+		compatible = "simple-bus";

...

Quoted 1 line
arch/arm/boot/dts/tegra20.dtsi +1 -0
+		intc: interrupt-controller at 50041000 {

...

Quoted 2 lines
arch/arm/boot/dts/tegra20.dtsi +2 -0
+		};
+	};

...

arch/arm/boot/dts/tegra20.dtsi

Quoted 1 line
arch/arm/boot/dts/tegra20.dtsi +1 -0
+	i2c at 7000c000 {

I've always wondered why all the devices aren't included inside the amba node. Or put another way, if the devices are outside the amba node, why not move everything outside the amba node and remove the amba node?

arch/arm/mach-tegra/Makefile obj-${CONFIG_MACH_PAZ00} += board-paz00-pinmux.o · line 34

Quoted 10 lines
arch/arm/mach-tegra/Makefile +2 -0
index 823c703..6d3d695 100644
@@ -30,5 +30,8 @@ obj-${CONFIG_MACH_PAZ00}		+= board-paz00-pinmux.o
 obj-${CONFIG_MACH_SEABOARD}             += board-seaboard.o
 obj-${CONFIG_MACH_SEABOARD}             += board-seaboard-pinmux.o
 
+obj-${CONFIG_MACH_TEGRA_DT}             += board-dt.o
+obj-${CONFIG_MACH_TEGRA_DT}             += board-harmony-pinmux.o

You need board-seaboard-pinmux.o here too.

Quoted 1 line
arch/arm/mach-tegra/board-dt.c +0 -0

...

arch/arm/mach-tegra/board-dt.c line 70

Quoted 5 lines
arch/arm/mach-tegra/board-dt.c +5 -0
+static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
+	/* name		parent		rate		enabled */
+	{ "uartd",	"pll_p",	216000000,	true },
+	{ NULL,		NULL,		0,		0},
+};

For audio to work, you'll need more clock entries here currently; another reason I suggested to simply drop the audio stuff for now to keep things simple.

Quoted 1 line

+static void __init tegra_dt_init(void)

...

arch/arm/mach-tegra/board-dt.c line 96

Quoted 4 lines
arch/arm/mach-tegra/board-dt.c +4 -0
+	if (of_machine_is_compatible("nvidia,harmony"))
+		harmony_pinmux_init();
+	else if (of_machine_is_compatible("nvidia,seaboard"))
+		seaboard_pinmux_init();

else error, or at least warn?

Signature · 1 line
nvpublic
#4 lore raw
Quoted 9 lines · Stephen Warren

Grant Likely wrote at Tuesday, July 19, 2011 5:43 PM:

arch/arm/boot/dts/tegra-harmony.dts line 47

Quoted 2 lines
arch/arm/boot/dts/tegra-harmony.dts new file +2 -0
+	sound {
+		compatible = "nvidia,harmony-sound", "nvidia,tegra-wm8903";

I thought the sound bindings were still somewhat experimental and not completely agreed upon. One issue I see is that Device Tree is supposed to represent pure HW, rather than driver-required abstractions, and at least the compatible name here is pretty Linux-driver-specific.

The current decision is that the schematic for embedded audio hardware is sufficiently interesting to be considered hardware in its own right separately to the chips contained within it.

Quoted 3 lines

arch/arm/boot/dts/tegra-harmony.dts line 49

Quoted 1 line
arch/arm/boot/dts/tegra-harmony.dts new file +1 -0
+		spkr-en-gpios = <&codec 2 0>;

Should that be "gpio" not "gpios", since there is only one?

There's only one in this board but one does see designs with separate left and right channel enables sometimes, or separate front and back speaker enables for phones.

#5 lore raw
Quoted 11 lines · Mark Brown
Quoted 9 lines · Stephen Warren

Grant Likely wrote at Tuesday, July 19, 2011 5:43 PM:

arch/arm/boot/dts/tegra-harmony.dts line 47

Quoted 2 lines
arch/arm/boot/dts/tegra-harmony.dts new file +2 -0
+	sound {
+		compatible = "nvidia,harmony-sound", "nvidia,tegra-wm8903";

I thought the sound bindings were still somewhat experimental and not completely agreed upon. One issue I see is that Device Tree is supposed to represent pure HW, rather than driver-required abstractions, and at least the compatible name here is pretty Linux-driver-specific.

Quoted 3 lines

The current decision is that the schematic for embedded audio hardware is sufficiently interesting to be considered hardware in its own right separately to the chips contained within it.

Correct. For complex composite devices like audio, it is completely appropriate to have a root node that represents the entire complex and how it is wired together.

The compatible property here definitely represents the hardware because it reflects the sound infrastructure on the harmony board.

g.

#6 lore raw

Grant Likely wrote at Wednesday, July 20, 2011 12:32 PM:

Quoted 12 lines · Mark Brown
Quoted 11 lines · Stephen Warren
Quoted 9 lines

Grant Likely wrote at Tuesday, July 19, 2011 5:43 PM:

arch/arm/boot/dts/tegra-harmony.dts line 47

Quoted 2 lines
arch/arm/boot/dts/tegra-harmony.dts new file +2 -0
+	sound {
+		compatible = "nvidia,harmony-sound", "nvidia,tegra-wm8903";

I thought the sound bindings were still somewhat experimental and not completely agreed upon. One issue I see is that Device Tree is supposed to represent pure HW, rather than driver-required abstractions, and at least the compatible name here is pretty Linux-driver-specific.

Quoted 7 lines
Quoted 3 lines

The current decision is that the schematic for embedded audio hardware is sufficiently interesting to be considered hardware in its own right separately to the chips contained within it.

Correct. For complex composite devices like audio, it is completely appropriate to have a root node that represents the entire complex and how it is wired together.

Sure, that makes sense.

Quoted 2 lines

The compatible property here definitely represents the hardware because it reflects the sound infrastructure on the harmony board.

I can see that argument for "nvidia,harmony-sound".

But "nvidia,tegra-wm8903" is pretty generic; I can certainly see there being Tegra 20 systems that use a WM8903 but are so different from either Harmony or anything supported by sound/soc/tegra/tegra_wm8903.c that the existing driver isn't applicable. And hence, there may be a different ASoC driver for such board(s), and hence choosing such a generic name as "tegra-wm8903" for Harmony/Seaboard's audio layout seems like it might cause problems in the future.

I'm fine with such a generic name for the platform driver, since that name can fairly easily be modified just by editing the driver and the board file. But since *.dts files are at least logically separate from the kernel, such naming future-proofing is a little more important.

Signature · 1 line
nvpublic
#7 lore raw
Quoted 14 lines · Stephen Warren

Grant Likely wrote at Wednesday, July 20, 2011 12:32 PM:

Quoted 2 lines

The compatible property here definitely represents the hardware because it reflects the sound infrastructure on the harmony board.

I can see that argument for "nvidia,harmony-sound".

But "nvidia,tegra-wm8903" is pretty generic; I can certainly see there being Tegra 20 systems that use a WM8903 but are so different from either Harmony or anything supported by sound/soc/tegra/tegra_wm8903.c that the existing driver isn't applicable. And hence, there may be a different ASoC driver for such board(s), and hence choosing such a generic name as "tegra-wm8903" for Harmony/Seaboard's audio layout seems like it might cause problems in the future.

Quoted 4 lines

I'm fine with such a generic name for the platform driver, since that name can fairly easily be modified just by editing the driver and the board file. But since *.dts files are at least logically separate from the kernel, such naming future-proofing is a little more important.

Sure, the tegra-wm8903 property can be dropped. If we start to see a really well established pattern of the tegra paired with a wm8903, then at that point we can define a compatible property for it and document exactly what it means (document the boundaries and assumptions that the compatible value requires).

g.

#8 lore raw
Quoted 5 lines · Grant Likely

Sure, the tegra-wm8903 property can be dropped. If we start to see a really well established pattern of the tegra paired with a wm8903, then at that point we can define a compatible property for it and document exactly what it means (document the boundaries and assumptions that the compatible value requires).

There is actually such a pattern, for various reasons a huge proportion of Tegra systems are straight clones of the reference designs and the reference designs mostly used WM8903.

#9 lore raw
In reply to Stephen Warren
Quoted 8 lines · Stephen Warren

Grant Likely wrote at Tuesday, July 19, 2011 5:43 PM:

Quoted 7 lines

Everything required to populate NVIDIA Tegra devices from the device tree. This patch adds a new DT_MACHINE_DESC() which matches against a tegra20 device tree. So far it only registers the on-chip devices, but it will be refined in follow on patches to configure clocks and pin IO from the device tree also.

Oops, I merged patches, but missed some attribution. This patch is is also composed of work from John Bonesio and Stephen Warren.

Quoted 4 lines
Quoted 4 lines

---

Hi all,

Quoted 8 lines

arch/arm/boot/dts/tegra-harmony.dts

Quoted 5 lines

Similar to the versatile patch I just posted, this is certainly not complete board support, but it is enough to be useful. I'd like to merge this for v3.1. It should not break any existing board support.

arch/arm/boot/dts/tegra-harmony.dts +0 -0

tegra-*.dts don't include status="disable" for all the unused controllers. Should that be added?

I dropped that pattern since my preference has been to have boards explicitly disable unused cores and that has generally been the pattern on other DT platforms.

Quoted 9 lines

arch/arm/boot/dts/tegra-harmony.dts line 47

Quoted 3 lines
arch/arm/boot/dts/tegra-harmony.dts +2 -0
+	sound {
+		compatible = "nvidia,harmony-sound", "nvidia,tegra-wm8903";

I thought the sound bindings were still somewhat experimental and not completely agreed upon. One issue I see is that Device Tree is supposed to represent pure HW, rather than driver-required abstractions, and at least the compatible name here is pretty Linux-driver-specific.

Quoted 7 lines

I think there are some devices missing from the DT file for audio too, e.g. the ALSA "PCM" (DMA) driver.

Also, the bindings for this aren't documented IIRC.

I'd suggest dropping the audio part of the DT file until the audio side is more mature.

Yes, I'll drop the audio bits from this patch. I had taken John's dts file which includes the work he's performed on the audio. Actually, I haven't looked critically at this .dts, so there is probably a lot of cruft that should be tightened up.

Quoted 3 lines

arch/arm/boot/dts/tegra-harmony.dts line 49

Quoted 1 line
arch/arm/boot/dts/tegra-harmony.dts +1 -0
+		spkr-en-gpios = <&codec 2 0>;

Should that be "gpio" not "gpios", since there is only one?

Originally I though about that, but for consistency I think it is better to have all gpio properties use a "gpios" suffix instead of a mixture of "-gpio" and "-gpios".

Quoted 14 lines
Quoted 6 lines
arch/arm/boot/dts/tegra-harmony.dts +4 -0
+		hp-det-gpios = <&gpio 178 0>;
+		int-mic-en-gpios = <&gpio 184 0>;
+		ext-mic-en-gpios = <&gpio 185 0>;
+	};
arch/arm/boot/dts/tegra20.dtsi +0 -0

...

Quoted 1 line

+/ {

...

Quoted 2 lines
arch/arm/boot/dts/tegra20.dtsi +2 -0
+	amba {
+		compatible = "simple-bus";

...

Quoted 1 line
arch/arm/boot/dts/tegra20.dtsi +1 -0
+		intc: interrupt-controller at 50041000 {

...

Quoted 8 lines
Quoted 2 lines
arch/arm/boot/dts/tegra20.dtsi +2 -0
+		};
+	};

...

arch/arm/boot/dts/tegra20.dtsi

Quoted 1 line
arch/arm/boot/dts/tegra20.dtsi +1 -0
+	i2c at 7000c000 {

I've always wondered why all the devices aren't included inside the amba node. Or put another way, if the devices are outside the amba node, why not move everything outside the amba node and remove the amba node?

It is sometimes convenient to have all the SoC devices contained in a collection node, such as if there is shared clock or power management contect, but it is certainly not required. It is probabaly best if the hierarchy reflects the actual bus layout of the SoC instead of an anonymous "soc" or "amba" node.

Quoted 8 lines
Quoted 8 lines
arch/arm/mach-tegra/Makefile +0 -0
index 823c703..6d3d695 100644
@@ -30,5 +30,8 @@ obj-${CONFIG_MACH_PAZ00}		+= board-paz00-pinmux.o
 obj-${CONFIG_MACH_SEABOARD}             += board-seaboard.o
 obj-${CONFIG_MACH_SEABOARD}             += board-seaboard-pinmux.o
 
Quoted 4 lines

arch/arm/mach-tegra/Makefile obj-${CONFIG_MACH_PAZ00} += board-paz00-pinmux.o · line 34

Quoted 2 lines
arch/arm/mach-tegra/Makefile +2 -0
+obj-${CONFIG_MACH_TEGRA_DT}             += board-dt.o
+obj-${CONFIG_MACH_TEGRA_DT}             += board-harmony-pinmux.o

You need board-seaboard-pinmux.o here too.

Yes. Actually, what I really need is a better way to handle pinmux, and it isn't very sane to have board-*-pinmux.o added multiple times to obj-y. I'll tidy this up.

Quoted 12 lines
Quoted 2 lines
arch/arm/mach-tegra/board-dt.c +0 -0

...

arch/arm/mach-tegra/board-dt.c line 70

Quoted 5 lines
arch/arm/mach-tegra/board-dt.c +5 -0
+static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
+	/* name		parent		rate		enabled */
+	{ "uartd",	"pll_p",	216000000,	true },
+	{ NULL,		NULL,		0,		0},
+};

For audio to work, you'll need more clock entries here currently; another reason I suggested to simply drop the audio stuff for now to keep things simple.

I've split the audio changes into a separate patch since that work isn't complete yet.

Quoted 9 lines
Quoted 2 lines

+static void __init tegra_dt_init(void)

...

arch/arm/mach-tegra/board-dt.c line 96

Quoted 4 lines
arch/arm/mach-tegra/board-dt.c +4 -0
+	if (of_machine_is_compatible("nvidia,harmony"))
+		harmony_pinmux_init();
+	else if (of_machine_is_compatible("nvidia,seaboard"))
+		seaboard_pinmux_init();

else error, or at least warn?

Yeah, at least until I can remove this ugly hunk entirely.

g.

#10 lore raw

Grant Likely wrote at Wednesday, July 20, 2011 12:28 PM:

Quoted 7 lines · Stephen Warren
Quoted 6 lines

Grant Likely wrote at Tuesday, July 19, 2011 5:43 PM:

Quoted 5 lines

Everything required to populate NVIDIA Tegra devices from the device tree. This patch adds a new DT_MACHINE_DESC() which matches against a tegra20 device tree. So far it only registers the on-chip devices, but it will be refined in follow on patches to configure clocks and pin IO from the device tree also.

...

Quoted 8 lines
Quoted 4 lines

arch/arm/boot/dts/tegra-harmony.dts

Quoted 1 line
arch/arm/boot/dts/tegra-harmony.dts +0 -0

tegra-*.dts don't include status="disable" for all the unused controllers. Should that be added?

I dropped that pattern since my preference has been to have boards explicitly disable unused cores and that has generally been the pattern on other DT platforms.

Sorry if I wasn't clear, but what I meant was that the board-specific files tegra-harmony.dts and tegra-seaboard.dts don't include the status= "disable" entries for the modules/ports they don't use.

Still, everything probably works OK without that...

Signature · 1 line
nvpublic
#11 lore raw
Quoted 18 lines · Stephen Warren

Grant Likely wrote at Wednesday, July 20, 2011 12:28 PM:

Quoted 7 lines · Stephen Warren
Quoted 6 lines

Grant Likely wrote at Tuesday, July 19, 2011 5:43 PM:

Quoted 5 lines

Everything required to populate NVIDIA Tegra devices from the device tree. This patch adds a new DT_MACHINE_DESC() which matches against a tegra20 device tree. So far it only registers the on-chip devices, but it will be refined in follow on patches to configure clocks and pin IO from the device tree also.

...

Quoted 8 lines
Quoted 4 lines

arch/arm/boot/dts/tegra-harmony.dts

Quoted 1 line
arch/arm/boot/dts/tegra-harmony.dts +0 -0

tegra-*.dts don't include status="disable" for all the unused controllers. Should that be added?

I dropped that pattern since my preference has been to have boards explicitly disable unused cores and that has generally been the pattern on other DT platforms.

Quoted 5 lines

Sorry if I wasn't clear, but what I meant was that the board-specific files tegra-harmony.dts and tegra-seaboard.dts don't include the status= "disable" entries for the modules/ports they don't use.

Still, everything probably works OK without that...

For eval platforms, unless it is actively dangerous I would leave devices enabled. If it is actively dangerous (or potentially so) then that is an argument to disable by default in the tegra20.dtsi file, but I've not yet run into any situations like that.

g.

#12 lore raw
In reply to Stephen Warren
Quoted 32 lines · Stephen Warren

Grant Likely wrote at Tuesday, July 19, 2011 5:43 PM:

arch/arm/boot/dts/tegra-harmony.dts

Quoted 16 lines

Everything required to populate NVIDIA Tegra devices from the device tree. This patch adds a new DT_MACHINE_DESC() which matches against a tegra20 device tree. So far it only registers the on-chip devices, but it will be refined in follow on patches to configure clocks and pin IO from the device tree also.

---

Hi all,

Similar to the versatile patch I just posted, this is certainly not complete board support, but it is enough to be useful. I'd like to merge this for v3.1. It should not break any existing board support.

arch/arm/boot/dts/tegra-harmony.dts +0 -0

tegra-*.dts don't include status="disable" for all the unused controllers. Should that be added?

arch/arm/boot/dts/tegra-harmony.dts line 47

Quoted 2 lines
arch/arm/boot/dts/tegra-harmony.dts +2 -0
+	sound {
+		compatible = "nvidia,harmony-sound", "nvidia,tegra-wm8903";

I thought the sound bindings were still somewhat experimental and not completely agreed upon. One issue I see is that Device Tree is supposed to represent pure HW, rather than driver-required abstractions, and at least the compatible name here is pretty Linux-driver-specific.

I think there are some devices missing from the DT file for audio too, e.g. the ALSA "PCM" (DMA) driver.

Quoted 9 lines

Also, the bindings for this aren't documented IIRC.

I'd suggest dropping the audio part of the DT file until the audio side is more mature.

arch/arm/boot/dts/tegra-harmony.dts line 49

Quoted 1 line
arch/arm/boot/dts/tegra-harmony.dts +1 -0
+		spkr-en-gpios = <&codec 2 0>;

Should that be "gpio" not "gpios", since there is only one?

My reason for using "gpios" over "gpio" is that Documentation/devicetree/bindings/gpio/gpio.txt says so. Unless you want to change the document to elaborate the difference between "gpio" and "gpios", which I do not see the necessity ...

GPIO properties should be named "[<name>-]gpios".

Regards,
Shawn