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 <drivers/analogix/anx7625/anx7625.h>
#include <edid.h>
#include <framebuffer_info.h>
#include <gpio.h>
#include <soc/ddp.h>
#include <soc/dpm.h>
#include <soc/dsi.h>
#include <soc/gpio.h>
#include <soc/gpio_common.h>
#include <soc/i2c.h>
#include <soc/msdc.h>
#include <soc/mtcmos.h>
#include <soc/regulator.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 MSDC0_BASE   0x11f60000
 
#define MSDC0_TOP_BASE   0x11f50000
 
#define MSDC0_DRV_MASK   0x3fffffff
 
#define MSDC1_DRV_MASK   0x3ffff000
 
#define MSDC0_DRV_VALUE   0x24924924
 
#define MSDC1_DRV_VALUE   0x1b6db000
 
#define MSDC1_GPIO_MODE0_BASE   0x10005360
 
#define MSDC1_GPIO_MODE0_MASK   0x77777000
 
#define MSDC1_GPIO_MODE0_VALUE   0x11111000
 
#define MSDC1_GPIO_MODE1_BASE   0x10005370
 
#define MSDC1_GPIO_MODE1_MASK   0x7
 
#define MSDC1_GPIO_MODE1_VALUE   0x1
 
#define GPIO_EDPBRDG_INT_ODL   GPIO(EINT6) /* 6 */
 
#define GPIO_EDPBRDG_PWREN   GPIO(DSI_TE) /* 41 */
 
#define GPIO_EDPBRDG_RST_ODL   GPIO(LCM_RST) /* 42 */
 
#define GPIO_EN_PP3300_EDP_DX   GPIO(PERIPHERAL_EN1) /* 127 */
 
#define GPIO_EN_PP1800_EDPBRDG_DX   GPIO(PERIPHERAL_EN2) /* 128 */
 
#define GPIO_EN_PP1000_EDPBRDG   GPIO(PERIPHERAL_EN3) /* 129 */
 
#define GPIO_EN_PP3300_DISPLAY_DX   GPIO(CAM_CLK3) /* 136 */
 
#define GPIO_AP_EDP_BKLTEN   GPIO(KPROW1) /* 152 */
 
#define GPIO_BL_PWM_1V8   GPIO(DISP_PWM) /* 40 */
 

Functions

static void register_reset_to_bl31 (void)
 
void mtk_dsi_override_phy_timing (struct mtk_phy_timing *timing)
 
static void configure_backlight_and_bridge (void)
 
static bool configure_display (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(KPROW1) /* 152 */

Definition at line 53 of file mainboard.c.

◆ GPIO_BL_PWM_1V8

#define GPIO_BL_PWM_1V8   GPIO(DISP_PWM) /* 40 */

Definition at line 54 of file mainboard.c.

◆ GPIO_EDPBRDG_INT_ODL

#define GPIO_EDPBRDG_INT_ODL   GPIO(EINT6) /* 6 */

Definition at line 46 of file mainboard.c.

◆ GPIO_EDPBRDG_PWREN

#define GPIO_EDPBRDG_PWREN   GPIO(DSI_TE) /* 41 */

Definition at line 47 of file mainboard.c.

◆ GPIO_EDPBRDG_RST_ODL

#define GPIO_EDPBRDG_RST_ODL   GPIO(LCM_RST) /* 42 */

Definition at line 48 of file mainboard.c.

◆ GPIO_EN_PP1000_EDPBRDG

#define GPIO_EN_PP1000_EDPBRDG   GPIO(PERIPHERAL_EN3) /* 129 */

Definition at line 51 of file mainboard.c.

◆ GPIO_EN_PP1800_EDPBRDG_DX

#define GPIO_EN_PP1800_EDPBRDG_DX   GPIO(PERIPHERAL_EN2) /* 128 */

Definition at line 50 of file mainboard.c.

◆ GPIO_EN_PP3300_DISPLAY_DX

#define GPIO_EN_PP3300_DISPLAY_DX   GPIO(CAM_CLK3) /* 136 */

Definition at line 52 of file mainboard.c.

◆ GPIO_EN_PP3300_EDP_DX

#define GPIO_EN_PP3300_EDP_DX   GPIO(PERIPHERAL_EN1) /* 127 */

Definition at line 49 of file mainboard.c.

◆ MSDC0_BASE

#define MSDC0_BASE   0x11f60000

Definition at line 29 of file mainboard.c.

◆ MSDC0_DRV_MASK

#define MSDC0_DRV_MASK   0x3fffffff

Definition at line 32 of file mainboard.c.

◆ MSDC0_DRV_VALUE

#define MSDC0_DRV_VALUE   0x24924924

Definition at line 34 of file mainboard.c.

◆ MSDC0_TOP_BASE

#define MSDC0_TOP_BASE   0x11f50000

Definition at line 30 of file mainboard.c.

◆ MSDC1_DRV_MASK

#define MSDC1_DRV_MASK   0x3ffff000

Definition at line 33 of file mainboard.c.

◆ MSDC1_DRV_VALUE

#define MSDC1_DRV_VALUE   0x1b6db000

Definition at line 35 of file mainboard.c.

◆ MSDC1_GPIO_MODE0_BASE

#define MSDC1_GPIO_MODE0_BASE   0x10005360

Definition at line 37 of file mainboard.c.

◆ MSDC1_GPIO_MODE0_MASK

#define MSDC1_GPIO_MODE0_MASK   0x77777000

Definition at line 38 of file mainboard.c.

◆ MSDC1_GPIO_MODE0_VALUE

#define MSDC1_GPIO_MODE0_VALUE   0x11111000

Definition at line 39 of file mainboard.c.

◆ MSDC1_GPIO_MODE1_BASE

#define MSDC1_GPIO_MODE1_BASE   0x10005370

Definition at line 41 of file mainboard.c.

◆ MSDC1_GPIO_MODE1_MASK

#define MSDC1_GPIO_MODE1_MASK   0x7

Definition at line 42 of file mainboard.c.

◆ MSDC1_GPIO_MODE1_VALUE

#define MSDC1_GPIO_MODE1_VALUE   0x1

Definition at line 43 of file mainboard.c.

Function Documentation

◆ configure_audio()

static void configure_audio ( void  )
static

Definition at line 145 of file mainboard.c.

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

Referenced by mainboard_init().

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

◆ configure_backlight_and_bridge()

static void configure_backlight_and_bridge ( void  )
static

Definition at line 74 of file mainboard.c.

References GPIO_AP_EDP_BKLTEN, GPIO_BL_PWM_1V8, GPIO_EDPBRDG_PWREN, GPIO_EDPBRDG_RST_ODL, GPIO_EN_PP1000_EDPBRDG, GPIO_EN_PP1800_EDPBRDG_DX, GPIO_EN_PP3300_DISPLAY_DX, GPIO_EN_PP3300_EDP_DX, gpio_output(), and mdelay().

Referenced by configure_display().

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

◆ configure_display()

◆ mainboard_enable()

static void mainboard_enable ( struct device dev)
static

Definition at line 178 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 157 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:

◆ mtk_dsi_override_phy_timing()

void mtk_dsi_override_phy_timing ( struct mtk_phy_timing timing)

Definition at line 68 of file mainboard.c.

References mtk_phy_timing::da_hs_trail.

◆ register_reset_to_bl31()

static void register_reset_to_bl31 ( void  )
static

Definition at line 56 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:
= {
.enable_dev = mainboard_enable,
}
static void mainboard_enable(struct device *dev)
Definition: mainboard.c:178

Definition at line 178 of file mainboard.c.