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

Go to the source code of this file.

Macros

#define FLOW_CTRL_HALT_CPU0_EVENTS   0x0
 
#define FLOW_CTRL_WAITEVENT   (2 << 29)
 
#define FLOW_CTRL_WAIT_FOR_INTERRUPT   (4 << 29)
 
#define FLOW_CTRL_HALT_SCLK   (1 << 27)
 
#define FLOW_CTRL_HALT_LIC_IRQ   (1 << 11)
 
#define FLOW_CTRL_HALT_LIC_FIQ   (1 << 10)
 
#define FLOW_CTRL_HALT_GIC_IRQ   (1 << 9)
 
#define FLOW_CTRL_HALT_GIC_FIQ   (1 << 8)
 
#define FLOW_CTRL_CPU0_CSR   0x8
 
#define FLOW_CTRL_CSR_INTR_FLAG   (1 << 15)
 
#define FLOW_CTRL_CSR_EVENT_FLAG   (1 << 14)
 
#define FLOW_CTRL_CSR_WFI_CPU0   (1 << 8)
 
#define FLOW_CTRL_CSR_WFI_BITMAP   (0xF << 8)
 
#define FLOW_CTRL_CSR_WFE_BITMAP   (0xF << 4)
 
#define FLOW_CTRL_CSR_ENABLE   (1 << 0)
 
#define FLOW_CTRL_HALT_CPU1_EVENTS   0x14
 
#define FLOW_CTRL_CPU1_CSR   0x18
 
#define FLOW_CTRL_CC4_CORE0_CTRL   0x6c
 

Functions

void flowctrl_write_cpu_csr (int cpu, uint32_t val)
 
void flowctrl_write_cpu_halt (int cpu, uint32_t val)
 
void flowctrl_write_cc4_ctrl (int cpu, uint32_t val)
 
void flowctrl_cpu_off (int cpu)
 
void flowctrl_cpu_on (int cpu)
 
void flowctrl_cpu_suspend (int cpu)
 

Variables

static voidtegra_flowctrl_base = (void *)TEGRA_FLOW_BASE
 
static const uint8_t flowctrl_offset_halt_cpu []
 
static const uint8_t flowctrl_offset_cpu_csr []
 
static const uint8_t flowctrl_offset_cc4_ctrl []
 

Macro Definition Documentation

◆ FLOW_CTRL_CC4_CORE0_CTRL

#define FLOW_CTRL_CC4_CORE0_CTRL   0x6c

Definition at line 24 of file flow_ctrl.c.

◆ FLOW_CTRL_CPU0_CSR

#define FLOW_CTRL_CPU0_CSR   0x8

Definition at line 15 of file flow_ctrl.c.

◆ FLOW_CTRL_CPU1_CSR

#define FLOW_CTRL_CPU1_CSR   0x18

Definition at line 23 of file flow_ctrl.c.

◆ FLOW_CTRL_CSR_ENABLE

#define FLOW_CTRL_CSR_ENABLE   (1 << 0)

Definition at line 21 of file flow_ctrl.c.

◆ FLOW_CTRL_CSR_EVENT_FLAG

#define FLOW_CTRL_CSR_EVENT_FLAG   (1 << 14)

Definition at line 17 of file flow_ctrl.c.

◆ FLOW_CTRL_CSR_INTR_FLAG

#define FLOW_CTRL_CSR_INTR_FLAG   (1 << 15)

Definition at line 16 of file flow_ctrl.c.

◆ FLOW_CTRL_CSR_WFE_BITMAP

#define FLOW_CTRL_CSR_WFE_BITMAP   (0xF << 4)

Definition at line 20 of file flow_ctrl.c.

◆ FLOW_CTRL_CSR_WFI_BITMAP

#define FLOW_CTRL_CSR_WFI_BITMAP   (0xF << 8)

Definition at line 19 of file flow_ctrl.c.

◆ FLOW_CTRL_CSR_WFI_CPU0

#define FLOW_CTRL_CSR_WFI_CPU0   (1 << 8)

Definition at line 18 of file flow_ctrl.c.

◆ FLOW_CTRL_HALT_CPU0_EVENTS

#define FLOW_CTRL_HALT_CPU0_EVENTS   0x0

Definition at line 7 of file flow_ctrl.c.

◆ FLOW_CTRL_HALT_CPU1_EVENTS

