coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
power.c File Reference
#include <device/mmio.h>
#include <assert.h>
#include <console/console.h>
#include <soc/addressmap.h>
#include <soc/pmc.h>
#include <soc/power.h>
Include dependency graph for power.c:

Go to the source code of this file.

Enumerations

enum  { POWER_GATE = 0 , POWER_UNGATE = 1 }
 

Functions

static int partition_powered (int id)
 
static void power_gate_toggle_request (uint32_t id, int request)
 
void power_gate_partition (uint32_t id)
 
void power_ungate_partition (uint32_t id)
 
uint8_t pmc_rst_status (void)
 
void pmc_print_rst_status (void)
 
static int partition_clamp_on (int id)
 
void remove_clamps (int id)
 
void pmc_override_pwr_det (uint32_t bits, uint32_t override)
 

Variables

static struct tegra_pmc_regs *const pmc = (void *)TEGRA_PMC_BASE
 
static const char *const power_gate_string []
 
static const char * pmc_rst_status_str [PMC_RST_STATUS_NUM_SOURCES]
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
POWER_GATE 
POWER_UNGATE 

Definition at line 12 of file power.c.

Function Documentation

◆ partition_clamp_on()

static int partition_clamp_on ( int  id)
static

Definition at line 95 of file power.c.

References tegra_pmc_regs::clamp_status, pmc, and read32().

Referenced by remove_clamps().

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

◆ partition_powered()

static int partition_powered ( int  id)
static

Definition at line 17 of file power.c.

References pmc, POWER_GATE, POWER_UNGATE, tegra_pmc_regs::pwrgate_status, and read32().

Referenced by power_gate_toggle_request().

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

◆ pmc_override_pwr_det()

void pmc_override_pwr_det ( uint32_t  bits,
uint32_t  override 
)

Definition at line 113 of file power.c.

References pmc, tegra_pmc_regs::pwr_det_val, read32(), val, and write32().

Referenced by bootblock_mainboard_init().

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

◆ pmc_print_rst_status()

void pmc_print_rst_status ( void  )

Definition at line 87 of file power.c.

References assert, BIOS_INFO, pmc_rst_status(), PMC_RST_STATUS_NUM_SOURCES, pmc_rst_status_str, printk, and tegra_pmc_regs::rst_status.

Referenced by tegra210_main().

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

◆ pmc_rst_status()

uint8_t pmc_rst_status ( void  )

Definition at line 74 of file power.c.

References pmc, PMC_RST_STATUS_SOURCE_MASK, read32(), and tegra_pmc_regs::rst_status.

Referenced by pmc_print_rst_status().

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

◆ power_gate_partition()

void power_gate_partition ( uint32_t  id)

Definition at line 64 of file power.c.

References POWER_GATE, and power_gate_toggle_request().

Referenced by powergate_unused_partitions().

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

◆ power_gate_toggle_request()

static void power_gate_toggle_request ( uint32_t  id,
int  request 
)
static

Definition at line 30 of file power.c.

References BIOS_INFO, partition_powered(), pmc, PMC_PWRGATE_TOGGLE_PARTID_MASK, PMC_PWRGATE_TOGGLE_PARTID_SHIFT, PMC_PWRGATE_TOGGLE_START, power_gate_string, printk, tegra_pmc_regs::pwrgate_toggle, read32(), and write32().

Referenced by power_gate_partition(), and power_ungate_partition().

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

◆ power_ungate_partition()

void power_ungate_partition ( uint32_t  id)

Definition at line 69 of file power.c.

References power_gate_toggle_request(), and POWER_UNGATE.

Here is the call graph for this function:

◆ remove_clamps()

void remove_clamps ( int  id)

Definition at line 100 of file power.c.

References partition_clamp_on(), pmc, tegra_pmc_regs::remove_clamping_cmd, and write32().

Referenced by soc_configure_ape(), and soc_configure_host1x().

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

Variable Documentation

◆ pmc

◆ pmc_rst_status_str

const char* pmc_rst_status_str[PMC_RST_STATUS_NUM_SOURCES]
static
Initial value:
= {
}
@ PMC_RST_STATUS_SOURCE_LP0
Definition: pmc.h:591
@ PMC_RST_STATUS_SOURCE_POR
Definition: pmc.h:587
@ PMC_RST_STATUS_SOURCE_SW_MAIN
Definition: pmc.h:590
@ PMC_RST_STATUS_SOURCE_WATCHDOG
Definition: pmc.h:588
@ PMC_RST_STATUS_SOURCE_SENSOR
Definition: pmc.h:589

Definition at line 79 of file power.c.

Referenced by pmc_print_rst_status().

◆ power_gate_string

const char* const power_gate_string[]
static
Initial value:
= {
[POWER_GATE] = "Gat",
[POWER_UNGATE] = "Ungat",
}
@ POWER_GATE
Definition: power.c:13
@ POWER_UNGATE
Definition: power.c:14

Definition at line 25 of file power.c.

Referenced by power_gate_toggle_request().