diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bootm.h | 5 | ||||
-rw-r--r-- | include/charset.h | 23 | ||||
-rw-r--r-- | include/config_distro_bootcmd.h | 40 | ||||
-rw-r--r-- | include/configs/am65x_evm.h | 2 | ||||
-rw-r--r-- | include/configs/axs10x.h | 5 | ||||
-rw-r--r-- | include/configs/broadcom_bcm963158.h | 37 | ||||
-rw-r--r-- | include/configs/hsdk.h | 5 | ||||
-rw-r--r-- | include/configs/odroid.h | 1 | ||||
-rw-r--r-- | include/configs/odroid_xu3.h | 1 | ||||
-rw-r--r-- | include/configs/omap3_cairo.h | 10 | ||||
-rw-r--r-- | include/dm/of_access.h | 10 | ||||
-rw-r--r-- | include/dm/read.h | 16 | ||||
-rw-r--r-- | include/dt-bindings/clock/stm32mp1-clks.h | 3 | ||||
-rw-r--r-- | include/efi.h | 2 | ||||
-rw-r--r-- | include/efi_api.h | 445 | ||||
-rw-r--r-- | include/efi_loader.h | 24 | ||||
-rw-r--r-- | include/fdtdec.h | 20 | ||||
-rw-r--r-- | include/i2s.h | 11 | ||||
-rw-r--r-- | include/initcall.h | 35 | ||||
-rw-r--r-- | include/power/regulator.h | 11 | ||||
-rw-r--r-- | include/samsung/misc.h | 2 | ||||
-rw-r--r-- | include/test/lib.h | 14 | ||||
-rw-r--r-- | include/test/suites.h | 1 |
23 files changed, 651 insertions, 72 deletions
diff --git a/include/bootm.h b/include/bootm.h index dbd6f49c2d..e2cc6d4b99 100644 --- a/include/bootm.h +++ b/include/bootm.h @@ -82,4 +82,9 @@ int bootm_decomp_image(int comp, ulong load, ulong image_start, int type, */ void board_quiesce_devices(void); +/** + * switch_to_non_secure_mode() - switch to non-secure mode + */ +void switch_to_non_secure_mode(void); + #endif diff --git a/include/charset.h b/include/charset.h index 4d45e246e5..65087f76d1 100644 --- a/include/charset.h +++ b/include/charset.h @@ -192,6 +192,29 @@ size_t u16_strlen(const u16 *in); size_t u16_strnlen(const u16 *in, size_t count); /** + * u16_strcpy() - copy u16 string + * + * Copy u16 string pointed to by src, including terminating null word, to + * the buffer pointed to by dest. + * + * @dest: destination buffer + * @src: source buffer (null terminated) + * Return: 'dest' address + */ +u16 *u16_strcpy(u16 *dest, const u16 *src); + +/** + * u16_strdup() - duplicate u16 string + * + * Copy u16 string pointed to by src, including terminating null word, to a + * newly allocated buffer. + * + * @src: source buffer (null terminated) + * Return: allocated new buffer on success, NULL on failure + */ +u16 *u16_strdup(const u16 *src); + +/** * utf16_to_utf8() - Convert an utf16 string to utf8 * * Converts 'size' characters of the utf16 string 'src' to utf8 diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 555efb7433..4993303f4d 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -27,7 +27,7 @@ #define BOOTENV_SHARED_BLKDEV_BODY(devtypel) \ "if " #devtypel " dev ${devnum}; then " \ - "setenv devtype " #devtypel "; " \ + "devtype=" #devtypel "; " \ "run scan_dev_for_boot_part; " \ "fi\0" @@ -37,7 +37,7 @@ #define BOOTENV_DEV_BLKDEV(devtypeu, devtypel, instance) \ "bootcmd_" #devtypel #instance "=" \ - "setenv devnum " #instance "; " \ + "devnum=" #instance "; " \ "run " #devtypel "_boot\0" #define BOOTENV_DEV_NAME_BLKDEV(devtypeu, devtypel, instance) \ @@ -77,7 +77,7 @@ "if ubi part ${bootubipart} && " \ "ubifsmount ubi${devnum}:${bootubivol}; " \ "then " \ - "setenv devtype ubi; " \ + "devtype=ubi; " \ "run scan_dev_for_boot; " \ "fi\0" #define BOOTENV_DEV_UBIFS BOOTENV_DEV_BLKDEV @@ -178,13 +178,38 @@ BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_SATA #endif +#ifdef CONFIG_NVME +#define BOOTENV_RUN_NVME_INIT "run nvme_init; " +#define BOOTENV_SET_NVME_NEED_INIT "setenv nvme_need_init; " +#define BOOTENV_SHARED_NVME \ + "nvme_init=" \ + "if ${nvme_need_init}; then " \ + "setenv nvme_need_init false; " \ + "nvme scan; " \ + "fi\0" \ + \ + "nvme_boot=" \ + BOOTENV_RUN_NVME_INIT \ + BOOTENV_SHARED_BLKDEV_BODY(nvme) +#define BOOTENV_DEV_NVME BOOTENV_DEV_BLKDEV +#define BOOTENV_DEV_NAME_NVME BOOTENV_DEV_NAME_BLKDEV +#else +#define BOOTENV_RUN_NVME_INIT +#define BOOTENV_SET_NVME_NEED_INIT +#define BOOTENV_SHARED_NVME +#define BOOTENV_DEV_NVME \ + BOOT_TARGET_DEVICES_references_NVME_without_CONFIG_NVME +#define BOOTENV_DEV_NAME_NVME \ + BOOT_TARGET_DEVICES_references_NVME_without_CONFIG_NVME +#endif + #ifdef CONFIG_SCSI #define BOOTENV_RUN_SCSI_INIT "run scsi_init; " -#define BOOTENV_SET_SCSI_NEED_INIT "setenv scsi_need_init; " +#define BOOTENV_SET_SCSI_NEED_INIT "scsi_need_init=; " #define BOOTENV_SHARED_SCSI \ "scsi_init=" \ "if ${scsi_need_init}; then " \ - "setenv scsi_need_init false; " \ + "scsi_need_init=false; " \ "scsi scan; " \ "fi\0" \ \ @@ -359,6 +384,7 @@ BOOTENV_SHARED_USB \ BOOTENV_SHARED_SATA \ BOOTENV_SHARED_SCSI \ + BOOTENV_SHARED_NVME \ BOOTENV_SHARED_IDE \ BOOTENV_SHARED_UBIFS \ BOOTENV_SHARED_EFI \ @@ -418,11 +444,13 @@ "bootfstype; then " \ "run scan_dev_for_boot; " \ "fi; " \ - "done\0" \ + "done; " \ + "setenv devplist\0" \ \ BOOT_TARGET_DEVICES(BOOTENV_DEV) \ \ "distro_bootcmd=" BOOTENV_SET_SCSI_NEED_INIT \ + BOOTENV_SET_NVME_NEED_INIT \ "for target in ${boot_targets}; do " \ "run bootcmd_${target}; " \ "done\0" diff --git a/include/configs/am65x_evm.h b/include/configs/am65x_evm.h index 31749c6d06..9ce5b6e824 100644 --- a/include/configs/am65x_evm.h +++ b/include/configs/am65x_evm.h @@ -37,6 +37,8 @@ #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + \ CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE - 4) +#define CONFIG_SYS_BOOTM_LEN SZ_64M + /* U-Boot general configuration */ #define EXTRA_ENV_AM65X_BOARD_SETTINGS \ "findfdt=" \ diff --git a/include/configs/axs10x.h b/include/configs/axs10x.h index e128d1c08b..0f4d78a594 100644 --- a/include/configs/axs10x.h +++ b/include/configs/axs10x.h @@ -32,11 +32,6 @@ #define CONFIG_SYS_LOAD_ADDR 0x82000000 /* - * This board might be of different versions so handle it - */ -#define CONFIG_BOARD_TYPES - -/* * NAND Flash configuration */ #define CONFIG_SYS_NAND_BASE (ARC_FPGA_PERIPHERAL_BASE + 0x16000) diff --git a/include/configs/broadcom_bcm963158.h b/include/configs/broadcom_bcm963158.h new file mode 100644 index 0000000000..5834e1e2a2 --- /dev/null +++ b/include/configs/broadcom_bcm963158.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2019 Philippe Reynes <philippe.reynes@softathome.com> + */ + +#include <linux/sizes.h> + +/* + * common + */ + +/* UART */ +#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, \ + 230400, 500000, 1500000 } +/* Memory usage */ +#define CONFIG_SYS_MAXARGS 24 +#define CONFIG_SYS_MALLOC_LEN (1024 * 1024) +#define CONFIG_SYS_BOOTM_LEN (16 * 1024 * 1024) + +/* + * 63158 + */ + +/* RAM */ +#define CONFIG_SYS_SDRAM_BASE 0x00000000 + +/* U-Boot */ +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE + SZ_16M) +#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_TEXT_BASE + +#define CONFIG_SKIP_LOWLEVEL_INIT + +/* + * bcm963158 + */ + +#define CONFIG_ENV_SIZE (8 * 1024) diff --git a/include/configs/hsdk.h b/include/configs/hsdk.h index 9af1d12701..7735cc1720 100644 --- a/include/configs/hsdk.h +++ b/include/configs/hsdk.h @@ -33,11 +33,6 @@ #define CONFIG_SYS_LOAD_ADDR 0x82000000 /* - * This board might be of different versions so handle it - */ -#define CONFIG_BOARD_TYPES - -/* * UART configuration */ #define CONFIG_SYS_NS16550_SERIAL diff --git a/include/configs/odroid.h b/include/configs/odroid.h index c3520bb15f..b8809c8dcc 100644 --- a/include/configs/odroid.h +++ b/include/configs/odroid.h @@ -186,7 +186,6 @@ * TODO: Add Odroid X support */ #define CONFIG_MISC_COMMON -#define CONFIG_BOARD_TYPES #undef CONFIG_REVISION_TAG diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h index 0337c26475..f178549a72 100644 --- a/include/configs/odroid_xu3.h +++ b/include/configs/odroid_xu3.h @@ -87,7 +87,6 @@ /* Set soc_rev, soc_id, board_rev, boardname, fdtfile */ #define CONFIG_ODROID_REV_AIN 9 #define CONFIG_REVISION_TAG -#define CONFIG_BOARD_TYPES #undef CONFIG_SYS_BOARD #define CONFIG_SYS_BOARD "odroid" diff --git a/include/configs/omap3_cairo.h b/include/configs/omap3_cairo.h index 04bce2f8b4..ef69b24dd0 100644 --- a/include/configs/omap3_cairo.h +++ b/include/configs/omap3_cairo.h @@ -190,16 +190,6 @@ /* env defaults */ #define CONFIG_BOOTFILE "uImage" -/* Override OMAP3 common serial console configuration from UART3 - * to UART2. - * - * Attention: for UART2, special MUX settings (MUX_DEFAULT(), MCBSP3) - * are needed and peripheral clocks for UART2 must be enabled in - * function per_clocks_enable(). - */ -#ifdef CONFIG_SPL_BUILD -#endif - /* Provide the MACH_TYPE value the vendor kernel requires */ #define CONFIG_MACH_TYPE 3063 diff --git a/include/dm/of_access.h b/include/dm/of_access.h index 5ed1a0cdb4..13fedb7cf5 100644 --- a/include/dm/of_access.h +++ b/include/dm/of_access.h @@ -425,6 +425,16 @@ int of_alias_scan(void); int of_alias_get_id(const struct device_node *np, const char *stem); /** + * of_alias_get_highest_id - Get highest alias id for the given stem + * @stem: Alias stem to be examined + * + * The function travels the lookup table to get the highest alias id for the + * given alias stem. + * @return alias ID, if found, else -1 + */ +int of_alias_get_highest_id(const char *stem); + +/** * of_get_stdout() - Get node to use for stdout * * @return node referred to by stdout-path alias, or NULL if none diff --git a/include/dm/read.h b/include/dm/read.h index 389e30e7fb..60b727cbd8 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -510,6 +510,17 @@ int dev_read_resource_byname(struct udevice *dev, const char *name, * @return the translated address; OF_BAD_ADDR on error */ u64 dev_translate_address(struct udevice *dev, const fdt32_t *in_addr); + +/** + * dev_read_alias_highest_id - Get highest alias id for the given stem + * @stem: Alias stem to be examined + * + * The function travels the lookup table to get the highest alias id for the + * given alias stem. + * @return alias ID, if found, else -1 + */ +int dev_read_alias_highest_id(const char *stem); + #else /* CONFIG_DM_DEV_READ_INLINE is enabled */ static inline int dev_read_u32(struct udevice *dev, @@ -740,6 +751,11 @@ static inline u64 dev_translate_address(struct udevice *dev, const fdt32_t *in_a return ofnode_translate_address(dev_ofnode(dev), in_addr); } +static inline int dev_read_alias_highest_id(const char *stem) +{ + return fdtdec_get_alias_highest_id(gd->fdt_blob, stem); +} + #endif /* CONFIG_DM_DEV_READ_INLINE */ /** diff --git a/include/dt-bindings/clock/stm32mp1-clks.h b/include/dt-bindings/clock/stm32mp1-clks.h index 90ec780bfc..4cdaf13582 100644 --- a/include/dt-bindings/clock/stm32mp1-clks.h +++ b/include/dt-bindings/clock/stm32mp1-clks.h @@ -248,7 +248,4 @@ #define STM32MP1_LAST_CLK 232 -#define LTDC_K LTDC_PX -#define ETHMAC_K ETHCK_K - #endif /* _DT_BINDINGS_STM32MP1_CLKS_H_ */ diff --git a/include/efi.h b/include/efi.h index b5e2c64f38..d98441ab19 100644 --- a/include/efi.h +++ b/include/efi.h @@ -49,7 +49,7 @@ struct efi_device_path; typedef struct { u8 b[16]; -} efi_guid_t; +} efi_guid_t __attribute__((aligned(8))); #define EFI_BITS_PER_LONG (sizeof(long) * 8) diff --git a/include/efi_api.h b/include/efi_api.h index aef77b6319..45ca05e8ac 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -17,6 +17,7 @@ #define _EFI_API_H #include <efi.h> +#include <charset.h> #ifdef CONFIG_EFI_LOADER #include <asm/setjmp.h> @@ -34,7 +35,13 @@ enum efi_timer_delay { #define efi_intn_t ssize_t #define efi_uintn_t size_t -typedef uint16_t *efi_string_t; +typedef void *efi_hii_handle_t; +typedef u16 *efi_string_t; +typedef u16 efi_string_id_t; +typedef u32 efi_hii_font_style_t; +typedef u16 efi_question_id_t; +typedef u16 efi_image_id_t; +typedef u16 efi_form_id_t; #define EVT_TIMER 0x80000000 #define EVT_RUNTIME 0x40000000 @@ -115,11 +122,11 @@ struct efi_boot_services { struct efi_device_path *file_path, void *source_buffer, efi_uintn_t source_size, efi_handle_t *image); efi_status_t (EFIAPI *start_image)(efi_handle_t handle, - unsigned long *exitdata_size, - s16 **exitdata); + efi_uintn_t *exitdata_size, + u16 **exitdata); efi_status_t (EFIAPI *exit)(efi_handle_t handle, efi_status_t exit_status, - unsigned long exitdata_size, s16 *exitdata); + efi_uintn_t exitdata_size, u16 *exitdata); efi_status_t (EFIAPI *unload_image)(efi_handle_t image_handle); efi_status_t (EFIAPI *exit_boot_services)(efi_handle_t, unsigned long); @@ -221,14 +228,17 @@ struct efi_runtime_services { struct efi_mem_desc *virtmap); efi_status_t (*convert_pointer)(unsigned long dbg, void **address); efi_status_t (EFIAPI *get_variable)(u16 *variable_name, - efi_guid_t *vendor, u32 *attributes, + const efi_guid_t *vendor, + u32 *attributes, efi_uintn_t *data_size, void *data); efi_status_t (EFIAPI *get_next_variable_name)( efi_uintn_t *variable_name_size, - u16 *variable_name, efi_guid_t *vendor); + u16 *variable_name, const efi_guid_t *vendor); efi_status_t (EFIAPI *set_variable)(u16 *variable_name, - efi_guid_t *vendor, u32 attributes, - efi_uintn_t data_size, void *data); + const efi_guid_t *vendor, + u32 attributes, + efi_uintn_t data_size, + const void *data); efi_status_t (EFIAPI *get_next_high_mono_count)( uint32_t *high_count); void (EFIAPI *reset_system)(enum efi_reset_type reset_type, @@ -299,7 +309,7 @@ struct efi_runtime_services { struct efi_configuration_table { efi_guid_t guid; void *table; -}; +} __packed; #define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) @@ -697,6 +707,418 @@ struct efi_device_path_utilities_protocol { uint16_t node_length); }; +/* + * Human Interface Infrastructure (HII) + */ +struct efi_hii_package_list_header { + efi_guid_t package_list_guid; + u32 package_length; +} __packed; + +/** + * struct efi_hii_package_header - EFI HII package header + * + * @fields: 'fields' replaces the bit-fields defined in the EFI + * specification to to avoid possible compiler incompatibilities:: + * + * u32 length:24; + * u32 type:8; + */ +struct efi_hii_package_header { + u32 fields; +} __packed; + +#define __EFI_HII_PACKAGE_LEN_SHIFT 0 +#define __EFI_HII_PACKAGE_TYPE_SHIFT 24 +#define __EFI_HII_PACKAGE_LEN_MASK 0xffffff +#define __EFI_HII_PACKAGE_TYPE_MASK 0xff + +#define EFI_HII_PACKAGE_TYPE_ALL 0x00 +#define EFI_HII_PACKAGE_TYPE_GUID 0x01 +#define EFI_HII_PACKAGE_FORMS 0x02 +#define EFI_HII_PACKAGE_STRINGS 0x04 +#define EFI_HII_PACKAGE_FONTS 0x05 +#define EFI_HII_PACKAGE_IMAGES 0x06 +#define EFI_HII_PACKAGE_SIMPLE_FONTS 0x07 +#define EFI_HII_PACKAGE_DEVICE_PATH 0x08 +#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT 0x09 +#define EFI_HII_PACKAGE_ANIMATIONS 0x0A +#define EFI_HII_PACKAGE_END 0xDF +#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN 0xE0 +#define EFI_HII_PACKAGE_TYPE_SYSTEM_END 0xFF + +/* + * HII GUID package + */ +struct efi_hii_guid_package { + struct efi_hii_package_header header; + efi_guid_t guid; + char data[]; +} __packed; + +/* + * HII string package + */ +struct efi_hii_strings_package { + struct efi_hii_package_header header; + u32 header_size; + u32 string_info_offset; + u16 language_window[16]; + efi_string_id_t language_name; + u8 language[]; +} __packed; + +struct efi_hii_string_block { + u8 block_type; + /* u8 block_body[]; */ +} __packed; + +#define EFI_HII_SIBT_END 0x00 +#define EFI_HII_SIBT_STRING_SCSU 0x10 +#define EFI_HII_SIBT_STRING_SCSU_FONT 0x11 +#define EFI_HII_SIBT_STRINGS_SCSU 0x12 +#define EFI_HII_SIBT_STRINGS_SCSU_FONT 0x13 +#define EFI_HII_SIBT_STRING_UCS2 0x14 +#define EFI_HII_SIBT_STRING_UCS2_FONT 0x15 +#define EFI_HII_SIBT_STRINGS_UCS2 0x16 +#define EFI_HII_SIBT_STRINGS_UCS2_FONT 0x17 +#define EFI_HII_SIBT_DUPLICATE 0x20 +#define EFI_HII_SIBT_SKIP2 0x21 +#define EFI_HII_SIBT_SKIP1 0x22 +#define EFI_HII_SIBT_EXT1 0x30 +#define EFI_HII_SIBT_EXT2 0x31 +#define EFI_HII_SIBT_EXT4 0x32 +#define EFI_HII_SIBT_FONT 0x40 + +struct efi_hii_sibt_string_ucs2_block { + struct efi_hii_string_block header; + u16 string_text[]; +} __packed; + +static inline struct efi_hii_string_block * +efi_hii_sibt_string_ucs2_block_next(struct efi_hii_sibt_string_ucs2_block *blk) +{ + return ((void *)blk) + sizeof(*blk) + + (u16_strlen(blk->string_text) + 1) * 2; +} + +/* + * HII forms package + * TODO: full scope of definitions + */ +struct efi_hii_time { + u8 hour; + u8 minute; + u8 second; +}; + +struct efi_hii_date { + u16 year; + u8 month; + u8 day; +}; + +struct efi_hii_ref { + efi_question_id_t question_id; + efi_form_id_t form_id; + efi_guid_t form_set_guid; + efi_string_id_t device_path; +}; + +union efi_ifr_type_value { + u8 u8; // EFI_IFR_TYPE_NUM_SIZE_8 + u16 u16; // EFI_IFR_TYPE_NUM_SIZE_16 + u32 u32; // EFI_IFR_TYPE_NUM_SIZE_32 + u64 u64; // EFI_IFR_TYPE_NUM_SIZE_64 + bool b; // EFI_IFR_TYPE_BOOLEAN + struct efi_hii_time time; // EFI_IFR_TYPE_TIME + struct efi_hii_date date; // EFI_IFR_TYPE_DATE + efi_string_id_t string; // EFI_IFR_TYPE_STRING, EFI_IFR_TYPE_ACTION + struct efi_hii_ref ref; // EFI_IFR_TYPE_REF + // u8 buffer[]; // EFI_IFR_TYPE_BUFFER +}; + +#define EFI_IFR_TYPE_NUM_SIZE_8 0x00 +#define EFI_IFR_TYPE_NUM_SIZE_16 0x01 +#define EFI_IFR_TYPE_NUM_SIZE_32 0x02 +#define EFI_IFR_TYPE_NUM_SIZE_64 0x03 +#define EFI_IFR_TYPE_BOOLEAN 0x04 +#define EFI_IFR_TYPE_TIME 0x05 +#define EFI_IFR_TYPE_DATE 0x06 +#define EFI_IFR_TYPE_STRING 0x07 +#define EFI_IFR_TYPE_OTHER 0x08 +#define EFI_IFR_TYPE_UNDEFINED 0x09 +#define EFI_IFR_TYPE_ACTION 0x0A +#define EFI_IFR_TYPE_BUFFER 0x0B +#define EFI_IFR_TYPE_REF 0x0C +#define EFI_IFR_OPTION_DEFAULT 0x10 +#define EFI_IFR_OPTION_DEFAULT_MFG 0x20 + +#define EFI_IFR_ONE_OF_OPTION_OP 0x09 + +struct efi_ifr_op_header { + u8 opCode; + u8 length:7; + u8 scope:1; +}; + +struct efi_ifr_one_of_option { + struct efi_ifr_op_header header; + efi_string_id_t option; + u8 flags; + u8 type; + union efi_ifr_type_value value; +}; + +typedef efi_uintn_t efi_browser_action_t; + +#define EFI_BROWSER_ACTION_REQUEST_NONE 0 +#define EFI_BROWSER_ACTION_REQUEST_RESET 1 +#define EFI_BROWSER_ACTION_REQUEST_SUBMIT 2 +#define EFI_BROWSER_ACTION_REQUEST_EXIT 3 +#define EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT 4 +#define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT 5 +#define EFI_BROWSER_ACTION_REQUEST_FORM_APPLY 6 +#define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD 7 +#define EFI_BROWSER_ACTION_REQUEST_RECONNECT 8 + +typedef efi_uintn_t efi_browser_action_request_t; + +#define EFI_BROWSER_ACTION_CHANGING 0 +#define EFI_BROWSER_ACTION_CHANGED 1 +#define EFI_BROWSER_ACTION_RETRIEVE 2 +#define EFI_BROWSER_ACTION_FORM_OPEN 3 +#define EFI_BROWSER_ACTION_FORM_CLOSE 4 +#define EFI_BROWSER_ACTION_SUBMITTED 5 +#define EFI_BROWSER_ACTION_DEFAULT_STANDARD 0x1000 +#define EFI_BROWSER_ACTION_DEFAULT_MANUFACTURING 0x1001 +#define EFI_BROWSER_ACTION_DEFAULT_SAFE 0x1002 +#define EFI_BROWSER_ACTION_DEFAULT_PLATFORM 0x2000 +#define EFI_BROWSER_ACTION_DEFAULT_HARDWARE 0x3000 +#define EFI_BROWSER_ACTION_DEFAULT_FIRMWARE 0x4000 + +/* + * HII keyboard package + */ +typedef enum { + EFI_KEY_LCTRL, EFI_KEY_A0, EFI_KEY_LALT, EFI_KEY_SPACE_BAR, + EFI_KEY_A2, EFI_KEY_A3, EFI_KEY_A4, EFI_KEY_RCTRL, EFI_KEY_LEFT_ARROW, + EFI_KEY_DOWN_ARROW, EFI_KEY_RIGHT_ARROW, EFI_KEY_ZERO, + EFI_KEY_PERIOD, EFI_KEY_ENTER, EFI_KEY_LSHIFT, EFI_KEY_B0, + EFI_KEY_B1, EFI_KEY_B2, EFI_KEY_B3, EFI_KEY_B4, EFI_KEY_B5, EFI_KEY_B6, + EFI_KEY_B7, EFI_KEY_B8, EFI_KEY_B9, EFI_KEY_B10, EFI_KEY_RSHIFT, + EFI_KEY_UP_ARROW, EFI_KEY_ONE, EFI_KEY_TWO, EFI_KEY_THREE, + EFI_KEY_CAPS_LOCK, EFI_KEY_C1, EFI_KEY_C2, EFI_KEY_C3, EFI_KEY_C4, + EFI_KEY_C5, EFI_KEY_C6, EFI_KEY_C7, EFI_KEY_C8, EFI_KEY_C9, + EFI_KEY_C10, EFI_KEY_C11, EFI_KEY_C12, EFI_KEY_FOUR, EFI_KEY_FIVE, + EFI_KEY_SIX, EFI_KEY_PLUS, EFI_KEY_TAB, EFI_KEY_D1, EFI_KEY_D2, + EFI_KEY_D3, EFI_KEY_D4, EFI_KEY_D5, EFI_KEY_D6, EFI_KEY_D7, EFI_KEY_D8, + EFI_KEY_D9, EFI_KEY_D10, EFI_KEY_D11, EFI_KEY_D12, EFI_KEY_D13, + EFI_KEY_DEL, EFI_KEY_END, EFI_KEY_PG_DN, EFI_KEY_SEVEN, EFI_KEY_EIGHT, + EFI_KEY_NINE, EFI_KEY_E0, EFI_KEY_E1, EFI_KEY_E2, EFI_KEY_E3, + EFI_KEY_E4, EFI_KEY_E5, EFI_KEY_E6, EFI_KEY_E7, EFI_KEY_E8, EFI_KEY_E9, + EFI_KEY_E10, EFI_KEY_E11, EFI_KEY_E12, EFI_KEY_BACK_SPACE, + EFI_KEY_INS, EFI_KEY_HOME, EFI_KEY_PG_UP, EFI_KEY_NLCK, EFI_KEY_SLASH, + EFI_KEY_ASTERISK, EFI_KEY_MINUS, EFI_KEY_ESC, EFI_KEY_F1, EFI_KEY_F2, + EFI_KEY_F3, EFI_KEY_F4, EFI_KEY_F5, EFI_KEY_F6, EFI_KEY_F7, EFI_KEY_F8, + EFI_KEY_F9, EFI_KEY_F10, EFI_KEY_F11, EFI_KEY_F12, EFI_KEY_PRINT, + EFI_KEY_SLCK, EFI_KEY_PAUSE, +} efi_key; + +struct efi_key_descriptor { + u32 key; + u16 unicode; + u16 shifted_unicode; + u16 alt_gr_unicode; + u16 shifted_alt_gr_unicode; + u16 modifier; + u16 affected_attribute; +} __packed; + +struct efi_hii_keyboard_layout { + u16 layout_length; + efi_guid_t guid; + u32 layout_descriptor_string_offset; + u8 descriptor_count; + struct efi_key_descriptor descriptors[]; +} __packed; + +struct efi_hii_keyboard_package { + struct efi_hii_package_header header; + u16 layout_count; + struct efi_hii_keyboard_layout layout[]; +} __packed; + +/* + * HII protocols + */ +#define EFI_HII_STRING_PROTOCOL_GUID \ + EFI_GUID(0x0fd96974, 0x23aa, 0x4cdc, \ + 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a) + +struct efi_font_info { + efi_hii_font_style_t font_style; + u16 font_size; + u16 font_name[1]; +}; + +struct efi_hii_string_protocol { + efi_status_t(EFIAPI *new_string)( + const struct efi_hii_string_protocol *this, + efi_hii_handle_t package_list, + efi_string_id_t *string_id, + const u8 *language, + const u16 *language_name, + const efi_string_t string, + const struct efi_font_info *string_font_info); + efi_status_t(EFIAPI *get_string)( + const struct efi_hii_string_protocol *this, + const u8 *language, + efi_hii_handle_t package_list, + efi_string_id_t string_id, + efi_string_t string, + efi_uintn_t *string_size, + struct efi_font_info **string_font_info); + efi_status_t(EFIAPI *set_string)( + const struct efi_hii_string_protocol *this, + efi_hii_handle_t package_list, + efi_string_id_t string_id, + const u8 *language, + const efi_string_t string, + const struct efi_font_info *string_font_info); + efi_status_t(EFIAPI *get_languages)( + const struct efi_hii_string_protocol *this, + efi_hii_handle_t package_list, + u8 *languages, + efi_uintn_t *languages_size); + efi_status_t(EFIAPI *get_secondary_languages)( + const struct efi_hii_string_protocol *this, + efi_hii_handle_t package_list, + const u8 *primary_language, + u8 *secondary_languages, + efi_uintn_t *secondary_languages_size); +}; + +#define EFI_HII_DATABASE_PROTOCOL_GUID \ + EFI_GUID(0xef9fc172, 0xa1b2, 0x4693, \ + 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42) + +struct efi_hii_database_protocol { + efi_status_t(EFIAPI *new_package_list)( + const struct efi_hii_database_protocol *this, + const struct efi_hii_package_list_header *package_list, + const efi_handle_t driver_handle, + efi_hii_handle_t *handle); + efi_status_t(EFIAPI *remove_package_list)( + const struct efi_hii_database_protocol *this, + efi_hii_handle_t handle); + efi_status_t(EFIAPI *update_package_list)( + const struct efi_hii_database_protocol *this, + efi_hii_handle_t handle, + const struct efi_hii_package_list_header *package_list); + efi_status_t(EFIAPI *list_package_lists)( + const struct efi_hii_database_protocol *this, + u8 package_type, + const efi_guid_t *package_guid, + efi_uintn_t *handle_buffer_length, + efi_hii_handle_t *handle); + efi_status_t(EFIAPI *export_package_lists)( + const struct efi_hii_database_protocol *this, + efi_hii_handle_t handle, + efi_uintn_t *buffer_size, + struct efi_hii_package_list_header *buffer); + efi_status_t(EFIAPI *register_package_notify)( + const struct efi_hii_database_protocol *this, + u8 package_type, + const efi_guid_t *package_guid, + const void *package_notify_fn, + efi_uintn_t notify_type, + efi_handle_t *notify_handle); + efi_status_t(EFIAPI *unregister_package_notify)( + const struct efi_hii_database_protocol *this, + efi_handle_t notification_handle + ); + efi_status_t(EFIAPI *find_keyboard_layouts)( + const struct efi_hii_database_protocol *this, + u16 *key_guid_buffer_length, + efi_guid_t *key_guid_buffer); + efi_status_t(EFIAPI *get_keyboard_layout)( + const struct efi_hii_database_protocol *this, + efi_guid_t *key_guid, + u16 *keyboard_layout_length, + struct efi_hii_keyboard_layout *keyboard_layout); + efi_status_t(EFIAPI *set_keyboard_layout)( + const struct efi_hii_database_protocol *this, + efi_guid_t *key_guid); + efi_status_t(EFIAPI *get_package_list_handle)( + const struct efi_hii_database_protocol *this, + efi_hii_handle_t package_list_handle, + efi_handle_t *driver_handle); +}; + +#define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \ + EFI_GUID(0x587e72d7, 0xcc50, 0x4f79, \ + 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f) + +struct efi_hii_config_routing_protocol { + efi_status_t(EFIAPI *extract_config)( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t request, + efi_string_t *progress, + efi_string_t *results); + efi_status_t(EFIAPI *export_config)( + const struct efi_hii_config_routing_protocol *this, + efi_string_t *results); + efi_status_t(EFIAPI *route_config)( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t configuration, + efi_string_t *progress); + efi_status_t(EFIAPI *block_to_config)( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t config_request, + const uint8_t *block, + const efi_uintn_t block_size, + efi_string_t *config, + efi_string_t *progress); + efi_status_t(EFIAPI *config_to_block)( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t config_resp, + const uint8_t *block, + const efi_uintn_t *block_size, + efi_string_t *progress); + efi_status_t(EFIAPI *get_alt_config)( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t config_resp, + const efi_guid_t *guid, + const efi_string_t name, + const struct efi_device_path *device_path, + const efi_string_t alt_cfg_id, + efi_string_t *alt_cfg_resp); +}; + +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \ + EFI_GUID(0x330d4706, 0xf2a0, 0x4e4f, \ + 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85) + +struct efi_hii_config_access_protocol { + efi_status_t(EFIAPI *extract_config_access)( + const struct efi_hii_config_access_protocol *this, + const efi_string_t request, + efi_string_t *progress, + efi_string_t *results); + efi_status_t(EFIAPI *route_config_access)( + const struct efi_hii_config_access_protocol *this, + const efi_string_t configuration, + efi_string_t *progress); + efi_status_t(EFIAPI *form_callback)( + const struct efi_hii_config_access_protocol *this, + efi_browser_action_t action, + efi_question_id_t question_id, + u8 type, + union efi_ifr_type_value *value, + efi_browser_action_request_t *action_request); +}; + #define EFI_GOP_GUID \ EFI_GUID(0x9042a9de, 0x23dc, 0x4a38, \ 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a) @@ -906,7 +1328,7 @@ struct efi_file_handle { u64 rev; efi_status_t (EFIAPI *open)(struct efi_file_handle *file, struct efi_file_handle **new_handle, - s16 *file_name, u64 open_mode, u64 attributes); + u16 *file_name, u64 open_mode, u64 attributes); efi_status_t (EFIAPI *close)(struct efi_file_handle *file); efi_status_t (EFIAPI *delete)(struct efi_file_handle *file); efi_status_t (EFIAPI *read)(struct efi_file_handle *file, @@ -926,9 +1348,6 @@ struct efi_file_handle { efi_status_t (EFIAPI *flush)(struct efi_file_handle *file); }; -#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ - EFI_GUID(0x964e5b22, 0x6459, 0x11d2, \ - 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b) #define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION 0x00010000 struct efi_simple_file_system_protocol { diff --git a/include/efi_loader.h b/include/efi_loader.h index 53f08161ab..9dd933dae7 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -106,6 +106,10 @@ extern const struct efi_device_path_utilities_protocol /* Implementation of the EFI_UNICODE_COLLATION_PROTOCOL */ extern const struct efi_unicode_collation_protocol efi_unicode_collation_protocol; +extern const struct efi_hii_config_routing_protocol efi_hii_config_routing; +extern const struct efi_hii_config_access_protocol efi_hii_config_access; +extern const struct efi_hii_database_protocol efi_hii_database; +extern const struct efi_hii_string_protocol efi_hii_string; uint16_t *efi_dp_str(struct efi_device_path *dp); @@ -139,6 +143,10 @@ extern const efi_guid_t efi_file_system_info_guid; extern const efi_guid_t efi_guid_device_path_utilities_protocol; /* GUID of the Unicode collation protocol */ extern const efi_guid_t efi_guid_unicode_collation_protocol; +extern const efi_guid_t efi_guid_hii_config_routing_protocol; +extern const efi_guid_t efi_guid_hii_config_access_protocol; +extern const efi_guid_t efi_guid_hii_database_protocol; +extern const efi_guid_t efi_guid_hii_string_protocol; extern unsigned int __efi_runtime_start, __efi_runtime_stop; extern unsigned int __efi_runtime_rel_start, __efi_runtime_rel_stop; @@ -244,6 +252,8 @@ extern struct list_head efi_obj_list; /* List of all events */ extern struct list_head efi_events; +/* Initialize efi execution environment */ +efi_status_t efi_init_obj_list(void); /* Called by bootefi to initialize root node */ efi_status_t efi_root_node_register(void); /* Called by bootefi to initialize runtime */ @@ -508,15 +518,15 @@ efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle, struct efi_system_table *systab); #endif -efi_status_t EFIAPI efi_get_variable(u16 *variable_name, efi_guid_t *vendor, - u32 *attributes, efi_uintn_t *data_size, - void *data); +efi_status_t EFIAPI efi_get_variable(u16 *variable_name, + const efi_guid_t *vendor, u32 *attributes, + efi_uintn_t *data_size, void *data); efi_status_t EFIAPI efi_get_next_variable_name(efi_uintn_t *variable_name_size, u16 *variable_name, - efi_guid_t *vendor); -efi_status_t EFIAPI efi_set_variable(u16 *variable_name, efi_guid_t *vendor, - u32 attributes, efi_uintn_t data_size, - void *data); + const efi_guid_t *vendor); +efi_status_t EFIAPI efi_set_variable(u16 *variable_name, + const efi_guid_t *vendor, u32 attributes, + efi_uintn_t data_size, const void *data); /* * See section 3.1.3 in the v2.7 UEFI spec for more details on diff --git a/include/fdtdec.h b/include/fdtdec.h index f1bcbf837f..b7e35cd87c 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -133,21 +133,14 @@ enum fdt_compat_id { /* Tegra210 XUSB pad controller */ COMPAT_SMSC_LAN9215, /* SMSC 10/100 Ethernet LAN9215 */ COMPAT_SAMSUNG_EXYNOS5_SROMC, /* Exynos5 SROMC */ - COMPAT_SAMSUNG_S3C2440_I2C, /* Exynos I2C Controller */ - COMPAT_SAMSUNG_EXYNOS5_SOUND, /* Exynos Sound */ - COMPAT_WOLFSON_WM8994_CODEC, /* Wolfson WM8994 Sound Codec */ COMPAT_SAMSUNG_EXYNOS_USB_PHY, /* Exynos phy controller for usb2.0 */ COMPAT_SAMSUNG_EXYNOS5_USB3_PHY,/* Exynos phy controller for usb3.0 */ COMPAT_SAMSUNG_EXYNOS_TMU, /* Exynos TMU */ COMPAT_SAMSUNG_EXYNOS_MIPI_DSI, /* Exynos mipi dsi */ COMPAT_SAMSUNG_EXYNOS_DWMMC, /* Exynos DWMMC controller */ - COMPAT_SAMSUNG_EXYNOS_MMC, /* Exynos MMC controller */ COMPAT_GENERIC_SPI_FLASH, /* Generic SPI Flash chip */ - COMPAT_MAXIM_98095_CODEC, /* MAX98095 Codec */ - COMPAT_SAMSUNG_EXYNOS5_I2C, /* Exynos5 High Speed I2C Controller */ COMPAT_SAMSUNG_EXYNOS_SYSMMU, /* Exynos sysmmu */ COMPAT_INTEL_MICROCODE, /* Intel microcode update */ - COMPAT_AMS_AS3722, /* AMS AS3722 PMIC */ COMPAT_INTEL_QRK_MRC, /* Intel Quark MRC */ COMPAT_ALTERA_SOCFPGA_DWMAC, /* SoCFPGA Ethernet controller */ COMPAT_ALTERA_SOCFPGA_DWMMC, /* SoCFPGA DWMMC controller */ @@ -626,6 +619,19 @@ int fdtdec_get_alias_seq(const void *blob, const char *base, int node, int *seqp); /** + * Get the highest alias number for susbystem. + * + * It parses all aliases and find out highest recorded alias for subsystem. + * Aliases are of the form <base><num> where <num> is the sequence number. + * + * @param blob Device tree blob (if NULL, then error is returned) + * @param base Base name for alias susbystem (before the number) + * + * @return 0 highest alias ID, -1 if not found + */ +int fdtdec_get_alias_highest_id(const void *blob, const char *base); + +/** * Get a property from the /chosen node * * @param blob Device tree blob (if NULL, then NULL is returned) diff --git a/include/i2s.h b/include/i2s.h index 28f6184811..7760aab7c4 100644 --- a/include/i2s.h +++ b/include/i2s.h @@ -78,7 +78,7 @@ struct i2s_reg { /* This structure stores the i2s related information */ struct i2s_uc_priv { unsigned int rfs; /* LR clock frame size */ - unsigned int bfs; /* Bit slock frame size */ + unsigned int bfs; /* Bit clock frame size */ unsigned int audio_pll_clk; /* Audio pll frequency in Hz */ unsigned int samplingrate; /* sampling rate */ unsigned int bitspersample; /* bits per sample */ @@ -123,13 +123,4 @@ int i2s_tx_data(struct udevice *dev, void *data, uint data_size); int i2s_transfer_tx_data(struct i2s_uc_priv *pi2s_tx, void *data, uint data_size); -/* - * Initialise i2s transmiter - * - * @param pi2s_tx pointer of i2s transmitter parameter structure. - * - * @return int value 0 for success, -1 in case of error - */ -int i2s_tx_init(struct i2s_uc_priv *pi2s_tx); - #endif /* __I2S_H__ */ diff --git a/include/initcall.h b/include/initcall.h index 01f3f2833f..3ac01aa2cd 100644 --- a/include/initcall.h +++ b/include/initcall.h @@ -8,6 +8,39 @@ typedef int (*init_fnc_t)(void); -int initcall_run_list(const init_fnc_t init_sequence[]); +#include <common.h> +#include <initcall.h> +#include <efi.h> + +DECLARE_GLOBAL_DATA_PTR; + +static inline int initcall_run_list(const init_fnc_t init_sequence[]) +{ + const init_fnc_t *init_fnc_ptr; + + for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { + unsigned long reloc_ofs = 0; + int ret; + + if (gd->flags & GD_FLG_RELOC) + reloc_ofs = gd->reloc_off; +#ifdef CONFIG_EFI_APP + reloc_ofs = (unsigned long)image_base; +#endif + debug("initcall: %p", (char *)*init_fnc_ptr - reloc_ofs); + if (gd->flags & GD_FLG_RELOC) + debug(" (relocated to %p)\n", (char *)*init_fnc_ptr); + else + debug("\n"); + ret = (*init_fnc_ptr)(); + if (ret) { + printf("initcall sequence %p failed at call %p (err=%d)\n", + init_sequence, + (char *)*init_fnc_ptr - reloc_ofs, ret); + return -1; + } + } + return 0; +} #endif diff --git a/include/power/regulator.h b/include/power/regulator.h index 5318ab3ace..314160a894 100644 --- a/include/power/regulator.h +++ b/include/power/regulator.h @@ -304,6 +304,17 @@ int regulator_get_enable(struct udevice *dev); int regulator_set_enable(struct udevice *dev, bool enable); /** + * regulator_set_enable_if_allowed: set regulator enable state if allowed by + * regulator + * + * @dev - pointer to the regulator device + * @enable - set true or false + * @return - 0 on success or if enabling is not supported + * -errno val if fails. + */ +int regulator_set_enable_if_allowed(struct udevice *dev, bool enable); + +/** * regulator_get_mode: get active operation mode id of a given regulator * * @dev - pointer to the regulator device diff --git a/include/samsung/misc.h b/include/samsung/misc.h index 0f957dc367..017560c256 100644 --- a/include/samsung/misc.h +++ b/include/samsung/misc.h @@ -32,9 +32,7 @@ void draw_logo(void); char *get_dfu_alt_system(char *interface, char *devstr); char *get_dfu_alt_boot(char *interface, char *devstr); #endif -#ifdef CONFIG_BOARD_TYPES void set_board_type(void); const char *get_board_type(void); -#endif #endif /* __SAMSUNG_MISC_COMMON_H__ */ diff --git a/include/test/lib.h b/include/test/lib.h new file mode 100644 index 0000000000..04b6241e54 --- /dev/null +++ b/include/test/lib.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2019 Heinrich Schuchardt <xypron.glpk@gmx.de> + */ + +#ifndef __TEST_LIB_H__ +#define __TEST_LIB_H__ + +#include <test/test.h> + +/* Declare a new library function test */ +#define LIB_TEST(_name, _flags) UNIT_TEST(_name, _flags, lib_test) + +#endif /* __TEST_LIB_H__ */ diff --git a/include/test/suites.h b/include/test/suites.h index 77d863b4a6..01bee09346 100644 --- a/include/test/suites.h +++ b/include/test/suites.h @@ -27,6 +27,7 @@ int do_ut_bloblist(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]); int do_ut_compression(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]); int do_ut_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); int do_ut_env(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); +int do_ut_lib(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); int do_ut_overlay(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); int do_ut_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); int do_ut_unicode(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); |