diff options
Diffstat (limited to 'include')
79 files changed, 527 insertions, 254 deletions
diff --git a/include/abuf.h b/include/abuf.h new file mode 100644 index 00000000000..d230f72806d --- /dev/null +++ b/include/abuf.h @@ -0,0 +1,159 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Handles a buffer that can be allocated and freed + * + * Copyright 2021 Google LLC + * Written by Simon Glass <sjg@chromium.org> + */ + +#ifndef __ABUF_H +#define __ABUF_H + +#include <linux/types.h> + +/** + * struct abuf - buffer that can be allocated and freed + * + * This is useful for a block of data which may be allocated with malloc(), or + * not, so that it needs to be freed correctly when finished with. + * + * For now it has a very simple purpose. + * + * Using memset() to zero all fields is guaranteed to be equivalent to + * abuf_init(). + * + * @data: Pointer to data + * @size: Size of data in bytes + * @alloced: true if allocated with malloc(), so must be freed after use + */ +struct abuf { + void *data; + size_t size; + bool alloced; +}; + +static inline void *abuf_data(const struct abuf *abuf) +{ + return abuf->data; +} + +static inline size_t abuf_size(const struct abuf *abuf) +{ + return abuf->size; +} + +/** + * abuf_set() - set the (unallocated) data in a buffer + * + * This simply makes the abuf point to the supplied data, which must be live + * for the lifetime of the abuf. It is not alloced. + * + * Any existing data in the abuf is freed and the alloced member is set to + * false. + * + * @abuf: abuf to adjust + * @data: New contents of abuf + * @size: New size of abuf + */ +void abuf_set(struct abuf *abuf, void *data, size_t size); + +/** + * abuf_map_sysmem() - calls map_sysmem() to set up an abuf + * + * This is equivalent to abuf_set(abuf, map_sysmem(addr, size), size) + * + * Any existing data in the abuf is freed and the alloced member is set to + * false. + * + * @abuf: abuf to adjust + * @addr: Address to set the abuf to + * @size: New size of abuf + */ +void abuf_map_sysmem(struct abuf *abuf, ulong addr, size_t size); + +/** + * abuf_realloc() - Change the size of a buffer + * + * This uses realloc() to change the size of the buffer, with the same semantics + * as that function. If the abuf is not currently alloced, then it will alloc + * it if the size needs to increase (i.e. set the alloced member to true) + * + * @abuf: abuf to adjust + * @new_size: new size in bytes. + * if 0, the abuf is freed + * if greater than the current size, the abuf is extended and the new + * space is not inited. The alloced member is set to true + * if less than the current size, the abuf is contracted and the data at + * the end is lost. If @new_size is 0, this sets the alloced member to + * false + * @return true if OK, false if out of memory + */ +bool abuf_realloc(struct abuf *abuf, size_t new_size); + +/** + * abuf_uninit_move() - Return the allocated contents and uninit the abuf + * + * This returns the abuf data to the caller, allocating it if necessary, so that + * the caller receives data that it can be sure will hang around. The caller is + * responsible for freeing the data. + * + * If the abuf has allocated data, it is returned. If the abuf has data but it + * is not allocated, then it is first allocated, then returned. + * + * If the abuf size is 0, this returns NULL + * + * The abuf is uninited as part of this, except if the allocation fails, in + * which NULL is returned and the abuf remains untouched. + * + * The abuf must be inited before this can be called. + * + * @abuf: abuf to uninit + * @sizep: if non-NULL, returns the size of the returned data + * @return data contents, allocated with malloc(), or NULL if the data could not + * be allocated, or the data size is 0 + */ +void *abuf_uninit_move(struct abuf *abuf, size_t *sizep); + +/** + * abuf_init_move() - Make abuf take over the management of an allocated region + * + * After this, @data must not be used. All access must be via the abuf. + * + * @abuf: abuf to init + * @data: Existing allocated buffer to place in the abuf + * @size: Size of allocated buffer + */ +void abuf_init_move(struct abuf *abuf, void *data, size_t size); + +/** + * abuf_init_set() - Set up a new abuf + * + * Inits a new abuf and sets up its (unallocated) data + * + * @abuf: abuf to set up + * @data: New contents of abuf + * @size: New size of abuf + */ +void abuf_init_set(struct abuf *abuf, void *data, size_t size); + +/** + * abuf_uninit() - Free any memory used by an abuf + * + * The buffer must be inited before this can be called. + * + * @abuf: abuf to uninit + */ +void abuf_uninit(struct abuf *abuf); + +/** + * abuf_init() - Set up a new abuf + * + * This initially has no data and alloced is set to false. This is equivalent to + * setting all fields to 0, e.g. with memset(), so callers can do that instead + * if desired. + * + * @abuf: abuf to set up + */ +void abuf_init(struct abuf *abuf); + +#endif diff --git a/include/axp_pmic.h b/include/axp_pmic.h index 405044c3a32..46a017d2efa 100644 --- a/include/axp_pmic.h +++ b/include/axp_pmic.h @@ -6,6 +6,8 @@ */ #ifndef _AXP_PMIC_H_ +#include <stdbool.h> + #ifdef CONFIG_AXP152_POWER #include <axp152.h> #endif @@ -25,6 +27,16 @@ #include <axp818.h> #endif +#define AXP_PMIC_MODE_REG 0x3e +#define AXP_PMIC_MODE_I2C 0x00 +#define AXP_PMIC_MODE_P2WI 0x3e +#define AXP_PMIC_MODE_RSB 0x7c + +#define AXP_PMIC_PRI_DEVICE_ADDR 0x3a3 +#define AXP_PMIC_PRI_RUNTIME_ADDR 0x2d +#define AXP_PMIC_SEC_DEVICE_ADDR 0x745 +#define AXP_PMIC_SEC_RUNTIME_ADDR 0x3a + int axp_set_dcdc1(unsigned int mvolt); int axp_set_dcdc2(unsigned int mvolt); int axp_set_dcdc3(unsigned int mvolt); diff --git a/include/clk/sunxi.h b/include/clk/sunxi.h new file mode 100644 index 00000000000..d4ad5fd0ba3 --- /dev/null +++ b/include/clk/sunxi.h @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2018 Amarula Solutions. + * Author: Jagan Teki <jagan@amarulasolutions.com> + */ + +#ifndef _CLK_SUNXI_H +#define _CLK_SUNXI_H + +#include <linux/bitops.h> + +/** + * enum ccu_flags - ccu clock/reset flags + * + * @CCU_CLK_F_IS_VALID: is given clock gate is valid? + * @CCU_RST_F_IS_VALID: is given reset control is valid? + */ +enum ccu_flags { + CCU_CLK_F_IS_VALID = BIT(0), + CCU_RST_F_IS_VALID = BIT(1), +}; + +/** + * struct ccu_clk_gate - ccu clock gate + * @off: gate offset + * @bit: gate bit + * @flags: ccu clock gate flags + */ +struct ccu_clk_gate { + u16 off; + u32 bit; + enum ccu_flags flags; +}; + +#define GATE(_off, _bit) { \ + .off = _off, \ + .bit = _bit, \ + .flags = CCU_CLK_F_IS_VALID, \ +} + +/** + * struct ccu_reset - ccu reset + * @off: reset offset + * @bit: reset bit + * @flags: ccu reset control flags + */ +struct ccu_reset { + u16 off; + u32 bit; + enum ccu_flags flags; +}; + +#define RESET(_off, _bit) { \ + .off = _off, \ + .bit = _bit, \ + .flags = CCU_RST_F_IS_VALID, \ +} + +/** + * struct ccu_desc - clock control unit descriptor + * + * @gates: clock gates + * @resets: reset unit + */ +struct ccu_desc { + const struct ccu_clk_gate *gates; + const struct ccu_reset *resets; +}; + +/** + * struct ccu_priv - sunxi clock control unit + * + * @base: base address + * @desc: ccu descriptor + */ +struct ccu_priv { + void *base; + const struct ccu_desc *desc; +}; + +/** + * sunxi_clk_probe - common sunxi clock probe + * @dev: clock device + */ +int sunxi_clk_probe(struct udevice *dev); + +extern struct clk_ops sunxi_clk_ops; + +/** + * sunxi_reset_bind() - reset binding + * + * @dev: reset device + * @count: reset count + * @return 0 success, or error value + */ +int sunxi_reset_bind(struct udevice *dev, ulong count); + +#endif /* _CLK_SUNXI_H */ diff --git a/include/compiler.h b/include/compiler.h index 27b9843497a..8cf11792e24 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -68,6 +68,9 @@ typedef uint32_t __u32; typedef unsigned int uint; typedef unsigned long ulong; +/* Define these on the host so we can build some target code */ +typedef __u32 u32; + #define uswap_16(x) \ ((((x) & 0xff00) >> 8) | \ (((x) & 0x00ff) << 8)) @@ -151,7 +154,13 @@ typedef unsigned long int uintptr_t; #define MEM_SUPPORT_64BIT_DATA 0 #endif -static inline bool host_build(void) { +/** + * tools_build() - check if we are building host tools + * + * @return true if building for the host, false if for a target + */ +static inline bool tools_build(void) +{ #ifdef USE_HOSTCC return true; #else diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 750e9e04e8f..3f724aa10f4 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -226,6 +226,7 @@ "fi\0" \ \ "scsi_boot=" \ + BOOTENV_RUN_PCI_ENUM \ BOOTENV_RUN_SCSI_INIT \ BOOTENV_SHARED_BLKDEV_BODY(scsi) #define BOOTENV_DEV_SCSI BOOTENV_DEV_BLKDEV diff --git a/include/configs/M5235EVB.h b/include/configs/M5235EVB.h index f983281cc1f..b37c915538c 100644 --- a/include/configs/M5235EVB.h +++ b/include/configs/M5235EVB.h @@ -54,7 +54,7 @@ #define CONFIG_SYS_I2C_PINMUX_CLR ~(GPIO_PAR_FECI2C_SCL_MASK | GPIO_PAR_FECI2C_SDA_MASK) #define CONFIG_SYS_I2C_PINMUX_SET (GPIO_PAR_FECI2C_SCL_I2CSCL | GPIO_PAR_FECI2C_SDA_I2CSDA) -/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ +/* this must be included AFTER the definition of CONFIG COMMANDS (if any) */ #define CONFIG_BOOTFILE "u-boot.bin" #ifdef CONFIG_MCFFEC # define CONFIG_IPADDR 192.162.1.2 diff --git a/include/configs/MPC8560ADS.h b/include/configs/MPC8560ADS.h index 3a9ea032921..dcd538fdf1a 100644 --- a/include/configs/MPC8560ADS.h +++ b/include/configs/MPC8560ADS.h @@ -191,7 +191,6 @@ /* Serial Port */ #define CONFIG_CONS_ON_SCC /* define if console on SCC */ -#undef CONFIG_CONS_NONE /* define if console on something else */ #define CONFIG_SYS_BAUDRATE_TABLE \ {300, 600, 1200, 2400, 4800, 9600, 19200, 38400,115200} diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h index 21e56d68f5d..198b698f21f 100644 --- a/include/configs/P2041RDB.h +++ b/include/configs/P2041RDB.h @@ -203,7 +203,6 @@ unsigned long get_board_sys_clk(unsigned long dummy); #endif /* CONFIG_NAND_FSL_ELBC */ #define CONFIG_SYS_FLASH_EMPTY_INFO -#define CONFIG_SYS_FLASH_AMD_CHECK_DQ7 #define CONFIG_SYS_FLASH_BANKS_LIST {CONFIG_SYS_FLASH_BASE_PHYS + 0x8000000} #define CONFIG_HWCONFIG diff --git a/include/configs/am335x_sl50.h b/include/configs/am335x_sl50.h index dff946801c6..7fbf421149d 100644 --- a/include/configs/am335x_sl50.h +++ b/include/configs/am335x_sl50.h @@ -62,13 +62,6 @@ /* Bootcount using the RTC block */ #define CONFIG_SYS_BOOTCOUNT_BE -#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USB_ETHER) -/* Remove other SPL modes. */ -/* disable host part of MUSB in SPL */ -#undef CONFIG_MUSB_HOST -/* disable EFI partitions and partition UUID support */ -#endif - /* Network. */ #endif /* ! __CONFIG_AM335X_SL50_H */ diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h index 705217067b3..a30bca5147a 100644 --- a/include/configs/clearfog.h +++ b/include/configs/clearfog.h @@ -18,9 +18,6 @@ * U-Boot into it. */ -/* USB/EHCI configuration */ -#define CONFIG_EHCI_IS_TDI - #define CONFIG_ENV_MIN_ENTRIES 128 /* Environment in MMC */ diff --git a/include/configs/colibri-imx6ull.h b/include/configs/colibri-imx6ull.h index 2495193f05d..6b3e1c665a0 100644 --- a/include/configs/colibri-imx6ull.h +++ b/include/configs/colibri-imx6ull.h @@ -163,8 +163,7 @@ /* USB Device Firmware Update support */ #define DFU_DEFAULT_POLL_TIMEOUT 300 -#if defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO) -#define CONFIG_VIDEO_MXS +#if defined(CONFIG_DM_VIDEO) #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h index 07c26e3d0ba..344b266db9e 100644 --- a/include/configs/colibri_imx7.h +++ b/include/configs/colibri_imx7.h @@ -200,8 +200,7 @@ #define CONFIG_USBD_HS -#if defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO) -#define CONFIG_VIDEO_MXS +#if defined(CONFIG_DM_VIDEO) #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO #endif diff --git a/include/configs/controlcenterdc.h b/include/configs/controlcenterdc.h index efd04c6fb8a..21e61e5e8f5 100644 --- a/include/configs/controlcenterdc.h +++ b/include/configs/controlcenterdc.h @@ -27,9 +27,6 @@ #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ CONFIG_SYS_SCSI_MAX_LUN) -/* USB/EHCI configuration */ -#define CONFIG_EHCI_IS_TDI - /* Environment in SPI NOR flash */ #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */ diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h index 7fd1ad14b54..8819935de10 100644 --- a/include/configs/corenet_ds.h +++ b/include/configs/corenet_ds.h @@ -205,7 +205,6 @@ #endif /* CONFIG_NAND_FSL_ELBC */ #define CONFIG_SYS_FLASH_EMPTY_INFO -#define CONFIG_SYS_FLASH_AMD_CHECK_DQ7 #define CONFIG_SYS_FLASH_BANKS_LIST {CONFIG_SYS_FLASH_BASE_PHYS + 0x8000000, CONFIG_SYS_FLASH_BASE_PHYS} #define CONFIG_HWCONFIG diff --git a/include/configs/crs3xx-98dx3236.h b/include/configs/crs3xx-98dx3236.h index 3feaa60edad..27b45a7605d 100644 --- a/include/configs/crs3xx-98dx3236.h +++ b/include/configs/crs3xx-98dx3236.h @@ -13,9 +13,6 @@ #define CONFIG_SYS_BOOTM_LEN (64 * 1024 * 1024) /* 64 MB */ #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage.cfg -/* USB/EHCI configuration */ -#define CONFIG_EHCI_IS_TDI - /* Environment in SPI NOR flash */ /* Keep device tree and initrd in lower memory so the kernel can access them */ diff --git a/include/configs/db-88f6720.h b/include/configs/db-88f6720.h index 95f5cf00568..19fc669f89d 100644 --- a/include/configs/db-88f6720.h +++ b/include/configs/db-88f6720.h @@ -20,7 +20,6 @@ #define CONFIG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE /* USB/EHCI configuration */ -#define CONFIG_EHCI_IS_TDI #define CONFIG_USB_MAX_CONTROLLER_COUNT 3 /* Environment in SPI NOR flash */ diff --git a/include/configs/db-88f6820-amc.h b/include/configs/db-88f6820-amc.h index 41216b8b4fc..1f70c609d23 100644 --- a/include/configs/db-88f6820-amc.h +++ b/include/configs/db-88f6820-amc.h @@ -10,9 +10,6 @@ * High Level Configuration Options (easy to change) */ -/* USB/EHCI configuration */ -#define CONFIG_EHCI_IS_TDI - /* Environment in SPI NOR flash */ #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */ diff --git a/include/configs/db-88f6820-gp.h b/include/configs/db-88f6820-gp.h index 6bae063ae48..41dadfebb94 100644 --- a/include/configs/db-88f6820-gp.h +++ b/include/configs/db-88f6820-gp.h @@ -22,9 +22,6 @@ #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ CONFIG_SYS_SCSI_MAX_LUN) -/* USB/EHCI configuration */ -#define CONFIG_EHCI_IS_TDI - /* Environment in SPI NOR flash */ #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */ diff --git a/include/configs/db-mv784mp-gp.h b/include/configs/db-mv784mp-gp.h index 48471993b88..dbbc33ebf9c 100644 --- a/include/configs/db-mv784mp-gp.h +++ b/include/configs/db-mv784mp-gp.h @@ -21,7 +21,6 @@ #define CONFIG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE /* USB/EHCI configuration */ -#define CONFIG_EHCI_IS_TDI #define CONFIG_USB_MAX_CONTROLLER_COUNT 3 /* Environment in SPI NOR flash */ diff --git a/include/configs/db-xc3-24g4xg.h b/include/configs/db-xc3-24g4xg.h index 2c543fe12a8..6a4c5a7ab55 100644 --- a/include/configs/db-xc3-24g4xg.h +++ b/include/configs/db-xc3-24g4xg.h @@ -12,9 +12,6 @@ #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage.cfg -/* USB/EHCI configuration */ -#define CONFIG_EHCI_IS_TDI - /* Environment in SPI NOR flash */ /* NAND */ diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h index 7af8fceb71a..ee56eb691ad 100644 --- a/include/configs/dh_imx6.h +++ b/include/configs/dh_imx6.h @@ -50,8 +50,6 @@ /* USB Configs */ #ifdef CONFIG_CMD_USB #define CONFIG_EHCI_HCD_INIT_AFTER_RESET -#define CONFIG_USB_HOST_ETHER -#define CONFIG_USB_ETHER_ASIX #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) #define CONFIG_MXC_USB_FLAGS 0 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number */ diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index c54f375689f..900c5fd2333 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -103,7 +103,6 @@ #define CONFIG_SYS_MAX_FLASH_SECT 512 #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT #define CONFIG_SYS_FLASH_SIZE (64 * 1024 * 1024) /* 64 MB */ -/* #define CONFIG_INIT_IGNORE_ERROR */ #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_FLASH_BASE (0x08000000) #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE diff --git a/include/configs/ds414.h b/include/configs/ds414.h index 58ecc5f699d..1f2d2c5e446 100644 --- a/include/configs/ds414.h +++ b/include/configs/ds414.h @@ -24,9 +24,6 @@ #define CONFIG_PCI_SCAN_SHOW #endif -/* USB/EHCI/XHCI configuration */ -#define CONFIG_EHCI_IS_TDI - /* * mv-common.h should be defined after CMD configs since it used them * to enable certain macros diff --git a/include/configs/helios4.h b/include/configs/helios4.h index b5814ed55cf..56d35d6fdbc 100644 --- a/include/configs/helios4.h +++ b/include/configs/helios4.h @@ -18,9 +18,6 @@ * U-Boot into it. */ -/* USB/EHCI configuration */ -#define CONFIG_EHCI_IS_TDI - #define CONFIG_ENV_MIN_ENTRIES 128 /* Environment in MMC */ diff --git a/include/configs/imxrt1050-evk.h b/include/configs/imxrt1050-evk.h index 1b6754299e7..99d25c1e6ef 100644 --- a/include/configs/imxrt1050-evk.h +++ b/include/configs/imxrt1050-evk.h @@ -22,7 +22,6 @@ DMAMEM_SZ_ALL) #ifdef CONFIG_DM_VIDEO -#define CONFIG_VIDEO_MXS #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO diff --git a/include/configs/iot2050.h b/include/configs/iot2050.h index ddb4cfcc8e2..91ed76bb40b 100644 --- a/include/configs/iot2050.h +++ b/include/configs/iot2050.h @@ -17,8 +17,6 @@ #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + \ CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE) -#define CONFIG_SKIP_LOWLEVEL_INIT - #define CONFIG_SPL_MAX_SIZE CONFIG_SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE #define CONFIG_SYS_BOOTM_LEN SZ_64M diff --git a/include/configs/jethub.h b/include/configs/jethub.h new file mode 100644 index 00000000000..35f85095aca --- /dev/null +++ b/include/configs/jethub.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Configuration for JetHome devices + * Copyright (C) 2021 Vyacheslav Bocharov + * Author: Vyacheslav Bocharov <adeep@lexina.in> + */ + +#ifndef __JETHUB_CONFIG_H +#define __JETHUB_CONFIG_H + +#if defined(CONFIG_MESON_AXG) +#define BOOTENV_DEV_RESCUE(devtypeu, devtypel, instance) \ + "bootcmd_rescue=" \ + "if gpio input 10; then " \ + "run bootcmd_usb0;" \ + "fi;\0" +#else +#define BOOTENV_DEV_RESCUE(devtypeu, devtypel, instance) \ + "bootcmd_rescue=" \ + "if test \"${userbutton}\" = \"true\"; then " \ + "run bootcmd_mmc0; " \ + "fi;\0" +#endif + +#define BOOTENV_DEV_NAME_RESCUE(devtypeu, devtypel, instance) \ + "rescue " + +#ifndef BOOT_TARGET_DEVICES +#define BOOT_TARGET_DEVICES(func) \ + func(RESCUE, rescue, na) \ + func(MMC, mmc, 1) \ + func(MMC, mmc, 0) \ + BOOT_TARGET_DEVICES_USB(func) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na) +#endif + +#include <configs/meson64.h> + +#endif /* __JETHUB_CONFIG_H */ diff --git a/include/configs/kp_imx6q_tpc.h b/include/configs/kp_imx6q_tpc.h index 8471dffe832..3061c96e76b 100644 --- a/include/configs/kp_imx6q_tpc.h +++ b/include/configs/kp_imx6q_tpc.h @@ -23,8 +23,6 @@ /* USB Configs */ #ifdef CONFIG_CMD_USB #define CONFIG_EHCI_HCD_INIT_AFTER_RESET -#define CONFIG_USB_HOST_ETHER -#define CONFIG_USB_ETHER_ASIX #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) #define CONFIG_MXC_USB_FLAGS 0 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number */ diff --git a/include/configs/meson64.h b/include/configs/meson64.h index b779363b2b0..cb202d55556 100644 --- a/include/configs/meson64.h +++ b/include/configs/meson64.h @@ -62,6 +62,12 @@ #define BOOT_TARGET_NVME(func) #endif +#ifdef CONFIG_CMD_SCSI + #define BOOT_TARGET_SCSI(func) func(SCSI, scsi, 0) +#else + #define BOOT_TARGET_SCSI(func) +#endif + #ifndef BOOT_TARGET_DEVICES #define BOOT_TARGET_DEVICES(func) \ func(ROMUSB, romusb, na) \ @@ -70,6 +76,7 @@ func(MMC, mmc, 2) \ BOOT_TARGET_DEVICES_USB(func) \ BOOT_TARGET_NVME(func) \ + BOOT_TARGET_SCSI(func) \ func(PXE, pxe, na) \ func(DHCP, dhcp, na) #endif diff --git a/include/configs/mx23evk.h b/include/configs/mx23evk.h index 1f40d98be00..bccba5cbb17 100644 --- a/include/configs/mx23evk.h +++ b/include/configs/mx23evk.h @@ -26,7 +26,7 @@ #endif /* Framebuffer support */ -#ifdef CONFIG_VIDEO +#ifdef CONFIG_DM_VIDEO #define CONFIG_VIDEO_LOGO #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10) #endif diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h index 10292c86fac..fe4ea8997d4 100644 --- a/include/configs/mx28evk.h +++ b/include/configs/mx28evk.h @@ -40,7 +40,7 @@ #endif /* Framebuffer support */ -#ifdef CONFIG_VIDEO +#ifdef CONFIG_DM_VIDEO #define CONFIG_VIDEO_LOGO #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10) #endif diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h index b6232422567..f8118818b01 100644 --- a/include/configs/mx53ppd.h +++ b/include/configs/mx53ppd.h @@ -14,10 +14,6 @@ #define CONFIG_SYS_FSL_CLK /* USB Configs */ -#define CONFIG_USB_HOST_ETHER -#define CONFIG_USB_ETHER_ASIX -#define CONFIG_USB_ETHER_MCS7830 -#define CONFIG_USB_ETHER_SMSC95XX #define CONFIG_MXC_USB_PORT 1 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) #define CONFIG_MXC_USB_FLAGS 0 diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h index 1237ddef8e3..df2bd97438a 100644 --- a/include/configs/mx6sxsabresd.h +++ b/include/configs/mx6sxsabresd.h @@ -161,8 +161,7 @@ #endif #ifndef CONFIG_SPL_BUILD -#ifdef CONFIG_VIDEO -#define CONFIG_VIDEO_MXS +#ifdef CONFIG_DM_VIDEO #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO #define MXS_LCDIF_BASE MX6SX_LCDIF1_BASE_ADDR diff --git a/include/configs/mx6ul_14x14_evk.h b/include/configs/mx6ul_14x14_evk.h index ff2ad094a7d..9ddb47910f3 100644 --- a/include/configs/mx6ul_14x14_evk.h +++ b/include/configs/mx6ul_14x14_evk.h @@ -167,7 +167,6 @@ #ifndef CONFIG_SPL_BUILD #if defined(CONFIG_DM_VIDEO) -#define CONFIG_VIDEO_MXS #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR diff --git a/include/configs/mx7dsabresd.h b/include/configs/mx7dsabresd.h index 397af53bec3..92ce741768d 100644 --- a/include/configs/mx7dsabresd.h +++ b/include/configs/mx7dsabresd.h @@ -126,8 +126,7 @@ #define CONFIG_USBD_HS -#ifdef CONFIG_VIDEO -#define CONFIG_VIDEO_MXS +#ifdef CONFIG_DM_VIDEO #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO #endif diff --git a/include/configs/mxs.h b/include/configs/mxs.h index b5c525dc786..51624a27c46 100644 --- a/include/configs/mxs.h +++ b/include/configs/mxs.h @@ -105,11 +105,6 @@ #endif #endif -/* LCD */ -#ifdef CONFIG_VIDEO -#define CONFIG_VIDEO_MXS -#endif - /* NAND */ #ifdef CONFIG_CMD_NAND #define CONFIG_SYS_MAX_NAND_DEVICE 1 @@ -126,10 +121,4 @@ #define CONFIG_SPI_HALF_DUPLEX #endif -/* USB */ -#ifdef CONFIG_CMD_USB -#define CONFIG_USB_EHCI_MXS -#define CONFIG_EHCI_IS_TDI -#endif - #endif /* __CONFIGS_MXS_H__ */ diff --git a/include/configs/nas220.h b/include/configs/nas220.h index 16bbc9b049f..99b14ba6218 100644 --- a/include/configs/nas220.h +++ b/include/configs/nas220.h @@ -61,14 +61,6 @@ #endif /* CONFIG_CMD_NET */ /* - * USB/EHCI - */ -#ifdef CONFIG_CMD_USB -#define CONFIG_USB_EHCI_KIRKWOOD /* on Kirkwood platform */ -#define CONFIG_EHCI_IS_TDI -#endif /* CONFIG_CMD_USB */ - -/* * File system */ #define CONFIG_JFFS2_NAND diff --git a/include/configs/opos6uldev.h b/include/configs/opos6uldev.h index f9db8efd2fd..d9311a49350 100644 --- a/include/configs/opos6uldev.h +++ b/include/configs/opos6uldev.h @@ -43,7 +43,6 @@ #ifdef CONFIG_DM_VIDEO #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO -#define CONFIG_VIDEO_MXS #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR #endif #endif diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h index 7e36ceed3fe..6fed7522bdd 100644 --- a/include/configs/pico-imx6ul.h +++ b/include/configs/pico-imx6ul.h @@ -135,8 +135,7 @@ */ #define CONFIG_BOARD_SIZE_LIMIT 715776 -#ifdef CONFIG_VIDEO -#define CONFIG_VIDEO_MXS +#ifdef CONFIG_DM_VIDEO #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h index 36c57923dec..c0464278b98 100644 --- a/include/configs/pico-imx7d.h +++ b/include/configs/pico-imx7d.h @@ -126,7 +126,6 @@ #define CONFIG_POWER_PFUZE3000_I2C_ADDR 0x08 #ifdef CONFIG_DM_VIDEO -#define CONFIG_VIDEO_MXS #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO #endif diff --git a/include/configs/pm9263.h b/include/configs/pm9263.h index c13f8de7c18..80899930b29 100644 --- a/include/configs/pm9263.h +++ b/include/configs/pm9263.h @@ -136,8 +136,6 @@ AT91_WDT_MR_WDDIS | \ AT91_WDT_MR_WDD(0xfff)) -#define CONFIG_USER_LOWLEVEL_INIT 1 - /* * Hardware drivers */ diff --git a/include/configs/stih410-b2260.h b/include/configs/stih410-b2260.h index b1917c9d3f5..2fe0900e9f3 100644 --- a/include/configs/stih410-b2260.h +++ b/include/configs/stih410-b2260.h @@ -57,11 +57,6 @@ #define CONFIG_USB_OHCI_NEW #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2 -#define CONFIG_USB_HOST_ETHER -#define CONFIG_USB_ETHER_ASIX -#define CONFIG_USB_ETHER_MCS7830 -#define CONFIG_USB_ETHER_SMSC95XX - /* NET Configs */ #endif /* __CONFIG_H */ diff --git a/include/configs/stm32f429-discovery.h b/include/configs/stm32f429-discovery.h index 525a5277d86..8dddd5449e8 100644 --- a/include/configs/stm32f429-discovery.h +++ b/include/configs/stm32f429-discovery.h @@ -21,15 +21,10 @@ #define CONFIG_RED_LED 110 #define CONFIG_GREEN_LED 109 -#define CONFIG_STM32_FLASH - #define CONFIG_SYS_HZ_CLOCK 1000000 /* Timer is clocked at 1MHz */ #define CONFIG_SYS_CBSIZE 1024 -#define CONFIG_BOOTCOMMAND \ - "run bootcmd_romfs" - #define CONFIG_EXTRA_ENV_SETTINGS \ "bootargs_romfs=uclinux.physaddr=0x08180000 root=/dev/mtdblock0\0" \ "bootcmd_romfs=setenv bootargs ${bootargs} ${bootargs_romfs};" \ diff --git a/include/configs/stm32f429-evaluation.h b/include/configs/stm32f429-evaluation.h index 609b4c2c3be..c490e2d98b3 100644 --- a/include/configs/stm32f429-evaluation.h +++ b/include/configs/stm32f429-evaluation.h @@ -23,8 +23,6 @@ #define CONFIG_SYS_MAX_FLASH_SECT 12 #define CONFIG_SYS_MAX_FLASH_BANKS 2 -#define CONFIG_STM32_FLASH - #define CONFIG_SYS_HZ_CLOCK 1000000 /* Timer is clocked at 1MHz */ #define CONFIG_SYS_CBSIZE 1024 diff --git a/include/configs/stm32f469-discovery.h b/include/configs/stm32f469-discovery.h index a8f6fbf9cff..246dc1f9c66 100644 --- a/include/configs/stm32f469-discovery.h +++ b/include/configs/stm32f469-discovery.h @@ -23,8 +23,6 @@ #define CONFIG_SYS_MAX_FLASH_SECT 12 #define CONFIG_SYS_MAX_FLASH_BANKS 2 -#define CONFIG_STM32_FLASH - #define CONFIG_SYS_HZ_CLOCK 1000000 /* Timer is clocked at 1MHz */ #define CONFIG_SYS_CBSIZE 1024 diff --git a/include/configs/stm32f746-disco.h b/include/configs/stm32f746-disco.h index c76d290a57d..493699e9507 100644 --- a/include/configs/stm32f746-disco.h +++ b/include/configs/stm32f746-disco.h @@ -22,8 +22,6 @@ #define CONFIG_SYS_MAX_FLASH_SECT 8 #define CONFIG_SYS_MAX_FLASH_BANKS 1 -#define CONFIG_STM32_FLASH - #define CONFIG_DW_GMAC_DEFAULT_DMA_PBL (8) #define CONFIG_DW_ALTDESCRIPTOR diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h index 06cd153d135..30d4e8ff1fa 100644 --- a/include/configs/stm32mp1.h +++ b/include/configs/stm32mp1.h @@ -108,7 +108,7 @@ * for serial/usb: execute the stm32prog command * for mmc boot (eMMC, SD card), boot only on the same device * for nand or spi-nand boot, boot with on ubifs partition on UBI partition - * for nor boot, use SD card = mmc0 + * for nor boot, use the default order */ #define STM32MP_BOOTCMD "bootcmd_stm32mp=" \ "echo \"Boot over ${boot_device}${boot_instance}!\";" \ @@ -121,8 +121,6 @@ "if test ${boot_device} = nand ||" \ " test ${boot_device} = spi-nand ;" \ "then env set boot_targets ubifs0; fi;" \ - "if test ${boot_device} = nor;" \ - "then env set boot_targets mmc0; fi;" \ "run distro_bootcmd;" \ "fi;\0" diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 5d8b6052e4f..c576d65efaf 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -160,23 +160,6 @@ #define CONFIG_SPL_PAD_TO 32768 /* decimal for 'dd' */ #endif - -/* I2C */ -#if defined(CONFIG_VIDEO_LCD_PANEL_I2C) -/* We use pin names in Kconfig and sunxi_name_to_gpio() */ -#define CONFIG_SOFT_I2C_GPIO_SDA soft_i2c_gpio_sda -#define CONFIG_SOFT_I2C_GPIO_SCL soft_i2c_gpio_scl -#ifndef __ASSEMBLY__ -extern int soft_i2c_gpio_sda; -extern int soft_i2c_gpio_scl; -#endif -#define CONFIG_VIDEO_LCD_I2C_BUS 0 /* The lcd panel soft i2c is bus 0 */ -#define CONFIG_SYS_SPD_BUS_NUM 1 /* And the axp209 i2c bus is bus 1 */ -#else -#define CONFIG_SYS_SPD_BUS_NUM 0 /* The axp209 i2c bus is bus 0 */ -#define CONFIG_VIDEO_LCD_I2C_BUS -1 /* NA, but necessary to compile */ -#endif - /* Ethernet support */ #ifdef CONFIG_USB_EHCI_HCD diff --git a/include/configs/tegra114-common.h b/include/configs/tegra114-common.h index f714c52bb53..09737211803 100644 --- a/include/configs/tegra114-common.h +++ b/include/configs/tegra114-common.h @@ -58,7 +58,6 @@ #define CONFIG_SPL_STACK 0x800ffffc /* For USB EHCI controller */ -#define CONFIG_EHCI_IS_TDI #define CONFIG_USB_EHCI_TXFIFO_THRESH 0x10 #endif /* _TEGRA114_COMMON_H_ */ diff --git a/include/configs/tegra124-common.h b/include/configs/tegra124-common.h index 4a92954c9be..df688dabd1a 100644 --- a/include/configs/tegra124-common.h +++ b/include/configs/tegra124-common.h @@ -60,7 +60,6 @@ #define CONFIG_SPL_STACK 0x800ffffc /* For USB EHCI controller */ -#define CONFIG_EHCI_IS_TDI #define CONFIG_USB_EHCI_TXFIFO_THRESH 0x10 /* GPU needs setup */ diff --git a/include/configs/tegra20-common.h b/include/configs/tegra20-common.h index 19934a4cf0b..063213cbfeb 100644 --- a/include/configs/tegra20-common.h +++ b/include/configs/tegra20-common.h @@ -78,7 +78,6 @@ * packets depending on the buffer address and size. */ #define CONFIG_USB_EHCI_TXFIFO_THRESH 0x10 -#define CONFIG_EHCI_IS_TDI #define CONFIG_SYS_NAND_SELF_INIT diff --git a/include/configs/tegra210-common.h b/include/configs/tegra210-common.h index b9e04147be3..3ba12bec0ee 100644 --- a/include/configs/tegra210-common.h +++ b/include/configs/tegra210-common.h @@ -44,10 +44,9 @@ "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ "fdtfile=" FDTFILE "\0" \ "fdt_addr_r=0x83000000\0" \ - "ramdisk_addr_r=0x83200000\0" + "ramdisk_addr_r=0x83420000\0" /* For USB EHCI controller */ -#define CONFIG_EHCI_IS_TDI #define CONFIG_USB_EHCI_TXFIFO_THRESH 0x10 /* GPU needs setup */ diff --git a/include/configs/tegra30-common.h b/include/configs/tegra30-common.h index 0ee13a226d9..b878b1a9e69 100644 --- a/include/configs/tegra30-common.h +++ b/include/configs/tegra30-common.h @@ -55,7 +55,6 @@ #define CONFIG_SPL_STACK 0x800ffffc /* For USB EHCI controller */ -#define CONFIG_EHCI_IS_TDI #define CONFIG_USB_EHCI_TXFIFO_THRESH 0x10 #endif /* _TEGRA30_COMMON_H_ */ diff --git a/include/configs/theadorable.h b/include/configs/theadorable.h index 64b7f250920..b43c03d3e8a 100644 --- a/include/configs/theadorable.h +++ b/include/configs/theadorable.h @@ -29,7 +29,6 @@ #define CONFIG_I2C_MVTWSI_BASE1 MVEBU_TWSI1_BASE /* USB/EHCI configuration */ -#define CONFIG_EHCI_IS_TDI #define CONFIG_USB_MAX_CONTROLLER_COUNT 3 /* Environment in SPI NOR flash */ diff --git a/include/configs/thunderx_88xx.h b/include/configs/thunderx_88xx.h index 1ce03473002..600689843bb 100644 --- a/include/configs/thunderx_88xx.h +++ b/include/configs/thunderx_88xx.h @@ -58,7 +58,6 @@ /* Monitor Command Prompt */ #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */ #define CONFIG_SYS_MAXARGS 64 /* max command args */ -#define CONFIG_NO_RELOCATION 1 #define PLL_REF_CLK 50000000 /* 50 MHz */ #define NS_PER_REF_CLK_TICK (1000000000/PLL_REF_CLK) diff --git a/include/configs/total_compute.h b/include/configs/total_compute.h index bbeedaf841d..933a145f993 100644 --- a/include/configs/total_compute.h +++ b/include/configs/total_compute.h @@ -30,6 +30,9 @@ #define PHYS_SDRAM_1_SIZE 0x80000000 - DRAM_SEC_SIZE #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 +#define PHYS_SDRAM_2 0x8080000000 +#define PHYS_SDRAM_2_SIZE 0x180000000 + #define CONFIG_SYS_MMC_MAX_BLK_COUNT 127 #define CONFIG_EXTRA_ENV_SETTINGS \ diff --git a/include/configs/tplink_wdr4300.h b/include/configs/tplink_wdr4300.h index f9a0b7d1aaa..3e76d638c99 100644 --- a/include/configs/tplink_wdr4300.h +++ b/include/configs/tplink_wdr4300.h @@ -41,7 +41,6 @@ /* USB, USB storage, USB ethernet */ #define CONFIG_EHCI_MMIO_BIG_ENDIAN #define CONFIG_EHCI_DESC_BIG_ENDIAN -#define CONFIG_EHCI_IS_TDI /* * Diagnostics diff --git a/include/configs/turris_omnia.h b/include/configs/turris_omnia.h index 8646633ea4c..8d7d5c2bfc3 100644 --- a/include/configs/turris_omnia.h +++ b/include/configs/turris_omnia.h @@ -17,9 +17,6 @@ * U-Boot into it. */ -/* USB/EHCI configuration */ -#define CONFIG_EHCI_IS_TDI - /* Environment in SPI NOR flash */ #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */ diff --git a/include/configs/x530.h b/include/configs/x530.h index d6aec6d7f25..f8b808ec7cd 100644 --- a/include/configs/x530.h +++ b/include/configs/x530.h @@ -45,9 +45,6 @@ /* Additional FS support/configuration */ -/* USB/EHCI configuration */ -#define CONFIG_EHCI_IS_TDI - /* Environment in SPI NOR flash */ #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */ diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index 0c87f19ac36..4de2f94b040 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -55,8 +55,6 @@ #endif #ifdef CONFIG_USB_EHCI_ZYNQ -# define CONFIG_EHCI_IS_TDI - # define DFU_DEFAULT_POLL_TIMEOUT 300 # define CONFIG_THOR_RESET_OFF #endif diff --git a/include/dm/fdtaddr.h b/include/dm/fdtaddr.h index a4fda581a77..d2c19942916 100644 --- a/include/dm/fdtaddr.h +++ b/include/dm/fdtaddr.h @@ -93,6 +93,18 @@ void *devfdt_map_physmem(const struct udevice *dev, unsigned long size); fdt_addr_t devfdt_get_addr_index(const struct udevice *dev, int index); /** + * devfdt_get_addr_index_ptr() - Return indexed pointer to the address of the + * reg property of a device + * + * @dev: Pointer to a device + * @index: the 'reg' property can hold a list of <addr, size> pairs + * and @index is used to select which one is required + * + * @return Pointer to addr, or NULL if there is no such property + */ +void *devfdt_get_addr_index_ptr(const struct udevice *dev, int index); + +/** * devfdt_get_addr_size_index() - Get the indexed reg property of a device * * Returns the address and size specified in the 'reg' property of a device. diff --git a/include/dm/lists.h b/include/dm/lists.h index 1a865525461..5896ae36583 100644 --- a/include/dm/lists.h +++ b/include/dm/lists.h @@ -53,13 +53,14 @@ int lists_bind_drivers(struct udevice *parent, bool pre_reloc_only); * @parent: parent device (root) * @node: device tree node to bind * @devp: if non-NULL, returns a pointer to the bound device + * @drv: if non-NULL, force this driver to be bound * @pre_reloc_only: If true, bind only nodes with special devicetree properties, * or drivers with the DM_FLAG_PRE_RELOC flag. If false bind all drivers. * @return 0 if device was bound, -EINVAL if the device tree is invalid, * other -ve value on error */ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp, - bool pre_reloc_only); + struct driver *drv, bool pre_reloc_only); /** * device_bind_driver() - bind a device to a driver diff --git a/include/dm/read.h b/include/dm/read.h index 5bf34056147..890bf3d8472 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -181,6 +181,18 @@ int dev_read_size(const struct udevice *dev, const char *propname); fdt_addr_t dev_read_addr_index(const struct udevice *dev, int index); /** + * dev_read_addr_index_ptr() - Get the indexed reg property of a device + * as a pointer + * + * @dev: Device to read from + * @index: the 'reg' property can hold a list of <addr, size> pairs + * and @index is used to select which one is required + * + * @return pointer or NULL if not found + */ +void *dev_read_addr_index_ptr(const struct udevice *dev, int index); + +/** * dev_read_addr_size_index() - Get the indexed reg property of a device * * @dev: Device to read from @@ -805,6 +817,12 @@ static inline fdt_addr_t dev_read_addr_index(const struct udevice *dev, return devfdt_get_addr_index(dev, index); } +static inline void *dev_read_addr_index_ptr(const struct udevice *dev, + int index) +{ + return devfdt_get_addr_index_ptr(dev, index); +} + static inline fdt_addr_t dev_read_addr_size_index(const struct udevice *dev, int index, fdt_size_t *size) diff --git a/include/dt-bindings/clock/axg-clkc.h b/include/dt-bindings/clock/axg-clkc.h index fd1f938c38d..93752ea107e 100644 --- a/include/dt-bindings/clock/axg-clkc.h +++ b/include/dt-bindings/clock/axg-clkc.h @@ -70,7 +70,31 @@ #define CLKID_HIFI_PLL 69 #define CLKID_PCIE_CML_EN0 79 #define CLKID_PCIE_CML_EN1 80 -#define CLKID_MIPI_ENABLE 81 #define CLKID_GEN_CLK 84 +#define CLKID_VPU_0_SEL 92 +#define CLKID_VPU_0 93 +#define CLKID_VPU_1_SEL 95 +#define CLKID_VPU_1 96 +#define CLKID_VPU 97 +#define CLKID_VAPB_0_SEL 99 +#define CLKID_VAPB_0 100 +#define CLKID_VAPB_1_SEL 102 +#define CLKID_VAPB_1 103 +#define CLKID_VAPB_SEL 104 +#define CLKID_VAPB 105 +#define CLKID_VCLK 106 +#define CLKID_VCLK2 107 +#define CLKID_VCLK_DIV1 122 +#define CLKID_VCLK_DIV2 123 +#define CLKID_VCLK_DIV4 124 +#define CLKID_VCLK_DIV6 125 +#define CLKID_VCLK_DIV12 126 +#define CLKID_VCLK2_DIV1 127 +#define CLKID_VCLK2_DIV2 128 +#define CLKID_VCLK2_DIV4 129 +#define CLKID_VCLK2_DIV6 130 +#define CLKID_VCLK2_DIV12 131 +#define CLKID_CTS_ENCL 133 +#define CLKID_VDIN_MEAS 136 #endif /* __AXG_CLKC_H */ diff --git a/include/dt-bindings/clock/g12a-clkc.h b/include/dt-bindings/clock/g12a-clkc.h index 40d49940d8a..a93b58c5e18 100644 --- a/include/dt-bindings/clock/g12a-clkc.h +++ b/include/dt-bindings/clock/g12a-clkc.h @@ -147,5 +147,7 @@ #define CLKID_SPICC1_SCLK 261 #define CLKID_NNA_AXI_CLK 264 #define CLKID_NNA_CORE_CLK 267 +#define CLKID_MIPI_DSI_PXCLK_SEL 269 +#define CLKID_MIPI_DSI_PXCLK 270 #endif /* __G12A_CLKC_H */ diff --git a/include/fdt_support.h b/include/fdt_support.h index 72a5b90c97c..88d129c8038 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -7,7 +7,7 @@ #ifndef __FDT_SUPPORT_H #define __FDT_SUPPORT_H -#ifdef CONFIG_OF_LIBFDT +#if defined(CONFIG_OF_LIBFDT) && !defined(USE_HOSTCC) #include <asm/u-boot.h> #include <linux/libfdt.h> diff --git a/include/fdtdec.h b/include/fdtdec.h index 23efbe710cb..239814228d7 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -55,10 +55,6 @@ struct bd_info; #define SPL_BUILD 0 #endif -#ifdef CONFIG_OF_PRIOR_STAGE -extern phys_addr_t prior_stage_fdt_address; -#endif - /* * Information about a resource. start is the first address of the resource * and end is the last address (inclusive). The length of the resource will @@ -977,6 +973,9 @@ static inline int fdtdec_set_phandle(void *blob, int node, uint32_t phandle) return fdt_setprop_u32(blob, node, "phandle", phandle); } +/* add "no-map" property */ +#define FDTDEC_RESERVED_MEMORY_NO_MAP (1 << 0) + /** * fdtdec_add_reserved_memory() - add or find a reserved-memory node * @@ -995,7 +994,8 @@ static inline int fdtdec_set_phandle(void *blob, int node, uint32_t phandle) * }; * uint32_t phandle; * - * fdtdec_add_reserved_memory(fdt, "framebuffer", &fb, &phandle, false); + * fdtdec_add_reserved_memory(fdt, "framebuffer", &fb, NULL, 0, &phandle, + * 0); * * This results in the following subnode being added to the top-level * /reserved-memory node: @@ -1020,14 +1020,17 @@ static inline int fdtdec_set_phandle(void *blob, int node, uint32_t phandle) * @param blob FDT blob * @param basename base name of the node to create * @param carveout information about the carveout region + * @param compatibles list of compatible strings for the carveout region + * @param count number of compatible strings for the carveout region * @param phandlep return location for the phandle of the carveout region * can be NULL if no phandle should be added - * @param no_map add "no-map" property if true + * @param flags bitmask of flags to set for the carveout region * @return 0 on success or a negative error code on failure */ int fdtdec_add_reserved_memory(void *blob, const char *basename, const struct fdt_memory *carveout, - uint32_t *phandlep, bool no_map); + const char **compatibles, unsigned int count, + uint32_t *phandlep, unsigned long flags); /** * fdtdec_get_carveout() - reads a carveout from an FDT @@ -1038,14 +1041,21 @@ int fdtdec_add_reserved_memory(void *blob, const char *basename, * * @param blob FDT blob * @param node name of a node - * @param name name of the property in the given node that contains + * @param prop_name name of the property in the given node that contains * the phandle for the carveout * @param index index of the phandle for which to read the carveout * @param carveout return location for the carveout information + * @param name return location for the carveout name + * @param compatiblesp return location for compatible strings + * @param countp return location for the number of compatible strings + * @param flags return location for the flags of the carveout * @return 0 on success or a negative error code on failure */ -int fdtdec_get_carveout(const void *blob, const char *node, const char *name, - unsigned int index, struct fdt_memory *carveout); +int fdtdec_get_carveout(const void *blob, const char *node, + const char *prop_name, unsigned int index, + struct fdt_memory *carveout, const char **name, + const char ***compatiblesp, unsigned int *countp, + unsigned long *flags); /** * fdtdec_set_carveout() - sets a carveout region for a given node @@ -1063,7 +1073,8 @@ int fdtdec_get_carveout(const void *blob, const char *node, const char *name, * .end = 0x934b2fff, * }; * - * fdtdec_set_carveout(fdt, node, "memory-region", 0, "framebuffer", &fb); + * fdtdec_set_carveout(fdt, node, "memory-region", 0, "framebuffer", NULL, + * 0, &fb, 0); * * dc@54200000 is a display controller and was set up by the bootloader to * scan out the framebuffer specified by "fb". This would cause the following @@ -1100,13 +1111,17 @@ int fdtdec_get_carveout(const void *blob, const char *node, const char *name, * @param prop_name name of the property in which to store the phandle of * the carveout * @param index index of the phandle to store - * @param name base name of the reserved-memory node to create * @param carveout information about the carveout to add + * @param name base name of the reserved-memory node to create + * @param compatibles compatible strings to set for the carveout + * @param count number of compatible strings + * @param flags bitmask of flags to set for the carveout * @return 0 on success or a negative error code on failure */ int fdtdec_set_carveout(void *blob, const char *node, const char *prop_name, - unsigned int index, const char *name, - const struct fdt_memory *carveout); + unsigned int index, const struct fdt_memory *carveout, + const char *name, const char **compatibles, + unsigned int count, unsigned long flags); /** * Set up the device tree ready for use diff --git a/include/gzip.h b/include/gzip.h index 783acbb60d2..cb4db3d70fe 100644 --- a/include/gzip.h +++ b/include/gzip.h @@ -54,11 +54,11 @@ int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp, * gzwrite_progress_finish called at end of loop to * indicate success (retcode=0) or failure */ -void gzwrite_progress_init(u64 expected_size); +void gzwrite_progress_init(ulong expected_size); -void gzwrite_progress(int iteration, u64 bytes_written, u64 total_bytes); +void gzwrite_progress(int iteration, ulong bytes_written, ulong total_bytes); -void gzwrite_progress_finish(int retcode, u64 totalwritten, u64 totalsize, +void gzwrite_progress_finish(int retcode, ulong totalwritten, ulong totalsize, u32 expected_crc, u32 calculated_crc); /** @@ -74,7 +74,7 @@ void gzwrite_progress_finish(int retcode, u64 totalwritten, u64 totalsize, * @return 0 if OK, -1 on error */ int gzwrite(unsigned char *src, int len, struct blk_desc *dev, ulong szwritebuf, - u64 startoffs, u64 szexpected); + ulong startoffs, ulong szexpected); /** * gzip()- Compress data into a buffer using the gzip algorithm diff --git a/include/hash.h b/include/hash.h index 97bb3ed5d9a..cfafbe70064 100644 --- a/include/hash.h +++ b/include/hash.h @@ -6,13 +6,17 @@ #ifndef _HASH_H #define _HASH_H +#ifdef USE_HOSTCC +#include <linux/kconfig.h> +#endif + struct cmd_tbl; /* * Maximum digest size for all algorithms we support. Having this value * avoids a malloc() or C99 local declaration in common/cmd_hash.c. */ -#if defined(CONFIG_SHA384) || defined(CONFIG_SHA512) +#if CONFIG_IS_ENABLED(SHA384) || CONFIG_IS_ENABLED(SHA512) #define HASH_MAX_DIGEST_SIZE 64 #else #define HASH_MAX_DIGEST_SIZE 32 diff --git a/include/image.h b/include/image.h index 73a763a6936..34d13ada84b 100644 --- a/include/image.h +++ b/include/image.h @@ -25,19 +25,8 @@ struct fdt_region; #ifdef USE_HOSTCC #include <sys/types.h> +#include <linux/kconfig.h> -/* new uImage format support enabled on host */ -#define IMAGE_ENABLE_FIT 1 -#define IMAGE_ENABLE_OF_LIBFDT 1 -#define CONFIG_FIT_VERBOSE 1 /* enable fit_format_{error,warning}() */ -#define CONFIG_FIT_RSASSA_PSS 1 -#define CONFIG_MD5 -#define CONFIG_SHA1 -#define CONFIG_SHA256 -#define CONFIG_SHA384 -#define CONFIG_SHA512 - -#define IMAGE_ENABLE_IGNORE 0 #define IMAGE_INDENT_STRING "" #else @@ -47,38 +36,14 @@ struct fdt_region; #include <command.h> #include <linker_lists.h> -/* Take notice of the 'ignore' property for hashes */ -#define IMAGE_ENABLE_IGNORE 1 #define IMAGE_INDENT_STRING " " -#define IMAGE_ENABLE_FIT CONFIG_IS_ENABLED(FIT) -#define IMAGE_ENABLE_OF_LIBFDT CONFIG_IS_ENABLED(OF_LIBFDT) - #endif /* USE_HOSTCC */ -#if IMAGE_ENABLE_FIT #include <hash.h> #include <linux/libfdt.h> #include <fdt_support.h> -#endif /* IMAGE_ENABLE_FIT */ - -#ifdef CONFIG_SYS_BOOT_GET_CMDLINE -# define IMAGE_BOOT_GET_CMDLINE 1 -#else -# define IMAGE_BOOT_GET_CMDLINE 0 -#endif - -#ifdef CONFIG_OF_BOARD_SETUP -# define IMAGE_OF_BOARD_SETUP 1 -#else -# define IMAGE_OF_BOARD_SETUP 0 -#endif - -#ifdef CONFIG_OF_SYSTEM_SETUP -# define IMAGE_OF_SYSTEM_SETUP 1 -#else -# define IMAGE_OF_SYSTEM_SETUP 0 -#endif +#include <u-boot/hash-checksum.h> extern ulong image_load_addr; /* Default Load Address */ extern ulong image_save_addr; /* Default Save Address */ @@ -333,7 +298,11 @@ typedef struct bootm_headers { image_header_t legacy_hdr_os_copy; /* header copy */ ulong legacy_hdr_valid; -#if IMAGE_ENABLE_FIT + /* + * The fit_ members are only used with FIT, but it involves a lot of + * #ifdefs to avoid compiling that code. Since FIT is the standard + * format, even for SPL, this extra data size seems worth it. + */ const char *fit_uname_cfg; /* configuration node unit name */ void *fit_hdr_os; /* os FIT image header */ @@ -351,7 +320,6 @@ typedef struct bootm_headers { void *fit_hdr_setup; /* x86 setup FIT image header */ const char *fit_uname_setup; /* x86 setup subimage node name */ int fit_noffset_setup;/* x86 setup subimage node offset */ -#endif #ifndef USE_HOSTCC image_info_t os; /* os image info */ @@ -538,8 +506,7 @@ int genimg_get_type_id(const char *name); int genimg_get_comp_id(const char *name); void genimg_print_size(uint32_t size); -#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || \ - defined(USE_HOSTCC) +#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || defined(USE_HOSTCC) #define IMAGE_ENABLE_TIMESTAMP 1 #else #define IMAGE_ENABLE_TIMESTAMP 0 @@ -557,12 +524,9 @@ enum fit_load_op { int boot_get_setup(bootm_headers_t *images, uint8_t arch, ulong *setup_start, ulong *setup_len); -#ifndef USE_HOSTCC /* Image format types, returned by _get_format() routine */ #define IMAGE_FORMAT_INVALID 0x00 -#if defined(CONFIG_LEGACY_IMAGE_FORMAT) #define IMAGE_FORMAT_LEGACY 0x01 /* legacy image_header based format */ -#endif #define IMAGE_FORMAT_FIT 0x02 /* new, libfdt based format */ #define IMAGE_FORMAT_ANDROID 0x03 /* Android boot image */ @@ -601,7 +565,6 @@ int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images, */ int boot_get_loadable(int argc, char *const argv[], bootm_headers_t *images, uint8_t arch, const ulong *ld_start, ulong *const ld_len); -#endif /* !USE_HOSTCC */ int boot_get_setup_fit(bootm_headers_t *images, uint8_t arch, ulong *setup_start, ulong *setup_len); @@ -678,7 +641,6 @@ int fit_image_load(bootm_headers_t *images, ulong addr, */ int image_source_script(ulong addr, const char *fit_uname); -#ifndef USE_HOSTCC /** * fit_get_node_from_config() - Look up an image a FIT by type * @@ -718,10 +680,7 @@ int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size); int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len, ulong *initrd_start, ulong *initrd_end); int boot_get_cmdline(struct lmb *lmb, ulong *cmd_start, ulong *cmd_end); -#ifdef CONFIG_SYS_BOOT_GET_KBD int boot_get_kbd(struct lmb *lmb, struct bd_info **kbd); -#endif /* CONFIG_SYS_BOOT_GET_KBD */ -#endif /* !USE_HOSTCC */ /*******************************************************************/ /* Legacy format specific code (prefixed with image_) */ @@ -836,11 +795,9 @@ static inline int image_check_type(const image_header_t *hdr, uint8_t type) } static inline int image_check_arch(const image_header_t *hdr, uint8_t arch) { -#ifndef USE_HOSTCC /* Let's assume that sandbox can load any architecture */ - if (IS_ENABLED(CONFIG_SANDBOX)) + if (!tools_build() && IS_ENABLED(CONFIG_SANDBOX)) return true; -#endif return (image_get_arch(hdr) == arch) || (image_get_arch(hdr) == IH_ARCH_ARM && arch == IH_ARCH_ARM64); } @@ -988,7 +945,6 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size, #define FIT_MAX_HASH_LEN HASH_MAX_DIGEST_SIZE -#if IMAGE_ENABLE_FIT /* cmdline argument format parsing */ int fit_parse_conf(const char *spec, ulong addr_curr, ulong *addr, const char **conf_name); @@ -1162,7 +1118,6 @@ int fit_conf_get_prop_node(const void *fit, int noffset, int fit_check_ramdisk(const void *fit, int os_noffset, uint8_t arch, int verify); -#endif /* IMAGE_ENABLE_FIT */ int calculate_hash(const void *data, int data_len, const char *algo, uint8_t *value, int *value_len); @@ -1185,7 +1140,6 @@ int calculate_hash(const void *data, int data_len, const char *algo, # define FIT_IMAGE_ENABLE_VERIFY CONFIG_IS_ENABLED(FIT_SIGNATURE) #endif -#if IMAGE_ENABLE_FIT #ifdef USE_HOSTCC void *image_get_host_blob(void); void image_set_host_blob(void *host_blob); @@ -1194,8 +1148,6 @@ void image_set_host_blob(void *host_blob); # define gd_fdt_blob() (gd->fdt_blob) #endif -#endif /* IMAGE_ENABLE_FIT */ - /* * Information passed to the signing routines * @@ -1232,9 +1184,6 @@ struct image_region { int size; }; -#if FIT_IMAGE_ENABLE_VERIFY -# include <u-boot/hash-checksum.h> -#endif struct checksum_algo { const char *name; const int checksum_len; @@ -1244,7 +1193,7 @@ struct checksum_algo { const EVP_MD *(*calculate_sign)(void); #endif int (*calculate)(const char *name, - const struct image_region region[], + const struct image_region *region, int region_count, uint8_t *checksum); }; @@ -1340,8 +1289,6 @@ struct crypto_algo *image_get_crypto_algo(const char *full_name); */ struct padding_algo *image_get_padding_algo(const char *name); -#if IMAGE_ENABLE_FIT - /** * fit_image_verify_required_sigs() - Verify signatures marked as 'required' * @@ -1467,23 +1414,6 @@ int fit_image_cipher_get_algo(const void *fit, int noffset, char **algo); struct cipher_algo *image_get_cipher_algo(const char *full_name); -#ifdef CONFIG_FIT_VERBOSE -#define fit_unsupported(msg) printf("! %s:%d " \ - "FIT images not supported for '%s'\n", \ - __FILE__, __LINE__, (msg)) - -#define fit_unsupported_reset(msg) printf("! %s:%d " \ - "FIT images not supported for '%s' " \ - "- must reset board to recover!\n", \ - __FILE__, __LINE__, (msg)) -#else -#define fit_unsupported(msg) -#define fit_unsupported_reset(msg) -#endif /* CONFIG_FIT_VERBOSE */ -#endif /* CONFIG_FIT */ - -#if !defined(USE_HOSTCC) -#if defined(CONFIG_ANDROID_BOOT_IMAGE) struct andr_img_hdr; int android_image_check_header(const struct andr_img_hdr *hdr); int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify, @@ -1499,12 +1429,7 @@ ulong android_image_get_end(const struct andr_img_hdr *hdr); ulong android_image_get_kload(const struct andr_img_hdr *hdr); ulong android_image_get_kcomp(const struct andr_img_hdr *hdr); void android_print_contents(const struct andr_img_hdr *hdr); -#if !defined(CONFIG_SPL_BUILD) bool android_image_print_dtb_contents(ulong hdr_addr); -#endif - -#endif /* CONFIG_ANDROID_BOOT_IMAGE */ -#endif /* !USE_HOSTCC */ /** * board_fit_config_name_match() - Check for a matching board name diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h index d109ed3119e..a1d1a298426 100644 --- a/include/linux/kconfig.h +++ b/include/linux/kconfig.h @@ -31,11 +31,14 @@ (config_enabled(option)) /* - * U-Boot add-on: Helper macros to reference to different macros - * (CONFIG_ or CONFIG_SPL_ prefixed), depending on the build context. + * U-Boot add-on: Helper macros to reference to different macros (prefixed by + * CONFIG_, CONFIG_SPL_, CONFIG_TPL_ or CONFIG_TOOLS_), depending on the build + * context. */ -#if defined(CONFIG_TPL_BUILD) +#ifdef USE_HOSTCC +#define _CONFIG_PREFIX TOOLS_ +#elif defined(CONFIG_TPL_BUILD) #define _CONFIG_PREFIX TPL_ #elif defined(CONFIG_SPL_BUILD) #define _CONFIG_PREFIX SPL_ @@ -49,6 +52,7 @@ /* * CONFIG_VAL(FOO) evaluates to the value of + * CONFIG_TOOLS_FOO if USE_HOSTCC is defined, * CONFIG_FOO if CONFIG_SPL_BUILD is undefined, * CONFIG_SPL_FOO if CONFIG_SPL_BUILD is defined. * CONFIG_TPL_FOO if CONFIG_TPL_BUILD is defined. @@ -76,18 +80,21 @@ /* * CONFIG_IS_ENABLED(FOO) expands to + * 1 if USE_HOSTCC is defined and CONFIG_TOOLS_FOO is set to 'y', * 1 if CONFIG_SPL_BUILD is undefined and CONFIG_FOO is set to 'y', * 1 if CONFIG_SPL_BUILD is defined and CONFIG_SPL_FOO is set to 'y', * 1 if CONFIG_TPL_BUILD is defined and CONFIG_TPL_FOO is set to 'y', * 0 otherwise. * * CONFIG_IS_ENABLED(FOO, (abc)) expands to + * abc if USE_HOSTCC is defined and CONFIG_TOOLS_FOO is set to 'y', * abc if CONFIG_SPL_BUILD is undefined and CONFIG_FOO is set to 'y', * abc if CONFIG_SPL_BUILD is defined and CONFIG_SPL_FOO is set to 'y', * abc if CONFIG_TPL_BUILD is defined and CONFIG_TPL_FOO is set to 'y', * nothing otherwise. * * CONFIG_IS_ENABLED(FOO, (abc), (def)) expands to + * abc if USE_HOSTCC is defined and CONFIG_TOOLS_FOO is set to 'y', * abc if CONFIG_SPL_BUILD is undefined and CONFIG_FOO is set to 'y', * abc if CONFIG_SPL_BUILD is defined and CONFIG_SPL_FOO is set to 'y', * abc if CONFIG_TPL_BUILD is defined and CONFIG_TPL_FOO is set to 'y', diff --git a/include/linux/string.h b/include/linux/string.h index dd255f21633..3169c93796e 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -129,6 +129,19 @@ extern void * memchr(const void *,int,__kernel_size_t); void *memchr_inv(const void *, int, size_t); #endif +/** + * memdup() - allocate a buffer and copy in the contents + * + * Note that this returns a valid pointer even if @len is 0 + * + * @src: data to copy in + * @len: number of bytes to copy + * @return allocated buffer with the copied contents, or NULL if not enough + * memory is available + * + */ +char *memdup(const void *src, size_t len); + unsigned long ustrtoul(const char *cp, char **endp, unsigned int base); unsigned long long ustrtoull(const char *cp, char **endp, unsigned int base); diff --git a/include/linux/zstd.h b/include/linux/zstd.h index 724f69350e0..35ba4c90aa4 100644 --- a/include/linux/zstd.h +++ b/include/linux/zstd.h @@ -1144,4 +1144,15 @@ size_t ZSTD_decompressBlock(ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, size_t ZSTD_insertBlock(ZSTD_DCtx *dctx, const void *blockStart, size_t blockSize); +struct abuf; + +/** + * zstd_decompress() - Decompress Zstandard data + * + * @in: Input buffer to decompress + * @out: Output buffer to hold the results (must be large enough) + * @return size of the decompressed data, or -ve on error + */ +int zstd_decompress(struct abuf *in, struct abuf *out); + #endif /* ZSTD_H */ diff --git a/include/pci.h b/include/pci.h index 11009a2f787..797f224e2fc 100644 --- a/include/pci.h +++ b/include/pci.h @@ -495,6 +495,10 @@ #define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */ #define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ #define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */ +#define PCI_EXP_RTCTL 28 /* Root Control */ +#define PCI_EXP_RTCTL_CRSSVE 0x0010 /* CRS Software Visibility Enable */ +#define PCI_EXP_RTCAP 30 /* Root Capabilities */ +#define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */ #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ #define PCI_EXP_DEVCAP2_ARI 0x00000020 /* ARI Forwarding Supported */ #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ diff --git a/include/relocate.h b/include/relocate.h index 9ceeecdbe71..26682da955f 100644 --- a/include/relocate.h +++ b/include/relocate.h @@ -7,7 +7,11 @@ #ifndef _RELOCATE_H_ #define _RELOCATE_H_ -#include <common.h> +#ifndef USE_HOSTCC +#include <asm/global_data.h> + +DECLARE_GLOBAL_DATA_PTR; +#endif /** * copy_uboot_to_ram() - Copy U-Boot to its new relocated position @@ -35,4 +39,28 @@ int clear_bss(void); */ int do_elf_reloc_fixups(void); +/** + * manual_reloc() - Manually relocate a pointer if needed + * + * This is a nop in almost all cases, except for the systems with a broken gcc + * which need to manually relocate some things. + * + * @ptr: Pointer to relocate + * @return new pointer value + */ +static inline void *manual_reloc(void *ptr) +{ +#ifndef USE_HOSTCC + if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC)) + return ptr + gd->reloc_off; +#endif + return ptr; +} + +#if !defined(USE_HOSTCC) && defined(CONFIG_NEEDS_MANUAL_RELOC) +#define MANUAL_RELOC(ptr) (ptr) = manual_reloc(ptr) +#else +#define MANUAL_RELOC(ptr) (void)(ptr) +#endif + #endif /* _RELOCATE_H_ */ diff --git a/include/u-boot/hash-checksum.h b/include/u-boot/hash-checksum.h index 54e6a73744e..7f16b37a9ab 100644 --- a/include/u-boot/hash-checksum.h +++ b/include/u-boot/hash-checksum.h @@ -7,11 +7,12 @@ #define _RSA_CHECKSUM_H #include <errno.h> -#include <image.h> #include <u-boot/sha1.h> #include <u-boot/sha256.h> #include <u-boot/sha512.h> +struct image_region; + /** * hash_calculate() - Calculate hash over the data * @@ -23,7 +24,7 @@ * @return 0 if OK, < 0 if error */ int hash_calculate(const char *name, - const struct image_region region[], int region_count, + const struct image_region *region, int region_count, uint8_t *checksum); #endif diff --git a/include/lz4.h b/include/u-boot/lz4.h index 1276fb98a34..1276fb98a34 100644 --- a/include/lz4.h +++ b/include/u-boot/lz4.h diff --git a/include/u-boot/rsa.h b/include/u-boot/rsa.h index 89a9c4caa0a..7556aa5b4b7 100644 --- a/include/u-boot/rsa.h +++ b/include/u-boot/rsa.h @@ -103,11 +103,9 @@ int padding_pkcs_15_verify(struct image_sign_info *info, uint8_t *msg, int msg_len, const uint8_t *hash, int hash_len); -#ifdef CONFIG_FIT_RSASSA_PSS int padding_pss_verify(struct image_sign_info *info, uint8_t *msg, int msg_len, const uint8_t *hash, int hash_len); -#endif /* CONFIG_FIT_RSASSA_PSS */ #define RSA_DEFAULT_PADDING_NAME "pkcs-1.5" diff --git a/include/video.h b/include/video.h index 827733305e8..f14fb15f84f 100644 --- a/include/video.h +++ b/include/video.h @@ -64,6 +64,13 @@ enum video_log2_bpp { #define VNBITS(bpix) (1 << (bpix)) +enum video_format { + VIDEO_UNKNOWN, + VIDEO_X8B8G8R8, + VIDEO_X8R8G8B8, + VIDEO_X2R10G10B10, +}; + /** * struct video_priv - Device information used by the video uclass * @@ -71,6 +78,7 @@ enum video_log2_bpp { * @ysize: Number of pixels rows (e.g.. 768) * @rot: Display rotation (0=none, 1=90 degrees clockwise, etc.) * @bpix: Encoded bits per pixel (enum video_log2_bpp) + * @format: Pixel format (enum video_format) * @vidconsole_drv_name: Driver to use for the text console, NULL to * select automatically * @font_size: Font size in pixels (0 to use a default value) @@ -95,6 +103,7 @@ struct video_priv { ushort ysize; ushort rot; enum video_log2_bpp bpix; + enum video_format format; const char *vidconsole_drv_name; int font_size; |