diff mbox

[U-Boot] ARM: tegra: Add support for norrin board

Message ID 1404161611-18697-1-git-send-email-amartin@nvidia.com
State Changes Requested
Delegated to: Tom Warren
Headers show

Commit Message

Allen Martin June 30, 2014, 8:53 p.m. UTC
Norrin (PM370) is a Tegra124 clamshell board that is very similar to
venice2, but it has a different panel, the sdcard cd sense is flipped,
and it has a different revision of the AS3722 PMIC.  Reuse the venice2
config with a norrin dtb.  This board is also refered to as "nyan" in
the ChromeOS trees.

Signed-off-by: Allen Martin <amartin@nvidia.com>
---
 arch/arm/dts/Makefile              |  3 +-
 arch/arm/dts/tegra124-norrin.dts   | 91 ++++++++++++++++++++++++++++++++++++++
 board/nvidia/venice2/as3722_init.h |  2 +-
 boards.cfg                         |  1 +
 include/configs/venice2.h          |  9 ++++
 5 files changed, 104 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/tegra124-norrin.dts

Comments

Stephen Warren June 30, 2014, 9:32 p.m. UTC | #1
On 06/30/2014 02:53 PM, Allen Martin wrote:
> Norrin (PM370) is a Tegra124 clamshell board that is very similar to
> venice2, but it has a different panel, the sdcard cd sense is flipped,
> and it has a different revision of the AS3722 PMIC.  Reuse the venice2
> config with a norrin dtb.  This board is also refered to as "nyan" in
> the ChromeOS trees.

Isn't the pinmux different too? I think this patch should contain
board/nvidia/norrin/pinmux-config-norrin.h shouldn't it? That in turn
would mean adding Norrin support to tegra-pinmux-scripts. Of course, if
they really do have 100% identical pinmux, then there's no issue. I'm
skeptical though.
Allen Martin July 1, 2014, 6:13 p.m. UTC | #2
On Mon, Jun 30, 2014 at 02:32:20PM -0700, Stephen Warren wrote:
> On 06/30/2014 02:53 PM, Allen Martin wrote:
> > Norrin (PM370) is a Tegra124 clamshell board that is very similar to
> > venice2, but it has a different panel, the sdcard cd sense is flipped,
> > and it has a different revision of the AS3722 PMIC.  Reuse the venice2
> > config with a norrin dtb.  This board is also refered to as "nyan" in
> > the ChromeOS trees.
> 
> Isn't the pinmux different too? I think this patch should contain
> board/nvidia/norrin/pinmux-config-norrin.h shouldn't it? That in turn
> would mean adding Norrin support to tegra-pinmux-scripts. Of course, if
> they really do have 100% identical pinmux, then there's no issue. I'm
> skeptical though.

AFAIK they really do have identical pinmux, I'll double check the
pinmux spreadsheet to make sure.

There's another unintended side effect of reusing the venice2 board
this way that I discovered after posting this.  It causes
CONFIG_SYS_BOARD to be set to venice2 still, which causes the
"board_name" environment variable to be set to venice2, which causes
boot.scr to look for a venice2 dtb.

It may be cleaner to make norrin a proper board, and just have it
#include the vencie2 pinmux.

-Allen

nvpublic
diff mbox

Patch

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 55546152b94b..414f206cb6f0 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -23,7 +23,8 @@  dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
 	tegra30-tec-ng.dtb \
 	tegra114-dalmore.dtb \
 	tegra124-jetson-tk1.dtb \
-	tegra124-venice2.dtb
+	tegra124-venice2.dtb \
+	tegra124-norrin.dtb
 dtb-$(CONFIG_ZYNQ) += zynq-zc702.dtb \
 	zynq-zc706.dtb \
 	zynq-zed.dtb \
