![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <console/console.h>
#include <device/mmio.h>
#include <types.h>
#include <commonlib/helpers.h>
#include <soc/clock.h>
Go to the source code of this file.
Macros | |
#define | DIV(div) (div ? (2*div - 1) : 0) |
#define | HALF_DIVIDER(div2x) (div2x ? (div2x - 1) : 0) |
Functions | |
static int | clock_configure_gpll0 (void) |
static int | clock_configure_mnd (struct qcs405_clock *clk, uint32_t m, uint32_t n, uint32_t d_2) |
static int | clock_configure (struct qcs405_clock *clk, struct clock_config *clk_cfg, uint32_t hz, uint32_t num_perfs) |
static bool | clock_is_off (void *cbcr_addr) |
static int | clock_enable_vote (void *cbcr_addr, void *vote_addr, uint32_t vote_bit) |
static int | clock_enable (void *cbcr_addr) |
static int | clock_disable (void *cbcr_addr) |
int | clock_reset_bcr (void *bcr_addr, bool reset) |
void | clock_configure_uart (uint32_t hz) |
void | clock_configure_spi (int blsp, int qup, uint32_t hz) |
void | clock_configure_i2c (uint32_t hz) |
void | clock_enable_uart (void) |
void | clock_disable_uart (void) |
void | clock_enable_spi (int blsp, int qup) |
void | clock_disable_spi (int blsp, int qup) |
void | clock_enable_i2c (void) |
void | clock_disable_i2c (void) |
void | clock_init (void) |
Variables | |
struct clock_config | uart_cfg [] |
struct clock_config | i2c_cfg [] |
struct clock_config | spi_cfg [] |
|
static |
Definition at line 112 of file clock.c.
References BIT, qcs405_rcg::cfg, CLK_CTL_CFG_SRC_DIV_SHFT, CLK_CTL_CFG_SRC_SEL_SHFT, CLK_CTL_CMD_UPDATE_SHFT, clock_configure_mnd(), qcs405_rcg::cmd, clock_config::d_2, clock_config::div, clock_config::hz, m, clock_config::n, qcs405_clock::rcg, setbits32, clock_config::src, and write32().
|
static |
Definition at line 83 of file clock.c.
References CLK_CTL_GPLL_PLLOUT_AUX2_SHFT, CLK_CTL_GPLL_PLLOUT_AUX_SHFT, CLK_CTL_GPLL_PLLOUT_LV_EARLY_SHFT, CLK_CTL_GPLL_PLLOUT_MAIN_SHFT, gcc, qcs405_gcc::gpll0, setbits32, and qcs405_gpll::user_ctl.
Referenced by clock_init().
Definition at line 238 of file clock.c.
References ARRAY_SIZE, qcs405_gcc::blsp1_qup1_i2c_clk, clock_configure(), gcc, and i2c_cfg.
Referenced by blsp_i2c_init().
|
static |
Definition at line 94 of file clock.c.
References qcs405_rcg::cfg, CLK_CTL_CFG_MODE_SHFT, CLK_CTL_RCG_MND_BMSK, qcs405_clock::d_2, clock_config::d_2, m, qcs405_clock::m, qcs405_clock::n, clock_config::n, qcs405_clock::rcg, read32(), and write32().
Referenced by clock_configure().
Definition at line 198 of file clock.c.
References ARRAY_SIZE, BIOS_ERR, qcs405_gcc::blsp1_qup0_spi_clk, qcs405_gcc::blsp1_qup1_spi_clk, qcs405_gcc::blsp1_qup2_spi_clk, qcs405_gcc::blsp1_qup3_spi_clk, qcs405_gcc::blsp1_qup4_spi_clk, qcs405_gcc::blsp2_qup0_spi_clk, clock_configure(), gcc, and printk.
Referenced by spi_ctrlr_setup().
Definition at line 190 of file clock.c.
References ARRAY_SIZE, qcs405_gcc::blsp1_uart2_apps_clk, clock_configure(), gcc, and uart_cfg.
Referenced by uart_init().
|
static |
Definition at line 170 of file clock.c.
References BIT, CLK_CTL_CBC_CLK_EN_SHFT, and clrbits32.
Referenced by clock_disable_i2c(), and clock_disable_uart().
Definition at line 314 of file clock.c.
References qcs405_gcc::blsp1_qup1_i2c_apps_cbcr, clock_disable(), and gcc.
void clock_disable_spi | ( | int | blsp, |
int | qup | ||
) |
Definition at line 282 of file clock.c.
References BIOS_ERR, qcs405_gcc::blsp1_qup0_spi_apps_cbcr, qcs405_gcc::blsp1_qup1_spi_apps_cbcr, qcs405_gcc::blsp1_qup2_spi_apps_cbcr, qcs405_gcc::blsp1_qup3_spi_apps_cbcr, qcs405_gcc::blsp1_qup4_spi_apps_cbcr, qcs405_gcc::blsp2_qup0_spi_apps_cbcr, clock_enable(), gcc, and printk.
Definition at line 251 of file clock.c.
References qcs405_gcc::blsp1_uart2_apps_cbcr, clock_disable(), and gcc.
|
static |
Definition at line 157 of file clock.c.
References BIT, CLK_CTL_CBC_CLK_EN_SHFT, clock_is_off(), and setbits32.
Definition at line 309 of file clock.c.
References qcs405_gcc::blsp1_qup1_i2c_apps_cbcr, clock_enable(), and gcc.
Referenced by blsp_i2c_init().
void clock_enable_spi | ( | int | blsp, |
int | qup | ||
) |
Definition at line 256 of file clock.c.
References BIOS_ERR, qcs405_gcc::blsp1_qup0_spi_apps_cbcr, qcs405_gcc::blsp1_qup1_spi_apps_cbcr, qcs405_gcc::blsp1_qup2_spi_apps_cbcr, qcs405_gcc::blsp1_qup3_spi_apps_cbcr, qcs405_gcc::blsp1_qup4_spi_apps_cbcr, qcs405_gcc::blsp2_qup0_spi_apps_cbcr, clock_enable(), gcc, and printk.
Referenced by spi_ctrlr_setup().
Definition at line 246 of file clock.c.
References qcs405_gcc::blsp1_uart2_apps_cbcr, clock_enable(), and gcc.
Referenced by uart_init().
Definition at line 144 of file clock.c.
References BIT, clock_is_off(), and setbits32.
Definition at line 319 of file clock.c.
References qcs405_gcc::blsp1_ahb_cbcr, BLSP1_AHB_CLK_ENA, qcs405_gcc::blsp2_ahb_cbcr, BLSP2_AHB_CLK_ENA, clock_configure_gpll0(), clock_enable_vote(), gcc, and qcs405_gcc::gcc_apcs_clock_branch_en_vote.
Definition at line 139 of file clock.c.
References CLK_CTL_CBC_CLK_OFF_BMSK, and read32().
Referenced by clock_enable(), and clock_enable_vote().
Definition at line 178 of file clock.c.
References qcs405_bcr::bcr, BIT, CLK_CTL_BCR_BLK_ARES_SHFT, clrbits32, reset(), and setbits32.
struct clock_config i2c_cfg[] |
Definition at line 1 of file clock.c.
Referenced by clock_configure_i2c().
struct clock_config spi_cfg[] |
struct clock_config uart_cfg[] |
Definition at line 1 of file clock.c.
Referenced by clock_configure_uart().