OpenBIC
OpenSource Bridge-IC
rg3mxxb12.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
17#ifndef RG3MXXB12_H
18#define RG3MXXB12_H
19
20#include "hal_i2c.h"
21#include "hal_i3c.h"
22
23#define V_LDO_SETTING(vios1, vios0, viom1, viom0) \
24 ((vios1 << VIOS1_OFFSET) | (vios0 << VIOS0_OFFSET) | (viom1 << VIOM1_OFFSET) | \
25 (viom0 << VIOM0_OFFSET))
26
27#define RG3MXXB12_DEFAULT_STATIC_ADDRESS 0x70
28#define RG3M87B12_DEVICE_INFO 0x1287
29#define RG3M88B12_DEVICE_INFO 0x1288
30#define RG3M47B12_DEVICE_INFO 0x1247
31#define RG3M4812_DEVICE_INFO 0x1248
32
33#define RG3MXXB12_DEVICE_INFO0_REG 0x0
34#define RG3MXXB12_DEVICE_INFO1_REG 0x1
35#define RG3MXXB12_PROTECTION_REG 0x10
36#define RG3MXXB12_MASTER_PORT_CONFIG 0x11
37#define RG3MXXB12_SLAVE_PORT_ENABLE 0x12
38#define RG3MXXB12_HUB_NETWORK_OPERATION_MODE 0x15
39#define RG3MXXB12_VOLT_LDO_SETTING 0x16
40#define RG3MXXB12_SSPORTS_OD_ONLY 0x17
41#define RG3MXXB12_SSPORTS_AGENT_ENABLE 0x18
42#define RG3MXXB12_SSPORTS_PULLUP_SETTING 0x19
43#define RG3MXXB12_SSPORTS_GPIO_ENABLE 0x1E
44#define RG3MXXB12_SSPORTS_HUB_NETWORK_CONNECTION 0x51
45#define RG3MXXB12_SSPORTS_PULLUP_ENABLE 0x53
46
47/* 0x10 : Unlock Device Configuration Protection Code */
48#define RG3MXXB12_PROTECTION_LOCK 0x00
49#define RG3MXXB12_PROTECTION_UNLOCK 0x69
50
51/* 0x15 : Master Side Port Configuration */
52#define RG3MXXB12_HUB_NETWORK_ALWAYS_I3C 5
53
54/* 0x16 : Interface Voltage LDO Setting */
55#define VIOS1_OFFSET 6
56#define VIOS0_OFFSET 4
57#define VIOM1_OFFSET 2
58#define VIOM0_OFFSET 0
59
60/* 0x11 : Master Side Port Configuration */
61#define MPORT_OD_ONLY 4
62
63/* 0x19 : Pull-up Resistor Value */
64#define SSPORTS_RESISTOR0_OFFSET 6
65#define SSPORTS_RESISTOR1_OFFSET 4
66
67#define RG3MXXB12_SSPORTS_ALL_DISCONNECT 0x00
68
74};
75
81};
82
83bool rg3mxxb12_i2c_mode_only_init(uint8_t bus, uint8_t slave_port, uint8_t ldo_volt,
84 uint8_t pullup_resistor);
85bool rg3mxxb12_select_slave_port_connect(uint8_t bus, uint8_t slave_port);
86bool rg3mxxb12_i3c_mode_only_init(I3C_MSG *i3c_msg, uint8_t ldo_volt);
87bool rg3mxxb12_set_slave_port(uint8_t bus, uint8_t addr, uint8_t setting);
88bool rg3mxxb12_get_device_info(uint8_t bus, uint16_t *i3c_hub_type);
89bool rg3mxxb12_get_device_info_i3c(uint8_t bus, uint16_t *i3c_hub_type);
90
91#endif
uint8_t addr
Definition: isl69259.c:0
bool rg3mxxb12_get_device_info_i3c(uint8_t bus, uint16_t *i3c_hub_type)
Definition: rg3mxxb12.c:129
rg3mxxb12_pull_up_resistor
Definition: rg3mxxb12.h:76
@ rg3mxxb12_pullup_500_ohm
Definition: rg3mxxb12.h:78
@ rg3mxxb12_pullup_1k_ohm
Definition: rg3mxxb12.h:79
@ rg3mxxb12_pullup_250_ohm
Definition: rg3mxxb12.h:77
@ rg3mxxb12_pullup_2k_ohm
Definition: rg3mxxb12.h:80
bool rg3mxxb12_i2c_mode_only_init(uint8_t bus, uint8_t slave_port, uint8_t ldo_volt, uint8_t pullup_resistor)
Definition: rg3mxxb12.c:143
bool rg3mxxb12_set_slave_port(uint8_t bus, uint8_t addr, uint8_t setting)
Definition: rg3mxxb12.c:285
bool rg3mxxb12_i3c_mode_only_init(I3C_MSG *i3c_msg, uint8_t ldo_volt)
Definition: rg3mxxb12.c:233
bool rg3mxxb12_select_slave_port_connect(uint8_t bus, uint8_t slave_port)
Definition: rg3mxxb12.c:106
bool rg3mxxb12_get_device_info(uint8_t bus, uint16_t *i3c_hub_type)
Definition: rg3mxxb12.c:115
rg3mxxb12_ldo_volt
Definition: rg3mxxb12.h:69
@ rg3mxxb12_ldo_1_1_volt
Definition: rg3mxxb12.h:71
@ rg3mxxb12_ldo_1_2_volt
Definition: rg3mxxb12.h:72
@ rg3mxxb12_ldo_1_0_volt
Definition: rg3mxxb12.h:70
@ rg3mxxb12_ldo_1_8_volt
Definition: rg3mxxb12.h:73
Definition: hal_i3c.h:105