coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
soc.c File Reference
#include <console/console.h>
#include <device/device.h>
#include <soc/addressmap.h>
#include <soc/clock.h>
#include <soc/sdram.h>
#include <soc/timer.h>
#include <soc/uart.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <symbols.h>
#include <libbdk-boot/bdk-boot.h>
#include <soc/ecam0.h>
#include <console/uart.h>
#include <libbdk-hal/bdk-pcie.h>
#include <device/pci.h>
#include <libbdk-hal/bdk-qlm.h>
#include <libbdk-hal/bdk-config.h>
#include <libbdk-arch/bdk-csrs-bgx.h>
#include <bootmem.h>
#include <soc/bl31_plat_params.h>
#include <cbfs.h>
#include <cbmem.h>
#include <fit.h>
Include dependency graph for soc.c:

Go to the source code of this file.

Functions

static void dt_platform_fixup_phy (struct device_tree_node *node, char *path, int64_t phy_address, bdk_qlm_modes_t qlm_mode)
 
static void dt_iterate_phy (struct device_tree_node *parent, const char *name, char *path, int64_t phy_address, bdk_qlm_modes_t qlm_mode)
 
static void dt_platform_fixup_mac (struct device_tree_node *node)
 
static void dt_iterate_mac (struct device_tree_node *parent)
 
static int dt_platform_fixup (struct device_tree_fixup *fixup, struct device_tree *tree)
 
void bootmem_platform_add_ranges (void)
 
static void soc_read_resources (struct device *dev)
 
static void soc_init_atf (void)
 
static void soc_init (struct device *dev)
 
static void soc_final (struct device *dev)
 
static void enable_soc_dev (struct device *dev)
 

Variables

static const char * QLM_BGX_MODE_MAP [BDK_QLM_MODE_LAST]
 
u8 _sff8104 []
 
u8 _esff8104 []
 
static struct device_operations soc_ops
 
struct chip_operations soc_cavium_cn81xx_ops
 

Function Documentation

◆ bootmem_platform_add_ranges()

void bootmem_platform_add_ranges ( void  )

Definition at line 312 of file soc.c.

References _esff8104, _sff8104, BM_MEM_RESERVED, bootmem_add_range(), MiB, and sdram_size_mb().

Here is the call graph for this function:

◆ dt_iterate_mac()

static void dt_iterate_mac ( struct device_tree_node parent)
static

Definition at line 150 of file soc.c.

References device_tree_node::children, dt_platform_fixup_mac(), list_for_each, name, fdt_property::name, device_tree_property::prop, device_tree_node::properties, and strcmp().

Referenced by dt_platform_fixup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dt_iterate_phy()

static void dt_iterate_phy ( struct device_tree_node parent,
const char *  name,
char *  path,
int64_t  phy_address,
bdk_qlm_modes_t  qlm_mode 
)
static

Definition at line 91 of file soc.c.

References device_tree_node::children, dt_platform_fixup_phy(), list_for_each, name, fdt_property::name, device_tree_property::prop, device_tree_node::properties, and strcmp().

Referenced by dt_platform_fixup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dt_platform_fixup()

static int dt_platform_fixup ( struct device_tree_fixup fixup,
struct device_tree tree 
)
static

◆ dt_platform_fixup_mac()

static void dt_platform_fixup_mac ( struct device_tree_node node)
static

Definition at line 113 of file soc.c.

References BIOS_INFO, dt_add_bin_prop(), dt_find_bin_prop(), device_tree_node::list_node, list_remove(), name, device_tree_node::name, NULL, and printk.

Referenced by dt_iterate_mac().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dt_platform_fixup_phy()

static void dt_platform_fixup_phy ( struct device_tree_node node,
char *  path,
int64_t  phy_address,
bdk_qlm_modes_t  qlm_mode 
)
static

Definition at line 50 of file soc.c.

