coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
soc.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
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 
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 {
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  /* We don't need big CPUs, but bring them up as a courtesy to Linux. */
36 }
37 
38 static struct device_operations soc_ops = {
40  .init = soc_init,
41 };
42 
43 static void enable_soc_dev(struct device *dev)
44 {
45  dev->ops = &soc_ops;
46 }
47 
49  CHIP_NAME("SOC Rockchip RK3399")
50  .enable_dev = enable_soc_dev,
51 };
@ BM_MEM_BL31
Definition: bootmem.h:30
void bootmem_add_range(uint64_t start, uint64_t size, const enum bootmem_type tag)
Definition: bootmem.c:88
int display_init_required(void)
Definition: bootmode.c:22
#define KiB
Definition: helpers.h:75
size_t sdram_size_mb(void)
Definition: sdram.c:24
void bootmem_platform_add_ranges(void)
Definition: soc.c:312
#define printk(level,...)
Definition: stdlib.h:16
@ CONFIG
Definition: dsi_common.h:201
#define CHIP_NAME(X)
Definition: device.h:32
#define ram_resource(dev, idx, basek, sizek)
Definition: device.h:321
u8 _dram[]
#define REGION_SIZE(name)
Definition: symbols.h:10
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
static void enable_soc_dev(struct device *dev)
Definition: soc.c:43
static void soc_read_resources(struct device *dev)
Definition: soc.c:22
struct chip_operations soc_rockchip_rk3399_ops
Definition: soc.c:48
static struct device_operations soc_ops
Definition: soc.c:38
static void soc_init(struct device *dev)
Definition: soc.c:27
void rkclk_configure_cpu(enum apll_frequencies apll_freq)
Definition: clock.c:309
void rk_display_init(struct device *dev, u32 lcdbase, unsigned long fb_size)
Definition: display.c:24
@ APLL_600_MHZ
Definition: clock.h:18
@ CPU_CLUSTER_BIG
Definition: clock.h:93
unsigned long uintptr_t
Definition: stdint.h:21
void(* read_resources)(struct device *dev)
Definition: device.h:39
Definition: device.h:107
struct device_operations * ops
Definition: device.h:143