diff mbox

[U-Boot,1/3] tegra: usb: Add USB support to Tamonten boards

Message ID 1337843087-8373-1-git-send-email-thierry.reding@avionic-design.de
State Superseded
Headers show

Commit Message

Thierry Reding May 24, 2012, 7:04 a.m. UTC
This adds basic USB support for port 0. Device tree support is needed to
initialize the USB EHCI and will be added in a subsequent patch.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
---
 board/avionic-design/common/tamonten.c |   11 +++++++++++
 board/avionic-design/common/tamonten.h |    2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

Comments

Stephen Warren May 24, 2012, 3:46 p.m. UTC | #1
On 05/24/2012 01:04 AM, Thierry Reding wrote:
> This adds basic USB support for port 0. Device tree support is needed to
> initialize the USB EHCI and will be added in a subsequent patch.

I don't think this is anything in particular to do with USB support "for
port 0"; it's general USB support.

The code here duplicates changes made to board/nvidia/common/board.c.
Shouldn't all Tegra boards be using that common board code so we don't
have to duplicate all this early setup for every board vendor using
Tegra? Otherwise, every time we add I2C, SPI, LP0, ... to
board/nvidia/common/board.c, you'll just have to make the same change to
tamonten.c too.
Thierry Reding May 24, 2012, 9:07 p.m. UTC | #2
* Stephen Warren wrote:
> On 05/24/2012 01:04 AM, Thierry Reding wrote:
> > This adds basic USB support for port 0. Device tree support is needed to
> > initialize the USB EHCI and will be added in a subsequent patch.
> 
> I don't think this is anything in particular to do with USB support "for
> port 0"; it's general USB support.

Okay, I did copy this from Simon's earlier commits. I can just drop "for port
0". It isn't really relevant anyway.

> The code here duplicates changes made to board/nvidia/common/board.c.
> Shouldn't all Tegra boards be using that common board code so we don't
> have to duplicate all this early setup for every board vendor using
> Tegra? Otherwise, every time we add I2C, SPI, LP0, ... to
> board/nvidia/common/board.c, you'll just have to make the same change to
> tamonten.c too.

I think the problem is U-Boot's build system, which doesn't allow sharing
code between different subdirectories of board/.

Thierry
Stephen Warren May 24, 2012, 10:13 p.m. UTC | #3
On 05/24/2012 03:07 PM, Thierry Reding wrote:
> * Stephen Warren wrote:
>> On 05/24/2012 01:04 AM, Thierry Reding wrote:
>>> This adds basic USB support for port 0. Device tree support is
>>> needed to initialize the USB EHCI and will be added in a
>>> subsequent patch.
...
>> The code here duplicates changes made to
>> board/nvidia/common/board.c. Shouldn't all Tegra boards be using
>> that common board code so we don't have to duplicate all this
>> early setup for every board vendor using Tegra? Otherwise, every
>> time we add I2C, SPI, LP0, ... to board/nvidia/common/board.c,
>> you'll just have to make the same change to tamonten.c too.
> 
> I think the problem is U-Boot's build system, which doesn't allow
> sharing code between different subdirectories of board/.

I have both board/compulab/trimslice and board/compal/paz00 sharing
the board/nvidia/common code; take a look at their Makefiles.
Thierry Reding May 25, 2012, 4:55 a.m. UTC | #4
* Stephen Warren wrote:
> On 05/24/2012 03:07 PM, Thierry Reding wrote:
> > * Stephen Warren wrote:
> >> On 05/24/2012 01:04 AM, Thierry Reding wrote:
> >>> This adds basic USB support for port 0. Device tree support is
> >>> needed to initialize the USB EHCI and will be added in a
> >>> subsequent patch.
> ...
> >> The code here duplicates changes made to
> >> board/nvidia/common/board.c. Shouldn't all Tegra boards be using
> >> that common board code so we don't have to duplicate all this
> >> early setup for every board vendor using Tegra? Otherwise, every
> >> time we add I2C, SPI, LP0, ... to board/nvidia/common/board.c,
> >> you'll just have to make the same change to tamonten.c too.
> > 
> > I think the problem is U-Boot's build system, which doesn't allow
> > sharing code between different subdirectories of board/.
> 
> I have both board/compulab/trimslice and board/compal/paz00 sharing
> the board/nvidia/common code; take a look at their Makefiles.

Okay, will do.

Thierry
diff mbox

Patch

diff --git a/board/avionic-design/common/tamonten.c b/board/avionic-design/common/tamonten.c
index f23b657..794d90a 100644
--- a/board/avionic-design/common/tamonten.c
+++ b/board/avionic-design/common/tamonten.c
@@ -68,6 +68,12 @@  static void pin_mux_mmc(void)
 }
 #endif
 
+static void pin_mux_usb_default(void)
+{
+}
+
+void pin_mux_usb(void) __attribute__((weak, alias("pin_mux_usb_default")));
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -80,6 +86,11 @@  int board_init(void)
 	/* boot param addr */
 	gd->bd->bi_boot_params = (NV_PA_SDRAM_BASE + 0x100);
 
+#ifdef CONFIG_USB_EHCI_TEGRA
+	pin_mux_usb();
+	board_usb_init(gd->fdt_blob);
+#endif
+
 	return 0;
 }
 
diff --git a/board/avionic-design/common/tamonten.h b/board/avionic-design/common/tamonten.h
index 0e60b0f..ee101b7 100644
--- a/board/avionic-design/common/tamonten.h
+++ b/board/avionic-design/common/tamonten.h
@@ -26,7 +26,7 @@ 
 #ifndef _TAMONTEN_H_
 #define _TAMONTEN_H_
 
-void tegra2_start(void);
 void gpio_config_mmc(void);
+void pin_mux_usb(void);
 
 #endif /* TAMONTEN_H */