2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
ARM: tegra: Add support for nyan-big board
Nyan-big is a Tegra124 clamshell board that is very similar to venice2, but
it has a different panel, the sdcard cd and wp sense are flipped, and it has
a different revision of the AS3722 PMIC.
This is the Acer Chromebook 13 CB5-311-T7NN (13.3-inch HD, NVIDIA
Tegra K1, 2GB). The display is not currently supported, so it should
boot on other nyan-based Chromebooks also, but only the device tree for
nyan-big is provided here.
The device tree file is from Linux but with features removed which are
unlikely to be supported in U-Boot soon (regulators, pinmux). Also the
addresses are updated to 32-bit.
Signed-off-by: Allen Martin <amartin@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
(rebase, change to 'nyan-big', fix pinmux that resets nyan-big)
2014-12-04 13:36:30 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2014
|
|
|
|
* NVIDIA Corporation <www.nvidia.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2017-07-25 14:30:12 +00:00
|
|
|
#include <dm.h>
|
2015-04-15 03:03:29 +00:00
|
|
|
#include <errno.h>
|
2020-05-10 17:40:05 +00:00
|
|
|
#include <log.h>
|
2015-04-15 03:03:29 +00:00
|
|
|
#include <asm/gpio.h>
|
2015-06-05 20:39:43 +00:00
|
|
|
#include <asm/io.h>
|
ARM: tegra: Add support for nyan-big board
Nyan-big is a Tegra124 clamshell board that is very similar to venice2, but
it has a different panel, the sdcard cd and wp sense are flipped, and it has
a different revision of the AS3722 PMIC.
This is the Acer Chromebook 13 CB5-311-T7NN (13.3-inch HD, NVIDIA
Tegra K1, 2GB). The display is not currently supported, so it should
boot on other nyan-based Chromebooks also, but only the device tree for
nyan-big is provided here.
The device tree file is from Linux but with features removed which are
unlikely to be supported in U-Boot soon (regulators, pinmux). Also the
addresses are updated to 32-bit.
Signed-off-by: Allen Martin <amartin@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
(rebase, change to 'nyan-big', fix pinmux that resets nyan-big)
2014-12-04 13:36:30 +00:00
|
|
|
#include <asm/arch/pinmux.h>
|
2015-06-05 20:39:43 +00:00
|
|
|
#include <asm/arch/clock.h>
|
|
|
|
#include <asm/arch/mc.h>
|
|
|
|
#include <asm/arch-tegra/clk_rst.h>
|
|
|
|
#include <asm/arch-tegra/pmc.h>
|
2020-05-10 17:40:11 +00:00
|
|
|
#include <linux/delay.h>
|
2015-04-15 03:03:29 +00:00
|
|
|
#include <power/as3722.h>
|
|
|
|
#include <power/pmic.h>
|
ARM: tegra: Add support for nyan-big board
Nyan-big is a Tegra124 clamshell board that is very similar to venice2, but
it has a different panel, the sdcard cd and wp sense are flipped, and it has
a different revision of the AS3722 PMIC.
This is the Acer Chromebook 13 CB5-311-T7NN (13.3-inch HD, NVIDIA
Tegra K1, 2GB). The display is not currently supported, so it should
boot on other nyan-based Chromebooks also, but only the device tree for
nyan-big is provided here.
The device tree file is from Linux but with features removed which are
unlikely to be supported in U-Boot soon (regulators, pinmux). Also the
addresses are updated to 32-bit.
Signed-off-by: Allen Martin <amartin@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
(rebase, change to 'nyan-big', fix pinmux that resets nyan-big)
2014-12-04 13:36:30 +00:00
|
|
|
#include "pinmux-config-nyan-big.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Routine: pinmux_init
|
|
|
|
* Description: Do individual peripheral pinmux configs
|
|
|
|
*/
|
|
|
|
void pinmux_init(void)
|
|
|
|
{
|
|
|
|
gpio_config_table(nyan_big_gpio_inits,
|
|
|
|
ARRAY_SIZE(nyan_big_gpio_inits));
|
|
|
|
|
|
|
|
pinmux_config_pingrp_table(nyan_big_pingrps,
|
|
|
|
ARRAY_SIZE(nyan_big_pingrps));
|
|
|
|
|
|
|
|
pinmux_config_drvgrp_table(nyan_big_drvgrps,
|
|
|
|
ARRAY_SIZE(nyan_big_drvgrps));
|
|
|
|
}
|
2015-04-15 03:03:29 +00:00
|
|
|
|
|
|
|
int tegra_board_id(void)
|
|
|
|
{
|
2016-05-12 18:07:39 +00:00
|
|
|
static const int vector[] = {TEGRA_GPIO(Q, 3), TEGRA_GPIO(T, 1),
|
|
|
|
TEGRA_GPIO(X, 1), TEGRA_GPIO(X, 4),
|
|
|
|
-1};
|
2015-04-15 03:03:29 +00:00
|
|
|
|
|
|
|
gpio_claim_vector(vector, "board_id%d");
|
|
|
|
return gpio_get_values_as_int(vector);
|
|
|
|
}
|
|
|
|
|
|
|
|
int tegra_lcd_pmic_init(int board_id)
|
|
|
|
{
|
2017-07-25 14:30:12 +00:00
|
|
|
struct udevice *dev;
|
2015-04-15 03:03:29 +00:00
|
|
|
int ret;
|
|
|
|
|
2017-07-25 14:30:12 +00:00
|
|
|
ret = uclass_get_device_by_driver(UCLASS_PMIC,
|
2020-12-29 03:34:56 +00:00
|
|
|
DM_DRIVER_GET(pmic_as3722), &dev);
|
2017-07-25 14:30:12 +00:00
|
|
|
if (ret) {
|
|
|
|
debug("%s: Failed to find PMIC\n", __func__);
|
|
|
|
return ret;
|
|
|
|
}
|
2015-04-15 03:03:29 +00:00
|
|
|
|
|
|
|
if (board_id == 0)
|
2017-07-25 14:30:12 +00:00
|
|
|
pmic_reg_write(dev, 0x00, 0x3c);
|
2015-04-15 03:03:29 +00:00
|
|
|
else
|
2017-07-25 14:30:12 +00:00
|
|
|
pmic_reg_write(dev, 0x00, 0x50);
|
|
|
|
pmic_reg_write(dev, 0x12, 0x10);
|
|
|
|
pmic_reg_write(dev, 0x0c, 0x07);
|
|
|
|
pmic_reg_write(dev, 0x20, 0x10);
|
2015-04-15 03:03:29 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2015-06-05 20:39:43 +00:00
|
|
|
|
|
|
|
/* Setup required information for Linux kernel */
|
|
|
|
static void setup_kernel_info(void)
|
|
|
|
{
|
|
|
|
struct mc_ctlr *mc = (void *)NV_PA_MC_BASE;
|
|
|
|
|
|
|
|
/* The kernel graphics driver needs this region locked down */
|
|
|
|
writel(0, &mc->mc_video_protect_bom);
|
|
|
|
writel(0, &mc->mc_video_protect_size_mb);
|
|
|
|
writel(1, &mc->mc_video_protect_reg_ctrl);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* We need to take ALL audio devices conntected to AHUB (AUDIO, APBIF,
|
|
|
|
* I2S, DAM, AMX, ADX, SPDIF, AFC) out of reset and enable the clocks.
|
|
|
|
* Otherwise reading AHUB devices will hang when the kernel boots.
|
|
|
|
*/
|
|
|
|
static void enable_required_clocks(void)
|
|
|
|
{
|
|
|
|
static enum periph_id ids[] = {
|
|
|
|
PERIPH_ID_I2S0,
|
|
|
|
PERIPH_ID_I2S1,
|
|
|
|
PERIPH_ID_I2S2,
|
|
|
|
PERIPH_ID_I2S3,
|
|
|
|
PERIPH_ID_I2S4,
|
|
|
|
PERIPH_ID_AUDIO,
|
|
|
|
PERIPH_ID_APBIF,
|
|
|
|
PERIPH_ID_DAM0,
|
|
|
|
PERIPH_ID_DAM1,
|
|
|
|
PERIPH_ID_DAM2,
|
|
|
|
PERIPH_ID_AMX0,
|
|
|
|
PERIPH_ID_AMX1,
|
|
|
|
PERIPH_ID_ADX0,
|
|
|
|
PERIPH_ID_ADX1,
|
|
|
|
PERIPH_ID_SPDIF,
|
|
|
|
PERIPH_ID_AFC0,
|
|
|
|
PERIPH_ID_AFC1,
|
|
|
|
PERIPH_ID_AFC2,
|
|
|
|
PERIPH_ID_AFC3,
|
|
|
|
PERIPH_ID_AFC4,
|
|
|
|
PERIPH_ID_AFC5,
|
|
|
|
PERIPH_ID_EXTPERIPH1
|
|
|
|
};
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(ids); i++)
|
|
|
|
clock_enable(ids[i]);
|
|
|
|
udelay(2);
|
|
|
|
for (i = 0; i < ARRAY_SIZE(ids); i++)
|
|
|
|
reset_set_enable(ids[i], 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
int nvidia_board_init(void)
|
|
|
|
{
|
|
|
|
clock_start_periph_pll(PERIPH_ID_EXTPERIPH1, CLOCK_ID_OSC, 12000000);
|
2019-04-01 20:38:38 +00:00
|
|
|
clock_start_periph_pll(PERIPH_ID_I2S1, CLOCK_ID_CLK_M, 1500000);
|
2015-06-05 20:39:43 +00:00
|
|
|
|
|
|
|
/* For external MAX98090 audio codec */
|
|
|
|
clock_external_output(1);
|
|
|
|
setup_kernel_info();
|
|
|
|
enable_required_clocks();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|