1 /* SPDX-License-Identifier: GPL-2.0+ */ 2 /* 3 * Copyright 2025 Gateworks Corporation 4 */ 5 6 #ifndef _FSA_H_ 7 #define _FSA_H_ 8 9 #define FSA_MAX 5 10 11 enum fsa_gpio_cfg { 12 FSA_GPIO_NC, 13 FSA_GPIO_UNCONFIGURED, 14 FSA_GPIO_INPUT, 15 FSA_GPIO_OUTPUT_LOW, 16 FSA_GPIO_OUTPUT_HIGH, 17 }; 18 19 struct fsa_gpio_desc { 20 u8 offset; 21 u8 config; 22 u8 source; 23 char name[13]; 24 }; 25 26 struct fsa_board_info { 27 char model[16]; /* 0x00: model string */ 28 u8 mac[6]; /* 0x10: MAC base */ 29 u8 macno; /* 0x16: number of mac addrs */ 30 u8 resv1; /* 0x17: reserved */ 31 u32 serial; /* 0x18: Serial Number */ 32 u8 mfgdate[4]; /* 0x1c: MFG date */ 33 u8 sockgpios; /* 0x20: number of socket gpio descriptors */ 34 u8 ioexpgpios; /* 0x21: number of io expander gpio descriptors */ 35 u8 resv2[220]; /* 0x22: reserved */ 36 u8 chksum[2]; /* 0xfe: */ 37 }; 38 39 struct fsa_user_info { 40 char desc[32]; /* 0x000: user description */ 41 char overlay[16]; /* 0x020: dt-overlay suffice */ 42 struct fsa_gpio_desc gpios[20]; /* 0x030: gpio descriptors */ 43 u8 reserved[398]; /* 0x170: reserved */ 44 u8 chksum[2]; /* 0x2fe: */ 45 }; 46 47 int fsa_init(void); 48 int fsa_show(void); 49 int fsa_ft_fixup(void *fdt); 50 51 #endif // _FSA_H_ 52