2014-06-23 05:40:39 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
|
|
|
* Copyright 2014 Rockchip 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 <console/console.h>
|
|
|
|
#include <arch/cache.h>
|
2014-08-26 11:31:28 +02:00
|
|
|
#include <arch/io.h>
|
2014-06-23 05:40:39 +02:00
|
|
|
#include <bootblock_common.h>
|
|
|
|
#include "timer.h"
|
rk3288: add clock module
Call rkclk_init() in bootblock stage.
apll = 816MHz, gpll = 594MHz, cpll = 384MHz, dpll = 300MHz
arm clk = 816MHz, DDR clk = 300MHz, mpclk = 204MHz, m0clk = 408MHz
l2ramclk = 408MHz, atclk = 204MHz, pclk_dbg = 204MHz
aclk = 148.5MHz, hclk = 148.5MHz, pclk = 74.25MHz
BUG=chrome-os-partner:29778
TEST=Build coreboot
Change-Id: Id5967712e25df5be3a90f5d9ebe8671034deff68
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: d35d9fe7b5925291e9303e5eb21d20dbbdee99d9
Original-Change-Id: I97d953258039f6caa499cef4462be8f1a05ce2ab
Original-Signed-off-by: jinkun.hong <jinkun.hong@rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/209428
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-by: David Hendricks <dhendrix@chromium.org>
Original-Commit-Queue: David Hendricks <dhendrix@chromium.org>
Original-Tested-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: http://review.coreboot.org/8858
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2014-07-31 08:50:49 +02:00
|
|
|
#include "clock.h"
|
2014-08-26 11:31:28 +02:00
|
|
|
#include "grf.h"
|
|
|
|
#include "spi.h"
|
2014-09-24 18:39:16 +02:00
|
|
|
#include <vendorcode/google/chromeos/chromeos.h>
|
2014-09-27 06:02:27 +02:00
|
|
|
#include <soc/rockchip/rk3288/i2c.h>
|
2014-06-23 05:40:39 +02:00
|
|
|
|
|
|
|
static void bootblock_cpu_init(void)
|
|
|
|
{
|
2014-08-26 11:31:28 +02:00
|
|
|
writel(IOMUX_UART2, &rk3288_grf->iomux_uart2);
|
|
|
|
writel(IOMUX_SPI2_CSCLK, &rk3288_grf->iomux_spi2csclk);
|
|
|
|
writel(IOMUX_SPI2_TXRX, &rk3288_grf->iomux_spi2txrx);
|
2014-09-24 18:39:16 +02:00
|
|
|
/*i2c1 for tpm*/
|
|
|
|
writel(IOMUX_I2C1, &rk3288_grf->iomux_i2c1);
|
2014-09-27 06:02:27 +02:00
|
|
|
|
2014-09-24 18:39:16 +02:00
|
|
|
/* spi0 for chrome ec */
|
|
|
|
writel(IOMUX_SPI0, &rk3288_grf->iomux_spi0);
|
2014-06-23 05:40:39 +02:00
|
|
|
rk3288_init_timer();
|
2014-08-26 11:31:28 +02:00
|
|
|
console_init();
|
rk3288: add clock module
Call rkclk_init() in bootblock stage.
apll = 816MHz, gpll = 594MHz, cpll = 384MHz, dpll = 300MHz
arm clk = 816MHz, DDR clk = 300MHz, mpclk = 204MHz, m0clk = 408MHz
l2ramclk = 408MHz, atclk = 204MHz, pclk_dbg = 204MHz
aclk = 148.5MHz, hclk = 148.5MHz, pclk = 74.25MHz
BUG=chrome-os-partner:29778
TEST=Build coreboot
Change-Id: Id5967712e25df5be3a90f5d9ebe8671034deff68
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: d35d9fe7b5925291e9303e5eb21d20dbbdee99d9
Original-Change-Id: I97d953258039f6caa499cef4462be8f1a05ce2ab
Original-Signed-off-by: jinkun.hong <jinkun.hong@rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/209428
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-by: David Hendricks <dhendrix@chromium.org>
Original-Commit-Queue: David Hendricks <dhendrix@chromium.org>
Original-Tested-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: http://review.coreboot.org/8858
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2014-07-31 08:50:49 +02:00
|
|
|
rkclk_init();
|
2014-09-27 06:02:27 +02:00
|
|
|
|
|
|
|
/*i2c1 for tpm 400khz*/
|
|
|
|
i2c_init(1, 400000);
|
2014-08-26 11:31:28 +02:00
|
|
|
rockchip_spi_init(CONFIG_BOOT_MEDIA_SPI_BUS);
|
2014-09-24 18:39:16 +02:00
|
|
|
rockchip_spi_init(CONFIG_EC_GOOGLE_CHROMEEC_SPI_BUS);
|
|
|
|
setup_chromeos_gpios();
|
2014-06-23 05:40:39 +02:00
|
|
|
}
|