t132: Add vboot2 support

BUG=chrome-os-partner:32684
BRANCH=None
TEST=Compiles successfully and boots to kernel prompt using vboot2

Change-Id: Ibf7666d273e4d1af719c60d3f02bddcb4461f4bd
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221576
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
Furquan Shaikh 2014-10-04 17:00:56 -07:00 committed by chrome-internal-fetch
commit 8335915940
10 changed files with 151 additions and 16 deletions

View file

@ -1 +1 @@
#include <soc/nvidia/tegra132/memlayout.ld>
#include <soc/nvidia/tegra132/memlayout_vboot.ld>

View file

@ -1 +1 @@
#include <soc/nvidia/tegra132/memlayout.ld>
#include <soc/nvidia/tegra132/memlayout_vboot.ld>

View file

@ -2,6 +2,7 @@ config SOC_NVIDIA_TEGRA132
bool
default n
select ARCH_BOOTBLOCK_ARM_V4
select ARCH_VERSTAGE_ARM_V4
select ARCH_ROMSTAGE_ARM_V4
select ARCH_RAMSTAGE_ARM_V8_64
select BOOTBLOCK_CONSOLE

View file

@ -23,6 +23,20 @@ ifeq ($(CONFIG_BOOTBLOCK_CONSOLE),y)
bootblock-$(CONFIG_CONSOLE_SERIAL_UART) += uart.c
endif
verstage-y += verstage.c
verstage-y += cbfs.c
verstage-y += dma.c
verstage-y += monotonic_timer.c
verstage-y += spi.c
verstage-y += padconfig.c
verstage-y += funitcfg.c
verstage-$(CONFIG_CONSOLE_SERIAL_UART) += uart.c
verstage-y += ../tegra/gpio.c
verstage-y += ../tegra/i2c.c
verstage-y += ../tegra/pinmux.c
verstage-y += clock.c
verstage-y += i2c.c
romstage-y += 32bit_reset.S
romstage-y += romstage_asm.S
romstage-y += addressmap.c

View file

@ -26,6 +26,7 @@
#include <soc/clock.h>
#include <soc/nvidia/tegra/apbmisc.h>
#include <arch/stages.h>
#include <vendorcode/google/chromeos/chromeos.h>
#include "power.h"
@ -36,7 +37,7 @@ void __attribute__((weak)) bootblock_mainboard_early_init(void)
void main(void)
{
void *entry;
void *entry = NULL;
// enable pinmux clamp inputs
clamp_tristate_inputs();
@ -72,15 +73,20 @@ void main(void)
printk(BIOS_INFO, "T132 bootblock: Mainboard bootblock init done\n");
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA,
CONFIG_CBFS_PREFIX "/romstage");
if (entry) {
printk(BIOS_INFO, "T132 bootblock: jumping to romstage\n");
stage_exit(entry);
if (IS_ENABLED(CONFIG_VBOOT2_VERIFY_FIRMWARE)) {
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA,
CONFIG_CBFS_PREFIX "/verstage");
printk(BIOS_DEBUG, "T132 bootblock: jumping to verstage\n");
} else {
printk(BIOS_INFO, "T132 bootblock: fallback/romstage not found\n");
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA,
CONFIG_CBFS_PREFIX "/romstage");
printk(BIOS_INFO, "T132 bootblock: jumping to romstage\n");
}
if (entry != CBFS_LOAD_ERROR)
stage_exit(entry);
else
printk(BIOS_INFO, "T132 bootblock: stage not found\n");
hlt();
}

View file

@ -0,0 +1,25 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __SOC_NVIDIA_TEGRA132_SOC_VERSTAGE_H__
#define __SOC_NVIDIA_TEGRA132_SOC_VERSTAGE_H__
void verstage_mainboard_init(void);
#endif /* __SOC_NVIDIA_TEGRA132_SOC_VERSTAGE_H__ */

View file

@ -31,12 +31,11 @@
SECTIONS
{
SRAM_START(0x40000000)
/* 16K hole */
PRERAM_CBMEM_CONSOLE(0x40004000, 8K)
CBFS_CACHE(0x40006000, 88K)
STACK(0x4001C000, 16K)
BOOTBLOCK(0x40020000, 20K)
ROMSTAGE(0x40025000, 108K)
PRERAM_CBMEM_CONSOLE(0x40000000, 8K)
CBFS_CACHE(0x40002000, 88K)
STACK(0x40018000, 16K)
BOOTBLOCK(0x4001C000, 20K)
ROMSTAGE(0x40021000, 124K)
SRAM_END(0x40040000)
DRAM_START(0x80000000)

View file

@ -0,0 +1,46 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <memlayout.h>
#include <vendorcode/google/chromeos/memlayout.h>
#include <arch/header.ld>
/*
* Note: The BootROM uses the address range [0x4000_0000:0x4000_E000) itself,
* so the bootblock loading address must be placed after that. After the
* handoff that area may be reclaimed for other uses, e.g. CBFS cache.
* TODO: Did this change on Tegra132? What's the new valid range?
*/
SECTIONS
{
SRAM_START(0x40000000)
PRERAM_CBMEM_CONSOLE(0x40000000, 8K)
CBFS_CACHE(0x40002000, 72K)
VBOOT2_WORK(0x40014000, 16K)
STACK(0x40018000, 8K)
BOOTBLOCK(0x4001A000, 20K)
VERSTAGE(0x4001F000, 60K)
ROMSTAGE(0x4002E000, 72K)
SRAM_END(0x40040000)
DRAM_START(0x80000000)
RAMSTAGE(0x80200000, 192K)
}

View file

@ -44,12 +44,17 @@ static void *load_ramstage(void)
struct stopwatch sw;
stopwatch_init(&sw);
#if IS_ENABLED(CONFIG_VBOOT2_VERIFY_FIRMWARE)
entry = vboot_load_ramstage();
#else
/*
* This platform does not need to cache a loaded ramstage nor do we
* go down this path on resume. Therefore, no romstage_handoff is
* required.
*/
entry = vboot_verify_firmware_get_entry(NULL);
#endif
if (entry == NULL)
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA,

View file

@ -0,0 +1,39 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <arch/cache.h>
#include <arch/exception.h>
#include <console/console.h>
#include <soc/verstage.h>
#include <vendorcode/google/chromeos/chromeos.h>
void __attribute__((weak)) verstage_mainboard_init(void)
{
/* Default empty implementation. */
}
void main(void)
{
console_init();
exception_init();
verstage_mainboard_init();
vboot2_verify_firmware();
}