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

Go to the source code of this file.

Macros

#define BUFTAG   "[CLKBUF]"
 
#define buf_info(fmt, arg ...)
 
#define _buf_clrset32_impl(addr, clear, set)    buf_write(addr, (buf_read(addr) & ~((uint32_t)(clear))) | (set))
 
#define BUF_SET_FIELDS(addr, ...)    _BF_IMPL(_buf_clrset32_impl, addr, __VA_ARGS__)
 
#define BUF_READ_FIELD(addr, name)    EXTRACT_BITFIELD(buf_read(addr), name)
 
#define PMIC_CW00_INIT_VAL   0x4005 /* 0100 0000 0000 0101 */
 
#define PMIC_CW09_INIT_VAL   0x01F0 /* 0000 0001 1111 0000 */
 

Functions

static u32 buf_read (u32 addr)
 
static void buf_write (u32 addr, u32 wdata)
 
static void dump_clkbuf_log (void)
 
int clk_buf_init (void)
 

Variables

static struct pmifpmif_arb
 

Macro Definition Documentation

◆ _buf_clrset32_impl

#define _buf_clrset32_impl (   addr,
  clear,
  set 
)     buf_write(addr, (buf_read(addr) & ~((uint32_t)(clear))) | (set))

Definition at line 16 of file clkbuf.c.

◆ buf_info

#define buf_info (   fmt,
  arg ... 
)
Value:
printk(BIOS_INFO, BUFTAG "%s,%d: " fmt, \
__func__, __LINE__, ## arg)
#define BUFTAG
Definition: clkbuf.c:12
#define printk(level,...)
Definition: stdlib.h:16
struct bootblock_arg arg
Definition: decompressor.c:22
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113

Definition at line 13 of file clkbuf.c.

◆ BUF_READ_FIELD

#define BUF_READ_FIELD (   addr,
  name 
)     EXTRACT_BITFIELD(buf_read(addr), name)

Definition at line 21 of file clkbuf.c.

◆ BUF_SET_FIELDS

#define BUF_SET_FIELDS (   addr,
  ... 
)     _BF_IMPL(_buf_clrset32_impl, addr, __VA_ARGS__)

Definition at line 19 of file clkbuf.c.

◆ BUFTAG

#define BUFTAG   "[CLKBUF]"

Definition at line 12 of file clkbuf.c.

◆ PMIC_CW00_INIT_VAL

#define PMIC_CW00_INIT_VAL   0x4005 /* 0100 0000 0000 0101 */

Definition at line 24 of file clkbuf.c.

◆ PMIC_CW09_INIT_VAL

#define PMIC_CW09_INIT_VAL   0x01F0 /* 0000 0001 1111 0000 */

Definition at line 25 of file clkbuf.c.

Function Documentation

◆ buf_read()

static u32 buf_read ( u32  addr)
static

Definition at line 29 of file clkbuf.c.

References addr, get_pmif_controller(), NULL, pmif_arb, PMIF_SPI, and pmif::read.

Here is the call graph for this function:

◆ buf_write()

static void buf_write ( u32  addr,
u32  wdata 
)
static

Definition at line 40 of file clkbuf.c.

References addr, get_pmif_controller(), NULL, pmif_arb, PMIF_SPI, and pmif::write.

Here is the call graph for this function:

◆ clk_buf_init()

◆ dump_clkbuf_log()

Variable Documentation

◆ pmif_arb

struct pmif* pmif_arb
static