From 36e9370f30bd173879958d164156997841ec4e9c Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Thu, 24 Oct 2013 22:35:32 +0800 Subject: [PATCH] tegra124: Assign console address for kernel. Linux tegra124 kernel uses pmc.odmdata to figure out serial console type & address, which was defined by BCT in U-Boot world. For Coreboot, we should build that value by Kconfig values. But since we don't have a complete support for BCT & ODMDATA values yet, let's follow the values defined in bct/odmdata.cfg. BUG=none TEST=emerge-nyan chromeos-coreboot-nyan; boot # see linux kernel messages. BRANCH=none Change-Id: I95e8473df840cb9f55259670add9e99cebde4dee Signed-off-by: Hung-Te Lin Reviewed-on: https://chromium-review.googlesource.com/174486 --- src/mainboard/google/nyan/mainboard.c | 16 ++++++++++++++++ src/soc/nvidia/tegra124/pmc.h | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/mainboard/google/nyan/mainboard.c b/src/mainboard/google/nyan/mainboard.c index 368440dc63..ccc6f12e97 100644 --- a/src/mainboard/google/nyan/mainboard.c +++ b/src/mainboard/google/nyan/mainboard.c @@ -17,9 +17,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include +#include #include +#include static void setup_pinmux(void) { @@ -107,9 +110,22 @@ static void setup_pinmux(void) PINMUX_SDMMC4_DAT7_FUNC_SDMMC4 | pin_up); } +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; + writel(0x80080000, &pmc->odmdata); +} + static void mainboard_init(device_t dev) { setup_pinmux(); + setup_kernel_info(); } static void mainboard_enable(device_t dev) diff --git a/src/soc/nvidia/tegra124/pmc.h b/src/soc/nvidia/tegra124/pmc.h index 1134abd5df..c2e4f4d890 100644 --- a/src/soc/nvidia/tegra124/pmc.h +++ b/src/soc/nvidia/tegra124/pmc.h @@ -62,7 +62,9 @@ struct tegra_pmc_regs { u32 no_iopower; u32 pwr_det; u32 pwr_det_latch; - u32 scratch[24]; + u32 scratch[20]; + u32 odmdata; + u32 scratch21[24 - 21]; u32 secure_scratch[6]; u32 cpupwrgood_timer; u32 cpupwroff_timer;