Patchwork [U-Boot] tegra: paz00: add device tree support

login
register
mail settings
Submitter Stephen Warren
Date May 21, 2012, 8:04 p.m.
Message ID <1337630677-26390-1-git-send-email-swarren@wwwdotorg.org>
Download mbox | patch
Permalink /patch/160460/
State Accepted
Commit 00a55add04222539846dd884217bcf40c504da92
Headers show

Comments

Stephen Warren - May 21, 2012, 8:04 p.m.
From: Stephen Warren <swarren@nvidia.com>

... to enable USB host support, which enables Ethernet support.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 board/compal/dts/tegra2-paz00.dts |   57 +++++++++++++++++++++++++++++++++++++
 include/configs/paz00.h           |   22 +++++++++++++-
 2 files changed, 78 insertions(+), 1 deletions(-)
 create mode 100644 board/compal/dts/tegra2-paz00.dts
Marc Dietrich - May 22, 2012, 8:04 a.m.
Hi Stephen,

Am Montag, 21. Mai 2012, 14:04:37 schrieb Stephen Warren:
> From: Stephen Warren <swarren@nvidia.com>
> 
> ... to enable USB host support, which enables Ethernet support.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

while adding usb support is fine, I see no reason to add smsc95xx support 
because contrary to harmony, paz00 does not contain an ethernet port.

Marc

> ---
>  board/compal/dts/tegra2-paz00.dts |   57
> +++++++++++++++++++++++++++++++++++++ include/configs/paz00.h           |  
> 22 +++++++++++++-
>  2 files changed, 78 insertions(+), 1 deletions(-)
>  create mode 100644 board/compal/dts/tegra2-paz00.dts
> 
> diff --git a/board/compal/dts/tegra2-paz00.dts
> b/board/compal/dts/tegra2-paz00.dts new file mode 100644
> index 0000000..9e3e169
> --- /dev/null
> +++ b/board/compal/dts/tegra2-paz00.dts
> @@ -0,0 +1,57 @@
> +/dts-v1/;
> +
> +/include/ ARCH_CPU_DTS
> +
> +/ {
> +        model = "Toshiba AC100 / Dynabook AZ";
> +        compatible = "compal,paz00", "nvidia,tegra20";
> +
> +	aliases {
> +		usb0 = "/usb@c5008000";
> +	};
> +
> +	memory {
> +		reg = <0x00000000 0x20000000>;
> +	};
> +
> +	clocks {
> +		clk_32k: clk_32k {
> +			clock-frequency = <32000>;
> +		};
> +		osc {
> +			clock-frequency = <12000000>;
> +		};
> +	};
> +
> +	clock@60006000 {
> +		clocks = <&clk_32k &osc>;
> +	};
> +
> +	serial@70006000 {
> +		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";
> +	};
> +};
> diff --git a/include/configs/paz00.h b/include/configs/paz00.h
> index ced185e..f8bd7dc 100644
> --- a/include/configs/paz00.h
> +++ b/include/configs/paz00.h
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright (c) 2010,2011, NVIDIA CORPORATION.  All rights reserved.
> + * Copyright (c) 2010-2012 NVIDIA CORPORATION.  All rights reserved.
>   *
>   * See file CREDITS for list of people who contributed to this
>   * project.
> @@ -20,6 +20,11 @@
>  #include <asm/sizes.h>
>  #include "tegra2-common.h"
> 
> +/* Enable fdt support for Paz00. Flash the image in u-boot-dtb.bin */
> +#define CONFIG_DEFAULT_DEVICE_TREE	tegra2-paz00
> +#define CONFIG_OF_CONTROL
> +#define CONFIG_OF_SEPARATE
> +
>  /* High-level configuration options */
>  #define V_PROMPT		"Tegra2 (Paz00) MOD # "
>  #define CONFIG_TEGRA2_BOARD_STRING	"Compal Paz00"
> @@ -48,6 +53,21 @@
>  /* Environment not stored */
>  #define CONFIG_ENV_IS_NOWHERE
> 
> +/* 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
> +
>  #include "tegra2-common-post.h"
> 
>  #endif /* __CONFIG_H */
Stephen Warren - May 22, 2012, 4:14 p.m.
On 05/22/2012 02:04 AM, Marc Dietrich wrote:
> Hi Stephen,
> 
> Am Montag, 21. Mai 2012, 14:04:37 schrieb Stephen Warren:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> ... to enable USB host support, which enables Ethernet support.
>>
>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> 
> while adding usb support is fine, I see no reason to add smsc95xx support 
> because contrary to harmony, paz00 does not contain an ethernet port.

