coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mainboard.c File Reference
#include <assert.h>
#include <bl31.h>
#include <boardid.h>
#include <bootmode.h>
#include <console/console.h>
#include <device/mmio.h>
#include <delay.h>
#include <device/device.h>
#include <device/i2c_simple.h>
#include <ec/google/chromeec/ec.h>
#include <gpio.h>
#include <soc/clock.h>
#include <soc/display.h>
#include <soc/grf.h>
#include <soc/mipi.h>
#include <soc/i2c.h>
#include <soc/usb.h>
#include <string.h>
#include "board.h"
#include <arm-trusted-firmware/include/export/plat/rockchip/common/plat_params_exp.h>
Include dependency graph for mainboard.c:

Go to the source code of this file.

Functions

static void configure_touchpad (void)
 
static void assert_wifi_reset (void)
 
static void configure_emmc (void)
 
static void register_apio_suspend (void)
 
static void register_gpio_suspend (void)
 
static void register_reset_to_bl31 (void)
 
static void register_poweroff_to_bl31 (void)
 
static void configure_sdmmc (void)
 
static void configure_codec (void)
 
static void configure_display (void)
 
static void usb_power_cycle (int port)
 
static void setup_usb (int port)
 
static void mainboard_init (struct device *dev)
 
static void prepare_backlight_i2c (void)
 
void mainboard_power_on_backlight (void)
 
const struct mipi_panel_datamainboard_get_mipi_mode (struct edid_mode *edid_mode)
 
static void mainboard_enable (struct device *dev)
 

Variables

static struct panel_init_command innolux_p097pfg_init_cmds []
 
static struct panel_init_command kd097d04_init_commands []
 
const struct mipi_panel_data kd097d04_panel
 
static const struct edid_mode kd097d04_edid_mode
 
const struct mipi_panel_data inx097pfg_panel
 
static const struct edid_mode inx097pfg_edid_mode
 
struct chip_operations mainboard_ops
 

Function Documentation

◆ assert_wifi_reset()

static void assert_wifi_reset ( void  )
static

Definition at line 41 of file mainboard.c.

References gpio_output(), and GPIO_WLAN_RST_L.

Referenced by mainboard_init().

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

◆ configure_codec()

static void configure_codec ( void  )
static

Definition at line 204 of file mainboard.c.

References CONFIG, GPIO, gpio_input(), gpio_output(), GPIO_P18V_AUDIO_PWREN, GPIO_SPK_PA_EN, rk3399_grf_regs::iomux_i2s0, IOMUX_I2S0_SD0, IOMUX_I2SCLK, rk3399_grf_regs::iomux_i2sclk, rk3399_grf, rkclk_configure_i2s(), and write32().

Referenced by mainboard_init().

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

◆ configure_display()

static void configure_display ( void  )
static

Definition at line 224 of file mainboard.c.

References CONFIG, GPIO, gpio_input_pulldown(), gpio_output(), IOMUX_EDP_HOTPLUG, rk3399_grf_regs::iomux_edp_hotplug, mdelay(), rk3399_grf, and write32().

Referenced by mainboard_init().

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

◆ configure_emmc()

static void configure_emmc ( void  )
static

Definition at line 46 of file mainboard.c.

References rk3399_grf_regs::emmccore_con, rk3399_grf, RK_CLRSETBITS, rkclk_configure_emmc(), and write32().

Referenced by mainboard_init().

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

◆ configure_sdmmc()

static void configure_sdmmc ( void  )
static

Definition at line 150 of file mainboard.c.

References CONFIG, GPIO, rk3399_grf_regs::gpio2_p, rk3399_grf_regs::gpio4b_e01, rk3399_grf_regs::gpio4b_e2, gpio_input(), gpio_input_pullup(), gpio_output(), rk3399_grf_regs::iomux_sdmmc, IOMUX_SDMMC, rk3399_grf, RK_CLRSETBITS, and write32().

Referenced by mainboard_init().

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

◆ configure_touchpad()

static void configure_touchpad ( void  )
static

Definition at line 31 of file mainboard.c.

References gpio_output(), and GPIO_TP_RST_L.

Referenced by mainboard_init().

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

◆ mainboard_enable()

static void mainboard_enable ( struct device dev)
static

Definition at line 681 of file mainboard.c.

References device_operations::init, mainboard_init(), and device::ops.

Here is the call graph for this function:

◆ mainboard_get_mipi_mode()

const struct mipi_panel_data* mainboard_get_mipi_mode ( struct edid_mode edid_mode)

Definition at line 659 of file mainboard.c.

References inx097pfg_edid_mode, inx097pfg_panel, kd097d04_edid_mode, kd097d04_panel, memcpy(), and sku_id().

Referenced by rk_display_init().

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

◆ mainboard_init()

static void mainboard_init ( struct device dev)
static

◆ mainboard_power_on_backlight()

void mainboard_power_on_backlight ( void  )