diff --git a/arch/arm/dts/tegra124-norrin.dts b/arch/arm/dts/tegra124-norrin.dts
new file mode 100644
index 000000000000..fdf000cf75ec
--- /dev/null
+++ b/arch/arm/dts/tegra124-norrin.dts
@@ -0,0 +1,91 @@ 
+/dts-v1/;
+
+#include "tegra124.dtsi"
+
+/ {
+	model = "NVIDIA Norrin";
+	compatible = "nvidia,norrin", "nvidia,tegra124";
+
+	aliases {
+		i2c0 = "/i2c@7000d000";
+		i2c1 = "/i2c@7000c000";
+		i2c2 = "/i2c@7000c400";
+		i2c3 = "/i2c@7000c500";
+		i2c4 = "/i2c@7000c700";
+		i2c5 = "/i2c@7000d100";
+		sdhci0 = "/sdhci@700b0600";
+		sdhci1 = "/sdhci@700b0400";
+		spi0 = "/spi@7000d400";
+		spi1 = "/spi@7000da00";
+		usb0 = "/usb@7d000000";
+		usb1 = "/usb@7d008000";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x80000000>;
+	};
+
+	i2c@7000c000 {
+		status = "okay";
+		clock-frequency = <100000>;
+	};
+
+	i2c@7000c400 {
+		status = "okay";
+		clock-frequency = <100000>;
+	};
+
+	i2c@7000c500 {
+		status = "okay";
+		clock-frequency = <100000>;
+	};
+
+	i2c@7000c700 {
+		status = "okay";
+		clock-frequency = <100000>;
+	};
+
+	i2c@7000d000 {
+		status = "okay";
+		clock-frequency = <400000>;
+	};
+
+	i2c@7000d100 {
+		status = "okay";
+		clock-frequency = <400000>;
+	};
+
+	spi@7000d400 {
+		status = "okay";
+		spi-max-frequency = <25000000>;
+	};
+
+	spi@7000da00 {
+		status = "okay";
+		spi-max-frequency = <25000000>;
+	};
+
+	sdhci@700b0400 {
+		status = "okay";
+		cd-gpios = <&gpio 170 1>; /* gpio PV2 */
+		power-gpios = <&gpio 136 0>; /* gpio PR0 */
+		bus-width = <4>;
+	};
+
+	sdhci@700b0600 {
+		status = "okay";
+		bus-width = <8>;
+	};
+
+	usb@7d000000 {
+		status = "okay";
+		dr_mode = "otg";
+		nvidia,vbus-gpio = <&gpio 108 0>; /* gpio PN4, USB_VBUS_EN0 */
+	};
+
+	usb@7d008000 {
+		status = "okay";
+		nvidia,vbus-gpio = <&gpio 109 0>; /* gpio PN5, USB_VBUS_EN1 */
+	};
+};
diff --git a/board/nvidia/venice2/as3722_init.h b/board/nvidia/venice2/as3722_init.h
index a7b24039f6aa..7c80ef09387b 100644
--- a/board/nvidia/venice2/as3722_init.h
+++ b/board/nvidia/venice2/as3722_init.h
@@ -18,7 +18,7 @@ 
 #define AS3722_LDO6VOLTAGE_REG	0x16	/* VDD_SDMMC */
 #define AS3722_LDCONTROL_REG	0x4E
 
-#ifdef CONFIG_BOARD_JETSON_TK1
+#if defined(CONFIG_BOARD_JETSON_TK1) || defined(CONFIG_BOARD_NORRIN)
 #define AS3722_SD0VOLTAGE_DATA	(0x3C00 | AS3722_SD0VOLTAGE_REG)
 #else
 #define AS3722_SD0VOLTAGE_DATA	(0x2800 | AS3722_SD0VOLTAGE_REG)
diff --git a/boards.cfg b/boards.cfg
index 5a85fad48095..3950688ba30b 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -395,6 +395,7 @@  Active  arm         armv7          zynq        xilinx          zynq
 Active  arm         armv7:arm720t  tegra114    nvidia          dalmore             dalmore                               -                                                                                                                                 Tom Warren <twarren@nvidia.com>
 Active  arm         armv7:arm720t  tegra124    nvidia          jetson-tk1          jetson-tk1                            jetson-tk1:BOARD_JETSON_TK1=                                                                                                      Stephen Warren <swarren@nvidia.com>
 Active  arm         armv7:arm720t  tegra124    nvidia          venice2             venice2                               -                                                                                                                                 Tom Warren <twarren@nvidia.com>
+Active  arm         armv7:arm720t  tegra124    nvidia          venice2             norrin                                venice2:BOARD_NORRIN                                                                                                              Tom Warren <twarren@nvidia.com>
 Active  arm         armv7:arm720t  tegra20     avionic-design  medcom-wide         medcom-wide                           -                                                                                                                                 Alban Bedel <alban.bedel@avionic-design.de>
 Active  arm         armv7:arm720t  tegra20     avionic-design  plutux              plutux                                -                                                                                                                                 Alban Bedel <alban.bedel@avionic-design.de>
 Active  arm         armv7:arm720t  tegra20     avionic-design  tec                 tec                                   -                                                                                                                                 Alban Bedel <alban.bedel@avionic-design.de>
diff --git a/include/configs/venice2.h b/include/configs/venice2.h
index c4a1b94b98e1..7162d2e4bd47 100644
--- a/include/configs/venice2.h
+++ b/include/configs/venice2.h
@@ -13,13 +13,22 @@ 
 #include "tegra124-common.h"
 
 /* Enable fdt support for Venice2. Flash the image in u-boot-dtb.bin */
+#ifdef CONFIG_BOARD_NORRIN
+#define CONFIG_DEFAULT_DEVICE_TREE	tegra124-norrin
+#else
 #define CONFIG_DEFAULT_DEVICE_TREE	tegra124-venice2
+#endif
 #define CONFIG_OF_CONTROL
 #define CONFIG_OF_SEPARATE
 
 /* High-level configuration options */
+#ifdef CONFIG_BOARD_NORRIN
+#define V_PROMPT			"Tegra124 (Norrin) # "
+#define CONFIG_TEGRA_BOARD_STRING	"NVIDIA Norrin"
+#else
 #define V_PROMPT			"Tegra124 (Venice2) # "
 #define CONFIG_TEGRA_BOARD_STRING	"NVIDIA Venice2"
+#endif
 
 /* Board-specific serial config */
 #define CONFIG_SERIAL_MULTI