blob: f7f1ec9a88750c19ad1802a530c22df175973d49 [file] [log] [blame]
Angel Ponsbbc99cf2020-04-04 18:51:23 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
huang lin82ba4d02014-08-16 10:49:32 +08003
Aaron Durbinbc98cc62015-09-02 09:21:36 -05004#include <bootmode.h>
Julius Werner7a453eb2014-10-20 13:14:55 -07005#include <console/console.h>
Julius Werner7a453eb2014-10-20 13:14:55 -07006#include <device/device.h>
Julius Wernereaa9c452014-09-24 15:40:49 -07007#include <gpio.h>
huang lin40f558e2014-09-19 14:51:52 +08008#include <soc/display.h>
Julius Werner7a453eb2014-10-20 13:14:55 -07009#include <soc/soc.h>
huang linee28c862015-01-26 21:04:55 +080010#include <soc/sdram.h>
Julius Werner7a453eb2014-10-20 13:14:55 -070011#include <stddef.h>
Julius Werner249f9cc2015-01-14 14:53:59 -080012#include <symbols.h>
Julius Werner7a453eb2014-10-20 13:14:55 -070013
huang lin82ba4d02014-08-16 10:49:32 +080014#include "chip.h"
15
Elyes HAOUASf3ca88b2018-05-25 09:52:45 +020016static void soc_init(struct device *dev)
huang lin82ba4d02014-08-16 10:49:32 +080017{
huang linee28c862015-01-26 21:04:55 +080018 ram_resource(dev, 0, (uintptr_t)_dram/KiB, sdram_size_mb()*(MiB/KiB));
Aaron Durbinbc98cc62015-09-02 09:21:36 -050019 if (display_init_required())
Julius Werner249f9cc2015-01-14 14:53:59 -080020 rk_display_init(dev, (uintptr_t)_framebuffer,
Julius Werner7e0dea62019-02-20 18:39:22 -080021 REGION_SIZE(framebuffer));
Aaron Durbinbc98cc62015-09-02 09:21:36 -050022 else
23 printk(BIOS_INFO, "Skipping display init.\n");
huang lin82ba4d02014-08-16 10:49:32 +080024}
25
huang lin82ba4d02014-08-16 10:49:32 +080026static struct device_operations soc_ops = {
Edward O'Callaghanc1a9dfe2015-03-26 20:10:09 +110027 .read_resources = DEVICE_NOOP,
28 .set_resources = DEVICE_NOOP,
huang lin40f558e2014-09-19 14:51:52 +080029 .init = soc_init,
huang lin82ba4d02014-08-16 10:49:32 +080030};
31
Elyes HAOUASf3ca88b2018-05-25 09:52:45 +020032static void enable_rk3288_dev(struct device *dev)
huang lin82ba4d02014-08-16 10:49:32 +080033{
34 dev->ops = &soc_ops;
35}
36
37struct chip_operations soc_rockchip_rk3288_ops = {
38 CHIP_NAME("SOC Rockchip 3288")
39 .enable_dev = enable_rk3288_dev,
40};