public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 1/7] tegra: Rework Tamonten support
@ 2012-06-05  6:02 Thierry Reding
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 2/7] tegra: medcom: Add device tree support Thierry Reding
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Thierry Reding @ 2012-06-05  6:02 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
---
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

diff --git a/board/avionic-design/common/tamonten.c b/board/avionic-design/common/tamonten.c
index f23b657..d9ecd23 100644
--- a/board/avionic-design/common/tamonten.c
+++ b/board/avionic-design/common/tamonten.c
@@ -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 */
diff --git a/board/avionic-design/common/tamonten.h b/board/avionic-design/common/tamonten.h
deleted file mode 100644
index 0e60b0f..0000000
--- a/board/avionic-design/common/tamonten.h
+++ /dev/null
@@ -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 */
diff --git a/board/avionic-design/medcom/Makefile b/board/avionic-design/medcom/Makefile
index b0c318c..d96d043 100644
--- a/board/avionic-design/medcom/Makefile
+++ b/board/avionic-design/medcom/Makefile
@@ -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)
diff --git a/board/avionic-design/medcom/medcom.c b/board/avionic-design/medcom/medcom.c
deleted file mode 100644
index 42c8094..0000000
--- a/board/avionic-design/medcom/medcom.c
+++ /dev/null
@@ -1,45 +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
- */
-
-#include <common.h>
-#include <asm/io.h>
-#include <asm/gpio.h>
-#include <asm/arch/tegra2.h>
-#ifdef CONFIG_TEGRA2_MMC
-#include <mmc.h>
-#endif
-
-#ifdef CONFIG_TEGRA2_MMC
-/*
- * Routine: gpio_config_mmc
- * Description: Set GPIOs for SD card
- */
-void gpio_config_mmc(void)
-{
-	/* configure pin as input for card detect */
-	gpio_request(GPIO_PH2, "SD4 CD");
-	gpio_direction_input(GPIO_PH2);
-}
-#endif
diff --git a/board/avionic-design/plutux/Makefile b/board/avionic-design/plutux/Makefile
index b0c318c..d96d043 100644
--- a/board/avionic-design/plutux/Makefile
+++ b/board/avionic-design/plutux/Makefile
@@ -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)
diff --git a/board/avionic-design/plutux/plutux.c b/board/avionic-design/plutux/plutux.c
deleted file mode 100644
index 42c8094..0000000
--- a/board/avionic-design/plutux/plutux.c
+++ /dev/null
@@ -1,45 +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
- */
-
-#include <common.h>
-#include <asm/io.h>
-#include <asm/gpio.h>
-#include <asm/arch/tegra2.h>
-#ifdef CONFIG_TEGRA2_MMC
-#include <mmc.h>
-#endif
-
-#ifdef CONFIG_TEGRA2_MMC
-/*
- * Routine: gpio_config_mmc
- * Description: Set GPIOs for SD card
- */
-void gpio_config_mmc(void)
-{
-	/* configure pin as input for card detect */
-	gpio_request(GPIO_PH2, "SD4 CD");
-	gpio_direction_input(GPIO_PH2);
-}
-#endif
-- 
1.7.10.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v3 2/7] tegra: medcom: Add device tree support
  2012-06-05  6:02 [U-Boot] [PATCH v3 1/7] tegra: Rework Tamonten support Thierry Reding
@ 2012-06-05  6:02 ` Thierry Reding
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 3/7] tegra: plutux: " Thierry Reding
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2012-06-05  6:02 UTC (permalink / raw)
  To: u-boot

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>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
---
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

diff --git a/board/avionic-design/dts/tegra2-medcom.dts b/board/avionic-design/dts/tegra2-medcom.dts
new file mode 100644
index 0000000..fc52f9c
--- /dev/null
+++ b/board/avionic-design/dts/tegra2-medcom.dts
@@ -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";
+	};
+};
diff --git a/include/configs/medcom.h b/include/configs/medcom.h
index bdea7c9..c84db03 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 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
-- 
1.7.10.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v3 3/7] tegra: plutux: Add device tree support
  2012-06-05  6:02 [U-Boot] [PATCH v3 1/7] tegra: Rework Tamonten support Thierry Reding
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 2/7] tegra: medcom: Add device tree support Thierry Reding
@ 2012-06-05  6:02 ` Thierry Reding
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 4/7] tegra: Allow boards to perform early GPIO setup Thierry Reding
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2012-06-05  6:02 UTC (permalink / raw)
  To: u-boot

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>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
---
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

