mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-12-20 08:52:12 +01:00
The Gateworks Flexible Socket Adapters adapt common busses such as SDIO/UART/USB/PCI to various connectors such as M.2 B-Key, M.2 E-Key, M.2 M-Key, and MiniPCIe. Each FSA has an EEPROM onboard describing its details as well as an optional port-expander for configurable GPIO's. Add support for identifying the FSA's and configuring their details such as user description and GPIO's: - enable pca953x, pca954x and eeprom support for communicating with the I2C eeprom and gpio port expander on the FSA - add FSA detection support - add FSA gpio configuration support Each FSA is identified in the device-tree by an alias to it's I2C bus where an eeprom@54 node must exist as well as an gpio@20 node for an io-expander. These nodes must be enabled so that they can be probed to determine if they are actually present in the system. If not present or not enabled the gpio expander can not be used. This also requires livetree as the gpio expander node if not present must be disabled. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
52 lines
1.1 KiB
C
52 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* Copyright 2025 Gateworks Corporation
|
|
*/
|
|
|
|
#ifndef _FSA_H_
|
|
#define _FSA_H_
|
|
|
|
#define FSA_MAX 5
|
|
|
|
enum fsa_gpio_cfg {
|
|
FSA_GPIO_NC,
|
|
FSA_GPIO_UNCONFIGURED,
|
|
FSA_GPIO_INPUT,
|
|
FSA_GPIO_OUTPUT_LOW,
|
|
FSA_GPIO_OUTPUT_HIGH,
|
|
};
|
|
|
|
struct fsa_gpio_desc {
|
|
u8 offset;
|
|
u8 config;
|
|
u8 source;
|
|
char name[13];
|
|
};
|
|
|
|
struct fsa_board_info {
|
|
char model[16]; /* 0x00: model string */
|
|
u8 mac[6]; /* 0x10: MAC base */
|
|
u8 macno; /* 0x16: number of mac addrs */
|
|
u8 resv1; /* 0x17: reserved */
|
|
u32 serial; /* 0x18: Serial Number */
|
|
u8 mfgdate[4]; /* 0x1c: MFG date */
|
|
u8 sockgpios; /* 0x20: number of socket gpio descriptors */
|
|
u8 ioexpgpios; /* 0x21: number of io expander gpio descriptors */
|
|
u8 resv2[220]; /* 0x22: reserved */
|
|
u8 chksum[2]; /* 0xfe: */
|
|
};
|
|
|
|
struct fsa_user_info {
|
|
char desc[32]; /* 0x000: user description */
|
|
char overlay[16]; /* 0x020: dt-overlay suffice */
|
|
struct fsa_gpio_desc gpios[20]; /* 0x030: gpio descriptors */
|
|
u8 reserved[398]; /* 0x170: reserved */
|
|
u8 chksum[2]; /* 0x2fe: */
|
|
};
|
|
|
|
int fsa_init(void);
|
|
int fsa_show(void);
|
|
int fsa_ft_fixup(void *fdt);
|
|
|
|
#endif // _FSA_H_
|