diff options
Diffstat (limited to 'include')
100 files changed, 1109 insertions, 209 deletions
diff --git a/include/blk.h b/include/blk.h index 76bd5baf99..7c7cf7f2b1 100644 --- a/include/blk.h +++ b/include/blk.h @@ -68,6 +68,7 @@ struct blk_desc { /* device can use 48bit addr (ATA/ATAPI v7) */ bool lba48; unsigned char atapi; /* Use ATAPI protocol */ + unsigned char bb; /* Use bounce buffer */ lbaint_t lba; /* number of blocks */ unsigned long blksz; /* block size */ int log2blksz; /* for convenience: log2(blksz) */ diff --git a/include/bootdev.h b/include/bootdev.h index b079a91b5b..35fa25aff1 100644 --- a/include/bootdev.h +++ b/include/bootdev.h @@ -65,7 +65,7 @@ struct bootdev_hunter; * * @info: Info structure describing this hunter * @show: true to show information from the hunter - * Returns: 0 if OK, -ve on error + * Returns: 0 if OK, -ENOENT on device not found, otherwise -ve on error */ typedef int (*bootdev_hunter_func)(struct bootdev_hunter *info, bool show); diff --git a/include/bootm.h b/include/bootm.h index c3c7336207..10a1bd65a7 100644 --- a/include/bootm.h +++ b/include/bootm.h @@ -56,6 +56,17 @@ ulong bootm_disable_interrupts(void); int bootm_find_images(int flag, int argc, char *const argv[], ulong start, ulong size); +/* + * Measure the boot images. Measurement is the process of hashing some binary + * data and storing it into secure memory, i.e. TPM PCRs. In addition, each + * measurement is logged into the platform event log such that the operating + * system can access it and perform attestation of the boot. + * + * @images: The structure containing the various images to boot (linux, + * initrd, dts, etc.) + */ +int bootm_measure(struct bootm_headers *images); + int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[], int states, struct bootm_headers *images, int boot_progress); diff --git a/include/bootstage.h b/include/bootstage.h index f9376c320c..affb0e5c6a 100644 --- a/include/bootstage.h +++ b/include/bootstage.h @@ -11,6 +11,7 @@ #ifndef _BOOTSTAGE_H #define _BOOTSTAGE_H +#include <linux/types.h> #include <linux/kconfig.h> /* Flags for each bootstage record */ diff --git a/include/cache.h b/include/cache.h index b12fec2591..296ae3c8b4 100644 --- a/include/cache.h +++ b/include/cache.h @@ -6,6 +6,8 @@ #ifndef __CACHE_H #define __CACHE_H +#include <linux/types.h> + struct udevice; /* diff --git a/include/cbfs.h b/include/cbfs.h index 38efb1d2b0..2bc5de2297 100644 --- a/include/cbfs.h +++ b/include/cbfs.h @@ -22,7 +22,7 @@ enum cbfs_result { enum cbfs_filetype { CBFS_TYPE_BOOTBLOCK = 0x01, CBFS_TYPE_CBFSHEADER = 0x02, - CBFS_TYPE_STAGE = 0x10, + CBFS_TYPE_LEGACY_STAGE = 0x10, CBFS_TYPE_PAYLOAD = 0x20, CBFS_TYPE_SELF = CBFS_TYPE_PAYLOAD, diff --git a/include/clk.h b/include/clk.h index d91285235f..249c0e0ab4 100644 --- a/include/clk.h +++ b/include/clk.h @@ -223,9 +223,11 @@ struct clk *devm_clk_get(struct udevice *dev, const char *id); static inline struct clk *devm_clk_get_optional(struct udevice *dev, const char *id) { + int ret; struct clk *clk = devm_clk_get(dev, id); - if (PTR_ERR(clk) == -ENODATA) + ret = PTR_ERR(clk); + if (ret == -ENODATA || ret == -ENOENT) return NULL; return clk; @@ -243,7 +245,7 @@ static inline struct clk *devm_clk_get_optional(struct udevice *dev, * * Return: zero on success, or -ve error code. */ -int clk_release_all(struct clk *clk, int count); +int clk_release_all(struct clk *clk, unsigned int count); /** * devm_clk_put - "free" a managed clock source @@ -307,7 +309,7 @@ clk_get_by_name_nodev(ofnode node, const char *name, struct clk *clk) return -ENOSYS; } -static inline int clk_release_all(struct clk *clk, int count) +static inline int clk_release_all(struct clk *clk, unsigned int count) { return -ENOSYS; } @@ -335,7 +337,7 @@ static inline int clk_get_by_name_optional(struct udevice *dev, int ret; ret = clk_get_by_name(dev, name, clk); - if (ret == -ENODATA) + if (ret == -ENODATA || ret == -ENOENT) return 0; return ret; @@ -359,7 +361,7 @@ static inline int clk_get_by_name_nodev_optional(ofnode node, const char *name, int ret; ret = clk_get_by_name_nodev(node, name, clk); - if (ret == -ENODATA) + if (ret == -ENODATA || ret == -ENOENT) return 0; return ret; diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index 504b1f0228..67f4656253 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -1,7 +1,7 @@ /* * am335x_evm.h * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff --git a/include/configs/am335x_shc.h b/include/configs/am335x_shc.h index ee6f62275a..dedef91ba5 100644 --- a/include/configs/am335x_shc.h +++ b/include/configs/am335x_shc.h @@ -6,7 +6,7 @@ * Based on: * am335x_evm.h * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/ */ #ifndef __CONFIG_AM335X_SHC_H diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h index 7ee7b7e4f4..983428920f 100644 --- a/include/configs/am43xx_evm.h +++ b/include/configs/am43xx_evm.h @@ -2,7 +2,7 @@ /* * am43xx_evm.h * - * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com/ */ #ifndef __CONFIG_AM43XX_EVM_H diff --git a/include/configs/am65x_evm.h b/include/configs/am65x_evm.h index 9e90239a1c..811dc0ff1a 100644 --- a/include/configs/am65x_evm.h +++ b/include/configs/am65x_evm.h @@ -2,7 +2,7 @@ /* * Configuration header file for K3 AM654 EVM * - * Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2017-2018 Texas Instruments Incorporated - https://www.ti.com/ * Lokesh Vutla <lokeshvutla@ti.com> */ diff --git a/include/configs/arbel.h b/include/configs/arbel.h index 891257bc93..576ee37ee4 100644 --- a/include/configs/arbel.h +++ b/include/configs/arbel.h @@ -7,11 +7,15 @@ #define __CONFIG_ARBEL_H #define CFG_SYS_SDRAM_BASE 0x0 -#define CFG_SYS_BOOTMAPSZ (30 << 20) +#define CFG_SYS_BOOTMAPSZ (128 << 20) #define CFG_SYS_BOOTM_LEN (20 << 20) #define CFG_SYS_INIT_RAM_ADDR CFG_SYS_SDRAM_BASE #define CFG_SYS_INIT_RAM_SIZE 0x8000 +#define CFG_SYS_BAUDRATE_TABLE \ + { 9600, 14400, 19200, 38400, 57600, 115200, 230400, 380400, 460800, 921600 } + + /* Default environemnt variables */ #define CFG_EXTRA_ENV_SETTINGS "uimage_flash_addr=80400000\0" \ "stdin=serial\0" \ diff --git a/include/configs/baltos.h b/include/configs/baltos.h index e7946389ef..cc54b514ff 100644 --- a/include/configs/baltos.h +++ b/include/configs/baltos.h @@ -1,7 +1,7 @@ /* * am335x_evm.h * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h index 3347c11792..3ada21cbba 100644 --- a/include/configs/corstone1000.h +++ b/include/configs/corstone1000.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * (C) Copyright 2022 ARM Limited + * Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com> * (C) Copyright 2022 Linaro * Rui Miguel Silva <rui.silva@linaro.org> * Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> @@ -29,5 +29,6 @@ #include <config_distro_bootcmd.h> +#define CFG_EXTRA_ENV_SETTINGS BOOTENV #endif diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h index cef404218e..416aa96366 100644 --- a/include/configs/da850evm.h +++ b/include/configs/da850evm.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2010 Texas Instruments Incorporated - https://www.ti.com/ * * Based on davinci_dvevm.h. Original Copyrights follow: * diff --git a/include/configs/draco.h b/include/configs/draco.h index 4c67174572..8f993cee0a 100644 --- a/include/configs/draco.h +++ b/include/configs/draco.h @@ -6,7 +6,7 @@ * Based on: * U-Boot file:/include/configs/am335x_evm.h * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/ */ #ifndef __CONFIG_DRACO_H diff --git a/include/configs/etamin.h b/include/configs/etamin.h index d07b4e9536..97585a4fd1 100644 --- a/include/configs/etamin.h +++ b/include/configs/etamin.h @@ -6,7 +6,7 @@ * Based on: * U-Boot file:/include/configs/am335x_evm.h * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/ */ #ifndef __CONFIG_ETAMIN_H diff --git a/include/configs/inteno_xg6846.h b/include/configs/inteno_xg6846.h new file mode 100644 index 0000000000..4f2a2f8401 --- /dev/null +++ b/include/configs/inteno_xg6846.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2023 Linus Walleij <linusw@kernel.org> + */ + +#include <configs/bmips_common.h> +#include <configs/bmips_bcm6328.h> + diff --git a/include/configs/iot2050.h b/include/configs/iot2050.h index 4968722d18..94a9c76788 100644 --- a/include/configs/iot2050.h +++ b/include/configs/iot2050.h @@ -15,6 +15,15 @@ #include <configs/ti_armv7_common.h> +/* allow up to 3 USB storage devices */ +#ifdef CONFIG_CMD_USB +#undef BOOT_TARGET_USB +#define BOOT_TARGET_USB(func) \ + func(USB, usb, 0) \ + func(USB, usb, 1) \ + func(USB, usb, 2) +#endif + /* * This defines all MMC devices, even if the basic variant has no mmc1. * The non-supported device will be removed from the boot targets during diff --git a/include/configs/legoev3.h b/include/configs/legoev3.h index ff966586ba..a50f9480dd 100644 --- a/include/configs/legoev3.h +++ b/include/configs/legoev3.h @@ -4,7 +4,7 @@ * * Based on da850evm.h * - * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2010 Texas Instruments Incorporated - https://www.ti.com/ * * Based on davinci_dvevm.h. Original Copyrights follow: * diff --git a/include/configs/libretech-ac.h b/include/configs/libretech-ac.h index bf20d31543..16239f2520 100644 --- a/include/configs/libretech-ac.h +++ b/include/configs/libretech-ac.h @@ -11,6 +11,7 @@ #define BOOT_TARGET_DEVICES(func) \ func(ROMUSB, romusb, na) \ + func(USB_DFU, usbdfu, na) \ func(MMC, mmc, 0) \ BOOT_TARGET_DEVICES_USB(func) \ func(PXE, pxe, na) \ diff --git a/include/configs/meson64.h b/include/configs/meson64.h index 801cdae470..efab9a624d 100644 --- a/include/configs/meson64.h +++ b/include/configs/meson64.h @@ -53,6 +53,30 @@ #define BOOTENV_DEV_NAME_ROMUSB(devtypeu, devtypel, instance) \ "romusb " +/* + * Fallback to "USB DFU" boot if script is not at scriptaddr + * + * DFU will expose the kernel_addr_r memory range as DFU entry, + * then with `dfu-util --detach`, booting the uploaded image + * will be attempted: + * $ dfu-util -a 0 -D fitImage + * $ dfu-util -a 0 -e + */ +#if CONFIG_IS_ENABLED(USB_GADGET) && CONFIG_IS_ENABLED(DFU_RAM) + #define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \ + "bootcmd_usbdfu=" \ + "if test \"${boot_source}\" = \"usb\"; then " \ + "dfu 0 ram 0 60;" \ + "bootm ${kernel_addr_r};" \ + "fi\0" + + #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \ + "usbdfu " +#else + #define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) + #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) +#endif + #ifdef CONFIG_CMD_USB #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) #else @@ -74,6 +98,7 @@ #ifndef BOOT_TARGET_DEVICES #define BOOT_TARGET_DEVICES(func) \ func(ROMUSB, romusb, na) \ + func(USB_DFU, usbdfu, na) \ func(MMC, mmc, 0) \ func(MMC, mmc, 1) \ func(MMC, mmc, 2) \ @@ -84,6 +109,15 @@ func(DHCP, dhcp, na) #endif +#define BOOTM_SIZE __stringify(0x1700000) +#define KERNEL_ADDR_R __stringify(0x08080000) +#define KERNEL_COMP_ADDR_R __stringify(0x0d080000) +#define FDT_ADDR_R __stringify(0x08008000) +#define SCRIPT_ADDR_R __stringify(0x08000000) +#define PXEFILE_ADDR_R __stringify(0x01080000) +#define FDTOVERLAY_ADDR_R __stringify(0x01000000) +#define RAMDISK_ADDR_R __stringify(0x13000000) + #include <config_distro_bootcmd.h> #ifndef CFG_EXTRA_ENV_SETTINGS @@ -91,15 +125,16 @@ "stdin=" STDIN_CFG "\0" \ "stdout=" STDOUT_CFG "\0" \ "stderr=" STDOUT_CFG "\0" \ - "kernel_comp_addr_r=0x0d080000\0" \ + "kernel_comp_addr_r=" KERNEL_COMP_ADDR_R "\0" \ "kernel_comp_size=0x2000000\0" \ - "fdt_addr_r=0x08008000\0" \ - "scriptaddr=0x08000000\0" \ - "kernel_addr_r=0x08080000\0" \ - "pxefile_addr_r=0x01080000\0" \ - "fdtoverlay_addr_r=0x01000000\0" \ - "ramdisk_addr_r=0x13000000\0" \ + "fdt_addr_r=" FDT_ADDR_R "\0" \ + "scriptaddr=" SCRIPT_ADDR_R "\0" \ + "kernel_addr_r=" KERNEL_ADDR_R "\0" \ + "pxefile_addr_r=" PXEFILE_ADDR_R "\0" \ + "fdtoverlay_addr_r=" FDTOVERLAY_ADDR_R "\0" \ + "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \ "fdtfile=amlogic/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ + "dfu_alt_info=fitimage ram " KERNEL_ADDR_R " 0x4000000 \0" \ BOOTENV #endif diff --git a/include/configs/mvebu_armada-37xx.h b/include/configs/mvebu_armada-37xx.h index 76e148f55e..18b55be0d8 100644 --- a/include/configs/mvebu_armada-37xx.h +++ b/include/configs/mvebu_armada-37xx.h @@ -30,7 +30,6 @@ /* * Environment */ -#define DEFAULT_ENV_IS_RW /* required for configuring default fdtfile= */ #ifdef CONFIG_MMC #define BOOT_TARGET_DEVICES_MMC(func, i) func(MMC, mmc, i) diff --git a/include/configs/nanopc-t6-rk3588.h b/include/configs/nanopc-t6-rk3588.h new file mode 100644 index 0000000000..1ece6f9383 --- /dev/null +++ b/include/configs/nanopc-t6-rk3588.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2023 Rockchip Electronics Co., Ltd. + */ + +#ifndef __NANOPCT6_RK3588_H +#define __NANOPCT6_RK3588_H + +#define ROCKCHIP_DEVICE_SETTINGS \ + "stdout=serial,vidconsole\0" \ + "stderr=serial,vidconsole\0" + +#include <configs/rk3588_common.h> + +#endif /* __NANOPCT6_RK3588_H */ diff --git a/include/configs/nsa310s.h b/include/configs/nsa310s.h index fa029a176b..8c4d03553d 100644 --- a/include/configs/nsa310s.h +++ b/include/configs/nsa310s.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright (C) 2015, 2021-2022 Tony Dinh <mibodhi@gmail.com> + * Copyright (C) 2015, 2021-2023 Tony Dinh <mibodhi@gmail.com> * Copyright (C) 2015 * Gerald Kerma <dreagle@doukki.net> * Luka Perkov <luka.perkov@sartura.hr> @@ -15,14 +15,6 @@ */ #include "mv-common.h" -/* Include the common distro boot environment */ -#ifndef CONFIG_SPL_BUILD - -#define BOOT_TARGET_DEVICES(func) \ - func(USB, usb, 0) \ - func(SATA, sata, 0) \ - func(DHCP, dhcp, na) - #define KERNEL_ADDR_R __stringify(0x800000) #define FDT_ADDR_R __stringify(0x2c00000) #define RAMDISK_ADDR_R __stringify(0x01100000) @@ -34,16 +26,11 @@ "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \ "scriptaddr=" SCRIPT_ADDR_R "\0" -#include <config_distro_bootcmd.h> - #define CFG_EXTRA_ENV_SETTINGS \ "console=console=ttyS0,115200\0" \ "kernel=/boot/zImage\0" \ "fdt=/boot/nsa310s.dtb\0" \ "bootargs_root=ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs rw\0" \ - LOAD_ADDRESS_ENV_SETTINGS \ - BOOTENV - -#endif /* CONFIG_SPL_BUILD */ + LOAD_ADDRESS_ENV_SETTINGS #endif /* _CONFIG_NSA310S_H */ diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h index f44967787c..2cb2e52ad2 100644 --- a/include/configs/omap3_evm.h +++ b/include/configs/omap3_evm.h @@ -2,7 +2,7 @@ /* * Configuration settings for the TI OMAP3 EVM board. * - * Copyright (C) 2006-2011 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2006-2011 Texas Instruments Incorporated - https://www.ti.com/ * * Author : * Manikandan Pillai <mani.pillai@ti.com> diff --git a/include/configs/omapl138_lcdk.h b/include/configs/omapl138_lcdk.h index fc2655a17b..5b7eb0b694 100644 --- a/include/configs/omapl138_lcdk.h +++ b/include/configs/omapl138_lcdk.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* - * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2010 Texas Instruments Incorporated - https://www.ti.com/ * * Based on davinci_dvevm.h. Original Copyrights follow: * diff --git a/include/configs/pdu001.h b/include/configs/pdu001.h index 80b14b002a..24d7dcd427 100644 --- a/include/configs/pdu001.h +++ b/include/configs/pdu001.h @@ -4,7 +4,7 @@ * * Copyright (C) 2018 EETS GmbH - http://www.eets.ch/ * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/ */ #ifndef __CONFIG_PDU001_H diff --git a/include/configs/phycore_am335x_r2.h b/include/configs/phycore_am335x_r2.h index 8668da6eba..060a150965 100644 --- a/include/configs/phycore_am335x_r2.h +++ b/include/configs/phycore_am335x_r2.h @@ -4,7 +4,7 @@ * * Phytec phyCORE-AM335x R2 (PCL060 / PCM060) boards information header * - * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/ + * Copyright (C) 2011, Texas Instruments, Incorporated - https://www.ti.com/ * Copyright (C) 2013 Lars Poeschel, Lemonage Software GmbH * Copyright (C) 2019 DENX Software Engineering GmbH */ diff --git a/include/configs/pogo_v4.h b/include/configs/pogo_v4.h index 3371579023..d5003538da 100644 --- a/include/configs/pogo_v4.h +++ b/include/configs/pogo_v4.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright (C) 2014-2022 Tony Dinh <mibodhi@gmail.com> + * Copyright (C) 2014-2023 Tony Dinh <mibodhi@gmail.com> * * Based on * Copyright (C) 2012 @@ -21,33 +21,6 @@ */ #include "mv-common.h" -/* Include the common distro boot environment */ -#ifndef CONFIG_SPL_BUILD - -#ifdef CONFIG_MMC -#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) -#else -#define BOOT_TARGET_DEVICES_MMC(func) -#endif - -#ifdef CONFIG_SATA -#define BOOT_TARGET_DEVICES_SATA(func) func(SATA, sata, 0) -#else -#define BOOT_TARGET_DEVICES_SATA(func) -#endif - -#ifdef CONFIG_USB_STORAGE -#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) -#else -#define BOOT_TARGET_DEVICES_USB(func) -#endif - -#define BOOT_TARGET_DEVICES(func) \ - BOOT_TARGET_DEVICES_MMC(func) \ - BOOT_TARGET_DEVICES_USB(func) \ - BOOT_TARGET_DEVICES_SATA(func) \ - func(DHCP, dhcp, na) - #define KERNEL_ADDR_R __stringify(0x800000) #define FDT_ADDR_R __stringify(0x2c00000) #define RAMDISK_ADDR_R __stringify(0x01100000) @@ -59,14 +32,10 @@ "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \ "scriptaddr=" SCRIPT_ADDR_R "\0" -#include <config_distro_bootcmd.h> - #define CFG_EXTRA_ENV_SETTINGS \ LOAD_ADDRESS_ENV_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ - "console=ttyS0,115200\0" \ - BOOTENV -#endif /* CONFIG_SPL_BUILD */ + "console=ttyS0,115200\0" #endif /* _CONFIG_POGO_V4_H */ diff --git a/include/configs/poleg.h b/include/configs/poleg.h index 1e96e838be..2a2d85c8ec 100644 --- a/include/configs/poleg.h +++ b/include/configs/poleg.h @@ -13,6 +13,8 @@ #define CFG_SYS_BOOTMAPSZ (0x30 << 20) #define CFG_SYS_SDRAM_BASE 0x0 +#define CFG_SYS_BAUDRATE_TABLE { 57600, 115200, 230400, 460800 } + /* Default environemnt variables */ #define CFG_EXTRA_ENV_SETTINGS "uimage_flash_addr=80200000\0" \ "stdin=serial\0" \ diff --git a/include/configs/pxm2.h b/include/configs/pxm2.h index b701e52076..040178baf8 100644 --- a/include/configs/pxm2.h +++ b/include/configs/pxm2.h @@ -7,7 +7,7 @@ * Based on: * U-Boot file:/include/configs/am335x_evm.h * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/ */ #ifndef __CONFIG_PXM2_H diff --git a/include/configs/quartzpro64-rk3588.h b/include/configs/quartzpro64-rk3588.h new file mode 100644 index 0000000000..a1faa2aad8 --- /dev/null +++ b/include/configs/quartzpro64-rk3588.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0+ + * Copyright 2023 Google, Inc + */ + +#ifndef __QUARTZPRO64_RK3588_H +#define __QUARTZPRO64_RK3588_H + +#define ROCKCHIP_DEVICE_SETTINGS \ + "stdout=serial,vidconsole\0" \ + "stderr=serial,vidconsole\0" + +#include <configs/rk3588_common.h> + +#endif /* __QUARTZPRO64_RK3588_H */ diff --git a/include/configs/rastaban.h b/include/configs/rastaban.h index 2efb4d23cd..0991ebfd00 100644 --- a/include/configs/rastaban.h +++ b/include/configs/rastaban.h @@ -6,7 +6,7 @@ * Based on: * U-Boot file:/include/configs/am335x_evm.h * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/ */ #ifndef __CONFIG_RASTABAN_H diff --git a/include/configs/rut.h b/include/configs/rut.h index 4002bc4b6c..7cc2bd5a34 100644 --- a/include/configs/rut.h +++ b/include/configs/rut.h @@ -7,7 +7,7 @@ * Based on: * U-Boot file:/include/configs/am335x_evm.h * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/ */ #ifndef __CONFIG_RUT_H diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h index 7def657bcd..6b1d5caafb 100644 --- a/include/configs/siemens-am33x-common.h +++ b/include/configs/siemens-am33x-common.h @@ -7,7 +7,7 @@ * Based on: * U-Boot file:/include/configs/am335x_evm.h * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/ */ #ifndef __CONFIG_SIEMENS_AM33X_COMMON_H diff --git a/include/configs/sifive-unmatched.h b/include/configs/sifive-unmatched.h index 74150b7d4b..de8bfc1123 100644 --- a/include/configs/sifive-unmatched.h +++ b/include/configs/sifive-unmatched.h @@ -36,7 +36,7 @@ "name=system,size=-,bootable,type=${type_guid_gpt_system};" #define CFG_EXTRA_ENV_SETTINGS \ - "kernel_addr_r=0x84000000\0" \ + "kernel_addr_r=0x80200000\0" \ "kernel_comp_addr_r=0x88000000\0" \ "kernel_comp_size=0x4000000\0" \ "fdt_addr_r=0x8c000000\0" \ diff --git a/include/configs/synquacer.h b/include/configs/synquacer.h index cd7359c2f8..e36e63e81e 100644 --- a/include/configs/synquacer.h +++ b/include/configs/synquacer.h @@ -41,20 +41,6 @@ /* Since U-Boot 64bit PCIe support is limited, disable 64bit MMIO support */ #ifdef CONFIG_FWU_MULTI_BANK_UPDATE -#define DEFAULT_DFU_ALT_INFO -#else -#define DEFAULT_DFU_ALT_INFO "dfu_alt_info=" \ - "mtd nor1=u-boot.bin raw 200000 100000;" \ - "fip.bin raw 180000 78000;" \ - "optee.bin raw 500000 100000\0" -#endif - -/* GUIDs for capsule updatable firmware images */ -#define DEVELOPERBOX_UBOOT_IMAGE_GUID \ - EFI_GUID(0x53a92e83, 0x4ef4, 0x473a, 0x8b, 0x0d, \ - 0xb5, 0xd8, 0xc7, 0xb2, 0xd6, 0x00) - -#ifdef CONFIG_FWU_MULTI_BANK_UPDATE #define DEVELOPERBOX_FIP_IMAGE_GUID \ EFI_GUID(0x7d6dc310, 0x52ca, 0x43b8, 0xb7, 0xb9, \ 0xf9, 0xd6, 0xc5, 0x01, 0xd1, 0x08) @@ -64,10 +50,6 @@ 0x33, 0xe0, 0xb9, 0x16, 0xf3, 0x98) #endif -#define DEVELOPERBOX_OPTEE_IMAGE_GUID \ - EFI_GUID(0xc1b629f1, 0xce0e, 0x4894, 0x82, 0xbf, \ - 0xf0, 0xa3, 0x83, 0x87, 0xe6, 0x30) - /* Distro boot settings */ #ifdef CONFIG_CMD_USB #define BOOT_TARGET_DEVICE_USB(func) func(USB, usb, 0) @@ -107,7 +89,6 @@ "ramdisk_addr_r=0xa0000000\0" \ "scriptaddr=0x88000000\0" \ "pxefile_addr_r=0x88100000\0" \ - DEFAULT_DFU_ALT_INFO \ BOOTENV #endif /* __CONFIG_H */ diff --git a/include/configs/thuban.h b/include/configs/thuban.h index a5913e1e7d..f4c04c55eb 100644 --- a/include/configs/thuban.h +++ b/include/configs/thuban.h @@ -6,7 +6,7 @@ * Based on: * U-Boot file:/include/configs/am335x_evm.h * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/ */ #ifndef __CONFIG_THUBAN_H diff --git a/include/configs/ti_am335x_common.h b/include/configs/ti_am335x_common.h index 20f8643771..c827a9cace 100644 --- a/include/configs/ti_am335x_common.h +++ b/include/configs/ti_am335x_common.h @@ -2,10 +2,10 @@ /* * ti_am335x_common.h * - * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com/ * * For more details, please see the technical documents listed at - * http://www.ti.com/product/am3359#technicaldocuments + * https://www.ti.com/product/am3359#technicaldocuments */ #ifndef __CONFIG_TI_AM335X_COMMON_H__ diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h index 4e30d0d2dd..3def7b1027 100644 --- a/include/configs/ti_armv7_common.h +++ b/include/configs/ti_armv7_common.h @@ -2,7 +2,7 @@ /* * ti_armv7_common.h * - * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com/ * * The various ARMv7 SoCs from TI all share a number of IP blocks when * implementing a given feature. Rather than define these in every diff --git a/include/configs/ti_armv7_omap.h b/include/configs/ti_armv7_omap.h index d34042af46..0b8b1ac8f9 100644 --- a/include/configs/ti_armv7_omap.h +++ b/include/configs/ti_armv7_omap.h @@ -2,7 +2,7 @@ /* * ti_armv7_omap.h * - * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2015 Texas Instruments Incorporated - https://www.ti.com/ * * The various ARMv7 SoCs from TI all share a number of IP blocks when * implementing a given feature. This is meant to isolate the features diff --git a/include/configs/ti_omap3_common.h b/include/configs/ti_omap3_common.h index 36a05b6896..45f7179f03 100644 --- a/include/configs/ti_omap3_common.h +++ b/include/configs/ti_omap3_common.h @@ -2,12 +2,12 @@ /* * ti_omap3_common.h * - * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com/ * * For more details, please see the technical documents listed at - * http://www.ti.com/product/omap3530 - * http://www.ti.com/product/omap3630 - * http://www.ti.com/product/dm3730 + * https://www.ti.com/product/omap3530 + * https://www.ti.com/product/omap3630 + * https://www.ti.com/product/dm3730 */ #ifndef __CONFIG_TI_OMAP3_COMMON_H__ diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h index 4e5aa74147..26494ae980 100644 --- a/include/configs/ti_omap5_common.h +++ b/include/configs/ti_omap5_common.h @@ -10,7 +10,7 @@ * TI OMAP5 AND DRA7XX common configuration settings * * For more details, please see the technical documents listed at - * http://www.ti.com/product/omap5432 + * https://www.ti.com/product/omap5432 */ #ifndef __CONFIG_TI_OMAP5_COMMON_H diff --git a/include/configs/transformer-common.h b/include/configs/transformer-common.h index dcdda1ec5b..3b7db0ab14 100644 --- a/include/configs/transformer-common.h +++ b/include/configs/transformer-common.h @@ -64,19 +64,14 @@ "else echo SPI flash backup FAILED! Aborting ...;" \ "poweroff; fi\0" -#define TRANSFORMER_REFRESH_USB \ - "refresh_usb=usb start; usb reset; usb tree; usb info;" \ - "pause 'Press ANY key to return to bootmenu...'; bootmenu\0" - #define TRANSFORMER_BOOTMENU \ TRANSFORMER_FLASH_UBOOT \ TRANSFORMER_FLASH_SPI \ - TRANSFORMER_REFRESH_USB \ "bootmenu_0=mount internal storage=usb start && ums 0 mmc 0; bootmenu\0" \ "bootmenu_1=mount external storage=usb start && ums 0 mmc 1; bootmenu\0" \ "bootmenu_2=fastboot=echo Starting Fastboot protocol ...; fastboot usb 0; bootmenu\0" \ "bootmenu_3=update bootloader=run flash_uboot\0" \ - "bootmenu_4=refresh USB=run refresh_usb\0" \ + "bootmenu_4=enter console=usb start; setenv skip_boot 1; exit\0" \ "bootmenu_5=reboot RCM=enterrcm\0" \ "bootmenu_6=reboot=reset\0" \ "bootmenu_7=power off=poweroff\0" \ diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h index 43f7e454d8..24d8ca0866 100644 --- a/include/configs/vexpress_aemv8.h +++ b/include/configs/vexpress_aemv8.h @@ -148,6 +148,12 @@ #define FUNC_VIRTIO(func) #endif +#ifdef CONFIG_CMD_MMC +#define FUNC_MMC(func) func(MMC, mmc, 0) +#else +#define FUNC_MMC(func) +#endif + /* * Boot by loading an Android image, or kernel, initrd and FDT through * semihosting into DRAM. @@ -204,6 +210,7 @@ func(SMH, smh, na) \ func(MEM, mem, na) \ FUNC_VIRTIO(func) \ + FUNC_MMC(func) \ func(PXE, pxe, na) \ func(DHCP, dhcp, na) diff --git a/include/cpsw.h b/include/cpsw.h index 786f8b385b..5e0509923b 100644 --- a/include/cpsw.h +++ b/include/cpsw.h @@ -1,7 +1,7 @@ /* * CPSW Ethernet Switch Driver * - * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2010 Texas Instruments Incorporated - https://www.ti.com/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff --git a/include/cpu.h b/include/cpu.h index be02a16712..2077ff3063 100644 --- a/include/cpu.h +++ b/include/cpu.h @@ -7,6 +7,8 @@ #ifndef __CPU_H #define __CPU_H +#include <linux/types.h> + struct udevice; /** diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index 19e97a9032..5795115c49 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -977,12 +977,22 @@ const char *ofnode_read_chosen_string(const char *propname); ofnode ofnode_get_chosen_node(const char *propname); /** - * ofnode_read_aliases_prop() - get the value of a aliases property + * ofnode_read_baud() - get the baudrate from string value of chosen property * - * This looks for a property within the /aliases node and returns its value + * This looks for stdout-path property within the /chosen node and parses its + * value to return baudrate. * * This only works with the control FDT. * + * Return: baudrate value if found, else -ve error code + */ +int ofnode_read_baud(void); + +/** + * ofnode_read_aliases_prop() - get the value of a aliases property + * + * This looks for a property within the /aliases node and returns its value + * * @propname: Property name to look for * @sizep: Returns size of property, or `FDT_ERR_...` error code if function * returns NULL diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index a6045f5cc8..5271e646bb 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -121,6 +121,7 @@ enum uclass_id { UCLASS_REGULATOR, /* Regulator device */ UCLASS_REMOTEPROC, /* Remote Processor device */ UCLASS_RESET, /* Reset controller device */ + UCLASS_RKMTD, /* Rockchip MTD device */ UCLASS_RNG, /* Random Number Generator */ UCLASS_RTC, /* Real time clock device */ UCLASS_SCMI_AGENT, /* Interface with an SCMI server */ diff --git a/include/dt-bindings/leds/common.h b/include/dt-bindings/leds/common.h index 3be89a7c20..9a0d33d027 100644 --- a/include/dt-bindings/leds/common.h +++ b/include/dt-bindings/leds/common.h @@ -33,7 +33,12 @@ #define LED_COLOR_ID_MULTI 8 /* For multicolor LEDs */ #define LED_COLOR_ID_RGB 9 /* For multicolor LEDs that can do arbitrary color, so this would include RGBW and similar */ -#define LED_COLOR_ID_MAX 10 +#define LED_COLOR_ID_PURPLE 10 +#define LED_COLOR_ID_ORANGE 11 +#define LED_COLOR_ID_PINK 12 +#define LED_COLOR_ID_CYAN 13 +#define LED_COLOR_ID_LIME 14 +#define LED_COLOR_ID_MAX 15 /* Standard LED functions */ /* Keyboard LEDs, usually it would be input4::capslock etc. */ diff --git a/include/dt-bindings/net/mscc-phy-vsc8531.h b/include/dt-bindings/net/mscc-phy-vsc8531.h index 61f5287d75..c340437414 100644 --- a/include/dt-bindings/net/mscc-phy-vsc8531.h +++ b/include/dt-bindings/net/mscc-phy-vsc8531.h @@ -28,13 +28,4 @@ #define VSC8531_FORCE_LED_OFF 14 #define VSC8531_FORCE_LED_ON 15 -#define VSC8531_RGMII_CLK_DELAY_0_2_NS 0 -#define VSC8531_RGMII_CLK_DELAY_0_8_NS 1 -#define VSC8531_RGMII_CLK_DELAY_1_1_NS 2 -#define VSC8531_RGMII_CLK_DELAY_1_7_NS 3 -#define VSC8531_RGMII_CLK_DELAY_2_0_NS 4 -#define VSC8531_RGMII_CLK_DELAY_2_3_NS 5 -#define VSC8531_RGMII_CLK_DELAY_2_6_NS 6 -#define VSC8531_RGMII_CLK_DELAY_3_4_NS 7 - #endif diff --git a/include/dt-bindings/pinctrl/dra.h b/include/dt-bindings/pinctrl/dra.h index b543eebd2f..765c385f7b 100644 --- a/include/dt-bindings/pinctrl/dra.h +++ b/include/dt-bindings/pinctrl/dra.h @@ -1,7 +1,7 @@ /* * This header provides constants for DRA pinctrl bindings. * - * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com/ * Author: Rajendra Nayak <rnayak@ti.com> * * This program is free software; you can redistribute it and/or modify diff --git a/include/dt-bindings/reset/ti-syscon.h b/include/dt-bindings/reset/ti-syscon.h index 884fd91df8..1427ff140f 100644 --- a/include/dt-bindings/reset/ti-syscon.h +++ b/include/dt-bindings/reset/ti-syscon.h @@ -1,7 +1,7 @@ /* * TI Syscon Reset definitions * - * Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2015-2016 Texas Instruments Incorporated - https://www.ti.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/dwc3-omap-uboot.h b/include/dwc3-omap-uboot.h index 9e0e717dc9..ed92bfc5a9 100644 --- a/include/dwc3-omap-uboot.h +++ b/include/dwc3-omap-uboot.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* include/dwc3_omap_uboot.h * - * Copyright (c) 2015 Texas Instruments Incorporated - http://www.ti.com + * Copyright (c) 2015 Texas Instruments Incorporated - https://www.ti.com * * Designware SuperSpeed OMAP Glue uboot init */ diff --git a/include/dwc3-uboot.h b/include/dwc3-uboot.h index bb0436c097..35cfbb93b2 100644 --- a/include/dwc3-uboot.h +++ b/include/dwc3-uboot.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* include/dwc3-uboot.h * - * Copyright (c) 2015 Texas Instruments Incorporated - http://www.ti.com + * Copyright (c) 2015 Texas Instruments Incorporated - https://www.ti.com * * Designware SuperSpeed USB uboot init */ diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h index b1c3abd097..b21c5cb3dd 100644 --- a/include/efi_tcg2.h +++ b/include/efi_tcg2.h @@ -129,50 +129,6 @@ struct efi_tcg2_boot_service_capability { #define BOOT_SERVICE_CAPABILITY_MIN \ offsetof(struct efi_tcg2_boot_service_capability, number_of_pcr_banks) -#define TCG_EFI_SPEC_ID_EVENT_SIGNATURE_03 "Spec ID Event03" -#define TCG_EFI_SPEC_ID_EVENT_SPEC_VERSION_MAJOR_TPM2 2 -#define TCG_EFI_SPEC_ID_EVENT_SPEC_VERSION_MINOR_TPM2 0 -#define TCG_EFI_SPEC_ID_EVENT_SPEC_VERSION_ERRATA_TPM2 2 - -/** - * struct TCG_EfiSpecIdEventAlgorithmSize - hashing algorithm information - * - * @algorithm_id: algorithm defined in enum tpm2_algorithms - * @digest_size: size of the algorithm - */ -struct tcg_efi_spec_id_event_algorithm_size { - u16 algorithm_id; - u16 digest_size; -} __packed; - -/** - * struct TCG_EfiSpecIDEventStruct - content of the event log header - * - * @signature: signature, set to Spec ID Event03 - * @platform_class: class defined in TCG ACPI Specification - * Client Common Header. - * @spec_version_minor: minor version - * @spec_version_major: major version - * @spec_version_errata: major version - * @uintn_size: size of the efi_uintn_t fields used in various - * data structures used in this specification. - * 0x01 indicates u32 and 0x02 indicates u64 - * @number_of_algorithms: hashing algorithms used in this event log - * @digest_sizes: array of number_of_algorithms pairs - * 1st member defines the algorithm id - * 2nd member defines the algorithm size - */ -struct tcg_efi_spec_id_event { - u8 signature[16]; - u32 platform_class; - u8 spec_version_minor; - u8 spec_version_major; - u8 spec_errata; - u8 uintn_size; - u32 number_of_algorithms; - struct tcg_efi_spec_id_event_algorithm_size digest_sizes[]; -} __packed; - /** * struct tdEFI_TCG2_FINAL_EVENTS_TABLE - log entries after Get Event Log * @version: version number for this structure diff --git a/include/env/ti/dfu.h b/include/env/ti/dfu.h index 3c90570107..10bcf33c63 100644 --- a/include/env/ti/dfu.h +++ b/include/env/ti/dfu.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2016 Texas Instruments Incorporated - https://www.ti.com * * Environment variable definitions for DFU on TI boards. */ diff --git a/include/env/ti/k3_dfu.h b/include/env/ti/k3_dfu.h index a16a3adeca..098f5f5dab 100644 --- a/include/env/ti/k3_dfu.h +++ b/include/env/ti/k3_dfu.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com * * Environment variable definitions for DFU on TI K3 SoCs. * diff --git a/include/env/ti/k3_rproc.h b/include/env/ti/k3_rproc.h index 3418cb42be..a467d751e2 100644 --- a/include/env/ti/k3_rproc.h +++ b/include/env/ti/k3_rproc.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com * * rproc environment variable definitions for various TI K3 SoCs. */ diff --git a/include/env/ti/mmc.h b/include/env/ti/mmc.h index 769ea9d5ef..d07189baaf 100644 --- a/include/env/ti/mmc.h +++ b/include/env/ti/mmc.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2017 Texas Instruments Incorporated - https://www.ti.com * * Environment variable definitions for MMC/SD on TI boards. */ diff --git a/include/env/ti/nand.h b/include/env/ti/nand.h index 7d00afa2b1..0e0da458b9 100644 --- a/include/env/ti/nand.h +++ b/include/env/ti/nand.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com * * Environment variable definitions for NAND on TI boards. */ diff --git a/include/env/ti/ufs.h b/include/env/ti/ufs.h index 6619ec9c88..c192f3aee1 100644 --- a/include/env/ti/ufs.h +++ b/include/env/ti/ufs.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com * * Environment variable definitions for UFS on TI boards. */ diff --git a/include/env_default.h b/include/env_default.h index b16c22d5a2..2ca4a087d3 100644 --- a/include/env_default.h +++ b/include/env_default.h @@ -21,7 +21,7 @@ env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = { { #elif defined(DEFAULT_ENV_INSTANCE_STATIC) static char default_environment[] = { -#elif defined(DEFAULT_ENV_IS_RW) +#elif defined(CONFIG_DEFAULT_ENV_IS_RW) char default_environment[] = { #else const char default_environment[] = { @@ -42,7 +42,7 @@ const char default_environment[] = { #if defined(CONFIG_BOOTDELAY) "bootdelay=" __stringify(CONFIG_BOOTDELAY) "\0" #endif -#if defined(CONFIG_BAUDRATE) && (CONFIG_BAUDRATE >= 0) +#if !defined(CONFIG_OF_SERIAL_BAUD) && defined(CONFIG_BAUDRATE) && (CONFIG_BAUDRATE >= 0) "baudrate=" __stringify(CONFIG_BAUDRATE) "\0" #endif #ifdef CONFIG_LOADS_ECHO @@ -119,6 +119,10 @@ const char default_environment[] = { #ifdef CFG_EXTRA_ENV_SETTINGS CFG_EXTRA_ENV_SETTINGS #endif +#ifdef CONFIG_OF_SERIAL_BAUD + /* Padding for baudrate at the end when environment is writable */ + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" +#endif "\0" #else /* CONFIG_USE_DEFAULT_ENV_FILE */ #include "generated/defaultenv_autogenerated.h" diff --git a/include/env_internal.h b/include/env_internal.h index 6a69494646..fcb464263f 100644 --- a/include/env_internal.h +++ b/include/env_internal.h @@ -89,7 +89,7 @@ typedef struct environment_s { extern env_t embedded_environment; #endif /* ENV_IS_EMBEDDED */ -#ifdef DEFAULT_ENV_IS_RW +#ifdef CONFIG_DEFAULT_ENV_IS_RW extern char default_environment[]; #else extern const char default_environment[]; diff --git a/include/generic-phy.h b/include/generic-phy.h index bee4de8a0b..eaab749166 100644 --- a/include/generic-phy.h +++ b/include/generic-phy.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2017 Texas Instruments Incorporated - https://www.ti.com/ * Written by Jean-Jacques Hiblot <jjhiblot@ti.com> */ diff --git a/include/i2c.h b/include/i2c.h index ef3820eaba..4e59009cd9 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -538,6 +538,18 @@ int i2c_get_chip_for_busnum(int busnum, int chip_addr, uint offset_len, struct udevice **devp); /** + * i2c_get_chip_by_phandle() - get a device to use to access a chip + * based on a phandle property pointing to it + * + * @parent: Parent device containing the phandle pointer + * @name: Name of phandle property in the parent device node + * @devp: Returns pointer to new device or NULL if not found + * Return: 0 on success, -ve on failure + */ +int i2c_get_chip_by_phandle(const struct udevice *parent, const char *prop_name, + struct udevice **devp); + +/** * i2c_chip_of_to_plat() - Decode standard I2C platform data * * This decodes the chip address from a device tree node and puts it into diff --git a/include/image.h b/include/image.h index 5f85bf84a2..2e3cf839ee 100644 --- a/include/image.h +++ b/include/image.h @@ -409,6 +409,7 @@ struct bootm_headers { #define BOOTM_STATE_OS_FAKE_GO 0x00000200 /* 'Almost' run the OS */ #define BOOTM_STATE_OS_GO 0x00000400 #define BOOTM_STATE_PRE_LOAD 0x00000800 +#define BOOTM_STATE_MEASURE 0x00001000 int state; #if defined(CONFIG_LMB) && !defined(USE_HOSTCC) diff --git a/include/interrupt.h b/include/interrupt.h new file mode 100644 index 0000000000..46ef2e196d --- /dev/null +++ b/include/interrupt.h @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <asm/setjmp.h> + +/** + * struct resume_data - data for resume after interrupt + */ +struct resume_data { + /** @jump: longjmp buffer */ + jmp_buf jump; + /** @code: exception code */ + ulong code; +}; + +/** + * set_resume() - set longjmp buffer for resuming after exception + * + * By calling this function it is possible to use a long jump to catch an + * exception. The caller sets the long jump buffer with set_resume() and then + * executes setjmp(). If an exception occurs, the code will return to the + * setjmp caller(). The exception code will be returned in @data->code. + * + * After the critical operation call set_resume(NULL) so that an exception in + * another part of the code will not accidently invoke the long jump. + * + * .. code-block:: c + * + * // This example shows how to use set_resume(). + * + * struct resume_data resume; + * int ret; + * + * set_resume(&resume); + * ret = setjmp(resume.jump); + * if (ret) { + * printf("An exception %ld occurred\n", resume.code); + * } else { + * // Do what might raise an exception here. + * } + * set_resume(NULL); + * + * @data: pointer to structure with longjmp address + * Return: 0 before an exception, 1 after an exception occurred + */ +void set_resume(struct resume_data *data); diff --git a/include/k3-avs.h b/include/k3-avs.h index e3c3cafbb9..1014d5d114 100644 --- a/include/k3-avs.h +++ b/include/k3-avs.h @@ -2,7 +2,7 @@ /* * Texas Instruments' K3 Adaptive Voltage Scaling driver * - * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com/ * Tero Kristo <t-kristo@ti.com> * */ diff --git a/include/k3-clk.h b/include/k3-clk.h index 49ba53d20f..1b6ab8fe65 100644 --- a/include/k3-clk.h +++ b/include/k3-clk.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * (C) Copyright 2020-2021 Texas Instruments Incorporated - http://www.ti.com + * (C) Copyright 2020-2021 Texas Instruments Incorporated - https://www.ti.com * Tero Kristo <t-kristo@ti.com> */ diff --git a/include/k3-dev.h b/include/k3-dev.h index d288ae3be7..072e10ba63 100644 --- a/include/k3-dev.h +++ b/include/k3-dev.h @@ -2,7 +2,7 @@ /* * Texas Instruments K3 Device Platform Data * - * Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2020 Texas Instruments Incorporated - https://www.ti.com/ */ #ifndef __K3_DEV_H__ #define __K3_DEV_H__ diff --git a/include/linux/soc/ti/cppi5.h b/include/linux/soc/ti/cppi5.h index 3a55c3ec46..c5d7ebd05d 100644 --- a/include/linux/soc/ti/cppi5.h +++ b/include/linux/soc/ti/cppi5.h @@ -2,7 +2,7 @@ /* * CPPI5 descriptors interface * - * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2018 Texas Instruments Incorporated - https://www.ti.com */ #ifndef __TI_CPPI5_H__ diff --git a/include/linux/soc/ti/k3-navss-ringacc.h b/include/linux/soc/ti/k3-navss-ringacc.h index 0ad8f203da..30fb903d97 100644 --- a/include/linux/soc/ti/k3-navss-ringacc.h +++ b/include/linux/soc/ti/k3-navss-ringacc.h @@ -2,7 +2,7 @@ /* * TI K3 AM65x NAVSS Ring accelerator Manager (RA) subsystem driver * - * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2018 Texas Instruments Incorporated - https://www.ti.com */ #ifndef __SOC_TI_K3_NAVSS_RINGACC_API_H_ diff --git a/include/linux/soc/ti/k3-sec-proxy.h b/include/linux/soc/ti/k3-sec-proxy.h index f34854ceeb..c3a83f163d 100644 --- a/include/linux/soc/ti/k3-sec-proxy.h +++ b/include/linux/soc/ti/k3-sec-proxy.h @@ -2,7 +2,7 @@ /* * Texas Instruments' K3 Secure proxy * - * Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2017-2018 Texas Instruments Incorporated - https://www.ti.com/ * Lokesh Vutla <lokeshvutla@ti.com> * */ diff --git a/include/linux/soc/ti/ti-udma.h b/include/linux/soc/ti/ti-udma.h index 04e354fb2d..89faf69242 100644 --- a/include/linux/soc/ti/ti-udma.h +++ b/include/linux/soc/ti/ti-udma.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* - * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2018 Texas Instruments Incorporated - https://www.ti.com * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> */ diff --git a/include/linux/soc/ti/ti_sci_protocol.h b/include/linux/soc/ti/ti_sci_protocol.h index 7f9941894c..8e4c43cef3 100644 --- a/include/linux/soc/ti/ti_sci_protocol.h +++ b/include/linux/soc/ti/ti_sci_protocol.h @@ -3,7 +3,7 @@ * Texas Instruments System Control Interface Protocol * Based on include/linux/soc/ti/ti_sci_protocol.h from Linux. * - * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2018 Texas Instruments Incorporated - https://www.ti.com/ * Nishanth Menon * Lokesh Vutla <lokeshvutla@ti.com> */ diff --git a/include/linux/usb/dwc3-omap.h b/include/linux/usb/dwc3-omap.h index 62180e3973..d5737ed7e8 100644 --- a/include/linux/usb/dwc3-omap.h +++ b/include/linux/usb/dwc3-omap.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* include/linux/usb/dwc3-omap.h * - * Copyright (c) 2014 Texas Instruments Incorporated - http://www.ti.com + * Copyright (c) 2014 Texas Instruments Incorporated - https://www.ti.com * * Designware SuperSpeed Glue */ diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 5d0dac950e..e7e3d259ca 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* include/linux/usb/otg.h * - * Copyright (c) 2015 Texas Instruments Incorporated - http://www.ti.com + * Copyright (c) 2015 Texas Instruments Incorporated - https://www.ti.com * * USB OTG (On The Go) defines */ diff --git a/include/mux-internal.h b/include/mux-internal.h index 93e3a5cdd7..67fa28933c 100644 --- a/include/mux-internal.h +++ b/include/mux-internal.h @@ -5,7 +5,7 @@ * Copyright (C) 2017 Axentia Technologies AB * Author: Peter Rosin <peda@axentia.se> * - * Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2017-2018 Texas Instruments Incorporated - https://www.ti.com/ * Jean-Jacques Hiblot <jjhiblot@ti.com> */ diff --git a/include/mux.h b/include/mux.h index c92d887591..e5deaba66f 100644 --- a/include/mux.h +++ b/include/mux.h @@ -10,7 +10,7 @@ * Copyright (C) 2017 Axentia Technologies AB * Author: Peter Rosin <peda@axentia.se> * - * Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2017-2018 Texas Instruments Incorporated - https://www.ti.com/ * Jean-Jacques Hiblot <jjhiblot@ti.com> */ diff --git a/include/net.h b/include/net.h index e254df7d7f..e63a946002 100644 --- a/include/net.h +++ b/include/net.h @@ -16,6 +16,7 @@ #include <asm/cache.h> #include <asm/byteorder.h> /* for nton* / ntoh* stuff */ #include <env.h> +#include <hexdump.h> #include <log.h> #include <time.h> #include <linux/if_ether.h> @@ -29,6 +30,7 @@ struct udevice; #define DEBUG_DEV_PKT 0 /* Packets or info directed to the device */ #define DEBUG_NET_PKT 0 /* Packets on info on the network at large */ #define DEBUG_INT_STATE 0 /* Internal network state changes */ +#define DEBUG_NET_PKT_TRACE 0 /* Trace all packet data */ /* * The number of receive packet buffers, and the required packet buffer @@ -640,6 +642,8 @@ uchar * net_get_async_tx_pkt_buf(void); /* Transmit a packet */ static inline void net_send_packet(uchar *pkt, int len) { + if (DEBUG_NET_PKT_TRACE) + print_hex_dump_bytes("tx: ", DUMP_PREFIX_OFFSET, pkt, len); /* Currently no way to return errors from eth_send() */ (void) eth_send(pkt, len); } diff --git a/include/power/max77663.h b/include/power/max77663.h new file mode 100644 index 0000000000..b3ae3dabf4 --- /dev/null +++ b/include/power/max77663.h @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright(C) 2023 Svyatoslav Ryhel <clamor95@gmail.com> + */ + +#ifndef _MAX77663_H_ +#define _MAX77663_H_ + +#define MAX77663_LDO_NUM 9 +#define MAX77663_SD_NUM 5 + +/* Drivers name */ +#define MAX77663_LDO_DRIVER "max77663_ldo" +#define MAX77663_SD_DRIVER "max77663_sd" +#define MAX77663_RST_DRIVER "max77663_rst" + +/* Step-Down (SD) Regulator calculations */ +#define SD_STATUS_MASK 0x30 + +#define SD0_VOLT_MAX_HEX 0x40 +#define SD1_VOLT_MAX_HEX 0x4c +#define SD_VOLT_MAX_HEX 0xff +#define SD_VOLT_MIN_HEX 0x02 + +#define SD0_VOLT_MAX 1400000 +#define SD1_VOLT_MAX 1550000 +#define SD_VOLT_MAX 3787500 +#define SD_VOLT_MIN 625000 + +#define SD_VOLT_BASE 600000 + +/* Low-Dropout Linear (LDO) Regulator calculations */ +#define LDO_STATUS_MASK 0xc0 +#define LDO_VOLT_MASK 0x3f +#define LDO_VOLT_MAX_HEX 0x3f + +#define LDO01_VOLT_MAX 2375000 +#define LDO4_VOLT_MAX 1587500 +#define LDO_VOLT_MAX 3950000 + +#define LDO_VOLT_BASE 800000 + +#define MAX77663_REG_ONOFF_CFG1 0x41 +#define ONOFF_SFT_RST BIT(7) +#define ONOFF_PWR_OFF BIT(1) + +#endif /* _MAX77663_H_ */ diff --git a/include/power/palmas.h b/include/power/palmas.h index df5f15c5bd..0a612052f0 100644 --- a/include/power/palmas.h +++ b/include/power/palmas.h @@ -2,6 +2,10 @@ #define TPS659038 0x1 #define TPS65917 0x2 +struct palmas_priv { + struct udevice *chip2; +}; + /* I2C device address for pmic palmas */ #define PALMAS_I2C_ADDR (0x12 >> 1) #define PALMAS_LDO_NUM 11 @@ -10,6 +14,7 @@ /* Drivers name */ #define PALMAS_LDO_DRIVER "palmas_ldo" #define PALMAS_SMPS_DRIVER "palmas_smps" +#define PALMAS_RST_DRIVER "palmas_rst" #define PALMAS_SMPS_VOLT_MASK 0x7F #define PALMAS_SMPS_RANGE_MASK 0x80 @@ -24,3 +29,9 @@ #define PALMAS_LDO_MODE_MASK 0x1 #define PALMAS_LDO_STATUS_MASK 0x10 #define PALMAS_LDO_BYPASS_EN 0x40 + +#define PALMAS_DEV_CTRL 0xA0 +#define SW_RST BIT(1) +#define DEV_OFF 0x00 +#define PALMAS_INT3_MASK 0x1B +#define MASK_VBUS BIT(7) diff --git a/include/power/tps62362.h b/include/power/tps62362.h index f0fc538463..df06c28fed 100644 --- a/include/power/tps62362.h +++ b/include/power/tps62362.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * (C) Copyright 2014 Texas Instruments Incorporated - http://www.ti.com + * (C) Copyright 2014 Texas Instruments Incorporated - https://www.ti.com * Author: Felipe Balbi <balbi@ti.com> */ diff --git a/include/power/tps65217.h b/include/power/tps65217.h index 669a94a6c8..7862b31bfb 100644 --- a/include/power/tps65217.h +++ b/include/power/tps65217.h @@ -3,7 +3,7 @@ * (C) Copyright 2011-2013 * Texas Instruments, <www.ti.com> * - * For more details, please see the TRM at http://www.ti.com/product/tps65217a + * For more details, please see the TRM at https://www.ti.com/product/tps65217a */ #ifndef __POWER_TPS65217_H__ diff --git a/include/power/tps65910.h b/include/power/tps65910.h index 21b2a21ee0..ccc759acf6 100644 --- a/include/power/tps65910.h +++ b/include/power/tps65910.h @@ -3,7 +3,7 @@ * (C) Copyright 2011-2013 * Texas Instruments, <www.ti.com> * - * For more details, please see the TRM at http://www.ti.com/product/tps65910 + * For more details, please see the TRM at https://www.ti.com/product/tps65910 */ #ifndef __POWER_TPS65910_H__ #define __POWER_TPS65910_H__ diff --git a/include/power/tps65910_pmic.h b/include/power/tps65910_pmic.h index 66214786d3..2026ec2f42 100644 --- a/include/power/tps65910_pmic.h +++ b/include/power/tps65910_pmic.h @@ -17,6 +17,12 @@ #define TPS65910_SUPPLY_STATE_OFF 0x0 #define TPS65910_SUPPLY_STATE_ON 0x1 +/* TPS65910 DEVICE_CTRL bits */ +#define PWR_OFF_SEQ BIT(7) +#define DEV_OFF_RST BIT(3) +#define DEV_ON BIT(2) +#define DEV_OFF BIT(0) + /* i2c registers */ enum { TPS65910_REG_RTC_SEC = 0x00, @@ -125,5 +131,50 @@ struct tps65910_regulator_pdata { #define TPS65910_BUCK_DRIVER "tps65910_buck" #define TPS65910_BOOST_DRIVER "tps65910_boost" #define TPS65910_LDO_DRIVER "tps65910_ldo" +#define TPS65910_RST_DRIVER "tps65910_rst" + +/* tps65911 i2c registers */ +enum { + TPS65911_REG_VIO = 0x20, + TPS65911_REG_VDD1, + TPS65911_REG_VDD1_OP, + TPS65911_REG_VDD1_SR, + TPS65911_REG_VDD2, + TPS65911_REG_VDD2_OP, + TPS65911_REG_VDD2_SR, + TPS65911_REG_VDDCTRL, + TPS65911_REG_VDDCTRL_OP, + TPS65911_REG_VDDCTRL_SR, + TPS65911_REG_LDO1 = 0x30, + TPS65911_REG_LDO2, + TPS65911_REG_LDO5, + TPS65911_REG_LDO8, + TPS65911_REG_LDO7, + TPS65911_REG_LDO6, + TPS65911_REG_LDO4, + TPS65911_REG_LDO3, +}; + +#define TPS65911_VDD_NUM 4 +#define TPS65911_LDO_NUM 8 + +#define TPS65911_VDD_VOLT_MAX 1500000 +#define TPS65911_VDD_VOLT_MIN 600000 +#define TPS65911_VDD_VOLT_BASE 562500 + +#define TPS65911_LDO_VOLT_MAX 3300000 +#define TPS65911_LDO_VOLT_BASE 800000 + +#define TPS65911_LDO_SEL_MASK (0x3f << 2) + +#define TPS65911_LDO124_VOLT_MAX_HEX 0x32 +#define TPS65911_LDO358_VOLT_MAX_HEX 0x19 +#define TPS65911_LDO358_VOLT_MIN_HEX 0x02 + +#define TPS65911_LDO124_VOLT_STEP 50000 +#define TPS65911_LDO358_VOLT_STEP 100000 + +#define TPS65911_VDD_DRIVER "tps65911_vdd" +#define TPS65911_LDO_DRIVER "tps65911_ldo" #endif /* __TPS65910_PMIC_H_ */ diff --git a/include/power/tps80031.h b/include/power/tps80031.h new file mode 100644 index 0000000000..983c841bfe --- /dev/null +++ b/include/power/tps80031.h @@ -0,0 +1,50 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright(C) 2023 Svyatoslav Ryhel <clamor95@gmail.com> + */ + +#ifndef _TPS80031_H_ +#define _TPS80031_H_ + +#define TPS80031_LDO_NUM 9 +#define TPS80031_SMPS_NUM 5 + +/* Drivers name */ +#define TPS80031_LDO_DRIVER "tps80031_ldo" +#define TPS80031_SMPS_DRIVER "tps80031_smps" +#define TPS80031_RST_DRIVER "tps80031_rst" + +#define TPS80031_SMPS_OFFSET 0xe0 +#define TPS80031_OFFSET_FLAG BIT(0) + +#define REGULATOR_STATUS_MASK 0x3 +#define REGULATOR_MODE_ON 0x1 + +/* Switched-Mode Power Supply Regulator calculations */ +#define SMPS_VOLT_MASK 0x3f +#define SMPS_VOLT_LINEAR_HEX 0x39 +#define SMPS_VOLT_NLINEAR_HEX 0x3a +#define SMPS_VOLT_LINEAR 1300000 +#define SMPS_VOLT_BASE 600000 +#define SMPS_VOLT_BASE_OFFSET 700000 + +/* Low-Dropout Linear (LDO) Regulator calculations */ +#define LDO_VOLT_MASK 0x3f +#define LDO_VOLT_MAX_HEX 0x18 +#define LDO_VOLT_MIN_HEX 0x01 +#define LDO_VOLT_MAX 3360000 +#define LDO_VOLT_MIN 1018000 +#define LDO_VOLT_BASE 916000 + +#define TPS80031_PHOENIX_DEV_ON 0x25 +#define SW_RESET BIT(6) +#define DEVOFF BIT(0) + +/* register groups */ +enum { + CTRL, + VOLT, + OFFSET, +}; + +#endif /* _TPS80031_H_ */ diff --git a/include/remoteproc.h b/include/remoteproc.h index f48054de6b..a11dc8a9b6 100644 --- a/include/remoteproc.h +++ b/include/remoteproc.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* * (C) Copyright 2015 - * Texas Instruments Incorporated - http://www.ti.com/ + * Texas Instruments Incorporated - https://www.ti.com/ */ #ifndef _RPROC_H_ diff --git a/include/rkmtd.h b/include/rkmtd.h new file mode 100644 index 0000000000..145fede6c8 --- /dev/null +++ b/include/rkmtd.h @@ -0,0 +1,191 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Driver interface derived from: + * /include/sandbox_host.h + * Copyright 2022 Google LLC + * + * Copyright 2023 Johan Jonker <jbx6244@gmail.com> + */ + +#ifndef __RKMTD__ +#define __RKMTD__ + +#include <part_efi.h> +#include <uuid.h> + +#define LBA 64 + 512 + 33 + +#define RK_TAG 0xFCDC8C3B +#define NFC_SYS_DATA_SIZE 4 +#define BLK_SIZE 2048 +#define STEP_SIZE 1024 +#define BUF_SIZE 512 * 512 + +struct nand_para_info { + u8 id_bytes; + u8 nand_id[6]; + u8 vendor; + u8 die_per_chip; + u8 sec_per_page; + u16 page_per_blk; + u8 cell; + u8 plane_per_die; + u16 blk_per_plane; + u16 operation_opt; + u8 lsb_mode; + u8 read_retry_mode; + u8 ecc_bits; + u8 access_freq; + u8 opt_mode; + u8 die_gap; + u8 bad_block_mode; + u8 multi_plane_mode; + u8 slc_mode; + u8 reserved[5]; +}; + +struct bootblk { + int blk; + int boot_size; + int offset; +}; + +struct rkmtd_dev { + struct udevice *dev; + struct blk_desc *desc; + char *label; + legacy_mbr *mbr; + gpt_header *gpt_h; + gpt_header *gpt_h2; + gpt_entry *gpt_e; + char *check; + char *idb; + char *str; + char uuid_part_str[UUID_STR_LEN + 1]; + char uuid_disk_str[UUID_STR_LEN + 1]; + char *datbuf; + char *oobbuf; + struct mtd_info *mtd; + struct nand_para_info *info; + u16 page_table[512]; + u32 idb_need_write_back; + struct bootblk idblock[5]; + u32 blk_counter; + u32 boot_blks; + u32 offset; + u32 boot_size; + u32 lsb_mode; +}; + +struct sector0 { + u32 magic; + u8 reserved[4]; + u32 rc4_flag; + u16 boot_code1_offset; + u16 boot_code2_offset; + u8 reserved1[490]; + u16 flash_data_size; + u16 flash_boot_size; + u8 reserved2[2]; +} __packed; + +/** + * rkmtd_rc4() - Rockchip specific RC4 Encryption Algorithm + * + * Encrypt Rockchip boot block header version 1 and data + * + * @buf: Pointer to data buffer + * @len: Data buffer size + */ +void rkmtd_rc4(u8 *buf, u32 len); + +/** + * struct rkmtd_ops - operations supported by UCLASS_RKMTD + */ +struct rkmtd_ops { + /** + * @attach_mtd: - Attach a new rkmtd driver to the device structure + * + * @attach_mtd.dev: Device to update + * @attach_mtd.Returns: 0 if OK, -EEXIST if a driver is already attached, + * other -ve on other error + */ + int (*attach_mtd)(struct udevice *dev); + + /** + * @detach_mtd: - Detach a rkmtd driver from the device structure + * + * @detach_mtd.dev: Device to detach from + * @detach_mtd.Returns: 0 if OK, -ENOENT if no driver is attached, + * other -ve on other error + */ + int (*detach_mtd)(struct udevice *dev); +}; + +#define rkmtd_get_ops(dev) ((struct rkmtd_ops *)(dev)->driver->ops) + +/** + * rkmtd_get_cur_dev() - Get the current device + * + * Returns current device, or NULL if none + */ +struct udevice *rkmtd_get_cur_dev(void); + +/** + * rkmtd_set_cur_dev() - Set the current device + * + * Sets the current device, or clears it if @dev is NULL + * + * @dev: Device to set as the current one + */ +void rkmtd_set_cur_dev(struct udevice *dev); + +/** + * rkmtd_find_by_label() - Find a rkmtd device by label + * + * Searches all rkmtd devices to find one with the given label + * + * @label: Label to find + * Returns: associated device, or NULL if not found + */ +struct udevice *rkmtd_find_by_label(const char *label); + +/** + * rkmtd_attach() - Attach a new rkmtd driver to the device structure + * + * @dev: Device to update + * Returns: 0 if OK, -EEXIST if a file is already attached, other -ve on + * other error + */ +int rkmtd_attach(struct udevice *dev); + +/** + * rkmtd_detach() - Detach a rkmtd driver from the device structure + * + * @dev: Device to detach from + * Returns: 0 if OK, -ENOENT if no file is attached, other -ve on other + * error + */ +int rkmtd_detach(struct udevice *dev); + +/** + * rkmtd_create_device() - Create a new rkmtd device + * + * Any existing device with the same label is removed and unbound first + * + * @label: Label of the attachment, e.g. "test1" + * @devp: Returns the device created, on success + * Returns: 0 if OK, -ve on error + */ +int rkmtd_create_device(const char *label, struct udevice **devp); + +/** + * rkmtd_create_attach_mtd() - Create a new rkmtd device and attach driver + * + * @label: Label of the attachment, e.g. "test1" + * @devp: Returns the device created, on success + * Returns: 0 if OK, -ve on error + */ +int rkmtd_create_attach_mtd(const char *label, struct udevice **devp); + +#endif /* __RKMTD__ */ diff --git a/include/scmi_agent-uclass.h b/include/scmi_agent-uclass.h index 35d9606964..33e0e18c30 100644 --- a/include/scmi_agent-uclass.h +++ b/include/scmi_agent-uclass.h @@ -23,6 +23,7 @@ struct scmi_channel; * @agent_name: Agent name * @agent_id: Identifier of agent * @base_dev: SCMI base protocol device + * @pwdom_dev: SCMI power domain management protocol device * @clock_dev: SCMI clock protocol device * @resetdom_dev: SCMI reset domain protocol device * @voltagedom_dev: SCMI voltage domain protocol device @@ -38,6 +39,7 @@ struct scmi_agent_priv { u8 *agent_name; u32 agent_id; struct udevice *base_dev; + struct udevice *pwdom_dev; struct udevice *clock_dev; struct udevice *resetdom_dev; struct udevice *voltagedom_dev; diff --git a/include/scmi_protocols.h b/include/scmi_protocols.h index 163647a57b..7abb2a6f36 100644 --- a/include/scmi_protocols.h +++ b/include/scmi_protocols.h @@ -545,6 +545,184 @@ int scmi_base_reset_agent_configuration(struct udevice *dev, u32 agent_id, u32 flags); /* + * SCMI Power Domain Management Protocol + */ + +#define SCMI_PWD_PROTOCOL_VERSION 0x30000 +#define SCMI_PWD_PSTATE_TYPE_LOST BIT(30) +#define SCMI_PWD_PSTATE_ID GENMASK(27, 0) + +enum scmi_power_domain_message_id { + SCMI_PWD_ATTRIBUTES = 0x3, + SCMI_PWD_STATE_SET = 0x4, + SCMI_PWD_STATE_GET = 0x5, + SCMI_PWD_STATE_NOTIFY = 0x6, + SCMI_PWD_STATE_CHANGE_REQUESTED_NOTIFY = 0x7, + SCMI_PWD_NAME_GET = 0x8, +}; + +/** + * struct scmi_pwd_protocol_attrs_out + * @status: SCMI command status + * @attributes: Protocol attributes + * @stats_addr_low: Lower 32 bits of address of statistics memory region + * @stats_addr_high: Higher 32 bits of address of statistics memory region + * @stats_len: Length of statistics memory region + */ +struct scmi_pwd_protocol_attrs_out { + s32 status; + u32 attributes; + u32 stats_addr_low; + u32 stats_addr_high; + u32 stats_len; +}; + +#define SCMI_PWD_PROTO_ATTRS_NUM_PWD(attributes) ((attributes) & GENMASK(15, 0)) + +/** + * struct scmi_pwd_protocol_msg_attrs_out + * @status: SCMI command status + * @attributes: Message-specific attributes + */ +struct scmi_pwd_protocol_msg_attrs_out { + s32 status; + u32 attributes; +}; + +#define SCMI_PWD_NAME_LENGTH_MAX 16 + +/** + * struct scmi_pwd_attrs_out + * @status: SCMI command status + * @attributes: Power domain attributes + * @name: Name of power domain + */ +struct scmi_pwd_attrs_out { + s32 status; + u32 attributes; + u8 name[SCMI_PWD_NAME_LENGTH_MAX]; +}; + +#define SCMI_PWD_ATTR_PSTATE_CHANGE_NOTIFY BIT(31) +#define SCMI_PWD_ATTR_PSTATE_ASYNC BIT(30) +#define SCMI_PWD_ATTR_PSTATE_SYNC BIT(29) +#define SCMI_PWD_ATTR_PSTATE_CHANGE_RQ_NOTIFY BIT(28) +#define SCMI_PWD_ATTR_EXTENDED_NAME BIT(27) + +/** + * struct scmi_pwd_state_set_in + * @flags: Flags + * @domain_id: Identifier of power domain + * @pstate: Power state of the domain + */ +struct scmi_pwd_state_set_in { + u32 flags; + u32 domain_id; + u32 pstate; +}; + +#define SCMI_PWD_SET_FLAGS_ASYNC BIT(0) + +/** + * struct scmi_pwd_state_get_out + * @status: SCMI command status + * @pstate: Power state of the domain + */ +struct scmi_pwd_state_get_out { + s32 status; + u32 pstate; +}; + +#define SCMI_PWD_EXTENDED_NAME_MAX 64 +/** + * struct scmi_pwd_name_get_out + * @status: SCMI command status + * @flags: Parameter flags + * @extended_name: Extended name of power domain + */ +struct scmi_pwd_name_get_out { + s32 status; + u32 flags; + u8 extended_name[SCMI_PWD_EXTENDED_NAME_MAX]; +}; + +/** + * scmi_pwd_protocol_attrs - get protocol attributes + * @dev: SCMI protocol device + * @num_pwdoms: Number of power domains + * @stats_addr: Address of statistics memory region + * @stats_len: Length of statistics memory region + * + * Obtain the protocol attributes, the number of power domains and + * the information of statistics memory region. + * + * Return: 0 on success, error code on failure + */ +int scmi_pwd_protocol_attrs(struct udevice *dev, int *num_pwdoms, + u64 *stats_addr, size_t *stats_len); +/** + * scmi_pwd_protocol_message_attrs - get message-specific attributes + * @dev: SCMI protocol device + * @message_id: SCMI message ID + * @attributes: Message-specific attributes + * + * Obtain the message-specific attributes in @attributes. + * + * Return: 0 on success, error code on failure + */ +int scmi_pwd_protocol_message_attrs(struct udevice *dev, s32 message_id, + u32 *attributes); +/** + * scmi_pwd_attrs - get power domain attributes + * @dev: SCMI protocol device + * @domain_id: Identifier of power domain + * @attributes: Power domain attributes + * @name: Name of power domain + * + * Obtain the attributes of the given power domain, @domain_id, in @attributes + * as well as its name in @name. + * + * Return: 0 on success, error code on failure + */ +int scmi_pwd_attrs(struct udevice *dev, u32 message_id, u32 *attributes, + u8 **name); +/** + * scmi_pwd_state_set - set power state + * @dev: SCMI protocol device + * @flags: Parameter flags + * @domain_id: Identifier of power domain + * @pstate: Power state + * + * Change the power state of the given power domain, @domain_id. + * + * Return: 0 on success, error code on failure + */ +int scmi_pwd_state_set(struct udevice *dev, u32 flags, u32 domain_id, + u32 pstate); +/** + * scmi_pwd_state_get - get power state + * @dev: SCMI protocol device + * @domain_id: Identifier of power domain + * @pstate: Power state + * + * Obtain the power state of the given power domain, @domain_id. + * + * Return: 0 on success, error code on failure + */ +int scmi_pwd_state_get(struct udevice *dev, u32 domain_id, u32 *pstate); +/** + * scmi_pwd_name_get - get extended name + * @dev: SCMI protocol device + * @domain_id: Identifier of power domain + * @name: Extended name of the domain + * + * Obtain the extended name of the given power domain, @domain_id, in @name. + * + * Return: 0 on success, error code on failure + */ +int scmi_pwd_name_get(struct udevice *dev, u32 domain_id, u8 **name); + +/* * SCMI Clock Protocol */ diff --git a/include/sdhci.h b/include/sdhci.h index 70fefca2a9..a1b74e3bd7 100644 --- a/include/sdhci.h +++ b/include/sdhci.h @@ -57,6 +57,7 @@ #define SDHCI_PRESENT_STATE 0x24 #define SDHCI_CMD_INHIBIT BIT(0) #define SDHCI_DATA_INHIBIT BIT(1) +#define SDHCI_DAT_ACTIVE BIT(2) #define SDHCI_DOING_WRITE BIT(8) #define SDHCI_DOING_READ BIT(9) #define SDHCI_SPACE_AVAILABLE BIT(10) diff --git a/include/serial.h b/include/serial.h index 205889d28b..d129dc3253 100644 --- a/include/serial.h +++ b/include/serial.h @@ -339,6 +339,13 @@ int serial_setconfig(struct udevice *dev, uint config); */ int serial_getinfo(struct udevice *dev, struct serial_device_info *info); +/** + * fetch_baud_from_dtb() - Fetch the baudrate value from DT + * + * Return: baudrate if OK, -ve on error + */ +int fetch_baud_from_dtb(void); + void atmel_serial_initialize(void); void mcf_serial_initialize(void); void mpc85xx_serial_initialize(void); diff --git a/include/soc.h b/include/soc.h index a52a300a84..850db28b76 100644 --- a/include/soc.h +++ b/include/soc.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * (C) Copyright 2020 - Texas Instruments Incorporated - http://www.ti.com/ + * (C) Copyright 2020 - Texas Instruments Incorporated - https://www.ti.com/ * Dave Gerlach <d-gerlach@ti.com> */ diff --git a/include/spl.h b/include/spl.h index 0d49e4a454..8ff20adc28 100644 --- a/include/spl.h +++ b/include/spl.h @@ -497,6 +497,32 @@ int spl_mmc_emmc_boot_partition(struct mmc *mmc); void spl_set_bd(void); /** + * spl_mmc_get_uboot_raw_sector() - Provide raw sector of the start of U-Boot (architecture override) + * + * This is a weak function which by default will provide the raw sector that is + * where the start of the U-Boot image has been written to. + * + * @mmc: struct mmc that describes the devie where U-Boot resides + * @raw_sect: The raw sector number where U-Boot is by default. + * Return: The raw sector location that U-Boot resides at + */ +unsigned long arch_spl_mmc_get_uboot_raw_sector(struct mmc *mmc, + unsigned long raw_sect); + +/** + * spl_mmc_get_uboot_raw_sector() - Provide raw sector of the start of U-Boot (board override) + * + * This is a weak function which by default will provide the raw sector that is + * where the start of the U-Boot image has been written to. + * + * @mmc: struct mmc that describes the devie where U-Boot resides + * @raw_sect: The raw sector number where U-Boot is by default. + * Return: The raw sector location that U-Boot resides at + */ +unsigned long board_spl_mmc_get_uboot_raw_sector(struct mmc *mmc, + unsigned long raw_sect); + +/** * spl_mmc_get_uboot_raw_sector() - Provide raw sector of the start of U-Boot * * This is a weak function which by default will provide the raw sector that is diff --git a/include/test/suites.h b/include/test/suites.h index 1c7dc65966..ad4fc926f4 100644 --- a/include/test/suites.h +++ b/include/test/suites.h @@ -45,6 +45,8 @@ int do_ut_font(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ut_lib(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ut_loadm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ut_log(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]); +int do_ut_mbr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); +int do_ut_measurement(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]); int do_ut_mem(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ut_optee(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ut_overlay(struct cmd_tbl *cmdtp, int flag, int argc, diff --git a/include/ti-usb-phy-uboot.h b/include/ti-usb-phy-uboot.h index cd2ba40477..feeddb8652 100644 --- a/include/ti-usb-phy-uboot.h +++ b/include/ti-usb-phy-uboot.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* include/ti_usb_phy_uboot.h * - * Copyright (c) 2014 Texas Instruments Incorporated - http://www.ti.com + * Copyright (c) 2014 Texas Instruments Incorporated - https://www.ti.com * * USB2 and USB3 PHY uboot init */ diff --git a/include/tpm-v2.h b/include/tpm-v2.h index 2b6980e441..33dd103767 100644 --- a/include/tpm-v2.h +++ b/include/tpm-v2.h @@ -169,7 +169,7 @@ struct tcg_pcr_event { /** * Definition of TPMU_HA Union */ -union tmpu_ha { +union tpmu_ha { u8 sha1[TPM2_SHA1_DIGEST_SIZE]; u8 sha256[TPM2_SHA256_DIGEST_SIZE]; u8 sm3_256[TPM2_SM3_256_DIGEST_SIZE]; @@ -185,7 +185,7 @@ union tmpu_ha { */ struct tpmt_ha { u16 hash_alg; - union tmpu_ha digest; + union tpmu_ha digest; } __packed; /** @@ -217,6 +217,50 @@ struct tcg_pcr_event2 { } __packed; /** + * struct TCG_EfiSpecIdEventAlgorithmSize - hashing algorithm information + * + * @algorithm_id: algorithm defined in enum tpm2_algorithms + * @digest_size: size of the algorithm + */ +struct tcg_efi_spec_id_event_algorithm_size { + u16 algorithm_id; + u16 digest_size; +} __packed; + +#define TCG_EFI_SPEC_ID_EVENT_SIGNATURE_03 "Spec ID Event03" +#define TCG_EFI_SPEC_ID_EVENT_SPEC_VERSION_MAJOR_TPM2 2 +#define TCG_EFI_SPEC_ID_EVENT_SPEC_VERSION_MINOR_TPM2 0 +#define TCG_EFI_SPEC_ID_EVENT_SPEC_VERSION_ERRATA_TPM2 2 + +/** + * struct TCG_EfiSpecIDEventStruct - content of the event log header + * + * @signature: signature, set to Spec ID Event03 + * @platform_class: class defined in TCG ACPI Specification + * Client Common Header. + * @spec_version_minor: minor version + * @spec_version_major: major version + * @spec_version_errata: major version + * @uintn_size: size of the efi_uintn_t fields used in various + * data structures used in this specification. + * 0x01 indicates u32 and 0x02 indicates u64 + * @number_of_algorithms: hashing algorithms used in this event log + * @digest_sizes: array of number_of_algorithms pairs + * 1st member defines the algorithm id + * 2nd member defines the algorithm size + */ +struct tcg_efi_spec_id_event { + u8 signature[16]; + u32 platform_class; + u8 spec_version_minor; + u8 spec_version_major; + u8 spec_errata; + u8 uintn_size; + u32 number_of_algorithms; + struct tcg_efi_spec_id_event_algorithm_size digest_sizes[]; +} __packed; + +/** * TPM2 Structure Tags for command/response buffers. * * @TPM2_ST_NO_SESSIONS: the command does not need an authentication. @@ -342,6 +386,26 @@ enum tpm2_algorithms { TPM2_ALG_SM3_256 = 0x12, }; +extern const enum tpm2_algorithms tpm2_supported_algorithms[4]; + +static inline u16 tpm2_algorithm_to_len(enum tpm2_algorithms a) +{ + switch (a) { + case TPM2_ALG_SHA1: + return TPM2_SHA1_DIGEST_SIZE; + case TPM2_ALG_SHA256: + return TPM2_SHA256_DIGEST_SIZE; + case TPM2_ALG_SHA384: + return TPM2_SHA384_DIGEST_SIZE; + case TPM2_ALG_SHA512: + return TPM2_SHA512_DIGEST_SIZE; + default: + return 0; + } +} + +#define tpm2_algorithm_to_mask(a) (1 << (a)) + /* NV index attributes */ enum tpm_index_attrs { TPMA_NV_PPWRITE = 1UL << 0, @@ -422,6 +486,188 @@ enum { }; /** + * struct tcg2_event_log - Container for managing the platform event log + * + * @log: Address of the log + * @log_position: Current entry position + * @log_size: Log space available + * @found: Boolean indicating if an existing log was discovered + */ +struct tcg2_event_log { + u8 *log; + u32 log_position; + u32 log_size; + bool found; +}; + +/** + * Create a list of digests of the supported PCR banks for a given input data + * + * @dev TPM device + * @input Data + * @length Length of the data to calculate the digest + * @digest_list List of digests to fill in + * + * Return: zero on success, negative errno otherwise + */ +int tcg2_create_digest(struct udevice *dev, const u8 *input, u32 length, + struct tpml_digest_values *digest_list); + +/** + * Get the event size of the specified digests + * + * @digest_list List of digests for the event + * + * Return: Size in bytes of the event + */ +u32 tcg2_event_get_size(struct tpml_digest_values *digest_list); + +/** + * tcg2_get_active_pcr_banks + * + * @dev TPM device + * @active_pcr_banks Bitmask of PCR algorithms supported + * + * Return: zero on success, negative errno otherwise + */ +int tcg2_get_active_pcr_banks(struct udevice *dev, u32 *active_pcr_banks); + +/** + * tcg2_log_append - Append an event to an event log + * + * @pcr_index Index of the PCR + * @event_type Type of event + * @digest_list List of digests to add + * @size Size of event + * @event Event data + * @log Log buffer to append the event to + */ +void tcg2_log_append(u32 pcr_index, u32 event_type, + struct tpml_digest_values *digest_list, u32 size, + const u8 *event, u8 *log); + +/** + * Extend the PCR with specified digests + * + * @dev TPM device + * @pcr_index Index of the PCR + * @digest_list List of digests to extend + * + * Return: zero on success, negative errno otherwise + */ +int tcg2_pcr_extend(struct udevice *dev, u32 pcr_index, + struct tpml_digest_values *digest_list); + +/** + * Read the PCR into a list of digests + * + * @dev TPM device + * @pcr_index Index of the PCR + * @digest_list List of digests to extend + * + * Return: zero on success, negative errno otherwise + */ +int tcg2_pcr_read(struct udevice *dev, u32 pcr_index, + struct tpml_digest_values *digest_list); + +/** + * Measure data into the TPM PCRs and the platform event log. + * + * @dev TPM device + * @log Platform event log + * @pcr_index Index of the PCR + * @size Size of the data or 0 for event only + * @data Pointer to the data or NULL for event only + * @event_type Event log type + * @event_size Size of the event + * @event Pointer to the event + * + * Return: zero on success, negative errno otherwise + */ +int tcg2_measure_data(struct udevice *dev, struct tcg2_event_log *elog, + u32 pcr_index, u32 size, const u8 *data, u32 event_type, + u32 event_size, const u8 *event); + +#define tcg2_measure_event(dev, elog, pcr_index, event_type, size, event) \ + tcg2_measure_data(dev, elog, pcr_index, 0, NULL, event_type, size, \ + event) + +/** + * Prepare the event log buffer. This function tries to discover an existing + * event log in memory from a previous bootloader stage. If such a log exists + * and the PCRs are not extended, the log is "replayed" to extend the PCRs. + * If no log is discovered, create the log header. + * + * @dev TPM device + * @elog Platform event log. The log pointer and log_size + * members must be initialized to either 0 or to a valid + * memory region, in which case any existing log + * discovered will be copied to the specified memory + * region. + * @ignore_existing_log Boolean to indicate whether or not to ignore an + * existing platform log in memory + * + * Return: zero on success, negative errno otherwise + */ +int tcg2_log_prepare_buffer(struct udevice *dev, struct tcg2_event_log *elog, + bool ignore_existing_log); + +/** + * Begin measurements. + * + * @dev TPM device + * @elog Platform event log. The log pointer and log_size + * members must be initialized to either 0 or to a valid + * memory region, in which case any existing log + * discovered will be copied to the specified memory + * region. + * @ignore_existing_log Boolean to indicate whether or not to ignore an + * existing platform log in memory + * + * Return: zero on success, negative errno otherwise + */ +int tcg2_measurement_init(struct udevice **dev, struct tcg2_event_log *elog, + bool ignore_existing_log); + +/** + * Stop measurements and record separator events. + * + * @dev TPM device + * @elog Platform event log + * @error Boolean to indicate whether an error ocurred or not + */ +void tcg2_measurement_term(struct udevice *dev, struct tcg2_event_log *elog, + bool error); + +/** + * Get the platform event log address and size. + * + * @dev TPM device + * @addr Address of the log + * @size Size of the log + * + * Return: zero on success, negative errno otherwise + */ +int tcg2_platform_get_log(struct udevice *dev, void **addr, u32 *size); + +/** + * Get the first TPM2 device found. + * + * @dev TPM device + * + * Return: zero on success, negative errno otherwise + */ +int tcg2_platform_get_tpm2(struct udevice **dev); + +/** + * Platform-specific function for handling TPM startup errors + * + * @dev TPM device + * @rc The TPM response code + */ +void tcg2_platform_startup_error(struct udevice *dev, int rc); + +/** * Issue a TPM2_Startup command. * * @dev TPM device @@ -541,6 +787,19 @@ u32 tpm2_get_capability(struct udevice *dev, u32 capability, u32 property, void *buf, size_t prop_count); /** + * tpm2_get_pcr_info() - get the supported, active PCRs and number of banks + * + * @dev: TPM device + * @supported_pcr: bitmask with the algorithms supported + * @active_pcr: bitmask with the active algorithms + * @pcr_banks: number of PCR banks + * + * @return 0 on success, code of operation or negative errno on failure + */ +int tpm2_get_pcr_info(struct udevice *dev, u32 *supported_pcr, u32 *active_pcr, + u32 *pcr_banks); + +/** * Issue a TPM2_DictionaryAttackLockReset command. * * @dev TPM device |