coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mainboard.c File Reference
#include <arch/cache.h>
#include <boot/coreboot_tables.h>
#include <console/console.h>
#include <device/mmio.h>
#include <delay.h>
#include <device/device.h>
#include <device/i2c_simple.h>
#include <drivers/parade/ps8625/ps8625.h>
#include <ec/google/chromeec/ec.h>
#include <soc/tmu.h>
#include <soc/clk.h>
#include <soc/cpu.h>
#include <soc/gpio.h>
#include <soc/power.h>
#include <soc/periph.h>
#include <soc/i2c.h>
#include <soc/dp.h>
#include <soc/fimd.h>
#include <soc/usb.h>
#include <string.h>
#include <symbols.h>
#include <vbe.h>
#include <framebuffer_info.h>
Include dependency graph for mainboard.c:

Go to the source code of this file.

Macros

#define DRAM_START   ((uintptr_t)_dram/MiB)
 
#define DRAM_SIZE   CONFIG_DRAM_SIZE_MB
 
#define LCD_T3_DELAY_MS   60
 
#define LCD_T5_DELAY_MS   10
 
#define LCD_T6_DELAY_MS   10
 
#define MAX_DP_TRIES   5
 

Enumerations

enum  { FET_CTRL_WAIT = 3 << 2 , FET_CTRL_ADENFET = 1 << 1 , FET_CTRL_ENFET = 1 << 0 }
 

Functions

static void parade_dp_bridge_setup (void)
 
static void backlight_pwm (void)
 
static void backlight_en (void)
 
static void prepare_usb (void)
 
static void setup_usb (void)
 
static void setup_storage (void)
 
static void gpio_init (void)
 
static void tps65090_thru_ec_fet_set (int index)
 
static void lcd_vdd (void)
 
static void backlight_vdd (void)
 
static void sdmmc_vdd (void)
 
static void mainboard_init (struct device *dev)
 
static void mainboard_enable (struct device *dev)
 
void lb_board (struct lb_header *header)
 

Variables

static struct vidinfo vidinfo
 
static unsigned char panel_edid []
 
static const struct parade_write parade_writes []
 
static enum exynos5_gpio_pin dp_pd_l = GPIO_X35
 
static enum exynos5_gpio_pin dp_rst_l = GPIO_Y77
 
static enum exynos5_gpio_pin dp_hpd = GPIO_X26
 
static enum exynos5_gpio_pin bl_pwm = GPIO_B20
 
static enum exynos5_gpio_pin bl_en = GPIO_X22
 
static enum exynos5_gpio_pin usb_drd0_vbus = GPIO_H00
 
static enum exynos5_gpio_pin usb_drd1_vbus = GPIO_H01
 
static struct edp_video_info dp_video_info
 
struct chip_operations mainboard_ops
 

Macro Definition Documentation

◆ DRAM_SIZE

#define DRAM_SIZE   CONFIG_DRAM_SIZE_MB

Definition at line 29 of file mainboard.c.

◆ DRAM_START

#define DRAM_START   ((uintptr_t)_dram/MiB)

Definition at line 28 of file mainboard.c.

◆ LCD_T3_DELAY_MS

#define LCD_T3_DELAY_MS   60

Definition at line 262 of file mainboard.c.

◆ LCD_T5_DELAY_MS

#define LCD_T5_DELAY_MS   10

Definition at line 264 of file mainboard.c.

◆ LCD_T6_DELAY_MS

#define LCD_T6_DELAY_MS   10

Definition at line 265 of file mainboard.c.

◆ MAX_DP_TRIES

#define MAX_DP_TRIES   5

Definition at line 316 of file mainboard.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FET_CTRL_WAIT 
FET_CTRL_ADENFET 
FET_CTRL_ENFET 

Definition at line 342 of file mainboard.c.

Function Documentation

◆ backlight_en()

static void backlight_en ( void  )
static

Definition at line 274 of file mainboard.c.

References bl_en, and gpio_direction_output().

Referenced by mainboard_init().

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

◆ backlight_pwm()

static void backlight_pwm ( void  )
static

Definition at line 267 of file mainboard.c.

References bl_pwm, gpio_direction_output(), LCD_T6_DELAY_MS, and udelay().

Referenced by mainboard_init().

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

◆ backlight_vdd()

static void backlight_vdd ( void  )
static

Definition at line 365 of file mainboard.c.

References tps65090_thru_ec_fet_set().

Referenced by mainboard_init().

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

◆ gpio_init()

static void gpio_init ( void  )
static

Definition at line 331 of file mainboard.c.

References exynos_pinmux_i2c10(), exynos_pinmux_i2c2(), exynos_pinmux_i2c4(), exynos_pinmux_i2c7(), exynos_pinmux_i2c8(), and exynos_pinmux_i2c9().

Referenced by mainboard_init().

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

◆ lb_board()

void lb_board ( struct lb_header header)

Definition at line 458 of file mainboard.c.

References dma, dma_coherent(), header, lb_new_record(), LB_TAG_DMA, and REGION_SIZE.

Here is the call graph for this function:

◆ lcd_vdd()

static void lcd_vdd ( void  )
static

Definition at line 359 of file mainboard.c.

References tps65090_thru_ec_fet_set().