diff --git a/board/avionic-design/dts/tegra2-plutux.dts b/board/avionic-design/dts/tegra2-plutux.dts
new file mode 100644
index 0000000..cef49ad
--- /dev/null
+++ b/board/avionic-design/dts/tegra2-plutux.dts
@@ -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";
+	};
+};
diff --git a/include/configs/plutux.h b/include/configs/plutux.h
index 6397eb1..9870590 100644
--- a/include/configs/plutux.h
+++ b/include/configs/plutux.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 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
-- 
1.7.10.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v3 4/7] tegra: Allow boards to perform early GPIO setup
  2012-06-05  6:02 [U-Boot] [PATCH v3 1/7] tegra: Rework Tamonten support Thierry Reding
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 2/7] tegra: medcom: Add device tree support Thierry Reding
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 3/7] tegra: plutux: " Thierry Reding
@ 2012-06-05  6:02 ` Thierry Reding
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 5/7] tegra: Implement gpio_early_init() on Tamonten Thierry Reding
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2012-06-05  6:02 UTC (permalink / raw)
  To: u-boot

The new gpio_early_init() function, which does nothing by default, can
be overridden by boards to configure GPIOs at an early stage.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
---
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(+)

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 2e22133..a159deb 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -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
diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h
index 09fb158..dada4c4 100644
--- a/board/nvidia/common/board.h
+++ b/board/nvidia/common/board.h
@@ -25,6 +25,7 @@
 #define _BOARD_H_
 
 void gpio_config_uart(void);
+void gpio_early_init(void);
 void gpio_early_init_uart(void);
 
 /*
-- 
1.7.10.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v3 5/7] tegra: Implement gpio_early_init() on Tamonten
  2012-06-05  6:02 [U-Boot] [PATCH v3 1/7] tegra: Rework Tamonten support Thierry Reding
                   ` (2 preceding siblings ...)
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 4/7] tegra: Allow boards to perform early GPIO setup Thierry Reding
@ 2012-06-05  6:02 ` Thierry Reding
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 6/7] tegra: Use SD write-protect GPIO " Thierry Reding
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 7/7] tegra: Add Tamonten Evaluation Carrier support Thierry Reding
  5 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2012-06-05  6:02 UTC (permalink / raw)
  To: u-boot

The 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.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
---
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(+)

diff --git a/board/avionic-design/common/tamonten.c b/board/avionic-design/common/tamonten.c
index d9ecd23..915247c 100644
--- a/board/avionic-design/common/tamonten.c
+++ b/board/avionic-design/common/tamonten.c
@@ -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
-- 
1.7.10.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v3 6/7] tegra: Use SD write-protect GPIO on Tamonten
  2012-06-05  6:02 [U-Boot] [PATCH v3 1/7] tegra: Rework Tamonten support Thierry Reding
                   ` (3 preceding siblings ...)
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 5/7] tegra: Implement gpio_early_init() on Tamonten Thierry Reding
@ 2012-06-05  6:02 ` Thierry Reding
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 7/7] tegra: Add Tamonten Evaluation Carrier support Thierry Reding
  5 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2012-06-05  6:02 UTC (permalink / raw)
  To: u-boot

GPIO PI6 can be used to obtain the write-protect status of an SD card
inserted into the SD slot.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
---
Changes in v3:
- none

Changes in v2:
- new patch

 board/avionic-design/common/tamonten.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/board/avionic-design/common/tamonten.c b/board/avionic-design/common/tamonten.c
index 915247c..610f188 100644
--- a/board/avionic-design/common/tamonten.c
+++ b/board/avionic-design/common/tamonten.c
@@ -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;
 }
-- 
1.7.10.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v3 7/7] tegra: Add Tamonten Evaluation Carrier support
  2012-06-05  6:02 [U-Boot] [PATCH v3 1/7] tegra: Rework Tamonten support Thierry Reding
                   ` (4 preceding siblings ...)
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 6/7] tegra: Use SD write-protect GPIO " Thierry Reding
@ 2012-06-05  6:02 ` Thierry Reding
  2012-06-08 20:38   ` Allen Martin
  5 siblings, 1 reply; 9+ messages in thread
