Patchwork [U-Boot,2/3] tegra: medcom: Add device tree support

login
register
mail settings
Submitter Thierry Reding
Date May 24, 2012, 7:04 a.m.
Message ID <1337843087-8373-2-git-send-email-thierry.reding@avionic-design.de>
Download mbox | patch
Permalink /patch/161070/
State Superseded
Headers show

Comments

Thierry Reding - May 24, 2012, 7:04 a.m.
Device tree support is required for working USB host support, which in
turn enables ethernet support.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
---
 board/avionic-design/dts/tegra2-medcom.dts |   67 ++++++++++++++++++++++++++++
 include/configs/medcom.h                   |   22 ++++++++-
 2 files changed, 88 insertions(+), 1 deletion(-)
 create mode 100644 board/avionic-design/dts/tegra2-medcom.dts
Stephen Warren - May 24, 2012, 3:51 p.m.
On 05/24/2012 01:04 AM, Thierry Reding wrote:
> Device tree support is required for working USB host support, which in
> turn enables ethernet support.

> diff --git a/board/avionic-design/dts/tegra2-medcom.dts b/board/avionic-design/dts/tegra2-medcom.dts

> +	chosen {
> +		bootargs = "console=ttyS0,115200n8";
> +	};

I don't think you need that in the U-Boot .dts file, since it's specific
to the kernel. Admittedly, U-Boot's tegra2-seaboard.dts has it, but none
of the other Tegra .dts files do.

> +	sdhci@c8000600 {
> +		cd-gpios = <&gpio 58 0>; /* gpio PH2 */
> +		wp-gpios = <&gpio 59 0>; /* gpio PH3 */
> +	};

I'd prefer not to include SDHCI nodes in the U-Boot .dts files, since
U-Boot doesn't support configuring the SDHCI controllers from device
tree (yet?). Having these nodes exist before then would be misleading.
Yes again, the seaboard .dts file has it, but it should probably be
removed from there too.

> diff --git a/include/configs/medcom.h b/include/configs/medcom.h

> +/* USB networking support */
> +#define CONFIG_USB_HOST_ETHER
> +#define CONFIG_USB_ETHER_SMSC95XX
> +#define CONFIG_USB_ETHER_ASIX

Is there an SMSC95XX on the board? Since standalone dongles with that
chipset are rare, we've removed that one config option from all the
other Tegra boards since it likely isn't useful (except Harmony which
has that chip on board).

Aside from those comments, this looks fine.
Thierry Reding - May 24, 2012, 9:09 p.m.
* Stephen Warren wrote:
> On 05/24/2012 01:04 AM, Thierry Reding wrote:
> > Device tree support is required for working USB host support, which in
> > turn enables ethernet support.
> 
> > diff --git a/board/avionic-design/dts/tegra2-medcom.dts b/board/avionic-design/dts/tegra2-medcom.dts
> 
> > +	chosen {
> > +		bootargs = "console=ttyS0,115200n8";
> > +	};
> 
> I don't think you need that in the U-Boot .dts file, since it's specific
> to the kernel. Admittedly, U-Boot's tegra2-seaboard.dts has it, but none
> of the other Tegra .dts files do.

Okay, I'll drop it.

> > +	sdhci@c8000600 {
> > +		cd-gpios = <&gpio 58 0>; /* gpio PH2 */
> > +		wp-gpios = <&gpio 59 0>; /* gpio PH3 */
> > +	};
> 
> I'd prefer not to include SDHCI nodes in the U-Boot .dts files, since
> U-Boot doesn't support configuring the SDHCI controllers from device
> tree (yet?). Having these nodes exist before then would be misleading.
> Yes again, the seaboard .dts file has it, but it should probably be
> removed from there too.

I'll drop that as well, then. Do you want me to prepare a patch to remove
those nodes from the Seaboard DTS?

