blob: c16beb8310deb155af5c083f937b2706510fe902 [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.
huang lin82ba4d02014-08-16 10:49:32 +080014 */
15
Julius Werner7a453eb2014-10-20 13:14:55 -070016#include <arch/cache.h>
Aaron Durbinbc98cc62015-09-02 09:21:36 -050017#include <bootmode.h>
Julius Werner7a453eb2014-10-20 13:14:55 -070018#include <cbmem.h>
19#include <console/console.h>
20#include <delay.h>
21#include <device/device.h>
Julius Wernereaa9c452014-09-24 15:40:49 -070022#include <gpio.h>
huang lin40f558e2014-09-19 14:51:52 +080023#include <soc/display.h>
Julius Werner7a453eb2014-10-20 13:14:55 -070024#include <soc/soc.h>
huang linee28c862015-01-26 21:04:55 +080025#include <soc/sdram.h>
Julius Werner7a453eb2014-10-20 13:14:55 -070026#include <stddef.h>
huang lin82ba4d02014-08-16 10:49:32 +080027#include <stdlib.h>
28#include <string.h>
Julius Werner249f9cc2015-01-14 14:53:59 -080029#include <symbols.h>
Julius Werner7a453eb2014-10-20 13:14:55 -070030
huang lin82ba4d02014-08-16 10:49:32 +080031#include "chip.h"
32
huang lin40f558e2014-09-19 14:51:52 +080033static void soc_init(device_t dev)
huang lin82ba4d02014-08-16 10:49:32 +080034{
huang linee28c862015-01-26 21:04:55 +080035 ram_resource(dev, 0, (uintptr_t)_dram/KiB, sdram_size_mb()*(MiB/KiB));
Aaron Durbinbc98cc62015-09-02 09:21:36 -050036 if (display_init_required())
Julius Werner249f9cc2015-01-14 14:53:59 -080037 rk_display_init(dev, (uintptr_t)_framebuffer,
38 _framebuffer_size);
Aaron Durbinbc98cc62015-09-02 09:21:36 -050039 else
40 printk(BIOS_INFO, "Skipping display init.\n");
huang lin82ba4d02014-08-16 10:49:32 +080041}
42
huang lin82ba4d02014-08-16 10:49:32 +080043static struct device_operations soc_ops = {
Edward O'Callaghanc1a9dfe2015-03-26 20:10:09 +110044 .read_resources = DEVICE_NOOP,
45 .set_resources = DEVICE_NOOP,
huang lin40f558e2014-09-19 14:51:52 +080046 .init = soc_init,
huang lin82ba4d02014-08-16 10:49:32 +080047 .scan_bus = 0,
48};
49
50static void enable_rk3288_dev(device_t dev)
51{
52 dev->ops = &soc_ops;
53}
54
55struct chip_operations soc_rockchip_rk3288_ops = {
56 CHIP_NAME("SOC Rockchip 3288")
57 .enable_dev = enable_rk3288_dev,
58};