Skip to content

Commit 5487ab4

Browse files
ftang1lenb
authored andcommitted
SFI: add support for v0.81 spec
There are 2 major changes from v0.81 to v0.7: 1. Consolidating the SPIB/I2CB tables into a new DEVS table, which is more expandable and can support other bus types than spi/i2c. 2. Creating a new GPIO table, which list all the GPIO pins used in the platform. However, to avoid breaking current platforms who use SFI v0.7 version firmware, the definitions for SPIB/I2CB will still be kept for a while Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent e40152e commit 5487ab4

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

‎drivers/sfi/sfi_core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ void __init sfi_init(void)
390390
if (sfi_disabled)
391391
return;
392392

393-
pr_info("Simple Firmware Interface v0.7 http://simplefirmware.org\n");
393+
pr_info("Simple Firmware Interface v0.81 http://simplefirmware.org\n");
394394

395395
if (sfi_find_syst() || sfi_parse_syst() || sfi_platform_init())
396396
disable_sfi();

‎include/linux/sfi.h‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@
7373
#define SFI_SIG_SPIB "SPIB"
7474
#define SFI_SIG_I2CB "I2CB"
7575
#define SFI_SIG_GPEM "GPEM"
76+
#define SFI_SIG_DEVS "DEVS"
77+
#define SFI_SIG_GPIO "GPIO"
7678

7779
#define SFI_SIGNATURE_SIZE 4
7880
#define SFI_OEM_ID_SIZE 6
@@ -145,6 +147,27 @@ struct sfi_rtc_table_entry {
145147
u32 irq;
146148
} __packed;
147149

150+
struct sfi_device_table_entry {
151+
u8 type; /* bus type, I2C, SPI or ...*/
152+
#define SFI_DEV_TYPE_SPI 0
153+
#define SFI_DEV_TYPE_I2C 1
154+
#define SFI_DEV_TYPE_UART 2
155+
#define SFI_DEV_TYPE_HSI 3
156+
#define SFI_DEV_TYPE_IPC 4
157+
158+
u8 host_num; /* attached to host 0, 1...*/
159+
u16 addr;
160+
u8 irq;
161+
u32 max_freq;
162+
char name[16];
163+
} __packed;
164+
165+
struct sfi_gpio_table_entry {
166+
char controller_name[16];
167+
u16 pin_no;
168+
char pin_name[16];
169+
} __packed;
170+
148171
struct sfi_spi_table_entry {
149172
u16 host_num; /* attached to host 0, 1...*/
150173
u16 cs; /* chip select */
@@ -166,7 +189,6 @@ struct sfi_gpe_table_entry {
166189
u16 phys_id; /* physical GPE id */
167190
} __packed;
168191

169-
170192
typedef int (*sfi_table_handler) (struct sfi_table_header *table);
171193

172194
#ifdef CONFIG_SFI

0 commit comments

Comments
 (0)