diff options
Diffstat (limited to 'include')
37 files changed, 489 insertions, 183 deletions
diff --git a/include/configs/arbel.h b/include/configs/arbel.h index 61f6a5e2438..b5f684e88fe 100644 --- a/include/configs/arbel.h +++ b/include/configs/arbel.h @@ -16,7 +16,7 @@ { 9600, 14400, 19200, 38400, 57600, 115200, 230400, 380400, 460800, 921600 } /* Default environemnt variables */ -#define CFG_EXTRA_ENV_SETTINGS "uimage_flash_addr=80400000\0" \ +#define CFG_EXTRA_ENV_SETTINGS "uimage_flash_addr=80800000\0" \ "stdin=serial\0" \ "stdout=serial\0" \ "stderr=serial\0" \ diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h index b9cc7ba974d..b75db7e7bac 100644 --- a/include/configs/at91sam9260ek.h +++ b/include/configs/at91sam9260ek.h @@ -35,11 +35,7 @@ #define CFG_SYS_SDRAM_SIZE 0x04000000 #define CFG_SYS_INIT_RAM_SIZE (16 * 1024) -#ifdef CONFIG_AT91SAM9XE -# define CFG_SYS_INIT_RAM_ADDR ATMEL_BASE_SRAM -#else -# define CFG_SYS_INIT_RAM_ADDR ATMEL_BASE_SRAM1 -#endif +#define CFG_SYS_INIT_RAM_ADDR ATMEL_BASE_SRAM1 /* NAND flash */ #ifdef CONFIG_CMD_NAND diff --git a/include/configs/ethernut5.h b/include/configs/ethernut5.h deleted file mode 100644 index c327bbbe07d..00000000000 --- a/include/configs/ethernut5.h +++ /dev/null @@ -1,88 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * (C) Copyright 2011 - * egnite GmbH <info@egnite.de> - * - * Configuation settings for Ethernut 5 with AT91SAM9XE. - */ - -#ifndef __CONFIG_H -#define __CONFIG_H - -#include <asm/hardware.h> - -/* The first stage boot loader expects u-boot running at this address. */ - -/* The first stage boot loader takes care of low level initialization. */ - -/* CPU information */ - -/* ARM asynchronous clock */ -#define CFG_SYS_AT91_SLOW_CLOCK 32768 /* slow clock xtal */ -#define CFG_SYS_AT91_MAIN_CLOCK 18432000 /* 18.432 MHz crystal */ - -/* 32kB internal SRAM */ -#define CFG_SYS_INIT_RAM_ADDR 0x00300000 /*AT91SAM9XE_SRAM_BASE */ -#define CFG_SYS_INIT_RAM_SIZE (32 << 10) - -/* 128MB SDRAM in 1 bank */ -#define CFG_SYS_SDRAM_BASE 0x20000000 -#define CFG_SYS_SDRAM_SIZE (128 << 20) - -/* 512kB on-chip NOR flash */ -# define CFG_SYS_FLASH_BASE 0x00200000 /* AT91SAM9XE_FLASH_BASE */ - -/* bootstrap + u-boot + env + linux in dataflash on CS0 */ - -/* NAND flash */ -#ifdef CONFIG_CMD_NAND -#define CFG_SYS_NAND_BASE 0x40000000 -/* our ALE is AD21 */ -#define CFG_SYS_NAND_MASK_ALE (1 << 21) -/* our CLE is AD22 */ -#define CFG_SYS_NAND_MASK_CLE (1 << 22) -#define CFG_SYS_NAND_ENABLE_PIN GPIO_PIN_PC(14) -#endif - -/* JFFS2 */ - -/* Ethernet */ -#define CFG_PHY_ID 0 - -/* MMC */ -#ifdef CONFIG_CMD_MMC -#define CFG_SYS_MMC_CD_PIN AT91_PIO_PORTC, 8 -#endif - -/* RTC */ -#if defined(CONFIG_CMD_DATE) || defined(CONFIG_CMD_SNTP) -#define CFG_SYS_I2C_RTC_ADDR 0x51 -#endif - -#define I2C_SOFT_DECLARATIONS - -#define GPIO_I2C_SCL AT91_PIO_PORTA, 24 -#define GPIO_I2C_SDA AT91_PIO_PORTA, 23 - -#define I2C_INIT { \ - at91_set_pio_periph(AT91_PIO_PORTA, 23, 0); \ - at91_set_pio_multi_drive(AT91_PIO_PORTA, 23, 1); \ - at91_set_pio_periph(AT91_PIO_PORTA, 24, 0); \ - at91_set_pio_output(AT91_PIO_PORTA, 24, 0); \ - at91_set_pio_multi_drive(AT91_PIO_PORTA, 24, 1); \ -} - -#define I2C_ACTIVE at91_set_pio_output(AT91_PIO_PORTA, 23, 0) -#define I2C_TRISTATE at91_set_pio_input(AT91_PIO_PORTA, 23, 0) -#define I2C_SCL(bit) at91_set_pio_value(AT91_PIO_PORTA, 24, bit) -#define I2C_SDA(bit) at91_set_pio_value(AT91_PIO_PORTA, 23, bit) -#define I2C_DELAY udelay(100) -#define I2C_READ at91_get_pio_value(AT91_PIO_PORTA, 23) - -/* File systems */ - -/* Boot command */ - -/* Misc. u-boot settings */ - -#endif diff --git a/include/configs/ibex_ast2700.h b/include/configs/ibex_ast2700.h new file mode 100644 index 00000000000..0f6850f7240 --- /dev/null +++ b/include/configs/ibex_ast2700.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) Aspeed Technology Inc. + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CFG_SYS_UBOOT_BASE CONFIG_TEXT_BASE +#define CFG_SYS_SDRAM_BASE 0x80000000 + +#endif /* __CONFIG_H */ diff --git a/include/configs/lxr2.h b/include/configs/lxr2.h new file mode 100644 index 00000000000..d8d37a42228 --- /dev/null +++ b/include/configs/lxr2.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +// Copyright (C) Stefano Babic <sbabic@denx.de> + +#ifndef __LXR2_CONFIG_H +#define __LXR2_CONFIG_H + +#include <config_distro_bootcmd.h> + +#include "mx6_common.h" + +#define PHYS_SDRAM_SIZE SZ_1G + +/* Physical Memory Map */ +#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR + +#define CFG_SYS_SDRAM_BASE PHYS_SDRAM +#define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR +#define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE + +#define CFG_SYS_FSL_ESDHC_ADDR 0 +#define CFG_MXC_UART_BASE UART4_BASE + +#endif diff --git a/include/configs/sc573-ezkit.h b/include/configs/sc573-ezkit.h new file mode 100644 index 00000000000..42e42f8150b --- /dev/null +++ b/include/configs/sc573-ezkit.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#ifndef __CONFIG_SC573_EZKIT_H +#define __CONFIG_SC573_EZKIT_H + +/* + * Memory Settings + */ +#define MEM_MT41K128M16JT +#define MEM_DMC0 + +#define CFG_SYS_SDRAM_BASE 0x82000000 +#define CFG_SYS_SDRAM_SIZE 0xe000000 + +#endif diff --git a/include/configs/sc584-ezkit.h b/include/configs/sc584-ezkit.h new file mode 100644 index 00000000000..905836cc2cf --- /dev/null +++ b/include/configs/sc584-ezkit.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#ifndef __CONFIG_SC584_EZKIT_H +#define __CONFIG_SC584_EZKIT_H + +/* + * Memory Settings + */ +#define MEM_MT47H128M16RT +#define MEM_DMC0 + +#define CFG_SYS_SDRAM_BASE 0x89000000 +#define CFG_SYS_SDRAM_SIZE 0x7000000 + +#endif diff --git a/include/configs/sc589.h b/include/configs/sc589.h new file mode 100644 index 00000000000..137c80be8e5 --- /dev/null +++ b/include/configs/sc589.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#ifndef __CONFIG_SC589_H +#define __CONFIG_SC589_H + +/* + * Memory Settings + */ +#define MEM_MT41K128M16JT +#define MEM_DMC0 +#define MEM_DMC1 + +#define CFG_SYS_SDRAM_BASE 0xC2000000 +#define CFG_SYS_SDRAM_SIZE 0xe000000 + +#endif diff --git a/include/configs/sc594-som.h b/include/configs/sc594-som.h new file mode 100644 index 00000000000..ba9b0cdb0c0 --- /dev/null +++ b/include/configs/sc594-som.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#ifndef __CONFIG_SC594_SOM_H +#define __CONFIG_SC594_SOM_H + +/* + * Memory Settings + */ +#define MEM_IS43TR16512BL +#define MEM_ISSI_8Gb_DDR3_800MHZ +#define MEM_DMC0 + +#define CFG_SYS_SDRAM_BASE 0xA0000000 +#define CFG_SYS_SDRAM_SIZE 0x20000000 + +#endif diff --git a/include/configs/sc598-som.h b/include/configs/sc598-som.h new file mode 100644 index 00000000000..964c694bbe7 --- /dev/null +++ b/include/configs/sc598-som.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) Copyright 2024 - Analog Devices, Inc. + */ + +#ifndef __CONFIG_SC598_SOM_H +#define __CONFIG_SC598_SOM_H + +/* + * Memory Settings + */ +#define MEM_IS43TR16512BL +#define MEM_ISSI_4Gb_DDR3_800MHZ +#define MEM_DMC0 + +#define CFG_SYS_SDRAM_BASE 0x90000000 +#define CFG_SYS_SDRAM_SIZE 0x0e000000 + +/* GIC */ +#define GICD_BASE 0x31200000 +#define GICR_BASE 0x31240000 + +#endif diff --git a/include/console.h b/include/console.h index 6b6d0f9de73..57fdb0834c1 100644 --- a/include/console.h +++ b/include/console.h @@ -179,6 +179,14 @@ void console_puts_select_stderr(bool serial_only, const char *s); */ int console_clear(void); +/** + * console_remove_by_name() - Remove a console by its stdio name + * + * This must only be used in tests. It removes any use of the named stdio device + * from the console tables. + */ +int console_remove_by_name(const char *name); + /* * CONSOLE multiplexing. */ diff --git a/include/dt-bindings/clock/sophgo,cv1800.h b/include/dt-bindings/clock/sophgo,cv1800.h new file mode 100644 index 00000000000..cfbeca25a65 --- /dev/null +++ b/include/dt-bindings/clock/sophgo,cv1800.h @@ -0,0 +1,176 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ +/* + * Copyright (C) 2023 Sophgo Ltd. + */ + +#ifndef __DT_BINDINGS_SOPHGO_CV1800_CLK_H__ +#define __DT_BINDINGS_SOPHGO_CV1800_CLK_H__ + +#define CLK_MPLL 0 +#define CLK_TPLL 1 +#define CLK_FPLL 2 +#define CLK_MIPIMPLL 3 +#define CLK_A0PLL 4 +#define CLK_DISPPLL 5 +#define CLK_CAM0PLL 6 +#define CLK_CAM1PLL 7 + +#define CLK_MIPIMPLL_D3 8 +#define CLK_CAM0PLL_D2 9 +#define CLK_CAM0PLL_D3 10 + +#define CLK_TPU 11 +#define CLK_TPU_FAB 12 +#define CLK_AHB_ROM 13 +#define CLK_DDR_AXI_REG 14 +#define CLK_RTC_25M 15 +#define CLK_SRC_RTC_SYS_0 16 +#define CLK_TEMPSEN 17 +#define CLK_SARADC 18 +#define CLK_EFUSE 19 +#define CLK_APB_EFUSE 20 +#define CLK_DEBUG 21 +#define CLK_AP_DEBUG 22 +#define CLK_XTAL_MISC 23 +#define CLK_AXI4_EMMC 24 +#define CLK_EMMC 25 +#define CLK_EMMC_100K 26 +#define CLK_AXI4_SD0 27 +#define CLK_SD0 28 +#define CLK_SD0_100K 29 +#define CLK_AXI4_SD1 30 +#define CLK_SD1 31 +#define CLK_SD1_100K 32 +#define CLK_SPI_NAND 33 +#define CLK_ETH0_500M 34 +#define CLK_AXI4_ETH0 35 +#define CLK_ETH1_500M 36 +#define CLK_AXI4_ETH1 37 +#define CLK_APB_GPIO 38 +#define CLK_APB_GPIO_INTR 39 +#define CLK_GPIO_DB 40 +#define CLK_AHB_SF 41 +#define CLK_AHB_SF1 42 +#define CLK_A24M 43 +#define CLK_AUDSRC 44 +#define CLK_APB_AUDSRC 45 +#define CLK_SDMA_AXI 46 +#define CLK_SDMA_AUD0 47 +#define CLK_SDMA_AUD1 48 +#define CLK_SDMA_AUD2 49 +#define CLK_SDMA_AUD3 50 +#define CLK_I2C 51 +#define CLK_APB_I2C 52 +#define CLK_APB_I2C0 53 +#define CLK_APB_I2C1 54 +#define CLK_APB_I2C2 55 +#define CLK_APB_I2C3 56 +#define CLK_APB_I2C4 57 +#define CLK_APB_WDT 58 +#define CLK_PWM_SRC 59 +#define CLK_PWM 60 +#define CLK_SPI 61 +#define CLK_APB_SPI0 62 +#define CLK_APB_SPI1 63 +#define CLK_APB_SPI2 64 +#define CLK_APB_SPI3 65 +#define CLK_1M 66 +#define CLK_CAM0_200 67 +#define CLK_PM 68 +#define CLK_TIMER0 69 +#define CLK_TIMER1 70 +#define CLK_TIMER2 71 +#define CLK_TIMER3 72 +#define CLK_TIMER4 73 +#define CLK_TIMER5 74 +#define CLK_TIMER6 75 +#define CLK_TIMER7 76 +#define CLK_UART0 77 +#define CLK_APB_UART0 78 +#define CLK_UART1 79 +#define CLK_APB_UART1 80 +#define CLK_UART2 81 +#define CLK_APB_UART2 82 +#define CLK_UART3 83 +#define CLK_APB_UART3 84 +#define CLK_UART4 85 +#define CLK_APB_UART4 86 +#define CLK_APB_I2S0 87 +#define CLK_APB_I2S1 88 +#define CLK_APB_I2S2 89 +#define CLK_APB_I2S3 90 +#define CLK_AXI4_USB 91 +#define CLK_APB_USB 92 +#define CLK_USB_125M 93 +#define CLK_USB_33K 94 +#define CLK_USB_12M 95 +#define CLK_AXI4 96 +#define CLK_AXI6 97 +#define CLK_DSI_ESC 98 +#define CLK_AXI_VIP 99 +#define CLK_SRC_VIP_SYS_0 100 +#define CLK_SRC_VIP_SYS_1 101 +#define CLK_SRC_VIP_SYS_2 102 +#define CLK_SRC_VIP_SYS_3 103 +#define CLK_SRC_VIP_SYS_4 104 +#define CLK_CSI_BE_VIP 105 +#define CLK_CSI_MAC0_VIP 106 +#define CLK_CSI_MAC1_VIP 107 +#define CLK_CSI_MAC2_VIP 108 +#define CLK_CSI0_RX_VIP 109 +#define CLK_CSI1_RX_VIP 110 +#define CLK_ISP_TOP_VIP 111 +#define CLK_IMG_D_VIP 112 +#define CLK_IMG_V_VIP 113 +#define CLK_SC_TOP_VIP 114 +#define CLK_SC_D_VIP 115 +#define CLK_SC_V1_VIP 116 +#define CLK_SC_V2_VIP 117 +#define CLK_SC_V3_VIP 118 +#define CLK_DWA_VIP 119 +#define CLK_BT_VIP 120 +#define CLK_DISP_VIP 121 +#define CLK_DSI_MAC_VIP 122 +#define CLK_LVDS0_VIP 123 +#define CLK_LVDS1_VIP 124 +#define CLK_PAD_VI_VIP 125 +#define CLK_PAD_VI1_VIP 126 +#define CLK_PAD_VI2_VIP 127 +#define CLK_CFG_REG_VIP 128 +#define CLK_VIP_IP0 129 +#define CLK_VIP_IP1 130 +#define CLK_VIP_IP2 131 +#define CLK_VIP_IP3 132 +#define CLK_IVE_VIP 133 +#define CLK_RAW_VIP 134 +#define CLK_OSDC_VIP 135 +#define CLK_CAM0_VIP 136 +#define CLK_AXI_VIDEO_CODEC 137 +#define CLK_VC_SRC0 138 +#define CLK_VC_SRC1 139 +#define CLK_VC_SRC2 140 +#define CLK_H264C 141 +#define CLK_APB_H264C 142 +#define CLK_H265C 143 +#define CLK_APB_H265C 144 +#define CLK_JPEG 145 +#define CLK_APB_JPEG 146 +#define CLK_CAM0 147 +#define CLK_CAM1 148 +#define CLK_WGN 149 +#define CLK_WGN0 150 +#define CLK_WGN1 151 +#define CLK_WGN2 152 +#define CLK_KEYSCAN 153 +#define CLK_CFG_REG_VC 154 +#define CLK_C906_0 155 +#define CLK_C906_1 156 +#define CLK_A53 157 +#define CLK_CPU_AXI0 158 +#define CLK_CPU_GIC 159 +#define CLK_XTAL_AP 160 + +// Only for CV181x +#define CLK_DISP_SRC_VIP 161 + +#endif /* __DT_BINDINGS_SOPHGO_CV1800_CLK_H__ */ diff --git a/include/efi.h b/include/efi.h index d5af2139946..84640cf7b25 100644 --- a/include/efi.h +++ b/include/efi.h @@ -74,7 +74,7 @@ struct efi_device_path { * struct { u32 a; u16; b; u16 c; u8 d[8]; }; which is 4-byte * aligned. */ -typedef struct { +typedef struct efi_guid { u8 b[16]; } efi_guid_t __attribute__((aligned(4))); diff --git a/include/efi_variable.h b/include/efi_variable.h index 223bb9a4a5b..4065cf45eca 100644 --- a/include/efi_variable.h +++ b/include/efi_variable.h @@ -38,7 +38,7 @@ efi_status_t efi_get_variable_int(const u16 *variable_name, void *data, u64 *timep); /** - * efi_set_variable() - set value of a UEFI variable + * efi_set_variable_int() - set value of a UEFI variable * * @variable_name: name of the variable * @vendor: vendor GUID diff --git a/include/env/phytec/k3_mmc.env b/include/env/phytec/k3_mmc.env index 3d3595ceb7e..ad8d3a8b764 100644 --- a/include/env/phytec/k3_mmc.env +++ b/include/env/phytec/k3_mmc.env @@ -7,15 +7,17 @@ /* Logic for TI K3 based SoCs to boot from a MMC device. */ #include <env/phytec/overlays.env> +#include <env/phytec/rauc.env> mmcargs=setenv bootargs console=${console} earlycon=${earlycon} - root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw -loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} Image -loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile} -mmcboot=run mmcargs; + root=/dev/mmcblk${mmcdev}p${mmcroot} ${raucargs} rootwait rw +mmcloadimage=load mmc ${mmcdev}:${mmcpart} ${kernel_addr_r} Image +mmcloadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile} +mmcboot=if test ${doraucboot} = 1; then run raucinit; fi; + run mmcargs; mmc dev ${mmcdev}; mmc rescan; - run loadimage; - run loadfdt; + run mmcloadimage; + run mmcloadfdt; run mmc_apply_overlays; - booti ${loadaddr} - ${fdt_addr_r} + booti ${kernel_addr_r} - ${fdt_addr_r} diff --git a/include/env/phytec/k3_net.env b/include/env/phytec/k3_net.env new file mode 100644 index 00000000000..377e406688d --- /dev/null +++ b/include/env/phytec/k3_net.env @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2024 PHYTEC Messtechnik GmbH + * Author: Daniel Schultz <d.schultz@phytec.de> + */ + +/* Logic for TI K3 based SoCs to boot via network. */ + +#include <env/phytec/overlays.env> + +netargs=setenv bootargs console=${console} root=/dev/nfs ip=dhcp rw + nfsroot=${serverip}:${nfsroot},vers=4,tcp +netloadimage=${net_fetch_cmd} ${kernel_addr_r} ${serverip}:/Image +netloadfdt=${net_fetch_cmd} ${fdt_addr_r} ${serverip}:/${fdtfile} +netboot=run netargs; + setenv autoload no; + dhcp; + run netloadimage; + run netloadfdt; + run net_apply_overlays; + run net_apply_extensions; + booti ${kernel_addr_r} - ${fdt_addr_r} diff --git a/include/env/phytec/k3_spi.env b/include/env/phytec/k3_spi.env new file mode 100644 index 00000000000..97d3a157058 --- /dev/null +++ b/include/env/phytec/k3_spi.env @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2024 PHYTEC Messtechnik GmbH + * Author: Daniel Schultz <d.schultz@phytec.de> + */ + +/* Logic for TI K3 based SoCs to boot from an OSPI/QSPI NOR flash. */ + +spiargs=setenv bootargs console=${console} earlycon=${earlycon} +spiloadimage=sf read ${kernel_addr_r} ${spi_image_addr} ${size_kern} +spiloadfdt=sf read ${fdt_addr_r} ${spi_fdt_addr} ${size_fdt} +spiloadramdisk=sf read ${ramdisk_addr_r} ${spi_ramdisk_addr} ${size_fs} +spiboot=run spiargs; + sf probe; + run spiloadimage; + run spiloadfdt; + run spiloadramdisk; + booti ${kernel_addr_r} ${ramdisk_addr_r}:0x${size_fs} ${fdt_addr_r} diff --git a/include/env/ti/android.env b/include/env/ti/android.env new file mode 100644 index 00000000000..a058beb7fc4 --- /dev/null +++ b/include/env/ti/android.env @@ -0,0 +1,31 @@ +/* Android partitions + * += is needed because \n is converted by space in .env files */ +partitions=name=bootloader,start=5M,size=8M,uuid=${uuid_gpt_bootloader}; +partitions+=name=tiboot3,start=4M,size=1M,uuid=${uuid_gpt_tiboot3}; +partitions+=name=misc,start=13824K,size=512K,uuid=${uuid_gpt_misc}; +partitions+=name=frp,size=512K,uuid=${uuid_gpt_frp}; +partitions+=name=boot_a,size=40M,uuid=${uuid_gpt_boot_a}; +partitions+=name=boot_b,size=40M,uuid=${uuid_gpt_boot_b}; +partitions+=name=vendor_boot_a,size=32M,uuid=${uuid_gpt_vendor_boot_a}; +partitions+=name=vendor_boot_b,size=32M,uuid=${uuid_gpt_vendor_boot_b}; +partitions+=name=init_boot_a,size=8M,uuid=${uuid_gpt_init_boot_a}; +partitions+=name=init_boot_b,size=8M,uuid=${uuid_gpt_init_boot_b}; +partitions+=name=dtbo_a,size=8M,uuid=${uuid_gpt_dtbo_a}; +partitions+=name=dtbo_b,size=8M,uuid=${uuid_gpt_dtbo_b}; +partitions+=name=vbmeta_a,size=64K,uuid=${uuid_gpt_vbmeta_a}; +partitions+=name=vbmeta_b,size=64K,uuid=${uuid_gpt_vbmeta_b}; +partitions+=name=vbmeta_vendor_dlkm_a,size=64K,uuid=${uuid_gpt_vbmeta_vendor_dlkm_a}; +partitions+=name=vbmeta_vendor_dlkm_b,size=64K,uuid=${uuid_gpt_vbmeta_vendor_dlkm_b}; +partitions+=name=super,size=4608M,uuid=${uuid_gpt_super}; +partitions+=name=metadata,size=64M,uuid=${uuid_gpt_metadata}; +partitions+=name=persist,size=32M,uuid=${uuid_gpt_persist}; +partitions+=name=userdata,size=-,uuid=${uuid_gpt_userdata} + +fastboot_raw_partition_bootenv=0x800 0x400 mmcpart 1 +fastboot.partition-type:metadata=f2fs + +boot_targets=mmc0 +mmcdev=0 +bootmeths=android +vendor_boot_comp_addr_r=0xd0000000 +bootcmd=bootflow scan -lb diff --git a/include/event.h b/include/event.h index fb353ad623e..75141a192a4 100644 --- a/include/event.h +++ b/include/event.h @@ -385,7 +385,7 @@ static inline int event_notify_null(enum event_t type) int event_uninit(void); /** - * event_uninit() - Set up dynamic events + * event_init() - Set up dynamic events * * Init a list of dynamic event handlers, so that these can be added as * needed diff --git a/include/expo.h b/include/expo.h index 264745f7f01..c235fa2709d 100644 --- a/include/expo.h +++ b/include/expo.h @@ -42,7 +42,7 @@ enum expoact_type { * * @type: Action type (EXPOACT_NONE if there is no action) * @select: Used for EXPOACT_POINT_ITEM and EXPOACT_SELECT - * @id: ID number of the object affected. + * @select.id: ID number of the object affected. */ struct expo_action { enum expoact_type type; diff --git a/include/flash.h b/include/flash.h index 60babe8a805..32bc65e7b60 100644 --- a/include/flash.h +++ b/include/flash.h @@ -127,16 +127,16 @@ void flash_perror(int err); /*----------------------------------------------------------------------- * return codes from flash_write(): */ -#define ERR_OK 0 -#define ERR_TIMEOUT 1 -#define ERR_NOT_ERASED 2 -#define ERR_PROTECTED 4 -#define ERR_INVAL 8 -#define ERR_ALIGN 16 -#define ERR_UNKNOWN_FLASH_VENDOR 32 -#define ERR_UNKNOWN_FLASH_TYPE 64 -#define ERR_PROG_ERROR 128 -#define ERR_ABORTED 256 +#define FL_ERR_OK 0 +#define FL_ERR_TIMEOUT 1 +#define FL_ERR_NOT_ERASED 2 +#define FL_ERR_PROTECTED 4 +#define FL_ERR_INVAL 8 +#define FL_ERR_ALIGN 16 +#define FL_ERR_UNKNOWN_FLASH_VENDOR 32 +#define FL_ERR_UNKNOWN_FLASH_TYPE 64 +#define FL_ERR_PROG_ERROR 128 +#define FL_ERR_ABORTED 256 /*----------------------------------------------------------------------- * Protection Flags for flash_protect(): diff --git a/include/fwu.h b/include/fwu.h index 77ec65e6180..6441de370c9 100644 --- a/include/fwu.h +++ b/include/fwu.h @@ -10,7 +10,7 @@ #include <efi.h> #include <fwu_mdata.h> #include <mtd.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <linux/types.h> @@ -417,4 +417,15 @@ int fwu_state_machine_updates(bool trial_state, uint32_t update_index); */ int fwu_init(void); +/** + * fwu_bank_accepted() - Has the bank been accepted + * @data: Version agnostic FWU metadata information + * @bank: Update bank to check + * + * Check in the given bank if all the images have been accepted. + * + * Return: true if all images accepted, false otherwise + */ +bool fwu_bank_accepted(struct fwu_data *data, uint32_t bank); + #endif /* _FWU_H_ */ diff --git a/include/generic-phy.h b/include/generic-phy.h index eaab7491660..ba3321f4849 100644 --- a/include/generic-phy.h +++ b/include/generic-phy.h @@ -415,10 +415,13 @@ int generic_phy_power_off_bulk(struct phy_bulk *bulk); * @dev: The consumer device. * @phy: A pointer to the PHY port * @index: The index in the list of available PHYs + * @mode: PHY mode + * @submode: PHY submode * * Return: 0 if OK, or negative error code. */ -int generic_setup_phy(struct udevice *dev, struct phy *phy, int index); +int generic_setup_phy(struct udevice *dev, struct phy *phy, int index, + enum phy_mode mode, int submode); /** * generic_shutdown_phy() - Power off and de-initialize phy. @@ -509,7 +512,8 @@ static inline int generic_phy_power_off_bulk(struct phy_bulk *bulk) return 0; } -static inline int generic_setup_phy(struct udevice *dev, struct phy *phy, int index) +static inline int generic_setup_phy(struct udevice *dev, struct phy *phy, int index, + enum phy_mode mode, int submode) { return 0; } diff --git a/include/getopt.h b/include/getopt.h index 8645082da2a..0cf7ee84d6f 100644 --- a/include/getopt.h +++ b/include/getopt.h @@ -20,11 +20,9 @@ struct getopt_state { * parsed all of @argv, then @index will equal @argc. */ int index; - /* private: */ /** @arg_index: Index within the current argument */ int arg_index; union { - /* public: */ /** * @opt: Option being parsed when an error occurs. @opt is only * valid when getopt() returns ``?`` or ``:``. @@ -35,7 +33,6 @@ struct getopt_state { * is only valid when getopt() returns an option character. */ char *arg; - /* private: */ }; }; diff --git a/include/lmb.h b/include/lmb.h index fc2daaa7bfc..aee2f9fcdaa 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -111,6 +111,11 @@ struct lmb *lmb_get(void); int lmb_push(struct lmb *store); void lmb_pop(struct lmb *store); +static inline int lmb_read_check(phys_addr_t addr, phys_size_t len) +{ + return lmb_alloc_addr(addr, len) == addr ? 0 : -1; +} + #endif /* __KERNEL__ */ #endif /* _LINUX_LMB_H */ diff --git a/include/log.h b/include/log.h index 69dcb339543..7c25bf0b081 100644 --- a/include/log.h +++ b/include/log.h @@ -104,6 +104,8 @@ enum log_category_t { LOGC_FS, /** @LOGC_EXPO: Related to expo handling */ LOGC_EXPO, + /** @LOGC_CONSOLE: Related to the console and stdio */ + LOGC_CONSOLE, /** @LOGC_COUNT: Number of log categories */ LOGC_COUNT, /** @LOGC_END: Sentinel value for lists of log categories */ diff --git a/include/mmc.h b/include/mmc.h index f508cd15700..0044ff8bef7 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -14,6 +14,7 @@ #include <linux/sizes.h> #include <linux/compiler.h> #include <linux/dma-direction.h> +#include <cyclic.h> #include <part.h> struct bd_info; @@ -757,6 +758,8 @@ struct mmc { bool hs400_tuning:1; enum bus_mode user_speed_mode; /* input speed mode from user */ + + CONFIG_IS_ENABLED(CYCLIC, (struct cyclic_info cyclic)); }; #if CONFIG_IS_ENABLED(DM_MMC) diff --git a/include/os.h b/include/os.h index 4371270a1ee..ae3ca6d42a2 100644 --- a/include/os.h +++ b/include/os.h @@ -24,7 +24,7 @@ struct sandbox_state; int os_printf(const char *format, ...); /** - * Access to the OS read() system call + * os_read() - access the OS read() system call * * @fd: File descriptor as returned by os_open() * @buf: Buffer to place data @@ -34,7 +34,7 @@ int os_printf(const char *format, ...); ssize_t os_read(int fd, void *buf, size_t count); /** - * Access to the OS write() system call + * os_write() - access the OS write() system call * * @fd: File descriptor as returned by os_open() * @buf: Buffer containing data to write @@ -44,7 +44,7 @@ ssize_t os_read(int fd, void *buf, size_t count); ssize_t os_write(int fd, const void *buf, size_t count); /** - * Access to the OS lseek() system call + * os_lseek() - access the OS lseek() system call * * @fd: File descriptor as returned by os_open() * @offset: File offset (based on whence) @@ -67,7 +67,7 @@ off_t os_lseek(int fd, off_t offset, int whence); off_t os_filesize(int fd); /** - * Access to the OS open() system call + * os_open() - access the OS open() system call * * @pathname: Pathname of file to open * @flags: Flags, like OS_O_RDONLY, OS_O_RDWR @@ -162,7 +162,7 @@ void os_raise_sigalrm(void); void os_tty_raw(int fd, bool allow_sigs); /** - * os_fs_restore() - restore the tty to its original mode + * os_fd_restore() - restore the tty to its original mode * * Call this to restore the original terminal mode, after it has been changed * by os_tty_raw(). This is an internal function. @@ -207,14 +207,14 @@ void *os_realloc(void *ptr, size_t length); void os_usleep(unsigned long usec); /** - * Gets a monotonic increasing number of nano seconds from the OS + * os_get_nsec() - get monotonically increasing number of nano seconds from OS * - * Return: a monotonic increasing time scaled in nano seconds + * Return: a monotoniccally increasing time scaled in nano seconds */ uint64_t os_get_nsec(void); /** - * Parse arguments and update sandbox state. + * os_parse_args() - parse arguments and update sandbox state. * * @state: sandbox state to update * @argc: argument count diff --git a/include/part.h b/include/part.h index 54b986cee63..797b542ef1f 100644 --- a/include/part.h +++ b/include/part.h @@ -8,7 +8,7 @@ #include <blk.h> #include <ide.h> -#include <uuid.h> +#include <u-boot/uuid.h> #include <linker_lists.h> #include <linux/errno.h> #include <linux/list.h> diff --git a/include/power/pca9450.h b/include/power/pca9450.h index b8219d535ad..f896d829d37 100644 --- a/include/power/pca9450.h +++ b/include/power/pca9450.h @@ -54,6 +54,8 @@ enum { PCA9450_REG_NUM, }; +#define PCA9450_REG_PWRCTRL_TOFF_DEB BIT(5) + int power_pca9450_init(unsigned char bus, unsigned char addr); enum { diff --git a/include/power/regulator.h b/include/power/regulator.h index bb07a814c79..8a914dfc74f 100644 --- a/include/power/regulator.h +++ b/include/power/regulator.h @@ -415,26 +415,6 @@ int regulator_get_mode(struct udevice *dev); int regulator_set_mode(struct udevice *dev, int mode_id); /** - * regulators_enable_boot_on() - enable regulators needed for boot - * - * This enables all regulators which are marked to be on at boot time. This - * only works for regulators which don't have a range for voltage/current, - * since in that case it is not possible to know which value to use. - * - * This effectively calls regulator_autoset() for every regulator. - */ -int regulators_enable_boot_on(bool verbose); - -/** - * regulators_enable_boot_off() - disable regulators needed for boot - * - * This disables all regulators which are marked to be off at boot time. - * - * This effectively calls regulator_unset() for every regulator. - */ -int regulators_enable_boot_off(bool verbose); - -/** * regulator_autoset: setup the voltage/current on a regulator * * The setup depends on constraints found in device's uclass's platform data @@ -454,18 +434,6 @@ int regulators_enable_boot_off(bool verbose); int regulator_autoset(struct udevice *dev); /** - * regulator_unset: turn off a regulator - * - * The setup depends on constraints found in device's uclass's platform data - * (struct dm_regulator_uclass_platdata): - * - * - Disable - will set - if 'force_off' is set to true, - * - * The function returns on the first-encountered error. - */ -int regulator_unset(struct udevice *dev); - -/** * regulator_autoset_by_name: setup the regulator given by its uclass's * platform data name field. The setup depends on constraints found in device's * uclass's platform data (struct dm_regulator_uclass_plat): @@ -629,11 +597,6 @@ static inline int regulator_set_mode(struct udevice *dev, int mode_id) return -ENOSYS; } -static inline int regulators_enable_boot_on(bool verbose) -{ - return -ENOSYS; -} - static inline int regulator_autoset(struct udevice *dev) { return -ENOSYS; diff --git a/include/rkmtd.h b/include/rkmtd.h index 145fede6c84..b7479036b39 100644 --- a/include/rkmtd.h +++ b/include/rkmtd.h @@ -11,7 +11,7 @@ #define __RKMTD__ #include <part_efi.h> -#include <uuid.h> +#include <u-boot/uuid.h> #define LBA 64 + 512 + 33 diff --git a/include/sandbox_efi_capsule.h b/include/sandbox_efi_capsule.h index 3e288e8a84a..84d45ec5cfd 100644 --- a/include/sandbox_efi_capsule.h +++ b/include/sandbox_efi_capsule.h @@ -6,9 +6,9 @@ #if !defined(_SANDBOX_EFI_CAPSULE_H_) #define _SANDBOX_EFI_CAPSULE_H_ -#define SANDBOX_UBOOT_IMAGE_GUID "09d7cf52-0720-4710-91d1-08469b7fe9c8" -#define SANDBOX_UBOOT_ENV_IMAGE_GUID "5a7021f5-fef2-48b4-aaba-832e777418c0" -#define SANDBOX_FIT_IMAGE_GUID "3673b45d-6a7c-46f3-9e60-adabb03f7937" +#define SANDBOX_UBOOT_IMAGE_GUID "985f2937-7c2e-5e9a-8a5e-8e063312964b" +#define SANDBOX_UBOOT_ENV_IMAGE_GUID "9e339473-c2eb-530a-a69b-0cd6bbbed40e" +#define SANDBOX_FIT_IMAGE_GUID "46610520-469e-59dc-a8dd-c11832b877ea" #define SANDBOX_INCORRECT_GUID "058b7d83-50d5-4c47-a195-60d86ad341c4" #define UBOOT_FIT_IMAGE "u-boot_bin_env.itb" diff --git a/include/spl_load.h b/include/spl_load.h index 83db3812029..935f7d336f2 100644 --- a/include/spl_load.h +++ b/include/spl_load.h @@ -83,6 +83,10 @@ static inline int _spl_load(struct spl_image_info *spl_image, read = info->read(info, offset + image_offset, size, map_sysmem(spl_image->load_addr - overhead, size)); + + if (read < 0) + return read; + return read < spl_image->size ? -EIO : 0; } diff --git a/include/u-boot/ecdsa.h b/include/u-boot/ecdsa.h index 53490c6b287..8f9f5e7d6e7 100644 --- a/include/u-boot/ecdsa.h +++ b/include/u-boot/ecdsa.h @@ -65,5 +65,6 @@ int ecdsa_verify(struct image_sign_info *info, /** @} */ #define ECDSA256_BYTES (256 / 8) +#define ECDSA521_BYTES ((521 + 7) / 8) #endif diff --git a/include/uuid.h b/include/u-boot/uuid.h index f5a941250f4..7f8414dc906 100644 --- a/include/uuid.h +++ b/include/u-boot/uuid.h @@ -11,6 +11,7 @@ #define __UUID_H__ #include <linux/bitops.h> +#include <linux/kconfig.h> /* * UUID - Universally Unique IDentifier - 128 bits unique number. @@ -46,8 +47,8 @@ * When converting to a binary UUID, le means the field should be converted * to little endian and be means it should be converted to big endian. * - * UUID is also used as GUID (Globally Unique Identifier) with the same binary - * format but it differs in string format like below. + * UUID is also used as GUID (Globally Unique Identifier) with the same format + * but with some fields stored in little endian. * * GUID: * 0 9 14 19 24 @@ -69,8 +70,8 @@ struct uuid { /* Bits of a bitmask specifying the output format for GUIDs */ #define UUID_STR_FORMAT_STD 0 -#define UUID_STR_FORMAT_GUID BIT(0) -#define UUID_STR_UPPER_CASE BIT(1) +#define UUID_STR_FORMAT_GUID 0x1 +#define UUID_STR_UPPER_CASE 0x2 /* Use UUID_STR_LEN + 1 for string space */ #define UUID_STR_LEN 36 @@ -143,6 +144,18 @@ void gen_rand_uuid(unsigned char *uuid_bin); */ void gen_rand_uuid_str(char *uuid_str, int str_format); +struct efi_guid; + +/** + * gen_v5_guid() - generate little endian v5 GUID from namespace and other seed data. + * + * @namespace: pointer to UUID namespace salt + * @guid: pointer to allocated GUID output + * @...: NULL terminated list of seed data as pairs of pointers + * to data and their lengths + */ +void gen_v5_guid(const struct uuid *namespace, struct efi_guid *guid, ...); + /** * uuid_str_to_le_bin() - Convert string UUID to little endian binary data. * @uuid_str: pointer to UUID string diff --git a/include/usb.h b/include/usb.h index fcbe2146f7d..be37ed272e1 100644 --- a/include/usb.h +++ b/include/usb.h @@ -250,20 +250,12 @@ int usb_host_eth_scan(int mode); #endif -#ifdef CONFIG_USB_KEYBOARD - /* * USB Keyboard reports are 8 bytes in boot protocol. * Appendix B of HID Device Class Definition 1.11 */ #define USB_KBD_BOOT_REPORT_SIZE 8 -int drv_usb_kbd_init(void); -int usb_kbd_deregister(int force); - -#endif -/* routines */ - /* * usb_init() - initialize the USB Controllers * @@ -1100,4 +1092,16 @@ struct usb_generic_descriptor **usb_emul_find_descriptor( */ void usb_show_tree(void); +/** + * usb_kbd_remove_for_test() - Remove any USB keyboard + * + * This can only be called from test_pre_run(). It removes the USB keyboard from + * the console system so that the USB device can be dropped + */ +#if CONFIG_IS_ENABLED(USB_KEYBOARD) +int usb_kbd_remove_for_test(void); +#else +static inline int usb_kbd_remove_for_test(void) { return 0; } +#endif + #endif /*_USB_H_ */ |