mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <dev@lynxeye.de>
To: barebox@lists.infradead.org
Subject: [PATCH 08/13] tegra: jetson-tk1: enable 1.05V_RUN
Date: Sun,  2 Nov 2014 21:13:50 +0100	[thread overview]
Message-ID: <1414959235-18095-9-git-send-email-dev@lynxeye.de> (raw)
In-Reply-To: <1414959235-18095-1-git-send-email-dev@lynxeye.de>

Needed for the PCIe PLL amongst other things.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 arch/arm/boards/nvidia-jetson-tk1/Makefile |  2 +-
 arch/arm/boards/nvidia-jetson-tk1/board.c  | 50 ++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boards/nvidia-jetson-tk1/board.c

diff --git a/arch/arm/boards/nvidia-jetson-tk1/Makefile b/arch/arm/boards/nvidia-jetson-tk1/Makefile
index f1e4620..16b203f 100644
--- a/arch/arm/boards/nvidia-jetson-tk1/Makefile
+++ b/arch/arm/boards/nvidia-jetson-tk1/Makefile
@@ -3,5 +3,5 @@ CFLAGS_pbl-entry.o := \
 	-fno-tree-switch-conversion -fno-jump-tables
 soc := tegra124
 lwl-y += entry.o
-#obj-y += board.o
+obj-y += board.o
 extra-y += jetson-tk1-2gb-emmc.bct
diff --git a/arch/arm/boards/nvidia-jetson-tk1/board.c b/arch/arm/boards/nvidia-jetson-tk1/board.c
new file mode 100644
index 0000000..c20f56a
--- /dev/null
+++ b/arch/arm/boards/nvidia-jetson-tk1/board.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2014 Lucas Stach <l.stach@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <common.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
+#include <gpio.h>
+#include <i2c/i2c.h>
+#include <init.h>
+
+#define AS3722_SD_VOLTAGE(n)	(0x00 + (n))
+#define AS3722_GPIO_CONTROL(n)	(0x08 + (n))
+#define  AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDH (1 << 0)
+#define AS3722_GPIO_SIGNAL_OUT	0x20
+#define AS3722_SD_CONTROL	0x4d
+
+static int nvidia_jetson_tk1_devices_init(void)
+{
+	struct i2c_client client;
+	u8 data;
+
+	if (!of_machine_is_compatible("nvidia,jetson-tk1"))
+		return 0;
+
+	client.adapter = i2c_get_adapter(4);
+	client.addr = 0x40;
+
+	/* AS3722: enable SD4 and set voltage to 1.05v */
+	i2c_read_reg(&client, AS3722_SD_CONTROL, &data, 1);
+	data |= 1 << 4;
+	i2c_write_reg(&client, AS3722_SD_CONTROL, &data, 1);
+
+	data = 0x24;
+	i2c_write_reg(&client, AS3722_SD_VOLTAGE(4), &data, 1);
+
+	return 0;
+}
+fs_initcall(nvidia_jetson_tk1_devices_init);
-- 
1.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2014-11-02 20:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-02 20:13 [PATCH 00/13] Tegra124 PCIe Lucas Stach
2014-11-02 20:13 ` [PATCH 01/13] net: rtl8169: add support for RTL-8168/8111g Lucas Stach
2014-11-02 20:13 ` [PATCH 02/13] net: rtl8169: clean receive buffer after net handler Lucas Stach
2014-11-02 20:13 ` [PATCH 03/13] tegra: defconfig: enable barebox OF drivers Lucas Stach
2014-11-02 20:13 ` [PATCH 04/13] pinctrl: tegra: try to select "boot" state Lucas Stach
2014-11-02 20:13 ` [PATCH 05/13] arm: dts: jetson-tk1: switch to upstream DT Lucas Stach
2014-11-02 20:13 ` [PATCH 06/13] clk: tegra: slow down MSELECT to 102MHz Lucas Stach
2014-11-02 20:13 ` [PATCH 07/13] tegra: pmc: work around power domain failure Lucas Stach
2014-11-02 20:13 ` Lucas Stach [this message]
2014-11-02 20:13 ` [PATCH 09/13] clk: tegra124: add PLLE setup functions Lucas Stach
2014-11-02 20:13 ` [PATCH 10/13] clk: tegra124: add PCIe clocks Lucas Stach
2014-11-02 20:13 ` [PATCH 11/13] add generic PHY framework Lucas Stach
2014-11-02 20:13 ` [PATCH 12/13] pinctrl: tegra: add XUSB pad controller Lucas Stach
2014-11-02 20:13 ` [PATCH 13/13] pci: tegra: add tegra124 support Lucas Stach
2014-11-03  8:40 ` [PATCH 00/13] Tegra124 PCIe Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414959235-18095-9-git-send-email-dev@lynxeye.de \
    --to=dev@lynxeye.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox