From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Thu, 31 Jul 2014 12:21:02 -0600 Subject: [U-Boot] [PATCH] ARM: tegra: add Colibri T30 board support In-Reply-To: <1406828177-23047-1-git-send-email-stefan@agner.ch> References: <1406828177-23047-1-git-send-email-stefan@agner.ch> Message-ID: <53DA890E.5020206@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 07/31/2014 11:36 AM, Stefan Agner wrote: > This adds board support for the Toradex Colibri T30 module. > > Working functions: > - SD card boot > - eMMC environment and boot > - USB host/USB client (on the dual role port) > - Network (via ASIX USB) > arch/arm/Kconfig | 4 + > arch/arm/dts/Makefile | 1 + > arch/arm/dts/tegra30-colibri.dts | 84 +++++ > arch/arm/include/asm/mach-types.h | 13 + > board/toradex/colibri_t30/Makefile | 6 + > board/toradex/colibri_t30/colibri_t30.c | 52 +++ > .../colibri_t30/pinmux-config-colibri_t30.h | 360 +++++++++++++++++++++ > include/configs/colibri_t30.h | 73 +++++ I think in latest u-boot/master, you'll also need to add configs/colibri_t30_defconfig. > diff --git a/arch/arm/dts/tegra30-colibri.dts b/arch/arm/dts/tegra30-colibri.dts > + /* EHCI instance 0: USB1_DP/N -> USBC_P/N */ > + usb at 7d000000 { > + status = "okay"; > + dr_mode = "otg"; > + }; For OTG support, VBUS needs to be able to be turned on/off. Should this port be host-mode, or a VBUS GPIO defined? > diff --git a/board/toradex/colibri_t30/colibri_t30.c b/board/toradex/colibri_t30/colibri_t30.c > +void pin_mux_usb(void) > +{ > + /* Enable LAN_VBUS */ > + gpio_request(GPIO_PDD2, NULL); > + gpio_direction_output(GPIO_PDD2, 1); > + > + /* Reset ASIX using LAN_RESET */ > + gpio_request(GPIO_PDD0, NULL); > + gpio_direction_output(GPIO_PDD0, 0); > + > + udelay(5); > + > + gpio_set_value(GPIO_PDD0, 1); > +} It might be nice to remove the blank lines around the udelay() call; I initially didn't notice that GOPIO_PDD0 was manipulated by the code both before and after the udelay() and hence there was already a comment saying what GPIO_PDD0 controlled. Nestling the lines together would make this more obvious. > diff --git a/include/configs/colibri_t30.h b/include/configs/colibri_t30.h > +#define CONFIG_I2C_MULTI_BUS > +#define CONFIG_SYS_MAX_I2C_BUS TEGRA_I2C_NUM_CONTROLLERS Are those needed? They aren't defined in e.g. the Beaver config header. > +#define BOARD_EXTRA_ENV_SETTINGS \ > + "board_name=colibri-eval-v3\0" \ > + "fdtfile=tegra30-colibri-eval-v3.dtb\0" It'd be nice to name the board the same in U-Boot as the kernel DT filename. Then you wouldn't need to manually override the default values here. > +#include "tegra-common-ums.h" Did you test this? I mostly developed the USB device mode support on Tegra124. While at some point I did test it on Beaver/Tegra30, it was early on and not very extensive. I'd love to hear that it works well for you too:-) (BTW, I sent a patch to rename that file to tegra-common-usb-gadget.h, since I added DFU support too, so depending on what order TomW applies our patches, one of us will need to rebase)