coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mainboard.c File Reference
#include <bl31.h>
#include <bootmode.h>
#include <console/console.h>
#include <delay.h>
#include <device/device.h>
#include <device/mmio.h>
#include <edid.h>
#include <framebuffer_info.h>
#include <gpio.h>
#include <soc/ddp.h>
#include <soc/dpm.h>
#include <soc/dptx.h>
#include <soc/gpio.h>
#include <soc/i2c.h>
#include <soc/msdc.h>
#include <soc/mtcmos.h>
#include <soc/spm.h>
#include <soc/usb.h>
#include <arm-trusted-firmware/include/export/plat/mediatek/common/plat_params_exp.h>
Include dependency graph for mainboard.c:

Go to the source code of this file.

Macros

#define GPIO_AP_EDP_BKLTEN   GPIO(DGI_D5)
 
#define GPIO_BL_PWM_1V8   GPIO(DISP_PWM0)
 
#define GPIO_EDP_HPD_1V8   GPIO(GPIO_07)
 
#define GPIO_EN_PP3300_DISP_X   GPIO(I2SO1_D2)
 

Functions

static void register_reset_to_bl31 (void)
 
static void configure_panel_backlight (void)
 
static void power_on_panel (void)
 
static bool configure_display (void)
 
static void configure_i2s (void)
 
static void configure_audio (void)
 
static void mainboard_init (struct device *dev)
 
static void mainboard_enable (struct device *dev)
 

Variables

struct chip_operations mainboard_ops
 

Macro Definition Documentation

◆ GPIO_AP_EDP_BKLTEN

#define GPIO_AP_EDP_BKLTEN   GPIO(DGI_D5)

Definition at line 27 of file mainboard.c.

◆ GPIO_BL_PWM_1V8

#define GPIO_BL_PWM_1V8   GPIO(DISP_PWM0)

Definition at line 28 of file mainboard.c.

◆ GPIO_EDP_HPD_1V8

#define GPIO_EDP_HPD_1V8   GPIO(GPIO_07)

Definition at line 29 of file mainboard.c.

◆ GPIO_EN_PP3300_DISP_X

#define GPIO_EN_PP3300_DISP_X   GPIO(I2SO1_D2)

Definition at line 30 of file mainboard.c.

Function Documentation

◆ configure_audio()

static void configure_audio ( void  )
static

Definition at line 107 of file mainboard.c.

References CONFIG, configure_i2s(), I2C2, I2C_SPEED_FAST, and mtk_i2c_bus_init().

Referenced by mainboard_init().

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

◆ configure_display()

◆ configure_i2s()

static void configure_i2s ( void  )
static

Definition at line 95 of file mainboard.c.

References GPIO, gpio_set_mode(), mtcmos_audio_power_on(), and mtcmos_protect_audio_bus().

Referenced by configure_audio().

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

◆ configure_panel_backlight()

static void configure_panel_backlight ( void  )
static

Definition at line 44 of file mainboard.c.

References GPIO_AP_EDP_BKLTEN, GPIO_BL_PWM_1V8, and gpio_output().

Referenced by configure_display().

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 138 of file mainboard.c.

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

Here is the call graph for this function:

◆ mainboard_init()

static void mainboard_init ( struct device dev)
static

Definition at line 116 of file mainboard.c.

References BIOS_ERR, BIOS_INFO, configure_audio(), configure_display(), display_init_required(), dpm_init(), mtk_msdc_configure_emmc(), mtk_msdc_configure_sdcard(), printk, register_reset_to_bl31(), setup_usb_host(), and spm_init().

Referenced by mainboard_enable().

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

◆ power_on_panel()

static void power_on_panel ( void  )
static

Definition at line 50 of file mainboard.c.

References GPIO_EDP_HPD_1V8, GPIO_EN_PP3300_DISP_X, gpio_output(), GPIO_PULL_ENABLE, GPIO_PULL_UP, gpio_set_mode(), and gpio_set_pull().

Referenced by configure_display().

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 32 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:

Variable Documentation

◆ mainboard_ops

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

Definition at line 138 of file mainboard.c.