OpenBIC
OpenSource Bridge-IC
plat_ioexp.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 PLAT_IOEXP_H
18#define PLAT_IOEXP_H
19
20#define PCA6414A_INPUT_PORT_0 0x00
21#define PCA6414A_INPUT_PORT_1 0x01
22#define PCA6414A_OUTPUT_PORT_0 0x02
23#define PCA6414A_OUTPUT_PORT_1 0x03
24#define PCA6414A_CONFIG_0 0x06
25#define PCA6414A_CONFIG_1 0x07
26
27#define TCA6424A_INPUT_PORT_0 0x00
28#define TCA6424A_INPUT_PORT_1 0x01
29#define TCA6424A_INPUT_PORT_2 0x02
30#define TCA6424A_OUTPUT_PORT_0 0x04
31#define TCA6424A_OUTPUT_PORT_1 0x05
32#define TCA6424A_OUTPUT_PORT_2 0x06
33#define TCA6424A_CONFIG_0 0x0C
34#define TCA6424A_CONFIG_1 0x0D
35#define TCA6424A_CONFIG_2 0x0E
36#define U200052_IO_ADDR 0x3A
37#define U200070_IO_ADDR 0x3C
38#define U200052_IO_I2C_BUS I2C_BUS1
39#define U200051_IO_I2C_BUS I2C_BUS1
40#define U200070_IO_I2C_BUS I2C_BUS1
41
42#define HAMSA_MFIO19 1
43
44bool pca6416a_i2c_read(uint8_t offset, uint8_t *data, uint8_t len);
45bool pca6416a_i2c_write(uint8_t offset, uint8_t *data, uint8_t len);
46bool tca6424a_i2c_read(uint8_t offset, uint8_t *data, uint8_t len);
47bool tca6424a_i2c_write(uint8_t offset, uint8_t *data, uint8_t len);
48bool tca6424a_i2c_write_bit(uint8_t offset, uint8_t bit, uint8_t val);
49void ioexp_init(void);
50void init_U200052_IO();
51void set_pca6554apw_ioe_value(uint8_t ioe_bus, uint8_t ioe_addr, uint8_t ioe_reg, uint8_t value);
52int get_pca6554apw_ioe_value(uint8_t ioe_bus, uint8_t ioe_addr, uint8_t ioe_reg, uint8_t *value);
53
54#endif
uint32_t val
Definition: plat_util.c:43
uint8_t data[]
Definition: isl69259.c:2
bool tca6424a_i2c_write(uint8_t offset, uint8_t *data, uint8_t len)
Definition: plat_ioexp.c:44
bool pca6416a_i2c_write(uint8_t offset, uint8_t *data, uint8_t len)
Definition: plat_ioexp.c:24
void set_pca6554apw_ioe_value(uint8_t ioe_bus, uint8_t ioe_addr, uint8_t ioe_reg, uint8_t value)
Definition: plat_ioexp.c:97
bool tca6424a_i2c_write_bit(uint8_t offset, uint8_t bit, uint8_t val)
Definition: plat_ioexp.c:49
void ioexp_init(void)
Definition: plat_ioexp.c:87
bool pca6416a_i2c_read(uint8_t offset, uint8_t *data, uint8_t len)
Definition: plat_ioexp.c:19
bool tca6424a_i2c_read(uint8_t offset, uint8_t *data, uint8_t len)
Definition: plat_ioexp.c:39
int get_pca6554apw_ioe_value(uint8_t ioe_bus, uint8_t ioe_addr, uint8_t ioe_reg, uint8_t *value)
Definition: plat_ioexp.c:116
void init_U200052_IO()
Definition: plat_ioexp.c:142
uint32_t offset
Definition: pldm_firmware_update.h:0