From: Thierry Reding @ 2012-06-05  6:02 UTC (permalink / raw)
  To: u-boot

The Tamonten Evaluation Carrier is an evaluation board for the Tamonten
processor board. More information is available here:

	http://www.avionic-design.de/en/products/nvidia-tegra-tamonten-system-en/nvidia-tegra-tamonten-evboard-en.html

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
---
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

diff --git a/MAINTAINERS b/MAINTAINERS
index 9d35c0e..52e3909 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -806,6 +806,7 @@ Thierry Reding <thierry.reding@avionic-design.de>
 
 	plutux		Tegra2 (ARM7 & A9 Dual Core)
 	medcom		Tegra2 (ARM7 & A9 Dual Core)
+	tec		Tegra2 (ARM7 & A9 Dual Core)
 
 Christian Riesch <christian.riesch@omicron.at>
 Manfred Rudigier <manfred.rudigier@omicron.at>
diff --git a/board/avionic-design/dts/tegra2-tec.dts b/board/avionic-design/dts/tegra2-tec.dts
new file mode 100644
index 0000000..9faebd8
--- /dev/null
+++ b/board/avionic-design/dts/tegra2-tec.dts
@@ -0,0 +1,58 @@
+/dts-v1/;
+
+/include/ ARCH_CPU_DTS
+
+/ {
+	model = "Avionic Design Tamonten Evaluation Carrier";
+	compatible = "avionic-design,tec", "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";
+	};
+};
diff --git a/board/avionic-design/tec/Makefile b/board/avionic-design/tec/Makefile
new file mode 100644
index 0000000..d96d043
--- /dev/null
+++ b/board/avionic-design/tec/Makefile
@@ -0,0 +1,50 @@
+#
+#  (C) Copyright 2010,2011
+#  NVIDIA Corporation <www.nvidia.com>
+#  (C) Copyright 2011,2012
+#  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
+#
+
+include $(TOPDIR)/config.mk
+
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common $(obj)../../nvidia/common)
+endif
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS	:= ../../nvidia/common/board.o
+COBJS	+= ../common/tamonten.o
+
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/boards.cfg b/boards.cfg
index e983b05..7138279 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -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
diff --git a/include/configs/tec.h b/include/configs/tec.h
new file mode 100644
index 0000000..3d0a788
--- /dev/null
+++ b/include/configs/tec.h
@@ -0,0 +1,82 @@
+/*
+ *  (C) Copyright 2010,2011
+ *  NVIDIA Corporation <www.nvidia.com>
+ *  (C) Copyright 2011-2012
+ *  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 __CONFIG_H
+#define __CONFIG_H
+
+#include "tegra2-common.h"
+
+/* Enable fdt support for TEC. Flash the image in u-boot-dtb.bin */
+#define CONFIG_DEFAULT_DEVICE_TREE	tegra2-tec
+#define CONFIG_OF_CONTROL
+#define CONFIG_OF_SEPARATE
+
+/* High-level configuration options */
+#define V_PROMPT			"Tegra2 (TEC) # "
+#define CONFIG_TEGRA2_BOARD_STRING	"Avionic Design Tamonten Evaluation Carrier"
+#define CONFIG_SYS_BOARD_ODMDATA	0x2b0d8011
+
+/* Board-specific serial config */
+#define CONFIG_SERIAL_MULTI
+#define CONFIG_TEGRA2_ENABLE_UARTD	/* UARTD: debug UART */
+#define CONFIG_SYS_NS16550_COM1		NV_PA_APB_UARTD_BASE
+
+#define CONFIG_BOARD_EARLY_INIT_F
+
+#define CONFIG_ENV_IS_NOWHERE
+
+/* SD/MMC */
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#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
+#define CONFIG_CMD_FAT
+
+#define CONFIG_FIT
+
+#define CONFIG_BOOTCOMMAND				\
+	"mmc rescan;"					\
+	"ext2load mmc 0 0x17000000 /boot/uImage;"	\
+	"bootm"
+
+#endif /* __CONFIG_H */
-- 
1.7.10.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v3 7/7] tegra: Add Tamonten Evaluation Carrier support
  2012-06-05  6:02 ` [U-Boot] [PATCH v3 7/7] tegra: Add Tamonten Evaluation Carrier support Thierry Reding
@ 2012-06-08 20:38   ` Allen Martin
  2012-06-11  9:22     ` Thierry Reding
  0 siblings, 1 reply; 9+ messages in thread
From: Allen Martin @ 2012-06-08 20:38 UTC (permalink / raw)
  To: u-boot

On Mon, Jun 04, 2012 at 11:02:30PM -0700, Thierry Reding wrote:
> The Tamonten Evaluation Carrier is an evaluation board for the Tamonten
> processor board. More information is available here:
> 
>         http://www.avionic-design.de/en/products/nvidia-tegra-tamonten-system-en/nvidia-tegra-tamonten-evboard-en.html
> 
> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
> ---
> diff --git a/include/configs/tec.h b/include/configs/tec.h
> new file mode 100644
> index 0000000..3d0a788
> --- /dev/null
> +++ b/include/configs/tec.h
> +
> +#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
-- 
nvpublic

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v3 7/7] tegra: Add Tamonten Evaluation Carrier support
  2012-06-08 20:38   ` Allen Martin
