diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clock.h | 3 | ||||
-rw-r--r-- | include/console_countdown.h | 2 | ||||
-rw-r--r-- | include/efi.h | 45 | ||||
-rw-r--r-- | include/efi/debug_ll.h | 20 | ||||
-rw-r--r-- | include/efi/efi-device.h | 45 | ||||
-rw-r--r-- | include/efi/efi.h | 26 | ||||
-rw-r--r-- | include/filetype.h | 1 | ||||
-rw-r--r-- | include/linux/clk.h | 5 | ||||
-rw-r--r-- | include/mfd/syscon.h | 8 | ||||
-rw-r--r-- | include/usb/gadget-multi.h | 2 |
10 files changed, 150 insertions, 7 deletions
diff --git a/include/clock.h b/include/clock.h index d65e404e86..5f2f53ab66 100644 --- a/include/clock.h +++ b/include/clock.h @@ -12,7 +12,8 @@ struct clocksource { uint64_t (*read)(void); uint64_t cycle_last; uint64_t mask; - + int priority; + int (*init)(struct clocksource*); }; static inline uint32_t cyc2ns(struct clocksource *cs, uint64_t cycles) diff --git a/include/console_countdown.h b/include/console_countdown.h index cb46964bc4..c6c2d5c00e 100644 --- a/include/console_countdown.h +++ b/include/console_countdown.h @@ -5,7 +5,9 @@ #define CONSOLE_COUNTDOWN_ANYKEY (1 << 1) #define CONSOLE_COUNTDOWN_RETURN (1 << 3) #define CONSOLE_COUNTDOWN_CTRLC (1 << 4) +#define CONSOLE_COUNTDOWN_EXTERN (1 << 5) int console_countdown(int timeout_s, unsigned flags, char *out_key); +void console_countdown_abort(void); #endif /* __CONSOLE_COUNTDOWN_H */ diff --git a/include/efi.h b/include/efi.h index b2e965bae1..e1fc134ee7 100644 --- a/include/efi.h +++ b/include/efi.h @@ -14,7 +14,7 @@ #include <linux/string.h> #include <linux/types.h> -#ifdef CONFIG_ARCH_EFI +#ifdef CONFIG_EFI_BOOTUP #define EFIAPI __attribute__((ms_abi)) #else #define EFIAPI @@ -171,6 +171,12 @@ struct efi_open_protocol_information_entry { u32 open_count; }; +typedef enum { + EFI_TIMER_CANCEL = 0, + EFI_TIMER_PERIODIC = 1, + EFI_TIMER_RELATIVE = 2 +} efi_timer_delay_t; + /* * EFI Boot Services table */ @@ -185,12 +191,25 @@ typedef struct { unsigned long *, u32 *); efi_status_t (EFIAPI *allocate_pool)(int, unsigned long, void **); efi_status_t (EFIAPI *free_pool)(void *); - void *create_event; - void *set_timer; +#define EFI_EVT_TIMER 0x80000000 +#define EFI_EVT_RUNTIME 0x40000000 +#define EFI_EVT_NOTIFY_WAIT 0x00000100 +#define EFI_EVT_NOTIFY_SIGNAL 0x00000200 +#define EFI_EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201 +#define EFI_EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202 + +#define EFI_TPL_APPLICATION 4 +#define EFI_TPL_CALLBACK 8 +#define EFI_TPL_NOTIFY 16 +#define EFI_TPL_HIGH_LEVEL 31 + efi_status_t(EFIAPI *create_event)(u32 type , unsigned long tpl, + void (*fn) (void *event, void *ctx), + void *ctx, void **event); + efi_status_t(EFIAPI *set_timer)(void *event, efi_timer_delay_t type, uint64_t time); efi_status_t(EFIAPI *wait_for_event)(unsigned long number_of_events, void *event, unsigned long *index); void *signal_event; - void *close_event; + efi_status_t(EFIAPI *close_event)(void *event); void *check_event; void *install_protocol_interface; void *reinstall_protocol_interface; @@ -469,6 +488,9 @@ extern efi_runtime_services_t *RT; #define EFI_VLANCONFIGDXE_INF_GUID \ EFI_GUID(0xe4f61863, 0xfe2c, 0x4b56, 0xa8, 0xf4, 0x08, 0x51, 0x9b, 0xc4, 0x39, 0xdf) +#define EFI_TIMESTAMP_PROTOCOL_GUID \ + EFI_GUID(0xafbfde41, 0x2e6e, 0x4262, 0xba, 0x65, 0x62, 0xb9, 0x23, 0x6e, 0x54, 0x95) + /* barebox specific GUIDs */ #define EFI_BAREBOX_VENDOR_GUID \ EFI_GUID(0x5b91f69c, 0x8b88, 0x4a2b, 0x92, 0x69, 0x5f, 0x1d, 0x80, 0x2b, 0x51, 0x75) @@ -477,6 +499,14 @@ extern efi_runtime_services_t *RT; #define EFI_SYSTEMD_VENDOR_GUID \ EFI_GUID(0x4a67b082, 0x0a4c, 0x41cf, 0xb6, 0xc7, 0x44, 0x0b, 0x29, 0xbb, 0x8c, 0x4f) +/* for TPM 1.2 */ +#define EFI_TCG_PROTOCOL_GUID \ + EFI_GUID(0xf541796d, 0xa62e, 0x4954, 0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd) + +/* for TPM 2.0 */ +#define EFI_TCG2_PROTOCOL_GUID \ + EFI_GUID(0x607f766c, 0x7455, 0x42be, 0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f) + extern efi_guid_t efi_file_info_id; extern efi_guid_t efi_simple_file_system_protocol_guid; extern efi_guid_t efi_device_path_protocol_guid; @@ -488,6 +518,11 @@ extern efi_guid_t efi_block_io_protocol_guid; extern efi_guid_t efi_barebox_vendor_guid; extern efi_guid_t efi_systemd_vendor_guid; +typedef struct { + efi_guid_t guid; + unsigned long table; +} efi_config_table_t; + #define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) #define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30)) @@ -510,7 +545,7 @@ typedef struct { efi_runtime_services_t *runtime; efi_boot_services_t *boottime; unsigned long nr_tables; - unsigned long tables; + efi_config_table_t *tables; } efi_system_table_t; typedef struct { diff --git a/include/efi/debug_ll.h b/include/efi/debug_ll.h new file mode 100644 index 0000000000..4ca72de312 --- /dev/null +++ b/include/efi/debug_ll.h @@ -0,0 +1,20 @@ +#ifndef __MACH_DEBUG_LL_H__ +#define __MACH_DEBUG_LL_H__ + +#define EFI_DEBUG 0 +#define EFI_DEBUG_CLEAR_MEMORY 0 + +#include <efi.h> +#include <efi/efi.h> + +static inline void PUTC_LL(char c) +{ + uint16_t str[2] = {}; + struct efi_simple_text_output_protocol *con_out = efi_sys_table->con_out; + + str[0] = c; + + con_out->output_string(con_out, str); +} + +#endif diff --git a/include/efi/efi-device.h b/include/efi/efi-device.h new file mode 100644 index 0000000000..8f5f1f3f13 --- /dev/null +++ b/include/efi/efi-device.h @@ -0,0 +1,45 @@ +#ifndef __EFI_EFI_DEVICE_H +#define __EFI_EFI_DEVICE_H + +struct efi_device { + struct device_d dev; + efi_guid_t *guids; + int num_guids; + efi_handle_t handle; + efi_handle_t parent_handle; + void *protocol; + struct efi_device_path *devpath; +}; + +struct efi_driver { + struct driver_d driver; + int (*probe)(struct efi_device *efidev); + void (*remove)(struct efi_device *efidev); + efi_guid_t guid; +}; + +extern struct bus_type efi_bus; + +static inline struct efi_device *to_efi_device(struct device_d *dev) +{ + return container_of(dev, struct efi_device, dev); +} + +static inline struct efi_driver *to_efi_driver(struct driver_d *drv) +{ + return container_of(drv, struct efi_driver, driver); +} + +#define device_efi_driver(drv) \ + register_driver_macro(device, efi, drv) + +static inline int efi_driver_register(struct efi_driver *efidrv) +{ + efidrv->driver.bus = &efi_bus; + return register_driver(&efidrv->driver); +} + +int efi_connect_all(void); +void efi_register_devices(void); + +#endif /* __EFI_EFI_DEVICE_H */ diff --git a/include/efi/efi.h b/include/efi/efi.h new file mode 100644 index 0000000000..648afb9ec5 --- /dev/null +++ b/include/efi/efi.h @@ -0,0 +1,26 @@ +#ifndef __MACH_EFI_H +#define __MACH_EFI_H + +#include <efi.h> + +const char *efi_strerror(efi_status_t err); + +extern efi_system_table_t *efi_sys_table; +extern efi_handle_t efi_parent_image; +extern struct efi_device_path *efi_device_path; +extern efi_loaded_image_t *efi_loaded_image; + +int efi_errno(efi_status_t err); + +void *efi_get_variable(char *name, efi_guid_t *vendor, int *var_size); + +static inline void *efi_get_global_var(char *name, int *var_size) +{ + return efi_get_variable(name, &efi_global_variable_guid, var_size); +} + +int efi_set_variable(char *name, efi_guid_t *vendor, uint32_t attributes, + void *buf, unsigned long size); +int efi_set_variable_usec(char *name, efi_guid_t *vendor, uint64_t usec); + +#endif /* __MACH_EFI_H */ diff --git a/include/filetype.h b/include/filetype.h index 65bd6efb7b..709c1869f7 100644 --- a/include/filetype.h +++ b/include/filetype.h @@ -38,6 +38,7 @@ enum filetype { filetype_xz_compressed, filetype_mxs_bootstream, filetype_socfpga_xload, + filetype_kwbimage_v1, filetype_max, }; diff --git a/include/linux/clk.h b/include/linux/clk.h index 7dd52388c5..a061398555 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -329,7 +329,7 @@ const struct of_device_id __clk_of_table_##name \ __attribute__ ((unused,section (".__clk_of_table"))) \ = { .compatible = compat, .data = fn } -#if defined(CONFIG_OFTREE) && defined(CONFIG_COMMON_CLK_OF_PROVIDER) +#if defined(CONFIG_COMMON_CLK_OF_PROVIDER) int of_clk_add_provider(struct device_node *np, struct clk *(*clk_src_get)(struct of_phandle_args *args, void *data), @@ -348,7 +348,10 @@ struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, void *data); struct clk *of_clk_get(struct device_node *np, int index); struct clk *of_clk_get_by_name(struct device_node *np, const char *name); struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec); +unsigned int of_clk_get_parent_count(struct device_node *np); char *of_clk_get_parent_name(struct device_node *np, unsigned int index); +int of_clk_parent_fill(struct device_node *np, const char **parents, + unsigned int size); int of_clk_init(struct device_node *root, const struct of_device_id *matches); #else static inline struct clk *of_clk_get(struct device_node *np, int index) diff --git a/include/mfd/syscon.h b/include/mfd/syscon.h index 651d4c267c..63b893e4ae 100644 --- a/include/mfd/syscon.h +++ b/include/mfd/syscon.h @@ -14,10 +14,13 @@ #ifndef __MFD_SYSCON_H__ #define __MFD_SYSCON_H__ +#include <regmap.h> + #ifdef CONFIG_MFD_SYSCON void __iomem *syscon_base_lookup_by_pdevname(const char *s); void __iomem *syscon_base_lookup_by_phandle (struct device_node *np, const char *property); +struct regmap *syscon_node_to_regmap(struct device_node *np); #else static inline void __iomem *syscon_base_lookup_by_pdevname(const char *s) { @@ -29,6 +32,11 @@ static inline void __iomem *syscon_base_lookup_by_phandle { return ERR_PTR(-ENOSYS); } + +static inline struct regmap *syscon_node_to_regmap(struct device_node *np) +{ + return ERR_PTR(-ENOSYS); +} #endif #endif diff --git a/include/usb/gadget-multi.h b/include/usb/gadget-multi.h index 5ca462326a..81beddc7cf 100644 --- a/include/usb/gadget-multi.h +++ b/include/usb/gadget-multi.h @@ -9,9 +9,11 @@ struct f_multi_opts { struct f_fastboot_opts fastboot_opts; struct f_dfu_opts dfu_opts; int create_acm; + void (*release)(struct f_multi_opts *opts); }; int usb_multi_register(struct f_multi_opts *opts); void usb_multi_unregister(void); +void usb_multi_opts_release(struct f_multi_opts *opts); #endif /* __USB_GADGET_MULTI_H */ |