References BIOS_INFO, dt_delete_prop(), dt_find_bin_prop(), device_tree_node::list_node, list_remove(), device_tree_node::name, NULL, printk, strcmp(), strlen(), and strncmp().

Referenced by dt_iterate_phy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enable_soc_dev()

static void enable_soc_dev ( struct device dev)
static

◆ soc_final()

static void soc_final ( struct device dev)
static

Definition at line 374 of file soc.c.

References watchdog_disable().

Here is the call graph for this function:

◆ soc_init()

static void soc_init ( struct device dev)
static

Definition at line 354 of file soc.c.

References CONFIG, device_tree_fixups, dt_platform_fixup(), device_tree_fixup::fixup, list_insert_after(), device_tree_fixup::list_node, malloc(), and soc_init_atf().

Here is the call graph for this function:

◆ soc_init_atf()

static void soc_init_atf ( void  )
static

Definition at line 329 of file soc.c.

References _sff8104, cbfs_map(), cbmem_find(), CBMEM_ID_CBTABLE, cn81xx_register_bl31_param(), bl31_fdt_param::fdt_ptr, bl31_fdt_param::h, bl31_u64_param::h, memcpy(), PARAM_COREBOOT_TABLE, PARAM_FDT, bl31_plat_param::type, and bl31_u64_param::value.

Referenced by soc_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ soc_read_resources()

static void soc_read_resources ( struct device dev)
static

Definition at line 323 of file soc.c.

References KiB, ram_resource, and sdram_size_mb().

Here is the call graph for this function:

Variable Documentation

◆ _esff8104

u8 _esff8104[]
extern

◆ _sff8104

u8 _sff8104[]
extern

◆ QLM_BGX_MODE_MAP

const char* QLM_BGX_MODE_MAP[BDK_QLM_MODE_LAST]
static
Initial value:
= {
[BDK_QLM_MODE_SGMII_4X1] = "sgmii",
[BDK_QLM_MODE_SGMII_2X1] = "sgmii",
[BDK_QLM_MODE_SGMII_1X1] = "sgmii",
[BDK_QLM_MODE_XAUI_1X4] = "xaui",
[BDK_QLM_MODE_RXAUI_2X2] = "rxaui",
[BDK_QLM_MODE_RXAUI_1X2] = "rxaui",
[BDK_QLM_MODE_XFI_4X1] = "xfi",
[BDK_QLM_MODE_XFI_2X1] = "xfi",
[BDK_QLM_MODE_XFI_1X1] = "xfi",
[BDK_QLM_MODE_XLAUI_1X4] = "xlaui",
[BDK_QLM_MODE_10G_KR_4X1] = "xfi-10g-kr",
[BDK_QLM_MODE_10G_KR_2X1] = "xfi-10g-kr",
[BDK_QLM_MODE_10G_KR_1X1] = "xfi-10g-kr",
[BDK_QLM_MODE_40G_KR4_1X4] = "xlaui-40g-kr",
[BDK_QLM_MODE_QSGMII_4X1] = "qsgmii",
}

Definition at line 32 of file soc.c.

Referenced by dt_platform_fixup().

◆ soc_cavium_cn81xx_ops

struct chip_operations soc_cavium_cn81xx_ops
Initial value:
= {
.enable_dev = enable_soc_dev,
}
static void enable_soc_dev(struct device *dev)
Definition: soc.c:386

Definition at line 386 of file soc.c.

◆ soc_ops

struct device_operations soc_ops
static
Initial value:
= {
.read_resources = soc_read_resources,
.set_resources = noop_set_resources,
.init = soc_init,
.final = soc_final,
}
static void soc_read_resources(struct device *dev)
Definition: soc.c:323
static void soc_init(struct device *dev)
Definition: soc.c:354
static void soc_final(struct device *dev)
Definition: soc.c:374
static void noop_set_resources(struct device *dev)
Definition: device.h:74

Definition at line 374 of file soc.c.

Referenced by enable_soc_dev().