OpenBIC
OpenSource Bridge-IC
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
p3h284x.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 P3H284X_H
18#define P3H284X_H
19
20#include "hal_i2c.h"
21#include "hal_i3c.h"
22
23#define P3H284X_DEFAULT_STATIC_ADDRESS 0x70
24
25// P3H2840 Device setting
26#define P3H2840_DEVICE_INFO 0x1530
27#define P3H2840_I3C_LDO_VOLT 0x0A // 1.2V
28#define P3H2840_I2C_MODE 0
29#define P3H2840_BYPASS_MODE 1
30
31#define P3H284X_DEVICE_INFO0_REG 0x0
32#define P3H284X_DEVICE_INFO1_REG 0x1
33#define P3H284X_PROTECTION_REG 0x10
34#define P3H284X_CONTROLLER_PORT_CONFIG 0x11
35#define P3H284X_TARGET_PORT_ENABLE 0x12
36#define P3H284X_HUB_NETWORK_OPERATION_MODE 0x15
37#define P3H284X_VOLT_LDO_SETTING 0x16
38#define P3H284X_TARGET_PORTS_MODE_SETTING 0x17
39#define P3H284X_TARGET_PORTS_AGENT_ENABLE 0x18
40#define P3H284X_TARGET_PORTS_PULLUP_SETTING 0x19
41#define P3H284X_TARGET_PORTS_GPIO_ENABLE 0x1E
42#define P3H284X_TARGET_PORTSHUB_NETWORK_CONNECTION 0x51
43#define P3H284X_BYPASS_MODE_ENABLE 0x52
44#define P3H284X_TARGET_PORTS_PULLUP_ENABLE 0x53
45
46/* 0x10 : Unlock Device Configuration Protection Code */
47#define P3H284X_PROTECTION_LOCK 0x00
48#define P3H284X_PROTECTION_UNLOCK 0x69
49
50/* 0x15 : Master Side Port Configuration */
51#define P3H284X_HUB_NETWORK_ALWAYS_I3C 5
52
53/* 0x16 : Interface Voltage LDO Setting */
54#define TP_VCCIO1_OFFSET 6
55#define TP_VCCIO0_OFFSET 4
56#define CP1_OFFSET 2
57#define CP0_OFFSET 0
58
59/* 0x17 : Master Side Port Configuration */
60#define CP_OD_ONLY 4
61
62/* 0x19 : Pull-up Resistor Value */
63#define TARGET_PORTS_VCCIO0_PULLUP_OFFSET 6
64#define TARGET_PORTS_VCCIO1_PULLUP_OFFSET 4
65
66#define P3H284X_SSPORTS_ALL_DISCONNECT 0x00
67
73};
74
80};
81
82bool p3h284x_i2c_mode_only_init(uint8_t bus, uint8_t slave_port, uint8_t ldo_volt,
83 uint8_t pullup_resistor, uint8_t mode);
84bool p3h284x_select_slave_port_connect(uint8_t bus, uint8_t slave_port);
85bool p3h284x_i3c_mode_only_init(I3C_MSG *i3c_msg, uint8_t ldo_volt);
86bool p3h284x_set_slave_port(uint8_t bus, uint8_t addr, uint8_t setting);
87bool p3h284x_get_device_info(uint8_t bus, uint16_t *i3c_hub_type);
88bool p3h284x_get_device_info_i3c(uint8_t bus, uint16_t *i3c_hub_type);
89
90#endif
uint8_t addr
Definition: isl69259.c:0
bool p3h284x_i3c_mode_only_init(I3C_MSG *i3c_msg, uint8_t ldo_volt)
Definition: p3h284x.c:234
p3g284x_ldo_volt
Definition: p3h284x.h:68
@ p3g284x_ldo_1_8_volt
Definition: p3h284x.h:72
@ p3g284x_ldo_1_1_volt
Definition: p3h284x.h:70
@ p3g284x_ldo_1_2_volt
Definition: p3h284x.h:71
@ p3g284x_ldo_1_0_volt
Definition: p3h284x.h:69
bool p3h284x_get_device_info(uint8_t bus, uint16_t *i3c_hub_type)
Definition: p3h284x.c:115
bool p3h284x_get_device_info_i3c(uint8_t bus, uint16_t *i3c_hub_type)
Definition: p3h284x.c:129
p3g284x_pull_up_resistor
Definition: p3h284x.h:75
@ p3g284x_pullup_1k_ohm
Definition: p3h284x.h:78
@ p3g284x_pullup_250_ohm
Definition: p3h284x.h:76
@ p3g284x_pullup_2k_ohm
Definition: p3h284x.h:79
@ p3g284x_pullup_500_ohm
Definition: p3h284x.h:77
bool p3h284x_set_slave_port(uint8_t bus, uint8_t addr, uint8_t setting)
Definition: p3h284x.c:289
bool p3h284x_select_slave_port_connect(uint8_t bus, uint8_t slave_port)
Definition: p3h284x.c:106
bool p3h284x_i2c_mode_only_init(uint8_t bus, uint8_t slave_port, uint8_t ldo_volt, uint8_t pullup_resistor, uint8_t mode)
Definition: p3h284x.c:143
uint8_t mode
Definition: plat_ncsi.h:5
Definition: hal_i3c.h:105