Is the SMSC95xx only an internal part, or could it be present on a
user-pluggable USB dongle? I wasn't sure, so I left it in.
Stephen Warren - May 22, 2012, 4:58 p.m.
On 05/22/2012 10:14 AM, Stephen Warren wrote:
> On 05/22/2012 02:04 AM, Marc Dietrich wrote:
>> Hi Stephen,
>>
>> Am Montag, 21. Mai 2012, 14:04:37 schrieb Stephen Warren:
>>> From: Stephen Warren <swarren@nvidia.com>
>>>
>>> ... to enable USB host support, which enables Ethernet support.
>>>
>>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>
>> while adding usb support is fine, I see no reason to add smsc95xx support 
>> because contrary to harmony, paz00 does not contain an ethernet port.
> 
> Is the SMSC95xx only an internal part, or could it be present on a
> user-pluggable USB dongle? I wasn't sure, so I left it in.

Looking at the driver (and the Linux kernel driver and SMSC's website),
it supports both the standalone USB->Ethernet 9500 chip that's likely to
be in USB Ethernet dongles, and various combo USB hub + Ethernet chips
that are found on motherboards (e.g. Harmony). As such, I think it's
reasonable to leave this config option enabled on Paz00 and other Tegra
boards even when such a chip isn't on the board itself. Do you agree?
Marc Dietrich - May 22, 2012, 9:15 p.m.
On Tuesday 22 May 2012 10:58:37 Stephen Warren wrote:
> On 05/22/2012 10:14 AM, Stephen Warren wrote:
> > On 05/22/2012 02:04 AM, Marc Dietrich wrote:
> >> Hi Stephen,
> >> 
> >> Am Montag, 21. Mai 2012, 14:04:37 schrieb Stephen Warren:
> >>> From: Stephen Warren <swarren@nvidia.com>
> >>> 
> >>> ... to enable USB host support, which enables Ethernet support.
> >>> 
> >>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> >> 
> >> while adding usb support is fine, I see no reason to add smsc95xx support
> >> because contrary to harmony, paz00 does not contain an ethernet port.
> > 
> > Is the SMSC95xx only an internal part, or could it be present on a
> > user-pluggable USB dongle? I wasn't sure, so I left it in.
> 
> Looking at the driver (and the Linux kernel driver and SMSC's website),
> it supports both the standalone USB->Ethernet 9500 chip that's likely to
> be in USB Ethernet dongles, and various combo USB hub + Ethernet chips
> that are found on motherboards (e.g. Harmony). As such, I think it's
> reasonable to leave this config option enabled on Paz00 and other Tegra
> boards even when such a chip isn't on the board itself. Do you agree?

Following this argument would mean to enable all current (and future) usb 
devices and we end up with an u-boot which is to heavy to swim. I only have a 
mcs7830 which is unfortunately not supported. Do you have a SMSC95xx based usb 
adapter or plan to get one? In this case I think it would be ok to enable it, 
otherwise I tend to disagree here. On the other hand, given that you kindly 
take care of the paz00 code, the decision is up to you. 

Just my two cents,

Marc
Stephen Warren - May 22, 2012, 10:30 p.m.
On 05/22/2012 03:15 PM, Marc Dietrich wrote:
> On Tuesday 22 May 2012 10:58:37 Stephen Warren wrote:
>> On 05/22/2012 10:14 AM, Stephen Warren wrote:
>>> On 05/22/2012 02:04 AM, Marc Dietrich wrote:
>>>> Hi Stephen,
>>>>
>>>> Am Montag, 21. Mai 2012, 14:04:37 schrieb Stephen Warren:
>>>>> From: Stephen Warren <swarren@nvidia.com>
>>>>>
>>>>> ... to enable USB host support, which enables Ethernet support.
>>>>>
>>>>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>>>
>>>> while adding usb support is fine, I see no reason to add smsc95xx support
>>>> because contrary to harmony, paz00 does not contain an ethernet port.
>>>
>>> Is the SMSC95xx only an internal part, or could it be present on a
>>> user-pluggable USB dongle? I wasn't sure, so I left it in.
>>
>> Looking at the driver (and the Linux kernel driver and SMSC's website),
>> it supports both the standalone USB->Ethernet 9500 chip that's likely to
>> be in USB Ethernet dongles, and various combo USB hub + Ethernet chips
>> that are found on motherboards (e.g. Harmony). As such, I think it's
>> reasonable to leave this config option enabled on Paz00 and other Tegra
>> boards even when such a chip isn't on the board itself. Do you agree?
> 
> Following this argument would mean to enable all current (and future) usb 
> devices and we end up with an u-boot which is to heavy to swim. I only have a 
> mcs7830 which is unfortunately not supported. Do you have a SMSC95xx based usb 
> adapter or plan to get one? In this case I think it would be ok to enable it, 
> otherwise I tend to disagree here. On the other hand, given that you kindly 
> take care of the paz00 code, the decision is up to you. 

Mine is an Asix-based dongle.

It seems a pity to artificially limit ourselves. I'd be happy seeing all
the USB devices enabled as the drivers are written myself.

But I suppose net-booting is a developer thing, and developers can
easily turn on this option if they want, so I can remove it.

Is your objection for the Paz00 board only? I turned it on for all the
other boards too. Note that Harmony really does have this chip on the
board, so would need this option enabled either way.
Marc Dietrich - May 23, 2012, 12:16 p.m.
Am Dienstag, 22. Mai 2012, 16:30:29 schrieb Stephen Warren:
> On 05/22/2012 03:15 PM, Marc Dietrich wrote:
> > On Tuesday 22 May 2012 10:58:37 Stephen Warren wrote:
> >> On 05/22/2012 10:14 AM, Stephen Warren wrote:
> >>> On 05/22/2012 02:04 AM, Marc Dietrich wrote:
> >>>> Hi Stephen,
> >>>> 
> >>>> Am Montag, 21. Mai 2012, 14:04:37 schrieb Stephen Warren:
> >>>>> From: Stephen Warren <swarren@nvidia.com>
> >>>>> 
> >>>>> ... to enable USB host support, which enables Ethernet support.
> >>>>> 
> >>>>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> >>>> 
> >>>> while adding usb support is fine, I see no reason to add smsc95xx
> >>>> support
> >>>> because contrary to harmony, paz00 does not contain an ethernet port.
> >>> 
> >>> Is the SMSC95xx only an internal part, or could it be present on a
> >>> user-pluggable USB dongle? I wasn't sure, so I left it in.
> >> 
> >> Looking at the driver (and the Linux kernel driver and SMSC's website),
> >> it supports both the standalone USB->Ethernet 9500 chip that's likely to
> >> be in USB Ethernet dongles, and various combo USB hub + Ethernet chips
> >> that are found on motherboards (e.g. Harmony). As such, I think it's
> >> reasonable to leave this config option enabled on Paz00 and other Tegra
> >> boards even when such a chip isn't on the board itself. Do you agree?
> > 
> > Following this argument would mean to enable all current (and future) usb
> > devices and we end up with an u-boot which is to heavy to swim. I only
> > have a mcs7830 which is unfortunately not supported. Do you have a
> > SMSC95xx based usb adapter or plan to get one? In this case I think it
> > would be ok to enable it, otherwise I tend to disagree here. On the other
> > hand, given that you kindly take care of the paz00 code, the decision is
> > up to you.
> 
> Mine is an Asix-based dongle.
> 
> It seems a pity to artificially limit ourselves. I'd be happy seeing all
> the USB devices enabled as the drivers are written myself.
> 
> But I suppose net-booting is a developer thing, and developers can
> easily turn on this option if they want, so I can remove it.
> 
> Is your objection for the Paz00 board only? I turned it on for all the
> other boards too. Note that Harmony really does have this chip on the
> board, so would need this option enabled either way.

My comment was only with regard to Paz00. Of course, if Harmony has it build 
in (I mean the hardware), it should also be included in u-boot. The question 
was more if we should also support all possible "pluggable" hw. I only found a 
smsc 9500 eval board (usb adapter) for 160 pounds, while my mcs only cost me 
1/10th of that. As I said, I'll leave it up to you (and the "vendors") to 
enable it in the build.

Marc

Patch

diff --git a/board/compal/dts/tegra2-paz00.dts b/board/compal/dts/tegra2-paz00.dts
new file mode 100644
index 0000000..9e3e169
--- /dev/null
+++ b/board/compal/dts/tegra2-paz00.dts
@@ -0,0 +1,57 @@ 
+/dts-v1/;
+
+/include/ ARCH_CPU_DTS
+
+/ {
+        model = "Toshiba AC100 / Dynabook AZ";
+        compatible = "compal,paz00", "nvidia,tegra20";
+
+	aliases {
+		usb0 = "/usb@c5008000";
+	};
+
+	memory {
+		reg = <0x00000000 0x20000000>;
+	};
+
+	clocks {
+		clk_32k: clk_32k {
+			clock-frequency = <32000>;
+		};
+		osc {
+			clock-frequency = <12000000>;
+		};
+	};
+
+	clock@60006000 {
+		clocks = <&clk_32k &osc>;
+	};
+
+	serial@70006000 {
+		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";
+	};
+};
diff --git a/include/configs/paz00.h b/include/configs/paz00.h
index ced185e..f8bd7dc 100644
--- a/include/configs/paz00.h
+++ b/include/configs/paz00.h
@@ -1,5 +1,5 @@ 
 /*
- * Copyright (c) 2010,2011, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2012 NVIDIA CORPORATION.  All rights reserved.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -20,6 +20,11 @@ 
 #include <asm/sizes.h>
 #include "tegra2-common.h"
 
+/* Enable fdt support for Paz00. Flash the image in u-boot-dtb.bin */
+#define CONFIG_DEFAULT_DEVICE_TREE	tegra2-paz00
+#define CONFIG_OF_CONTROL
+#define CONFIG_OF_SEPARATE
+
 /* High-level configuration options */
 #define V_PROMPT		"Tegra2 (Paz00) MOD # "
 #define CONFIG_TEGRA2_BOARD_STRING	"Compal Paz00"
@@ -48,6 +53,21 @@ 
 /* Environment not stored */
 #define CONFIG_ENV_IS_NOWHERE
 
+/* 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
+
 #include "tegra2-common-post.h"
 
 #endif /* __CONFIG_H */