coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mainboard.c File Reference
#include <device/mmio.h>
#include <arch/mmu.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <delay.h>
#include <device/device.h>
#include <device/i2c_simple.h>
#include <soc/addressmap.h>
#include <soc/clk_rst.h>
#include <soc/clock.h>
#include <soc/funitcfg.h>
#include <soc/padconfig.h>
#include <soc/nvidia/tegra/i2c.h>
#include <soc/nvidia/tegra/pingroup.h>
#include <soc/nvidia/tegra/dc.h>
#include <soc/display.h>
#include <soc/mtc.h>
#include <soc/pmc.h>
#include <soc/power.h>
#include "gpio.h"
#include "pmic.h"
Include dependency graph for mainboard.c:

Go to the source code of this file.

Functions

static void setup_audio (void)
 
static void configure_display_clocks (void)
 
static int enable_lcd_vdd (void)
 
static int configure_display_blocks (void)
 
static void powergate_unused_partitions (void)
 
static void mainboard_init (struct device *dev)
 
void display_startup (struct device *dev)
 
static void mainboard_enable (struct device *dev)
 
void lb_board (struct lb_header *header)
 

Variables

static const struct pad_config padcfgs []
 
static const struct pad_config audio_codec_pads []
 
static const struct pad_config i2s1_pad []
 
static const struct funit_cfg audio_funit []
 
static const struct funit_cfg funits []
 
static const struct pad_config lcd_gpio_padcfgs []
 
struct chip_operations mainboard_ops
 

Function Documentation

◆ configure_display_blocks()

static int configure_display_blocks ( void  )
static

Definition at line 139 of file mainboard.c.

References ARRAY_SIZE, configure_display_clocks(), enable_lcd_vdd(), lcd_gpio_padcfgs, and soc_configure_pads().

Referenced by mainboard_init().

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

◆ configure_display_clocks()

static void configure_display_clocks ( void  )
static

Definition at line 96 of file mainboard.c.

References CLK_H_DSI, CLK_H_MIPI_CAL, CLK_L_DISP1, CLK_L_HOST1X, CLK_U_DSIB, CLK_X_UART_FST_MIPI_CAL, clock_configure_source, clock_enable_clear_reset(), IO_STABILIZATION_DELAY, PLLP_OUT3, and udelay().

Referenced by configure_display_blocks().

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

◆ display_startup()

void display_startup ( struct device dev)

Definition at line 189 of file mainboard.c.

References dsi_display_startup().

Referenced by mainboard_init().

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

◆ enable_lcd_vdd()

static int enable_lcd_vdd ( void  )
static

Definition at line 112 of file mainboard.c.

References EN_VDD18_LCD, EN_VDD_LCD, gpio_set(), I2CPWR_BUS, LCD_EN, LCD_RST_L, MAX77620_CNFG1_L0_REG, mdelay(), and pmic_write_reg_77620().

Referenced by configure_display_blocks().

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

References CONFIG, header, lb_table_add_serialno_from_vpd(), and soc_add_mtc().

Here is the call graph for this function:

◆ mainboard_enable()

static void mainboard_enable ( struct device dev)
static

Definition at line 194 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 172 of file mainboard.c.

References ARRAY_SIZE, configure_display_blocks(), display_init_required(), funits, I2C6_BUS, i2c_init(), padcfgs, powergate_unused_partitions(), setup_audio(), soc_configure_funits(), soc_configure_i2c6pad(), and soc_configure_pads().

Referenced by mainboard_enable().

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

◆ powergate_unused_partitions()

static void powergate_unused_partitions ( void  )
static

Definition at line 154 of file mainboard.c.

References ARRAY_SIZE, power_gate_partition(), POWER_PARTID_DFD, POWER_PARTID_NVDEC, POWER_PARTID_NVJPG, POWER_PARTID_PCX, POWER_PARTID_SAX, POWER_PARTID_XUSBA, POWER_PARTID_XUSBB, and POWER_PARTID_XUSBC.

Referenced by mainboard_init().

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

◆ setup_audio()

static void setup_audio ( void  )
static

Definition at line 60 of file mainboard.c.

Referenced by mainboard_init().

Here is the caller graph for this function:

Variable Documentation

◆ audio_codec_pads

const struct pad_config audio_codec_pads[]
static
Initial value:
= {
}
@ PINMUX_PULL_DOWN
Definition: pinmux.h:13
#define PAD_CFG_GPIO_OUT1(ball_, pinmux_flgs_)
Definition: padconfig.h:40

Definition at line 1 of file mainboard.c.

◆ audio_funit

const struct funit_cfg audio_funit[]
static
Initial value:
= {
}
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define FUNIT_CFG(_funit, _clk_src, _clk_freq, _cfg, _cfg_size)
Definition: funitcfg.h:55
static const struct pad_config i2s1_pad[]
Definition: mainboard.c:37
@ CLK_M
Definition: clock.h:253

Definition at line 1 of file mainboard.c.

◆ funits

const struct funit_cfg funits[]
static
Initial value:
= {
FUNIT_CFG(SDMMC4, PLLP, 48000, NULL, 0),
}
#define FUNIT_CFG_USB(_funit)
Definition: funitcfg.h:65
static const struct pad_config audio_codec_pads[]
Definition: mainboard.c:31
@ I2C6
Definition: i2c.h:56
@ PLLP
Definition: clock.h:245
#define NULL
Definition: stddef.h:19

Definition at line 1 of file mainboard.c.

Referenced by mainboard_init().

◆ i2s1_pad

const struct pad_config i2s1_pad[]
static
Initial value:
= {
PAD_CFG_SFIO(DAP1_SCLK, PINMUX_INPUT_ENABLE, I2S1),
PAD_CFG_SFIO(DAP1_DOUT, PINMUX_INPUT_ENABLE, I2S1),
PAD_CFG_SFIO(AUD_MCLK, PINMUX_PULL_NONE, AUD),
}
@ PINMUX_INPUT_ENABLE
Definition: pinmux.h:17
@ PINMUX_PULL_NONE
Definition: pinmux.h:12
@ PINMUX_TRISTATE
Definition: pinmux.h:16
#define PAD_CFG_SFIO(ball_, pinmux_flgs_, sfio_)
Definition: padconfig.h:50

Definition at line 1 of file mainboard.c.

◆ lcd_gpio_padcfgs

const struct pad_config lcd_gpio_padcfgs[]
static
Initial value:
= {
}
@ PINMUX_PULL_UP
Definition: pinmux.h:14
#define PAD_CFG_GPIO_OUT0(ball_, pinmux_flgs_)
Definition: padconfig.h:30

Definition at line 60 of file mainboard.c.

Referenced by configure_display_blocks().

◆ mainboard_ops

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

Definition at line 194 of file mainboard.c.

◆ padcfgs

const struct pad_config padcfgs[]
static
Initial value:
= {
}
@ PINMUX_IO_HV
Definition: pinmux.h:23
@ PINMUX_PARKED
Definition: pinmux.h:18
@ PINMUX_LPDR
Definition: pinmux.h:21
#define PAD_CFG_GPIO_INPUT(ball_, pinmux_flgs_)
Definition: padconfig.h:21

Definition at line 1 of file mainboard.c.

Referenced by mainboard_init().