2014-01-18 07:11:35 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
|
|
|
* Copyright 2014 Google Inc.
|
|
|
|
*
|
|
|
|
* 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; version 2 of the License.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <arch/io.h>
|
2014-10-20 22:24:14 +02:00
|
|
|
#include <boot/coreboot_tables.h>
|
2014-01-18 07:11:35 +01:00
|
|
|
#include <device/device.h>
|
2014-03-21 02:43:45 +01:00
|
|
|
#include <elog.h>
|
gpio: Extend common GPIO header, simplify function names
We've had gpiolib.h which defines a few common GPIO access functions for
a while, but it wasn't really complete. This patch adds the missing
gpio_output() function, and also renames the unwieldy
gpio_get_in_value() and gpio_set_out_value() to the much easier to
handle gpio_get() and gpio_set(). The header is renamed to the simpler
gpio.h while we're at it (there was never really anything "lib" about
it, and it was presumably just chosen due to the IPQ806x include/
conflict problem that is now resolved).
It also moves the definition of gpio_t into SoC-specific code, so that
different implementations are free to encode their platform-specific
GPIO parameters in those 4 bytes in the most convenient way (such as the
rk3288 with a bitfield struct). Every SoC intending to use this common
API should supply a <soc/gpio.h> that typedefs gpio_t to a type at most
4 bytes in length. Files accessing the API only need to include <gpio.h>
which may pull in additional things (like a gpio_t creation macro) from
<soc/gpio.h> on its own.
For now the API is still only used on non-x86 SoCs. Whether it makes
sense to expand it to x86 as well should be separately evaluated at a
later point (by someone who understands those systems better). Also,
Exynos retains its old, incompatible GPIO API even though it would be a
prime candidate, because it's currently just not worth the effort.
BUG=None
TEST=Compiled on Daisy, Peach_Pit, Nyan_Blaze, Rush_Ryu, Storm and
Veyron_Pinky.
Change-Id: Ieee77373c2bd13d07ece26fa7f8b08be324842fe
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 9e04902ada56b929e3829f2c3b4aeb618682096e
Original-Change-Id: I6c1e7d1e154d9b02288aabedb397e21e1aadfa15
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/220975
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/9400
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2014-09-25 00:40:49 +02:00
|
|
|
#include <gpio.h>
|
2014-01-18 07:11:35 +01:00
|
|
|
#include <soc/addressmap.h>
|
2014-10-20 22:24:14 +02:00
|
|
|
#include <soc/clk_rst.h>
|
2014-01-18 07:11:35 +01:00
|
|
|
#include <soc/clock.h>
|
2014-10-20 22:24:14 +02:00
|
|
|
#include <soc/mc.h>
|
2014-01-18 07:11:35 +01:00
|
|
|
#include <soc/nvidia/tegra/i2c.h>
|
2014-10-20 22:24:14 +02:00
|
|
|
#include <soc/pmc.h>
|
|
|
|
#include <soc/spi.h>
|
2014-08-06 18:53:55 +02:00
|
|
|
#include <soc/nvidia/tegra/usb.h>
|
New mechanism to define SRAM/memory map with automatic bounds checking
This patch creates a new mechanism to define the static memory layout
(primarily in SRAM) for a given board, superseding the brittle mass of
Kconfigs that we were using before. The core part is a memlayout.ld file
in the mainboard directory (although boards are expected to just include
the SoC default in most cases), which is the primary linker script for
all stages (though not rmodules for now). It uses preprocessor macros
from <memlayout.h> to form a different valid linker script for all
stages while looking like a declarative, boilerplate-free map of memory
addresses to the programmer. Linker asserts will automatically guarantee
that the defined regions cannot overlap. Stages are defined with a
maximum size that will be enforced by the linker. The file serves to
both define and document the memory layout, so that the documentation
cannot go missing or out of date.
The mechanism is implemented for all boards in the ARM, ARM64 and MIPS
architectures, and should be extended onto all systems using SRAM in the
future. The CAR/XIP environment on x86 has very different requirements
and the layout is generally not as static, so it will stay like it is
and be unaffected by this patch (save for aligning some symbol names for
consistency and sharing the new common ramstage linker script include).
BUG=None
TEST=Booted normally and in recovery mode, checked suspend/resume and
the CBMEM console on Falco, Blaze (both normal and vboot2), Pinky and
Pit. Compiled Ryu, Storm and Urara, manually compared the disassemblies
with ToT and looked for red flags.
Change-Id: Ifd2276417f2036cbe9c056f17e42f051bcd20e81
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: f1e2028e7ebceeb2d71ff366150a37564595e614
Original-Change-Id: I005506add4e8fcdb74db6d5e6cb2d4cb1bd3cda5
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/213370
Reviewed-on: http://review.coreboot.org/9283
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-by: Aaron Durbin <adurbin@google.com>
2014-08-21 00:29:56 +02:00
|
|
|
#include <symbols.h>
|
2014-05-14 05:32:14 +02:00
|
|
|
#include <vendorcode/google/chromeos/chromeos.h>
|
2014-01-18 07:11:35 +01:00
|
|
|
|
|
|
|
static struct clk_rst_ctlr *clk_rst = (void *)TEGRA_CLK_RST_BASE;
|
|
|
|
|
|
|
|
static void set_clock_sources(void)
|
|
|
|
{
|
2014-03-06 07:07:41 +01:00
|
|
|
/*
|
|
|
|
* The max98090 codec and the temperature sensor are on I2C1. These
|
|
|
|
* can both run at 400 KHz, but the kernel sets the bus to 100 KHz.
|
|
|
|
*/
|
|
|
|
clock_configure_i2c_scl_freq(i2c1, PLLP, 100);
|
2014-01-18 07:11:35 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* MMC3 and MMC4: Set base clock frequency for SD Clock to Tegra MMC's
|
|
|
|
* maximum speed (48MHz) so we can change SDCLK by second stage divisor
|
|
|
|
* in payloads, without touching base clock.
|
|
|
|
*/
|
|
|
|
clock_configure_source(sdmmc3, PLLP, 48000);
|
|
|
|
clock_configure_source(sdmmc4, PLLP, 48000);
|
|
|
|
|
|
|
|
/* External peripheral 1: audio codec (max98090) using 12MHz CLK1.
|
|
|
|
* Note the source id of CLK_M for EXTPERIPH1 is 3. */
|
|
|
|
clock_configure_irregular_source(extperiph1, CLK_M, 12000, 3);
|
|
|
|
|
|
|
|
/*
|
2014-03-28 17:21:37 +01:00
|
|
|
* We need 1.5MHz. So, we use CLK_M. CLK_DIVIDER macro returns a divisor
|
|
|
|
* (0xe) a little bit off from the ideal value (0xd) but it's good
|
|
|
|
* enough for beeps. The source id of CLK_M for I2S is 6.
|
2014-01-18 07:11:35 +01:00
|
|
|
*/
|
2014-03-28 17:21:37 +01:00
|
|
|
clock_configure_irregular_source(i2s1, CLK_M, 1500, 6);
|
2014-01-18 07:11:35 +01:00
|
|
|
|
|
|
|
/* Note source id of PLLP for HOST1x is 4. */
|
|
|
|
clock_configure_irregular_source(host1x, PLLP, 408000, 4);
|
|
|
|
|
|
|
|
/* Use PLLD_OUT0 as clock source for disp1 */
|
|
|
|
clrsetbits_le32(&clk_rst->clk_src_disp1,
|
|
|
|
CLK_SOURCE_MASK | CLK_DIVISOR_MASK,
|
|
|
|
2 /*PLLD_OUT0 */ << CLK_SOURCE_SHIFT);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void setup_pinmux(void)
|
|
|
|
{
|
|
|
|
// I2C1 clock.
|
|
|
|
pinmux_set_config(PINMUX_GEN1_I2C_SCL_INDEX,
|
|
|
|
PINMUX_GEN1_I2C_SCL_FUNC_I2C1 | PINMUX_INPUT_ENABLE);
|
|
|
|
// I2C1 data.
|
|
|
|
pinmux_set_config(PINMUX_GEN1_I2C_SDA_INDEX,
|
|
|
|
PINMUX_GEN1_I2C_SDA_FUNC_I2C1 | PINMUX_INPUT_ENABLE);
|
|
|
|
// I2C2 clock.
|
|
|
|
pinmux_set_config(PINMUX_GEN2_I2C_SCL_INDEX,
|
2014-05-22 04:54:16 +02:00
|
|
|
PINMUX_GEN2_I2C_SCL_FUNC_I2C2 | PINMUX_INPUT_ENABLE |
|
|
|
|
PINMUX_OPEN_DRAIN);
|
2014-01-18 07:11:35 +01:00
|
|
|
// I2C2 data.
|
|
|
|
pinmux_set_config(PINMUX_GEN2_I2C_SDA_INDEX,
|
2014-05-22 04:54:16 +02:00
|
|
|
PINMUX_GEN2_I2C_SDA_FUNC_I2C2 | PINMUX_INPUT_ENABLE |
|
|
|
|
PINMUX_OPEN_DRAIN);
|
2014-01-18 07:11:35 +01:00
|
|
|
// I2C4 (DDC) clock.
|
|
|
|
pinmux_set_config(PINMUX_DDC_SCL_INDEX,
|
|
|
|
PINMUX_DDC_SCL_FUNC_I2C4 | PINMUX_INPUT_ENABLE);
|
|
|
|
// I2C4 (DDC) data.
|
|
|
|
pinmux_set_config(PINMUX_DDC_SDA_INDEX,
|
|
|
|
PINMUX_DDC_SDA_FUNC_I2C4 | PINMUX_INPUT_ENABLE);
|
|
|
|
|
|
|
|
// TODO(hungte) Revice pinmux setup, make nice little SoC functions for
|
|
|
|
// every single logical thing instead of dumping a wall of code below.
|
|
|
|
uint32_t pin_up = PINMUX_PULL_UP | PINMUX_INPUT_ENABLE,
|
|
|
|
pin_down = PINMUX_PULL_DOWN | PINMUX_INPUT_ENABLE,
|
|
|
|
pin_none = PINMUX_PULL_NONE | PINMUX_INPUT_ENABLE;
|
|
|
|
|
2014-04-24 15:07:05 +02:00
|
|
|
// MMC3 (sdcard reader)
|
2014-01-18 07:11:35 +01:00
|
|
|
pinmux_set_config(PINMUX_SDMMC3_CLK_INDEX,
|
|
|
|
PINMUX_SDMMC3_CLK_FUNC_SDMMC3 | pin_none);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC3_CMD_INDEX,
|
|
|
|
PINMUX_SDMMC3_CMD_FUNC_SDMMC3 | pin_up);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC3_DAT0_INDEX,
|
|
|
|
PINMUX_SDMMC3_DAT0_FUNC_SDMMC3 | pin_up);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC3_DAT1_INDEX,
|
|
|
|
PINMUX_SDMMC3_DAT1_FUNC_SDMMC3 | pin_up);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC3_DAT2_INDEX,
|
|
|
|
PINMUX_SDMMC3_DAT2_FUNC_SDMMC3 | pin_up);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC3_DAT3_INDEX,
|
|
|
|
PINMUX_SDMMC3_DAT3_FUNC_SDMMC3 | pin_up);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC3_CLK_LB_IN_INDEX,
|
2014-04-21 11:54:28 +02:00
|
|
|
PINMUX_SDMMC3_CLK_LB_IN_FUNC_SDMMC3 | pin_up);
|
2014-01-18 07:11:35 +01:00
|
|
|
pinmux_set_config(PINMUX_SDMMC3_CLK_LB_OUT_INDEX,
|
|
|
|
PINMUX_SDMMC3_CLK_LB_OUT_FUNC_SDMMC3 | pin_down);
|
|
|
|
|
|
|
|
// MMC3 Card Detect pin.
|
|
|
|
gpio_input_pullup(GPIO(V2));
|
2014-04-24 15:07:05 +02:00
|
|
|
// Disable SD card reader power so it can be reset even on warm boot.
|
|
|
|
// Payloads must enable power before accessing SD card slots.
|
|
|
|
gpio_output(GPIO(R0), 0);
|
2014-01-18 07:11:35 +01:00
|
|
|
|
2014-04-24 15:07:05 +02:00
|
|
|
// MMC4 (eMMC)
|
2014-01-18 07:11:35 +01:00
|
|
|
pinmux_set_config(PINMUX_SDMMC4_CLK_INDEX,
|
|
|
|
PINMUX_SDMMC4_CLK_FUNC_SDMMC4 | pin_none);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC4_CMD_INDEX,
|
|
|
|
PINMUX_SDMMC4_CMD_FUNC_SDMMC4 | pin_up);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC4_DAT0_INDEX,
|
|
|
|
PINMUX_SDMMC4_DAT0_FUNC_SDMMC4 | pin_up);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC4_DAT1_INDEX,
|
|
|
|
PINMUX_SDMMC4_DAT1_FUNC_SDMMC4 | pin_up);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC4_DAT2_INDEX,
|
|
|
|
PINMUX_SDMMC4_DAT2_FUNC_SDMMC4 | pin_up);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC4_DAT3_INDEX,
|
|
|
|
PINMUX_SDMMC4_DAT3_FUNC_SDMMC4 | pin_up);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC4_DAT4_INDEX,
|
|
|
|
PINMUX_SDMMC4_DAT4_FUNC_SDMMC4 | pin_up);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC4_DAT5_INDEX,
|
|
|
|
PINMUX_SDMMC4_DAT5_FUNC_SDMMC4 | pin_up);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC4_DAT6_INDEX,
|
|
|
|
PINMUX_SDMMC4_DAT6_FUNC_SDMMC4 | pin_up);
|
|
|
|
pinmux_set_config(PINMUX_SDMMC4_DAT7_INDEX,
|
|
|
|
PINMUX_SDMMC4_DAT7_FUNC_SDMMC4 | pin_up);
|
|
|
|
|
|
|
|
/* We pull the USB VBUS signals up but keep them as inputs since the
|
|
|
|
* voltage source likes to drive them low on overcurrent conditions */
|
|
|
|
gpio_input_pullup(GPIO(N4)); /* USB VBUS EN0 */
|
|
|
|
gpio_input_pullup(GPIO(N5)); /* USB VBUS EN1 */
|
|
|
|
|
|
|
|
/* Clock output 1 (for external peripheral) */
|
|
|
|
pinmux_set_config(PINMUX_DAP_MCLK1_INDEX,
|
|
|
|
PINMUX_DAP_MCLK1_FUNC_EXTPERIPH1 | PINMUX_PULL_NONE);
|
|
|
|
|
|
|
|
/* I2S1 */
|
|
|
|
pinmux_set_config(PINMUX_DAP2_DIN_INDEX,
|
2014-04-21 11:54:28 +02:00
|
|
|
PINMUX_DAP2_DIN_FUNC_I2S1 | PINMUX_INPUT_ENABLE);
|
2014-01-18 07:11:35 +01:00
|
|
|
pinmux_set_config(PINMUX_DAP2_DOUT_INDEX,
|
|
|
|
PINMUX_DAP2_DOUT_FUNC_I2S1 | PINMUX_INPUT_ENABLE);
|
|
|
|
pinmux_set_config(PINMUX_DAP2_FS_INDEX,
|
|
|
|
PINMUX_DAP2_FS_FUNC_I2S1 | PINMUX_INPUT_ENABLE);
|
|
|
|
pinmux_set_config(PINMUX_DAP2_SCLK_INDEX,
|
|
|
|
PINMUX_DAP2_SCLK_FUNC_I2S1 | PINMUX_INPUT_ENABLE);
|
2014-02-15 07:25:01 +01:00
|
|
|
|
|
|
|
/* PWM1 */
|
|
|
|
pinmux_set_config(PINMUX_GPIO_PH1_INDEX,
|
|
|
|
PINMUX_GPIO_PH1_FUNC_PWM1 | PINMUX_PULL_NONE);
|
2014-04-21 11:54:28 +02:00
|
|
|
|
|
|
|
/* DP HPD */
|
|
|
|
pinmux_set_config(PINMUX_DP_HPD_INDEX,
|
|
|
|
PINMUX_DP_HPD_FUNC_DP | PINMUX_INPUT_ENABLE);
|
2014-01-18 07:11:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void setup_kernel_info(void)
|
|
|
|
{
|
|
|
|
// Setup required information for Linux kernel.
|
|
|
|
|
|
|
|
// pmc.odmdata: [18:19]: console type, [15:17]: UART id.
|
|
|
|
// TODO(hungte) This should be done by filling BCT values, or derived
|
|
|
|
// from CONFIG_CONSOLE_SERIAL_UART[A-E]. Right now we simply copy the
|
|
|
|
// value defined in BCT.
|
|
|
|
struct tegra_pmc_regs *pmc = (void*)TEGRA_PMC_BASE;
|
arm(64): Globally replace writel(v, a) with write32(a, v)
This patch is a raw application of the following spatch to src/:
@@
expression A, V;
@@
- writel(V, A)
+ write32(A, V)
@@
expression A, V;
@@
- writew(V, A)
+ write16(A, V)
@@
expression A, V;
@@
- writeb(V, A)
+ write8(A, V)
@@
expression A;
@@
- readl(A)
+ read32(A)
@@
expression A;
@@
- readb(A)
+ read8(A)
BRANCH=none
BUG=chromium:444723
TEST=None (depends on next patch)
Change-Id: I5dd96490c85ee2bcbc669f08bc6fff0ecc0f9e27
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 64f643da95d85954c4d4ea91c34a5c69b9b08eb6
Original-Change-Id: I366a2eb5b3a0df2279ebcce572fe814894791c42
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/254864
Reviewed-on: http://review.coreboot.org/9836
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-02-19 23:51:15 +01:00
|
|
|
write32(&pmc->odmdata, 0x80080000);
|
2014-01-18 07:11:35 +01:00
|
|
|
|
|
|
|
// Not strictly info, but kernel graphics driver needs this region locked down
|
|
|
|
struct tegra_mc_regs *mc = (void *)TEGRA_MC_BASE;
|
arm(64): Globally replace writel(v, a) with write32(a, v)
This patch is a raw application of the following spatch to src/:
@@
expression A, V;
@@
- writel(V, A)
+ write32(A, V)
@@
expression A, V;
@@
- writew(V, A)
+ write16(A, V)
@@
expression A, V;
@@
- writeb(V, A)
+ write8(A, V)
@@
expression A;
@@
- readl(A)
+ read32(A)
@@
expression A;
@@
- readb(A)
+ read8(A)
BRANCH=none
BUG=chromium:444723
TEST=None (depends on next patch)
Change-Id: I5dd96490c85ee2bcbc669f08bc6fff0ecc0f9e27
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 64f643da95d85954c4d4ea91c34a5c69b9b08eb6
Original-Change-Id: I366a2eb5b3a0df2279ebcce572fe814894791c42
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/254864
Reviewed-on: http://review.coreboot.org/9836
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-02-19 23:51:15 +01:00
|
|
|
write32(&mc->video_protect_bom, 0);
|
|
|
|
write32(&mc->video_protect_size_mb, 0);
|
|
|
|
write32(&mc->video_protect_reg_ctrl, 1);
|
2014-01-18 07:11:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void setup_ec_spi(void)
|
|
|
|
{
|
2014-03-22 05:32:12 +01:00
|
|
|
tegra_spi_init(CONFIG_EC_GOOGLE_CHROMEEC_SPI_BUS);
|
2014-01-18 07:11:35 +01:00
|
|
|
}
|
|
|
|
|
2018-05-04 20:23:33 +02:00
|
|
|
static void mainboard_init(struct device *dev)
|
2014-01-18 07:11:35 +01:00
|
|
|
{
|
|
|
|
set_clock_sources();
|
|
|
|
|
|
|
|
clock_external_output(1); /* For external MAX98090 audio codec. */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Confirmed by NVIDIA hardware team, we need to take ALL audio devices
|
|
|
|
* conntected to AHUB (AUDIO, APBIF, I2S, DAM, AMX, ADX, SPDIF, AFC) out
|
|
|
|
* of reset and clock-enabled, otherwise reading AHUB devices (In our
|
|
|
|
* case, I2S/APBIF/AUDIO<XBAR>) will hang.
|
|
|
|
*/
|
|
|
|
clock_enable_clear_reset(CLK_L_GPIO | CLK_L_I2C1 | CLK_L_SDMMC4 |
|
|
|
|
CLK_L_I2S0 | CLK_L_I2S1 | CLK_L_I2S2 |
|
|
|
|
CLK_L_SPDIF | CLK_L_USBD | CLK_L_DISP1 |
|
2014-02-15 07:25:01 +01:00
|
|
|
CLK_L_HOST1X | CLK_L_PWM,
|
2014-01-18 07:11:35 +01:00
|
|
|
|
2014-03-25 05:24:24 +01:00
|
|
|
CLK_H_EMC | CLK_H_I2C2 | CLK_H_PMC |
|
|
|
|
CLK_H_MEM | CLK_H_USB3,
|
2014-01-18 07:11:35 +01:00
|
|
|
|
2014-03-25 05:24:24 +01:00
|
|
|
CLK_U_CSITE | CLK_U_SDMMC3,
|
2014-01-18 07:11:35 +01:00
|
|
|
|
|
|
|
CLK_V_I2C4 | CLK_V_EXTPERIPH1 | CLK_V_APBIF |
|
|
|
|
CLK_V_AUDIO | CLK_V_I2S3 | CLK_V_I2S4 |
|
|
|
|
CLK_V_DAM0 | CLK_V_DAM1 | CLK_V_DAM2,
|
|
|
|
|
|
|
|
CLK_W_DVFS | CLK_W_AMX0 | CLK_W_ADX0,
|
|
|
|
|
|
|
|
CLK_X_DPAUX | CLK_X_SOR0 | CLK_X_AMX1 |
|
|
|
|
CLK_X_ADX1 | CLK_X_AFC0 | CLK_X_AFC1 |
|
|
|
|
CLK_X_AFC2 | CLK_X_AFC3 | CLK_X_AFC4 |
|
|
|
|
CLK_X_AFC5);
|
|
|
|
|
2014-08-06 18:53:55 +02:00
|
|
|
usb_setup_utmip((void*)TEGRA_USBD_BASE);
|
2014-01-18 07:11:35 +01:00
|
|
|
/* USB2 is the camera, we don't need it in firmware */
|
2014-08-06 18:53:55 +02:00
|
|
|
usb_setup_utmip((void*)TEGRA_USB3_BASE);
|
2014-01-18 07:11:35 +01:00
|
|
|
|
|
|
|
setup_pinmux();
|
|
|
|
|
|
|
|
i2c_init(0);
|
|
|
|
i2c_init(1);
|
|
|
|
i2c_init(3);
|
|
|
|
|
|
|
|
setup_kernel_info();
|
|
|
|
clock_init_arm_generic_timer();
|
|
|
|
setup_ec_spi();
|
|
|
|
}
|
|
|
|
|
2018-05-04 20:23:33 +02:00
|
|
|
static void mainboard_enable(struct device *dev)
|
2014-01-18 07:11:35 +01:00
|
|
|
{
|
|
|
|
dev->ops->init = &mainboard_init;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct chip_operations mainboard_ops = {
|
|
|
|
.name = "nyan_big",
|
|
|
|
.enable_dev = mainboard_enable,
|
|
|
|
};
|
|
|
|
|
|
|
|
void lb_board(struct lb_header *header)
|
|
|
|
{
|
|
|
|
struct lb_range *dma;
|
|
|
|
|
|
|
|
dma = (struct lb_range *)lb_new_record(header);
|
|
|
|
dma->tag = LB_TAB_DMA;
|
|
|
|
dma->size = sizeof(*dma);
|
New mechanism to define SRAM/memory map with automatic bounds checking
This patch creates a new mechanism to define the static memory layout
(primarily in SRAM) for a given board, superseding the brittle mass of
Kconfigs that we were using before. The core part is a memlayout.ld file
in the mainboard directory (although boards are expected to just include
the SoC default in most cases), which is the primary linker script for
all stages (though not rmodules for now). It uses preprocessor macros
from <memlayout.h> to form a different valid linker script for all
stages while looking like a declarative, boilerplate-free map of memory
addresses to the programmer. Linker asserts will automatically guarantee
that the defined regions cannot overlap. Stages are defined with a
maximum size that will be enforced by the linker. The file serves to
both define and document the memory layout, so that the documentation
cannot go missing or out of date.
The mechanism is implemented for all boards in the ARM, ARM64 and MIPS
architectures, and should be extended onto all systems using SRAM in the
future. The CAR/XIP environment on x86 has very different requirements
and the layout is generally not as static, so it will stay like it is
and be unaffected by this patch (save for aligning some symbol names for
consistency and sharing the new common ramstage linker script include).
BUG=None
TEST=Booted normally and in recovery mode, checked suspend/resume and
the CBMEM console on Falco, Blaze (both normal and vboot2), Pinky and
Pit. Compiled Ryu, Storm and Urara, manually compared the disassemblies
with ToT and looked for red flags.
Change-Id: Ifd2276417f2036cbe9c056f17e42f051bcd20e81
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: f1e2028e7ebceeb2d71ff366150a37564595e614
Original-Change-Id: I005506add4e8fcdb74db6d5e6cb2d4cb1bd3cda5
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/213370
Reviewed-on: http://review.coreboot.org/9283
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-by: Aaron Durbin <adurbin@google.com>
2014-08-21 00:29:56 +02:00
|
|
|
dma->range_start = (uintptr_t)_dma_coherent;
|
|
|
|
dma->range_size = _dma_coherent_size;
|
2014-01-18 07:11:35 +01:00
|
|
|
}
|