Skip to content

Commit

Permalink
SFI: add support for v0.81 spec
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
  • Loading branch information
ftang1 authored and lenb committed May 25, 2010
1 parent e40152e commit 5487ab4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/sfi/sfi_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void __init sfi_init(void)
if (sfi_disabled)
return;

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

if (sfi_find_syst() || sfi_parse_syst() || sfi_platform_init())
disable_sfi();
Expand Down
24 changes: 23 additions & 1 deletion include/linux/sfi.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
#define SFI_SIG_SPIB "SPIB"
#define SFI_SIG_I2CB "I2CB"
#define SFI_SIG_GPEM "GPEM"
#define SFI_SIG_DEVS "DEVS"
#define SFI_SIG_GPIO "GPIO"

#define SFI_SIGNATURE_SIZE 4
#define SFI_OEM_ID_SIZE 6
Expand Down Expand Up @@ -145,6 +147,27 @@ struct sfi_rtc_table_entry {
u32 irq;
} __packed;

struct sfi_device_table_entry {
u8 type; /* bus type, I2C, SPI or ...*/
#define SFI_DEV_TYPE_SPI 0
#define SFI_DEV_TYPE_I2C 1
#define SFI_DEV_TYPE_UART 2
#define SFI_DEV_TYPE_HSI 3
#define SFI_DEV_TYPE_IPC 4

u8 host_num; /* attached to host 0, 1...*/
u16 addr;
u8 irq;
u32 max_freq;
char name[16];
} __packed;

struct sfi_gpio_table_entry {
char controller_name[16];
u16 pin_no;
char pin_name[16];
} __packed;

struct sfi_spi_table_entry {
u16 host_num; /* attached to host 0, 1...*/
u16 cs; /* chip select */
Expand All @@ -166,7 +189,6 @@ struct sfi_gpe_table_entry {
u16 phys_id; /* physical GPE id */
} __packed;


typedef int (*sfi_table_handler) (struct sfi_table_header *table);

#ifdef CONFIG_SFI
Expand Down

0 comments on commit 5487ab4

Please sign in to comment.