Referenced by mainboard_init().

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

◆ mainboard_enable()

◆ mainboard_init()

◆ parade_dp_bridge_setup()

static void parade_dp_bridge_setup ( void  )
static

Definition at line 211 of file mainboard.c.

References ARRAY_SIZE, dp_hpd, dp_pd_l, dp_rst_l, exynos_pinmux_i2c7(), gpio_cfg_pin(), gpio_get_value(), GPIO_INPUT, GPIO_OUTPUT, GPIO_PULL_NONE, gpio_set_pull(), gpio_set_value(), i2c_init(), mdelay(), parade_ps8625_bridge_setup(), parade_writes, and udelay().

Referenced by mainboard_init().

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

◆ prepare_usb()

static void prepare_usb ( void  )
static

Definition at line 284 of file mainboard.c.

References reset_usb_drd0_dwc3(), and reset_usb_drd1_dwc3().

Referenced by mainboard_init().

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

◆ sdmmc_vdd()

static void sdmmc_vdd ( void  )
static

Definition at line 371 of file mainboard.c.

References tps65090_thru_ec_fet_set().

Referenced by mainboard_init().

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

◆ setup_storage()

static void setup_storage ( void  )
static

Definition at line 318 of file mainboard.c.

References BIOS_CRIT, clock_set_dwmci(), exynos_pinmux_sdmmc0(), exynos_pinmux_sdmmc2(), PERIPH_ID_SDMMC0, PERIPH_ID_SDMMC2, and printk.

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 ( void  )
static

Definition at line 291 of file mainboard.c.

Referenced by mainboard_init().

Here is the caller graph for this function:

◆ tps65090_thru_ec_fet_set()

static void tps65090_thru_ec_fet_set ( int  index)
static

Definition at line 348 of file mainboard.c.

References BIOS_ERR, FET_CTRL_ADENFET, FET_CTRL_ENFET, FET_CTRL_WAIT, google_chromeec_i2c_xfer(), printk, and value.

Referenced by backlight_vdd(), lcd_vdd(), and sdmmc_vdd().

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

Variable Documentation

◆ bl_en

enum exynos5_gpio_pin bl_en = GPIO_X22
static

Definition at line 54 of file mainboard.c.

Referenced by backlight_en().

◆ bl_pwm

enum exynos5_gpio_pin bl_pwm = GPIO_B20
static

Definition at line 54 of file mainboard.c.

Referenced by backlight_pwm().

◆ dp_hpd

enum exynos5_gpio_pin dp_hpd = GPIO_X26
static

Definition at line 54 of file mainboard.c.

Referenced by parade_dp_bridge_setup().

◆ dp_pd_l

enum exynos5_gpio_pin dp_pd_l = GPIO_X35
static

Definition at line 54 of file mainboard.c.

Referenced by parade_dp_bridge_setup().

◆ dp_rst_l

enum exynos5_gpio_pin dp_rst_l = GPIO_Y77
static

Definition at line 54 of file mainboard.c.

Referenced by parade_dp_bridge_setup().

◆ dp_video_info

struct edp_video_info dp_video_info
static
Initial value:
= {
.master_mode = 0,
.h_sync_polarity = 0,
.v_sync_polarity = 0,
.interlaced = 0,
.color_space = COLOR_RGB,
.dynamic_range = VESA,
.ycbcr_coeff = COLOR_YCBCR601,
.color_depth = COLOR_8,
}
@ COLOR_RGB
Definition: dp-core.h:37
@ COLOR_8
Definition: edp.h:579
@ VESA
Definition: edp.h:544
@ COLOR_YCBCR601
Definition: edp.h:539

Definition at line 291 of file mainboard.c.

Referenced by mainboard_init().

◆ mainboard_ops

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

Definition at line 435 of file mainboard.c.

◆ panel_edid

unsigned char panel_edid[]
static

Definition at line 54 of file mainboard.c.

Referenced by mainboard_init().

◆ parade_writes

const struct parade_write parade_writes[]
static

Definition at line 54 of file mainboard.c.

Referenced by parade_dp_bridge_setup(), and parade_ps8625_bridge_setup().

◆ usb_drd0_vbus

enum exynos5_gpio_pin usb_drd0_vbus = GPIO_H00
static

Definition at line 274 of file mainboard.c.

◆ usb_drd1_vbus

enum exynos5_gpio_pin usb_drd1_vbus = GPIO_H01
static

Definition at line 274 of file mainboard.c.

◆ vidinfo

struct vidinfo vidinfo
static
Initial value:
= {
.vl_freq = 60,
.vl_col = 1366,
.vl_row = 768,
.vl_width = 1366,
.vl_height = 768,
.vl_clkp = 1,
.vl_dp = 1,
.vl_bpix = 4,
.vl_hspw = 32,
.vl_hbpd = 40,
.vl_hfpd = 40,
.vl_vspw = 6,
.vl_vbpd = 10,
.vl_vfpd = 12,
.vl_cmd_allow_len = 0xf,
.win_id = 3,
.dp_enabled = 1,
.dual_lcd_enabled = 0,
.interface_mode = FIMD_RGB_INTERFACE,
}
@ FIMD_RGB_INTERFACE
Definition: fimd.h:131

Definition at line 1 of file mainboard.c.