Tegra DRM device tree bindings

Thierry Reding thierry.reding at avionic-design.de
Tue Jun 26 03:55:13 PDT 2012


Hi,

while I haven't got much time to work on the actual code right now, I
think it might still be useful if we could get the device tree binding
to a point where everybody is happy with it. That'll also save me some
time once I get to writing the code because I won't have to redo it over
again. =)

So here's the current proposal:

	host1x {
		compatible = "nvidia,tegra20-host1x", "simple-bus";
		reg = <0x50000000 0x00024000>;
		interrupts = <0 64 0x04   /* cop syncpt */
			      0 65 0x04   /* mpcore syncpt */
			      0 66 0x04   /* cop general */
			      0 67 0x04>; /* mpcore general */

		#address-cells = <1>;
		#size-cells = <1>;

		ranges = <0x54000000 0x54000000 0x04000000>;

		status = "disabled";

		gart = <&gart>;

		/* video-encoding/decoding */
		mpe {
			reg = <0x54040000 0x00040000>;
			interrupts = <0 68 0x04>;
			status = "disabled";
		};

		/* video input */
		vi {
			reg = <0x54080000 0x00040000>;
			interrupts = <0 69 0x04>;
			status = "disabled";
		};

		/* EPP */
		epp {
			reg = <0x540c0000 0x00040000>;
			interrupts = <0 70 0x04>;
			status = "disabled";
		};

		/* ISP */
		isp {
			reg = <0x54100000 0x00040000>;
			interrupts = <0 71 0x04>;
			status = "disabled";
		};

		/* 2D engine */
		gr2d {
			reg = <0x54140000 0x00040000>;
			interrupts = <0 72 0x04>;
			status = "disabled";
		};

		/* 3D engine */
		gr3d {
			reg = <0x54180000 0x00040000>;
			status = "disabled";
		};

		/* display controllers */
		dc1: dc at 54200000 {
			compatible = "nvidia,tegra20-dc";
			reg = <0x54200000 0x00040000>;
			interrupts = <0 73 0x04>;
			status = "disabled";
		};

		dc2: dc at 54240000 {
			compatible = "nvidia,tegra20-dc";
			reg = <0x54240000 0x00040000>;
			interrupts = <0 74 0x04>;
			status = "disabled";
		};

		/* outputs */
		rgb {
			compatible = "nvidia,tegra20-rgb";
			status = "disabled";
		};

		hdmi {
			compatible = "nvidia,tegra20-hdmi";
			reg = <0x54280000 0x00040000>;
			interrupts = <0 75 0x04>;
			status = "disabled";
		};

		tvo {
			compatible = "nvidia,tegra20-tvo";
			reg = <0x542c0000 0x00040000>;
			interrupts = <0 76 0x04>;
			status = "disabled";
		};

		dsi {
			compatible = "nvidia,tegra20-dsi";
			reg = <0x54300000 0x00040000>;
			status = "disabled";
		};
	};

This really isn't anything new but merely brings the Tegra DRM binding
in sync with other devices in tegra20.dtsi (disable devices by default,
leave out unit addresses for unique nodes). The only actual change is
that host1x clients are now children of the host1x node. The children
are instantiated by the initial call to of_platform_populate() since the
host1x node is also marked compatible with "simple-bus".

An alternative would be to call of_platform_populate() from the host1x
driver. This has the advantage that it could integrate better with the
host1x bus implementation that Terje is working on, but it also needs
additional code to tear down the devices when the host1x driver is
unloaded because a module reload would try to create duplicate devices
otherwise.

The rgb node is something that I don't quite know how to handle yet.
Since it is really part of the display controller and uses its register
space, it isn't quite correct to represent it as a separate device. But
we will need a separate node to make it available as a connector, which
will become more obvious below.

Perhaps the ranges property can also be used to remap the reg properties
of the child nodes so that they can be specified as an offset into the
host1x aperture instead of an address in the CPU address space. But
that's just a minor issue because the OF code should be able to handle
it transparently.

Board DTS files could then extend this with board-specific requirements
and connectors. The following describes the Medcom Wide:

	host1x {
		carveout = <0x0e000000 0x02000000>;
		display-controllers = <&dc1>;
		status = "okay";

		dc at 54200000 {
			status = "okay";
		};

		lvds: rgb {
			status = "okay";
		};
	};

	connectors {
		#address-cells = <1>;
		#size-cells = <0>;

		connector at 0 {
			reg = <0>;
			edid = /incbin/("tegra-medcom.edid");
			output = <&lvds>;
		};
	};

Basically this turns on the first display controller and the RGB/LVDS
output and hooks up a static EDID block with the LVDS output. There is
also a carveout property which might be a better replacement for the
"crippled" GART on Tegra20. Alternatively the CMA might work just as
well instead.

The Plutux can be described like this:

	host1x {
		carveout = <0x0e000000 0x02000000>;
		display-controllers = <&dc1 &dc2>;
		status = "okay";

		dc at 54200000 {
			status = "okay";
		};

		hdmi: hdmi {
			vdd-supply = <&ldo7_reg>;
			pll-supply = <&ldo8_reg>;
			status = "okay";

		};
	};

	connectors {
		#address-cells = <1>;
		#size-cells = <0>;

		connector at 0 {
			reg = <0>;
			output = <&hdmi>;
			ddc = <&ddc>;

			hpd-gpio = <&gpio 111 0>; /* PN7 */
		};
	};

Which is similar to the Medcom Wide, only it uses the HDMI output and
hooks it up with one of the Tegra's I2C controllers to do EDID probing
via DDC. Additionally it can detect whether an HDMI cable is connected
using the GPIO specified by the hpd-gpio property.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20120626/b888734e/attachment.pgp>


More information about the dri-devel mailing list