Angel Pons | bbc99cf | 2020-04-04 18:51:23 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
huang lin | 82ba4d0 | 2014-08-16 10:49:32 +0800 | [diff] [blame] | 2 | |
Aaron Durbin | bc98cc6 | 2015-09-02 09:21:36 -0500 | [diff] [blame] | 3 | #include <bootmode.h> |
Julius Werner | 7a453eb | 2014-10-20 13:14:55 -0700 | [diff] [blame] | 4 | #include <console/console.h> |
Julius Werner | 7a453eb | 2014-10-20 13:14:55 -0700 | [diff] [blame] | 5 | #include <device/device.h> |
Julius Werner | eaa9c45 | 2014-09-24 15:40:49 -0700 | [diff] [blame] | 6 | #include <gpio.h> |
huang lin | 40f558e | 2014-09-19 14:51:52 +0800 | [diff] [blame] | 7 | #include <soc/display.h> |
Julius Werner | 7a453eb | 2014-10-20 13:14:55 -0700 | [diff] [blame] | 8 | #include <soc/soc.h> |
huang lin | ee28c86 | 2015-01-26 21:04:55 +0800 | [diff] [blame] | 9 | #include <soc/sdram.h> |
Julius Werner | 249f9cc | 2015-01-14 14:53:59 -0800 | [diff] [blame] | 10 | #include <symbols.h> |
Julius Werner | 7a453eb | 2014-10-20 13:14:55 -0700 | [diff] [blame] | 11 | |
huang lin | 82ba4d0 | 2014-08-16 10:49:32 +0800 | [diff] [blame] | 12 | #include "chip.h" |
| 13 | |
Elyes HAOUAS | f3ca88b | 2018-05-25 09:52:45 +0200 | [diff] [blame] | 14 | static void soc_init(struct device *dev) |
huang lin | 82ba4d0 | 2014-08-16 10:49:32 +0800 | [diff] [blame] | 15 | { |
Kyösti Mälkki | 84a9360a | 2021-06-26 14:10:39 +0300 | [diff] [blame^] | 16 | ram_range(dev, 0, (uintptr_t)_dram, sdram_size_mb() * MiB); |
Aaron Durbin | bc98cc6 | 2015-09-02 09:21:36 -0500 | [diff] [blame] | 17 | if (display_init_required()) |
Julius Werner | 249f9cc | 2015-01-14 14:53:59 -0800 | [diff] [blame] | 18 | rk_display_init(dev, (uintptr_t)_framebuffer, |
Julius Werner | 7e0dea6 | 2019-02-20 18:39:22 -0800 | [diff] [blame] | 19 | REGION_SIZE(framebuffer)); |
Aaron Durbin | bc98cc6 | 2015-09-02 09:21:36 -0500 | [diff] [blame] | 20 | else |
| 21 | printk(BIOS_INFO, "Skipping display init.\n"); |
huang lin | 82ba4d0 | 2014-08-16 10:49:32 +0800 | [diff] [blame] | 22 | } |
| 23 | |
huang lin | 82ba4d0 | 2014-08-16 10:49:32 +0800 | [diff] [blame] | 24 | static struct device_operations soc_ops = { |
Nico Huber | 2f8ba69 | 2020-04-05 14:05:24 +0200 | [diff] [blame] | 25 | .read_resources = noop_read_resources, |
| 26 | .set_resources = noop_set_resources, |
huang lin | 40f558e | 2014-09-19 14:51:52 +0800 | [diff] [blame] | 27 | .init = soc_init, |
huang lin | 82ba4d0 | 2014-08-16 10:49:32 +0800 | [diff] [blame] | 28 | }; |
| 29 | |
Elyes HAOUAS | f3ca88b | 2018-05-25 09:52:45 +0200 | [diff] [blame] | 30 | static void enable_rk3288_dev(struct device *dev) |
huang lin | 82ba4d0 | 2014-08-16 10:49:32 +0800 | [diff] [blame] | 31 | { |
| 32 | dev->ops = &soc_ops; |
| 33 | } |
| 34 | |
| 35 | struct chip_operations soc_rockchip_rk3288_ops = { |
| 36 | CHIP_NAME("SOC Rockchip 3288") |
| 37 | .enable_dev = enable_rk3288_dev, |
| 38 | }; |