#define FLOW_CTRL_HALT_CPU1_EVENTS   0x14

Definition at line 22 of file flow_ctrl.c.

◆ FLOW_CTRL_HALT_GIC_FIQ

#define FLOW_CTRL_HALT_GIC_FIQ   (1 << 8)

Definition at line 14 of file flow_ctrl.c.

◆ FLOW_CTRL_HALT_GIC_IRQ

#define FLOW_CTRL_HALT_GIC_IRQ   (1 << 9)

Definition at line 13 of file flow_ctrl.c.

◆ FLOW_CTRL_HALT_LIC_FIQ

#define FLOW_CTRL_HALT_LIC_FIQ   (1 << 10)

Definition at line 12 of file flow_ctrl.c.

◆ FLOW_CTRL_HALT_LIC_IRQ

#define FLOW_CTRL_HALT_LIC_IRQ   (1 << 11)

Definition at line 11 of file flow_ctrl.c.

◆ FLOW_CTRL_HALT_SCLK

#define FLOW_CTRL_HALT_SCLK   (1 << 27)

Definition at line 10 of file flow_ctrl.c.

◆ FLOW_CTRL_WAIT_FOR_INTERRUPT

#define FLOW_CTRL_WAIT_FOR_INTERRUPT   (4 << 29)

Definition at line 9 of file flow_ctrl.c.

◆ FLOW_CTRL_WAITEVENT

#define FLOW_CTRL_WAITEVENT   (2 << 29)

Definition at line 8 of file flow_ctrl.c.

Function Documentation

◆ flowctrl_cpu_off()

void flowctrl_cpu_off ( int  cpu)

◆ flowctrl_cpu_on()

void flowctrl_cpu_on ( int  cpu)

Definition at line 77 of file flow_ctrl.c.

References FLOW_CTRL_CSR_ENABLE, FLOW_CTRL_HALT_SCLK, FLOW_CTRL_WAITEVENT, flowctrl_write_cpu_csr(), and flowctrl_write_cpu_halt().

Here is the call graph for this function:

◆ flowctrl_cpu_suspend()

◆ flowctrl_write_cc4_ctrl()

void flowctrl_write_cc4_ctrl ( int  cpu,
uint32_t  val 
)

Definition at line 61 of file flow_ctrl.c.

References flowctrl_offset_cc4_ctrl, read32(), tegra_flowctrl_base, val, and write32().

Referenced by flowctrl_cpu_off().

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

◆ flowctrl_write_cpu_csr()

void flowctrl_write_cpu_csr ( int  cpu,
uint32_t  val 
)

Definition at line 49 of file flow_ctrl.c.

References flowctrl_offset_cpu_csr, read32(), tegra_flowctrl_base, val, and write32().

Referenced by flowctrl_cpu_off(), flowctrl_cpu_on(), and flowctrl_cpu_suspend().

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

◆ flowctrl_write_cpu_halt()

void flowctrl_write_cpu_halt ( int  cpu,
uint32_t  val 
)

Definition at line 55 of file flow_ctrl.c.

References flowctrl_offset_halt_cpu, read32(), tegra_flowctrl_base, val, and write32().

Referenced by flowctrl_cpu_off(), flowctrl_cpu_on(), and flowctrl_cpu_suspend().

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

Variable Documentation

◆ flowctrl_offset_cc4_ctrl

const uint8_t flowctrl_offset_cc4_ctrl[]
static
Initial value:

Definition at line 42 of file flow_ctrl.c.

Referenced by flowctrl_write_cc4_ctrl().

◆ flowctrl_offset_cpu_csr

const uint8_t flowctrl_offset_cpu_csr[]
static
Initial value:
= {
}
#define FLOW_CTRL_CPU1_CSR
Definition: flow_ctrl.c:23
#define FLOW_CTRL_CPU0_CSR
Definition: flow_ctrl.c:15

Definition at line 35 of file flow_ctrl.c.

Referenced by flowctrl_write_cpu_csr().

◆ flowctrl_offset_halt_cpu

const uint8_t flowctrl_offset_halt_cpu[]
static
Initial value:

Definition at line 28 of file flow_ctrl.c.

Referenced by flowctrl_write_cpu_halt().

◆ tegra_flowctrl_base

void* tegra_flowctrl_base = (void *)TEGRA_FLOW_BASE
static