Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/ti/clk/clock_common.h
Show All 24 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
struct clock_cell_info { | struct parent_lookup_table { | ||||
cell_t *clock_cells; | const char *node_name; | ||||
uint8_t *clock_cells_ncells; | int parent_cnt; | ||||
uint32_t num_clock_cells; | const char **parent_names; | ||||
uint8_t num_real_clocks; | |||||
}; | }; | ||||
void read_clock_cells(device_t dev, struct clock_cell_info *clk); | /* sub clock types */ | ||||
int find_parent_clock_names(device_t dev, struct clock_cell_info *clk, struct clknode_init_def *def); | #define TI_CLKCTRL_GATE 0x3 | ||||
void create_clkdef(device_t dev, struct clock_cell_info *clk, struct clknode_init_def *def); | #define TI_CLKCTRL_MUX 0x2 | ||||
void free_clkdef(struct clknode_init_def *def); | #define TI_CLKCTRL_DIVIDER 0x1 | ||||
#define TI_CLKCTRL_NO_SUB_CLOCK 0x0 | |||||
struct ti_clkctrl_lookup_table { | |||||
const char *node_name; | |||||
uint8_t clk_type; | |||||
/* clk_gate/mux/div_def */ | |||||
uint32_t shift; | |||||
uint32_t mask; | |||||
uint8_t flags; | |||||
uint32_t offset; | |||||
/* clknode_init_def */ | |||||
int id_subclock; /* id = offset + id_subclock */ | |||||
int parent_cnt; | |||||
const char **parents; | |||||
}; | |||||
/* From rk3399_cru.c & rk_cru.c */ | |||||
#define PLIST(x) static const char *x[] | |||||
#define LINK(_name) \ | |||||
{ \ | |||||
.clkdef.id = 0, \ | |||||
.clkdef.name = _name, \ | |||||
.clkdef.parent_names = NULL, \ | |||||
.clkdef.parent_cnt = 0, \ | |||||
.clkdef.flags = CLK_NODE_STATIC_STRINGS, \ | |||||
} |