blob: abd93d70f0cf18dfb9e82bdcdfa03295c86e9004 [file] [log] [blame]
huang lin82ba4d02014-08-16 10:49:32 +08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2014 Rockchip Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
Julius Werner7a453eb2014-10-20 13:14:55 -070020#include <arch/cache.h>
21#include <cbmem.h>
22#include <console/console.h>
23#include <delay.h>
24#include <device/device.h>
Julius Wernereaa9c452014-09-24 15:40:49 -070025#include <gpio.h>
huang lin40f558e2014-09-19 14:51:52 +080026#include <soc/display.h>
Julius Werner7a453eb2014-10-20 13:14:55 -070027#include <soc/soc.h>
28#include <stddef.h>
huang lin82ba4d02014-08-16 10:49:32 +080029#include <stdlib.h>
30#include <string.h>
huang lin40f558e2014-09-19 14:51:52 +080031#include <vendorcode/google/chromeos/chromeos.h>
Julius Werner7a453eb2014-10-20 13:14:55 -070032
huang lin82ba4d02014-08-16 10:49:32 +080033#include "chip.h"
34
huang lin40f558e2014-09-19 14:51:52 +080035static void soc_init(device_t dev)
huang lin82ba4d02014-08-16 10:49:32 +080036{
huang lin40f558e2014-09-19 14:51:52 +080037 unsigned long fb_size = FB_SIZE_KB * KiB;
38 u32 lcdbase = get_fb_base_kb() * KiB;
39
huang lin82ba4d02014-08-16 10:49:32 +080040 ram_resource(dev, 0, RAM_BASE_KB, RAM_SIZE_KB);
huang lin40f558e2014-09-19 14:51:52 +080041 mmio_resource(dev, 1, lcdbase / KiB, fb_size / KiB);
42
43 if (vboot_skip_display_init())
44 printk(BIOS_INFO, "Skipping display init.\n");
David Hendricks1c780092014-12-15 21:20:35 -080045#if !IS_ENABLED(CONFIG_SKIP_DISPLAY_INIT_HACK)
huang lin40f558e2014-09-19 14:51:52 +080046 else
47 rk_display_init(dev, lcdbase, fb_size);
David Hendricks1c780092014-12-15 21:20:35 -080048#endif
huang lin82ba4d02014-08-16 10:49:32 +080049}
50
huang lin82ba4d02014-08-16 10:49:32 +080051static struct device_operations soc_ops = {
Edward O'Callaghanc1a9dfe2015-03-26 20:10:09 +110052 .read_resources = DEVICE_NOOP,
53 .set_resources = DEVICE_NOOP,
huang lin40f558e2014-09-19 14:51:52 +080054 .enable_resources = DEVICE_NOOP,
55 .init = soc_init,
huang lin82ba4d02014-08-16 10:49:32 +080056 .scan_bus = 0,
57};
58
59static void enable_rk3288_dev(device_t dev)
60{
61 dev->ops = &soc_ops;
62}
63
64struct chip_operations soc_rockchip_rk3288_ops = {
65 CHIP_NAME("SOC Rockchip 3288")
66 .enable_dev = enable_rk3288_dev,
67};