@ 2012-06-11  9:22     ` Thierry Reding
  0 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2012-06-11  9:22 UTC (permalink / raw)
  To: u-boot

* Allen Martin wrote:
> On Mon, Jun 04, 2012 at 11:02:30PM -0700, Thierry Reding wrote:
> > The Tamonten Evaluation Carrier is an evaluation board for the Tamonten
> > processor board. More information is available here:
> > 
> >         http://www.avionic-design.de/en/products/nvidia-tegra-tamonten-system-en/nvidia-tegra-tamonten-evboard-en.html
> > 
> > Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> > Acked-by: Stephen Warren <swarren@wwwdotorg.org>
> > ---
> > diff --git a/include/configs/tec.h b/include/configs/tec.h
> > new file mode 100644
> > index 0000000..3d0a788
> > --- /dev/null
> > +++ b/include/configs/tec.h
> > +
> > +#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.

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>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-06-11  9:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-05  6:02 [U-Boot] [PATCH v3 1/7] tegra: Rework Tamonten support Thierry Reding
2012-06-05  6:02 ` [U-Boot] [PATCH v3 2/7] tegra: medcom: Add device tree support Thierry Reding
2012-06-05  6:02 ` [U-Boot] [PATCH v3 3/7] tegra: plutux: " Thierry Reding
2012-06-05  6:02 ` [U-Boot] [PATCH v3 4/7] tegra: Allow boards to perform early GPIO setup Thierry Reding
2012-06-05  6:02 ` [U-Boot] [PATCH v3 5/7] tegra: Implement gpio_early_init() on Tamonten Thierry Reding
2012-06-05  6:02 ` [U-Boot] [PATCH v3 6/7] tegra: Use SD write-protect GPIO " Thierry Reding
2012-06-05  6:02 ` [U-Boot] [PATCH v3 7/7] tegra: Add Tamonten Evaluation Carrier support Thierry Reding
2012-06-08 20:38   ` Allen Martin
2012-06-11  9:22     ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox