tegra: Rework Tamonten support
PATCH v3 1/7 tegra: Rework Tamonten support
This commit uses the common Tegra board implementation instead of duplicating a lot of the code. In addition, the Plutux and Medcom specific board files can be removed as the MMC/SD setup is common among all Tamonten-based boards.
---
Changes in v3:
- none
Changes in v2:
- new patch
board/avionic-design/common/tamonten.c | 49 +++++--------------------------- board/avionic-design/common/tamonten.h | 32 --------------------- board/avionic-design/medcom/Makefile | 6 ++-- board/avionic-design/medcom/medcom.c | 45 ----------------------------- board/avionic-design/plutux/Makefile | 6 ++-- board/avionic-design/plutux/plutux.c | 45 ----------------------------- 6 files changed, 13 insertions(+), 170 deletions(-) delete mode 100644 board/avionic-design/common/tamonten.h delete mode 100644 board/avionic-design/medcom/medcom.c delete mode 100644 board/avionic-design/plutux/plutux.c
board/avionic-design/common/tamonten.c +7 -42
@@ -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
@@ -36,25 +36,17 @@#include <asm/arch/pinmux.h> #include <asm/arch/uart.h> #include <asm/arch/mmc.h> -#include "tamonten.h" #ifdef CONFIG_TEGRA2_MMC #include <mmc.h> #endif -DECLARE_GLOBAL_DATA_PTR ; - -const struct tegra2_sysinfo sysinfo = { -CONFIG_TEGRA2_BOARD_STRING -}; -/* -* Routine: timer_init -* Description: init the timestamp and lastinc value +* Routine: gpio_config_uart +* Description: Does nothing on Tamonten - no conflict w/SPI. */ -int timer_init (void ) +void gpio_config_uart (void ) { -return 0 ; }#ifdef CONFIG_TEGRA2_MMC
@@ -65,46 +57,19 @@ int timer_init(void)static void pin_mux_mmc (void ) {funcmux_select (PERIPH_ID_SDMMC4 ,FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT ); +/* for CD GPIO PH2 */ +pinmux_tristate_disable (PINGRP_ATD ); } -#endif - -/* -* Routine: board_init -* Description: Early hardware init. -*/ -int board_init (void ) -{ -clock_init (); -clock_verify (); - -/* boot param addr */ - gd->bd->bi_boot_params = (NV_PA_SDRAM_BASE +0x100 ); -return 0 ; -} - -#ifdef CONFIG_TEGRA2_MMC /* this is a weak define that we are overriding */ int board_mmc_init (bd_t *bd) { -debug ("board_mmc_init called\n" );/* Enable muxes, etc. for SDMMC controllers */ pin_mux_mmc (); -gpio_config_mmc (); -debug ("board_mmc_init: init eMMC\n" ); -/* init dev 0, eMMC chip, with 4-bit bus */ +/* init dev 0, SD slot, with 4-bit bus */ tegra2_mmc_init (0 ,4 ,-1 ,GPIO_PH2 );return 0 ; }#endif - -#ifdef CONFIG_BOARD_EARLY_INIT_F -int board_early_init_f (void ) -{ -/* Initialize selected UARTs */ -board_init_uart_f (); -return 0 ; -} -#endif /* EARLY_INIT */
board/avionic-design/common/tamonten.h deleted +0 -32
@@ -1,32 +0,0 @@ -/* -* (C) Copyright 2010,2011 -* NVIDIA Corporation <www.nvidia.com> -* (C) Copyright 2011 -* Avionic Design GmbH <www.avionic-design.de> -* -* See file CREDITS for list of people who contributed to this -* project. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation; either version 2 of -* the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, -* MA 02111-1307 USA -*/ - -#ifndef _TAMONTEN_H_ -#define _TAMONTEN_H_ - -void tegra2_start (void ); -void gpio_config_mmc (void ); - -#endif /* TAMONTEN_H */
board/avionic-design/medcom/Makefile +3 -3
@@ -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
@@ -26,12 +26,12 @@ include $(TOPDIR)/config.mk ifneq ($(OBJTREE),$(SRCTREE)) -$(shell mkdir -p $(obj)../common) +$(shell mkdir -p $(obj)../common $(obj)../../nvidia/common) endif LIB = $(obj)lib$(BOARD).o -COBJS := $(BOARD).o +COBJS := ../../nvidia/common/board.o COBJS += ../common/tamonten.o SRCS := $(COBJS:.o=.c)
board/avionic-design/medcom/medcom.c deleted +0 -45
45 lines not on this page · raw message
board/avionic-design/plutux/Makefile +3 -3
@@ -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
@@ -26,12 +26,12 @@ include $(TOPDIR)/config.mk ifneq ($(OBJTREE),$(SRCTREE)) -$(shell mkdir -p $(obj)../common) +$(shell mkdir -p $(obj)../common $(obj)../../nvidia/common) endif LIB = $(obj)lib$(BOARD).o -COBJS := $(BOARD).o +COBJS := ../../nvidia/common/board.o COBJS += ../common/tamonten.o SRCS := $(COBJS:.o=.c)
board/avionic-design/plutux/plutux.c deleted +0 -45
45 lines not on this page · raw message
Signature · 1 line
1.7.10.3
PATCH v3 2/7 tegra: medcom: Add device tree support
Device tree support is required for working USB host support, which in turn enables ethernet support.
---
Changes in v3:
- none
Changes in v2:
- drop chosen and sdhci at c8000600 nodes from DTS
- drop CONFIG_USB_ETHER_ASIX from configuration
board/avionic-design/dts/tegra2-medcom.dts | 58 ++++++++++++++++++++++++++++ include/configs/medcom.h | 21 +++++++++- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 board/avionic-design/dts/tegra2-medcom.dts
board/avionic-design/dts/tegra2-medcom.dts new file +58 -0
@@ -0,0 +1,58 @@ +/dts-v1/; + +/include/ ARCH_CPU_DTS + +/ { + model = "Avionic Design Medcom-Wide"; + compatible = "avionic-design,medcom", "nvidia,tegra20"; + + aliases { + usb0 = "/usb at c5008000"; + }; + + memory { + reg = <0x00000000 0x20000000>; + }; + + clocks { + clk_32k: clk_32k { + clock-frequency = <32000>; + }; + + osc { + clock-frequency = <12000000>; + }; + }; + + clock at 60006000 { + clocks = <&clk_32k &osc>; + }; + + serial at 70006300 { + clock-frequency = <216000000>; + }; + + i2c at 7000c000 { + status = "disabled"; + }; + + i2c at 7000c400 { + status = "disabled"; + }; + + i2c at 7000c500 { + status = "disabled"; + }; + + i2c at 7000d000 { + status = "disabled"; + }; + + usb at c5000000 { + status = "disabled"; + }; + + usb at c5004000 { + status = "disabled"; + }; +};
include/configs/medcom.h +20 -1
@@ -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 V_PROMPT "Tegra2 (Medcom) # "#define CONFIG_TEGRA2_BOARD_STRING "Avionic Design Medcom"
@@ -47,6 +52,20 @@#define CONFIG_TEGRA_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 + +/* General networking support */ +#define CONFIG_CMD_NET +#define CONFIG_CMD_DHCP +#define CONFIG_DOS_PARTITION #define CONFIG_EFI_PARTITION #define CONFIG_CMD_EXT2
Signature · 1 line
1.7.10.3
PATCH v3 3/7 tegra: plutux: Add device tree support
In reply to Thierry RedingDevice tree support is required for working USB host support, which in turn enables ethernet support.
---
Changes in v3:
- none
Changes in v2:
- drop chosen and sdhci at c8000600 nodes from DTS
- drop CONFIG_USB_ETHER_ASIX from configuration
board/avionic-design/dts/tegra2-plutux.dts | 58 ++++++++++++++++++++++++++++ include/configs/plutux.h | 21 +++++++++- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 board/avionic-design/dts/tegra2-plutux.dts
board/avionic-design/dts/tegra2-plutux.dts new file +58 -0
@@ -0,0 +1,58 @@ +/dts-v1/; + +/include/ ARCH_CPU_DTS + +/ { + model = "Avionic Design Plutux"; + compatible = "avionic-design,plutux", "nvidia,tegra20"; + + aliases { + usb0 = "/usb at c5008000"; + }; + + memory { + reg = <0x00000000 0x20000000>; + }; + + clocks { + clk_32k: clk_32k { + clock-frequency = <32000>; + }; + + osc { + clock-frequency = <12000000>; + }; + }; + + clock at 60006000 { + clocks = <&clk_32k &osc>; + }; + + serial at 70006300 { + clock-frequency = <216000000>; + }; + + i2c at 7000c000 { + status = "disabled"; + }; + + i2c at 7000c400 { + status = "disabled"; + }; + + i2c at 7000c500 { + status = "disabled"; + }; + + i2c at 7000d000 { + status = "disabled"; + }; + + usb at c5000000 { + status = "disabled"; + }; + + usb at c5004000 { + status = "disabled"; + }; +};
include/configs/plutux.h +20 -1
@@ -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 Plutux. Flash the image in u-boot-dtb.bin */ +#define CONFIG_DEFAULT_DEVICE_TREE tegra2-plutux +#define CONFIG_OF_CONTROL +#define CONFIG_OF_SEPARATE +/* High-level configuration options */ #define V_PROMPT "Tegra2 (Plutux) # "#define CONFIG_TEGRA2_BOARD_STRING "Avionic Design Plutux"
@@ -47,6 +52,20 @@#define CONFIG_TEGRA_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 + +/* General networking support */ +#define CONFIG_CMD_NET +#define CONFIG_CMD_DHCP +#define CONFIG_DOS_PARTITION #define CONFIG_EFI_PARTITION #define CONFIG_CMD_EXT2
Signature · 1 line
1.7.10.3
PATCH v3 4/7 tegra: Allow boards to perform early GPIO setup
In reply to Thierry RedingThe new gpio_early_init() function, which does nothing by default, can be overridden by boards to configure GPIOs at an early stage.
---
Changes in v3:
- none
Changes in v2:
- new patch required for TEC support
board/nvidia/common/board.c | 7 +++++++ board/nvidia/common/board.h | 1 + 2 files changed, 8 insertions(+)
board/nvidia/common/board.c +7 -0
@@ -132,11 +132,18 @@ int board_init(void) }#ifdef CONFIG_BOARD_EARLY_INIT_F +static void __gpio_early_init (void ) +{ +} + +void gpio_early_init (void ) __attribute__((weak,alias ("__gpio_early_init" ))); +int board_early_init_f (void ) {board_init_uart_f ();/* Initialize periph GPIOs */ +gpio_early_init ();#ifdef CONFIG_SPI_UART_SWITCH gpio_early_init_uart ();#else
board/nvidia/common/board.h +1 -0
@@ -25,6 +25,7 @@#define _BOARD_H_void gpio_config_uart (void ); +void gpio_early_init (void );void gpio_early_init_uart (void );/*
Signature · 1 line
1.7.10.3
PATCH v3 5/7 tegra: Implement gpio_early_init() on Tamonten
In reply to Thierry RedingThe PI4 GPIO is used on Tamonten to reset carrier board peripherals. Power sequencing hardware on the carrier pulls the reset low before powering up the Tegra, and the CPU is supposed to signal readiness, and therefore bring peripherals out of reset by pulling PI4 high.
---
Changes in v3:
- do not free PI4 GPIO after configuring it
Changes in v2:
- new patch required for TEC support
board/avionic-design/common/tamonten.c | 8 ++++++++ 1 file changed, 8 insertions(+)
board/avionic-design/common/tamonten.c +8 -0
@@ -49,6 +49,14 @@ void gpio_config_uart(void) { } +#ifdef CONFIG_BOARD_EARLY_INIT_F +void gpio_early_init (void ) +{ +gpio_request (GPIO_PI4 ,NULL ); +gpio_direction_output (GPIO_PI4 ,1 ); +} +#endif +#ifdef CONFIG_TEGRA2_MMC /* * Routine: pin_mux_mmc
Signature · 1 line
1.7.10.3
PATCH v3 6/7 tegra: Use SD write-protect GPIO on Tamonten
In reply to Thierry RedingGPIO PI6 can be used to obtain the write-protect status of an SD card inserted into the SD slot.
---
Changes in v3:
- none
Changes in v2:
- new patch
board/avionic-design/common/tamonten.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
board/avionic-design/common/tamonten.c +3 -1
@@ -65,6 +65,8 @@ void gpio_early_init(void)static void pin_mux_mmc (void ) {funcmux_select (PERIPH_ID_SDMMC4 ,FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT ); +/* for write-protect GPIO PI6 */ +pinmux_tristate_disable (PINGRP_ATA );/* for CD GPIO PH2 */ pinmux_tristate_disable (PINGRP_ATD ); }
@@ -76,7 +78,7 @@ int board_mmc_init(bd_t *bd)pin_mux_mmc ();/* init dev 0, SD slot, with 4-bit bus */ -tegra2_mmc_init (0 ,4 ,-1 ,GPIO_PH2 ); +tegra2_mmc_init (0 ,4 ,GPIO_PI6 ,GPIO_PH2 );return 0 ; }
Signature · 1 line
1.7.10.3
PATCH v3 7/7 tegra: Add Tamonten Evaluation Carrier support
In reply to Thierry RedingThe Tamonten Evaluation Carrier is an evaluation board for the Tamonten processor board. More information is available here:
---
Changes in v3:
- drop obsolete TEGRA2_SYSMEM definition
- rename CONFIG_TEGRA2_MMC to CONFIG_TEGRA_MMC
- add MAINTAINERS entry
Changes in v2:
- new patch
MAINTAINERS | 1 + board/avionic-design/dts/tegra2-tec.dts | 58 ++++++++++++++++++++++ board/avionic-design/tec/Makefile | 50 +++++++++++++++++++ boards.cfg | 1 + include/configs/tec.h | 82 +++++++++++++++++++++++++++++++ 5 files changed, 192 insertions(+) create mode 100644 board/avionic-design/dts/tegra2-tec.dts create mode 100644 board/avionic-design/tec/Makefile create mode 100644 include/configs/tec.h
MAINTAINERS +1 -0
@@ -806,6 +806,7 @@ Thierry Reding <[email protected]> plutux Tegra2 (ARM7 & A9 Dual Core) medcom Tegra2 (ARM7 & A9 Dual Core) + tec Tegra2 (ARM7 & A9 Dual Core) Christian Riesch <[email protected]> Manfred Rudigier <[email protected]>
board/avionic-design/dts/tegra2-tec.dts new file +58 -0
58 lines not on this page · raw message
board/avionic-design/tec/Makefile new file +50 -0
50 lines not on this page · raw message
boards.cfg +1 -0
@@ -259,6 +259,7 @@ colibri_pxa270 arm pxa - toradex jornada arm sa1100 plutux arm armv7 plutux avionic-design tegra2 medcom arm armv7 medcom avionic-design tegra2 +tec arm armv7 tec avionic-design tegra2 paz00 arm armv7 paz00 compal tegra2 trimslice arm armv7 trimslice compulab tegra2 atngw100 avr32 at32ap - atmel at32ap700x
include/configs/tec.h new file +82 -0
82 lines not on this page · raw message
Signature · 1 line
1.7.10.3
PATCH v3 7/7 tegra: Add Tamonten Evaluation Carrier support
Quoted 13 lines · Thierry Reding
The Tamonten Evaluation Carrier is an evaluation board for the Tamonten processor board. More information is available here:
Signed-off-by Thierry Reding <[email protected]>Acked-by Stephen Warren <[email protected]>---
include/configs/tec.h new file +0
-0
include/configs/tec.h line 82
Quoted 7 lines
include/configs/tec.h new file +7
-0+ +#define CONFIG_BOOTCOMMAND \ + "mmc rescan;" \ + "ext2load mmc 0 0x17000000 /boot/uImage;" \ + "bootm" + +#endif /* __CONFIG_H */
You're not including "tegra2-common-post.h" here, is that on purpose? I think it's preferable if all tegra boards include both tegra2-common and tegra2-common-post to make it easier to apply changes across the board.
-Allen
Signature · 1 line
nvpublic
PATCH v3 7/7 tegra: Add Tamonten Evaluation Carrier support
Quoted 18 lines · Allen Martin
Quoted 17 lines · Thierry Reding
The Tamonten Evaluation Carrier is an evaluation board for the Tamonten processor board. More information is available here:
Signed-off-by Thierry Reding <[email protected]>Acked-by Stephen Warren <[email protected]>---
include/configs/tec.h new file +4
-0+ +#define CONFIG_BOOTCOMMAND \ + "mmc rescan;" \ + "ext2load mmc 0 0x17000000 /boot/uImage;" \
Quoted 8 lines
include/configs/tec.h line 82
Quoted 3 lines
include/configs/tec.h new file +3
-0+ "bootm" + +#endif /* __CONFIG_H */ You're not including "
tegra2-common-post.h" here, is that on purpose? I think it's preferable if all tegra boards include both tegra2-common and tegra2-common-post to make it easier to apply changes across the board.
Yes, that was on purpose. I still need to figure out if I want to use Stephen's boot commands as defined in tegra2-common-post.h. But I just realized that since our boards define CONFIG_BOOTCOMMAND, including it won't hurt much anyway. I also just noticed that Stephen added it for Medcom and Plutux already and I'm fine with you carrying the TEC change in your series.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120611/9aebf5b0/attachment.pgp>