diff options
author | Lucas Stach <dev@lynxeye.de> | 2014-11-02 21:13:50 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-11-04 09:50:43 +0100 |
commit | a546e66838ff4c62b91ec401256bfae15d02c53e (patch) | |
tree | 4b6a62f6faedfcc3b4492ee1100770237f868c9d /arch/arm | |
parent | 7cf0a3ea2bb07bd02dfe22a81d34c8614e72f52c (diff) | |
download | barebox-a546e66838ff4c62b91ec401256bfae15d02c53e.tar.gz barebox-a546e66838ff4c62b91ec401256bfae15d02c53e.tar.xz |
tegra: jetson-tk1: enable 1.05V_RUN
Needed for the PCIe PLL amongst other things.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/boards/nvidia-jetson-tk1/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/boards/nvidia-jetson-tk1/board.c | 50 | ||||
-rw-r--r-- | arch/arm/mach-tegra/Kconfig | 2 |
3 files changed, 53 insertions, 1 deletions
diff --git a/arch/arm/boards/nvidia-jetson-tk1/Makefile b/arch/arm/boards/nvidia-jetson-tk1/Makefile index f1e46206f8..16b203f9f3 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 0000000000..c20f56a3bb --- /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); diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 2c69406dfc..1bdea8e6a9 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -70,6 +70,8 @@ config MACH_NVIDIA_BEAVER config MACH_NVIDIA_JETSON bool "NVIDIA Jetson TK1" select ARCH_TEGRA_124_SOC + select I2C + select I2C_TEGRA endmenu |