Definition at line 356 of file mainboard.c.

Referenced by rk_display_init().

Here is the caller graph for this function:

◆ prepare_backlight_i2c()

static void prepare_backlight_i2c ( void  )
static

Definition at line 345 of file mainboard.c.

References GPIO, gpio_input(), i2c_init(), rk3399_pmugrf_regs::iomux_i2c0_scl, IOMUX_I2C0_SCL, rk3399_pmugrf_regs::iomux_i2c0_sda, IOMUX_I2C0_SDA, KHz, rk3399_pmugrf, and write32().

Here is the call graph for this function:

◆ register_apio_suspend()

static void register_apio_suspend ( void  )
static

Definition at line 60 of file mainboard.c.

References register_bl31_aux_param().

Referenced by mainboard_init().

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

◆ register_gpio_suspend()

static void register_gpio_suspend ( void  )
static

Definition at line 77 of file mainboard.c.

References CONFIG, GPIO_P15V_EN, GPIO_P18V_AUDIO_PWREN, GPIO_P30V_EN, and register_bl31_aux_param().

Referenced by mainboard_init().

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

◆ register_poweroff_to_bl31()

static void register_poweroff_to_bl31 ( void  )
static

Definition at line 129 of file mainboard.c.

References GPIO_POWEROFF, and register_bl31_aux_param().

Referenced by mainboard_init().

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

◆ register_reset_to_bl31()

static void register_reset_to_bl31 ( void  )
static

Definition at line 112 of file mainboard.c.

References GPIO_RESET, and register_bl31_aux_param().

Referenced by mainboard_init().

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

◆ setup_usb()

static void setup_usb ( int  port)
static

Definition at line 258 of file mainboard.c.

References assert, display_init_required(), rk3399_grf, RK_CLRBITS, RK_CLRSETBITS, RK_SETBITS, setup_usb_otg0(), setup_usb_otg1(), usb_power_cycle(), rk3399_grf_regs::usbphy_ctrl, and write32().

Referenced by mainboard_init().

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

◆ usb_power_cycle()

static void usb_power_cycle ( int  port)
static

Definition at line 247 of file mainboard.c.

References BIOS_ERR, google_chromeec_set_usb_pd_role(), mdelay(), printk, USB_PD_CTRL_ROLE_FORCE_SINK, and USB_PD_CTRL_ROLE_TOGGLE_ON.

Referenced by setup_usb().

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

Variable Documentation

◆ innolux_p097pfg_init_cmds

struct panel_init_command innolux_p097pfg_init_cmds[]
static

Definition at line 356 of file mainboard.c.

◆ inx097pfg_edid_mode

const struct edid_mode inx097pfg_edid_mode
static
Initial value:
= {
.name = "1536x2048@60Hz",
.pixel_clock = 220000,
.refresh = 60,
.ha = 1536,
.hbl = 224,
.hso = 100,
.hspw = 24,
.va = 2048,
.vbl = 38,
.vso = 18,
.vspw = 2,
}

Definition at line 356 of file mainboard.c.

Referenced by mainboard_get_mipi_mode().

◆ inx097pfg_panel

const struct mipi_panel_data inx097pfg_panel
Initial value:
= {
.mipi_num = 2,
.lanes = 8,
.display_on_udelay = 120000,
.video_mode_udelay = 5000,
}
@ MIPI_DSI_FMT_RGB888
Definition: dsi_common.h:13
static struct panel_init_command innolux_p097pfg_init_cmds[]
Definition: mainboard.c:368

Definition at line 356 of file mainboard.c.

Referenced by mainboard_get_mipi_mode().

◆ kd097d04_edid_mode

const struct edid_mode kd097d04_edid_mode
static
Initial value:
= {
.name = "1536x2048@60Hz",
.pixel_clock = 216000,
.refresh = 60,
.ha = 1536,
.hbl = 186,
.hso = 81,
.hspw = 24,
.va = 2048,
.vbl = 42,
.vso = 17,
.vspw = 2,
}

Definition at line 356 of file mainboard.c.

Referenced by mainboard_get_mipi_mode().

◆ kd097d04_init_commands

struct panel_init_command kd097d04_init_commands[]
static

Definition at line 356 of file mainboard.c.

◆ kd097d04_panel

const struct mipi_panel_data kd097d04_panel
Initial value:
= {
.mipi_num = 2,
.lanes = 8,
.display_on_udelay = 120000,
.video_mode_udelay = 5000,
}
static struct panel_init_command kd097d04_init_commands[]
Definition: mainboard.c:477

Definition at line 356 of file mainboard.c.

Referenced by mainboard_get_mipi_mode().

◆ mainboard_ops

struct chip_operations mainboard_ops
Initial value:
= {
.enable_dev = mainboard_enable,
}
static void mainboard_enable(struct device *dev)
Definition: mainboard.c:681

Definition at line 681 of file mainboard.c.