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 <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174486
This commit is contained in:
Hung-Te Lin 2013-10-24 22:35:32 +08:00 committed by chrome-internal-fetch
commit 36e9370f30
2 changed files with 19 additions and 1 deletions

View file

@ -17,9 +17,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <arch/io.h>
#include <device/device.h>
#include <boot/coreboot_tables.h>
#include <soc/addressmap.h>
#include <soc/nvidia/tegra124/gpio.h>
#include <soc/nvidia/tegra124/pmc.h>
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)

View file

@ -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;