OpenBIC
OpenSource Bridge-IC
shell_clock.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#include <shell/shell.h>
17#ifndef PLAT_CLOCK_H
18#define PLAT_CLOCK_H
19
20#define CLK_BUF_U85_ADDR (0xCE >> 1)
21#define CLK_BUF_U690_ADDR (0xD8 >> 1)
22#define CLK_BUF_U88_ADDR (0xDE >> 1)
23#define CLK_GEN_100M_U86_ADDR 0x9
24
25#define CLK_BUF_100M_WRITE_LOCK_CLEAR_LOS_EVENT_OFFSET 0x27
26#define CLK_GEN_LOSMON_EVENT_OFFSET 0x5a
27#define CLK_BUF_100M_BYTE_COUNT 0x7
28#define CLK_DEFAULT_BYTE_VALUE 0x00
29#define REGISTER_BYTE_MAX 4
30
37};
38
39typedef struct clock_compnt_mapping {
40 uint8_t clock_name_index;
41 uint8_t addr;
42 uint8_t bus;
43 uint8_t *clock_name;
45
46typedef struct _clock_default_info {
47 sys_snode_t node;
48 bool is_default;
49 uint8_t clock_index;
50 uint8_t value[REGISTER_BYTE_MAX];
51 uint8_t write_length;
52 uint16_t offset;
54
56 { CLK_BUF_100M_U85, CLK_BUF_U85_ADDR, I2C_BUS1, "CLK_BUF_100M_U85" },
57 { CLK_BUF_100M_U690, CLK_BUF_U690_ADDR, I2C_BUS1, "CLK_BUF_100M_U690" },
58 { CLK_BUF_100M_U88, CLK_BUF_U88_ADDR, I2C_BUS3, "CLK_BUF_100M_U88" },
59 { CLK_GEN_100M_U86, CLK_GEN_100M_U86_ADDR, I2C_BUS3, "CLK_GEN_100M_U86" },
60};
#define I2C_BUS3
Definition: plat_i2c.h:26
#define I2C_BUS1
Definition: plat_i2c.h:24
CLOCK_COMPONENT
Definition: clock_shell.h:22
struct clock_compnt_mapping clock_compnt_mapping
#define CLK_BUF_U85_ADDR
Definition: shell_clock.h:20
clock_compnt_mapping clock_compnt_mapping_table[]
Definition: shell_clock.h:55
#define CLK_GEN_100M_U86_ADDR
Definition: shell_clock.h:23
#define CLK_BUF_U88_ADDR
Definition: shell_clock.h:22
#define CLK_BUF_U690_ADDR
Definition: shell_clock.h:21
@ CLK_BUF_100M_U88
Definition: shell_clock.h:34
@ CLK_BUF_100M_U85
Definition: shell_clock.h:32
@ CLK_COMPONENT_MAX
Definition: shell_clock.h:36
@ CLK_BUF_100M_U690
Definition: shell_clock.h:33
@ CLK_GEN_100M_U86
Definition: shell_clock.h:35
#define REGISTER_BYTE_MAX
Definition: shell_clock.h:29
struct _clock_default_info clock_default_info
Definition: clock_shell.c:44
sys_snode_t node
Definition: clock_shell.c:45
bool is_default
Definition: clock_shell.c:46
uint8_t value[REGISTER_BYTE_MAX]
Definition: clock_shell.c:48
uint16_t offset
Definition: clock_shell.c:50
uint8_t clock_index
Definition: clock_shell.c:47
uint8_t write_length
Definition: clock_shell.c:49
Definition: clock_shell.h:30
uint8_t clock_name_index
Definition: clock_shell.h:31
uint8_t addr
Definition: clock_shell.h:32
uint8_t bus
Definition: clock_shell.h:33
uint8_t * clock_name
Definition: clock_shell.h:34