summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/_exports.h2
-rw-r--r--include/altera.h9
-rw-r--r--include/asm-generic/global_data.h525
-rw-r--r--include/asm-generic/gpio.h2
-rw-r--r--include/binman.h7
-rw-r--r--include/bootm.h10
-rw-r--r--include/config_uncmd_spl.h1
-rw-r--r--include/configs/advantech_dms-ba16.h2
-rw-r--r--include/configs/am65x_evm.h8
-rw-r--r--include/configs/apalis_imx6.h2
-rw-r--r--include/configs/aristainetos2.h2
-rw-r--r--include/configs/arndale.h2
-rw-r--r--include/configs/cgtqmx6eval.h2
-rw-r--r--include/configs/cm_fx6.h2
-rw-r--r--include/configs/colibri-imx6ull.h2
-rw-r--r--include/configs/colibri_imx6.h2
-rw-r--r--include/configs/colibri_imx7.h2
-rw-r--r--include/configs/eb_cpu5282.h4
-rw-r--r--include/configs/embestmx6boards.h2
-rw-r--r--include/configs/espresso7420.h3
-rw-r--r--include/configs/ethernut5.h1
-rw-r--r--include/configs/ids8313.h1
-rw-r--r--include/configs/imx6-engicam.h2
-rw-r--r--include/configs/imxrt1050-evk.h2
-rw-r--r--include/configs/j721e_evm.h8
-rw-r--r--include/configs/km/keymile-common.h4
-rw-r--r--include/configs/km/km-powerpc.h4
-rw-r--r--include/configs/km/km_arm.h3
-rw-r--r--include/configs/kmp204x.h4
-rw-r--r--include/configs/kontron_sl28.h108
-rw-r--r--include/configs/ls1012aqds.h1
-rw-r--r--include/configs/ls2080ardb.h1
-rw-r--r--include/configs/m53menlo.h3
-rw-r--r--include/configs/meson64.h4
-rw-r--r--include/configs/microblaze-generic.h69
-rw-r--r--include/configs/mvebu_armada-37xx.h7
-rw-r--r--include/configs/mx23evk.h3
-rw-r--r--include/configs/mx28evk.h3
-rw-r--r--include/configs/mx51evk.h2
-rw-r--r--include/configs/mx53loco.h2
-rw-r--r--include/configs/mx6cuboxi.h2
-rw-r--r--include/configs/mx6sabre_common.h2
-rw-r--r--include/configs/mx6sxsabresd.h2
-rw-r--r--include/configs/mx6ul_14x14_evk.h2
-rw-r--r--include/configs/mx7dsabresd.h2
-rw-r--r--include/configs/nitrogen6x.h3
-rw-r--r--include/configs/novena.h2
-rw-r--r--include/configs/odroid.h7
-rw-r--r--include/configs/odroid_xu3.h6
-rw-r--r--include/configs/opos6uldev.h4
-rw-r--r--include/configs/origen.h5
-rw-r--r--include/configs/peach-pi.h3
-rw-r--r--include/configs/peach-pit.h3
-rw-r--r--include/configs/pico-imx6.h2
-rw-r--r--include/configs/pico-imx6ul.h2
-rw-r--r--include/configs/pico-imx7d.h2
-rw-r--r--include/configs/puma_rk3399.h4
-rw-r--r--include/configs/pxm2.h1
-rw-r--r--include/configs/qemu-arm.h8
-rw-r--r--include/configs/rut.h1
-rw-r--r--include/configs/s5p4418_nanopi2.h5
-rw-r--r--include/configs/s5p_goni.h8
-rw-r--r--include/configs/s5pc210_universal.h9
-rw-r--r--include/configs/sam9x60ek.h3
-rw-r--r--include/configs/sandbox.h1
-rw-r--r--include/configs/smdk5250.h2
-rw-r--r--include/configs/smdk5420.h5
-rw-r--r--include/configs/smdkv310.h5
-rw-r--r--include/configs/snow.h2
-rw-r--r--include/configs/socfpga_arria5_secu1.h2
-rw-r--r--include/configs/spring.h2
-rw-r--r--include/configs/stm32f746-disco.h6
-rw-r--r--include/configs/stm32mp1.h7
-rw-r--r--include/configs/tbs2910.h1
-rw-r--r--include/configs/theadorable-x86-common.h1
-rw-r--r--include/configs/theadorable.h4
-rw-r--r--include/configs/trats.h7
-rw-r--r--include/configs/trats2.h9
-rw-r--r--include/configs/wandboard.h2
-rw-r--r--include/configs/xilinx_versal.h1
-rw-r--r--include/configs/xilinx_versal_mini.h1
-rw-r--r--include/configs/xilinx_zynqmp_mini.h1
-rw-r--r--include/display_options.h2
-rw-r--r--include/dm/device-internal.h2
-rw-r--r--include/dm/device.h16
-rw-r--r--include/dm/device_compat.h20
-rw-r--r--include/dm/of.h9
-rw-r--r--include/dm/ofnode.h22
-rw-r--r--include/dm/pinctrl.h498
-rw-r--r--include/dm/platdata.h49
-rw-r--r--include/dm/uclass-id.h1
-rw-r--r--include/dm/uclass.h3
-rw-r--r--include/dm/util.h2
-rw-r--r--include/dt-bindings/clock/r8a774c0-cpg-mssr.h61
-rw-r--r--include/dt-bindings/clock/xlnx-versal-clk.h123
-rw-r--r--include/dt-bindings/mux/mux.h17
-rw-r--r--include/dt-bindings/pinctrl/k210-pinctrl.h277
-rw-r--r--include/dt-bindings/pinctrl/sandbox-pinmux.h19
-rw-r--r--include/dt-bindings/power/r8a774c0-sysc.h25
-rw-r--r--include/dt-bindings/power/xlnx-versal-power.h42
-rw-r--r--include/dt-bindings/reset/ast2500-reset.h73
-rw-r--r--include/dt-structs.h8
-rw-r--r--include/env.h18
-rw-r--r--include/environment/ti/ufs.h4
-rw-r--r--include/fdt_support.h3
-rw-r--r--include/fsl_esdhc.h43
-rw-r--r--include/getopt.h130
-rw-r--r--include/image.h12
-rw-r--r--include/linux/compat.h28
-rw-r--r--include/linux/usb/ch9.h5
-rw-r--r--include/log.h262
-rw-r--r--include/mipi_dsi.h17
-rw-r--r--include/mmc.h39
-rw-r--r--include/mux-internal.h109
-rw-r--r--include/mux.h159
-rw-r--r--include/net.h5
-rw-r--r--include/pci.h6
-rw-r--r--include/power/regulator.h114
-rw-r--r--include/sdhci.h9
-rw-r--r--include/stdio.h2
-rw-r--r--include/test/log.h3
-rw-r--r--include/test/test.h11
-rw-r--r--include/timer.h53
-rw-r--r--include/u-boot/aes.h6
-rw-r--r--include/u-boot/rsa-mod-exp.h2
-rw-r--r--include/zynqmp_tap_delay.h5
126 files changed, 2612 insertions, 672 deletions
diff --git a/include/_exports.h b/include/_exports.h
index 1e9ba861088..aeb666c8470 100644
--- a/include/_exports.h
+++ b/include/_exports.h
@@ -8,7 +8,7 @@
#define EXPORT_FUNC(a, b, c, ...)
#endif
EXPORT_FUNC(get_version, unsigned long, get_version, void)
- EXPORT_FUNC(getc, int, getc, void)
+ EXPORT_FUNC(getchar, int, getc, void)
EXPORT_FUNC(tstc, int, tstc, void)
EXPORT_FUNC(putc, void, putc, const char)
EXPORT_FUNC(puts, void, puts, const char *)
diff --git a/include/altera.h b/include/altera.h
index 22d55cfd73e..946413c66e8 100644
--- a/include/altera.h
+++ b/include/altera.h
@@ -56,10 +56,10 @@ enum altera_family {
Altera_StratixII,
/* StratixV Family */
Altera_StratixV,
- /* Stratix10 Family */
- Intel_FPGA_Stratix10,
/* SoCFPGA Family */
Altera_SoCFPGA,
+ /* Intel FPGA Family with SDM (Secure Device Manager) Mailbox */
+ Intel_FPGA_SDM_Mailbox,
/* Add new models here */
@@ -120,8 +120,9 @@ int socfpga_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size);
int stratixv_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size);
#endif
-#ifdef CONFIG_FPGA_STRATIX10
-int stratix10_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size);
+#ifdef CONFIG_FPGA_INTEL_SDM_MAILBOX
+int intel_sdm_mb_load(Altera_desc *desc, const void *rbf_data,
+ size_t rbf_size);
#endif
#endif /* _ALTERA_H_ */
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index d4a4e2215dc..f3920437968 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -24,149 +24,518 @@
#include <membuff.h>
#include <linux/list.h>
-typedef struct global_data {
+struct driver_rt;
+
+typedef struct global_data gd_t;
+
+/**
+ * struct global_data - global data structure
+ */
+struct global_data {
+ /**
+ * @bd: board information
+ */
struct bd_info *bd;
+ /**
+ * @flags: global data flags
+ *
+ * See &enum gd_flags
+ */
unsigned long flags;
+ /**
+ * @baudrate: baud rate of the serial interface
+ */
unsigned int baudrate;
- unsigned long cpu_clk; /* CPU clock in Hz! */
+ /**
+ * @cpu_clk: CPU clock rate in Hz
+ */
+ unsigned long cpu_clk;
+ /**
+ * @bus_clk: platform clock rate in Hz
+ */
unsigned long bus_clk;
+ /**
+ * @pci_clk: PCI clock rate in Hz
+ */
/* We cannot bracket this with CONFIG_PCI due to mpc5xxx */
unsigned long pci_clk;
+ /**
+ * @mem_clk: memory clock rate in Hz
+ */
unsigned long mem_clk;
#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO)
- unsigned long fb_base; /* Base address of framebuffer mem */
+ /**
+ * @fb_base: base address of frame buffer memory
+ */
+ unsigned long fb_base;
#endif
#if defined(CONFIG_POST)
- unsigned long post_log_word; /* Record POST activities */
- unsigned long post_log_res; /* success of POST test */
- unsigned long post_init_f_time; /* When post_init_f started */
+ /**
+ * @post_log_word: active POST tests
+ *
+ * @post_log_word is a bit mask defining which POST tests are recorded
+ * (see constants POST_*).
+ */
+ unsigned long post_log_word;
+ /**
+ * @post_log_res: POST results
+ *
+ * @post_log_res is a bit mask with the POST results. A bit with value 1
+ * indicates successful execution.
+ */
+ unsigned long post_log_res;
+ /**
+ * @post_init_f_time: time in ms when post_init_f() started
+ */
+ unsigned long post_init_f_time;
#endif
#ifdef CONFIG_BOARD_TYPES
+ /**
+ * @board_type: board type
+ *
+ * If a U-Boot configuration supports multiple board types, the actual
+ * board type may be stored in this field.
+ */
unsigned long board_type;
#endif
- unsigned long have_console; /* serial_init() was called */
+ /**
+ * @have_console: console is available
+ *
+ * A value of 1 indicates that serial_init() was called and a console
+ * is available.
+ * A value of 0 indicates that console input and output drivers shall
+ * not be called.
+ */
+ unsigned long have_console;
#if CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER)
- unsigned long precon_buf_idx; /* Pre-Console buffer index */
+ /**
+ * @precon_buf_idx: pre-console buffer index
+ *
+ * @precon_buf_idx indicates the current position of the buffer used to
+ * collect output before the console becomes available
+ */
+ unsigned long precon_buf_idx;
#endif
- unsigned long env_addr; /* Address of Environment struct */
- unsigned long env_valid; /* Environment valid? enum env_valid */
- unsigned long env_has_init; /* Bitmask of boolean of struct env_location offsets */
- int env_load_prio; /* Priority of the loaded environment */
-
- unsigned long ram_base; /* Base address of RAM used by U-Boot */
- unsigned long ram_top; /* Top address of RAM used by U-Boot */
- unsigned long relocaddr; /* Start address of U-Boot in RAM */
- phys_size_t ram_size; /* RAM size */
- unsigned long mon_len; /* monitor len */
- unsigned long irq_sp; /* irq stack pointer */
- unsigned long start_addr_sp; /* start_addr_stackpointer */
+ /**
+ * @env_addr: address of environment structure
+ *
+ * @env_addr contains the address of the structure holding the
+ * environment variables.
+ */
+ unsigned long env_addr;
+ /**
+ * @env_valid: environment is valid
+ *
+ * See &enum env_valid
+ */
+ unsigned long env_valid;
+ /**
+ * @env_has_init: bit mask indicating environment locations
+ *
+ * &enum env_location defines which bit relates to which location
+ */
+ unsigned long env_has_init;
+ /**
+ * @env_load_prio: priority of the loaded environment
+ */
+ int env_load_prio;
+ /**
+ * @ram_base: base address of RAM used by U-Boot
+ */
+ unsigned long ram_base;
+ /**
+ * @ram_top: top address of RAM used by U-Boot
+ */
+ unsigned long ram_top;
+ /**
+ * @relocaddr: start address of U-Boot in RAM
+ *
+ * After relocation this field indicates the address to which U-Boot
+ * has been relocated. It can be displayed using the bdinfo command.
+ * Its value is needed to display the source code when debugging with
+ * GDB using the 'add-symbol-file u-boot <relocaddr>' command.
+ */
+ unsigned long relocaddr;
+ /**
+ * @ram_size: RAM size in bytes
+ */
+ phys_size_t ram_size;
+ /**
+ * @mon_len: monitor length in bytes
+ */
+ unsigned long mon_len;
+ /**
+ * @irq_sp: IRQ stack pointer
+ */
+ unsigned long irq_sp;
+ /**
+ * @start_addr_sp: initial stack pointer address
+ */
+ unsigned long start_addr_sp;
+ /**
+ * @reloc_off: relocation offset
+ */
unsigned long reloc_off;
- struct global_data *new_gd; /* relocated global data */
+ /**
+ * @new_gd: pointer to relocated global data
+ */
+ struct global_data *new_gd;
#ifdef CONFIG_DM
- struct udevice *dm_root; /* Root instance for Driver Model */
- struct udevice *dm_root_f; /* Pre-relocation root instance */
- struct list_head uclass_root; /* Head of core tree */
+ /**
+ * @dm_root: root instance for Driver Model
+ */
+ struct udevice *dm_root;
+ /**
+ * @dm_root_f: pre-relocation root instance
+ */
+ struct udevice *dm_root_f;
+ /**
+ * @uclass_root: head of core tree
+ */
+ struct list_head uclass_root;
+# if CONFIG_IS_ENABLED(OF_PLATDATA)
+ /** Dynamic info about the driver */
+ struct driver_rt *dm_driver_rt;
+# endif
#endif
#ifdef CONFIG_TIMER
- struct udevice *timer; /* Timer instance for Driver Model */
+ /**
+ * @timer: timer instance for Driver Model
+ */
+ struct udevice *timer;
#endif
-
- const void *fdt_blob; /* Our device tree, NULL if none */
- void *new_fdt; /* Relocated FDT */
- unsigned long fdt_size; /* Space reserved for relocated FDT */
-#ifdef CONFIG_OF_LIVE
+ /**
+ * @fdt_blob: U-Boot's own device tree, NULL if none
+ */
+ const void *fdt_blob;
+ /**
+ * @new_fdt: relocated device tree
+ */
+ void *new_fdt;
+ /**
+ * @fdt_size: space reserved for relocated device space
+ */
+ unsigned long fdt_size;
+#if CONFIG_IS_ENABLED(OF_LIVE)
+ /**
+ * @of_root: root node of the live tree
+ */
struct device_node *of_root;
#endif
#if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
- const void *multi_dtb_fit; /* uncompressed multi-dtb FIT image */
+ /**
+ * @multi_dtb_fit: pointer to uncompressed multi-dtb FIT image
+ */
+ const void *multi_dtb_fit;
#endif
- struct jt_funcs *jt; /* jump table */
- char env_buf[32]; /* buffer for env_get() before reloc. */
+ /**
+ * @jt: jump table
+ *
+ * The jump table contains pointers to exported functions. A pointer to
+ * the jump table is passed to standalone applications.
+ */
+ struct jt_funcs *jt;
+ /**
+ * @env_buf: buffer for env_get() before reloc
+ */
+ char env_buf[32];
#ifdef CONFIG_TRACE
- void *trace_buff; /* The trace buffer */
+ /**
+ * @trace_buff: trace buffer
+ *
+ * When tracing function in U-Boot this field points to the buffer
+ * recording the function calls.
+ */
+ void *trace_buff;
#endif
#if defined(CONFIG_SYS_I2C)
- int cur_i2c_bus; /* current used i2c bus */
+ /**
+ * @cur_i2c_bus: currently used I2C bus
+ */
+ int cur_i2c_bus;
#endif
+ /**
+ * @timebase_h: high 32 bits of timer
+ */
unsigned int timebase_h;
+ /**
+ * @timebase_l: low 32 bits of timer
+ */
unsigned int timebase_l;
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
- unsigned long malloc_base; /* base address of early malloc() */
- unsigned long malloc_limit; /* limit address */
- unsigned long malloc_ptr; /* current address */
+ /**
+ * @malloc_base: base address of early malloc()
+ */
+ unsigned long malloc_base;
+ /**
+ * @malloc_limit: limit address of early malloc()
+ */
+ unsigned long malloc_limit;
+ /**
+ * @malloc_ptr: current address of early malloc()
+ */
+ unsigned long malloc_ptr;
#endif
#ifdef CONFIG_PCI
- struct pci_controller *hose; /* PCI hose for early use */
- phys_addr_t pci_ram_top; /* top of region accessible to PCI */
+ /**
+ * @hose: PCI hose for early use
+ */
+ struct pci_controller *hose;
+ /**
+ * @pci_ram_top: top of region accessible to PCI
+ */
+ phys_addr_t pci_ram_top;
#endif
#ifdef CONFIG_PCI_BOOTDELAY
+ /**
+ * @pcidelay_done: delay time before scanning of PIC hose expired
+ *
+ * If CONFIG_PCI_BOOTDELAY=y, pci_hose_scan() waits for the number of
+ * milliseconds defined by environment variable pcidelay before
+ * scanning. Once this delay has expired the flag @pcidelay_done
+ * is set to 1.
+ */
int pcidelay_done;
#endif
- struct udevice *cur_serial_dev; /* current serial device */
- struct arch_global_data arch; /* architecture-specific data */
+ /**
+ * @cur_serial_dev: current serial device
+ */
+ struct udevice *cur_serial_dev;
+ /**
+ * @arch: architecture-specific data
+ */
+ struct arch_global_data arch;
#ifdef CONFIG_CONSOLE_RECORD
- struct membuff console_out; /* console output */
- struct membuff console_in; /* console input */
+ /**
+ * @console_out: output buffer for console recording
+ *
+ * This buffer is used to collect output during console recording.
+ */
+ struct membuff console_out;
+ /**
+ * @console_in: input buffer for console recording
+ *
+ * If console recording is activated, this buffer can be used to
+ * emulate input.
+ */
+ struct membuff console_in;
#endif
#ifdef CONFIG_DM_VIDEO
- ulong video_top; /* Top of video frame buffer area */
- ulong video_bottom; /* Bottom of video frame buffer area */
+ /**
+ * @video_top: top of video frame buffer area
+ */
+ ulong video_top;
+ /**
+ * @video_bottom: bottom of video frame buffer area
+ */
+ ulong video_bottom;
#endif
#ifdef CONFIG_BOOTSTAGE
- struct bootstage_data *bootstage; /* Bootstage information */
- struct bootstage_data *new_bootstage; /* Relocated bootstage info */
+ /**
+ * @bootstage: boot stage information
+ */
+ struct bootstage_data *bootstage;
+ /**
+ * @new_bootstage: relocated boot stage information
+ */
+ struct bootstage_data *new_bootstage;
#endif
#ifdef CONFIG_LOG
- int log_drop_count; /* Number of dropped log messages */
- int default_log_level; /* For devices with no filters */
- struct list_head log_head; /* List of struct log_device */
- int log_fmt; /* Mask containing log format info */
+ /**
+ * @log_drop_count: number of dropped log messages
+ *
+ * This counter is incremented for each log message which can not
+ * be processed because logging is not yet available as signaled by
+ * flag %GD_FLG_LOG_READY in @flags.
+ */
+ int log_drop_count;
+ /**
+ * @default_log_level: default logging level
+ *
+ * For logging devices without filters @default_log_level defines the
+ * logging level, cf. &enum log_level_t.
+ */
+ int default_log_level;
+ /**
+ * @log_head: list of logging devices
+ */
+ struct list_head log_head;
+ /**
+ * @log_fmt: bit mask for logging format
+ *
+ * The @log_fmt bit mask selects the fields to be shown in log messages.
+ * &enum log_fmt defines the bits of the bit mask.
+ */
+ int log_fmt;
+
+ /**
+ * @processing_msg: a log message is being processed
+ *
+ * This flag is used to suppress the creation of additional messages
+ * while another message is being processed.
+ */
+ bool processing_msg;
+ /**
+ * @logc_prev: logging category of previous message
+ *
+ * This value is used as logging category for continuation messages.
+ */
+ int logc_prev;
+ /**
+ * @logl_prev: logging level of the previous message
+ *
+ * This value is used as logging level for continuation messages.
+ */
+ int logl_prev;
#endif
#if CONFIG_IS_ENABLED(BLOBLIST)
- struct bloblist_hdr *bloblist; /* Bloblist information */
- struct bloblist_hdr *new_bloblist; /* Relocated blolist info */
+ /**
+ * @bloblist: blob list information
+ */
+ struct bloblist_hdr *bloblist;
+ /**
+ * @new_bloblist: relocated blob list information
+ */
+ struct bloblist_hdr *new_bloblist;
# ifdef CONFIG_SPL
+ /**
+ * @spl_handoff: SPL hand-off information
+ */
struct spl_handoff *spl_handoff;
# endif
#endif
#if defined(CONFIG_TRANSLATION_OFFSET)
- fdt_addr_t translation_offset; /* optional translation offset */
+ /**
+ * @translation_offset: optional translation offset
+ *
+ * See CONFIG_TRANSLATION_OFFSET.
+ */
+ fdt_addr_t translation_offset;
#endif
#if CONFIG_IS_ENABLED(WDT)
+ /**
+ * @watchdog_dev: watchdog device
+ */
struct udevice *watchdog_dev;
#endif
-} gd_t;
-#endif
+};
+/**
+ * gd_board_type() - retrieve board type
+ *
+ * Return: global board type
+ */
#ifdef CONFIG_BOARD_TYPES
#define gd_board_type() gd->board_type
#else
#define gd_board_type() 0
#endif
-/*
- * Global Data Flags
+/* These macros help avoid #ifdefs in the code */
+#if CONFIG_IS_ENABLED(OF_LIVE)
+#define gd_of_root() gd->of_root
+#define gd_of_root_ptr() &gd->of_root
+#define gd_set_of_root(_root) gd->of_root = (_root)
+#else
+#define gd_of_root() NULL
+#define gd_of_root_ptr() NULL
+#define gd_set_of_root(_root)
+#endif
+
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+#define gd_set_dm_driver_rt(dyn) gd->dm_driver_rt = dyn
+#define gd_dm_driver_rt() gd->dm_driver_rt
+#else
+#define gd_set_dm_driver_rt(dyn)
+#define gd_dm_driver_rt() NULL
+#endif
+
+/**
+ * enum gd_flags - global data flags
+ *
+ * See field flags of &struct global_data.
*/
-#define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */
-#define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
-#define GD_FLG_SILENT 0x00004 /* Silent mode */
-#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
-#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
-#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
-#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
-#define GD_FLG_ENV_READY 0x00080 /* Env. imported into hash table */
-#define GD_FLG_SERIAL_READY 0x00100 /* Pre-reloc serial console ready */
-#define GD_FLG_FULL_MALLOC_INIT 0x00200 /* Full malloc() is ready */
-#define GD_FLG_SPL_INIT 0x00400 /* spl_init() has been called */
-#define GD_FLG_SKIP_RELOC 0x00800 /* Don't relocate */
-#define GD_FLG_RECORD 0x01000 /* Record console */
-#define GD_FLG_ENV_DEFAULT 0x02000 /* Default variable flag */
-#define GD_FLG_SPL_EARLY_INIT 0x04000 /* Early SPL init is done */
-#define GD_FLG_LOG_READY 0x08000 /* Log system is ready for use */
-#define GD_FLG_WDT_READY 0x10000 /* Watchdog is ready for use */
-#define GD_FLG_SKIP_LL_INIT 0x20000 /* Don't perform low-level init */
-#define GD_FLG_SMP_READY 0x40000 /* SMP init is complete */
+enum gd_flags {
+ /**
+ * @GD_FLG_RELOC: code was relocated to RAM
+ */
+ GD_FLG_RELOC = 0x00001,
+ /**
+ * @GD_FLG_DEVINIT: devices have been initialized
+ */
+ GD_FLG_DEVINIT = 0x00002,
+ /**
+ * @GD_FLG_SILENT: silent mode
+ */
+ GD_FLG_SILENT = 0x00004,
+ /**
+ * @GD_FLG_POSTFAIL: critical POST test failed
+ */
+ GD_FLG_POSTFAIL = 0x00008,
+ /**
+ * @GD_FLG_POSTSTOP: POST sequence aborted
+ */
+ GD_FLG_POSTSTOP = 0x00010,
+ /**
+ * @GD_FLG_LOGINIT: log Buffer has been initialized
+ */
+ GD_FLG_LOGINIT = 0x00020,
+ /**
+ * @GD_FLG_DISABLE_CONSOLE: disable console (in & out)
+ */
+ GD_FLG_DISABLE_CONSOLE = 0x00040,
+ /**
+ * @GD_FLG_ENV_READY: environment imported into hash table
+ */
+ GD_FLG_ENV_READY = 0x00080,
+ /**
+ * @GD_FLG_SERIAL_READY: pre-relocation serial console ready
+ */
+ GD_FLG_SERIAL_READY = 0x00100,
+ /**
+ * @GD_FLG_FULL_MALLOC_INIT: full malloc() is ready
+ */
+ GD_FLG_FULL_MALLOC_INIT = 0x00200,
+ /**
+ * @GD_FLG_SPL_INIT: spl_init() has been called
+ */
+ GD_FLG_SPL_INIT = 0x00400,
+ /**
+ * @GD_FLG_SKIP_RELOC: don't relocate
+ */
+ GD_FLG_SKIP_RELOC = 0x00800,
+ /**
+ * @GD_FLG_RECORD: record console
+ */
+ GD_FLG_RECORD = 0x01000,
+ /**
+ * @GD_FLG_ENV_DEFAULT: default variable flag
+ */
+ GD_FLG_ENV_DEFAULT = 0x02000,
+ /**
+ * @GD_FLG_SPL_EARLY_INIT: early SPL initialization is done
+ */
+ GD_FLG_SPL_EARLY_INIT = 0x04000,
+ /**
+ * @GD_FLG_LOG_READY: log system is ready for use
+ */
+ GD_FLG_LOG_READY = 0x08000,
+ /**
+ * @GD_FLG_WDT_READY: watchdog is ready for use
+ */
+ GD_FLG_WDT_READY = 0x10000,
+ /**
+ * @GD_FLG_SKIP_LL_INIT: don't perform low-level initialization
+ */
+ GD_FLG_SKIP_LL_INIT = 0x20000,
+ /**
+ * @GD_FLG_SMP_READY: SMP initialization is complete
+ */
+ GD_FLG_SMP_READY = 0x40000,
+};
+
+#endif /* __ASSEMBLY__ */
#endif /* __ASM_GENERIC_GBL_DATA_H */
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 3ae1894a981..82294cbdc57 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -496,7 +496,7 @@ int gpio_claim_vector(const int *gpio_num_array, const char *fmt);
* @list_name: Name of GPIO list (e.g. "board-id-gpios")
* @index: Index number of the GPIO in that list use request (0=first)
* @desc: Returns GPIO description information. If there is no such
- * GPIO, dev->dev will be NULL.
+ * GPIO, @desc->dev will be NULL.
* @flags: Indicates the GPIO input/output settings (GPIOD_...)
* @return 0 if OK, -ENOENT if the GPIO does not exist, -EINVAL if there is
* something wrong with the list, or other -ve for another error (e.g.
diff --git a/include/binman.h b/include/binman.h
index e0b92075e27..8b89a9666d5 100644
--- a/include/binman.h
+++ b/include/binman.h
@@ -43,6 +43,13 @@ int binman_entry_map(ofnode parent, const char *name, void **bufp, int *sizep);
void binman_set_rom_offset(int rom_offset);
/**
+ * binman_get_rom_offset() - Get the ROM memory-map offset
+ *
+ * @returns offset from an image_pos to the memory-mapped address
+ */
+int binman_get_rom_offset(void);
+
+/**
* binman_entry_find() - Find a binman symbol
*
* This searches the binman information in the device tree for a symbol of the
diff --git a/include/bootm.h b/include/bootm.h
index 0350c349f37..a812a6bf24f 100644
--- a/include/bootm.h
+++ b/include/bootm.h
@@ -75,4 +75,14 @@ void board_quiesce_devices(void);
*/
void switch_to_non_secure_mode(void);
+/**
+ * arch_preboot_os() - arch specific configuration before booting
+ */
+void arch_preboot_os(void);
+
+/**
+ * board_preboot_os() - board specific configuration before booting
+ */
+void board_preboot_os(void);
+
#endif
diff --git a/include/config_uncmd_spl.h b/include/config_uncmd_spl.h
index 31da6215b3a..af7e3e49fdd 100644
--- a/include/config_uncmd_spl.h
+++ b/include/config_uncmd_spl.h
@@ -16,7 +16,6 @@
#undef CONFIG_DM_SPI
#endif
-#undef CONFIG_DM_WARN
#undef CONFIG_DM_STDIO
#endif /* CONFIG_SPL_BUILD */
diff --git a/include/configs/advantech_dms-ba16.h b/include/configs/advantech_dms-ba16.h
index 07d804cbcbf..1ecb7c9df89 100644
--- a/include/configs/advantech_dms-ba16.h
+++ b/include/configs/advantech_dms-ba16.h
@@ -197,8 +197,6 @@
#define CONFIG_SYS_FSL_USDHC_NUM 3
/* Framebuffer */
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_IMX_HDMI
diff --git a/include/configs/am65x_evm.h b/include/configs/am65x_evm.h
index df0605657ae..9eed0ea203a 100644
--- a/include/configs/am65x_evm.h
+++ b/include/configs/am65x_evm.h
@@ -69,9 +69,6 @@
"findfdt=" \
"setenv name_fdt k3-am654-base-board.dtb;" \
"setenv fdtfile ${name_fdt}\0" \
- "loadaddr=0x80080000\0" \
- "fdtaddr=0x82000000\0" \
- "overlayaddr=0x83000000\0" \
"name_kern=Image\0" \
"console=ttyS2,115200n8\0" \
"stdin=serial,usbkbd\0" \
@@ -93,8 +90,8 @@
"fdt resize 0x100000;" \
"for overlay in $name_overlays;" \
"do;" \
- "load mmc ${bootpart} ${overlayaddr} ${bootdir}/${overlay};" \
- "fdt apply ${overlayaddr};" \
+ "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay};" \
+ "fdt apply ${dtboaddr};" \
"done;\0" \
"get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \
"${bootdir}/${name_kern}\0" \
@@ -133,6 +130,7 @@
/* Incorporate settings into the U-Boot environment */
#define CONFIG_EXTRA_ENV_SETTINGS \
+ DEFAULT_LINUX_BOOT_ENV \
DEFAULT_MMC_TI_ARGS \
DEFAULT_FIT_TI_ARGS \
EXTRA_ENV_AM65X_BOARD_SETTINGS \
diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h
index 4cffc7f887d..0e81ef94d37 100644
--- a/include/configs/apalis_imx6.h
+++ b/include/configs/apalis_imx6.h
@@ -67,8 +67,6 @@
/* Framebuffer and LCD */
#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_IMX_HDMI
diff --git a/include/configs/aristainetos2.h b/include/configs/aristainetos2.h
index fd28f44ae31..6e8595caad8 100644
--- a/include/configs/aristainetos2.h
+++ b/include/configs/aristainetos2.h
@@ -441,8 +441,6 @@
#define CONFIG_IMX_VIDEO_SKIP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_IMX6_PWM_PER_CLK 66000000
diff --git a/include/configs/arndale.h b/include/configs/arndale.h
index 79e7418b9bf..5109f7de534 100644
--- a/include/configs/arndale.h
+++ b/include/configs/arndale.h
@@ -18,8 +18,6 @@
#define CONFIG_EXYNOS_SPL
/* Miscellaneous configurable options */
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
-
#define CONFIG_IRAM_STACK 0x02050000
#define CONFIG_SYS_INIT_SP_ADDR CONFIG_IRAM_STACK
diff --git a/include/configs/cgtqmx6eval.h b/include/configs/cgtqmx6eval.h
index 9d0f516b7dc..2ef6bfdba86 100644
--- a/include/configs/cgtqmx6eval.h
+++ b/include/configs/cgtqmx6eval.h
@@ -60,8 +60,6 @@
#define CONFIG_USBD_HS
/* Framebuffer */
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_IMX_HDMI
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 6915dcb6615..72eb19b581c 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -204,8 +204,6 @@
/* Display */
#define CONFIG_IMX_HDMI
-#define CONFIG_VIDEO_BMP_RLE8
-
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
diff --git a/include/configs/colibri-imx6ull.h b/include/configs/colibri-imx6ull.h
index 63b3fef34c5..d373fda0168 100644
--- a/include/configs/colibri-imx6ull.h
+++ b/include/configs/colibri-imx6ull.h
@@ -152,8 +152,6 @@
#define CONFIG_VIDEO_MXS
#define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
#define CONFIG_VIDEO_LOGO
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#endif
diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h
index 097e620de4a..c014d6b2d5f 100644
--- a/include/configs/colibri_imx6.h
+++ b/include/configs/colibri_imx6.h
@@ -55,8 +55,6 @@
/* Framebuffer and LCD */
#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_IMX_HDMI
diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h
index 76088d53a3b..b3601abe2cb 100644
--- a/include/configs/colibri_imx7.h
+++ b/include/configs/colibri_imx7.h
@@ -215,8 +215,6 @@
#if defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO)
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#endif
diff --git a/include/configs/eb_cpu5282.h b/include/configs/eb_cpu5282.h
index db92bbd49a4..ab9daa4074a 100644
--- a/include/configs/eb_cpu5282.h
+++ b/include/configs/eb_cpu5282.h
@@ -212,9 +212,6 @@
* VIDEO configuration
*/
-#ifdef CONFIG_VIDEO
-#define CONFIG_VIDEO_VCXK 1
-
#define CONFIG_SYS_VCXK_DEFAULT_LINEALIGN 2
#define CONFIG_SYS_VCXK_DOUBLEBUFFERED 1
#define CONFIG_SYS_VCXK_BASE CONFIG_SYS_CS2_BASE
@@ -235,6 +232,5 @@
#define CONFIG_SYS_VCXK_INVERT_DDR MCFGPIO_DDRE
#define CONFIG_SYS_VCXK_INVERT_PIN MCFGPIO_PORT2
-#endif /* CONFIG_VIDEO */
#endif /* _CONFIG_M5282EVB_H */
/*---------------------------------------------------------------------*/
diff --git a/include/configs/embestmx6boards.h b/include/configs/embestmx6boards.h
index ef4ea9a29bf..b18db76d2f1 100644
--- a/include/configs/embestmx6boards.h
+++ b/include/configs/embestmx6boards.h
@@ -72,8 +72,6 @@
#endif
/* Framebuffer */
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_IMX_HDMI
diff --git a/include/configs/espresso7420.h b/include/configs/espresso7420.h
index 5aeb009f030..2495db93f8d 100644
--- a/include/configs/espresso7420.h
+++ b/include/configs/espresso7420.h
@@ -18,9 +18,6 @@
#define CONFIG_SPL_STACK CONFIG_IRAM_END
#define CONFIG_SYS_INIT_SP_ADDR CONFIG_IRAM_END
-/* select serial console configuration */
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
-
/* DRAM Memory Banks */
#define SDRAM_BANK_SIZE (256UL << 20UL) /* 256 MB */
diff --git a/include/configs/ethernut5.h b/include/configs/ethernut5.h
index d121b395dfe..b513b4bc68a 100644
--- a/include/configs/ethernut5.h
+++ b/include/configs/ethernut5.h
@@ -92,7 +92,6 @@
/* RTC */
#if defined(CONFIG_CMD_DATE) || defined(CONFIG_CMD_SNTP)
-#define CONFIG_RTC_PCF8563
#define CONFIG_SYS_I2C_RTC_ADDR 0x51
#endif
diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
index bcd8aee7c32..362e2892d19 100644
--- a/include/configs/ids8313.h
+++ b/include/configs/ids8313.h
@@ -168,7 +168,6 @@
#define CONFIG_SYS_FSL_I2C_SPEED 400000
#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
#define CONFIG_SYS_FSL_I2C_OFFSET 0x3100
-#define CONFIG_RTC_PCF8563
#define CONFIG_SYS_I2C_RTC_ADDR 0x51
/*
diff --git a/include/configs/imx6-engicam.h b/include/configs/imx6-engicam.h
index 13cd54a8dc1..bfe83b8cba5 100644
--- a/include/configs/imx6-engicam.h
+++ b/include/configs/imx6-engicam.h
@@ -165,8 +165,6 @@
#ifdef CONFIG_VIDEO_IPUV3
# define CONFIG_IMX_VIDEO_SKIP
-# define CONFIG_BMP_16BPP
-# define CONFIG_VIDEO_BMP_RLE8
# define CONFIG_VIDEO_LOGO
# define CONFIG_VIDEO_BMP_LOGO
#endif
diff --git a/include/configs/imxrt1050-evk.h b/include/configs/imxrt1050-evk.h
index 559e6880b7d..c8d661fb3ee 100644
--- a/include/configs/imxrt1050-evk.h
+++ b/include/configs/imxrt1050-evk.h
@@ -31,8 +31,6 @@
#ifdef CONFIG_DM_VIDEO
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_EXTRA_ENV_SETTINGS \
diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h
index 1b47e18b2f9..b707fc4e899 100644
--- a/include/configs/j721e_evm.h
+++ b/include/configs/j721e_evm.h
@@ -69,9 +69,6 @@
"findfdt=" \
"setenv name_fdt ${default_device_tree};" \
"setenv fdtfile ${name_fdt}\0" \
- "loadaddr=0x80080000\0" \
- "fdtaddr=0x82000000\0" \
- "overlayaddr=0x83000000\0" \
"name_kern=Image\0" \
"console=ttyS2,115200n8\0" \
"args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 " \
@@ -114,8 +111,8 @@
"fdt resize 0x100000;" \
"for overlay in $name_overlays;" \
"do;" \
- "load mmc ${bootpart} ${overlayaddr} ${bootdir}/${overlay} && " \
- "fdt apply ${overlayaddr};" \
+ "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
+ "fdt apply ${dtboaddr};" \
"done;\0" \
"partitions=" PARTS_DEFAULT \
"get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \
@@ -165,6 +162,7 @@
/* Incorporate settings into the U-Boot environment */
#define CONFIG_EXTRA_ENV_SETTINGS \
+ DEFAULT_LINUX_BOOT_ENV \
DEFAULT_MMC_TI_ARGS \
DEFAULT_FIT_TI_ARGS \
EXTRA_ENV_J721E_BOARD_SETTINGS \
diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h
index e9e3981060b..c1968048a7d 100644
--- a/include/configs/km/keymile-common.h
+++ b/include/configs/km/keymile-common.h
@@ -143,8 +143,7 @@
#define CONFIG_KM_DEF_ENV_FLASH_BOOT \
"cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
"cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
- "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
- " bootfs${boot_bank}\0" \
+ "ubicopy=ubi read ${cramfsaddr} bootfs${boot_bank}\0" \
"uimage=" CONFIG_KM_UIMAGE_NAME \
CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
@@ -160,6 +159,7 @@
"pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
"testbootcmd=setenv boot_bank ${test_bank}; " \
"run ${subbootcmds}; reset\0" \
+ "env_version=1\0" \
""
#ifndef CONFIG_KM_DEF_ENV
diff --git a/include/configs/km/km-powerpc.h b/include/configs/km/km-powerpc.h
index fde84871787..7bfe12fecbb 100644
--- a/include/configs/km/km-powerpc.h
+++ b/include/configs/km/km-powerpc.h
@@ -21,6 +21,9 @@
/* Reserve 4 MB for malloc */
#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
+/* Increase max size of compressed kernel */
+#define CONFIG_SYS_BOOTM_LEN 0x2000000 /* 32 MB */
+
/******************************************************************************
* (PRAM usage)
* ... -------------------------------------------------------
@@ -53,6 +56,7 @@
"protect on " __stringify(BOOTFLASH_START) " +${filesize}\0"\
"set_fdthigh=true\0" \
"checkfdt=true\0" \
+ "bootm_mapsize=" __stringify(CONFIG_SYS_BOOTM_LEN) "\0" \
""
#endif /* __CONFIG_KEYMILE_POWERPC_H */
diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h
index 79edfa728a5..98e0ce1c240 100644
--- a/include/configs/km/km_arm.h
+++ b/include/configs/km/km_arm.h
@@ -35,6 +35,9 @@
/* Reserve 4 MB for malloc */
#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
+/* Increase max size of compressed kernel */
+#define CONFIG_SYS_BOOTM_LEN (32 << 20)
+
#include "asm/arch/config.h"
#define CONFIG_SYS_LOAD_ADDR 0x00800000 /* default load adr- 8M */
diff --git a/include/configs/kmp204x.h b/include/configs/kmp204x.h
index fb3a83ce673..ec1254e747b 100644
--- a/include/configs/kmp204x.h
+++ b/include/configs/kmp204x.h
@@ -125,10 +125,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
*/
#define CONFIG_PRAM ((CONFIG_KM_PNVRAM + CONFIG_KM_PHRAM) >> 10)
-#define CONFIG_KM_CRAMFS_ADDR 0x2000000
-#define CONFIG_KM_KERNEL_ADDR 0x1000000 /* max kernel size 15.5Mbytes */
-#define CONFIG_KM_FDT_ADDR 0x1F80000 /* max dtb size 0.5Mbytes */
-
/*
* Local Bus Definitions
*/
diff --git a/include/configs/kontron_sl28.h b/include/configs/kontron_sl28.h
new file mode 100644
index 00000000000..afe512a8c7b
--- /dev/null
+++ b/include/configs/kontron_sl28.h
@@ -0,0 +1,108 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __SL28_H
+#define __SL28_H
+
+#include <asm/arch/stream_id_lsch3.h>
+#include <asm/arch/config.h>
+#include <asm/arch/soc.h>
+
+/* we don't use hwconfig but this has to be defined.. */
+#define HWCONFIG_BUFFER_SIZE 256
+
+/* we don't have secure memory unless we have a BL31 */
+#ifndef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
+#undef CONFIG_SYS_MEM_RESERVE_SECURE
+#endif
+
+/* DDR */
+#define CONFIG_DDR_ECC
+#define CONFIG_ECC_INIT_VIA_DDRCONTROLLER
+#define CONFIG_MEM_INIT_VALUE 0xdeadbeef
+
+#define CONFIG_VERY_BIG_RAM
+#define CONFIG_CHIP_SELECTS_PER_CTRL 4
+#define CONFIG_DIMM_SLOTS_PER_CTLR 1
+#define CONFIG_SYS_DDR_SDRAM_BASE 0x80000000
+#define CONFIG_SYS_FSL_DDR_SDRAM_BASE_PHY 0
+#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE
+#define CONFIG_SYS_DDR_BLOCK2_BASE 0x2080000000ULL
+#define CONFIG_SYS_FSL_DDR_MAIN_NUM_CTRLS 1
+
+/* early stack pointer */
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_FSL_OCRAM_BASE + 0xeff0)
+
+/* memtest command */
+#define CONFIG_SYS_MEMTEST_START 0x80000000
+#define CONFIG_SYS_MEMTEST_END 0x9fffffff
+
+/* SMP */
+#define CPU_RELEASE_ADDR secondary_boot_addr
+
+/* generic timer */
+#define COUNTER_FREQUENCY 25000000
+
+/* size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2048 * 1024)
+
+/* early heap for SPL DM */
+#define CONFIG_MALLOC_F_ADDR CONFIG_SYS_FSL_OCRAM_BASE
+
+/* serial port */
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE 1
+#define CONFIG_SYS_NS16550_CLK (get_bus_freq(0) / 2)
+#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
+
+#define CONFIG_SYS_CLK_FREQ 100000000
+#define CONFIG_DDR_CLK_FREQ 100000000
+#define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ / 4)
+
+/* MMC */
+#ifdef CONFIG_MMC
+#define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
+#endif
+
+/* ethernet */
+#define CONFIG_SYS_RX_ETH_BUFFER 8
+
+/* SPL */
+#define CONFIG_SPL_BSS_START_ADDR 0x80100000
+#define CONFIG_SPL_BSS_MAX_SIZE 0x00100000
+#define CONFIG_SPL_MAX_SIZE 0x20000
+#define CONFIG_SPL_STACK (CONFIG_SYS_FSL_OCRAM_BASE + 0x9ff0)
+
+#define CONFIG_SYS_SPL_MALLOC_SIZE 0x00100000
+#define CONFIG_SYS_SPL_MALLOC_START 0x80200000
+#define CONFIG_SYS_MONITOR_LEN (1024 * 1024)
+
+/* environment */
+/* see include/configs/ti_armv7_common.h */
+#define CONFIG_SYS_LOAD_ADDR 0x82000000
+#define ENV_MEM_LAYOUT_SETTINGS \
+ "loadaddr=0x82000000\0" \
+ "kernel_addr_r=0x82000000\0" \
+ "fdt_addr_r=0x88000000\0" \
+ "bootm_size=0x10000000\0" \
+ "pxefile_addr_r=0x80100000\0" \
+ "scriptaddr=0x80000000\0" \
+ "ramdisk_addr_r=0x88080000\0"
+
+#define BOOT_TARGET_DEVICES(func) \
+ func(MMC, mmc, 1) \
+ func(MMC, mmc, 0) \
+ func(NVME, nvme, 0) \
+ func(USB, usb, 0) \
+ func(DHCP, dhcp, 0) \
+ func(PXE, pxe, 0)
+#include <config_distro_bootcmd.h>
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "env_addr=0x203e0004\0" \
+ "envload=env import -d -b ${env_addr}\0" \
+ "install_rcw=source 20200000\0" \
+ "fdtfile=freescale/fsl-ls1028a-kontron-sl28.dtb\0" \
+ ENV_MEM_LAYOUT_SETTINGS \
+ BOOTENV
+
+#endif /* __SL28_H */
diff --git a/include/configs/ls1012aqds.h b/include/configs/ls1012aqds.h
index 9498a03f405..df2a613eaf3 100644
--- a/include/configs/ls1012aqds.h
+++ b/include/configs/ls1012aqds.h
@@ -50,7 +50,6 @@
* RTC configuration
*/
#define RTC
-#define CONFIG_RTC_PCF8563 1
#define CONFIG_SYS_I2C_RTC_ADDR 0x51 /* Channel 3*/
/* EEPROM */
diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h
index b7a7dc0a64a..ab4214c2653 100644
--- a/include/configs/ls2080ardb.h
+++ b/include/configs/ls2080ardb.h
@@ -279,7 +279,6 @@ unsigned long get_board_sys_clk(void);
*/
#define RTC
#ifdef CONFIG_TARGET_LS2081ARDB
-#define CONFIG_RTC_PCF8563 1
#define CONFIG_SYS_I2C_RTC_ADDR 0x51
#else
#define CONFIG_RTC_DS3231 1
diff --git a/include/configs/m53menlo.h b/include/configs/m53menlo.h
index c15e7d22bc8..52c95de5231 100644
--- a/include/configs/m53menlo.h
+++ b/include/configs/m53menlo.h
@@ -126,9 +126,6 @@
/*
* LCD
*/
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_VIDEO_BMP_GZIP
-#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20)
diff --git a/include/configs/meson64.h b/include/configs/meson64.h
index c895a24eca3..cee69006802 100644
--- a/include/configs/meson64.h
+++ b/include/configs/meson64.h
@@ -18,10 +18,6 @@
/* For splashscreen */
#ifdef CONFIG_DM_VIDEO
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
-#define CONFIG_BMP_24BPP
-#define CONFIG_BMP_32BPP
#define STDOUT_CFG "vidconsole,serial"
#else
#define STDOUT_CFG "serial"
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h
index 8ca0e83c783..2b412423508 100644
--- a/include/configs/microblaze-generic.h
+++ b/include/configs/microblaze-generic.h
@@ -125,21 +125,67 @@
#define CONFIG_SYS_LOAD_ADDR 0
#define CONFIG_HOSTNAME "microblaze-generic"
-#define CONFIG_BOOTCOMMAND "base 0;tftp 11000000 image.img;bootm"
/* architecture dependent code */
#define CONFIG_SYS_USR_EXCEP /* user exception */
+#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
+#define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
+#else
+#define BOOT_TARGET_DEVICES_PXE(func)
+#endif
+
+#if defined(CONFIG_CMD_DHCP)
+#define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
+#else
+#define BOOT_TARGET_DEVICES_DHCP(func)
+#endif
+
+#if defined(CONFIG_SPI_FLASH)
+# define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
+#else
+# define BOOT_TARGET_DEVICES_QSPI(func)
+#endif
+
+#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
+ "bootcmd_qspi=sf probe 0 0 0 && " \
+ "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \
+ "echo QSPI: Trying to boot script at ${scriptaddr} && " \
+ "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0"
+
+#define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
+ "qspi "
+
+#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
+
+#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
+ "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
+ "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
+
+#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
+ "jtag "
+
+#define BOOT_TARGET_DEVICES(func) \
+ BOOT_TARGET_DEVICES_JTAG(func) \
+ BOOT_TARGET_DEVICES_QSPI(func) \
+ BOOT_TARGET_DEVICES_DHCP(func) \
+ BOOT_TARGET_DEVICES_PXE(func)
+
+#include <config_distro_bootcmd.h>
+
#ifndef CONFIG_EXTRA_ENV_SETTINGS
-#define CONFIG_EXTRA_ENV_SETTINGS "unlock=yes\0" \
- "nor0=flash-0\0"\
- "mtdparts=mtdparts=flash-0:"\
- "256k(u-boot),256k(env),3m(kernel),"\
- "1m(romfs),1m(cramfs),-(jffs2)\0"\
- "nc=setenv stdout nc;"\
- "setenv stdin nc\0" \
- "serial=setenv stdout serial;"\
- "setenv stdin serial\0"
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "unlock=yes\0"\
+ "nor0=flash-0\0"\
+ "mtdparts=mtdparts=flash-0:"\
+ "256k(u-boot),256k(env),3m(kernel),"\
+ "1m(romfs),1m(cramfs),-(jffs2)\0"\
+ "nc=setenv stdout nc;"\
+ "setenv stdin nc\0" \
+ "serial=setenv stdout serial;"\
+ "setenv stdin serial\0"\
+ "script_size_f=0x40000\0"\
+ BOOTENV
#endif
#if defined(CONFIG_XILINX_AXIEMAC)
@@ -167,8 +213,7 @@
#define CONFIG_SYS_INIT_RAM_SIZE 0x100000
# define CONFIG_SPL_STACK_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
- CONFIG_SYS_INIT_RAM_SIZE - \
- CONFIG_SYS_MALLOC_F_LEN)
+ CONFIG_SYS_INIT_RAM_SIZE)
/* Just for sure that there is a space for stack */
#define CONFIG_SPL_STACK_SIZE 0x100
diff --git a/include/configs/mvebu_armada-37xx.h b/include/configs/mvebu_armada-37xx.h
index 27428d5a0f5..0d585606a73 100644
--- a/include/configs/mvebu_armada-37xx.h
+++ b/include/configs/mvebu_armada-37xx.h
@@ -17,8 +17,6 @@
#define CONFIG_SYS_BOOTM_LEN SZ_64M /* Increase max gunzip size */
-/* auto boot */
-
#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, \
115200, 230400, 460800, 921600 }
@@ -57,11 +55,8 @@
/*
* SPI Flash configuration
*/
-
#define CONFIG_MTD_PARTITIONS /* required for UBI partition support */
-/* Environment in SPI NOR flash */
-
/*
* Ethernet Driver configuration
*/
@@ -70,8 +65,6 @@
#define CONFIG_USB_MAX_CONTROLLER_COUNT (3 + 3)
-/* USB ethernet */
-
/*
* SATA/SCSI/AHCI configuration
*/
diff --git a/include/configs/mx23evk.h b/include/configs/mx23evk.h
index 8f170b25297..3f13e60531c 100644
--- a/include/configs/mx23evk.h
+++ b/include/configs/mx23evk.h
@@ -31,9 +31,6 @@
/* Framebuffer support */
#ifdef CONFIG_VIDEO
#define CONFIG_VIDEO_LOGO
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_VIDEO_BMP_GZIP
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10)
#endif
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index d65f6a900f9..a65df486081 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -52,9 +52,6 @@
/* Framebuffer support */
#ifdef CONFIG_VIDEO
#define CONFIG_VIDEO_LOGO
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_VIDEO_BMP_GZIP
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10)
#endif
diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
index 58712926b4d..49f88c27dcd 100644
--- a/include/configs/mx51evk.h
+++ b/include/configs/mx51evk.h
@@ -65,8 +65,6 @@
#define CONFIG_MXC_USB_FLAGS MXC_EHCI_POWER_PINS_ENABLED
/* Framebuffer and LCD */
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_ETHPRIME "FEC0"
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index 90d800cd254..a0dd33aecd3 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -176,8 +176,6 @@
#endif
/* Framebuffer and LCD */
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#endif /* __CONFIG_H */
diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h
index 20b757e621b..cfab9a7fc02 100644
--- a/include/configs/mx6cuboxi.h
+++ b/include/configs/mx6cuboxi.h
@@ -29,8 +29,6 @@
#endif
/* Framebuffer */
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_IMX_HDMI
diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h
index ecf4681c1f7..c4e34e9cbc7 100644
--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -169,8 +169,6 @@
/* Environment organization */
/* Framebuffer */
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_IMX_HDMI
diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h
index 441ea3d4df5..42feb140197 100644
--- a/include/configs/mx6sxsabresd.h
+++ b/include/configs/mx6sxsabresd.h
@@ -176,8 +176,6 @@
#ifdef CONFIG_VIDEO
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#define MXS_LCDIF_BASE MX6SX_LCDIF1_BASE_ADDR
#endif
diff --git a/include/configs/mx6ul_14x14_evk.h b/include/configs/mx6ul_14x14_evk.h
index 68e1db52c73..fa6b303dd4a 100644
--- a/include/configs/mx6ul_14x14_evk.h
+++ b/include/configs/mx6ul_14x14_evk.h
@@ -183,8 +183,6 @@
#if defined(CONFIG_DM_VIDEO)
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
#endif
diff --git a/include/configs/mx7dsabresd.h b/include/configs/mx7dsabresd.h
index 16b8c07f324..51a7a5f4a0e 100644
--- a/include/configs/mx7dsabresd.h
+++ b/include/configs/mx7dsabresd.h
@@ -141,8 +141,6 @@
#ifdef CONFIG_VIDEO
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#endif
diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index f1780b2391a..6448ea891f8 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -56,10 +56,7 @@
#define CONFIG_MXC_USB_FLAGS 0
/* Framebuffer and LCD */
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_VIDEO_BMP_GZIP
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (6 * 1024 * 1024)
-#define CONFIG_BMP_16BPP
#define CONFIG_IMX_HDMI
#define CONFIG_IMX_VIDEO_SKIP
diff --git a/include/configs/novena.h b/include/configs/novena.h
index b648c7bc868..2b0a7631c8c 100644
--- a/include/configs/novena.h
+++ b/include/configs/novena.h
@@ -101,8 +101,6 @@
#endif
/* Video output */
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_IMX_HDMI
#define CONFIG_IMX_VIDEO_SKIP
diff --git a/include/configs/odroid.h b/include/configs/odroid.h
index befb9f9aa15..1367d13891a 100644
--- a/include/configs/odroid.h
+++ b/include/configs/odroid.h
@@ -33,12 +33,7 @@
#include <linux/sizes.h>
-/* select serial console configuration */
-
-/* Console configuration */
-
#define CONFIG_BOOTCOMMAND "run distro_bootcmd ; run autoboot"
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \
- GENERATED_GBL_DATA_SIZE)
@@ -149,7 +144,7 @@
"elif test -e mmc ${mmcbootdev} uImage; then; " \
"run boot_uimg;" \
"fi;\0" \
- "console=" CONFIG_DEFAULT_CONSOLE \
+ "console=console=ttySAC1,115200n8\0" \
"mmcbootdev=0\0" \
"mmcbootpart=1\0" \
"mmcrootdev=0\0" \
diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h
index 564319c2311..0c86196152f 100644
--- a/include/configs/odroid_xu3.h
+++ b/include/configs/odroid_xu3.h
@@ -14,8 +14,6 @@
#define CONFIG_SYS_SDRAM_BASE 0x40000000
-/* select serial console configuration */
-
#define TZPC_BASE_OFFSET 0x10000
#define SDRAM_BANK_SIZE (256UL << 20UL) /* 256 MB */
@@ -25,8 +23,6 @@
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - 0x1000000)
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
-
/* USB */
#define CONFIG_USB_EHCI_EXYNOS
@@ -97,7 +93,7 @@
MEM_LAYOUT_ENV_SETTINGS \
BOOTENV \
"rootfstype=ext4\0" \
- "console=" CONFIG_DEFAULT_CONSOLE \
+ "console=console=ttySAC2,115200n8\0" \
"fdtfile=exynos5422-odroidxu3.dtb\0" \
"board_name=odroidxu3\0" \
"mmcbootdev=0\0" \
diff --git a/include/configs/opos6uldev.h b/include/configs/opos6uldev.h
index 8dfd5bede3c..2fb1634a7de 100644
--- a/include/configs/opos6uldev.h
+++ b/include/configs/opos6uldev.h
@@ -45,11 +45,7 @@
#ifndef CONFIG_SPL_BUILD
#ifdef CONFIG_DM_VIDEO
#define CONFIG_VIDEO_LOGO
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
-#define CONFIG_BMP_16BPP
-#define CONFIG_BMP_24BPP
-#define CONFIG_BMP_32BPP
#define CONFIG_VIDEO_MXS
#define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
#endif
diff --git a/include/configs/origen.h b/include/configs/origen.h
index 24b0338deb3..8a0e145c76c 100644
--- a/include/configs/origen.h
+++ b/include/configs/origen.h
@@ -24,11 +24,6 @@
#define CONFIG_MACH_TYPE MACH_TYPE_ORIGEN
-/* select serial console configuration */
-
-/* Console configuration */
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
-
#define CONFIG_SYS_MEM_TOP_HIDE (1 << 20) /* ram console */
#define CONFIG_SYS_MONITOR_BASE 0x00000000
diff --git a/include/configs/peach-pi.h b/include/configs/peach-pi.h
index a732e06a991..ba82aaf6537 100644
--- a/include/configs/peach-pi.h
+++ b/include/configs/peach-pi.h
@@ -23,9 +23,6 @@
#define CONFIG_SYS_SDRAM_BASE 0x20000000
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_IRAM_TOP - 0x800)
-/* select serial console configuration */
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
-
/* Display */
#ifdef CONFIG_LCD
#define CONFIG_EXYNOS_FB
diff --git a/include/configs/peach-pit.h b/include/configs/peach-pit.h
index 6c5960cb8da..16fb2f3a0e3 100644
--- a/include/configs/peach-pit.h
+++ b/include/configs/peach-pit.h
@@ -23,9 +23,6 @@
#define CONFIG_SYS_SDRAM_BASE 0x20000000
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_IRAM_TOP - 0x800)
-/* select serial console configuration */
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
-
/* DRAM Memory Banks */
#define SDRAM_BANK_SIZE (512UL << 20UL) /* 512 MB */
diff --git a/include/configs/pico-imx6.h b/include/configs/pico-imx6.h
index 289c1cac669..19c8aeb71b6 100644
--- a/include/configs/pico-imx6.h
+++ b/include/configs/pico-imx6.h
@@ -143,8 +143,6 @@
#define CONFIG_FEC_MXC_PHYADDR 1
/* Framebuffer */
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_IMX_HDMI
diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h
index 5211970a83c..747ef09f37d 100644
--- a/include/configs/pico-imx6ul.h
+++ b/include/configs/pico-imx6ul.h
@@ -147,8 +147,6 @@
#ifdef CONFIG_VIDEO
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
#endif
diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h
index 12417dfeded..51b7359cad9 100644
--- a/include/configs/pico-imx7d.h
+++ b/include/configs/pico-imx7d.h
@@ -143,8 +143,6 @@
#ifdef CONFIG_DM_VIDEO
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#endif
diff --git a/include/configs/puma_rk3399.h b/include/configs/puma_rk3399.h
index 5714437a001..f52ea014b5d 100644
--- a/include/configs/puma_rk3399.h
+++ b/include/configs/puma_rk3399.h
@@ -12,8 +12,4 @@
#define CONFIG_SERIAL_TAG
-#define CONFIG_BMP_16BPP
-#define CONFIG_BMP_24BPP
-#define CONFIG_BMP_32BPP
-
#endif
diff --git a/include/configs/pxm2.h b/include/configs/pxm2.h
index 588eb282a17..4673390c1a7 100644
--- a/include/configs/pxm2.h
+++ b/include/configs/pxm2.h
@@ -115,7 +115,6 @@
#if defined(CONFIG_VIDEO)
#define CONFIG_VIDEO_DA8XX
#define CONFIG_VIDEO_LOGO
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#define DA8XX_LCD_CNTL_BASE LCD_CNTL_BASE
#define PWM_TICKS 0x1388
diff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h
index bc8b7c5c123..273fa1a7d7b 100644
--- a/include/configs/qemu-arm.h
+++ b/include/configs/qemu-arm.h
@@ -45,13 +45,7 @@
#define CONFIG_SYS_CBSIZE 512
#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
-#ifdef CONFIG_TFABOOT
-#define CONFIG_SYS_FLASH_BASE 0x4000000
-#define CONFIG_SYS_MAX_FLASH_BANKS 1
-#else
-#define CONFIG_SYS_FLASH_BASE 0x0
-#define CONFIG_SYS_MAX_FLASH_BANKS 2
-#endif
+#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT 2
#define CONFIG_SYS_MAX_FLASH_SECT 256 /* Sector: 256K, Bank: 64M */
#define CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS
diff --git a/include/configs/rut.h b/include/configs/rut.h
index 7e1e8f428eb..66940033ab9 100644
--- a/include/configs/rut.h
+++ b/include/configs/rut.h
@@ -108,7 +108,6 @@
#if defined(CONFIG_VIDEO)
#define CONFIG_VIDEO_DA8XX
#define CONFIG_VIDEO_LOGO
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#define DA8XX_LCD_CNTL_BASE LCD_CNTL_BASE
diff --git a/include/configs/s5p4418_nanopi2.h b/include/configs/s5p4418_nanopi2.h
index 8577729d654..6dd1f3bc049 100644
--- a/include/configs/s5p4418_nanopi2.h
+++ b/include/configs/s5p4418_nanopi2.h
@@ -153,11 +153,6 @@
#define CONFIG_VIDEO_LOGO
#ifdef CONFIG_VIDEO_LOGO
-
-#ifdef CONFIG_DM_VIDEO
-#define CONFIG_BMP_24BPP
-#endif
-
#ifdef CONFIG_SPLASH_SCREEN
#define SPLASH_FILE logo.bmp
#endif
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index d6d07a95b68..9688bdc4c03 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -34,10 +34,6 @@
/* Size of malloc() pool before and after relocation */
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (80 << 20))
-/*
- * select serial console configuration
- */
-
/* MMC */
#define SDHCI_MAX_HOSTS 4
@@ -85,8 +81,6 @@
#define CONFIG_BOOTCOMMAND "run mmcboot"
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
-
#define CONFIG_RAMDISK_BOOT "root=/dev/ram0 rw rootfstype=ext4" \
" ${console} ${meminfo}"
@@ -131,7 +125,7 @@
"bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \
"verify=n\0" \
"rootfstype=ext4\0" \
- "console=" CONFIG_DEFAULT_CONSOLE \
+ "console=console=ttySAC2,115200n8\0" \
"meminfo=mem=80M mem=256M@0x40000000 mem=128M@0x50000000\0" \
"loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0" \
"mmcdev=0\0" \
diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h
index da6ed975c36..0b679f43748 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -22,12 +22,7 @@
#define SDRAM_BANK_SIZE (256 << 20) /* 256 MB */
-/* select serial console configuration */
-
-/* Console configuration */
-
#define CONFIG_BOOTCOMMAND "run mmcboot"
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \
- GENERATED_GBL_DATA_SIZE)
@@ -102,7 +97,7 @@
"mmcoops=mmc read 0 0x40000000 0x40 8; md 0x40000000 0x400\0" \
"verify=n\0" \
"rootfstype=ext4\0" \
- "console=" CONFIG_DEFAULT_CONSOLE \
+ "console=console=ttySAC1,115200n8\0" \
"mtdparts=" CONFIG_MTDPARTS_DEFAULT \
"mbrparts=" MBRPARTS_DEFAULT \
"meminfo=crashkernel=32M@0x50000000\0" \
@@ -158,9 +153,7 @@ int universal_spi_read(void);
/*
* LCD Settings
*/
-#define CONFIG_BMP_16BPP
#define CONFIG_LD9040
-#define CONFIG_VIDEO_BMP_GZIP
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54)
#endif /* __CONFIG_H */
diff --git a/include/configs/sam9x60ek.h b/include/configs/sam9x60ek.h
index 19714402ca4..6a6f1de41d1 100644
--- a/include/configs/sam9x60ek.h
+++ b/include/configs/sam9x60ek.h
@@ -40,7 +40,8 @@
#define CONFIG_SYS_SDRAM_SIZE 0x10000000 /* 256 megs */
#define CONFIG_SYS_INIT_SP_ADDR \
- (CONFIG_SYS_SDRAM_BASE + 16 * 1024 - GENERATED_GBL_DATA_SIZE)
+ (CONFIG_SYS_SDRAM_BASE + 16 * 1024 + CONFIG_SYS_MALLOC_F_LEN - \
+ GENERATED_GBL_DATA_SIZE)
/* NAND flash */
#ifdef CONFIG_CMD_NAND
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 5554313810c..e0708fe5739 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -80,7 +80,6 @@
#ifdef CONFIG_SANDBOX_SDL
#define LCD_BPP LCD_COLOR16
#define CONFIG_LCD_BMP_RLE8
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_KEYBOARD
diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
index 82251b36150..3af13673f2a 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/smdk5250.h
@@ -18,6 +18,4 @@
#define CONFIG_BOARD_COMMON
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
-
#endif /* __CONFIG_SMDK_H */
diff --git a/include/configs/smdk5420.h b/include/configs/smdk5420.h
index 14ec099d53b..d06dfe43a23 100644
--- a/include/configs/smdk5420.h
+++ b/include/configs/smdk5420.h
@@ -24,11 +24,6 @@
#define CONFIG_SYS_SDRAM_BASE 0x20000000
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_IRAM_TOP - 0x800)
-/* select serial console configuration */
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
-
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
-
/* USB */
#define CONFIG_USB_XHCI_EXYNOS
diff --git a/include/configs/smdkv310.h b/include/configs/smdkv310.h
index b970e4bc80e..fc2f6ecf6be 100644
--- a/include/configs/smdkv310.h
+++ b/include/configs/smdkv310.h
@@ -27,17 +27,12 @@
#define S5P_CHECK_DIDLE 0xBAD00000
#define S5P_CHECK_LPA 0xABAD0000
-/* select serial console configuration */
-#define EXYNOS4_DEFAULT_UART_OFFSET 0x010000
-
/* MMC SPL */
#define CONFIG_SKIP_LOWLEVEL_INIT
#define COPY_BL2_FNPTR_ADDR 0x00002488
#define CONFIG_BOOTCOMMAND "fatload mmc 0 40007000 uImage; bootm 40007000"
-/* Miscellaneous configurable options */
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
/* memtest works on */
#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x3E00000)
diff --git a/include/configs/snow.h b/include/configs/snow.h
index c546a5a6d07..c082b2d82d8 100644
--- a/include/configs/snow.h
+++ b/include/configs/snow.h
@@ -17,6 +17,4 @@
#define CONFIG_BOARD_COMMON
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
-
#endif /* __CONFIG_SNOW_H */
diff --git a/include/configs/socfpga_arria5_secu1.h b/include/configs/socfpga_arria5_secu1.h
index 2271f26a6b3..c25d6bd82be 100644
--- a/include/configs/socfpga_arria5_secu1.h
+++ b/include/configs/socfpga_arria5_secu1.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
- * Copyright (C) 2017-2020 ABB
+ * Copyright (C) 2017-2020 Hitachi Power Grids
*
*/
#ifndef __CONFIG_SOCFPGA_SECU1_H__
diff --git a/include/configs/spring.h b/include/configs/spring.h
index 272622a5ed9..0b052453a51 100644
--- a/include/configs/spring.h
+++ b/include/configs/spring.h
@@ -12,6 +12,4 @@
#define CONFIG_BOARD_COMMON
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
-
#endif /* __CONFIG_SPRING_H */
diff --git a/include/configs/stm32f746-disco.h b/include/configs/stm32f746-disco.h
index 74abf95ce93..08d050adfa5 100644
--- a/include/configs/stm32f746-disco.h
+++ b/include/configs/stm32f746-disco.h
@@ -76,11 +76,5 @@
/* For SPL ends */
/* For splashcreen */
-#ifdef CONFIG_DM_VIDEO
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
-#define CONFIG_BMP_24BPP
-#define CONFIG_BMP_32BPP
-#endif
#endif /* __CONFIG_H */
diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h
index b937233797f..1aa7514ac79 100644
--- a/include/configs/stm32mp1.h
+++ b/include/configs/stm32mp1.h
@@ -75,13 +75,6 @@
#define CONFIG_SYS_AUTOLOAD "no"
#endif
-#ifdef CONFIG_DM_VIDEO
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
-#define CONFIG_BMP_24BPP
-#define CONFIG_BMP_32BPP
-#endif
-
/*****************************************************************************/
#ifdef CONFIG_DISTRO_DEFAULTS
/*****************************************************************************/
diff --git a/include/configs/tbs2910.h b/include/configs/tbs2910.h
index b05034945e5..01c1143e43c 100644
--- a/include/configs/tbs2910.h
+++ b/include/configs/tbs2910.h
@@ -36,7 +36,6 @@
#define CONFIG_MXC_UART_BASE UART1_BASE /* select UART1/UART2 */
/* Framebuffer */
-#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_IMX_HDMI
#define CONFIG_IMX_VIDEO_SKIP
diff --git a/include/configs/theadorable-x86-common.h b/include/configs/theadorable-x86-common.h
index 141d4d61f84..193c6c3bb5c 100644
--- a/include/configs/theadorable-x86-common.h
+++ b/include/configs/theadorable-x86-common.h
@@ -19,7 +19,6 @@
#define VIDEO_IO_OFFSET 0
#define CONFIG_X86EMU_RAW_IO
-#define CONFIG_BMP_16BPP
/* Environment settings */
diff --git a/include/configs/theadorable.h b/include/configs/theadorable.h
index 85ab34c0834..587b134a1b3 100644
--- a/include/configs/theadorable.h
+++ b/include/configs/theadorable.h
@@ -51,10 +51,6 @@
/* Enable LCD and reserve 512KB from top of memory*/
#define CONFIG_SYS_MEM_TOP_HIDE 0x80000
-#define CONFIG_BMP_16BPP
-#define CONFIG_BMP_24BPP
-#define CONFIG_BMP_32BPP
-
/* FPGA programming support */
#define CONFIG_FPGA_STRATIX_V
diff --git a/include/configs/trats.h b/include/configs/trats.h
index 3202627a7db..a44792d8576 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -29,12 +29,9 @@
/* memtest works on */
#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x4800000)
-/* select serial console configuration */
-
#define CONFIG_MACH_TYPE MACH_TYPE_TRATS
#define CONFIG_BOOTCOMMAND "run autoboot"
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \
- GENERATED_GBL_DATA_SIZE)
@@ -112,7 +109,7 @@
"mmcoops=mmc read 0 0x40000000 0x40 8; md 0x40000000 0x400\0" \
"verify=n\0" \
"rootfstype=ext4\0" \
- "console=" CONFIG_DEFAULT_CONSOLE \
+ "console=console=ttySAC2,115200n8\0" \
"meminfo=crashkernel=32M@0x50000000\0" \
"nfsroot=/nfsroot/arm\0" \
"bootblock=" CONFIG_BOOTBLOCK "\0" \
@@ -178,10 +175,8 @@
#define LCD_BPP LCD_COLOR16
/* LCD */
-#define CONFIG_BMP_16BPP
#define CONFIG_FB_ADDR 0x52504000
#define CONFIG_EXYNOS_MIPI_DSIM
-#define CONFIG_VIDEO_BMP_GZIP
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54)
#endif /* __CONFIG_H */
diff --git a/include/configs/trats2.h b/include/configs/trats2.h
index 14549dd1a0c..4b1eff08f3b 100644
--- a/include/configs/trats2.h
+++ b/include/configs/trats2.h
@@ -27,12 +27,7 @@
/* memtest works on */
#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x3E00000)
-/* select serial console configuration */
-
-/* Console configuration */
-
#define CONFIG_BOOTCOMMAND "run autoboot"
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \
- GENERATED_GBL_DATA_SIZE)
@@ -95,7 +90,7 @@
"boottrace=setenv opts initcall_debug; run bootcmd\0" \
"verify=n\0" \
"rootfstype=ext4\0" \
- "console=" CONFIG_DEFAULT_CONSOLE \
+ "console=console=ttySAC2,115200n8\0" \
"kernelname=uImage\0" \
"loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x40007FC0 " \
"${kernelname}\0" \
@@ -161,10 +156,8 @@
#define LCD_BPP LCD_COLOR16
/* LCD */
-#define CONFIG_BMP_16BPP
#define CONFIG_FB_ADDR 0x52504000
#define CONFIG_EXYNOS_MIPI_DSIM
-#define CONFIG_VIDEO_BMP_GZIP
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54)
#endif /* __CONFIG_H */
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index 5506c1a028a..bd64893fc77 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -37,8 +37,6 @@
#define CONFIG_MXC_USB_FLAGS 0
/* Framebuffer */
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_IMX_HDMI
diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h
index 8b416327b57..f1d2594f3b3 100644
--- a/include/configs/xilinx_versal.h
+++ b/include/configs/xilinx_versal.h
@@ -18,7 +18,6 @@
#define GICD_BASE 0xF9000000
#define GICR_BASE 0xF9080000
-
#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
/* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */
diff --git a/include/configs/xilinx_versal_mini.h b/include/configs/xilinx_versal_mini.h
index 0b201a2b4d6..00c97188198 100644
--- a/include/configs/xilinx_versal_mini.h
+++ b/include/configs/xilinx_versal_mini.h
@@ -10,7 +10,6 @@
#ifndef __CONFIG_VERSAL_MINI_H
#define __CONFIG_VERSAL_MINI_H
-
#define CONFIG_EXTRA_ENV_SETTINGS
#include <configs/xilinx_versal.h>
diff --git a/include/configs/xilinx_zynqmp_mini.h b/include/configs/xilinx_zynqmp_mini.h
index 3f57423b789..ef9c768e48e 100644
--- a/include/configs/xilinx_zynqmp_mini.h
+++ b/include/configs/xilinx_zynqmp_mini.h
@@ -10,7 +10,6 @@
#ifndef __CONFIG_ZYNQMP_MINI_H
#define __CONFIG_ZYNQMP_MINI_H
-
#define CONFIG_EXTRA_ENV_SETTINGS
#include <configs/xilinx_zynqmp.h>
diff --git a/include/display_options.h b/include/display_options.h
index a0dabca2b8a..049688e39e8 100644
--- a/include/display_options.h
+++ b/include/display_options.h
@@ -24,7 +24,7 @@ void print_size(uint64_t size, const char *suffix);
/**
* print_freq() - Print a frequency with a suffix
*
- * Print frequencies as "x.xx GHz", "xxx KHz", etc as needed; allow for
+ * Print frequencies as "x.xx GHz", "xxx kHz", etc as needed; allow for
* optional trailing string (like "\n")
*
* @freq: Frequency to print in Hz
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index 1dcc22f6891..c5d7ec0650f 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -81,7 +81,7 @@ int device_bind_with_driver_data(struct udevice *parent,
* @return 0 if OK, -ve on error
*/
int device_bind_by_name(struct udevice *parent, bool pre_reloc_only,
- struct driver_info *info, struct udevice **devp);
+ const struct driver_info *info, struct udevice **devp);
/**
* device_reparent: reparent the device to a new parent
diff --git a/include/dm/device.h b/include/dm/device.h
index ac3b6c1b8a0..5bef4842470 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -554,6 +554,20 @@ int device_get_by_driver_info(const struct driver_info *info,
struct udevice **devp);
/**
+ * device_get_by_driver_info_idx() - Get a device based on driver_info index
+ *
+ * Locates a device by its struct driver_info, by using its index number which
+ * is written into the idx field of struct phandle_1_arg, etc.
+ *
+ * The device is probed to activate it ready for use.
+ *
+ * @idx: Index number of the driver_info structure (0=first)
+ * @devp: Returns pointer to device if found, otherwise this is set to NULL
+ * @return 0 if OK, -ve on error
+ */
+int device_get_by_driver_info_idx(uint idx, struct udevice **devp);
+
+/**
* device_find_first_child() - Find the first child of a device
*
* @parent: Parent device to search
@@ -823,7 +837,7 @@ static inline bool device_is_on_pci_bus(const struct udevice *dev)
_ret = device_next_child_err(&dev))
/**
- * dm_scan_fdt_dev() - Bind child device in a the device tree
+ * dm_scan_fdt_dev() - Bind child device in the device tree
*
* This handles device which have sub-nodes in the device tree. It scans all
* sub-nodes and binds drivers for each node where a driver can be found.
diff --git a/include/dm/device_compat.h b/include/dm/device_compat.h
index 8f26053b450..82d7a7d4924 100644
--- a/include/dm/device_compat.h
+++ b/include/dm/device_compat.h
@@ -16,26 +16,6 @@
#include <linux/compat.h>
/*
- * REVISIT:
- * remove the following after resolving conflicts with <linux/compat.h>
- */
-#ifdef dev_dbg
-#undef dev_dbg
-#endif
-#ifdef dev_vdbg
-#undef dev_vdbg
-#endif
-#ifdef dev_info
-#undef dev_info
-#endif
-#ifdef dev_err
-#undef dev_err
-#endif
-#ifdef dev_warn
-#undef dev_warn
-#endif
-
-/*
* Define a new identifier which can be tested on by C code. A similar
* definition is made for DEBUG in <log.h>.
*/
diff --git a/include/dm/of.h b/include/dm/of.h
index 6bef73b441c..5cb6f44a6c6 100644
--- a/include/dm/of.h
+++ b/include/dm/of.h
@@ -90,17 +90,10 @@ DECLARE_GLOBAL_DATA_PTR;
*
* @returns true if livetree is active, false it not
*/
-#ifdef CONFIG_OF_LIVE
static inline bool of_live_active(void)
{
- return gd->of_root != NULL;
+ return gd_of_root() != NULL;
}
-#else
-static inline bool of_live_active(void)
-{
- return false;
-}
-#endif
#define OF_BAD_ADDR ((u64)-1)
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 4b7af370560..ced7f6ffb25 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -605,6 +605,28 @@ 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
+ *
+ * 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
+ * @return property value if found, else NULL
+ */
+const void *ofnode_read_aliases_prop(const char *propname, int *sizep);
+
+/**
+ * ofnode_get_aliases_node() - get a referenced node from the aliases node
+ *
+ * This looks up a named property in the aliases node and uses that as a path to
+ * look up a code.
+ *
+ * @return the referenced node if present, else ofnode_null()
+ */
+ofnode ofnode_get_aliases_node(const char *propname);
+
struct display_timing;
/**
* ofnode_decode_display_timing() - decode display timings
diff --git a/include/dm/pinctrl.h b/include/dm/pinctrl.h
index 692e5fc8cbf..1bdc8d3cbd7 100644
--- a/include/dm/pinctrl.h
+++ b/include/dm/pinctrl.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
- * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+ * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@com>
*/
#ifndef __PINCTRL_H
@@ -11,11 +11,10 @@
/**
* struct pinconf_param - pin config parameters
- *
- * @property: property name in DT nodes
- * @param: ID for this config parameter
- * @default_value: default value for this config parameter used in case
- * no value is specified in DT nodes
+ * @property: Property name in DT nodes
+ * @param: ID for this config parameter
+ * @default_value: default value for this config parameter used in case
+ * no value is specified in DT nodes
*/
struct pinconf_param {
const char * const property;
@@ -27,106 +26,274 @@ struct pinconf_param {
* struct pinctrl_ops - pin control operations, to be implemented by
* pin controller drivers.
*
- * The @set_state is the only mandatory operation. You can implement your
- * pinctrl driver with its own @set_state. In this case, the other callbacks
- * are not required. Otherwise, generic pinctrl framework is also available;
- * use pinctrl_generic_set_state for @set_state, and implement other operations
+ * set_state() is the only mandatory operation. You can implement your pinctrl
+ * driver with its own @set_state. In this case, the other callbacks are not
+ * required. Otherwise, generic pinctrl framework is also available; use
+ * pinctrl_generic_set_state for @set_state, and implement other operations
* depending on your necessity.
- *
- * @get_pins_count: return number of selectable named pins available
- * in this driver. (necessary to parse "pins" property in DTS)
- * @get_pin_name: return the pin name of the pin selector,
- * called by the core to figure out which pin it shall do
- * operations to. (necessary to parse "pins" property in DTS)
- * @get_groups_count: return number of selectable named groups available
- * in this driver. (necessary to parse "groups" property in DTS)
- * @get_group_name: return the group name of the group selector,
- * called by the core to figure out which pin group it shall do
- * operations to. (necessary to parse "groups" property in DTS)
- * @get_functions_count: return number of selectable named functions available
- * in this driver. (necessary for pin-muxing)
- * @get_function_name: return the function name of the muxing selector,
- * called by the core to figure out which mux setting it shall map a
- * certain device to. (necessary for pin-muxing)
- * @pinmux_set: enable a certain muxing function with a certain pin.
- * The @func_selector selects a certain function whereas @pin_selector
- * selects a certain pin to be used. On simple controllers one of them
- * may be ignored. (necessary for pin-muxing against a single pin)
- * @pinmux_group_set: enable a certain muxing function with a certain pin
- * group. The @func_selector selects a certain function whereas
- * @group_selector selects a certain set of pins to be used. On simple
- * controllers one of them may be ignored.
- * (necessary for pin-muxing against a pin group)
- * @pinconf_num_params: number of driver-specific parameters to be parsed
- * from device trees (necessary for pin-configuration)
- * @pinconf_params: list of driver_specific parameters to be parsed from
- * device trees (necessary for pin-configuration)
- * @pinconf_set: configure an individual pin with a given parameter.
- * (necessary for pin-configuration against a single pin)
- * @pinconf_group_set: configure all pins in a group with a given parameter.
- * (necessary for pin-configuration against a pin group)
- * @set_state: do pinctrl operations specified by @config, a pseudo device
- * pointing a config node. (necessary for pinctrl_full)
- * @set_state_simple: do needed pinctrl operations for a peripherl @periph.
- * (necessary for pinctrl_simple)
- * @get_pin_muxing: display the muxing of a given pin.
- * @gpio_request_enable: requests and enables GPIO on a certain pin.
- * Implement this only if you can mux every pin individually as GPIO. The
- * affected GPIO range is passed along with an offset(pin number) into that
- * specific GPIO range - function selectors and pin groups are orthogonal
- * to this, the core will however make sure the pins do not collide.
- * @gpio_disable_free: free up GPIO muxing on a certain pin, the reverse of
- * @gpio_request_enable
*/
struct pinctrl_ops {
+ /**
+ * @get_pins_count: Get the number of selectable pins
+ *
+ * @dev: Pinctrl device to use
+ *
+ * This function is necessary to parse the "pins" property in DTS.
+ *
+ * @Return:
+ * number of selectable named pins available in this driver
+ */
int (*get_pins_count)(struct udevice *dev);
+
+ /**
+ * @get_pin_name: Get the name of a pin
+ *
+ * @dev: Pinctrl device of the pin
+ *
+ * @selector: The pin selector
+ *
+ * This function is called by the core to figure out which pin it will
+ * do operations to. This function is necessary to parse the "pins"
+ * property in DTS.
+ *
+ * @Return: const pointer to the name of the pin
+ */
const char *(*get_pin_name)(struct udevice *dev, unsigned selector);
+
+ /**
+ * @get_groups_count: Get the number of selectable groups
+ *
+ * @dev: Pinctrl device to use
+ *
+ * This function is necessary to parse the "groups" property in DTS.
+ *
+ * @Return:
+ * number of selectable named groups available in the driver
+ */
int (*get_groups_count)(struct udevice *dev);
+
+ /**
+ * @get_group_name: Get the name of a group
+ *
+ * @dev: Pinctrl device of the group
+ *
+ * @selector: The group selector
+ *
+ * This function is called by the core to figure out which group it
+ * will do operations to. This function is necessary to parse the
+ * "groups" property in DTS.
+ *
+ * @Return: Pointer to the name of the group
+ */
const char *(*get_group_name)(struct udevice *dev, unsigned selector);
+
+ /**
+ * @get_functions_count: Get the number of selectable functions
+ *
+ * @dev: Pinctrl device to use
+ *
+ * This function is necessary for pin-muxing.
+ *
+ * @Return:
+ * number of selectable named functions available in this driver
+ */
int (*get_functions_count)(struct udevice *dev);
+
+ /**
+ * @get_function_name: Get the name of a function
+ *
+ * @dev: Pinmux device of the function
+ *
+ * @selector: The function selector
+ *
+ * This function is called by the core to figure out which mux setting
+ * it will map a certain device to. This function is necessary for
+ * pin-muxing.
+ *
+ * @Return:
+ * Pointer to the function name of the muxing selector
+ */
const char *(*get_function_name)(struct udevice *dev,
unsigned selector);
+
+ /**
+ * @pinmux_set: Mux a pin to a function
+ *
+ * @dev: Pinctrl device to use
+ *
+ * @pin_selector: The pin selector
+ *
+ * @func_selector: The func selector
+ *
+ * On simple controllers one of @pin_selector or @func_selector may be
+ * ignored. This function is necessary for pin-muxing against a single
+ * pin.
+ *
+ * @Return: 0 if OK, or negative error code on failure
+ */
int (*pinmux_set)(struct udevice *dev, unsigned pin_selector,
unsigned func_selector);
+
+ /**
+ * @pinmux_group_set: Mux a group of pins to a function
+ *
+ * @dev: Pinctrl device to use
+ *
+ * @group_selector: The group selector
+ *
+ * @func_selector: The func selector
+ *
+ * On simple controllers one of @group_selector or @func_selector may be
+ * ignored. This function is necessary for pin-muxing against a group of
+ * pins.
+ *
+ * @Return: 0 if OK, or negative error code on failure
+ */
int (*pinmux_group_set)(struct udevice *dev, unsigned group_selector,
unsigned func_selector);
+
+ /**
+ * @pinmux_property_set: Enable a pinmux group
+ *
+ * @dev: Pinctrl device to use
+ *
+ * @pinmux_group: A u32 representing the pin identifier and mux
+ * settings. The exact format of a pinmux group is left
+ * up to the driver.
+ *
+ * Mux a single pin to a single function based on a driver-specific
+ * pinmux group. This function is necessary for parsing the "pinmux"
+ * property in DTS, and for pin-muxing against a pinmux group.
+ *
+ * @Return:
+ * Pin selector for the muxed pin if OK, or negative error code on
+ * failure
+ */
+ int (*pinmux_property_set)(struct udevice *dev, u32 pinmux_group);
+
+ /**
+ * @pinconf_num_params:
+ * Number of driver-specific parameters to be parsed from device
+ * trees. This member is necessary for pin configuration.
+ */
unsigned int pinconf_num_params;
+
+ /**
+ * @pinconf_params:
+ * List of driver-specific parameters to be parsed from the device
+ * tree. This member is necessary for pin configuration.
+ */
const struct pinconf_param *pinconf_params;
+
+ /**
+ * @pinconf_set: Configure an individual pin with a parameter
+ *
+ * @dev: Pinctrl device to use
+ *
+ * @pin_selector: The pin selector
+ *
+ * @param: An &enum pin_config_param from @pinconf_params
+ *
+ * @argument: The argument to this param from the device tree, or
+ * @pinconf_params.default_value
+ *
+ * This function is necessary for pin configuration against a single
+ * pin.
+ *
+ * @Return: 0 if OK, or negative error code on failure
+ */
int (*pinconf_set)(struct udevice *dev, unsigned pin_selector,
unsigned param, unsigned argument);
+
+ /**
+ * @pinconf_group_set: Configure all pins in a group with a parameter
+ *
+ * @dev: Pinctrl device to use
+ *
+ * @pin_selector: The group selector
+ *
+ * @param: A &enum pin_config_param from
+ * @pinconf_params
+ *
+ * @argument: The argument to this param from the device tree, or
+ * @pinconf_params.default_value
+ *
+ * This function is necessary for pin configuration against a group of
+ * pins.
+ *
+ * @Return: 0 if OK, or negative error code on failure
+ */
int (*pinconf_group_set)(struct udevice *dev, unsigned group_selector,
unsigned param, unsigned argument);
+
+ /**
+ * @set_state: Configure a pinctrl device
+ *
+ * @dev: Pinctrl device to use
+ *
+ * @config: Pseudo device pointing a config node
+ *
+ * This function is required to be implemented by all pinctrl drivers.
+ * Drivers may set this member to pinctrl_generic_set_state(), which
+ * will call other functions in &struct pinctrl_ops to parse
+ * @config.
+ *
+ * @Return: 0 if OK, or negative error code on failure
+ */
int (*set_state)(struct udevice *dev, struct udevice *config);
- /* for pinctrl-simple */
+ /**
+ * @set_state_simple: Configure a pinctrl device
+ *
+ * @dev: Pinctrl device to use
+ *
+ * @config: Pseudo-device pointing a config node
+ *
+ * This function is usually a simpler version of set_state(). Only the
+ * first pinctrl device on the system is supported by this function.
+ *
+ * @Return: 0 if OK, or negative error code on failure
+ */
int (*set_state_simple)(struct udevice *dev, struct udevice *periph);
+
/**
- * request() - Request a particular pinctrl function
+ * @request: Request a particular pinctrl function
+ *
+ * @dev: Device to adjust (%UCLASS_PINCTRL)
+ *
+ * @func: Function number (driver-specific)
*
* This activates the selected function.
*
- * @dev: Device to adjust (UCLASS_PINCTRL)
- * @func: Function number (driver-specific)
- * @return 0 if OK, -ve on error
+ * @Return: 0 if OK, or negative error code on failure
*/
int (*request)(struct udevice *dev, int func, int flags);
/**
- * get_periph_id() - get the peripheral ID for a device
+ * @get_periph_id: Get the peripheral ID for a device
+ *
+ * @dev: Pinctrl device to use for decoding
+ *
+ * @periph: Device to check
*
* This generally looks at the peripheral's device tree node to work
* out the peripheral ID. The return value is normally interpreted as
- * enum periph_id. so long as this is defined by the platform (which it
+ * &enum periph_id. so long as this is defined by the platform (which it
* should be).
*
- * @dev: Pinctrl device to use for decoding
- * @periph: Device to check
- * @return peripheral ID of @periph, or -ENOENT on error
+ * @Return:
+ * Peripheral ID of @periph, or %-ENOENT on error
*/
int (*get_periph_id)(struct udevice *dev, struct udevice *periph);
/**
- * get_gpio_mux() - get the mux value for a particular GPIO
+ * @get_gpio_mux: Get the mux value for a particular GPIO
+ *
+ * @dev: Pinctrl device to use
+ *
+ * @banknum: GPIO bank number
+ *
+ * @index: GPIO index within the bank
*
* This allows the raw mux value for a GPIO to be obtained. It is
* useful for displaying the function being used by that GPIO, such
@@ -134,46 +301,60 @@ struct pinctrl_ops {
* subsystem and should not be used by generic code. Typically it is
* used by a GPIO driver with knowledge of the SoC pinctrl setup.
*
- * @dev: Pinctrl device to use
- * @banknum: GPIO bank number
- * @index: GPIO index within the bank
- * @return mux value (SoC-specific, e.g. 0 for input, 1 for output)
+ * @Return:
+ * Mux value (SoC-specific, e.g. 0 for input, 1 for output)
*/
int (*get_gpio_mux)(struct udevice *dev, int banknum, int index);
/**
- * get_pin_muxing() - show pin muxing
+ * @get_pin_muxing: Show pin muxing
+ *
+ * @dev: Pinctrl device to use
+ *
+ * @selector: Pin selector
+ *
+ * @buf: Buffer to fill with pin muxing description
+ *
+ * @size: Size of @buf
*
* This allows to display the muxing of a given pin. It's useful for
- * debug purpose to know if a pin is configured as GPIO or as an
- * alternate function and which one.
- * Typically it is used by a PINCTRL driver with knowledge of the SoC
- * pinctrl setup.
- *
- * @dev: Pinctrl device to use
- * @selector: Pin selector
- * @buf Pin's muxing description
- * @size Pin's muxing description length
- * return 0 if OK, -ve on error
+ * debug purposes to know if a pin is configured as GPIO or as an
+ * alternate function and which one. Typically it is used by a PINCTRL
+ * driver with knowledge of the SoC pinctrl setup.
+ *
+ * @Return: 0 if OK, or negative error code on failure
*/
int (*get_pin_muxing)(struct udevice *dev, unsigned int selector,
char *buf, int size);
/**
- * gpio_request_enable: requests and enables GPIO on a certain pin.
+ * @gpio_request_enable: Request and enable GPIO on a certain pin.
+ *
+ * @dev: Pinctrl device to use
+ *
+ * @selector: Pin selector
+ *
+ * Implement this only if you can mux every pin individually as GPIO.
+ * The affected GPIO range is passed along with an offset(pin number)
+ * into that specific GPIO range - function selectors and pin groups are
+ * orthogonal to this, the core will however make sure the pins do not
+ * collide.
*
- * @dev: Pinctrl device to use
- * @selector: Pin selector
- * return 0 if OK, -ve on error
+ * @Return:
+ * 0 if OK, or negative error code on failure
*/
int (*gpio_request_enable)(struct udevice *dev, unsigned int selector);
/**
- * gpio_disable_free: free up GPIO muxing on a certain pin.
+ * @gpio_disable_free: Free up GPIO muxing on a certain pin.
*
- * @dev: Pinctrl device to use
- * @selector: Pin selector
- * return 0 if OK, -ve on error
+ * @dev: Pinctrl device to use
+ *
+ * @selector: Pin selector
+ *
+ * This function is the reverse of @gpio_request_enable.
+ *
+ * @Return: 0 if OK, or negative error code on failure
*/
int (*gpio_disable_free)(struct udevice *dev, unsigned int selector);
};
@@ -181,27 +362,26 @@ struct pinctrl_ops {
#define pinctrl_get_ops(dev) ((struct pinctrl_ops *)(dev)->driver->ops)
/**
- * Generic pin configuration paramters
+ * enum pin_config_param - Generic pin configuration parameters
*
- * enum pin_config_param - possible pin configuration parameters
- * @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it
+ * @PIN_CONFIG_BIAS_BUS_HOLD: The pin will be set to weakly latch so that it
* weakly drives the last value on a tristate bus, also known as a "bus
* holder", "bus keeper" or "repeater". This allows another device on the
* bus to change the value by driving the bus high or low and switching to
* tristate. The argument is ignored.
- * @PIN_CONFIG_BIAS_DISABLE: disable any pin bias on the pin, a
+ * @PIN_CONFIG_BIAS_DISABLE: Disable any pin bias on the pin, a
* transition from say pull-up to pull-down implies that you disable
* pull-up in the process, this setting disables all biasing.
- * @PIN_CONFIG_BIAS_HIGH_IMPEDANCE: the pin will be set to a high impedance
+ * @PIN_CONFIG_BIAS_HIGH_IMPEDANCE: The pin will be set to a high impedance
* mode, also know as "third-state" (tristate) or "high-Z" or "floating".
* On output pins this effectively disconnects the pin, which is useful
* if for example some other pin is going to drive the signal connected
* to it for a while. Pins used for input are usually always high
* impedance.
- * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high
+ * @PIN_CONFIG_BIAS_PULL_DOWN: The pin will be pulled down (usually with high
* impedance to GROUND). If the argument is != 0 pull-down is enabled,
* if it is 0, pull-down is total, i.e. the pin is connected to GROUND.
- * @PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: the pin will be pulled up or down based
+ * @PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: The pin will be pulled up or down based
* on embedded knowledge of the controller hardware, like current mux
* function. The pull direction and possibly strength too will normally
* be decided completely inside the hardware block and not be readable
@@ -209,67 +389,67 @@ struct pinctrl_ops {
* If the argument is != 0 pull up/down is enabled, if it is 0, the
* configuration is ignored. The proper way to disable it is to use
* @PIN_CONFIG_BIAS_DISABLE.
- * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high
+ * @PIN_CONFIG_BIAS_PULL_UP: The pin will be pulled up (usually with high
* impedance to VDD). If the argument is != 0 pull-up is enabled,
* if it is 0, pull-up is total, i.e. the pin is connected to VDD.
- * @PIN_CONFIG_DRIVE_OPEN_DRAIN: the pin will be driven with open drain (open
+ * @PIN_CONFIG_DRIVE_OPEN_DRAIN: The pin will be driven with open drain (open
* collector) which means it is usually wired with other output ports
* which are then pulled up with an external resistor. Setting this
* config will enable open drain mode, the argument is ignored.
- * @PIN_CONFIG_DRIVE_OPEN_SOURCE: the pin will be driven with open source
+ * @PIN_CONFIG_DRIVE_OPEN_SOURCE: The pin will be driven with open source
* (open emitter). Setting this config will enable open source mode, the
* argument is ignored.
- * @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and
+ * @PIN_CONFIG_DRIVE_PUSH_PULL: The pin will be driven actively high and
* low, this is the most typical case and is typically achieved with two
* active transistors on the output. Setting this config will enable
* push-pull mode, the argument is ignored.
- * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current
+ * @PIN_CONFIG_DRIVE_STRENGTH: The pin will sink or source at most the current
* passed as argument. The argument is in mA.
- * @PIN_CONFIG_DRIVE_STRENGTH_UA: the pin will sink or source at most the current
- * passed as argument. The argument is in uA.
- * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode,
+ * @PIN_CONFIG_DRIVE_STRENGTH_UA: The pin will sink or source at most the
+ * current passed as argument. The argument is in uA.
+ * @PIN_CONFIG_INPUT_DEBOUNCE: This will configure the pin to debounce mode,
* which means it will wait for signals to settle when reading inputs. The
* argument gives the debounce time in usecs. Setting the
* argument to zero turns debouncing off.
- * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not
+ * @PIN_CONFIG_INPUT_ENABLE: Enable the pin's input. Note that this does not
* affect the pin's ability to drive output. 1 enables input, 0 disables
* input.
- * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in
+ * @PIN_CONFIG_INPUT_SCHMITT: This will configure an input pin to run in
* schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis,
* the threshold value is given on a custom format as argument when
* setting pins to this mode.
- * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin.
+ * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: Control schmitt-trigger mode on the pin.
* If the argument != 0, schmitt-trigger mode is enabled. If it's 0,
* schmitt-trigger mode is disabled.
- * @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power
+ * @PIN_CONFIG_LOW_POWER_MODE: This will configure the pin for low power
* operation, if several modes of operation are supported these can be
* passed in the argument on a custom form, else just use argument 1
* to indicate low power mode, argument 0 turns low power mode off.
- * @PIN_CONFIG_OUTPUT_ENABLE: this will enable the pin's output mode
+ * @PIN_CONFIG_OUTPUT_ENABLE: This will enable the pin's output mode
* without driving a value there. For most platforms this reduces to
* enable the output buffers and then let the pin controller current
* configuration (eg. the currently selected mux function) drive values on
* the line. Use argument 1 to enable output mode, argument 0 to disable
* it.
- * @PIN_CONFIG_OUTPUT: this will configure the pin as an output and drive a
+ * @PIN_CONFIG_OUTPUT: This will configure the pin as an output and drive a
* value on the line. Use argument 1 to indicate high level, argument 0 to
* indicate low level. (Please see Documentation/driver-api/pinctl.rst,
* section "GPIO mode pitfalls" for a discussion around this parameter.)
- * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power
+ * @PIN_CONFIG_POWER_SOURCE: If the pin can select between different power
* supplies, the argument to this parameter (on a custom format) tells
* the driver which alternative power source to use.
- * @PIN_CONFIG_SLEEP_HARDWARE_STATE: indicate this is sleep related state.
- * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to
+ * @PIN_CONFIG_SLEEP_HARDWARE_STATE: Indicate this is sleep related state.
+ * @PIN_CONFIG_SLEW_RATE: If the pin can select slew rate, the argument to
* this parameter (on a custom format) tells the driver which alternative
* slew rate to use.
- * @PIN_CONFIG_SKEW_DELAY: if the pin has programmable skew rate (on inputs)
+ * @PIN_CONFIG_SKEW_DELAY: If the pin has programmable skew rate (on inputs)
* or latch delay (on outputs) this parameter (in a custom format)
* specifies the clock skew or latch delay. It typically controls how
* many double inverters are put in front of the line.
- * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if
+ * @PIN_CONFIG_END: This is the last enumerator for pin configurations, if
* you need to pass in custom configurations to the pin controller, use
* PIN_CONFIG_END+1 as the base offset.
- * @PIN_CONFIG_MAX: this is the maximum configuration value that can be
+ * @PIN_CONFIG_MAX: This is the maximum configuration value that can be
* presented using the packed format.
*/
enum pin_config_param {
@@ -301,13 +481,14 @@ enum pin_config_param {
#if CONFIG_IS_ENABLED(PINCTRL_GENERIC)
/**
- * pinctrl_generic_set_state() - generic set_state operation
+ * pinctrl_generic_set_state() - Generic set_state operation
+ * @pctldev: Pinctrl device to use
+ * @config: Config device (pseudo device), pointing a config node in DTS
+ *
* Parse the DT node of @config and its children and handle generic properties
* such as "pins", "groups", "functions", and pin configuration parameters.
*
- * @pctldev: pinctrl device
- * @config: config device (pseudo device), pointing a config node in DTS
- * @return: 0 on success, or negative error code on failure
+ * Return: 0 on success, or negative error code on failure
*/
int pinctrl_generic_set_state(struct udevice *pctldev, struct udevice *config);
#else
@@ -320,11 +501,11 @@ static inline int pinctrl_generic_set_state(struct udevice *pctldev,
#if CONFIG_IS_ENABLED(PINCTRL)
/**
- * pinctrl_select_state() - set a device to a given state
+ * pinctrl_select_state() - Set a device to a given state
+ * @dev: Peripheral device
+ * @statename: State name, like "default"
*
- * @dev: peripheral device
- * @statename: state name, like "default"
- * @return: 0 on success, or negative error code on failure
+ * Return: 0 on success, or negative error code on failure
*/
int pinctrl_select_state(struct udevice *dev, const char *statename);
#else
@@ -337,40 +518,43 @@ static inline int pinctrl_select_state(struct udevice *dev,
/**
* pinctrl_request() - Request a particular pinctrl function
- *
- * @dev: Device to check (UCLASS_PINCTRL)
+ * @dev: Pinctrl device to use
* @func: Function number (driver-specific)
* @flags: Flags (driver-specific)
- * @return 0 if OK, -ve on error
+ *
+ * Return: 0 if OK, or negative error code on failure
*/
int pinctrl_request(struct udevice *dev, int func, int flags);
/**
* pinctrl_request_noflags() - Request a particular pinctrl function
+ * @dev: Pinctrl device to use
+ * @func: Function number (driver-specific)
*
* This is similar to pinctrl_request() but uses 0 for @flags.
*
- * @dev: Device to check (UCLASS_PINCTRL)
- * @func: Function number (driver-specific)
- * @return 0 if OK, -ve on error
+ * Return: 0 if OK, or negative error code on failure
*/
int pinctrl_request_noflags(struct udevice *dev, int func);
/**
- * pinctrl_get_periph_id() - get the peripheral ID for a device
+ * pinctrl_get_periph_id() - Get the peripheral ID for a device
+ * @dev: Pinctrl device to use for decoding
+ * @periph: Device to check
*
* This generally looks at the peripheral's device tree node to work out the
* peripheral ID. The return value is normally interpreted as enum periph_id.
* so long as this is defined by the platform (which it should be).
*
- * @dev: Pinctrl device to use for decoding
- * @periph: Device to check
- * @return peripheral ID of @periph, or -ENOENT on error
+ * Return: Peripheral ID of @periph, or -ENOENT on error
*/
int pinctrl_get_periph_id(struct udevice *dev, struct udevice *periph);
/**
* pinctrl_get_gpio_mux() - get the mux value for a particular GPIO
+ * @dev: Pinctrl device to use
+ * @banknum: GPIO bank number
+ * @index: GPIO index within the bank
*
* This allows the raw mux value for a GPIO to be obtained. It is
* useful for displaying the function being used by that GPIO, such
@@ -378,66 +562,64 @@ int pinctrl_get_periph_id(struct udevice *dev, struct udevice *periph);
* subsystem and should not be used by generic code. Typically it is
* used by a GPIO driver with knowledge of the SoC pinctrl setup.
*
- * @dev: Pinctrl device to use
- * @banknum: GPIO bank number
- * @index: GPIO index within the bank
- * @return mux value (SoC-specific, e.g. 0 for input, 1 for output)
+ * Return: Mux value (SoC-specific, e.g. 0 for input, 1 for output)
*/
int pinctrl_get_gpio_mux(struct udevice *dev, int banknum, int index);
/**
* pinctrl_get_pin_muxing() - Returns the muxing description
+ * @dev: Pinctrl device to use
+ * @selector: Pin index within pin-controller
+ * @buf: Pin's muxing description
+ * @size: Pin's muxing description length
*
* This allows to display the muxing description of the given pin for
* debug purpose
*
- * @dev: Pinctrl device to use
- * @selector Pin index within pin-controller
- * @buf Pin's muxing description
- * @size Pin's muxing description length
- * @return 0 if OK, -ve on error
+ * Return: 0 if OK, or negative error code on failure
*/
int pinctrl_get_pin_muxing(struct udevice *dev, int selector, char *buf,
int size);
/**
- * pinctrl_get_pins_count() - display pin-controller pins number
+ * pinctrl_get_pins_count() - Display pin-controller pins number
+ * @dev: Pinctrl device to use
*
* This allows to know the number of pins owned by a given pin-controller
*
- * @dev: Pinctrl device to use
- * @return pins number if OK, -ve on error
+ * Return: Number of pins if OK, or negative error code on failure
*/
int pinctrl_get_pins_count(struct udevice *dev);
/**
* pinctrl_get_pin_name() - Returns the pin's name
+ * @dev: Pinctrl device to use
+ * @selector: Pin index within pin-controller
+ * @buf: Buffer to fill with the name of the pin
+ * @size: Size of @buf
*
* This allows to display the pin's name for debug purpose
*
- * @dev: Pinctrl device to use
- * @selector Pin index within pin-controller
- * @buf Pin's name
- * @return 0 if OK, -ve on error
+ * Return: 0 if OK, or negative error code on failure
*/
int pinctrl_get_pin_name(struct udevice *dev, int selector, char *buf,
int size);
/**
- * pinctrl_gpio_request() - request a single pin to be used as GPIO
+ * pinctrl_gpio_request() - Request a single pin to be used as GPIO
+ * @dev: GPIO peripheral device
+ * @offset: GPIO pin offset from the GPIO controller
*
- * @dev: GPIO peripheral device
- * @offset: the GPIO pin offset from the GPIO controller
- * @return: 0 on success, or negative error code on failure
+ * Return: 0 on success, or negative error code on failure
*/
int pinctrl_gpio_request(struct udevice *dev, unsigned offset);
/**
- * pinctrl_gpio_free() - free a single pin used as GPIO
+ * pinctrl_gpio_free() - Free a single pin used as GPIO
+ * @dev: GPIO peripheral device
+ * @offset: GPIO pin offset from the GPIO controller
*
- * @dev: GPIO peripheral device
- * @offset: the GPIO pin offset from the GPIO controller
- * @return: 0 on success, or negative error code on failure
+ * Return: 0 on success, or negative error code on failure
*/
int pinctrl_gpio_free(struct udevice *dev, unsigned offset);
diff --git a/include/dm/platdata.h b/include/dm/platdata.h
index cab93b071ba..216efa8ef77 100644
--- a/include/dm/platdata.h
+++ b/include/dm/platdata.h
@@ -22,30 +22,71 @@
* @name: Driver name
* @platdata: Driver-specific platform data
* @platdata_size: Size of platform data structure
- * @dev: Device created from this structure data
+ * @parent_idx: Index of the parent driver_info structure
*/
struct driver_info {
const char *name;
const void *platdata;
#if CONFIG_IS_ENABLED(OF_PLATDATA)
- uint platdata_size;
- struct udevice *dev;
+ unsigned short platdata_size;
+ short parent_idx;
#endif
};
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+#define driver_info_parent_id(driver_info) driver_info->parent_idx
+#else
+#define driver_info_parent_id(driver_info) (-1)
+#endif
+
+/**
+ * driver_rt - runtime information set up by U-Boot
+ *
+ * There is one of these for every driver_info in the linker list, indexed by
+ * the driver_info idx value.
+ *
+ * @dev: Device created from this idx
+ */
+struct driver_rt {
+ struct udevice *dev;
+};
+
/**
* NOTE: Avoid using these except in extreme circumstances, where device tree
* is not feasible (e.g. serial driver in SPL where <8KB of SRAM is
* available). U-Boot's driver model uses device tree for configuration.
+ *
+ * When of-platdata is in use, U_BOOT_DEVICE() cannot be used outside of the
+ * dt-platdata.c file created by dtoc
*/
+#if CONFIG_IS_ENABLED(OF_PLATDATA) && !defined(DT_PLATDATA_C)
+#define U_BOOT_DEVICE(__name) _Static_assert(false, \
+ "Cannot use U_BOOT_DEVICE with of-platdata. Please use devicetree instead")
+#else
#define U_BOOT_DEVICE(__name) \
ll_entry_declare(struct driver_info, __name, driver_info)
+#endif
/* Declare a list of devices. The argument is a driver_info[] array */
#define U_BOOT_DEVICES(__name) \
ll_entry_declare_list(struct driver_info, __name, driver_info)
-/* Get a pointer to a given driver */
+/**
+ * Get a pointer to a given device info given its name
+ *
+ * With the declaration U_BOOT_DEVICE(name), DM_GET_DEVICE(name) will return a
+ * pointer to the struct driver_info created by that declaration.
+ *
+ * if OF_PLATDATA is enabled, from this it is possible to use the @dev member of
+ * struct driver_info to find the device pointer itself.
+ *
+ * TODO(sjg@chromium.org): U_BOOT_DEVICE() tells U-Boot to create a device, so
+ * the naming seems sensible, but DM_GET_DEVICE() is a bit of misnomer, since it
+ * finds the driver_info record, not the device.
+ *
+ * @__name: Driver name (C identifier, not a string. E.g. gpio7_at_ff7e0000)
+ * @return struct driver_info * to the driver that created the device
+ */
#define DM_GET_DEVICE(__name) \
ll_entry_get(struct driver_info, __name, driver_info)
diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h
index 88f10c46221..17542de2f36 100644
--- a/include/dm/uclass-id.h
+++ b/include/dm/uclass-id.h
@@ -71,6 +71,7 @@ enum uclass_id {
UCLASS_MMC, /* SD / MMC card or chip */
UCLASS_MOD_EXP, /* RSA Mod Exp device */
UCLASS_MTD, /* Memory Technology Device (MTD) device */
+ UCLASS_MUX, /* Multiplexer device */
UCLASS_NOP, /* No-op devices */
UCLASS_NORTHBRIDGE, /* Intel Northbridge / SDRAM controller */
UCLASS_NVME, /* NVM Express device */
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index 67ff7466c86..71883043046 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -224,7 +224,8 @@ int uclass_get_device_by_ofnode(enum uclass_id id, ofnode node,
*
* @id: uclass ID to look up
* @phandle_id: the phandle id to look up
- * @devp: Returns pointer to device (there is only one for each node)
+ * @devp: Returns pointer to device (there is only one for each node). NULL if
+ * there is no such device.
* @return 0 if OK, -ENODEV if there is no device match the phandle, other
* -ve on error
*/
diff --git a/include/dm/util.h b/include/dm/util.h
index 9773db6de17..01a044992f2 100644
--- a/include/dm/util.h
+++ b/include/dm/util.h
@@ -6,7 +6,7 @@
#ifndef __DM_UTIL_H
#define __DM_UTIL_H
-#ifdef CONFIG_DM_WARN
+#if CONFIG_IS_ENABLED(DM_WARN)
void dm_warn(const char *fmt, ...);
#else
static inline void dm_warn(const char *fmt, ...)
diff --git a/include/dt-bindings/clock/r8a774c0-cpg-mssr.h b/include/dt-bindings/clock/r8a774c0-cpg-mssr.h
new file mode 100644
index 00000000000..9db5c76e23f
--- /dev/null
+++ b/include/dt-bindings/clock/r8a774c0-cpg-mssr.h
@@ -0,0 +1,61 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Renesas Electronics Corp.
+ */
+#ifndef __DT_BINDINGS_CLOCK_R8A774C0_CPG_MSSR_H__
+#define __DT_BINDINGS_CLOCK_R8A774C0_CPG_MSSR_H__
+
+#include <dt-bindings/clock/renesas-cpg-mssr.h>
+
+/* r8a774c0 CPG Core Clocks */
+#define R8A774C0_CLK_Z2 0
+#define R8A774C0_CLK_ZG 1
+#define R8A774C0_CLK_ZTR 2
+#define R8A774C0_CLK_ZT 3
+#define R8A774C0_CLK_ZX 4
+#define R8A774C0_CLK_S0D1 5
+#define R8A774C0_CLK_S0D3 6
+#define R8A774C0_CLK_S0D6 7
+#define R8A774C0_CLK_S0D12 8
+#define R8A774C0_CLK_S0D24 9
+#define R8A774C0_CLK_S1D1 10
+#define R8A774C0_CLK_S1D2 11
+#define R8A774C0_CLK_S1D4 12
+#define R8A774C0_CLK_S2D1 13
+#define R8A774C0_CLK_S2D2 14
+#define R8A774C0_CLK_S2D4 15
+#define R8A774C0_CLK_S3D1 16
+#define R8A774C0_CLK_S3D2 17
+#define R8A774C0_CLK_S3D4 18
+#define R8A774C0_CLK_S0D6C 19
+#define R8A774C0_CLK_S3D1C 20
+#define R8A774C0_CLK_S3D2C 21
+#define R8A774C0_CLK_S3D4C 22
+#define R8A774C0_CLK_LB 23
+#define R8A774C0_CLK_CL 24
+#define R8A774C0_CLK_ZB3 25
+#define R8A774C0_CLK_ZB3D2 26
+#define R8A774C0_CLK_CR 27
+#define R8A774C0_CLK_CRD2 28
+#define R8A774C0_CLK_SD0H 29
+#define R8A774C0_CLK_SD0 30
+#define R8A774C0_CLK_SD1H 31
+#define R8A774C0_CLK_SD1 32
+#define R8A774C0_CLK_SD3H 33
+#define R8A774C0_CLK_SD3 34
+#define R8A774C0_CLK_RPC 35
+#define R8A774C0_CLK_RPCD2 36
+#define R8A774C0_CLK_ZA2 37
+#define R8A774C0_CLK_ZA8 38
+#define R8A774C0_CLK_Z2D 39
+#define R8A774C0_CLK_MSO 40
+#define R8A774C0_CLK_R 41
+#define R8A774C0_CLK_OSC 42
+#define R8A774C0_CLK_LV0 43
+#define R8A774C0_CLK_LV1 44
+#define R8A774C0_CLK_CSI0 45
+#define R8A774C0_CLK_CP 46
+#define R8A774C0_CLK_CPEX 47
+#define R8A774C0_CLK_CANFD 48
+
+#endif /* __DT_BINDINGS_CLOCK_R8A774C0_CPG_MSSR_H__ */
diff --git a/include/dt-bindings/clock/xlnx-versal-clk.h b/include/dt-bindings/clock/xlnx-versal-clk.h
new file mode 100644
index 00000000000..264d634d226
--- /dev/null
+++ b/include/dt-bindings/clock/xlnx-versal-clk.h
@@ -0,0 +1,123 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Xilinx Inc.
+ *
+ */
+
+#ifndef _DT_BINDINGS_CLK_VERSAL_H
+#define _DT_BINDINGS_CLK_VERSAL_H
+
+#define PMC_PLL 1
+#define APU_PLL 2
+#define RPU_PLL 3
+#define CPM_PLL 4
+#define NOC_PLL 5
+#define PLL_MAX 6
+#define PMC_PRESRC 7
+#define PMC_POSTCLK 8
+#define PMC_PLL_OUT 9
+#define PPLL 10
+#define NOC_PRESRC 11
+#define NOC_POSTCLK 12
+#define NOC_PLL_OUT 13
+#define NPLL 14
+#define APU_PRESRC 15
+#define APU_POSTCLK 16
+#define APU_PLL_OUT 17
+#define APLL 18
+#define RPU_PRESRC 19
+#define RPU_POSTCLK 20
+#define RPU_PLL_OUT 21
+#define RPLL 22
+#define CPM_PRESRC 23
+#define CPM_POSTCLK 24
+#define CPM_PLL_OUT 25
+#define CPLL 26
+#define PPLL_TO_XPD 27
+#define NPLL_TO_XPD 28
+#define APLL_TO_XPD 29
+#define RPLL_TO_XPD 30
+#define EFUSE_REF 31
+#define SYSMON_REF 32
+#define IRO_SUSPEND_REF 33
+#define USB_SUSPEND 34
+#define SWITCH_TIMEOUT 35
+#define RCLK_PMC 36
+#define RCLK_LPD 37
+#define WDT 38
+#define TTC0 39
+#define TTC1 40
+#define TTC2 41
+#define TTC3 42
+#define GEM_TSU 43
+#define GEM_TSU_LB 44
+#define MUXED_IRO_DIV2 45
+#define MUXED_IRO_DIV4 46
+#define PSM_REF 47
+#define GEM0_RX 48
+#define GEM0_TX 49
+#define GEM1_RX 50
+#define GEM1_TX 51
+#define CPM_CORE_REF 52
+#define CPM_LSBUS_REF 53
+#define CPM_DBG_REF 54
+#define CPM_AUX0_REF 55
+#define CPM_AUX1_REF 56
+#define QSPI_REF 57
+#define OSPI_REF 58
+#define SDIO0_REF 59
+#define SDIO1_REF 60
+#define PMC_LSBUS_REF 61
+#define I2C_REF 62
+#define TEST_PATTERN_REF 63
+#define DFT_OSC_REF 64
+#define PMC_PL0_REF 65
+#define PMC_PL1_REF 66
+#define PMC_PL2_REF 67
+#define PMC_PL3_REF 68
+#define CFU_REF 69
+#define SPARE_REF 70
+#define NPI_REF 71
+#define HSM0_REF 72
+#define HSM1_REF 73
+#define SD_DLL_REF 74
+#define FPD_TOP_SWITCH 75
+#define FPD_LSBUS 76
+#define ACPU 77
+#define DBG_TRACE 78
+#define DBG_FPD 79
+#define LPD_TOP_SWITCH 80
+#define ADMA 81
+#define LPD_LSBUS 82
+#define CPU_R5 83
+#define CPU_R5_CORE 84
+#define CPU_R5_OCM 85
+#define CPU_R5_OCM2 86
+#define IOU_SWITCH 87
+#define GEM0_REF 88
+#define GEM1_REF 89
+#define GEM_TSU_REF 90
+#define USB0_BUS_REF 91
+#define UART0_REF 92
+#define UART1_REF 93
+#define SPI0_REF 94
+#define SPI1_REF 95
+#define CAN0_REF 96
+#define CAN1_REF 97
+#define I2C0_REF 98
+#define I2C1_REF 99
+#define DBG_LPD 100
+#define TIMESTAMP_REF 101
+#define DBG_TSTMP 102
+#define CPM_TOPSW_REF 103
+#define USB3_DUAL_REF 104
+#define OUTCLK_MAX 105
+#define REF_CLK 106
+#define PL_ALT_REF_CLK 107
+#define MUXED_IRO 108
+#define PL_EXT 109
+#define PL_LB 110
+#define MIO_50_OR_51 111
+#define MIO_24_OR_25 112
+
+#endif
diff --git a/include/dt-bindings/mux/mux.h b/include/dt-bindings/mux/mux.h
new file mode 100644
index 00000000000..042719218db
--- /dev/null
+++ b/include/dt-bindings/mux/mux.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * This header provides constants for most Multiplexer bindings.
+ *
+ * Most Multiplexer bindings specify an idle state. In most cases, the
+ * the multiplexer can be left as is when idle, and in some cases it can
+ * disconnect the input/output and leave the multiplexer in a high
+ * impedance state.
+ */
+
+#ifndef _DT_BINDINGS_MUX_MUX_H
+#define _DT_BINDINGS_MUX_MUX_H
+
+#define MUX_IDLE_AS_IS (-1)
+#define MUX_IDLE_DISCONNECT (-2)
+
+#endif
diff --git a/include/dt-bindings/pinctrl/k210-pinctrl.h b/include/dt-bindings/pinctrl/k210-pinctrl.h
new file mode 100644
index 00000000000..26c1f23b0fe
--- /dev/null
+++ b/include/dt-bindings/pinctrl/k210-pinctrl.h
@@ -0,0 +1,277 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2020 Sean Anderson <seanga2@gmail.com>
+ */
+
+#ifndef DT_K210_PINCTRL_H
+#define DT_K210_PINCTRL_H
+
+/*
+ * Full list of FPIOA functions from
+ * kendryte-standalone-sdk/lib/drivers/include/fpioa.h
+ */
+#define K210_PCF_MASK GENMASK(7, 0)
+#define K210_PCF_JTAG_TCLK 0 /* JTAG Test Clock */
+#define K210_PCF_JTAG_TDI 1 /* JTAG Test Data In */
+#define K210_PCF_JTAG_TMS 2 /* JTAG Test Mode Select */
+#define K210_PCF_JTAG_TDO 3 /* JTAG Test Data Out */
+#define K210_PCF_SPI0_D0 4 /* SPI0 Data 0 */
+#define K210_PCF_SPI0_D1 5 /* SPI0 Data 1 */
+#define K210_PCF_SPI0_D2 6 /* SPI0 Data 2 */
+#define K210_PCF_SPI0_D3 7 /* SPI0 Data 3 */
+#define K210_PCF_SPI0_D4 8 /* SPI0 Data 4 */
+#define K210_PCF_SPI0_D5 9 /* SPI0 Data 5 */
+#define K210_PCF_SPI0_D6 10 /* SPI0 Data 6 */
+#define K210_PCF_SPI0_D7 11 /* SPI0 Data 7 */
+#define K210_PCF_SPI0_SS0 12 /* SPI0 Chip Select 0 */
+#define K210_PCF_SPI0_SS1 13 /* SPI0 Chip Select 1 */
+#define K210_PCF_SPI0_SS2 14 /* SPI0 Chip Select 2 */
+#define K210_PCF_SPI0_SS3 15 /* SPI0 Chip Select 3 */
+#define K210_PCF_SPI0_ARB 16 /* SPI0 Arbitration */
+#define K210_PCF_SPI0_SCLK 17 /* SPI0 Serial Clock */
+#define K210_PCF_UARTHS_RX 18 /* UART High speed Receiver */
+#define K210_PCF_UARTHS_TX 19 /* UART High speed Transmitter */
+#define K210_PCF_RESV6 20 /* Reserved function */
+#define K210_PCF_RESV7 21 /* Reserved function */
+#define K210_PCF_CLK_SPI1 22 /* Clock SPI1 */
+#define K210_PCF_CLK_I2C1 23 /* Clock I2C1 */
+#define K210_PCF_GPIOHS0 24 /* GPIO High speed 0 */
+#define K210_PCF_GPIOHS1 25 /* GPIO High speed 1 */
+#define K210_PCF_GPIOHS2 26 /* GPIO High speed 2 */
+#define K210_PCF_GPIOHS3 27 /* GPIO High speed 3 */
+#define K210_PCF_GPIOHS4 28 /* GPIO High speed 4 */
+#define K210_PCF_GPIOHS5 29 /* GPIO High speed 5 */
+#define K210_PCF_GPIOHS6 30 /* GPIO High speed 6 */
+#define K210_PCF_GPIOHS7 31 /* GPIO High speed 7 */
+#define K210_PCF_GPIOHS8 32 /* GPIO High speed 8 */
+#define K210_PCF_GPIOHS9 33 /* GPIO High speed 9 */
+#define K210_PCF_GPIOHS10 34 /* GPIO High speed 10 */
+#define K210_PCF_GPIOHS11 35 /* GPIO High speed 11 */
+#define K210_PCF_GPIOHS12 36 /* GPIO High speed 12 */
+#define K210_PCF_GPIOHS13 37 /* GPIO High speed 13 */
+#define K210_PCF_GPIOHS14 38 /* GPIO High speed 14 */
+#define K210_PCF_GPIOHS15 39 /* GPIO High speed 15 */
+#define K210_PCF_GPIOHS16 40 /* GPIO High speed 16 */
+#define K210_PCF_GPIOHS17 41 /* GPIO High speed 17 */
+#define K210_PCF_GPIOHS18 42 /* GPIO High speed 18 */
+#define K210_PCF_GPIOHS19 43 /* GPIO High speed 19 */
+#define K210_PCF_GPIOHS20 44 /* GPIO High speed 20 */
+#define K210_PCF_GPIOHS21 45 /* GPIO High speed 21 */
+#define K210_PCF_GPIOHS22 46 /* GPIO High speed 22 */
+#define K210_PCF_GPIOHS23 47 /* GPIO High speed 23 */
+#define K210_PCF_GPIOHS24 48 /* GPIO High speed 24 */
+#define K210_PCF_GPIOHS25 49 /* GPIO High speed 25 */
+#define K210_PCF_GPIOHS26 50 /* GPIO High speed 26 */
+#define K210_PCF_GPIOHS27 51 /* GPIO High speed 27 */
+#define K210_PCF_GPIOHS28 52 /* GPIO High speed 28 */
+#define K210_PCF_GPIOHS29 53 /* GPIO High speed 29 */
+#define K210_PCF_GPIOHS30 54 /* GPIO High speed 30 */
+#define K210_PCF_GPIOHS31 55 /* GPIO High speed 31 */
+#define K210_PCF_GPIO0 56 /* GPIO pin 0 */
+#define K210_PCF_GPIO1 57 /* GPIO pin 1 */
+#define K210_PCF_GPIO2 58 /* GPIO pin 2 */
+#define K210_PCF_GPIO3 59 /* GPIO pin 3 */
+#define K210_PCF_GPIO4 60 /* GPIO pin 4 */
+#define K210_PCF_GPIO5 61 /* GPIO pin 5 */
+#define K210_PCF_GPIO6 62 /* GPIO pin 6 */
+#define K210_PCF_GPIO7 63 /* GPIO pin 7 */
+#define K210_PCF_UART1_RX 64 /* UART1 Receiver */
+#define K210_PCF_UART1_TX 65 /* UART1 Transmitter */
+#define K210_PCF_UART2_RX 66 /* UART2 Receiver */
+#define K210_PCF_UART2_TX 67 /* UART2 Transmitter */
+#define K210_PCF_UART3_RX 68 /* UART3 Receiver */
+#define K210_PCF_UART3_TX 69 /* UART3 Transmitter */
+#define K210_PCF_SPI1_D0 70 /* SPI1 Data 0 */
+#define K210_PCF_SPI1_D1 71 /* SPI1 Data 1 */
+#define K210_PCF_SPI1_D2 72 /* SPI1 Data 2 */
+#define K210_PCF_SPI1_D3 73 /* SPI1 Data 3 */
+#define K210_PCF_SPI1_D4 74 /* SPI1 Data 4 */
+#define K210_PCF_SPI1_D5 75 /* SPI1 Data 5 */
+#define K210_PCF_SPI1_D6 76 /* SPI1 Data 6 */
+#define K210_PCF_SPI1_D7 77 /* SPI1 Data 7 */
+#define K210_PCF_SPI1_SS0 78 /* SPI1 Chip Select 0 */
+#define K210_PCF_SPI1_SS1 79 /* SPI1 Chip Select 1 */
+#define K210_PCF_SPI1_SS2 80 /* SPI1 Chip Select 2 */
+#define K210_PCF_SPI1_SS3 81 /* SPI1 Chip Select 3 */
+#define K210_PCF_SPI1_ARB 82 /* SPI1 Arbitration */
+#define K210_PCF_SPI1_SCLK 83 /* SPI1 Serial Clock */
+#define K210_PCF_SPI2_D0 84 /* SPI2 Data 0 */
+#define K210_PCF_SPI2_SS 85 /* SPI2 Select */
+#define K210_PCF_SPI2_SCLK 86 /* SPI2 Serial Clock */
+#define K210_PCF_I2S0_MCLK 87 /* I2S0 Master Clock */
+#define K210_PCF_I2S0_SCLK 88 /* I2S0 Serial Clock(BCLK) */
+#define K210_PCF_I2S0_WS 89 /* I2S0 Word Select(LRCLK) */
+#define K210_PCF_I2S0_IN_D0 90 /* I2S0 Serial Data Input 0 */
+#define K210_PCF_I2S0_IN_D1 91 /* I2S0 Serial Data Input 1 */
+#define K210_PCF_I2S0_IN_D2 92 /* I2S0 Serial Data Input 2 */
+#define K210_PCF_I2S0_IN_D3 93 /* I2S0 Serial Data Input 3 */
+#define K210_PCF_I2S0_OUT_D0 94 /* I2S0 Serial Data Output 0 */
+#define K210_PCF_I2S0_OUT_D1 95 /* I2S0 Serial Data Output 1 */
+#define K210_PCF_I2S0_OUT_D2 96 /* I2S0 Serial Data Output 2 */
+#define K210_PCF_I2S0_OUT_D3 97 /* I2S0 Serial Data Output 3 */
+#define K210_PCF_I2S1_MCLK 98 /* I2S1 Master Clock */
+#define K210_PCF_I2S1_SCLK 99 /* I2S1 Serial Clock(BCLK) */
+#define K210_PCF_I2S1_WS 100 /* I2S1 Word Select(LRCLK) */
+#define K210_PCF_I2S1_IN_D0 101 /* I2S1 Serial Data Input 0 */
+#define K210_PCF_I2S1_IN_D1 102 /* I2S1 Serial Data Input 1 */
+#define K210_PCF_I2S1_IN_D2 103 /* I2S1 Serial Data Input 2 */
+#define K210_PCF_I2S1_IN_D3 104 /* I2S1 Serial Data Input 3 */
+#define K210_PCF_I2S1_OUT_D0 105 /* I2S1 Serial Data Output 0 */
+#define K210_PCF_I2S1_OUT_D1 106 /* I2S1 Serial Data Output 1 */
+#define K210_PCF_I2S1_OUT_D2 107 /* I2S1 Serial Data Output 2 */
+#define K210_PCF_I2S1_OUT_D3 108 /* I2S1 Serial Data Output 3 */
+#define K210_PCF_I2S2_MCLK 109 /* I2S2 Master Clock */
+#define K210_PCF_I2S2_SCLK 110 /* I2S2 Serial Clock(BCLK) */
+#define K210_PCF_I2S2_WS 111 /* I2S2 Word Select(LRCLK) */
+#define K210_PCF_I2S2_IN_D0 112 /* I2S2 Serial Data Input 0 */
+#define K210_PCF_I2S2_IN_D1 113 /* I2S2 Serial Data Input 1 */
+#define K210_PCF_I2S2_IN_D2 114 /* I2S2 Serial Data Input 2 */
+#define K210_PCF_I2S2_IN_D3 115 /* I2S2 Serial Data Input 3 */
+#define K210_PCF_I2S2_OUT_D0 116 /* I2S2 Serial Data Output 0 */
+#define K210_PCF_I2S2_OUT_D1 117 /* I2S2 Serial Data Output 1 */
+#define K210_PCF_I2S2_OUT_D2 118 /* I2S2 Serial Data Output 2 */
+#define K210_PCF_I2S2_OUT_D3 119 /* I2S2 Serial Data Output 3 */
+#define K210_PCF_RESV0 120 /* Reserved function */
+#define K210_PCF_RESV1 121 /* Reserved function */
+#define K210_PCF_RESV2 122 /* Reserved function */
+#define K210_PCF_RESV3 123 /* Reserved function */
+#define K210_PCF_RESV4 124 /* Reserved function */
+#define K210_PCF_RESV5 125 /* Reserved function */
+#define K210_PCF_I2C0_SCLK 126 /* I2C0 Serial Clock */
+#define K210_PCF_I2C0_SDA 127 /* I2C0 Serial Data */
+#define K210_PCF_I2C1_SCLK 128 /* I2C1 Serial Clock */
+#define K210_PCF_I2C1_SDA 129 /* I2C1 Serial Data */
+#define K210_PCF_I2C2_SCLK 130 /* I2C2 Serial Clock */
+#define K210_PCF_I2C2_SDA 131 /* I2C2 Serial Data */
+#define K210_PCF_DVP_XCLK 132 /* DVP System Clock */
+#define K210_PCF_DVP_RST 133 /* DVP System Reset */
+#define K210_PCF_DVP_PWDN 134 /* DVP Power Down Mode */
+#define K210_PCF_DVP_VSYNC 135 /* DVP Vertical Sync */
+#define K210_PCF_DVP_HSYNC 136 /* DVP Horizontal Sync */
+#define K210_PCF_DVP_PCLK 137 /* Pixel Clock */
+#define K210_PCF_DVP_D0 138 /* Data Bit 0 */
+#define K210_PCF_DVP_D1 139 /* Data Bit 1 */
+#define K210_PCF_DVP_D2 140 /* Data Bit 2 */
+#define K210_PCF_DVP_D3 141 /* Data Bit 3 */
+#define K210_PCF_DVP_D4 142 /* Data Bit 4 */
+#define K210_PCF_DVP_D5 143 /* Data Bit 5 */
+#define K210_PCF_DVP_D6 144 /* Data Bit 6 */
+#define K210_PCF_DVP_D7 145 /* Data Bit 7 */
+#define K210_PCF_SCCB_SCLK 146 /* Serial Camera Control Bus Clock */
+#define K210_PCF_SCCB_SDA 147 /* Serial Camera Control Bus Data */
+#define K210_PCF_UART1_CTS 148 /* UART1 Clear To Send */
+#define K210_PCF_UART1_DSR 149 /* UART1 Data Set Ready */
+#define K210_PCF_UART1_DCD 150 /* UART1 Data Carrier Detect */
+#define K210_PCF_UART1_RI 151 /* UART1 Ring Indicator */
+#define K210_PCF_UART1_SIR_IN 152 /* UART1 Serial Infrared Input */
+#define K210_PCF_UART1_DTR 153 /* UART1 Data Terminal Ready */
+#define K210_PCF_UART1_RTS 154 /* UART1 Request To Send */
+#define K210_PCF_UART1_OUT2 155 /* UART1 User-designated Output 2 */
+#define K210_PCF_UART1_OUT1 156 /* UART1 User-designated Output 1 */
+#define K210_PCF_UART1_SIR_OUT 157 /* UART1 Serial Infrared Output */
+#define K210_PCF_UART1_BAUD 158 /* UART1 Transmit Clock Output */
+#define K210_PCF_UART1_RE 159 /* UART1 Receiver Output Enable */
+#define K210_PCF_UART1_DE 160 /* UART1 Driver Output Enable */
+#define K210_PCF_UART1_RS485_EN 161 /* UART1 RS485 Enable */
+#define K210_PCF_UART2_CTS 162 /* UART2 Clear To Send */
+#define K210_PCF_UART2_DSR 163 /* UART2 Data Set Ready */
+#define K210_PCF_UART2_DCD 164 /* UART2 Data Carrier Detect */
+#define K210_PCF_UART2_RI 165 /* UART2 Ring Indicator */
+#define K210_PCF_UART2_SIR_IN 166 /* UART2 Serial Infrared Input */
+#define K210_PCF_UART2_DTR 167 /* UART2 Data Terminal Ready */
+#define K210_PCF_UART2_RTS 168 /* UART2 Request To Send */
+#define K210_PCF_UART2_OUT2 169 /* UART2 User-designated Output 2 */
+#define K210_PCF_UART2_OUT1 170 /* UART2 User-designated Output 1 */
+#define K210_PCF_UART2_SIR_OUT 171 /* UART2 Serial Infrared Output */
+#define K210_PCF_UART2_BAUD 172 /* UART2 Transmit Clock Output */
+#define K210_PCF_UART2_RE 173 /* UART2 Receiver Output Enable */
+#define K210_PCF_UART2_DE 174 /* UART2 Driver Output Enable */
+#define K210_PCF_UART2_RS485_EN 175 /* UART2 RS485 Enable */
+#define K210_PCF_UART3_CTS 176 /* UART3 Clear To Send */
+#define K210_PCF_UART3_DSR 177 /* UART3 Data Set Ready */
+#define K210_PCF_UART3_DCD 178 /* UART3 Data Carrier Detect */
+#define K210_PCF_UART3_RI 179 /* UART3 Ring Indicator */
+#define K210_PCF_UART3_SIR_IN 180 /* UART3 Serial Infrared Input */
+#define K210_PCF_UART3_DTR 181 /* UART3 Data Terminal Ready */
+#define K210_PCF_UART3_RTS 182 /* UART3 Request To Send */
+#define K210_PCF_UART3_OUT2 183 /* UART3 User-designated Output 2 */
+#define K210_PCF_UART3_OUT1 184 /* UART3 User-designated Output 1 */
+#define K210_PCF_UART3_SIR_OUT 185 /* UART3 Serial Infrared Output */
+#define K210_PCF_UART3_BAUD 186 /* UART3 Transmit Clock Output */
+#define K210_PCF_UART3_RE 187 /* UART3 Receiver Output Enable */
+#define K210_PCF_UART3_DE 188 /* UART3 Driver Output Enable */
+#define K210_PCF_UART3_RS485_EN 189 /* UART3 RS485 Enable */
+#define K210_PCF_TIMER0_TOGGLE1 190 /* TIMER0 Toggle Output 1 */
+#define K210_PCF_TIMER0_TOGGLE2 191 /* TIMER0 Toggle Output 2 */
+#define K210_PCF_TIMER0_TOGGLE3 192 /* TIMER0 Toggle Output 3 */
+#define K210_PCF_TIMER0_TOGGLE4 193 /* TIMER0 Toggle Output 4 */
+#define K210_PCF_TIMER1_TOGGLE1 194 /* TIMER1 Toggle Output 1 */
+#define K210_PCF_TIMER1_TOGGLE2 195 /* TIMER1 Toggle Output 2 */
+#define K210_PCF_TIMER1_TOGGLE3 196 /* TIMER1 Toggle Output 3 */
+#define K210_PCF_TIMER1_TOGGLE4 197 /* TIMER1 Toggle Output 4 */
+#define K210_PCF_TIMER2_TOGGLE1 198 /* TIMER2 Toggle Output 1 */
+#define K210_PCF_TIMER2_TOGGLE2 199 /* TIMER2 Toggle Output 2 */
+#define K210_PCF_TIMER2_TOGGLE3 200 /* TIMER2 Toggle Output 3 */
+#define K210_PCF_TIMER2_TOGGLE4 201 /* TIMER2 Toggle Output 4 */
+#define K210_PCF_CLK_SPI2 202 /* Clock SPI2 */
+#define K210_PCF_CLK_I2C2 203 /* Clock I2C2 */
+#define K210_PCF_INTERNAL0 204 /* Internal function signal 0 */
+#define K210_PCF_INTERNAL1 205 /* Internal function signal 1 */
+#define K210_PCF_INTERNAL2 206 /* Internal function signal 2 */
+#define K210_PCF_INTERNAL3 207 /* Internal function signal 3 */
+#define K210_PCF_INTERNAL4 208 /* Internal function signal 4 */
+#define K210_PCF_INTERNAL5 209 /* Internal function signal 5 */
+#define K210_PCF_INTERNAL6 210 /* Internal function signal 6 */
+#define K210_PCF_INTERNAL7 211 /* Internal function signal 7 */
+#define K210_PCF_INTERNAL8 212 /* Internal function signal 8 */
+#define K210_PCF_INTERNAL9 213 /* Internal function signal 9 */
+#define K210_PCF_INTERNAL10 214 /* Internal function signal 10 */
+#define K210_PCF_INTERNAL11 215 /* Internal function signal 11 */
+#define K210_PCF_INTERNAL12 216 /* Internal function signal 12 */
+#define K210_PCF_INTERNAL13 217 /* Internal function signal 13 */
+#define K210_PCF_INTERNAL14 218 /* Internal function signal 14 */
+#define K210_PCF_INTERNAL15 219 /* Internal function signal 15 */
+#define K210_PCF_INTERNAL16 220 /* Internal function signal 16 */
+#define K210_PCF_INTERNAL17 221 /* Internal function signal 17 */
+#define K210_PCF_CONSTANT 222 /* Constant function */
+#define K210_PCF_INTERNAL18 223 /* Internal function signal 18 */
+#define K210_PCF_DEBUG0 224 /* Debug function 0 */
+#define K210_PCF_DEBUG1 225 /* Debug function 1 */
+#define K210_PCF_DEBUG2 226 /* Debug function 2 */
+#define K210_PCF_DEBUG3 227 /* Debug function 3 */
+#define K210_PCF_DEBUG4 228 /* Debug function 4 */
+#define K210_PCF_DEBUG5 229 /* Debug function 5 */
+#define K210_PCF_DEBUG6 230 /* Debug function 6 */
+#define K210_PCF_DEBUG7 231 /* Debug function 7 */
+#define K210_PCF_DEBUG8 232 /* Debug function 8 */
+#define K210_PCF_DEBUG9 233 /* Debug function 9 */
+#define K210_PCF_DEBUG10 234 /* Debug function 10 */
+#define K210_PCF_DEBUG11 235 /* Debug function 11 */
+#define K210_PCF_DEBUG12 236 /* Debug function 12 */
+#define K210_PCF_DEBUG13 237 /* Debug function 13 */
+#define K210_PCF_DEBUG14 238 /* Debug function 14 */
+#define K210_PCF_DEBUG15 239 /* Debug function 15 */
+#define K210_PCF_DEBUG16 240 /* Debug function 16 */
+#define K210_PCF_DEBUG17 241 /* Debug function 17 */
+#define K210_PCF_DEBUG18 242 /* Debug function 18 */
+#define K210_PCF_DEBUG19 243 /* Debug function 19 */
+#define K210_PCF_DEBUG20 244 /* Debug function 20 */
+#define K210_PCF_DEBUG21 245 /* Debug function 21 */
+#define K210_PCF_DEBUG22 246 /* Debug function 22 */
+#define K210_PCF_DEBUG23 247 /* Debug function 23 */
+#define K210_PCF_DEBUG24 248 /* Debug function 24 */
+#define K210_PCF_DEBUG25 249 /* Debug function 25 */
+#define K210_PCF_DEBUG26 250 /* Debug function 26 */
+#define K210_PCF_DEBUG27 251 /* Debug function 27 */
+#define K210_PCF_DEBUG28 252 /* Debug function 28 */
+#define K210_PCF_DEBUG29 253 /* Debug function 29 */
+#define K210_PCF_DEBUG30 254 /* Debug function 30 */
+#define K210_PCF_DEBUG31 255 /* Debug function 31 */
+
+#define K210_FPIOA(pin, func) (((pin) << 16) | (func))
+#define K210_FPIOA_DO(pin, func) (((pin) << 16) | (1 << 8) | (func))
+
+#define K210_PC_POWER_3V3 0
+#define K210_PC_POWER_1V8 1
+
+#endif /* DT_K210_PINCTRL_H */
diff --git a/include/dt-bindings/pinctrl/sandbox-pinmux.h b/include/dt-bindings/pinctrl/sandbox-pinmux.h
new file mode 100644
index 00000000000..891af072e52
--- /dev/null
+++ b/include/dt-bindings/pinctrl/sandbox-pinmux.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Sean Anderson <seanga2@gmail.com>
+ */
+
+#ifndef SANDBOX_PINMUX_H
+#define SANDBOX_PINMUX_H
+
+#define SANDBOX_PINMUX_UART 0
+#define SANDBOX_PINMUX_I2C 1
+#define SANDBOX_PINMUX_SPI 2
+#define SANDBOX_PINMUX_I2S 3
+#define SANDBOX_PINMUX_GPIO 4
+#define SANDBOX_PINMUX_CS 5
+#define SANDBOX_PINMUX_PWM 6
+
+#define SANDBOX_PINMUX(pin, func) ((func) << 16 | (pin))
+
+#endif /* SANDBOX_PINMUX_H */
diff --git a/include/dt-bindings/power/r8a774c0-sysc.h b/include/dt-bindings/power/r8a774c0-sysc.h
new file mode 100644
index 00000000000..dd0cd656d90
--- /dev/null
+++ b/include/dt-bindings/power/r8a774c0-sysc.h
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2020 Renesas Electronics Corp.
+ */
+#ifndef __DT_BINDINGS_POWER_R8A774C0_SYSC_H__
+#define __DT_BINDINGS_POWER_R8A774C0_SYSC_H__
+
+/*
+ * These power domain indices match the numbers of the interrupt bits
+ * representing the power areas in the various Interrupt Registers
+ * (e.g. SYSCISR, Interrupt Status Register)
+ */
+
+#define R8A774C0_PD_CA53_CPU0 5
+#define R8A774C0_PD_CA53_CPU1 6
+#define R8A774C0_PD_A3VC 14
+#define R8A774C0_PD_3DG_A 17
+#define R8A774C0_PD_3DG_B 18
+#define R8A774C0_PD_CA53_SCU 21
+#define R8A774C0_PD_A2VC1 26
+
+/* Always-on power area */
+#define R8A774C0_PD_ALWAYS_ON 32
+
+#endif /* __DT_BINDINGS_POWER_R8A774C0_SYSC_H__ */
diff --git a/include/dt-bindings/power/xlnx-versal-power.h b/include/dt-bindings/power/xlnx-versal-power.h
new file mode 100644
index 00000000000..1b75175edce
--- /dev/null
+++ b/include/dt-bindings/power/xlnx-versal-power.h
@@ -0,0 +1,42 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 - 2020 Xilinx, Inc.
+ */
+
+#ifndef _DT_BINDINGS_VERSAL_POWER_H
+#define _DT_BINDINGS_VERSAL_POWER_H
+
+#define PM_DEV_USB_0 (0x18224018U)
+#define PM_DEV_GEM_0 (0x18224019U)
+#define PM_DEV_GEM_1 (0x1822401aU)
+#define PM_DEV_SPI_0 (0x1822401bU)
+#define PM_DEV_SPI_1 (0x1822401cU)
+#define PM_DEV_I2C_0 (0x1822401dU)
+#define PM_DEV_I2C_1 (0x1822401eU)
+#define PM_DEV_CAN_FD_0 (0x1822401fU)
+#define PM_DEV_CAN_FD_1 (0x18224020U)
+#define PM_DEV_UART_0 (0x18224021U)
+#define PM_DEV_UART_1 (0x18224022U)
+#define PM_DEV_GPIO (0x18224023U)
+#define PM_DEV_TTC_0 (0x18224024U)
+#define PM_DEV_TTC_1 (0x18224025U)
+#define PM_DEV_TTC_2 (0x18224026U)
+#define PM_DEV_TTC_3 (0x18224027U)
+#define PM_DEV_SWDT_FPD (0x18224029U)
+#define PM_DEV_OSPI (0x1822402aU)
+#define PM_DEV_QSPI (0x1822402bU)
+#define PM_DEV_GPIO_PMC (0x1822402cU)
+#define PM_DEV_SDIO_0 (0x1822402eU)
+#define PM_DEV_SDIO_1 (0x1822402fU)
+#define PM_DEV_RTC (0x18224034U)
+#define PM_DEV_ADMA_0 (0x18224035U)
+#define PM_DEV_ADMA_1 (0x18224036U)
+#define PM_DEV_ADMA_2 (0x18224037U)
+#define PM_DEV_ADMA_3 (0x18224038U)
+#define PM_DEV_ADMA_4 (0x18224039U)
+#define PM_DEV_ADMA_5 (0x1822403aU)
+#define PM_DEV_ADMA_6 (0x1822403bU)
+#define PM_DEV_ADMA_7 (0x1822403cU)
+#define PM_DEV_AI (0x18224072U)
+
+#endif
diff --git a/include/dt-bindings/reset/ast2500-reset.h b/include/dt-bindings/reset/ast2500-reset.h
index d1b6b23fc11..cc85a31edf9 100644
--- a/include/dt-bindings/reset/ast2500-reset.h
+++ b/include/dt-bindings/reset/ast2500-reset.h
@@ -1,44 +1,49 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright 2017 Google, Inc
+ * Copyright 2020 ASPEED Technology Inc.
*/
#ifndef _ABI_MACH_ASPEED_AST2500_RESET_H_
#define _ABI_MACH_ASPEED_AST2500_RESET_H_
-/*
- * The values are intentionally layed out as flags in
- * WDT reset parameter.
- */
-
-#define AST_RESET_SOC 0
-#define AST_RESET_CHIP 1
-#define AST_RESET_CPU (1 << 1)
-#define AST_RESET_ARM (1 << 2)
-#define AST_RESET_COPROC (1 << 3)
-#define AST_RESET_SDRAM (1 << 4)
-#define AST_RESET_AHB (1 << 5)
-#define AST_RESET_I2C (1 << 6)
-#define AST_RESET_MAC1 (1 << 7)
-#define AST_RESET_MAC2 (1 << 8)
-#define AST_RESET_GCRT (1 << 9)
-#define AST_RESET_USB20 (1 << 10)
-#define AST_RESET_USB11_HOST (1 << 11)
-#define AST_RESET_USB11_HID (1 << 12)
-#define AST_RESET_VIDEO (1 << 13)
-#define AST_RESET_HAC (1 << 14)
-#define AST_RESET_LPC (1 << 15)
-#define AST_RESET_SDIO (1 << 16)
-#define AST_RESET_MIC (1 << 17)
-#define AST_RESET_CRT2D (1 << 18)
-#define AST_RESET_PWM (1 << 19)
-#define AST_RESET_PECI (1 << 20)
-#define AST_RESET_JTAG (1 << 21)
-#define AST_RESET_ADC (1 << 22)
-#define AST_RESET_GPIO (1 << 23)
-#define AST_RESET_MCTP (1 << 24)
-#define AST_RESET_XDMA (1 << 25)
-#define AST_RESET_SPI (1 << 26)
-#define AST_RESET_MISC (1 << 27)
+#define ASPEED_RESET_CRT1 (37)
+#define ASPEED_RESET_RESERVED36 (36)
+#define ASPEED_RESET_RESERVED35 (35)
+#define ASPEED_RESET_RESERVED34 (34)
+#define ASPEED_RESET_RESERVED33 (33)
+#define ASPEED_RESET_RESERVED32 (32)
+#define ASPEED_RESET_RESERVED31 (31)
+#define ASPEED_RESET_RESERVED30 (30)
+#define ASPEED_RESET_RESERVED29 (29)
+#define ASPEED_RESET_RESERVED28 (28)
+#define ASPEED_RESET_RESERVED27 (27)
+#define ASPEED_RESET_RESERVED26 (26)
+#define ASPEED_RESET_XDMA (25)
+#define ASPEED_RESET_MCTP (24)
+#define ASPEED_RESET_ADC (23)
+#define ASPEED_RESET_JTAG_MASTER (22)
+#define ASPEED_RESET_RESERVED21 (21)
+#define ASPEED_RESET_RESERVED20 (20)
+#define ASPEED_RESET_RESERVED19 (19)
+#define ASPEED_RESET_MIC (18)
+#define ASPEED_RESET_RESERVED17 (17)
+#define ASPEED_RESET_SDIO (16)
+#define ASPEED_RESET_UHCI (15)
+#define ASPEED_RESET_EHCI_P1 (14)
+#define ASPEED_RESET_CRT (13)
+#define ASPEED_RESET_MAC2 (12)
+#define ASPEED_RESET_MAC1 (11)
+#define ASPEED_RESET_PECI (10)
+#define ASPEED_RESET_PWM (9)
+#define ASPEED_RESET_PCI_VGA (8)
+#define ASPEED_RESET_2D (7)
+#define ASPEED_RESET_VIDEO (6)
+#define ASPEED_RESET_LPC_ESPI (5)
+#define ASPEED_RESET_HACE (4)
+#define ASPEED_RESET_EHCI_P2 (3)
+#define ASPEED_RESET_I2C (2)
+#define ASPEED_RESET_AHB (1)
+#define ASPEED_RESET_SDRAM (0)
#endif /* _ABI_MACH_ASPEED_AST2500_RESET_H_ */
diff --git a/include/dt-structs.h b/include/dt-structs.h
index 924d51fc522..f0e1c9cb901 100644
--- a/include/dt-structs.h
+++ b/include/dt-structs.h
@@ -8,18 +8,20 @@
/* These structures may only be used in SPL */
#if CONFIG_IS_ENABLED(OF_PLATDATA)
+struct driver_info;
+
struct phandle_0_arg {
- const void *node;
+ uint idx;
int arg[0];
};
struct phandle_1_arg {
- const void *node;
+ uint idx;
int arg[1];
};
struct phandle_2_arg {
- const void *node;
+ uint idx;
int arg[2];
};
#include <generated/dt-structs-gen.h>
diff --git a/include/env.h b/include/env.h
index af405955b0f..c15339a93f1 100644
--- a/include/env.h
+++ b/include/env.h
@@ -319,6 +319,24 @@ int env_import(const char *buf, int check, int flags);
int env_export(struct environment_s *env_out);
/**
+ * env_check_redund() - check the two redundant environments
+ * and find out, which is the valid one.
+ *
+ * @buf1: First environment (struct environemnt_s *)
+ * @buf1_read_fail: 0 if buf1 is valid, non-zero if invalid
+ * @buf2: Second environment (struct environemnt_s *)
+ * @buf2_read_fail: 0 if buf2 is valid, non-zero if invalid
+ * @return 0 if OK,
+ * -EIO if no environment is valid,
+ * -EINVAL if read of second entry is good
+ * -ENOENT if read of first entry is good
+ * -ENOMSG if the CRC was bad
+ */
+
+int env_check_redund(const char *buf1, int buf1_read_fail,
+ const char *buf2, int buf2_read_fail);
+
+/**
* env_import_redund() - Select and import one of two redundant environments
*
* @buf1: First environment (struct environemnt_s *)
diff --git a/include/environment/ti/ufs.h b/include/environment/ti/ufs.h
index d457e203081..6619ec9c88e 100644
--- a/include/environment/ti/ufs.h
+++ b/include/environment/ti/ufs.h
@@ -26,8 +26,8 @@
"fdt resize 0x100000;" \
"for overlay in $name_overlays;" \
"do;" \
- "load scsi ${bootpart} ${overlayaddr} ${bootdir}/${overlay} && " \
- "fdt apply ${overlayaddr};" \
+ "load scsi ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
+ "fdt apply ${dtboaddr};" \
"done;\0"
#endif
diff --git a/include/fdt_support.h b/include/fdt_support.h
index 9684cffe80b..dbbac0fb6a3 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -359,4 +359,7 @@ int fdt_update_ethernet_dt(void *blob);
#ifdef CONFIG_FSL_MC_ENET
void fdt_fixup_board_enet(void *blob);
#endif
+#ifdef CONFIG_CMD_PSTORE
+void fdt_fixup_pstore(void *blob);
+#endif
#endif /* ifndef __FDT_SUPPORT_H */
diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h
index 7f8f8edc621..e6f1c75e27c 100644
--- a/include/fsl_esdhc.h
+++ b/include/fsl_esdhc.h
@@ -74,8 +74,10 @@
#define IRQSTATEN_TC (0x00000002)
#define IRQSTATEN_CC (0x00000001)
+/* eSDHC control register */
#define ESDHCCTL 0x0002e40c
#define ESDHCCTL_PCS (0x00080000)
+#define ESDHCCTL_FAF (0x00040000)
#define PRSSTAT 0x0002e024
#define PRSSTAT_DAT0 (0x01000000)
@@ -95,6 +97,10 @@
#define PROCTL_DTW_4 0x00000002
#define PROCTL_DTW_8 0x00000004
#define PROCTL_D3CD 0x00000008
+#define PROCTL_DMAS_MASK 0x00000300
+#define PROCTL_DMAS_SDMA 0x00000000
+#define PROCTL_DMAS_ADMA1 0x00000100
+#define PROCTL_DMAS_ADMA2 0x00000300
#define PROCTL_VOLT_SEL 0x00000400
#define CMDARG 0x0002e008
@@ -154,6 +160,12 @@
#define BLKATTR_SIZE(x) (x & 0x1fff)
#define MAX_BLK_CNT 0x7fff /* so malloc will have enough room with 32M */
+/* Auto CMD error status register / system control 2 register */
+#define EXECUTE_TUNING 0x00400000
+#define SMPCLKSEL 0x00800000
+#define UHSM_MASK 0x00070000
+#define UHSM_SDR104_HS200 0x00030000
+
/* Host controller capabilities register */
#define HOSTCAPBLT_VS18 0x04000000
#define HOSTCAPBLT_VS30 0x02000000
@@ -162,6 +174,33 @@
#define HOSTCAPBLT_DMAS 0x00400000
#define HOSTCAPBLT_HSS 0x00200000
+/* Tuning block control register */
+#define TBCTL_TB_EN 0x00000004
+#define HS400_MODE 0x00000010
+#define HS400_WNDW_ADJUST 0x00000040
+
+/* SD clock control register */
+#define CMD_CLK_CTL 0x00008000
+
+/* SD timing control register */
+#define FLW_CTL_BG 0x00008000
+
+/* DLL config 0 register */
+#define DLL_ENABLE 0x80000000
+#define DLL_FREQ_SEL 0x08000000
+
+#define MAX_TUNING_LOOP 40
+
+#define HOSTVER_VENDOR(x) (((x) >> 8) & 0xff)
+#define VENDOR_V_10 0x00
+#define VENDOR_V_20 0x10
+#define VENDOR_V_21 0x11
+#define VENDOR_V_22 0x12
+#define VENDOR_V_23 0x13
+#define VENDOR_V_30 0x20
+#define VENDOR_V_31 0x21
+#define VENDOR_V_32 0x22
+
struct fsl_esdhc_cfg {
phys_addr_t esdhc_base;
u32 sdhc_clk;
@@ -203,10 +242,6 @@ struct fsl_esdhc_cfg {
int fsl_esdhc_mmc_init(struct bd_info *bis);
int fsl_esdhc_initialize(struct bd_info *bis, struct fsl_esdhc_cfg *cfg);
void fdt_fixup_esdhc(void *blob, struct bd_info *bd);
-#ifdef MMC_SUPPORTS_TUNING
-static inline int fsl_esdhc_execute_tuning(struct udevice *dev,
- uint32_t opcode) {return 0; }
-#endif
#else
static inline int fsl_esdhc_mmc_init(struct bd_info *bis) { return -ENOSYS; }
static inline void fdt_fixup_esdhc(void *blob, struct bd_info *bd) {}
diff --git a/include/getopt.h b/include/getopt.h
new file mode 100644
index 00000000000..6f5811e64be
--- /dev/null
+++ b/include/getopt.h
@@ -0,0 +1,130 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * getopt.h - a simple getopt(3) implementation.
+ *
+ * Copyright (C) 2020 Sean Anderson <seanga2@gmail.com>
+ * Copyright (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
+ */
+
+#ifndef __GETOPT_H
+#define __GETOPT_H
+
+/**
+ * struct getopt_state - Saved state across getopt() calls
+ */
+struct getopt_state {
+ /**
+ * @index: Index of the next unparsed argument of @argv. If getopt() has
+ * parsed all of @argv, then @index will equal @argc.
+ */
+ int index;
+ /* private: */
+ /** @arg_index: Index within the current argument */
+ int arg_index;
+ union {
+ /* public: */
+ /**
+ * @opt: Option being parsed when an error occurs. @opt is only
+ * valid when getopt() returns ``?`` or ``:``.
+ */
+ int opt;
+ /**
+ * @arg: The argument to an option, NULL if there is none. @arg
+ * is only valid when getopt() returns an option character.
+ */
+ char *arg;
+ /* private: */
+ };
+};
+
+/**
+ * getopt_init_state() - Initialize a &struct getopt_state
+ * @gs: The state to initialize
+ *
+ * This must be called before using @gs with getopt().
+ */
+void getopt_init_state(struct getopt_state *gs);
+
+int __getopt(struct getopt_state *gs, int argc, char *const argv[],
+ const char *optstring, bool silent);
+
+/**
+ * getopt() - Parse short command-line options
+ * @gs: Internal state and out-of-band return arguments. This must be
+ * initialized with getopt_init_context() beforehand.
+ * @argc: Number of arguments, not including the %NULL terminator
+ * @argv: Argument list, terminated by %NULL
+ * @optstring: Option specification, as described below
+ *
+ * getopt() parses short options. Short options are single characters. They may
+ * be followed by a required argument or an optional argument. Arguments to
+ * options may occur in the same argument as an option (like ``-larg``), or
+ * in the following argument (like ``-l arg``). An argument containing
+ * options begins with a ``-``. If an option expects no arguments, then it may
+ * be immediately followed by another option (like ``ls -alR``).
+ *
+ * @optstring is a list of accepted options. If an option is followed by ``:``
+ * in @optstring, then it expects a mandatory argument. If an option is followed
+ * by ``::`` in @optstring, it expects an optional argument. @gs.arg points
+ * to the argument, if one is parsed.
+ *
+ * getopt() stops parsing options when it encounters the first non-option
+ * argument, when it encounters the argument ``--``, or when it runs out of
+ * arguments. For example, in ``ls -l foo -R``, option parsing will stop when
+ * getopt() encounters ``foo``, if ``l`` does not expect an argument. However,
+ * the whole list of arguments would be parsed if ``l`` expects an argument.
+ *
+ * An example invocation of getopt() might look like::
+ *
+ * char *argv[] = { "program", "-cbx", "-a", "foo", "bar", 0 };
+ * int opt, argc = ARRAY_SIZE(argv) - 1;
+ * struct getopt_state gs;
+ *
+ * getopt_init_state(&gs);
+ * while ((opt = getopt(&gs, argc, argv, "a::b:c")) != -1)
+ * printf("opt = %c, index = %d, arg = \"%s\"\n", opt, gs.index, gs.arg);
+ * printf("%d argument(s) left\n", argc - gs.index);
+ *
+ * and would produce an output of::
+ *
+ * opt = c, index = 1, arg = "<NULL>"
+ * opt = b, index = 2, arg = "x"
+ * opt = a, index = 4, arg = "foo"
+ * 1 argument(s) left
+ *
+ * For further information, refer to the getopt(3) man page.
+ *
+ * Return:
+ * * An option character if an option is found. @gs.arg is set to the
+ * argument if there is one, otherwise it is set to ``NULL``.
+ * * ``-1`` if there are no more options, if a non-option argument is
+ * encountered, or if an ``--`` argument is encountered.
+ * * ``'?'`` if we encounter an option not in @optstring. @gs.opt is set to
+ * the unknown option.
+ * * ``':'`` if an argument is required, but no argument follows the
+ * option. @gs.opt is set to the option missing its argument.
+ *
+ * @gs.index is always set to the index of the next unparsed argument in @argv.
+ */
+static inline int getopt(struct getopt_state *gs, int argc,
+ char *const argv[], const char *optstring)
+{
+ return __getopt(gs, argc, argv, optstring, false);
+}
+
+/**
+ * getopt_silent() - Parse short command-line options silently
+ * @gs: State
+ * @argc: Argument count
+ * @argv: Argument list
+ * @optstring: Option specification
+ *
+ * Same as getopt(), except no error messages are printed.
+ */
+static inline int getopt_silent(struct getopt_state *gs, int argc,
+ char *const argv[], const char *optstring)
+{
+ return __getopt(gs, argc, argv, optstring, true);
+}
+
+#endif /* __GETOPT_H */
diff --git a/include/image.h b/include/image.h
index 9a5a87dbf87..4094ee588a5 100644
--- a/include/image.h
+++ b/include/image.h
@@ -563,11 +563,21 @@ int genimg_get_cat_count(enum ih_category category);
/**
* genimg_get_cat_desc() - Get the description of a category
*
+ * @category: Category to check
* @return the description of a category, e.g. "architecture". This
* effectively converts the enum to a string.
*/
const char *genimg_get_cat_desc(enum ih_category category);
+/**
+ * genimg_cat_has_id() - Check whether a category has an item
+ *
+ * @category: Category to check
+ * @id: Item ID
+ * @return true or false as to whether a category has an item
+ */
+bool genimg_cat_has_id(enum ih_category category, uint id);
+
int genimg_get_os_id(const char *name);
int genimg_get_arch_id(const char *name);
int genimg_get_type_id(const char *name);
@@ -1463,7 +1473,7 @@ struct cipher_algo {
unsigned char **cipher, int *cipher_len);
int (*add_cipher_data)(struct image_cipher_info *info,
- void *keydest);
+ void *keydest, void *fit, int node_noffset);
int (*decrypt)(struct image_cipher_info *info,
const void *cipher, size_t cipher_len,
diff --git a/include/linux/compat.h b/include/linux/compat.h
index d1297803122..38549baa251 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -24,34 +24,6 @@ struct p_current{
extern struct p_current *current;
-/* avoid conflict with <dm/device.h> */
-#ifdef dev_dbg
-#undef dev_dbg
-#endif
-#ifdef dev_vdbg
-#undef dev_vdbg
-#endif
-#ifdef dev_info
-#undef dev_info
-#endif
-#ifdef dev_err
-#undef dev_err
-#endif
-#ifdef dev_warn
-#undef dev_warn
-#endif
-
-#define dev_dbg(dev, fmt, args...) \
- debug(fmt, ##args)
-#define dev_vdbg(dev, fmt, args...) \
- debug(fmt, ##args)
-#define dev_info(dev, fmt, args...) \
- printf(fmt, ##args)
-#define dev_err(dev, fmt, args...) \
- printf(fmt, ##args)
-#define dev_warn(dev, fmt, args...) \
- printf(fmt, ##args)
-
#define GFP_ATOMIC ((gfp_t) 0)
#define GFP_KERNEL ((gfp_t) 0)
#define GFP_NOFS ((gfp_t) 0)
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index 989a5fcbd96..a8fa5d74490 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -956,10 +956,9 @@ enum usb_device_speed {
USB_SPEED_HIGH, /* usb 2.0 */
USB_SPEED_WIRELESS, /* wireless (usb 2.5) */
USB_SPEED_SUPER, /* usb 3.0 */
+ USB_SPEED_SUPER_PLUS, /* usb 3.1 */
};
-#ifdef __KERNEL__
-
/**
* usb_speed_string() - Returns human readable-name of the speed.
* @speed: The speed to return human-readable name for. If it's not
@@ -968,8 +967,6 @@ enum usb_device_speed {
*/
extern const char *usb_speed_string(enum usb_device_speed speed);
-#endif
-
enum usb_device_state {
/* NOTATTACHED isn't in the USB spec, and this state acts
* the same as ATTACHED ... but it's clearer this way.
diff --git a/include/log.h b/include/log.h
index 2859ce1f2e7..4d0692f155d 100644
--- a/include/log.h
+++ b/include/log.h
@@ -17,49 +17,92 @@
struct cmd_tbl;
-/** Log levels supported, ranging from most to least important */
+/**
+ * enum log_level_t - Log levels supported, ranging from most to least important
+ */
enum log_level_t {
- LOGL_EMERG = 0, /* U-Boot is unstable */
- LOGL_ALERT, /* Action must be taken immediately */
- LOGL_CRIT, /* Critical conditions */
- LOGL_ERR, /* Error that prevents something from working */
- LOGL_WARNING, /* Warning may prevent optimial operation */
- LOGL_NOTICE, /* Normal but significant condition, printf() */
- LOGL_INFO, /* General information message */
- LOGL_DEBUG, /* Basic debug-level message */
- LOGL_DEBUG_CONTENT, /* Debug message showing full message content */
- LOGL_DEBUG_IO, /* Debug message showing hardware I/O access */
-
+ /** @LOGL_EMERG: U-Boot is unstable */
+ LOGL_EMERG = 0,
+ /** @LOGL_ALERT: Action must be taken immediately */
+ LOGL_ALERT,
+ /** @LOGL_CRIT: Critical conditions */
+ LOGL_CRIT,
+ /** @LOGL_ERR: Error that prevents something from working */
+ LOGL_ERR,
+ /** @LOGL_WARNING: Warning may prevent optimial operation */
+ LOGL_WARNING,
+ /** @LOGL_NOTICE: Normal but significant condition, printf() */
+ LOGL_NOTICE,
+ /** @LOGL_INFO: General information message */
+ LOGL_INFO,
+ /** @LOGL_DEBUG: Basic debug-level message */
+ LOGL_DEBUG,
+ /** @LOGL_DEBUG_CONTENT: Debug message showing full message content */
+ LOGL_DEBUG_CONTENT,
+ /** @LOGL_DEBUG_IO: Debug message showing hardware I/O access */
+ LOGL_DEBUG_IO,
+
+ /** @LOGL_COUNT: Total number of valid log levels */
LOGL_COUNT,
+ /** @LOGL_NONE: Used to indicate that there is no valid log level */
LOGL_NONE,
+ /** @LOGL_LEVEL_MASK: Mask for valid log levels */
+ LOGL_LEVEL_MASK = 0xf,
+ /** @LOGL_FORCE_DEBUG: Mask to force output due to LOG_DEBUG */
+ LOGL_FORCE_DEBUG = 0x10,
+
+ /** @LOGL_FIRST: The first, most-important log level */
LOGL_FIRST = LOGL_EMERG,
+ /** @LOGL_MAX: The last, least-important log level */
LOGL_MAX = LOGL_DEBUG_IO,
+ /** @LOGL_CONT: Use same log level as in previous call */
+ LOGL_CONT = -1,
};
/**
- * Log categories supported. Most of these correspond to uclasses (i.e.
- * enum uclass_id) but there are also some more generic categories
+ * enum log_category_t - Log categories supported.
+ *
+ * Log categories between %LOGC_FIRST and %LOGC_NONE correspond to uclasses
+ * (i.e. &enum uclass_id), but there are also some more generic categories.
+ *
+ * Remember to update log_cat_name[] after adding a new category.
*/
enum log_category_t {
+ /** @LOGC_FIRST: First log category */
LOGC_FIRST = 0, /* First part mirrors UCLASS_... */
+ /** @LOGC_NONE: Default log category */
LOGC_NONE = UCLASS_COUNT, /* First number is after all uclasses */
- LOGC_ARCH, /* Related to arch-specific code */
- LOGC_BOARD, /* Related to board-specific code */
- LOGC_CORE, /* Related to core features (non-driver-model) */
- LOGC_DM, /* Core driver-model */
- LOGC_DT, /* Device-tree */
- LOGC_EFI, /* EFI implementation */
- LOGC_ALLOC, /* Memory allocation */
- LOGC_SANDBOX, /* Related to the sandbox board */
- LOGC_BLOBLIST, /* Bloblist */
- LOGC_DEVRES, /* Device resources (devres_... functions) */
- /* Advanced Configuration and Power Interface (ACPI) */
+ /** @LOGC_ARCH: Related to arch-specific code */
+ LOGC_ARCH,
+ /** @LOGC_BOARD: Related to board-specific code */
+ LOGC_BOARD,
+ /** @LOGC_CORE: Related to core features (non-driver-model) */
+ LOGC_CORE,
+ /** @LOGC_DM: Core driver-model */
+ LOGC_DM,
+ /** @LOGC_DT: Device-tree */
+ LOGC_DT,
+ /** @LOGC_EFI: EFI implementation */
+ LOGC_EFI,
+ /** @LOGC_ALLOC: Memory allocation */
+ LOGC_ALLOC,
+ /** @LOGC_SANDBOX: Related to the sandbox board */
+ LOGC_SANDBOX,
+ /** @LOGC_BLOBLIST: Bloblist */
+ LOGC_BLOBLIST,
+ /** @LOGC_DEVRES: Device resources (``devres_...`` functions) */
+ LOGC_DEVRES,
+ /** @LOGC_ACPI: Advanced Configuration and Power Interface (ACPI) */
LOGC_ACPI,
- LOGC_COUNT, /* Number of log categories */
- LOGC_END, /* Sentinel value for a list of log categories */
+ /** @LOGC_COUNT: Number of log categories */
+ LOGC_COUNT,
+ /** @LOGC_END: Sentinel value for lists of log categories */
+ LOGC_END,
+ /** @LOGC_CONT: Use same category as in previous call */
+ LOGC_CONT = -1,
};
/* Helper to cast a uclass ID to a log category */
@@ -78,7 +121,7 @@ static inline int log_uc_cat(enum uclass_id id)
* @func: Function where log record was generated
* @fmt: printf() format string for log record
* @...: Optional parameters, according to the format string @fmt
- * @return 0 if log record was emitted, -ve on error
+ * Return: 0 if log record was emitted, -ve on error
*/
int _log(enum log_category_t cat, enum log_level_t level, const char *file,
int line, const char *func, const char *fmt, ...)
@@ -133,7 +176,7 @@ static inline int _log_nop(enum log_category_t cat, enum log_level_t level,
#if CONFIG_IS_ENABLED(LOG)
#ifdef LOG_DEBUG
-#define _LOG_DEBUG 1
+#define _LOG_DEBUG LOGL_FORCE_DEBUG
#else
#define _LOG_DEBUG 0
#endif
@@ -141,9 +184,11 @@ static inline int _log_nop(enum log_category_t cat, enum log_level_t level,
/* Emit a log record if the level is less that the maximum */
#define log(_cat, _level, _fmt, _args...) ({ \
int _l = _level; \
- if (CONFIG_IS_ENABLED(LOG) && (_l <= _LOG_MAX_LEVEL || _LOG_DEBUG)) \
- _log((enum log_category_t)(_cat), _l, __FILE__, __LINE__, \
- __func__, \
+ if (CONFIG_IS_ENABLED(LOG) && \
+ (_LOG_DEBUG != 0 || _l <= _LOG_MAX_LEVEL)) \
+ _log((enum log_category_t)(_cat), \
+ (enum log_level_t)(_l | _LOG_DEBUG), __FILE__, \
+ __LINE__, __func__, \
pr_fmt(_fmt), ##_args); \
})
#else
@@ -231,7 +276,7 @@ void __assert_fail(const char *assertion, const char *file, unsigned int line,
* full pathname as it may be huge. Only use this when the user should be
* warning, similar to BUG_ON() in linux.
*
- * @return true if assertion succeeded (condition is true), else false
+ * Return: true if assertion succeeded (condition is true), else false
*/
#define assert_noisy(x) \
({ bool _val = (x); \
@@ -279,8 +324,12 @@ void __assert_fail(const char *assertion, const char *file, unsigned int line,
* Memebers marked as 'allocated' are allocated (e.g. via strdup()) by the log
* system.
*
+ * TODO(sjg@chromium.org): Compress this struct down a bit to reduce space, e.g.
+ * a single u32 for cat, level, line and force_debug
+ *
* @cat: Category, representing a uclass or part of U-Boot
* @level: Severity level, less severe is higher
+ * @force_debug: Force output of debug
* @file: Name of file where the log record was generated (not allocated)
* @line: Line number where the log record was generated
* @func: Function where the log record was generated (not allocated)
@@ -289,6 +338,7 @@ void __assert_fail(const char *assertion, const char *file, unsigned int line,
struct log_rec {
enum log_category_t cat;
enum log_level_t level;
+ bool force_debug;
const char *file;
int line;
const char *func;
@@ -297,20 +347,28 @@ struct log_rec {
struct log_device;
+enum log_device_flags {
+ LOGDF_ENABLE = BIT(0), /* Device is enabled */
+};
+
/**
* struct log_driver - a driver which accepts and processes log records
*
* @name: Name of driver
+ * @emit: Method to call to emit a log record via this device
+ * @flags: Initial value for flags (use LOGDF_ENABLE to enable on start-up)
*/
struct log_driver {
const char *name;
+
/**
- * emit() - emit a log record
+ * @emit: emit a log record
*
* Called by the log system to pass a log record to a particular driver
* for processing. The filter is checked before calling this function.
*/
int (*emit)(struct log_device *ldev, struct log_rec *rec);
+ unsigned short flags;
};
/**
@@ -323,12 +381,14 @@ struct log_driver {
* @next_filter_num: Seqence number of next filter filter added (0=no filters
* yet). This increments with each new filter on the device, but never
* decrements
+ * @flags: Flags for this filter (enum log_device_flags)
* @drv: Pointer to driver for this device
* @filter_head: List of filters for this device
* @sibling_node: Next device in the list of all devices
*/
struct log_device {
- int next_filter_num;
+ unsigned short next_filter_num;
+ unsigned short flags;
struct log_driver *drv;
struct list_head filter_head;
struct list_head sibling_node;
@@ -338,21 +398,32 @@ enum {
LOGF_MAX_CATEGORIES = 5, /* maximum categories per filter */
};
+/**
+ * enum log_filter_flags - Flags which modify a filter
+ */
enum log_filter_flags {
- LOGFF_HAS_CAT = 1 << 0, /* Filter has a category list */
+ /** @LOGFF_HAS_CAT: Filter has a category list */
+ LOGFF_HAS_CAT = 1 << 0,
+ /** @LOGFF_DENY: Filter denies matching messages */
+ LOGFF_DENY = 1 << 1,
+ /** @LOGFF_LEVEL_MIN: Filter's level is a minimum, not a maximum */
+ LOGFF_LEVEL_MIN = 1 << 2,
};
/**
* struct log_filter - criterial to filter out log messages
*
+ * If a message matches all criteria, then it is allowed. If LOGFF_DENY is set,
+ * then it is denied instead.
+ *
* @filter_num: Sequence number of this filter. This is returned when adding a
* new filter, and must be provided when removing a previously added
* filter.
- * @flags: Flags for this filter (LOGFF_...)
- * @cat_list: List of categories to allow (terminated by LOGC_none). If empty
- * then all categories are permitted. Up to LOGF_MAX_CATEGORIES entries
+ * @flags: Flags for this filter (``LOGFF_...``)
+ * @cat_list: List of categories to allow (terminated by %LOGC_END). If empty
+ * then all categories are permitted. Up to %LOGF_MAX_CATEGORIES entries
* can be provided
- * @max_level: Maximum log level to allow
+ * @level: Maximum (or minimum, if %LOGFF_MIN_LEVEL) log level to allow
* @file_list: List of files to allow, separated by comma. If NULL then all
* files are permitted
* @sibling_node: Next filter in the list of filters for this log device
@@ -361,7 +432,7 @@ struct log_filter {
int filter_num;
int flags;
enum log_category_t cat_list[LOGF_MAX_CATEGORIES];
- enum log_level_t max_level;
+ enum log_level_t level;
const char *file_list;
struct list_head sibling_node;
};
@@ -369,12 +440,17 @@ struct log_filter {
#define LOG_DRIVER(_name) \
ll_entry_declare(struct log_driver, _name, log_driver)
+/* Get a pointer to a given driver */
+#define LOG_GET_DRIVER(__name) \
+ ll_entry_get(struct log_driver, __name, log_driver)
+
/**
* log_get_cat_name() - Get the name of a category
*
* @cat: Category to look up
- * @return category name (which may be a uclass driver name) if found, or
- * "<invalid>" if invalid, or "<missing>" if not found
+ * Return: category name (which may be a uclass driver name) if found, or
+ * "<invalid>" if invalid, or "<missing>" if not found. All error
+ * responses begin with '<'.
*/
const char *log_get_cat_name(enum log_category_t cat);
@@ -382,7 +458,7 @@ const char *log_get_cat_name(enum log_category_t cat);
* log_get_cat_by_name() - Look up a category by name
*
* @name: Name to look up
- * @return category ID, or LOGC_NONE if not found
+ * Return: Category, or %LOGC_NONE if not found
*/
enum log_category_t log_get_cat_by_name(const char *name);
@@ -390,7 +466,7 @@ enum log_category_t log_get_cat_by_name(const char *name);
* log_get_level_name() - Get the name of a log level
*
* @level: Log level to look up
- * @return log level name (in ALL CAPS)
+ * Return: Log level name (in ALL CAPS)
*/
const char *log_get_level_name(enum log_level_t level);
@@ -398,10 +474,41 @@ const char *log_get_level_name(enum log_level_t level);
* log_get_level_by_name() - Look up a log level by name
*
* @name: Name to look up
- * @return log level ID, or LOGL_NONE if not found
+ * Return: Log level, or %LOGL_NONE if not found
*/
enum log_level_t log_get_level_by_name(const char *name);
+/**
+ * log_device_find_by_name() - Look up a log device by its driver's name
+ *
+ * @drv_name: Name of the driver
+ * Return: the log device, or %NULL if not found
+ */
+struct log_device *log_device_find_by_name(const char *drv_name);
+
+/**
+ * log_has_cat() - check if a log category exists within a list
+ *
+ * @cat_list: List of categories to check, at most %LOGF_MAX_CATEGORIES entries
+ * long, terminated by %LC_END if fewer
+ * @cat: Category to search for
+ *
+ * Return: ``true`` if @cat is in @cat_list, else ``false``
+ */
+bool log_has_cat(enum log_category_t cat_list[], enum log_category_t cat);
+
+/**
+ * log_has_file() - check if a file is with a list
+ *
+ * @file_list: List of files to check, separated by comma
+ * @file: File to check for. This string is matched against the end of each
+ * file in the list, i.e. ignoring any preceding path. The list is
+ * intended to consist of relative pathnames, e.g. common/main.c,cmd/log.c
+ *
+ * Return: ``true`` if @file is in @file_list, else ``false``
+ */
+bool log_has_file(const char *file_list, const char *file);
+
/* Log format flags (bit numbers) for gd->log_fmt. See log_fmt_chars */
enum log_fmt {
LOGF_CAT = 0,
@@ -419,21 +526,48 @@ enum log_fmt {
int do_log_test(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
/**
+ * log_add_filter_flags() - Add a new filter to a log device, specifying flags
+ *
+ * @drv_name: Driver name to add the filter to (since each driver only has a
+ * single device)
+ * @flags: Flags for this filter (``LOGFF_...``)
+ * @cat_list: List of categories to allow (terminated by %LOGC_END). If empty
+ * then all categories are permitted. Up to %LOGF_MAX_CATEGORIES entries
+ * can be provided
+ * @level: Maximum (or minimum, if %LOGFF_LEVEL_MIN) log level to allow
+ * @file_list: List of files to allow, separated by comma. If NULL then all
+ * files are permitted
+ * Return:
+ * the sequence number of the new filter (>=0) if the filter was added, or a
+ * -ve value on error
+ */
+int log_add_filter_flags(const char *drv_name, enum log_category_t cat_list[],
+ enum log_level_t level, const char *file_list,
+ int flags);
+
+/**
* log_add_filter() - Add a new filter to a log device
*
* @drv_name: Driver name to add the filter to (since each driver only has a
* single device)
- * @cat_list: List of categories to allow (terminated by LOGC_none). If empty
- * then all categories are permitted. Up to LOGF_MAX_CATEGORIES entries
+ * @cat_list: List of categories to allow (terminated by %LOGC_END). If empty
+ * then all categories are permitted. Up to %LOGF_MAX_CATEGORIES entries
* can be provided
* @max_level: Maximum log level to allow
- * @file_list: List of files to allow, separated by comma. If NULL then all
+ * @file_list: List of files to allow, separated by comma. If %NULL then all
* files are permitted
- * @return the sequence number of the new filter (>=0) if the filter was added,
- * or a -ve value on error
+ * Return:
+ * the sequence number of the new filter (>=0) if the filter was added, or a
+ * -ve value on error
*/
-int log_add_filter(const char *drv_name, enum log_category_t cat_list[],
- enum log_level_t max_level, const char *file_list);
+static inline int log_add_filter(const char *drv_name,
+ enum log_category_t cat_list[],
+ enum log_level_t max_level,
+ const char *file_list)
+{
+ return log_add_filter_flags(drv_name, cat_list, max_level, file_list,
+ 0);
+}
/**
* log_remove_filter() - Remove a filter from a log device
@@ -441,16 +575,30 @@ int log_add_filter(const char *drv_name, enum log_category_t cat_list[],
* @drv_name: Driver name to remove the filter from (since each driver only has
* a single device)
* @filter_num: Filter number to remove (as returned by log_add_filter())
- * @return 0 if the filter was removed, -ENOENT if either the driver or the
- * filter number was not found
+ * Return:
+ * 0 if the filter was removed, -%ENOENT if either the driver or the filter
+ * number was not found
*/
int log_remove_filter(const char *drv_name, int filter_num);
+/**
+ * log_device_set_enable() - Enable or disable a log device
+ *
+ * Devices are referenced by their driver, so use LOG_GET_DRIVER(name) to pass
+ * the driver to this function. For example if the driver is declared with
+ * LOG_DRIVER(wibble) then pass LOG_GET_DRIVER(wibble) here.
+ *
+ * @drv: Driver of device to enable
+ * @enable: true to enable, false to disable
+ * @return 0 if OK, -ENOENT if the driver was not found
+ */
+int log_device_set_enable(struct log_driver *drv, bool enable);
+
#if CONFIG_IS_ENABLED(LOG)
/**
* log_init() - Set up the log system ready for use
*
- * @return 0 if OK, -ENOMEM if out of memory
+ * Return: 0 if OK, -%ENOMEM if out of memory
*/
int log_init(void);
#else
@@ -464,7 +612,7 @@ static inline int log_init(void)
* log_get_default_format() - get default log format
*
* The default log format is configurable via
- * CONFIG_LOGF_FILE, CONFIG_LOGF_LINE, CONFIG_LOGF_FUNC.
+ * %CONFIG_LOGF_FILE, %CONFIG_LOGF_LINE, and %CONFIG_LOGF_FUNC.
*
* Return: default log format
*/
diff --git a/include/mipi_dsi.h b/include/mipi_dsi.h
index c8a7d3daefa..4ca05f71e29 100644
--- a/include/mipi_dsi.h
+++ b/include/mipi_dsi.h
@@ -97,6 +97,20 @@ struct mipi_dsi_host_ops {
};
/**
+ * struct mipi_dsi_phy_timing - DSI host phy timings
+ * @data_hs2lp: High Speed to Low Speed Data Transition Time
+ * @data_lp2hs: Low Speed to High Speed Data Transition Time
+ * @clk_hs2lp: High Speed to Low Speed Clock Transition Time
+ * @clk_lp2hs: Low Speed to High Speed Clock Transition Time
+ */
+struct mipi_dsi_phy_timing {
+ u16 data_hs2lp;
+ u16 data_lp2hs;
+ u16 clk_hs2lp;
+ u16 clk_lp2hs;
+};
+
+/**
* struct mipi_dsi_phy_ops - DSI host physical operations
* @init: initialized host physical part
* @get_lane_mbps: get lane bitrate per lane (mbps)
@@ -107,6 +121,9 @@ struct mipi_dsi_phy_ops {
int (*get_lane_mbps)(void *priv_data, struct display_timing *timings,
u32 lanes, u32 format, unsigned int *lane_mbps);
void (*post_set_mode)(void *priv_data, unsigned long mode_flags);
+ int (*get_timing)(void *priv_data, unsigned int lane_mbps,
+ struct mipi_dsi_phy_timing *timing);
+ void (*get_esc_clk_rate)(void *priv_data, unsigned int *esc_clk_rate);
};
/**
diff --git a/include/mmc.h b/include/mmc.h
index 75bcaaf6b35..1d377e0281f 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -360,6 +360,19 @@ enum mmc_voltage {
#define MMC_NUM_BOOT_PARTITION 2
#define MMC_PART_RPMB 3 /* RPMB partition number */
+/* timing specification used */
+#define MMC_TIMING_LEGACY 0
+#define MMC_TIMING_MMC_HS 1
+#define MMC_TIMING_SD_HS 2
+#define MMC_TIMING_UHS_SDR12 3
+#define MMC_TIMING_UHS_SDR25 4
+#define MMC_TIMING_UHS_SDR50 5
+#define MMC_TIMING_UHS_SDR104 6
+#define MMC_TIMING_UHS_DDR50 7
+#define MMC_TIMING_MMC_DDR52 8
+#define MMC_TIMING_MMC_HS200 9
+#define MMC_TIMING_MMC_HS400 10
+
/* Driver model support */
/**
@@ -422,6 +435,14 @@ struct dm_mmc_ops {
*/
int (*deferred_probe)(struct udevice *dev);
/**
+ * reinit() - Re-initialization to clear old configuration for
+ * mmc rescan.
+ *
+ * @dev: Device to reinit
+ * @return 0 if Ok, -ve if error
+ */
+ int (*reinit)(struct udevice *dev);
+ /**
* send_cmd() - Send a command to the MMC device
*
* @dev: Device to receive the command
@@ -505,6 +526,14 @@ struct dm_mmc_ops {
* @return maximum number of blocks for this transfer
*/
int (*get_b_max)(struct udevice *dev, void *dst, lbaint_t blkcnt);
+
+ /**
+ * hs400_prepare_ddr - prepare to switch to DDR mode
+ *
+ * @dev: Device to check
+ * @return 0 if success, -ve on error
+ */
+ int (*hs400_prepare_ddr)(struct udevice *dev);
};
#define mmc_get_ops(dev) ((struct dm_mmc_ops *)(dev)->driver->ops)
@@ -518,6 +547,7 @@ int dm_mmc_execute_tuning(struct udevice *dev, uint opcode);
int dm_mmc_wait_dat0(struct udevice *dev, int state, int timeout_us);
int dm_mmc_host_power_cycle(struct udevice *dev);
int dm_mmc_deferred_probe(struct udevice *dev);
+int dm_mmc_reinit(struct udevice *dev);
int dm_mmc_get_b_max(struct udevice *dev, void *dst, lbaint_t blkcnt);
/* Transition functions for compatibility */
@@ -529,8 +559,9 @@ int mmc_wait_dat0(struct mmc *mmc, int state, int timeout_us);
int mmc_set_enhanced_strobe(struct mmc *mmc);
int mmc_host_power_cycle(struct mmc *mmc);
int mmc_deferred_probe(struct mmc *mmc);
+int mmc_reinit(struct mmc *mmc);
int mmc_get_b_max(struct mmc *mmc, void *dst, lbaint_t blkcnt);
-
+int mmc_hs400_prepare_ddr(struct mmc *mmc);
#else
struct mmc_ops {
int (*send_cmd)(struct mmc *mmc,
@@ -542,6 +573,11 @@ struct mmc_ops {
int (*host_power_cycle)(struct mmc *mmc);
int (*get_b_max)(struct mmc *mmc, void *dst, lbaint_t blkcnt);
};
+
+static inline int mmc_hs400_prepare_ddr(struct mmc *mmc)
+{
+ return 0;
+}
#endif
struct mmc_config {
@@ -697,6 +733,7 @@ struct mmc {
* accessing the boot partitions
*/
u32 quirks;
+ u8 hs400_tuning;
};
struct mmc_hwpart_conf {
diff --git a/include/mux-internal.h b/include/mux-internal.h
new file mode 100644
index 00000000000..93e3a5cdd74
--- /dev/null
+++ b/include/mux-internal.h
@@ -0,0 +1,109 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Based on the linux multiplexer framework
+ *
+ * Copyright (C) 2017 Axentia Technologies AB
+ * Author: Peter Rosin <peda@axentia.se>
+ *
+ * Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
+ * Jean-Jacques Hiblot <jjhiblot@ti.com>
+ */
+
+#ifndef _MUX_INTERNAL_H
+#define _MUX_INTERNAL_H
+
+/* See mux.h for background documentation. */
+
+struct ofnode_phandle_args;
+
+/**
+ * struct mux_chip - Represents a chip holding mux controllers.
+ * @controllers: Number of mux controllers handled by the chip.
+ * @mux: Array of mux controllers that are handled.
+ *
+ * This a per-device uclass-private data.
+ */
+struct mux_chip {
+ unsigned int controllers;
+ struct mux_control *mux;
+};
+
+/**
+ * struct mux_control_ops - Mux controller operations for a mux chip.
+ * @set: Set the state of the given mux controller.
+ */
+struct mux_control_ops {
+ /**
+ * set - Apply a state to a multiplexer control
+ *
+ * @mux: A multiplexer control
+ * @return 0 if OK, or a negative error code.
+ */
+ int (*set)(struct mux_control *mux, int state);
+
+ /**
+ * of_xlate - Translate a client's device-tree (OF) multiplexer
+ * specifier.
+ *
+ * If this function pointer is set to NULL, the multiplexer core will
+ * use a default implementation, which assumes #mux-control-cells = <1>
+ * and that the DT cell contains a simple integer channel ID.
+ *
+ * @dev_mux: The multiplexer device. A single device may handle
+ * several multiplexer controls.
+ * @args: The multiplexer specifier values from device tree.
+ * @muxp: (out) A multiplexer control
+ * @return 0 if OK, or a negative error code.
+ */
+ int (*of_xlate)(struct mux_chip *dev_mux,
+ struct ofnode_phandle_args *args,
+ struct mux_control **muxp);
+};
+
+/**
+ * struct mux_control - Represents a mux controller.
+ * @in_use: Whether the mux controller is in use or not.
+ * @dev: The client device.
+ * @cached_state: The current mux controller state, or -1 if none.
+ * @states: The number of mux controller states.
+ * @idle_state: The mux controller state to use when inactive, or one
+ * of MUX_IDLE_AS_IS and MUX_IDLE_DISCONNECT.
+ * @id: The index of the mux controller within the mux chip
+ * it is a part of.
+ *
+ * Mux drivers may only change @states and @idle_state, and may only do so
+ * between allocation and registration of the mux controller. Specifically,
+ * @cached_state is internal to the mux core and should never be written by
+ * mux drivers.
+ */
+struct mux_control {
+ bool in_use;
+ struct udevice *dev;
+ int cached_state;
+ unsigned int states;
+ int idle_state;
+ int id;
+};
+
+/**
+ * mux_control_get_index() - Get the index of the given mux controller
+ * @mux: The mux-control to get the index for.
+ *
+ * Return: The index of the mux controller within the mux chip the mux
+ * controller is a part of.
+ */
+static inline unsigned int mux_control_get_index(struct mux_control *mux)
+{
+ return mux->id;
+}
+
+/**
+ * mux_alloc_controllers() - Allocate the given number of mux controllers.
+ * @dev: The client device.
+ * controllers: Number of controllers to allocate.
+ *
+ * Return: 0 of OK, -errno otherwise.
+ */
+int mux_alloc_controllers(struct udevice *dev, unsigned int controllers);
+
+#endif
diff --git a/include/mux.h b/include/mux.h
new file mode 100644
index 00000000000..23844f480ac
--- /dev/null
+++ b/include/mux.h
@@ -0,0 +1,159 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Based on the linux multiplexer framework
+ *
+ * At its core, a multiplexer (or mux), also known as a data selector, is a
+ * device that selects between several analog or digital input signals and
+ * forwards it to a single output line. This notion can be extended to work
+ * with buses, like a I2C bus multiplexer for example.
+ *
+ * Copyright (C) 2017 Axentia Technologies AB
+ * Author: Peter Rosin <peda@axentia.se>
+ *
+ * Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
+ * Jean-Jacques Hiblot <jjhiblot@ti.com>
+ */
+
+#ifndef _MUX_H_
+#define _MUX_H_
+
+#include <linux/errno.h>
+#include <linux/types.h>
+
+struct udevice;
+struct mux_control;
+
+#if CONFIG_IS_ENABLED(MULTIPLEXER)
+/**
+ * mux_control_states() - Query the number of multiplexer states.
+ * @mux: The mux-control to query.
+ *
+ * Return: The number of multiplexer states.
+ */
+unsigned int mux_control_states(struct mux_control *mux);
+
+/**
+ * mux_control_select() - Select the given multiplexer state.
+ * @mux: The mux-control to request a change of state from.
+ * @state: The new requested state.
+ *
+ * On successfully selecting the mux-control state, it will be locked until
+ * there is a call to mux_control_deselect(). If the mux-control is already
+ * selected when mux_control_select() is called, the function will indicate
+ * -EBUSY
+ *
+ * Therefore, make sure to call mux_control_deselect() when the operation is
+ * complete and the mux-control is free for others to use, but do not call
+ * mux_control_deselect() if mux_control_select() fails.
+ *
+ * Return: 0 when the mux-control state has the requested state or a negative
+ * errno on error.
+ */
+int __must_check mux_control_select(struct mux_control *mux,
+ unsigned int state);
+#define mux_control_try_select(mux) mux_control_select(mux)
+
+/**
+ * mux_control_deselect() - Deselect the previously selected multiplexer state.
+ * @mux: The mux-control to deselect.
+ *
+ * It is required that a single call is made to mux_control_deselect() for
+ * each and every successful call made to either of mux_control_select() or
+ * mux_control_try_select().
+ *
+ * Return: 0 on success and a negative errno on error. An error can only
+ * occur if the mux has an idle state. Note that even if an error occurs, the
+ * mux-control is unlocked and is thus free for the next access.
+ */
+int mux_control_deselect(struct mux_control *mux);
+
+/**
+ * mux_get_by_index() = Get a mux by integer index.
+ * @dev: The client device.
+ * @index: The index of the mux to get.
+ * @mux: A pointer to the 'mux_control' struct to initialize.
+ *
+ * This looks up and initializes a mux. The index is relative to the client
+ * device.
+ *
+ * Return: 0 if OK, or a negative error code.
+ */
+int mux_get_by_index(struct udevice *dev, int index, struct mux_control **mux);
+
+/**
+ * mux_control_get() - Get the mux-control for a device.
+ * @dev: The device that needs a mux-control.
+ * @mux_name: The name identifying the mux-control.
+ * @mux: A pointer to the mux-control pointer.
+ *
+ * Return: 0 of OK, or a negative error code.
+ */
+int mux_control_get(struct udevice *dev, const char *name,
+ struct mux_control **mux);
+
+/**
+ * mux_control_put() - Put away the mux-control for good.
+ * @mux: The mux-control to put away.
+ *
+ * mux_control_put() reverses the effects of mux_control_get().
+ */
+void mux_control_put(struct mux_control *mux);
+
+/**
+ * devm_mux_control_get() - Get the mux-control for a device, with resource
+ * management.
+ * @dev: The device that needs a mux-control.
+ * @mux_name: The name identifying the mux-control.
+ *
+ * Return: Pointer to the mux-control, or an ERR_PTR with a negative errno.
+ */
+struct mux_control *devm_mux_control_get(struct udevice *dev,
+ const char *mux_name);
+/**
+ * dm_mux_init() - Initialize the multiplexer controls to their default state.
+ *
+ * Return: 0 if OK, -errno otherwise.
+ */
+int dm_mux_init(void);
+
+#else
+unsigned int mux_control_states(struct mux_control *mux)
+{
+ return -ENOSYS;
+}
+
+int __must_check mux_control_select(struct mux_control *mux,
+ unsigned int state)
+{
+ return -ENOSYS;
+}
+
+#define mux_control_try_select(mux) mux_control_select(mux)
+
+int mux_control_deselect(struct mux_control *mux)
+{
+ return -ENOSYS;
+}
+
+struct mux_control *mux_control_get(struct udevice *dev, const char *mux_name)
+{
+ return NULL;
+}
+
+void mux_control_put(struct mux_control *mux)
+{
+}
+
+struct mux_control *devm_mux_control_get(struct udevice *dev,
+ const char *mux_name)
+{
+ return NULL;
+}
+
+int dm_mux_init(void)
+{
+ return -ENOSYS;
+}
+#endif
+
+#endif
diff --git a/include/net.h b/include/net.h
index 219107194f7..aff6674bb3e 100644
--- a/include/net.h
+++ b/include/net.h
@@ -44,6 +44,9 @@ struct udevice;
#define PKTALIGN ARCH_DMA_MINALIGN
+/* Number of packets processed together */
+#define ETH_PACKETS_BATCH_RECV 32
+
/* ARP hardware address length */
#define ARP_HLEN 6
/*
@@ -593,7 +596,7 @@ extern int net_ntp_time_offset; /* offset time from UTC */
#endif
/* Initialize the network adapter */
-void net_init(void);
+int net_init(void);
int net_loop(enum proto_t);
/* Load failed. Start again. */
diff --git a/include/pci.h b/include/pci.h
index 1c5b36617e3..d1ccf6c9636 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -495,12 +495,18 @@
#define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */
#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
#define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */
+#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */
+#define PCI_EXP_DEVCAP2_ARI 0x00000020 /* ARI Forwarding Supported */
+#define PCI_EXP_DEVCTL2 40 /* Device Control 2 */
+#define PCI_EXP_DEVCTL2_ARI 0x0020 /* Alternative Routing-ID */
+
#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
/* Single Root I/O Virtualization Registers */
#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */
#define PCI_SRIOV_CTRL 0x08 /* SR-IOV Control */
#define PCI_SRIOV_CTRL_VFE 0x01 /* VF Enable */
#define PCI_SRIOV_CTRL_MSE 0x08 /* VF Memory Space Enable */
+#define PCI_SRIOV_CTRL_ARI 0x10 /* ARI Capable Hierarchy */
#define PCI_SRIOV_INITIAL_VF 0x0c /* Initial VFs */
#define PCI_SRIOV_TOTAL_VF 0x0e /* Total VFs */
#define PCI_SRIOV_NUM_VF 0x10 /* Number of VFs */
diff --git a/include/power/regulator.h b/include/power/regulator.h
index 74938dd61e4..7f278e8c7dc 100644
--- a/include/power/regulator.h
+++ b/include/power/regulator.h
@@ -264,6 +264,7 @@ struct dm_regulator_ops {
int (*set_mode)(struct udevice *dev, int mode_id);
};
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
/**
* regulator_mode: returns a pointer to the array of regulator mode info
*
@@ -524,5 +525,118 @@ int regulator_get_by_platname(const char *platname, struct udevice **devp);
*/
int device_get_supply_regulator(struct udevice *dev, const char *supply_name,
struct udevice **devp);
+#else
+static inline int regulator_mode(struct udevice *dev, struct dm_regulator_mode **modep)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_get_value(struct udevice *dev)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_set_value(struct udevice *dev, int uV)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_set_suspend_value(struct udevice *dev, int uV)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_get_suspend_value(struct udevice *dev)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_set_value_force(struct udevice *dev, int uV)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_get_current(struct udevice *dev)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_set_current(struct udevice *dev, int uA)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_get_enable(struct udevice *dev)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_set_enable(struct udevice *dev, bool enable)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_set_enable_if_allowed(struct udevice *dev, bool enable)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_set_suspend_enable(struct udevice *dev, bool enable)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_get_suspend_enable(struct udevice *dev)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_get_mode(struct udevice *dev)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_set_mode(struct udevice *dev, int mode_id)
+{
+ return -ENOSYS;
+}
+
+static inline int regulators_enable_boot_on(bool verbose)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_autoset(struct udevice *dev)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_autoset_by_name(const char *platname, struct udevice **devp)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_list_autoset(const char *list_platname[], struct udevice *list_devp[],
+ bool verbose)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_get_by_devname(const char *devname, struct udevice **devp)
+{
+ return -ENOSYS;
+}
+
+static inline int regulator_get_by_platname(const char *platname, struct udevice **devp)
+{
+ return -ENOSYS;
+}
+
+static inline int device_get_supply_regulator(struct udevice *dev, const char *supply_name,
+ struct udevice **devp)
+{
+ return -ENOSYS;
+}
+#endif
#endif /* _INCLUDE_REGULATOR_H_ */
diff --git a/include/sdhci.h b/include/sdhci.h
index 94fc3ed56ac..1fd20ec0860 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -244,6 +244,7 @@
#define SDHCI_QUIRK_BROKEN_HISPD_MODE BIT(5)
#define SDHCI_QUIRK_WAIT_SEND_CMD (1 << 6)
#define SDHCI_QUIRK_USE_WIDE8 (1 << 8)
+#define SDHCI_QUIRK_NO_1_8_V (1 << 9)
/* to make gcc happy */
struct sdhci_host;
@@ -271,7 +272,6 @@ struct sdhci_ops {
int (*deferred_probe)(struct sdhci_host *host);
};
-#if CONFIG_IS_ENABLED(MMC_SDHCI_ADMA)
#define ADMA_MAX_LEN 65532
#ifdef CONFIG_DMA_ADDR_T_64BIT
#define ADMA_DESC_LEN 16
@@ -302,7 +302,7 @@ struct sdhci_adma_desc {
u32 addr_hi;
#endif
} __packed;
-#endif
+
struct sdhci_host {
const char *name;
void *ioaddr;
@@ -334,7 +334,6 @@ struct sdhci_host {
dma_addr_t adma_addr;
#if CONFIG_IS_ENABLED(MMC_SDHCI_ADMA)
struct sdhci_adma_desc *adma_desc_table;
- uint desc_slot;
#endif
};
@@ -496,4 +495,8 @@ extern const struct dm_mmc_ops sdhci_ops;
#else
#endif
+struct sdhci_adma_desc *sdhci_adma_init(void);
+void sdhci_prepare_adma_table(struct sdhci_adma_desc *table,
+ struct mmc_data *data, dma_addr_t addr);
+
#endif /* __SDHCI_HW_H */
diff --git a/include/stdio.h b/include/stdio.h
index aedf3744525..039f7df6892 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -5,7 +5,7 @@
#include <linux/compiler.h>
/* stdin */
-int getc(void);
+int getchar(void);
int tstc(void);
/* stdout */
diff --git a/include/test/log.h b/include/test/log.h
index c661cde75a3..e9028914500 100644
--- a/include/test/log.h
+++ b/include/test/log.h
@@ -10,7 +10,10 @@
#include <test/test.h>
+#define LOGF_TEST (BIT(LOGF_FUNC) | BIT(LOGF_MSG))
+
/* Declare a new logging test */
#define LOG_TEST(_name) UNIT_TEST(_name, 0, log_test)
+#define LOG_TEST_FLAGS(_name, _flags) UNIT_TEST(_name, _flags, log_test)
#endif /* __TEST_LOG_H__ */
diff --git a/include/test/test.h b/include/test/test.h
index 67c7d69d488..03e29290bf4 100644
--- a/include/test/test.h
+++ b/include/test/test.h
@@ -94,4 +94,15 @@ enum {
TEST_DEVRES_SIZE3 = 37,
};
+/**
+ * dm_test_main() - Run driver model tests
+ *
+ * Run all the available driver model tests, or a selection
+ *
+ * @test_name: Name of single test to run (e.g. "dm_test_fdt_pre_reloc" or just
+ * "fdt_pre_reloc"), or NULL to run all
+ * @return 0 if all tests passed, 1 if not
+ */
+int dm_test_main(const char *test_name);
+
#endif /* __TEST_TEST_H */
diff --git a/include/timer.h b/include/timer.h
index 8b9fa51c53d..a044cb034ed 100644
--- a/include/timer.h
+++ b/include/timer.h
@@ -6,12 +6,12 @@
#ifndef _TIMER_H_
#define _TIMER_H_
-/*
- * dm_timer_init - initialize a timer for time keeping. On success
+/**
+ * dm_timer_init() - initialize a timer for time keeping. On success
* initializes gd->timer so that lib/timer can use it for future
* referrence.
*
- * @return - 0 on success or error number
+ * Return: 0 on success or error number
*/
int dm_timer_init(void);
@@ -30,49 +30,54 @@ int dm_timer_init(void);
*/
int timer_timebase_fallback(struct udevice *dev);
-/*
- * timer_conv_64 - convert 32-bit counter value to 64-bit
- *
+/**
+ * timer_conv_64() - convert 32-bit counter value to 64-bit
* @count: 32-bit counter value
- * @return: 64-bit counter value
+ *
+ * Return: 64-bit counter value
*/
u64 timer_conv_64(u32 count);
-/*
- * Get the current timer count
- *
+/**
+ * timer_get_count() - Get the current timer count
* @dev: The timer device
* @count: pointer that returns the current timer count
- * @return: 0 if OK, -ve on error
+ *
+ * Return: 0 if OK, -ve on error
*/
int timer_get_count(struct udevice *dev, u64 *count);
-/*
- * Get the timer input clock frequency
- *
+/**
+ * timer_get_rate() - Get the timer input clock frequency
* @dev: The timer device
- * @return: the timer input clock frequency
+ *
+ * Return: the timer input clock frequency
*/
unsigned long timer_get_rate(struct udevice *dev);
-/*
+/**
* struct timer_ops - Driver model timer operations
*
* The uclass interface is implemented by all timer devices which use
* driver model.
*/
struct timer_ops {
- /*
- * Get the current timer count
+ /**
+ * @get_count: Get the current timer count
*
* @dev: The timer device
- * @count: pointer that returns the current 64-bit timer count
- * @return: 0 if OK, -ve on error
+ *
+ * This function may be called at any time after the driver is probed.
+ * All necessary initialization must be completed by the time probe()
+ * returns. The count returned by this functions should be monotonic.
+ * This function must succeed.
+ *
+ * Return: The current 64-bit timer count
*/
- int (*get_count)(struct udevice *dev, u64 *count);
+ u64 (*get_count)(struct udevice *dev);
};
-/*
+/**
* struct timer_dev_priv - information about a device used by the uclass
*
* @clock_rate: the timer input clock frequency
@@ -84,7 +89,7 @@ struct timer_dev_priv {
/**
* timer_early_get_count() - Implement timer_get_count() before driver model
*
- * If CONFIG_TIMER_EARLY is enabled, this function wil be called to return
+ * If ``CONFIG_TIMER_EARLY`` is enabled, this function wil be called to return
* the current timer value before the proper driver model timer is ready.
* It should be implemented by one of the timer values. This is mostly useful
* for tracing.
@@ -94,7 +99,7 @@ u64 timer_early_get_count(void);
/**
* timer_early_get_rate() - Get the timer rate before driver model
*
- * If CONFIG_TIMER_EARLY is enabled, this function wil be called to return
+ * If ``CONFIG_TIMER_EARLY`` is enabled, this function wil be called to return
* the current timer rate in Hz before the proper driver model timer is ready.
* It should be implemented by one of the timer values. This is mostly useful
* for tracing. This corresponds to the clock_rate value in struct
diff --git a/include/u-boot/aes.h b/include/u-boot/aes.h
index 32281041de2..acbc50b9e6f 100644
--- a/include/u-boot/aes.h
+++ b/include/u-boot/aes.h
@@ -13,7 +13,8 @@
int image_aes_encrypt(struct image_cipher_info *info,
const unsigned char *data, int size,
unsigned char **cipher, int *cipher_len);
-int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest);
+int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest,
+ void *fit, int node_noffset);
#else
int image_aes_encrypt(struct image_cipher_info *info,
const unsigned char *data, int size,
@@ -22,7 +23,8 @@ int image_aes_encrypt(struct image_cipher_info *info,
return -ENXIO;
}
-int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest)
+int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest,
+ void *fit, int node_noffset)
{
return -ENXIO;
}
diff --git a/include/u-boot/rsa-mod-exp.h b/include/u-boot/rsa-mod-exp.h
index 1da8af1bb83..7b7c2915a94 100644
--- a/include/u-boot/rsa-mod-exp.h
+++ b/include/u-boot/rsa-mod-exp.h
@@ -66,7 +66,7 @@ int rsa_mod_exp(struct udevice *dev, const uint8_t *sig, uint32_t sig_len,
struct key_prop *node, uint8_t *out);
#if defined(CONFIG_CMD_ZYNQ_RSA)
-int zynq_pow_mod(u32 *keyptr, u32 *inout);
+int zynq_pow_mod(uint32_t *keyptr, uint32_t *inout);
#endif
/**
diff --git a/include/zynqmp_tap_delay.h b/include/zynqmp_tap_delay.h
index b07e3e06922..7b713438f75 100644
--- a/include/zynqmp_tap_delay.h
+++ b/include/zynqmp_tap_delay.h
@@ -10,10 +10,11 @@
#ifdef CONFIG_ARCH_ZYNQMP
void zynqmp_dll_reset(u8 deviceid);
-void arasan_zynqmp_set_tapdelay(u8 device_id, u8 uhsmode, u8 bank);
+void arasan_zynqmp_set_tapdelay(u8 device_id, u32 itap_delay, u32 otap_delay);
#else
inline void zynqmp_dll_reset(u8 deviceid) {}
-inline void arasan_zynqmp_set_tapdelay(u8 device_id, u8 uhsmode, u8 bank) {}
+inline void arasan_zynqmp_set_tapdelay(u8 device_id, u32 itap_delay,
+ u32 otap_delay) {}
#endif
#endif