summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/sections.h2
-rw-r--r--include/bloblist.h18
-rw-r--r--include/cadence-nand.h529
-rw-r--r--include/configs/am335x_guardian.h5
-rw-r--r--include/configs/beagley_ai.h14
-rw-r--r--include/configs/bk4r1.h2
-rw-r--r--include/configs/brppt2.h1
-rw-r--r--include/configs/display5.h1
-rw-r--r--include/configs/ge_b1x5v2.h8
-rw-r--r--include/configs/ge_bx50v3.h8
-rw-r--r--include/configs/imx6-engicam.h1
-rw-r--r--include/configs/imx6q-bosch-acc.h3
-rw-r--r--include/configs/imx8mm-mx8menlo.h8
-rw-r--r--include/configs/imx8mm_data_modul_edm_sbc.h1
-rw-r--r--include/configs/imx8mp_data_modul_edm_sbc.h1
-rw-r--r--include/configs/imx8mp_dhcom_pdk2.h1
-rw-r--r--include/configs/imxrt1020-evk.h2
-rw-r--r--include/configs/imxrt1050-evk.h2
-rw-r--r--include/configs/imxrt1170-evk.h2
-rw-r--r--include/configs/m53menlo.h7
-rw-r--r--include/configs/mocha.h25
-rw-r--r--include/configs/mx53ppd.h8
-rw-r--r--include/configs/sandbox.h2
-rw-r--r--include/configs/siemens-am33x-common.h1
-rw-r--r--include/configs/siemens-env-common.h1
-rw-r--r--include/configs/snapper9g45.h3
-rw-r--r--include/configs/socfpga_soc64_common.h6
-rw-r--r--include/configs/ti_omap5_common.h27
-rw-r--r--include/configs/vexpress_aemv8.h6
-rw-r--r--include/cpu_func.h17
-rw-r--r--include/dm/ofnode_graph.h90
-rw-r--r--include/dt-bindings/pinctrl/adi-adsp.h21
-rw-r--r--include/efi_loader.h52
-rw-r--r--include/env/pg-wcom/common.env1
-rw-r--r--include/env/ti/mmc.h1
-rw-r--r--include/env_default.h3
-rw-r--r--include/fat.h1
-rw-r--r--include/fs.h16
-rw-r--r--include/image.h18
-rw-r--r--include/interrupt.h2
-rw-r--r--include/linux/mtd/rawnand.h12
-rw-r--r--include/mcheck.h13
-rw-r--r--include/miiphy.h38
-rw-r--r--include/net-common.h1
-rw-r--r--include/serial.h20
-rw-r--r--include/setjmp.h40
-rw-r--r--include/stdio_dev.h1
-rw-r--r--include/sysinfo.h65
-rw-r--r--include/test/fdt_overlay.h19
-rw-r--r--include/test/optee.h4
-rw-r--r--include/test/overlay.h15
-rw-r--r--include/test/suites.h43
-rw-r--r--include/test/test.h28
-rw-r--r--include/time.h15
-rw-r--r--include/video_bridge.h54
55 files changed, 1072 insertions, 213 deletions
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 3fd5c772a1a..024b1adde27 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -23,6 +23,7 @@ extern char __kprobes_text_start[], __kprobes_text_end[];
extern char __entry_text_start[], __entry_text_end[];
extern char __initdata_begin[], __initdata_end[];
extern char __start_rodata[], __end_rodata[];
+extern char __start_data[], __end_data[];
extern char __efi_helloworld_begin[];
extern char __efi_helloworld_end[];
extern char __efi_var_file_begin[];
@@ -63,6 +64,7 @@ static inline int arch_is_kernel_data(unsigned long addr)
/* Start of U-Boot text region */
extern char __text_start[];
+extern char __text_end[];
/* This marks the text region which must be relocated */
extern char __image_copy_start[], __image_copy_end[];
diff --git a/include/bloblist.h b/include/bloblist.h
index 52ba0ddcf84..f32faf78560 100644
--- a/include/bloblist.h
+++ b/include/bloblist.h
@@ -467,9 +467,8 @@ int bloblist_reloc(void *to, uint to_size);
* If CONFIG_BLOBLIST_ALLOC is selected, it allocates memory for a bloblist of
* size CONFIG_BLOBLIST_SIZE.
*
- * If CONFIG_BLOBLIST_PASSAGE is selected, it uses the bloblist in the incoming
- * standard passage. The size is detected automatically so CONFIG_BLOBLIST_SIZE
- * can be 0.
+ * If CONFIG_BLOBLIST_PASSAGE_MANDATORY is selected, bloblist in the incoming
+ * standard passage is mandatorily required.
*
* Sets GD_FLG_BLOBLIST_READY in global_data flags on success
*
@@ -481,7 +480,7 @@ int bloblist_init(void);
/**
* bloblist_maybe_init() - Init the bloblist system if not already done
*
- * Calls bloblist_init() if the GD_FLG_BLOBLIST_READY flag is not et
+ * Calls bloblist_init() if the GD_FLG_BLOBLIST_READY flag is not set
*
* Return: 0 if OK, -ve on error
*/
@@ -501,19 +500,18 @@ static inline int bloblist_maybe_init(void)
* @rfdt: Register that holds the FDT base address.
* @rzero: Register that must be zero.
* @rsig: Register that holds signature and register conventions version.
+ * @xlist: Register that holds the transfer list.
* Return: 0 if OK, -EIO if the bloblist is not compliant to the register
* conventions.
*/
-int bloblist_check_reg_conv(ulong rfdt, ulong rzero, ulong rsig);
+int bloblist_check_reg_conv(ulong rfdt, ulong rzero, ulong rsig, ulong xlist);
/**
- * xferlist_from_boot_arg() - Get bloblist from the boot args and relocate it
- * to the specified address.
+ * xferlist_from_boot_arg() - Get bloblist from the boot args.
*
- * @addr: Address for the bloblist
- * @size: Size of space reserved for the bloblist
+ * @addr: Address of the bloblist
* Return: 0 if OK, else on error
*/
-int xferlist_from_boot_arg(ulong addr, ulong size);
+int xferlist_from_boot_arg(ulong *addr);
#endif /* __BLOBLIST_H */
diff --git a/include/cadence-nand.h b/include/cadence-nand.h
new file mode 100644
index 00000000000..27ed217b1ed
--- /dev/null
+++ b/include/cadence-nand.h
@@ -0,0 +1,529 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Cadence NAND flash controller driver
+ *
+ * Copyright (C) 2019 Cadence
+ *
+ * Author: Piotr Sroka <piotrs@cadence.com>
+ *
+ */
+
+#ifndef _CADENCE_NAND_H_
+#define _CADENCE_NAND_H_
+#include <clk.h>
+#include <reset.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/rawnand.h>
+
+/*
+ * HPNFC can work in 3 modes:
+ * - PIO - can work in master or slave DMA
+ * - CDMA - needs Master DMA for accessing command descriptors.
+ * - Generic mode - can use only slave DMA.
+ * CDMA and PIO modes can be used to execute only base commands.
+ * CDMA and PIO modes can be used to execute only base commands.
+ * Generic mode can be used to execute any command
+ * on NAND flash memory. Driver uses CDMA mode for
+ * block erasing, page reading, page programing.
+ * Generic mode is used for executing rest of commands.
+ */
+
+#define DMA_DATA_SIZE_ALIGN 8
+
+/* Register definition. */
+/*
+ * Command register 0.
+ * Writing data to this register will initiate a new transaction
+ * of the NF controller.
+ */
+#define CMD_REG0 0x0000
+/* Command type field mask. */
+#define CMD_REG0_CT GENMASK(31, 30)
+/* Command type CDMA. */
+#define CMD_REG0_CT_CDMA 0uL
+/* Command type generic. */
+#define CMD_REG0_CT_GEN 3uL
+/* Command thread number field mask. */
+#define CMD_REG0_TN GENMASK(27, 24)
+
+/* Command register 2. */
+#define CMD_REG2 0x0008
+/* Command register 3. */
+#define CMD_REG3 0x000C
+/* Pointer register to select which thread status will be selected. */
+#define CMD_STATUS_PTR 0x0010
+/* Command status register for selected thread. */
+#define CMD_STATUS 0x0014
+
+/* Interrupt status register. */
+#define INTR_STATUS 0x0110
+#define INTR_STATUS_SDMA_ERR BIT(22)
+#define INTR_STATUS_SDMA_TRIGG BIT(21)
+#define INTR_STATUS_UNSUPP_CMD BIT(19)
+#define INTR_STATUS_DDMA_TERR BIT(18)
+#define INTR_STATUS_CDMA_TERR BIT(17)
+#define INTR_STATUS_CDMA_IDL BIT(16)
+
+/* Interrupt enable register. */
+#define INTR_ENABLE 0x0114
+#define INTR_ENABLE_INTR_EN BIT(31)
+
+/* Controller internal state. */
+#define CTRL_STATUS 0x0118
+#define CTRL_STATUS_INIT_COMP BIT(9)
+#define CTRL_STATUS_CTRL_BUSY BIT(8)
+
+/* Command Engine threads state. */
+#define TRD_STATUS 0x0120
+
+/* Command Engine interrupt thread error status. */
+#define TRD_ERR_INT_STATUS 0x0128
+/* Command Engine interrupt thread error enable. */
+#define TRD_ERR_INT_STATUS_EN 0x0130
+/* Command Engine interrupt thread complete status. */
+#define TRD_COMP_INT_STATUS 0x0138
+
+/*
+ * Transfer config 0 register.
+ * Configures data transfer parameters.
+ */
+#define TRAN_CFG_0 0x0400
+/* Offset value from the beginning of the page. */
+#define TRAN_CFG_0_OFFSET GENMASK(31, 16)
+/* Numbers of sectors to transfer within singlNF device's page. */
+#define TRAN_CFG_0_SEC_CNT GENMASK(7, 0)
+
+/*
+ * Transfer config 1 register.
+ * Configures data transfer parameters.
+ */
+#define TRAN_CFG_1 0x0404
+/* Size of last data sector. */
+#define TRAN_CFG_1_LAST_SEC_SIZE GENMASK(31, 16)
+/* Size of not-last data sector. */
+#define TRAN_CFG_1_SECTOR_SIZE GENMASK(15, 0)
+
+/* ECC engine configuration register 0. */
+#define ECC_CONFIG_0 0x0428
+/* Correction strength. */
+#define ECC_CONFIG_0_CORR_STR GENMASK(10, 8)
+/* Enable erased pages detection mechanism. */
+#define ECC_CONFIG_0_ERASE_DET_EN BIT(1)
+/* Enable controller ECC check bits generation and correction. */
+#define ECC_CONFIG_0_ECC_EN BIT(0)
+
+/* ECC engine configuration register 1. */
+#define ECC_CONFIG_1 0x042C
+
+/* Multiplane settings register. */
+#define MULTIPLANE_CFG 0x0434
+/* Cache operation settings. */
+#define CACHE_CFG 0x0438
+
+/* Transferred data block size for the slave DMA module. */
+#define SDMA_SIZE 0x0440
+
+/* Thread number associated with transferred data block
+ * for the slave DMA module.
+ */
+#define SDMA_TRD_NUM 0x0444
+/* Thread number mask. */
+#define SDMA_TRD_NUM_SDMA_TRD GENMASK(2, 0)
+
+#define CONTROL_DATA_CTRL 0x0494
+/* Thread number mask. */
+#define CONTROL_DATA_CTRL_SIZE GENMASK(15, 0)
+
+#define CTRL_VERSION 0x800
+#define CTRL_VERSION_REV GENMASK(7, 0)
+
+/* Available hardware features of the controller. */
+#define CTRL_FEATURES 0x804
+/* Support for NV-DDR2/3 work mode. */
+#define CTRL_FEATURES_NVDDR_2_3 BIT(28)
+/* Support for NV-DDR work mode. */
+#define CTRL_FEATURES_NVDDR BIT(27)
+/* Support for asynchronous work mode. */
+#define CTRL_FEATURES_ASYNC BIT(26)
+/* Support for asynchronous work mode. */
+#define CTRL_FEATURES_N_BANKS GENMASK(25, 24)
+/* Slave and Master DMA data width. */
+#define CTRL_FEATURES_DMA_DWITH64 BIT(21)
+/* Availability of Control Data feature.*/
+#define CTRL_FEATURES_CONTROL_DATA BIT(10)
+
+/* BCH Engine identification register 0 - correction strengths. */
+#define BCH_CFG_0 0x838
+#define BCH_CFG_0_CORR_CAP_0 GENMASK(7, 0)
+#define BCH_CFG_0_CORR_CAP_1 GENMASK(15, 8)
+#define BCH_CFG_0_CORR_CAP_2 GENMASK(23, 16)
+#define BCH_CFG_0_CORR_CAP_3 GENMASK(31, 24)
+
+/* BCH Engine identification register 1 - correction strengths. */
+#define BCH_CFG_1 0x83C
+#define BCH_CFG_1_CORR_CAP_4 GENMASK(7, 0)
+#define BCH_CFG_1_CORR_CAP_5 GENMASK(15, 8)
+#define BCH_CFG_1_CORR_CAP_6 GENMASK(23, 16)
+#define BCH_CFG_1_CORR_CAP_7 GENMASK(31, 24)
+
+/* BCH Engine identification register 2 - sector sizes. */
+#define BCH_CFG_2 0x840
+#define BCH_CFG_2_SECT_0 GENMASK(15, 0)
+#define BCH_CFG_2_SECT_1 GENMASK(31, 16)
+
+/* BCH Engine identification register 3. */
+#define BCH_CFG_3 0x844
+#define BCH_CFG_3_METADATA_SIZE GENMASK(23, 16)
+
+/* Ready/Busy# line status. */
+#define RBN_SETINGS 0x1004
+
+/* Common settings. */
+#define COMMON_SET 0x1008
+/* 16 bit device connected to the NAND Flash interface. */
+#define COMMON_SET_DEVICE_16BIT BIT(8)
+
+/* Skip_bytes registers. */
+#define SKIP_BYTES_CONF 0x100C
+#define SKIP_BYTES_MARKER_VALUE GENMASK(31, 16)
+#define SKIP_BYTES_NUM_OF_BYTES GENMASK(7, 0)
+
+#define SKIP_BYTES_OFFSET 0x1010
+#define SKIP_BYTES_OFFSET_VALUE GENMASK(23, 0)
+
+/* Timings configuration. */
+#define ASYNC_TOGGLE_TIMINGS 0x101c
+#define ASYNC_TOGGLE_TIMINGS_TRH GENMASK(28, 24)
+#define ASYNC_TOGGLE_TIMINGS_TRP GENMASK(20, 16)
+#define ASYNC_TOGGLE_TIMINGS_TWH GENMASK(12, 8)
+#define ASYNC_TOGGLE_TIMINGS_TWP GENMASK(4, 0)
+
+#define TIMINGS0 0x1024
+#define TIMINGS0_TADL GENMASK(31, 24)
+#define TIMINGS0_TCCS GENMASK(23, 16)
+#define TIMINGS0_TWHR GENMASK(15, 8)
+#define TIMINGS0_TRHW GENMASK(7, 0)
+
+#define TIMINGS1 0x1028
+#define TIMINGS1_TRHZ GENMASK(31, 24)
+#define TIMINGS1_TWB GENMASK(23, 16)
+#define TIMINGS1_TVDLY GENMASK(7, 0)
+
+#define TIMINGS2 0x102c
+#define TIMINGS2_TFEAT GENMASK(25, 16)
+#define TIMINGS2_CS_HOLD_TIME GENMASK(13, 8)
+#define TIMINGS2_CS_SETUP_TIME GENMASK(5, 0)
+
+/* Configuration of the resynchronization of slave DLL of PHY. */
+#define DLL_PHY_CTRL 0x1034
+#define DLL_PHY_CTRL_DLL_RST_N BIT(24)
+#define DLL_PHY_CTRL_EXTENDED_WR_MODE BIT(17)
+#define DLL_PHY_CTRL_EXTENDED_RD_MODE BIT(16)
+#define DLL_PHY_CTRL_RS_HIGH_WAIT_CNT GENMASK(11, 8)
+#define DLL_PHY_CTRL_RS_IDLE_CNT GENMASK(7, 0)
+
+/* TODO: - Identify better way to handle PHY address */
+#define PHY_OFFSET 0x10000
+
+/* Register controlling DQ related timing. */
+#define PHY_DQ_TIMING PHY_OFFSET + 0x2000
+/* Register controlling DSQ related timing. */
+#define PHY_DQS_TIMING PHY_OFFSET + 0x2004
+#define PHY_DQS_TIMING_DQS_SEL_OE_END GENMASK(3, 0)
+#define PHY_DQS_TIMING_PHONY_DQS_SEL BIT(16)
+#define PHY_DQS_TIMING_USE_PHONY_DQS BIT(20)
+
+/* Register controlling the gate and loopback control related timing. */
+#define PHY_GATE_LPBK_CTRL PHY_OFFSET + 0x2008
+#define PHY_GATE_LPBK_CTRL_RDS GENMASK(24, 19)
+
+/* Register holds the control for the master DLL logic. */
+#define PHY_DLL_MASTER_CTRL PHY_OFFSET + 0x200C
+#define PHY_DLL_MASTER_CTRL_BYPASS_MODE BIT(23)
+
+/* Register holds the control for the slave DLL logic. */
+#define PHY_DLL_SLAVE_CTRL PHY_OFFSET + 0x2010
+
+/* This register handles the global control settings for the PHY. */
+#define PHY_CTRL PHY_OFFSET + 0x2080
+#define PHY_CTRL_SDR_DQS BIT(14)
+#define PHY_CTRL_PHONY_DQS GENMASK(9, 4)
+
+/*
+ * This register handles the global control settings
+ * for the termination selects for reads.
+ */
+#define PHY_TSEL PHY_OFFSET + 0x2084
+
+/* Generic command layout. */
+#define GCMD_LAY_CS GENMASK_ULL(11, 8)
+/*
+ * This bit informs the minicotroller if it has to wait for tWB
+ * after sending the last CMD/ADDR/DATA in the sequence.
+ */
+#define GCMD_LAY_TWB BIT_ULL(6)
+/* Type of generic instruction. */
+#define GCMD_LAY_INSTR GENMASK_ULL(5, 0)
+
+/* Generic CMD sequence type. */
+#define GCMD_LAY_INSTR_CMD 0
+/* Generic ADDR sequence type. */
+#define GCMD_LAY_INSTR_ADDR 1
+/* Generic data transfer sequence type. */
+#define GCMD_LAY_INSTR_DATA 2
+
+/* Input part of generic command type of input is command. */
+#define GCMD_LAY_INPUT_CMD GENMASK_ULL(23, 16)
+
+/* Generic command address sequence - address fields. */
+#define GCMD_LAY_INPUT_ADDR GENMASK_ULL(63, 16)
+/* Generic command address sequence - address size. */
+#define GCMD_LAY_INPUT_ADDR_SIZE GENMASK_ULL(13, 11)
+
+/* Transfer direction field of generic command data sequence. */
+#define GCMD_DIR BIT_ULL(11)
+/* Read transfer direction of generic command data sequence. */
+#define GCMD_DIR_READ 0
+/* Write transfer direction of generic command data sequence. */
+#define GCMD_DIR_WRITE 1
+
+/* ECC enabled flag of generic command data sequence - ECC enabled. */
+#define GCMD_ECC_EN BIT_ULL(12)
+/* Generic command data sequence - sector size. */
+#define GCMD_SECT_SIZE GENMASK_ULL(31, 16)
+/* Generic command data sequence - sector count. */
+#define GCMD_SECT_CNT GENMASK_ULL(39, 32)
+/* Generic command data sequence - last sector size. */
+#define GCMD_LAST_SIZE GENMASK_ULL(55, 40)
+
+/* CDMA descriptor fields. */
+/* Erase command type of CDMA descriptor. */
+#define CDMA_CT_ERASE 0x1000
+/* Program page command type of CDMA descriptor. */
+#define CDMA_CT_WR 0x2100
+/* Read page command type of CDMA descriptor. */
+#define CDMA_CT_RD 0x2200
+
+/* Flash pointer memory shift. */
+#define CDMA_CFPTR_MEM_SHIFT 24
+/* Flash pointer memory mask. */
+#define CDMA_CFPTR_MEM GENMASK(26, 24)
+
+/*
+ * Command DMA descriptor flags. If set causes issue interrupt after
+ * the completion of descriptor processing.
+ */
+#define CDMA_CF_INT BIT(8)
+/*
+ * Command DMA descriptor flags - the next descriptor
+ * address field is valid and descriptor processing should continue.
+ */
+#define CDMA_CF_CONT BIT(9)
+/* DMA master flag of command DMA descriptor. */
+#define CDMA_CF_DMA_MASTER BIT(10)
+
+/* Operation complete status of command descriptor. */
+#define CDMA_CS_COMP BIT(15)
+/* Operation complete status of command descriptor. */
+/* Command descriptor status - operation fail. */
+#define CDMA_CS_FAIL BIT(14)
+/* Command descriptor status - page erased. */
+#define CDMA_CS_ERP BIT(11)
+/* Command descriptor status - timeout occurred. */
+#define CDMA_CS_TOUT BIT(10)
+/*
+ * Maximum amount of correction applied to one ECC sector.
+ * It is part of command descriptor status.
+ */
+#define CDMA_CS_MAXERR GENMASK(9, 2)
+/* Command descriptor status - uncorrectable ECC error. */
+#define CDMA_CS_UNCE BIT(1)
+/* Command descriptor status - descriptor error. */
+#define CDMA_CS_ERR BIT(0)
+
+/* Status of operation - OK. */
+#define STAT_OK 0
+/* Status of operation - FAIL. */
+#define STAT_FAIL 2
+/* Status of operation - uncorrectable ECC error. */
+#define STAT_ECC_UNCORR 3
+/* Status of operation - page erased. */
+#define STAT_ERASED 5
+/* Status of operation - correctable ECC error. */
+#define STAT_ECC_CORR 6
+/* Status of operation - unsuspected state. */
+#define STAT_UNKNOWN 7
+/* Status of operation - operation is not completed yet. */
+#define STAT_BUSY 0xFF
+
+#define BCH_MAX_NUM_CORR_CAPS 8
+#define BCH_MAX_NUM_SECTOR_SIZES 2
+
+#define ONE_CYCLE 1
+#define TIMEOUT_US 1000000
+
+struct cadence_nand_timings {
+ u32 async_toggle_timings;
+ u32 timings0;
+ u32 timings1;
+ u32 timings2;
+ u32 dll_phy_ctrl;
+ u32 phy_ctrl;
+ u32 phy_dqs_timing;
+ u32 phy_gate_lpbk_ctrl;
+};
+
+/* Command DMA descriptor. */
+struct cadence_nand_cdma_desc {
+ /* Next descriptor address. */
+ u64 next_pointer;
+
+ /* Flash address is a 32-bit address comprising of BANK and ROW ADDR. */
+ u32 flash_pointer;
+ /*field appears in HPNFC version 13*/
+ u16 bank;
+ u16 rsvd0;
+
+ /* Operation the controller needs to perform. */
+ u16 command_type;
+ u16 rsvd1;
+ /* Flags for operation of this command. */
+ u16 command_flags;
+ u16 rsvd2;
+
+ /* System/host memory address required for data DMA commands. */
+ u64 memory_pointer;
+
+ /* Status of operation. */
+ u32 status;
+ u32 rsvd3;
+
+ /* Address pointer to sync buffer location. */
+ u64 sync_flag_pointer;
+
+ /* Controls the buffer sync mechanism. */
+ u32 sync_arguments;
+ u32 rsvd4;
+
+ /* Control data pointer. */
+ u64 ctrl_data_ptr;
+};
+
+/* Interrupt status. */
+struct cadence_nand_irq_status {
+ /* Thread operation complete status. */
+ u32 trd_status;
+ /* Thread operation error. */
+ u32 trd_error;
+ /* Controller status. */
+ u32 status;
+};
+
+/* Cadence NAND flash controller capabilities get from driver data. */
+struct cadence_nand_dt_devdata {
+ /* Skew value of the output signals of the NAND Flash interface. */
+ u32 if_skew;
+ /* It informs if slave DMA interface is connected to DMA engine. */
+ unsigned int has_dma:1;
+};
+
+/* Cadence NAND flash controller capabilities read from registers. */
+struct cdns_nand_caps {
+ /* Maximum number of banks supported by hardware. */
+ u8 max_banks;
+ /* Slave and Master DMA data width in bytes (4 or 8). */
+ u8 data_dma_width;
+ /* Control Data feature supported. */
+ bool data_control_supp;
+ /* Is PHY type DLL. */
+ bool is_phy_type_dll;
+};
+
+struct cadence_nand_info {
+ struct nand_hw_control controller;
+ struct udevice *dev;
+ struct reset_ctl softphy_reset;
+ struct reset_ctl nand_reset;
+ struct cadence_nand_cdma_desc *cdma_desc;
+ /* IP capability. */
+ const struct cadence_nand_dt_devdata *caps1;
+ struct cdns_nand_caps caps2;
+ u8 ctrl_rev;
+ dma_addr_t dma_cdma_desc;
+ /* command interface buffers */
+ u8 *buf;
+ u32 buf_size;
+ u8 *stat;
+ u8 cmd;
+ u32 buf_index;
+
+ u8 curr_corr_str_idx;
+
+ /* Register interface. */
+ void __iomem *reg;
+
+ struct {
+ void __iomem *virt;
+ dma_addr_t dma;
+ } io;
+
+ int irq;
+ /* Interrupts that have happened. */
+ struct cadence_nand_irq_status irq_status;
+ /* Interrupts we are waiting for. */
+ struct cadence_nand_irq_status irq_mask;
+
+ int ecc_strengths[BCH_MAX_NUM_CORR_CAPS];
+ struct nand_ecc_step_info ecc_stepinfos[BCH_MAX_NUM_SECTOR_SIZES];
+ struct nand_ecc_caps ecc_caps;
+
+ int curr_trans_type;
+
+ struct clk clk;
+ u32 nf_clk_rate;
+ /*
+ * Estimated Board delay. The value includes the total
+ * round trip delay for the signals and is used for deciding on values
+ * associated with data read capture.
+ */
+ u32 board_delay;
+
+ struct nand_chip *selected_chip;
+
+ unsigned long assigned_cs;
+ struct list_head chips;
+ u8 bch_metadata_size;
+};
+
+struct cdns_nand_chip {
+ struct cadence_nand_timings timings;
+ struct nand_chip chip;
+ u8 nsels;
+ struct list_head node;
+
+ /*
+ * part of oob area of NAND flash memory page.
+ * This part is available for user to read or write.
+ */
+ u32 avail_oob_size;
+
+ /* Sector size. There are few sectors per mtd->writesize */
+ u32 sector_size;
+ u32 sector_count;
+
+ /* Offset of BBM. */
+ u8 bbm_offs;
+ /* Number of bytes reserved for BBM. */
+ u8 bbm_len;
+ /* ECC strength index. */
+ u8 corr_str_idx;
+
+ u8 cs[];
+};
+
+struct ecc_info {
+ int (*calc_ecc_bytes)(int step_size, int strength);
+ int max_step_size;
+};
+
+#endif /*_CADENCE_NAND_H_*/
diff --git a/include/configs/am335x_guardian.h b/include/configs/am335x_guardian.h
index 96efd38594a..385dec2ff4f 100644
--- a/include/configs/am335x_guardian.h
+++ b/include/configs/am335x_guardian.h
@@ -63,11 +63,6 @@
"fi; " \
"setenv extrabootargs $extrabootargs \"swi_attached\"; " \
"fi;" \
- "run bootcmd_ubifs0;\0" \
- "altbootcmd=" \
- "setenv boot_syslinux_conf \"extlinux/extlinux-rollback.conf\"; " \
- "run distro_bootcmd; " \
- "setenv boot_syslinux_conf \"extlinux/extlinux.conf\"; " \
"run bootcmd_ubifs0;\0"
#endif /* ! CONFIG_XPL_BUILD */
diff --git a/include/configs/beagley_ai.h b/include/configs/beagley_ai.h
new file mode 100644
index 00000000000..a7072a094c5
--- /dev/null
+++ b/include/configs/beagley_ai.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Configuration header file for BeagleY-AI
+ *
+ * Copyright (C) 2025 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+#ifndef __CONFIG_BEAGLEY_AI_H
+#define __CONFIG_BEAGLEY_AI_H
+
+/* Now for the remaining common defines */
+#include <configs/ti_armv7_common.h>
+
+#endif /* __CONFIG_BEAGLEY_AI_H */
diff --git a/include/configs/bk4r1.h b/include/configs/bk4r1.h
index 5df8d03c706..6d24c5decd5 100644
--- a/include/configs/bk4r1.h
+++ b/include/configs/bk4r1.h
@@ -16,8 +16,6 @@
#define BK4_EXTRA_ENV_SETTINGS \
"bootlimit=3\0" \
"eraseuserdata=false\0" \
- "altbootcmd=led 5 on; " \
- "boot\0" \
"set_gpio103=mw 0x400ff0c4 0x0080; mw 0x4004819C 0x000011bf\0" \
"set_gpio102=mw 0x400ff0c4 0x40; mw 0x40048198 0x000011bf\0" \
"set_gpio96=mw 0x40048180 0x282; mw 0x400ff0c4 0x1\0"\
diff --git a/include/configs/brppt2.h b/include/configs/brppt2.h
index d01f0d37316..93559a171ae 100644
--- a/include/configs/brppt2.h
+++ b/include/configs/brppt2.h
@@ -64,7 +64,6 @@ BUR_COMMON_ENV \
" do echo \"### booting ${target} ###\"; run b_${target};" \
" if test ${b_break} = 1; then; exit; fi; done\0" \
"loaddev=mmc 0\0" \
-"altbootcmd=setenv b_mode 0; run b_default;\0" \
"bootlimit=1\0" \
"net2nor=sf probe && dhcp &&" \
" tftp ${loadaddr} SPL && sf erase 0 +${filesize} &&" \
diff --git a/include/configs/display5.h b/include/configs/display5.h
index 51fa2b03a2e..98b1e5af2c0 100644
--- a/include/configs/display5.h
+++ b/include/configs/display5.h
@@ -170,7 +170,6 @@
"display=tianma-tm070-800x480\0" \
"board=display5\0" \
"mmcdev=0\0" \
- "altbootcmd=run recovery\0" \
"bootdelay=1\0" \
"baudrate=115200\0" \
"ethact=FEC\0" \
diff --git a/include/configs/ge_b1x5v2.h b/include/configs/ge_b1x5v2.h
index f3d85c9c11e..5e3f67124c0 100644
--- a/include/configs/ge_b1x5v2.h
+++ b/include/configs/ge_b1x5v2.h
@@ -82,14 +82,6 @@
"doboot=" \
"echo Booting from mmc:${mmcdev}:${mmcpart} ...; " \
"run helix;\0" \
- "altbootcmd=" \
- "setenv mmcpart 1; run hasfirstboot || setenv mmcpart 2; " \
- "run hasfirstboot || setenv mmcpart 0; " \
- "if test ${mmcpart} != 0; then " \
- "setenv bootcause REVERT; " \
- "run swappartitions loadimage doboot; " \
- "fi; " \
- "run failbootcmd\0" \
"tryboot=" \
"setenv mmcpart 1; run hasfirstboot || setenv mmcpart 2; " \
"run loadimage || run swappartitions && run loadimage || " \
diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h
index 07b36706e56..c8ef048bd43 100644
--- a/include/configs/ge_bx50v3.h
+++ b/include/configs/ge_bx50v3.h
@@ -67,14 +67,6 @@
"Try again, or contact GE Service for support.\"; " \
"bootcount reset; " \
"while true; do sleep 1; done; \0" \
- "altbootcmd=" \
- "run doquiet; " \
- "setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
- "run hasfirstboot || setenv partnum 0; " \
- "if test ${partnum} != 0; then " \
- "run swappartitions loadimage doboot; " \
- "fi; " \
- "run failbootcmd\0" \
"loadimage=" \
"ext2load ${dev} ${devnum}:${partnum} ${loadaddr} ${image}\0" \
"doboot=" \
diff --git a/include/configs/imx6-engicam.h b/include/configs/imx6-engicam.h
index 786b70fe064..3d5701c636c 100644
--- a/include/configs/imx6-engicam.h
+++ b/include/configs/imx6-engicam.h
@@ -47,7 +47,6 @@
"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
"loadfit=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${fit_image}\0" \
- "altbootcmd=run recoveryboot\0"\
"fitboot=echo Booting FIT image from mmc ...; " \
"run mmcargs; " \
"bootm ${loadaddr}\0" \
diff --git a/include/configs/imx6q-bosch-acc.h b/include/configs/imx6q-bosch-acc.h
index 64ddbf711d3..84da8250684 100644
--- a/include/configs/imx6q-bosch-acc.h
+++ b/include/configs/imx6q-bosch-acc.h
@@ -42,8 +42,7 @@
"env_persisted=0\0" \
"env_persist=if test ${env_persisted} != 1; " \
"then env set env_persisted 1; run save_env; fi;\0" \
- "save_env=env save; env save\0" \
- "altbootcmd=run handle_ustate; run switch_bootset; run save_env; run bootcmd\0"
+ "save_env=env save; env save\0"
#define CFG_ENV_FLAGS_LIST_STATIC \
"bootset:bw," \
diff --git a/include/configs/imx8mm-mx8menlo.h b/include/configs/imx8mm-mx8menlo.h
index 7058d632d67..626ccae7205 100644
--- a/include/configs/imx8mm-mx8menlo.h
+++ b/include/configs/imx8mm-mx8menlo.h
@@ -18,14 +18,6 @@
"devtype=mmc\0" \
"devnum=1\0" \
"distro_bootpart=1\0" \
- "altbootcmd=" \
- "mmc partconf 0 mmcpart ; " \
- "if test ${mmcpart} -eq 1 ; then " \
- "mmc partconf 0 1 2 0 ; " \
- "else " \
- "mmc partconf 0 1 1 0 ; " \
- "fi ; " \
- "boot\0" \
"boot_file=fitImage\0" \
"console=ttymxc0\0" \
"fdt_addr=0x43000000\0" \
diff --git a/include/configs/imx8mm_data_modul_edm_sbc.h b/include/configs/imx8mm_data_modul_edm_sbc.h
index 57ecb5e2190..5ce4219912f 100644
--- a/include/configs/imx8mm_data_modul_edm_sbc.h
+++ b/include/configs/imx8mm_data_modul_edm_sbc.h
@@ -34,7 +34,6 @@
#define CFG_SYS_FSL_ESDHC_ADDR 0
#define CFG_EXTRA_ENV_SETTINGS \
- "altbootcmd=run bootcmd\0" \
"bootlimit=3\0" \
"devtype=mmc\0" \
"devpart=1\0" \
diff --git a/include/configs/imx8mp_data_modul_edm_sbc.h b/include/configs/imx8mp_data_modul_edm_sbc.h
index de5bdd30e18..58a03b35ac4 100644
--- a/include/configs/imx8mp_data_modul_edm_sbc.h
+++ b/include/configs/imx8mp_data_modul_edm_sbc.h
@@ -24,7 +24,6 @@
#define FEC_QUIRK_ENET_MAC
#define CFG_EXTRA_ENV_SETTINGS \
- "altbootcmd=run bootcmd\0" \
"bootlimit=3\0" \
"devtype=mmc\0" \
"devpart=1\0" \
diff --git a/include/configs/imx8mp_dhcom_pdk2.h b/include/configs/imx8mp_dhcom_pdk2.h
index c848fce8bda..f3e239d780f 100644
--- a/include/configs/imx8mp_dhcom_pdk2.h
+++ b/include/configs/imx8mp_dhcom_pdk2.h
@@ -28,7 +28,6 @@
#define CFG_SYS_FSL_ESDHC_ADDR 0
#define CFG_EXTRA_ENV_SETTINGS \
- "altbootcmd=run bootcmd ; reset\0" \
"bootlimit=3\0" \
"dfu_alt_info=" \
/* RAM block at DRAM offset 256..768 MiB */ \
diff --git a/include/configs/imxrt1020-evk.h b/include/configs/imxrt1020-evk.h
index cd6af93454b..aec12082b95 100644
--- a/include/configs/imxrt1020-evk.h
+++ b/include/configs/imxrt1020-evk.h
@@ -9,8 +9,6 @@
#include <asm/arch/imx-regs.h>
-#define ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE 1
-
#define PHYS_SDRAM 0x80000000
#define PHYS_SDRAM_SIZE (32 * 1024 * 1024)
diff --git a/include/configs/imxrt1050-evk.h b/include/configs/imxrt1050-evk.h
index c520c2fc203..5b8d6a7ac05 100644
--- a/include/configs/imxrt1050-evk.h
+++ b/include/configs/imxrt1050-evk.h
@@ -9,8 +9,6 @@
#include <asm/arch/imx-regs.h>
-#define ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE 1
-
#define PHYS_SDRAM 0x80000000
#define PHYS_SDRAM_SIZE (32 * 1024 * 1024)
diff --git a/include/configs/imxrt1170-evk.h b/include/configs/imxrt1170-evk.h
index 1ccaa15bc11..f821212765c 100644
--- a/include/configs/imxrt1170-evk.h
+++ b/include/configs/imxrt1170-evk.h
@@ -10,8 +10,6 @@
#include <asm/arch/imx-regs.h>
-#define ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE 1
-
/*
* Configuration of the external SDRAM memory
*/
diff --git a/include/configs/m53menlo.h b/include/configs/m53menlo.h
index 1ea4fa59fd5..a6aafb51854 100644
--- a/include/configs/m53menlo.h
+++ b/include/configs/m53menlo.h
@@ -93,13 +93,6 @@
"splashfile=boot/usplash.bmp.gz\0" \
"splashimage=0x88000000\0" \
"splashpos=m,m\0" \
- "altbootcmd=" \
- "if test ${mmcpart} -eq 1 ; then " \
- "setenv mmcpart 2 ; " \
- "else " \
- "setenv mmcpart 1 ; " \
- "fi ; " \
- "boot\0" \
"stdout=serial,vidconsole\0" \
"stderr=serial,vidconsole\0" \
"addcons=" \
diff --git a/include/configs/mocha.h b/include/configs/mocha.h
new file mode 100644
index 00000000000..1c2eb906085
--- /dev/null
+++ b/include/configs/mocha.h
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved.
+ *
+ * Copyright (c) 2024, Svyatoslav Ryhel <clamor95@gmail.com>
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include "tegra124-common.h"
+
+/* High-level configuration options */
+#define CFG_TEGRA_BOARD_STRING "Xiaomi Mocha"
+
+/* Board-specific serial config */
+#define CFG_SYS_NS16550_COM1 NV_PA_APB_UARTD_BASE
+
+#ifdef CONFIG_TEGRA_SUPPORT_NON_SECURE
+ #define CFG_PRAM 0x38400 /* 225 MB */
+#endif
+
+#include "tegra-common-post.h"
+
+#endif /* __CONFIG_H */
diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h
index 6d1f669de50..3707de254e1 100644
--- a/include/configs/mx53ppd.h
+++ b/include/configs/mx53ppd.h
@@ -59,14 +59,6 @@
"Try again, or contact GE Service for support.\"; " \
"bootcount reset; " \
"while true; do sleep 1; done; \0" \
- "altbootcmd=" \
- "run doquiet; " \
- "setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
- "run hasfirstboot || setenv partnum 0; " \
- "if test ${partnum} != 0; then " \
- "run swappartitions loadimage doboot; " \
- "fi; " \
- "run failbootcmd\0" \
"loadimage=" \
"ext2load ${dev} ${devnum}:${partnum} ${loadaddr} ${image}\0" \
"doboot=" \
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 2372485c84e..db2ac7f83bb 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -6,7 +6,7 @@
#ifndef __CONFIG_H
#define __CONFIG_H
-#define CFG_MALLOC_F_ADDR 0x0010000
+#define CFG_MALLOC_F_ADDR 0x000f4000
/* Size of our emulated memory */
#define SB_CONCAT(x, y) x ## y
diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h
index 74b7fe85800..a918dc1350c 100644
--- a/include/configs/siemens-am33x-common.h
+++ b/include/configs/siemens-am33x-common.h
@@ -128,7 +128,6 @@
"verify=no \0" \
"project_dir=targetdir\0" \
"upgrade_available=0\0" \
- "altbootcmd=run bootcmd\0" \
"partitionset_active=A\0" \
"loadaddr=0x82000000\0" \
"kloadaddr=0x81000000\0" \
diff --git a/include/configs/siemens-env-common.h b/include/configs/siemens-env-common.h
index 36fa5d936f7..c028823e1eb 100644
--- a/include/configs/siemens-env-common.h
+++ b/include/configs/siemens-env-common.h
@@ -183,7 +183,6 @@
"rootfs_name=/dev/mmcblk0\0" \
"upgrade_available=0\0" \
"bootlimit=3\0" \
- "altbootcmd=run bootcmd\0" \
"optargs=\0" \
/**********************************************************************/
diff --git a/include/configs/snapper9g45.h b/include/configs/snapper9g45.h
index df8ed451a43..8ea708d0e92 100644
--- a/include/configs/snapper9g45.h
+++ b/include/configs/snapper9g45.h
@@ -58,8 +58,7 @@
"boot_tftp=setenv bootargs $bootargs_def ip=any nfsroot=$nfsroot; setenv autoload y && bootp && bootm\0" \
"boot_usb=setenv bootargs $bootargs_def; usb start && usb storage && fatload usb 0:1 $loadaddr dds-xm200.bin && bootm\0" \
"boot_mmc=setenv bootargs $bootargs_def; mmc rescan && fatload mmc 0:1 $loadaddr dds-xm200.bin && bootm\0" \
- "bootcmd=run boot_mmc ; run boot_usb ; run boot_working ; run boot_safe\0" \
- "altbootcmd=run boot_mmc ; run boot_usb ; run boot_safe ; run boot_working\0"
+ "bootcmd=run boot_mmc ; run boot_usb ; run boot_working ; run boot_safe\0"
/* Console settings */
diff --git a/include/configs/socfpga_soc64_common.h b/include/configs/socfpga_soc64_common.h
index b7ee1dbf201..5ed17671f79 100644
--- a/include/configs/socfpga_soc64_common.h
+++ b/include/configs/socfpga_soc64_common.h
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0
*
* Copyright (C) 2017-2024 Intel Corporation <www.intel.com>
+ * Copyright (C) 2025 Altera Corporation <www.altera.com>
*
*/
@@ -56,6 +57,11 @@
#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
"bootcmd_qspi=ubi detach; sf probe && " \
+ "setenv mtdids 'nor0=nor0,nand0=nand.0' && " \
+ "setenv mtdparts 'mtdparts=nor0:66m(u-boot),190m(root); " \
+ "nand.0:2m(nand_uboot),500m(nand_root)' && " \
+ "env select UBI; saveenv && " \
+ "ubi part root && " \
"if ubi part root && ubi readvol ${scriptaddr} script; " \
"then echo QSPI: Running script from UBIFS; " \
"elif sf read ${scriptaddr} ${qspiscriptaddr} ${scriptsize}; " \
diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h
index 26b6c1cd188..39102f15eb9 100644
--- a/include/configs/ti_omap5_common.h
+++ b/include/configs/ti_omap5_common.h
@@ -239,20 +239,47 @@
"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine device tree to use; fi; \0"
+#define GET_OVERLAY_MMC_TI_ARGS \
+ "get_overlay_mmc=" \
+ "fdt address ${fdtaddr};" \
+ "fdt resize 0x100000;" \
+ "for overlay in $name_overlays;" \
+ "do;" \
+ "load mmc ${bootpart} ${dtboaddr} ${bootdir}/dtb/${overlay} &&" \
+ "fdt apply ${dtboaddr};" \
+ "done;\0" \
+
#define BOOT_TARGET_DEVICES(func) \
+ func(TI_MMC, ti_mmc, na) \
func(MMC, mmc, 0) \
func(MMC, mmc, 1) \
func(PXE, pxe, na) \
func(DHCP, dhcp, na)
+#define BOOTENV_DEV_TI_MMC(devtypeu, devtypel, instance) \
+ "bootcmd_ti_mmc= run get_name_kern; run mmcboot\0"
+
+#define BOOTENV_DEV_NAME_TI_MMC(devtyeu, devtypel, instance) \
+ "ti_mmc "
+
#include <config_distro_bootcmd.h>
#define CFG_EXTRA_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV \
DEFAULT_MMC_TI_ARGS \
+ "bootpart=0:2\0" \
+ "bootdir=/boot\0" \
+ "get_name_kern=" \
+ "if test $boot_fit -eq 1; then " \
+ "setenv bootfile fitImage; " \
+ "else " \
+ "setenv bootfile zImage; " \
+ "fi\0" \
DEFAULT_FIT_TI_ARGS \
+ "get_fit_config=setenv name_fit_config ${fdtfile}\0" \
DEFAULT_COMMON_BOOT_TI_ARGS \
DEFAULT_FDT_TI_ARGS \
+ GET_OVERLAY_MMC_TI_ARGS \
DFUARGS \
NETARGS \
NANDARGS \
diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h
index b5a17f93efc..5eee13b3fc0 100644
--- a/include/configs/vexpress_aemv8.h
+++ b/include/configs/vexpress_aemv8.h
@@ -181,12 +181,14 @@
" if load hostfs - ${kernel_addr_r} ${kernel_name}; then" \
" setenv fdt_high 0xffffffffffffffff;" \
" setenv initrd_high 0xffffffffffffffff;" \
- " load hostfs - ${fdt_addr_r} ${fdtfile};" \
+ " if test -n load hostfs - ${fdt_addr_r} ${fdtfile}; then" \
+ " fdt move $fdtcontroladdr $fdt_addr_r;" \
+ " fi;" \
" load hostfs - ${ramdisk_addr_r} ${ramdisk_name};" \
" fdt addr ${fdt_addr_r};" \
" fdt resize;" \
" fdt chosen ${ramdisk_addr_r} ${filesize};" \
- " booti $kernel_addr_r - $fdt_addr_r;" \
+ " booti $kernel_addr_r - ${fdt_addr_r};" \
" fi;" \
"fi\0"
#define BOOTENV_DEV_NAME_SMH(devtypeu, devtypel, instance) "smh "
diff --git a/include/cpu_func.h b/include/cpu_func.h
index 7e81c4364a7..70a41ead3f7 100644
--- a/include/cpu_func.h
+++ b/include/cpu_func.h
@@ -69,6 +69,23 @@ void flush_dcache_range(unsigned long start, unsigned long stop);
void invalidate_dcache_range(unsigned long start, unsigned long stop);
void invalidate_dcache_all(void);
void invalidate_icache_all(void);
+
+enum pgprot_attrs {
+ MMU_ATTR_RO,
+ MMU_ATTR_RX,
+ MMU_ATTR_RW,
+};
+
+/** pgprot_set_attrs() - Set page table permissions
+ *
+ * @addr: Physical address start
+ * @size: size of memory to change
+ * @perm: New permissions
+ *
+ * Return: 0 on success, error otherwise.
+ **/
+int pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm);
+
/**
* noncached_init() - Initialize non-cached memory region
*
diff --git a/include/dm/ofnode_graph.h b/include/dm/ofnode_graph.h
new file mode 100644
index 00000000000..908c990a3f3
--- /dev/null
+++ b/include/dm/ofnode_graph.h
@@ -0,0 +1,90 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2025 Svyatoslav Ryhel <clamor95@gmail.com>
+ */
+
+#ifndef _DM_OFNODE_GRAPH_H
+#define _DM_OFNODE_GRAPH_H
+
+#include <dm/of.h>
+
+/**
+ * ofnode_graph_get_endpoint_count() - get the number of endpoints in a device ofnode
+ * @parent: ofnode to the device containing ports and endpoints
+ *
+ * Return: count of endpoint of this device ofnode
+ */
+unsigned int ofnode_graph_get_endpoint_count(ofnode parent);
+
+/**
+ * ofnode_graph_get_port_count() - get the number of port in a device or ports ofnode
+ * @parent: ofnode to the device or ports node
+ *
+ * Return: count of port of this device or ports node
+ */
+unsigned int ofnode_graph_get_port_count(ofnode parent);
+
+/**
+ * ofnode_graph_get_port_by_id() - get the port matching a given id
+ * @parent: parent ofnode
+ * @id: id of the port
+ *
+ * Return: ofnode in given port.
+ */
+ofnode ofnode_graph_get_port_by_id(ofnode parent, u32 id);
+
+/**
+ * ofnode_graph_get_endpoint_by_regs() - get the endpoint matching a given id
+ * @parent: parent ofnode
+ * @reg_id: id of the port
+ * @id: id for the endpoint
+ *
+ * Return: ofnode in given endpoint or NULL if not found.
+ * reg and port_reg are ignored when they are -1.
+ */
+ofnode ofnode_graph_get_endpoint_by_regs(ofnode parent, u32 reg_id, u32 id);
+
+/**
+ * ofnode_graph_get_remote_endpoint() - get remote endpoint node
+ * @endoint: ofnode of a local endpoint
+ *
+ * Return: Remote endpoint ofnode linked with local endpoint.
+ */
+ofnode ofnode_graph_get_remote_endpoint(ofnode endpoint);
+
+/**
+ * ofnode_graph_get_port_parent() - get port's parent node
+ * @endpoint: ofnode of a local endpoint
+ *
+ * Return: device ofnode associated with endpoint
+ */
+ofnode ofnode_graph_get_port_parent(ofnode endpoint);
+
+/**
+ * ofnode_graph_get_remote_port_parent() - get remote port's parent ofnode
+ * @endoint: ofnode of a local endpoint
+ *
+ * Return: device ofnode associated with endpoint linked to local endpoint.
+ */
+ofnode ofnode_graph_get_remote_port_parent(ofnode endpoint);
+
+/**
+ * ofnode_graph_get_remote_port() - get remote port ofnode
+ * @endoint: ofnode of a local endpoint
+ *
+ * Return: port ofnode associated with remote endpoint node linked
+ * to local endpoint.
+ */
+ofnode ofnode_graph_get_remote_port(ofnode endpoint);
+
+/**
+ * ofnode_graph_get_remote_node() - get remote parent ofnode for given port/endpoint
+ * @parent: parent ofnode containing graph port/endpoint
+ * @port: identifier (value of reg property) of the parent port ofnode
+ * @endpoint: identifier (value of reg property) of the endpoint ofnode
+ *
+ * Return: device ofnode associated with endpoint linked to local endpoint.
+ */
+ofnode ofnode_graph_get_remote_node(ofnode parent, u32 port, u32 endpoint);
+
+#endif
diff --git a/include/dt-bindings/pinctrl/adi-adsp.h b/include/dt-bindings/pinctrl/adi-adsp.h
new file mode 100644
index 00000000000..7dc8a1ef5c4
--- /dev/null
+++ b/include/dt-bindings/pinctrl/adi-adsp.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * (C) Copyright 2022 - Analog Devices, Inc.
+ *
+ * Written and/or maintained by Timesys Corporation
+ *
+ * Contact: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
+ * Contact: Greg Malysa <greg.malysa@timesys.com>
+ *
+ */
+
+#ifndef DT_BINDINGS_PINCTRL_ADI_ADSP
+#define DT_BINDINGS_PINCTRL_ADI_ADSP
+
+#define ADI_ADSP_PIN(port, pin) (16 * ((port) - 'A') + (pin))
+#define ADI_ADSP_PINFUNC_ALT0 0
+#define ADI_ADSP_PINFUNC_ALT1 1
+#define ADI_ADSP_PINFUNC_ALT2 2
+#define ADI_ADSP_PINFUNC_ALT3 3
+
+#endif
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 1d75d97ebbc..e9c10819ba2 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -15,13 +15,13 @@
#include <efi_api.h>
#include <image.h>
#include <pe.h>
+#include <setjmp.h>
#include <linux/list.h>
#include <linux/sizes.h>
#include <linux/oid_registry.h>
struct blk_desc;
struct bootflow;
-struct jmp_buf_data;
#if CONFIG_IS_ENABLED(EFI_LOADER)
@@ -129,17 +129,22 @@ static inline void efi_set_bootdev(const char *dev, const char *devnr,
#if CONFIG_IS_ENABLED(NETDEVICES) && CONFIG_IS_ENABLED(EFI_LOADER)
/* Call this to update the current device path of the efi net device */
-efi_status_t efi_net_set_dp(const char *dev, const char *server);
+efi_status_t efi_net_new_dp(const char *dev, const char *server, struct udevice *udev);
/* Call this to get the current device path of the efi net device */
-void efi_net_get_dp(struct efi_device_path **dp);
+void efi_net_dp_from_dev(struct efi_device_path **dp, struct udevice *udev, bool cache_only);
void efi_net_get_addr(struct efi_ipv4_address *ip,
struct efi_ipv4_address *mask,
- struct efi_ipv4_address *gw);
+ struct efi_ipv4_address *gw,
+ struct udevice *dev);
void efi_net_set_addr(struct efi_ipv4_address *ip,
struct efi_ipv4_address *mask,
- struct efi_ipv4_address *gw);
+ struct efi_ipv4_address *gw,
+ struct udevice *dev);
+#if IS_ENABLED(CONFIG_EFI_HTTP_PROTOCOL)
efi_status_t efi_net_do_request(u8 *url, enum efi_http_method method, void **buffer,
- u32 *status_code, ulong *file_size, char *headers_buffer);
+ u32 *status_code, ulong *file_size, char *headers_buffer,
+ struct efi_service_binding_protocol *parent);
+#endif
#define MAX_HTTP_HEADERS_SIZE SZ_64K
#define MAX_HTTP_HEADERS 100
#define MAX_HTTP_HEADER_NAME 128
@@ -151,13 +156,16 @@ struct http_header {
void efi_net_parse_headers(ulong *num_headers, struct http_header *headers);
#else
-static inline void efi_net_get_dp(struct efi_device_path **dp) { }
+static inline void efi_net_dp_from_dev(struct efi_device_path **dp,
+ struct udevice *udev, bool cache_only) { }
static inline void efi_net_get_addr(struct efi_ipv4_address *ip,
struct efi_ipv4_address *mask,
- struct efi_ipv4_address *gw) { }
+ struct efi_ipv4_address *gw,
+ struct udevice *dev) { }
static inline void efi_net_set_addr(struct efi_ipv4_address *ip,
struct efi_ipv4_address *mask,
- struct efi_ipv4_address *gw) { }
+ struct efi_ipv4_address *gw,
+ struct udevice *dev) { }
#endif
/* Maximum number of configuration tables */
@@ -321,6 +329,8 @@ extern const efi_guid_t efi_guid_host_dev;
#endif
/* GUID of the EFI_BLOCK_IO_PROTOCOL */
extern const efi_guid_t efi_block_io_guid;
+/* GUID of the EFI_SIMPLE_NETWORK_PROTOCOL */
+extern const efi_guid_t efi_net_guid;
extern const efi_guid_t efi_global_variable_guid;
extern const efi_guid_t efi_guid_console_control;
extern const efi_guid_t efi_guid_device_path;
@@ -485,7 +495,7 @@ struct efi_loaded_image_obj {
efi_status_t *exit_status;
efi_uintn_t *exit_data_size;
u16 **exit_data;
- struct jmp_buf_data *exit_jmp;
+ jmp_buf *exit_jmp;
EFIAPI efi_status_t (*entry)(efi_handle_t image_handle,
struct efi_system_table *st);
u16 image_type;
@@ -647,7 +657,8 @@ int efi_disk_create_partitions(efi_handle_t parent, struct blk_desc *desc,
/* Called by bootefi to make GOP (graphical) interface available */
efi_status_t efi_gop_register(void);
/* Called by bootefi to make the network interface available */
-efi_status_t efi_net_register(void);
+efi_status_t efi_net_register(struct udevice *dev);
+efi_status_t efi_net_do_start(struct udevice *dev);
/* Called by efi_net_register to make the ip4 config2 protocol available */
efi_status_t efi_ipconfig_register(const efi_handle_t handle,
struct efi_ip4_config2_protocol *ip4config);
@@ -733,6 +744,10 @@ efi_status_t efi_search_protocol(const efi_handle_t handle,
efi_status_t efi_add_protocol(const efi_handle_t handle,
const efi_guid_t *protocol,
void *protocol_interface);
+/* Uninstall new protocol on a handle */
+efi_status_t efi_uninstall_protocol
+ (efi_handle_t handle, const efi_guid_t *protocol,
+ void *protocol_interface, bool preserve);
/* Reinstall a protocol on a handle */
efi_status_t EFIAPI efi_reinstall_protocol_interface(
efi_handle_t handle,
@@ -748,6 +763,15 @@ efi_status_t EFIAPI
efi_install_multiple_protocol_interfaces(efi_handle_t *handle, ...);
efi_status_t EFIAPI
efi_uninstall_multiple_protocol_interfaces(efi_handle_t handle, ...);
+/* Connect and disconnect controller */
+efi_status_t EFIAPI efi_connect_controller(efi_handle_t controller_handle,
+ efi_handle_t *driver_image_handle,
+ struct efi_device_path *remain_device_path,
+ bool recursive);
+efi_status_t EFIAPI efi_disconnect_controller(
+ efi_handle_t controller_handle,
+ efi_handle_t driver_image_handle,
+ efi_handle_t child_handle);
/* Get handles that support a given protocol */
efi_status_t EFIAPI efi_locate_handle_buffer(
enum efi_locate_search_type search_type,
@@ -768,6 +792,8 @@ efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
void *context),
void *notify_context, const efi_guid_t *group,
struct efi_event **event);
+/* Call this to close an event */
+efi_status_t EFIAPI efi_close_event(struct efi_event *event);
/* Call this to set a timer */
efi_status_t efi_set_timer(struct efi_event *event, enum efi_timer_delay type,
uint64_t trigger_time);
@@ -907,8 +933,8 @@ struct efi_device_path *efi_dp_from_part(struct blk_desc *desc, int part);
struct efi_device_path *efi_dp_part_node(struct blk_desc *desc, int part);
struct efi_device_path *efi_dp_from_file(const struct efi_device_path *dp,
const char *path);
-struct efi_device_path *efi_dp_from_eth(void);
-struct efi_device_path *efi_dp_from_http(const char *server);
+struct efi_device_path *efi_dp_from_eth(struct udevice *dev);
+struct efi_device_path *efi_dp_from_http(const char *server, struct udevice *dev);
struct efi_device_path *efi_dp_from_mem(uint32_t mem_type,
uint64_t start_address,
size_t size);
diff --git a/include/env/pg-wcom/common.env b/include/env/pg-wcom/common.env
index 4b660cebd67..5f2ba1c4090 100644
--- a/include/env/pg-wcom/common.env
+++ b/include/env/pg-wcom/common.env
@@ -22,7 +22,6 @@ add_default=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${
WCOM_UBI_LINUX_MTD
addpanic=setenv bootargs ${bootargs} panic=1 panic_on_oops=1
-altbootcmd=run bootcmd
backup_bank=0
boot=bootm ${load_addr_r} - ${fdt_addr_r}
diff --git a/include/env/ti/mmc.h b/include/env/ti/mmc.h
index d07189baaf4..dbb0e3559ea 100644
--- a/include/env/ti/mmc.h
+++ b/include/env/ti/mmc.h
@@ -44,6 +44,7 @@
"mmcloados=" \
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
"if run loadfdt; then " \
+ "run get_overlay_mmc;" \
"bootz ${loadaddr} - ${fdtaddr}; " \
"else " \
"if test ${boot_fdt} = try; then " \
diff --git a/include/env_default.h b/include/env_default.h
index aa3dd40f3fa..60c39f9853f 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -115,6 +115,9 @@ const char default_environment[] = {
#if defined(CONFIG_BOOTCOUNT_BOOTLIMIT) && (CONFIG_BOOTCOUNT_BOOTLIMIT > 0)
"bootlimit=" __stringify(CONFIG_BOOTCOUNT_BOOTLIMIT)"\0"
#endif
+#ifdef CONFIG_BOOTCOUNT_ALTBOOTCMD
+ "altbootcmd=" CONFIG_BOOTCOUNT_ALTBOOTCMD "\0"
+#endif
#ifdef CONFIG_MTDIDS_DEFAULT
"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"
#endif
diff --git a/include/fat.h b/include/fat.h
index 3dce99a23cf..ca97880de12 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -206,6 +206,7 @@ int fat_opendir(const char *filename, struct fs_dir_stream **dirsp);
int fat_readdir(struct fs_dir_stream *dirs, struct fs_dirent **dentp);
void fat_closedir(struct fs_dir_stream *dirs);
int fat_unlink(const char *filename);
+int fat_rename(const char *old_path, const char *new_path);
int fat_mkdir(const char *dirname);
void fat_close(void);
void *fat_next_cluster(fat_itr *itr, unsigned int *nbytes);
diff --git a/include/fs.h b/include/fs.h
index 2474880385d..54449faf2e5 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -86,7 +86,7 @@ int fs_set_blk_dev_with_part(struct blk_desc *desc, int part);
*
* Many file functions implicitly call fs_close(), e.g. fs_closedir(),
* fs_exist(), fs_ln(), fs_ls(), fs_mkdir(), fs_read(), fs_size(), fs_write(),
- * fs_unlink().
+ * fs_unlink(), fs_rename().
*/
void fs_close(void);
@@ -270,6 +270,18 @@ int fs_unlink(const char *filename);
*/
int fs_mkdir(const char *filename);
+/**
+ * fs_rename - rename/move a file or directory
+ *
+ * @old_path: existing path of the file/directory to rename
+ * @new_path: new path of the file/directory. If this points to an existing
+ * file or empty directory, the existing file/directory will be unlinked.
+ * If this points to a non-empty directory, the rename will fail.
+ *
+ * Return: 0 on success, -1 on error conditions
+ */
+int fs_rename(const char *old_path, const char *new_path);
+
/*
* Common implementation for various filesystem commands, optionally limited
* to a specific filesystem type via the fstype parameter.
@@ -290,6 +302,8 @@ int do_mkdir(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
int fstype);
int do_ln(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
int fstype);
+int do_mv(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
+ int fstype);
/*
* Determine the UUID of the specified filesystem and print it. Optionally it is
diff --git a/include/image.h b/include/image.h
index 07912606f33..c1db8383459 100644
--- a/include/image.h
+++ b/include/image.h
@@ -1688,6 +1688,24 @@ struct sig_header_s {
*/
int image_pre_load(ulong addr);
+#if defined(USE_HOSTCC)
+/**
+ * rsa_verify_openssl() - Verify a signature against some data with openssl API
+ *
+ * Verify a RSA PKCS1.5/PSS signature against an expected hash.
+ *
+ * @info: Specifies the key and algorithms
+ * @region: Pointer to the input data
+ * @region_count: Number of region
+ * @sig: Signature
+ * @sig_len: Number of bytes in the signature
+ * Return: 0 if verified, -ve on error
+ */
+int rsa_verify_openssl(struct image_sign_info *info,
+ const struct image_region region[], int region_count,
+ uint8_t *sig, uint sig_len);
+#endif
+
/**
* fit_image_verify_required_sigs() - Verify signatures marked as 'required'
*
diff --git a/include/interrupt.h b/include/interrupt.h
index 46ef2e196d4..6ea28b54a56 100644
--- a/include/interrupt.h
+++ b/include/interrupt.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
-#include <asm/setjmp.h>
+#include <setjmp.h>
/**
* struct resume_data - data for resume after interrupt
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index 2d85b392465..3e80b134063 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -132,6 +132,17 @@ void nand_wait_ready(struct mtd_info *mtd);
#define NAND_DATA_IFACE_CHECK_ONLY -1
/*
+ * There are different places where the manufacturer stores the factory bad
+ * block markers.
+ *
+ * Position within the block: Each of these pages needs to be checked for a
+ * bad block marking pattern.
+ */
+#define NAND_BBM_FIRSTPAGE BIT(24)
+#define NAND_BBM_SECONDPAGE BIT(25)
+#define NAND_BBM_LASTPAGE BIT(26)
+
+/*
* Constants for ECC_MODES
*/
typedef enum {
@@ -981,6 +992,7 @@ struct nand_chip {
struct nand_bbt_descr *bbt_md;
struct nand_bbt_descr *badblock_pattern;
+ int cur_cs;
void *priv;
diff --git a/include/mcheck.h b/include/mcheck.h
index bd506ae6291..4b11751ebcc 100644
--- a/include/mcheck.h
+++ b/include/mcheck.h
@@ -1,18 +1,7 @@
-/* SPDX-License-Identifier: GPL-2.1+ */
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 1996-2024 Free Software Foundation, Inc.
* This file is part of the GNU C Library.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- * <https://www.gnu.org/licenses/>.
*/
#ifndef _MCHECK_H
#define _MCHECK_H 1
diff --git a/include/miiphy.h b/include/miiphy.h
index 1e6c7041fdc..00d0b9b6a43 100644
--- a/include/miiphy.h
+++ b/include/miiphy.h
@@ -33,8 +33,6 @@ int miiphy_is_1000base_x(const char *devname, unsigned char addr);
int miiphy_link(const char *devname, unsigned char addr);
#endif
-void miiphy_init(void);
-
int miiphy_set_current_dev(const char *devname);
const char *miiphy_get_current_dev(void);
struct mii_dev *mdio_get_current_dev(void);
@@ -63,33 +61,19 @@ void mdio_list_devices(void);
#define BB_MII_DEVNAME "bb_miiphy"
-struct bb_miiphy_bus {
- char name[MDIO_NAME_LEN];
- int (*init)(struct bb_miiphy_bus *bus);
- int (*mdio_active)(struct bb_miiphy_bus *bus);
- int (*mdio_tristate)(struct bb_miiphy_bus *bus);
- int (*set_mdio)(struct bb_miiphy_bus *bus, int v);
- int (*get_mdio)(struct bb_miiphy_bus *bus, int *v);
- int (*set_mdc)(struct bb_miiphy_bus *bus, int v);
- int (*delay)(struct bb_miiphy_bus *bus);
- void *priv;
+struct bb_miiphy_bus_ops {
+ int (*mdio_active)(struct mii_dev *miidev);
+ int (*mdio_tristate)(struct mii_dev *miidev);
+ int (*set_mdio)(struct mii_dev *miidev, int v);
+ int (*get_mdio)(struct mii_dev *miidev, int *v);
+ int (*set_mdc)(struct mii_dev *miidev, int v);
+ int (*delay)(struct mii_dev *miidev);
};
-extern struct bb_miiphy_bus bb_miiphy_buses[];
-extern int bb_miiphy_buses_num;
-
-/**
- * bb_miiphy_init() - Initialize bit-banged MII bus driver
- *
- * It is called during the generic post-relocation init sequence.
- *
- * Return: 0 if OK
- */
-int bb_miiphy_init(void);
-
-int bb_miiphy_read(struct mii_dev *miidev, int addr, int devad, int reg);
-int bb_miiphy_write(struct mii_dev *miidev, int addr, int devad, int reg,
- u16 value);
+int bb_miiphy_read(struct mii_dev *miidev, const struct bb_miiphy_bus_ops *ops,
+ int addr, int devad, int reg);
+int bb_miiphy_write(struct mii_dev *miidev, const struct bb_miiphy_bus_ops *ops,
+ int addr, int devad, int reg, u16 value);
#endif
/* phy seed setup */
diff --git a/include/net-common.h b/include/net-common.h
index 29d31f37263..1d507b13b06 100644
--- a/include/net-common.h
+++ b/include/net-common.h
@@ -291,6 +291,7 @@ struct eth_ops {
#define eth_get_ops(dev) ((struct eth_ops *)(dev)->driver->ops)
struct udevice *eth_get_dev(void); /* get the current device */
+void eth_set_dev(struct udevice *dev); /* set a device */
unsigned char *eth_get_ethaddr(void); /* get the current device MAC */
int eth_rx(void); /* Check for received packets */
void eth_halt(void); /* stop SCC */
diff --git a/include/serial.h b/include/serial.h
index e5f6d984d28..0a707ca730d 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -48,26 +48,6 @@ extern int serial_assign(const char *name);
extern void serial_reinit_all(void);
int serial_initialize(void);
-/* For usbtty */
-#ifdef CONFIG_USB_TTY
-
-struct stdio_dev;
-
-int usbtty_getc(struct stdio_dev *dev);
-void usbtty_putc(struct stdio_dev *dev, const char c);
-void usbtty_puts(struct stdio_dev *dev, const char *str);
-int usbtty_tstc(struct stdio_dev *dev);
-
-#else
-
-/* stubs */
-#define usbtty_getc(dev) 0
-#define usbtty_putc(dev, a)
-#define usbtty_puts(dev, a)
-#define usbtty_tstc(dev) 0
-
-#endif /* CONFIG_USB_TTY */
-
struct udevice;
enum serial_par {
diff --git a/include/setjmp.h b/include/setjmp.h
new file mode 100644
index 00000000000..37d3a8af85d
--- /dev/null
+++ b/include/setjmp.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef _SETJMP_H_
+#define _SETJMP_H_ 1
+
+#ifdef CONFIG_HAVE_SETJMP
+#include <asm/setjmp.h>
+#else
+struct jmp_buf_data {
+};
+#endif
+
+/**
+ * typedef jmp_buf - information needed to restore a calling environment
+ */
+typedef struct jmp_buf_data jmp_buf[1];
+
+/**
+ * setjmp() - prepare for a long jump
+ *
+ * Registers, the stack pointer, and the return address are saved in the
+ * jump bufffer. The function returns zero afterwards. When longjmp() is
+ * executed the function returns a second time with a non-zero value.
+ *
+ * @env: jump buffer used to store register values
+ * Return: 0 after setting up jump buffer, non-zero after longjmp()
+ */
+int setjmp(jmp_buf env);
+
+/**
+ * longjmp() - long jump
+ *
+ * Jump back to the address and the register state saved by setjmp().
+ *
+ * @env: jump buffer
+ * @val: value to be returned by setjmp(), 0 is replaced by 1
+ */
+void longjmp(jmp_buf env, int val);
+
+#endif /* _SETJMP_H_ */
diff --git a/include/stdio_dev.h b/include/stdio_dev.h
index 4e3c4708f80..f7f9c10199e 100644
--- a/include/stdio_dev.h
+++ b/include/stdio_dev.h
@@ -101,7 +101,6 @@ struct stdio_dev *stdio_clone(struct stdio_dev *dev);
int drv_lcd_init(void);
int drv_video_init(void);
int drv_keyboard_init(void);
-int drv_usbtty_init(void);
int drv_usbacm_init(void);
int drv_nc_init(void);
int drv_jtag_console_init(void);
diff --git a/include/sysinfo.h b/include/sysinfo.h
index ba2ac273e8e..e87cf969fcd 100644
--- a/include/sysinfo.h
+++ b/include/sysinfo.h
@@ -57,6 +57,7 @@ enum sysinfo_id {
SYSID_SM_SYSTEM_WAKEUP,
SYSID_SM_SYSTEM_SKU,
SYSID_SM_SYSTEM_FAMILY,
+ SYSID_SM_SYSTEM_UUID,
/* Baseboard (or Module) Information (Type 2) */
SYSID_SM_BASEBOARD_MANUFACTURER,
@@ -151,6 +152,8 @@ enum sysinfo_id {
/* For show_board_info() */
SYSID_BOARD_MODEL,
SYSID_BOARD_MANUFACTURER,
+ SYSID_BOARD_MAC_ADDR,
+ SYSID_BOARD_RAM_SIZE_MB,
SYSID_PRIOR_STAGE_VERSION,
SYSID_PRIOR_STAGE_DATE,
@@ -221,6 +224,30 @@ struct sysinfo_ops {
int (*get_data)(struct udevice *dev, int id, void **data, size_t *size);
/**
+ * get_item_count() - Get the item count of the specific data area that
+ * describes the hardware setup.
+ * @dev: The sysinfo instance to gather the data.
+ * @id: A unique identifier for the data area to be get.
+ *
+ * Return: non-negative item count if OK, -ve on error.
+ */
+ int (*get_item_count)(struct udevice *dev, int id);
+
+ /**
+ * get_data_by_index() - Get a data value by index from the platform.
+ *
+ * @dev: The sysinfo instance to gather the data.
+ * @id: A unique identifier for the data area to be get.
+ * @index: The item index, starting from 0.
+ * @data: Pointer to the address of the data area.
+ * @size: Pointer to the size of the data area.
+ *
+ * Return: 0 if OK, -ve on error.
+ */
+ int (*get_data_by_index)(struct udevice *dev, int id, int index,
+ void **data, size_t *size);
+
+ /**
* get_fit_loadable - Get the name of an image to load from FIT
* This function can be used to provide the image names based on runtime
* detection. A classic use-case would when DTBOs are used to describe
@@ -304,6 +331,32 @@ int sysinfo_get_str(struct udevice *dev, int id, size_t size, char *val);
int sysinfo_get_data(struct udevice *dev, int id, void **data, size_t *size);
/**
+ * sysinfo_get_item_count() - Get the item count of the specific data area that
+ * describes the hardware setup.
+ * @dev: The sysinfo instance to gather the data.
+ * @id: A unique identifier for the data area to be get.
+ *
+ * Return: non-negative item count if OK, -EPERM if called before
+ * sysinfo_detect(), else -ve on error.
+ */
+int sysinfo_get_item_count(struct udevice *dev, int id);
+
+/**
+ * sysinfo_get_data_by_index() - Get a data value by index from the platform.
+ *
+ * @dev: The sysinfo instance to gather the data.
+ * @id: A unique identifier for the data area to be get.
+ * @index: The item index, starting from 0.
+ * @data: Pointer to the address of the data area.
+ * @size: Pointer to the size of the data area.
+ *
+ * Return: 0 if OK, -EPERM if called before sysinfo_detect(), else -ve on
+ * error.
+ */
+int sysinfo_get_data_by_index(struct udevice *dev, int id, int index,
+ void **data, size_t *size);
+
+/**
* sysinfo_get() - Return the sysinfo device for the sysinfo in question.
* @devp: Pointer to structure to receive the sysinfo device.
*
@@ -364,6 +417,18 @@ static inline int sysinfo_get_data(struct udevice *dev, int id, void **data,
return -ENOSYS;
}
+static inline int sysinfo_get_item_count(struct udevice *dev, int id)
+{
+ return -ENOSYS;
+}
+
+static inline int sysinfo_get_data_by_index(struct udevice *dev, int id,
+ int index, void **data,
+ size_t *size)
+{
+ return -ENOSYS;
+}
+
static inline int sysinfo_get(struct udevice **devp)
{
return -ENOSYS;
diff --git a/include/test/fdt_overlay.h b/include/test/fdt_overlay.h
new file mode 100644
index 00000000000..251ad0ec97a
--- /dev/null
+++ b/include/test/fdt_overlay.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2016 NextThing Co
+ * Copyright (c) 2016 Free Electrons
+ */
+
+#ifndef __TEST_OVERLAY_H__
+#define __TEST_OVERLAY_H__
+
+#include <test/test.h>
+
+/* Declare a new FDT-overlay test */
+#define FDT_OVERLAY_TEST(_name, _flags) UNIT_TEST(_name, _flags, fdt_overlay)
+
+/* Declare init for FDT-overlay test */
+#define FDT_OVERLAY_TEST_INIT(_name, _flags) \
+ UNIT_TEST_INIT(_name, _flags, fdt_overlay)
+
+#endif /* __TEST_OVERLAY_H__ */
diff --git a/include/test/optee.h b/include/test/optee.h
index f4255b39ee3..0a548a59e83 100644
--- a/include/test/optee.h
+++ b/include/test/optee.h
@@ -8,7 +8,9 @@
#include <test/test.h>
-/* Declare a new environment test */
+/* Declare a new optee test */
#define OPTEE_TEST(_name, _flags) UNIT_TEST(_name, _flags, optee)
+#define OPTEE_TEST_INIT(_name, _flags) UNIT_TEST_INIT(_name, _flags, optee)
+#define OPTEE_TEST_UNINIT(_name, _flags) UNIT_TEST_UNINIT(_name, _flags, optee)
#endif /* __TEST_OPTEE_H__ */
diff --git a/include/test/overlay.h b/include/test/overlay.h
deleted file mode 100644
index 5dc98399ce7..00000000000
--- a/include/test/overlay.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (c) 2016 NextThing Co
- * Copyright (c) 2016 Free Electrons
- */
-
-#ifndef __TEST_OVERLAY_H__
-#define __TEST_OVERLAY_H__
-
-#include <test/test.h>
-
-/* Declare a new environment test */
-#define OVERLAY_TEST(_name, _flags) UNIT_TEST(_name, _flags, overlay)
-
-#endif /* __TEST_OVERLAY_H__ */
diff --git a/include/test/suites.h b/include/test/suites.h
deleted file mode 100644
index 774dd893378..00000000000
--- a/include/test/suites.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * (C) Copyright 2015
- * Joe Hershberger, National Instruments, joe.hershberger@ni.com
- */
-
-#ifndef __TEST_SUITES_H__
-#define __TEST_SUITES_H__
-
-struct cmd_tbl;
-struct unit_test;
-struct unit_test_state;
-
-/* 'command' functions normally called do_xxx where xxx is the command name */
-typedef int (*ut_cmd_func)(struct unit_test_state *uts, struct cmd_tbl *cmd,
- int flags, int argc, char *const argv[]);
-
-/**
- * cmd_ut_category() - Run a category of unit tests
- *
- * @uts: Unit-test state, which must be ready for use, i.e. ut_init_state()
- * has been called. The caller is responsible for calling
- * ut_uninit_state() after this function returns
- * @name: Category name
- * @prefix: Prefix of test name
- * @tests: List of tests to run
- * @n_ents: Number of tests in @tests
- * @argc: Argument count provided. Must be >= 1. If this is 1 then all
- * tests are run, otherwise only the one named @argv[1] is run.
- * @argv: Arguments: argv[1] is the test to run (if @argc >= 2)
- * Return: 0 if OK, CMD_RET_FAILURE on failure
- */
-int cmd_ut_category(struct unit_test_state *uts, const char *name,
- const char *prefix, struct unit_test *tests, int n_ents,
- int argc, char *const argv[]);
-
-int do_ut_bootstd(struct unit_test_state *uts, 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 unit_test_state *uts, struct cmd_tbl *cmdtp, int flag,
- int argc, char *const argv[]);
-
-#endif /* __TEST_SUITES_H__ */
diff --git a/include/test/test.h b/include/test/test.h
index bac43c81d63..0f2b68a5dee 100644
--- a/include/test/test.h
+++ b/include/test/test.h
@@ -16,11 +16,15 @@
* @skip_count: Number of tests that were skipped
* @test_count: Number of tests run. If a test is run muiltiple times, only one
* is counted
+ * @start: Timer value when test started
+ * @duration_ms: Suite duration in milliseconds
*/
struct ut_stats {
int fail_count;
int skip_count;
int test_count;
+ ulong start;
+ ulong duration_ms;
};
/*
@@ -29,6 +33,8 @@ struct ut_stats {
* @cur: Statistics for the current run
* @total: Statistics for all test runs
* @run_count: Number of times ut_run_list() has been called
+ * @worst: Sute which had the first per-text run time
+ * @worst_ms: Time taken by that test
* @start: Store the starting mallinfo when doing leak test
* @of_live: true to use livetree if available, false to use flattree
* @of_root: Record of the livetree root node (used for setting up tests)
@@ -52,6 +58,8 @@ struct unit_test_state {
struct ut_stats cur;
struct ut_stats total;
int run_count;
+ const struct suite *worst;
+ int worst_ms;
struct mallinfo start;
struct device_node *of_root;
bool of_live;
@@ -92,6 +100,8 @@ enum ut_flags {
UTF_ETH_BOOTDEV = BIT(9), /* enable Ethernet bootdevs */
UTF_SF_BOOTDEV = BIT(10), /* enable SPI flash bootdevs */
UFT_BLOBLIST = BIT(11), /* test changes gd->bloblist */
+ UTF_INIT = BIT(12), /* test inits a suite */
+ UTF_UNINIT = BIT(13), /* test uninits a suite */
};
/**
@@ -139,6 +149,24 @@ struct unit_test {
.func = _name, \
}
+/* init function for unit-test suite (the 'A' makes it first) */
+#define UNIT_TEST_INIT(_name, _flags, _suite) \
+ ll_entry_declare(struct unit_test, A ## _name, ut_ ## _suite) = { \
+ .file = __FILE__, \
+ .name = #_name, \
+ .flags = (_flags) | UTF_INIT, \
+ .func = _name, \
+ }
+
+/* uninit function for unit-test suite (the 'aaa' makes it last) */
+#define UNIT_TEST_UNINIT(_name, _flags, _suite) \
+ ll_entry_declare(struct unit_test, zzz ## _name, ut_ ## _suite) = { \
+ .file = __FILE__, \
+ .name = #_name, \
+ .flags = (_flags) | UTF_UNINIT, \
+ .func = _name, \
+ }
+
/* Get the start of a list of unit tests for a particular suite */
#define UNIT_TEST_SUITE_START(_suite) \
ll_entry_start(struct unit_test, ut_ ## _suite)
diff --git a/include/time.h b/include/time.h
index 3b2ba091247..f5b86bf70fe 100644
--- a/include/time.h
+++ b/include/time.h
@@ -28,7 +28,7 @@ uint64_t get_timer_us(uint64_t base);
*/
unsigned long get_timer_us_long(unsigned long base);
-/*
+/**
* timer_test_add_offset()
*
* Allow tests to add to the time reported through lib/time.c functions
@@ -36,6 +36,19 @@ unsigned long get_timer_us_long(unsigned long base);
*/
void timer_test_add_offset(unsigned long offset);
+#ifdef CONFIG_SANDBOX
+/**
+ * timer_test_get_offset()
+ *
+ * Get the total offset currently being added the time
+ *
+ * Return:: number of milliseconds the system time has been advanced
+ */
+ulong timer_test_get_offset(void);
+#else
+static inline ulong timer_test_get_offset(void) { return 0; }
+#endif
+
/**
* usec_to_tick() - convert microseconds to clock ticks
*
diff --git a/include/video_bridge.h b/include/video_bridge.h
index 3b429eac578..00e9804565c 100644
--- a/include/video_bridge.h
+++ b/include/video_bridge.h
@@ -54,6 +54,19 @@ struct video_bridge_ops {
int (*set_backlight)(struct udevice *dev, int percent);
/**
+ * get_display_timing() - Get display timings from bridge.
+ *
+ * @dev: Bridge device containing the linked display timings
+ * @tim: Place to put timings
+ * @return 0 if OK, -ve on error
+ *
+ * This call it totally optional and useful mainly for integrated
+ * bridges with fixed output device.
+ */
+ int (*get_display_timing)(struct udevice *dev,
+ struct display_timing *timing);
+
+ /**
* read_edid() - Read information from EDID
*
* @dev: Device to read from
@@ -67,6 +80,7 @@ struct video_bridge_ops {
#define video_bridge_get_ops(dev) \
((struct video_bridge_ops *)(dev)->driver->ops)
+#if CONFIG_IS_ENABLED(VIDEO_BRIDGE)
/**
* video_bridge_attach() - attach a video bridge
*
@@ -99,6 +113,14 @@ int video_bridge_set_active(struct udevice *dev, bool active);
int video_bridge_check_attached(struct udevice *dev);
/**
+ * video_bridge_get_display_timing() - Get display timings from bridge.
+ *
+ * @dev: Bridge device containing the linked display timings
+ * Return: 0 if OK, -ve on error
+ */
+int video_bridge_get_display_timing(struct udevice *dev,
+ struct display_timing *timing);
+/**
* video_bridge_read_edid() - Read information from EDID
*
* @dev: Device to read from
@@ -107,5 +129,37 @@ int video_bridge_check_attached(struct udevice *dev);
* Return: number of bytes read, <=0 for error
*/
int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size);
+#else
+static inline int video_bridge_attach(struct udevice *dev)
+{
+ return -ENOSYS;
+}
+
+static inline int video_bridge_set_backlight(struct udevice *dev, int percent)
+{
+ return -ENOSYS;
+}
+
+static inline int video_bridge_set_active(struct udevice *dev, bool active)
+{
+ return -ENOSYS;
+}
+
+static inline int video_bridge_check_attached(struct udevice *dev)
+{
+ return -ENOSYS;
+}
+
+static inline int video_bridge_get_display_timing(struct udevice *dev,
+ struct display_timing *timing)
+{
+ return -ENOSYS;
+}
+
+static inline int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size)
+{
+ return -ENOSYS;
+}
+#endif /* CONFIG_VIDEO_BRIDGE */
#endif