| 1 |
|
| 2 |
|
| 3 |
#include <bootmem.h> |
| 4 |
#include <bootmode.h> |
| 5 |
#include <console/console.h> |
| 6 |
#include <device/device.h> |
| 7 |
#include <soc/addressmap.h> |
| 8 |
#include <soc/clock.h> |
| 9 |
#include <soc/display.h> |
| 10 |
#include <soc/sdram.h> |
| 11 |
#include <soc/symbols.h> |
| 12 |
#include <symbols.h> |
| 13 |
|
| 14 |
void bootmem_platform_add_ranges(void) |
| 15 |
{ |
| 16 |
bootmem_add_range((uintptr_t)_pmu_sram, REGION_SIZE(pmu_sram), |
| 17 |
BM_MEM_BL31); |
| 18 |
bootmem_add_range((uintptr_t)_bl31_sram, REGION_SIZE(bl31_sram), |
| 19 |
BM_MEM_BL31); |
| 20 |
} |
| 21 |
|
| 22 |
static void soc_read_resources(struct device *dev) |
| 23 |
{ |
| 24 |
ram_range(dev, 0, (uintptr_t)_dram, sdram_size_mb() * MiB); |
| 25 |
} |
| 26 |
|
| 27 |
static void soc_init(struct device *dev) |
| 28 |
{ |
| 29 |
if (CONFIG(MAINBOARD_DO_NATIVE_VGA_INIT) && display_init_required()) |
| 30 |
rk_display_init(dev); |
| 31 |
else |
| 32 |
printk(BIOS_INFO, "Display initialization disabled.\n"); |
| 33 |
|
| 34 |
|
| 35 |
rkclk_configure_cpu(APLL_600_MHZ, CPU_CLUSTER_BIG); |
| 36 |
} |
| 37 |
|
| 38 |
static struct device_operations soc_ops = { |
| 39 |
.read_resources = soc_read_resources, |
| 40 |
.init = soc_init, |
| 41 |
}; |
| 42 |
|
| 43 |
static void enable_soc_dev(struct device *dev) |
| 44 |
{ |
| 45 |
dev->ops = &soc_ops; |
| 46 |
} |
| 47 |
|
| 48 |
struct chip_operations soc_rockchip_rk3399_ops = { |
| 49 |
.name = "SOC Rockchip RK3399", |
| 50 |
.enable_dev = enable_soc_dev, |
| 51 |
}; |