> > diff --git a/include/configs/medcom.h b/include/configs/medcom.h
> 
> > +/* USB networking support */
> > +#define CONFIG_USB_HOST_ETHER
> > +#define CONFIG_USB_ETHER_SMSC95XX
> > +#define CONFIG_USB_ETHER_ASIX
> 
> Is there an SMSC95XX on the board? Since standalone dongles with that
> chipset are rare, we've removed that one config option from all the
> other Tegra boards since it likely isn't useful (except Harmony which
> has that chip on board).

Yes, the Tamonten has an SMSC95XX.

> Aside from those comments, this looks fine.

Thanks for reviewing.

Thierry

Patch

diff --git a/board/avionic-design/dts/tegra2-medcom.dts b/board/avionic-design/dts/tegra2-medcom.dts
new file mode 100644
index 0000000..f766078
--- /dev/null
+++ b/board/avionic-design/dts/tegra2-medcom.dts
@@ -0,0 +1,67 @@ 
+/dts-v1/;
+
+/include/ ARCH_CPU_DTS
+
+/ {
+	model = "Avionic Design Medcom-Wide";
+	compatible = "avionic-design,medcom", "nvidia,tegra20";
+
+	aliases {
+		usb0 = "/usb@c5008000";
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8";
+	};
+
+	memory {
+		reg = <0x00000000 0x20000000>;
+	};
+
+	clocks {
+		clk_32k: clk_32k {
+			clock-frequency = <32000>;
+		};
+
+		osc {
+			clock-frequency = <12000000>;
+		};
+	};
+
+	clock@60006000 {
+		clocks = <&clk_32k &osc>;
+	};
+
+	serial@70006300 {
+		clock-frequency = <216000000>;
+	};
+
+	i2c@7000c000 {
+		status = "disabled";
+	};
+
+	i2c@7000c400 {
+		status = "disabled";
+	};
+
+	i2c@7000c500 {
+		status = "disabled";
+	};
+
+	i2c@7000d000 {
+		status = "disabled";
+	};
+
+	usb@c5000000 {
+		status = "disabled";
+	};
+
+	usb@c5004000 {
+		status = "disabled";
+	};
+
+	sdhci@c8000600 {
+		cd-gpios = <&gpio 58 0>; /* gpio PH2 */
+		wp-gpios = <&gpio 59 0>; /* gpio PH3 */
+	};
+};
diff --git a/include/configs/medcom.h b/include/configs/medcom.h
index 2dc3507..072e15a 100644
--- a/include/configs/medcom.h
+++ b/include/configs/medcom.h
@@ -1,7 +1,7 @@ 
 /*
  *  (C) Copyright 2010,2011
  *  NVIDIA Corporation <www.nvidia.com>
- *  (C) Copyright 2011
+ *  (C) Copyright 2011-2012
  *  Avionic Design GmbH <www.avionic-design.de>
  *
  * See file CREDITS for list of people who contributed to this
@@ -28,6 +28,11 @@ 
 
 #include "tegra2-common.h"
 
+/* Enable fdt support for Medcom. Flash the image in u-boot-dtb.bin */
+#define CONFIG_DEFAULT_DEVICE_TREE	tegra2-medcom
+#define CONFIG_OF_CONTROL
+#define CONFIG_OF_SEPARATE
+
 /* High-level configuration options */
 #define TEGRA2_SYSMEM			"mem=384M@0M nvmem=128M@384M"
 #define V_PROMPT			"Tegra2 (Medcom) # "
@@ -49,6 +54,21 @@ 
 #define CONFIG_TEGRA2_MMC
 #define CONFIG_CMD_MMC
 
+/* USB host support */
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_TEGRA
+#define CONFIG_USB_STORAGE
+#define CONFIG_CMD_USB
+
+/* USB networking support */
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_SMSC95XX
+#define CONFIG_USB_ETHER_ASIX
+
+/* General networking support */
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_DHCP
+
 #define CONFIG_DOS_PARTITION
 #define CONFIG_EFI_PARTITION
 #define CONFIG_CMD_EXT2