OpenBIC
OpenSource Bridge-IC
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <zephyr.h>
#include <logging/log.h>
#include <sys/slist.h>
#include "libutil.h"
#include "plat_i2c.h"
#include "clock_shell.h"
Classes | |
struct | _clock_default_info |
Macros | |
#define | CLK_GEN_312M_ADDR (0x12 >> 1) |
#define | CLK_GEN_100M_ADDR (0xD0 >> 1) |
#define | CLK_BUF_U471_ADDR (0xCE >> 1) |
#define | CLK_BUF_U519_ADDR (0xD8 >> 1) |
#define | CLK_GEN_312M_SW_RESET_OFFSET 0x0C |
#define | CLK_GEN_312M_LOSMON_0_STS_OFFSET 0x30 |
#define | CLK_GEN_312M_LOSMON_1_STS_OFFSET 0x40 |
#define | CLK_GEN_312M_LOSMON_2_STS_OFFSET 0x50 |
#define | CLK_GEN_312M_ACTMON_0_STS_OFFSET 0x60 |
#define | CLK_GEN_312M_ACTMON_1_STS_OFFSET 0x80 |
#define | CLK_BUF_100M_WRITE_LOCK_CLEAR_LOS_EVENT_OFFSET 0x27 |
#define | CLK_GEN_312M_PAGE_REGISTER 0xFC |
#define | CLK_BUF_100M_BYTE_COUNT 0x7 |
#define | REGISTER_BYTE_MAX 4 |
Typedefs | |
typedef struct _clock_default_info | clock_default_info |
Functions | |
LOG_MODULE_REGISTER (clock_shell) | |
int | find_clock_address_and_bus_by_clock_name_index (uint8_t clock_index, uint8_t *addr, uint8_t *bus) |
int | check_clock_offset_msb (uint8_t offset_msb, uint8_t addr, uint8_t bus) |
bool | clock_enum_get (uint8_t *name, uint8_t *num) |
void | cmd_set_clock (const struct shell *shell, size_t argc, char **argv) |
void | cmd_get_clock (const struct shell *shell, size_t argc, char **argv) |
void | cmd_get_clock_status (const struct shell *shell, size_t argc, char **argv) |
void | cmd_clear_clock_status (const struct shell *shell, size_t argc, char **argv) |
bool | clock_name_get (uint8_t index, uint8_t **name) |
SHELL_DYNAMIC_CMD_CREATE (clock_name, all_clock_name_get) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_clock_cmds, SHELL_CMD_ARG(set, &clock_name, "set <clock> <reg-offset> <value>|default", cmd_set_clock, 4, 3), SHELL_CMD_ARG(get, &clock_name, "get <clock> <reg-offset> <read_length>", cmd_get_clock, 4, 0), SHELL_SUBCMD_SET_END) | |
SHELL_CMD_REGISTER (clock, &sub_clock_cmds, "Clock commands for AG", NULL) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_clock_status_cmds, SHELL_CMD_ARG(get, &clock_name, "get <clock>", cmd_get_clock_status, 2, 0), SHELL_CMD_ARG(clear, &clock_name, "clear <clock>", cmd_clear_clock_status, 2, 0), SHELL_SUBCMD_SET_END) | |
SHELL_CMD_REGISTER (clock_status, &sub_clock_status_cmds, "Clock status commands for AG", NULL) | |
Variables | |
clock_compnt_mapping | clock_compnt_mapping_table [] |
#define CLK_BUF_100M_BYTE_COUNT 0x7 |
#define CLK_BUF_100M_WRITE_LOCK_CLEAR_LOS_EVENT_OFFSET 0x27 |
#define CLK_BUF_U471_ADDR (0xCE >> 1) |
#define CLK_BUF_U519_ADDR (0xD8 >> 1) |
#define CLK_GEN_100M_ADDR (0xD0 >> 1) |
#define CLK_GEN_312M_ACTMON_0_STS_OFFSET 0x60 |
#define CLK_GEN_312M_ACTMON_1_STS_OFFSET 0x80 |
#define CLK_GEN_312M_ADDR (0x12 >> 1) |
#define CLK_GEN_312M_LOSMON_0_STS_OFFSET 0x30 |
#define CLK_GEN_312M_LOSMON_1_STS_OFFSET 0x40 |
#define CLK_GEN_312M_LOSMON_2_STS_OFFSET 0x50 |
#define CLK_GEN_312M_PAGE_REGISTER 0xFC |
#define CLK_GEN_312M_SW_RESET_OFFSET 0x0C |
#define REGISTER_BYTE_MAX 4 |
typedef struct _clock_default_info clock_default_info |
int check_clock_offset_msb | ( | uint8_t | offset_msb, |
uint8_t | addr, | ||
uint8_t | bus | ||
) |
bool clock_enum_get | ( | uint8_t * | name, |
uint8_t * | num | ||
) |
bool clock_name_get | ( | uint8_t | index, |
uint8_t ** | name | ||
) |
void cmd_clear_clock_status | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_get_clock | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_get_clock_status | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_set_clock | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
int find_clock_address_and_bus_by_clock_name_index | ( | uint8_t | clock_index, |
uint8_t * | addr, | ||
uint8_t * | bus | ||
) |
LOG_MODULE_REGISTER | ( | clock_shell | ) |
SHELL_CMD_REGISTER | ( | clock | , |
& | sub_clock_cmds, | ||
"Clock commands for AG" | , | ||
NULL | |||
) |
SHELL_CMD_REGISTER | ( | clock_status | , |
& | sub_clock_status_cmds, | ||
"Clock status commands for AG" | , | ||
NULL | |||
) |
SHELL_DYNAMIC_CMD_CREATE | ( | clock_name | , |
all_clock_name_get | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_clock_cmds | , |
SHELL_CMD_ARG(set, &clock_name, "set <clock> <reg-offset> <value>|default", cmd_set_clock, 4, 3) | , | ||
SHELL_CMD_ARG(get, &clock_name, "get <clock> <reg-offset> <read_length>", cmd_get_clock, 4, 0) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_clock_status_cmds | , |
SHELL_CMD_ARG(get, &clock_name, "get <clock>", cmd_get_clock_status, 2, 0) | , | ||
SHELL_CMD_ARG(clear, &clock_name, "clear <clock>", cmd_clear_clock_status, 2, 0) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
clock_compnt_mapping clock_compnt_mapping_table[] |