summaryrefslogtreecommitdiff
path: root/arch/arm/include
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-07-06 18:26:12 -0600
committerTom Rini <[email protected]>2026-07-06 18:26:12 -0600
commitee5d46b45ec0c63f8f9dd1e816e0dac3452ccc3d (patch)
tree800cd9e204ca027144070101884c0d5d3c00130f /arch/arm/include
parentece349ade2973e220f524ce59e59711cc919263f (diff)
parenta18265f1ccb7a272721ed4286ed3b5a6182ff424 (diff)
Merge branch 'next'
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/arch-am33xx/clock.h43
-rw-r--r--arch/arm/include/asm/arch-am33xx/clocks_am33xx.h1
-rw-r--r--arch/arm/include/asm/arch-aspeed/fmc_hdr.h52
-rw-r--r--arch/arm/include/asm/arch-aspeed/platform.h30
-rw-r--r--arch/arm/include/asm/arch-aspeed/scu.h145
-rw-r--r--arch/arm/include/asm/arch-aspeed/scu_ast2700.h514
-rw-r--r--arch/arm/include/asm/arch-aspeed/sdram.h137
-rw-r--r--arch/arm/include/asm/arch-fsl-layerscape/sys_proto.h30
-rw-r--r--arch/arm/include/asm/arch-imx/cpu.h2
-rw-r--r--arch/arm/include/asm/arch-imx8ulp/imx-regs.h2
-rw-r--r--arch/arm/include/asm/arch-imx9/ddr.h70
-rw-r--r--arch/arm/include/asm/arch-imx9/imx-regs.h9
-rw-r--r--arch/arm/include/asm/arch-imx9/sys_proto.h5
-rw-r--r--arch/arm/include/asm/arch-mx6/clock.h2
-rw-r--r--arch/arm/include/asm/arch-omap4/clock.h84
-rw-r--r--arch/arm/include/asm/arch-omap4/cpu.h109
-rw-r--r--arch/arm/include/asm/arch-omap4/ehci.h38
-rw-r--r--arch/arm/include/asm/arch-omap4/gpio.h34
-rw-r--r--arch/arm/include/asm/arch-omap4/hardware.h25
-rw-r--r--arch/arm/include/asm/arch-omap4/i2c.h11
-rw-r--r--arch/arm/include/asm/arch-omap4/mem.h61
-rw-r--r--arch/arm/include/asm/arch-omap4/mmc_host_def.h16
-rw-r--r--arch/arm/include/asm/arch-omap4/mux_omap4.h325
-rw-r--r--arch/arm/include/asm/arch-omap4/omap.h143
-rw-r--r--arch/arm/include/asm/arch-omap4/spl.h22
-rw-r--r--arch/arm/include/asm/arch-omap4/sys_proto.h73
-rw-r--r--arch/arm/include/asm/arch-omap5/clock.h104
-rw-r--r--arch/arm/include/asm/armv8/mmu.h7
-rw-r--r--arch/arm/include/asm/mach-imx/ahab.h2
-rw-r--r--arch/arm/include/asm/mach-imx/ele_api.h8
-rw-r--r--arch/arm/include/asm/mach-imx/qb.h15
-rw-r--r--arch/arm/include/asm/mach-imx/sys_proto.h5
-rw-r--r--arch/arm/include/asm/mach-types.h1
-rw-r--r--arch/arm/include/asm/omap_common.h16
-rw-r--r--arch/arm/include/asm/ti-common/omap_clock.h114
35 files changed, 2075 insertions, 180 deletions
diff --git a/arch/arm/include/asm/arch-am33xx/clock.h b/arch/arm/include/asm/arch-am33xx/clock.h
index 13960db2fbd..80b0707131f 100644
--- a/arch/arm/include/asm/arch-am33xx/clock.h
+++ b/arch/arm/include/asm/arch-am33xx/clock.h
@@ -12,31 +12,10 @@
#include <asm/arch/clocks_am33xx.h>
#include <asm/arch/hardware.h>
+#include <asm/ti-common/omap_clock.h>
#define LDELAY 1000000
-/*CM_<clock_domain>__CLKCTRL */
-#define CD_CLKCTRL_CLKTRCTRL_SHIFT 0
-#define CD_CLKCTRL_CLKTRCTRL_MASK 3
-
-#define CD_CLKCTRL_CLKTRCTRL_NO_SLEEP 0
-#define CD_CLKCTRL_CLKTRCTRL_SW_SLEEP 1
-#define CD_CLKCTRL_CLKTRCTRL_SW_WKUP 2
-
-/* CM_<clock_domain>_<module>_CLKCTRL */
-#define MODULE_CLKCTRL_MODULEMODE_SHIFT 0
-#define MODULE_CLKCTRL_MODULEMODE_MASK 3
-#define MODULE_CLKCTRL_IDLEST_SHIFT 16
-#define MODULE_CLKCTRL_IDLEST_MASK (3 << 16)
-
-#define MODULE_CLKCTRL_MODULEMODE_SW_DISABLE 0
-#define MODULE_CLKCTRL_MODULEMODE_SW_EXPLICIT_EN 2
-
-#define MODULE_CLKCTRL_IDLEST_FULLY_FUNCTIONAL 0
-#define MODULE_CLKCTRL_IDLEST_TRANSITIONING 1
-#define MODULE_CLKCTRL_IDLEST_IDLE 2
-#define MODULE_CLKCTRL_IDLEST_DISABLED 3
-
/* CM_CLKMODE_DPLL */
#define CM_CLKMODE_DPLL_SSC_EN_SHIFT 12
#define CM_CLKMODE_DPLL_SSC_EN_MASK (1 << 12)
@@ -53,26 +32,6 @@
#define CM_CLKMODE_DPLL_DRIFTGUARD_EN_MASK (1 << 8)
#define CM_CLKMODE_DPLL_RAMP_RATE_SHIFT 5
#define CM_CLKMODE_DPLL_RAMP_RATE_MASK (0x7 << 5)
-#define CM_CLKMODE_DPLL_EN_SHIFT 0
-#define CM_CLKMODE_DPLL_EN_MASK (0x7 << 0)
-
-#define CM_CLKMODE_DPLL_DPLL_EN_SHIFT 0
-#define CM_CLKMODE_DPLL_DPLL_EN_MASK 7
-
-#define DPLL_EN_STOP 1
-#define DPLL_EN_MN_BYPASS 4
-#define DPLL_EN_LOW_POWER_BYPASS 5
-#define DPLL_EN_FAST_RELOCK_BYPASS 6
-#define DPLL_EN_LOCK 7
-
-/* CM_IDLEST_DPLL fields */
-#define ST_DPLL_CLK_MASK 1
-
-/* CM_CLKSEL_DPLL */
-#define CM_CLKSEL_DPLL_M_SHIFT 8
-#define CM_CLKSEL_DPLL_M_MASK (0x7FF << 8)
-#define CM_CLKSEL_DPLL_N_SHIFT 0
-#define CM_CLKSEL_DPLL_N_MASK 0x7F
/* CM_SSC_DELTAM_DPLL */
#define CM_SSC_DELTAM_DPLL_FRAC_SHIFT 0
diff --git a/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h b/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
index adb574e8f13..583364bf826 100644
--- a/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
+++ b/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
@@ -22,7 +22,6 @@
#define UART_CLK_RUNNING_MASK 0x1
#define UART_SMART_IDLE_EN (0x1 << 0x3)
-#define CM_DLL_CTRL_NO_OVERRIDE 0x0
#define CM_DLL_READYST 0x4
#define NUM_OPPS 6
diff --git a/arch/arm/include/asm/arch-aspeed/fmc_hdr.h b/arch/arm/include/asm/arch-aspeed/fmc_hdr.h
new file mode 100644
index 00000000000..c60277e1a81
--- /dev/null
+++ b/arch/arm/include/asm/arch-aspeed/fmc_hdr.h
@@ -0,0 +1,52 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) ASPEED Technology Inc.
+ */
+
+#ifndef __ASM_AST2700_FMC_HDR_H__
+#define __ASM_AST2700_FMC_HDR_H__
+
+#include <linux/types.h>
+
+#define HDR_MAGIC 0x48545341 /* ASTH */
+#define HDR_PB_MAX 30
+
+enum prebuilt_type {
+ PBT_END_MARK = 0x0,
+
+ PBT_DDR4_PMU_TRAIN_IMEM,
+ PBT_DDR4_PMU_TRAIN_DMEM,
+ PBT_DDR4_2D_PMU_TRAIN_IMEM,
+ PBT_DDR4_2D_PMU_TRAIN_DMEM,
+ PBT_DDR5_PMU_TRAIN_IMEM,
+ PBT_DDR5_PMU_TRAIN_DMEM,
+ PBT_DP_FW,
+ PBT_UEFI_X64_AST2700,
+
+ PBT_NUM
+};
+
+struct fmc_hdr_preamble {
+ u32 magic;
+ u32 version;
+};
+
+struct fmc_hdr_body {
+ u32 fmc_size;
+ union {
+ struct {
+ u32 type;
+ u32 size;
+ } pbs[0];
+ u32 raz[29];
+ };
+};
+
+struct fmc_hdr {
+ struct fmc_hdr_preamble preamble;
+ struct fmc_hdr_body body;
+} __packed;
+
+int fmc_hdr_get_prebuilt(u32 type, u32 *ofst, u32 *size);
+
+#endif
diff --git a/arch/arm/include/asm/arch-aspeed/platform.h b/arch/arm/include/asm/arch-aspeed/platform.h
index 589abd4a3f6..82699c03c00 100644
--- a/arch/arm/include/asm/arch-aspeed/platform.h
+++ b/arch/arm/include/asm/arch-aspeed/platform.h
@@ -18,8 +18,36 @@
#define ASPEED_DRAM_BASE 0x80000000
#define ASPEED_SRAM_BASE 0x10000000
#define ASPEED_SRAM_SIZE 0x16000
+#elif defined(CONFIG_ASPEED_AST2700)
+#define ASPEED_CPU_AHBC_BASE 0x12000000
+#define ASPEED_CPU_REVISION_ID 0x12C02000
+#define ASPEED_CPU_SCU_BASE 0x12C02000
+#define ASPEED_CPU_HW_STRAP1 0x12C02010
+#define ASPEED_CPU_RESET_LOG1 0x12C02050
+#define ASPEED_CPU_RESET_LOG2 0x12C02060
+#define ASPEED_CPU_RESET_LOG3 0x12C02070
+#define ASPEED_MAC_COUNT 3
+#define ASPEED_DRAM_BASE 0x400000000
+#define ASPEED_SRAM_BASE 0x10000000
+#define ASPEED_SRAM_SIZE 0x20000
+#define ASPEED_FMC_REG_BASE 0x14000000
+#define ASPEED_FMC_CS0_BASE 0x100000000
+#define ASPEED_FMC_CS0_SIZE 0x80000000
+#define ASPEED_IO_MAC0_BASE 0x14050000
+#define ASPEED_IO_MAC1_BASE 0x14060000
+#define ASPEED_IO_AHBC_BASE 0x140b0000
+#define ASPEED_IO_REVISION_ID 0x14C02000
+#define CHIP_AST2700A1_ID_MASK BIT(16)
+#define ASPEED_IO_SCU_BASE 0x14C02000
+#define ASPEED_IO_HW_STRAP1 0x14C02010
+#define ASPEED_IO_RESET_LOG1 0x14C02050
+#define ASPEED_IO_RESET_LOG2 0x14C02060
+#define ASPEED_IO_RESET_LOG3 0x14C02070
+#define ASPEED_IO_RESET_LOG4 0x14C02080
+#define ASPEED_IO_GPIO_BASE 0x14C0B000
+#define ASPEED_WDTA_BASE 0x14C37400
#else
-#err "Unrecognized Aspeed platform."
+#error "Unrecognized Aspeed platform."
#endif
#endif
diff --git a/arch/arm/include/asm/arch-aspeed/scu.h b/arch/arm/include/asm/arch-aspeed/scu.h
new file mode 100644
index 00000000000..1aa7d38bace
--- /dev/null
+++ b/arch/arm/include/asm/arch-aspeed/scu.h
@@ -0,0 +1,145 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) Aspeed Technology Inc.
+ */
+#ifndef __ASM_AST2700_SCU_H__
+#define __ASM_AST2700_SCU_H__
+
+/* SCU0: CPU-die SCU */
+#define SCU0_HWSTRAP 0x010
+#define SCU0_HWSTRAP_DIS_RVAS BIT(30)
+#define SCU0_HWSTRAP_DIS_WDTFULL BIT(25)
+#define SCU0_HWSTRAP_DISARMICE_TZ BIT(22)
+#define SCU0_HWSTRAP_DISABLE_XHCI BIT(21)
+#define SCU0_HWSTRAP_BOOTEMMCSPEED BIT(20)
+#define SCU0_HWSTRAP_VGA_CC BIT(18)
+#define SCU0_HWSTRAP_EN_OPROM BIT(17)
+#define SCU0_HWSTRAP_DISARMICE BIT(16)
+#define SCU0_HWSTRAP_TSPRSNTSEL BIT(9)
+#define SCU0_HWSTRAP_DISDEBUG BIT(8)
+#define SCU0_HWSTRAP_HCLKHPLL BIT(7)
+#define SCU0_HWSTRAP_HCLKSEL GENMASK(6, 5)
+#define SCU0_HWSTRAP_CPUHPLL BIT(4)
+#define SCU0_HWSTRAP_HPLLFREQ GENMASK(3, 2)
+#define SCU0_HWSTRAP_BOOTSPI BIT(1)
+#define SCU0_HWSTRAP_HWSTRAP_DISCPU BIT(0)
+#define SCU0_DBGCTL 0x0c8
+#define SCU0_DBGCTL_MASK GENMASK(14, 0)
+#define SCU0_DBGCTL_UARTDBG BIT(1)
+#define SCU0_RSTCTL1 0x200
+#define SCU0_RSTCTL1_EMMC BIT(17)
+#define SCU0_RSTCTL1_HACE BIT(4)
+#define SCU0_RSTCTL1_CLR 0x204
+#define SCU0_RSTCTL1_CLR_EMMC BIT(17)
+#define SCU0_RSTCTL1_CLR_HACE BIT(4)
+#define SCU0_CLKGATE1 0x240
+#define SCU0_CLKGATE1_EMMC BIT(27)
+#define SCU0_CLKGATE1_HACE BIT(13)
+#define SCU0_CLKGATE1_DDRPHY BIT(11)
+#define SCU0_CLKGATE1_CLR 0x244
+#define SCU0_CLKGATE1_CLR_EMMC BIT(27)
+#define SCU0_CLKGATE1_CLR_HACE BIT(13)
+#define SCU0_CLKGATE1_CLR_DDRPHY BIT(11)
+#define SCU0_VGA0_SCRATCH 0x900
+#define SCU0_VGA0_SCRATCH_DRAM_INIT BIT(6)
+#define SCU0_PCI_MISC70 0xa70
+#define SCU0_PCI_MISC70_EN_PCIEXHCI0 BIT(3)
+#define SCU0_PCI_MISC70_EN_PCIEEHCI0 BIT(2)
+#define SCU0_PCI_MISC70_EN_PCIEVGA0 BIT(0)
+#define SCU0_PCI_MISC80 0xa80
+#define SCU0_PCI_MISC80_EN_PCIEXHCI1 BIT(3)
+#define SCU0_PCI_MISC80_EN_PCIEEHCI1 BIT(2)
+#define SCU0_PCI_MISC80_EN_PCIEVGA1 BIT(0)
+#define SCU0_PCI_MISCF0 0xaf0
+#define SCU0_PCI_MISCF0_EN_PCIEXHCI1 BIT(3)
+#define SCU0_PCI_MISCF0_EN_PCIEEHCI1 BIT(2)
+#define SCU0_PCI_MISCF0_EN_PCIEVGA1 BIT(0)
+#define SCU0_WPROT1 0xe04
+#define SCU0_WPROT1_0C8 BIT(18)
+
+/* SCU1: IO-die SCU */
+#define SCU1_REVISION 0x000
+#define SCU1_REVISION_HWID GENMASK(23, 16)
+#define SCU1_REVISION_CHIP_EFUSE GENMASK(15, 8)
+#define SCU1_HWSTRAP1 0x010
+#define SCU1_HWSTRAP1_DIS_CPTRA BIT(30)
+#define SCU1_HWSTRAP1_RECOVERY_USB_PORT GENMASK(29, 28)
+#define SCU1_HWSTRAP1_RECOVERY_INTERFACE GENMASK(27, 26)
+#define SCU1_HWSTRAP1_RECOVERY_I3C (BIT(26) | BIT(27))
+#define SCU1_HWSTRAP1_RECOVERY_I2C BIT(27)
+#define SCU1_HWSTRAP1_RECOVERY_USB BIT(26)
+#define SCU1_HWSTRAP1_SPI_FLASH_4_BYTE_MODE BIT(25)
+#define SCU1_HWSTRAP1_SPI_FLASH_WAIT_READY BIT(24)
+#define SCU1_HWSTRAP1_BOOT_UFS BIT(23)
+#define SCU1_HWSTRAP1_DIS_ROM BIT(22)
+#define SCU1_HWSTRAP1_DIS_CPTRAJTAG BIT(20)
+#define SCU1_HWSTRAP1_UARTDBGSEL BIT(19)
+#define SCU1_HWSTRAP1_DIS_UARTDBG BIT(18)
+#define SCU1_HWSTRAP1_DIS_WDTFULL BIT(17)
+#define SCU1_HWSTRAP1_DISDEBUG1 BIT(16)
+#define SCU1_HWSTRAP1_LTPI0_IO_DRIVING GENMASK(15, 14)
+#define SCU1_HWSTRAP1_ACPI_1 BIT(13)
+#define SCU1_HWSTRAP1_ACPI_0 BIT(12)
+#define SCU1_HWSTRAP1_BOOT_EMMC_UFS BIT(11)
+#define SCU1_HWSTRAP1_DDR4 BIT(10)
+#define SCU1_HWSTRAP1_LOW_SECURE BIT(8)
+#define SCU1_HWSTRAP1_EN_EMCS BIT(7)
+#define SCU1_HWSTRAP1_EN_GPIOPT BIT(6)
+#define SCU1_HWSTRAP1_EN_SECBOOT BIT(5)
+#define SCU1_HWSTRAP1_EN_RECOVERY_BOOT BIT(4)
+#define SCU1_HWSTRAP1_LTPI0_EN BIT(3)
+#define SCU1_HWSTRAP1_LTPI_IDX BIT(2)
+#define SCU1_HWSTRAP1_LTPI1_EN BIT(1)
+#define SCU1_HWSTRAP1_LTPI_MODE BIT(0)
+#define SCU1_HWSTRAP2 0x030
+#define SCU1_HWSTRAP2_FMC_ABR_SINGLE_FLASH BIT(29)
+#define SCU1_HWSTRAP2_FMC_ABR_CS_SWAP_DIS BIT(28)
+#define SCU1_HWSTRAP2_SPI_TPM_PCR_EXT_EN BIT(27)
+#define SCU1_HWSTRAP2_SPI_TPM_HASH_ALGO GENMASK(26, 25)
+#define SCU1_HWSTRAP2_BOOT_SPI_FREQ GENMASK(24, 23)
+#define SCU1_HWSTRAP2_RESERVED GENMASK(22, 19)
+#define SCU1_HWSTRAP2_FWSPI_CRTM GENMASK(18, 17)
+#define SCU1_HWSTRAP2_EN_FWSPIAUX BIT(16)
+#define SCU1_HWSTRAP2_FWSPISIZE GENMASK(15, 13)
+#define SCU1_HWSTRAP2_DIS_REC BIT(12)
+#define SCU1_HWSTRAP2_EN_CPTRA_DBG BIT(11)
+#define SCU1_HWSTRAP2_TPM_PCR_INDEX GENMASK(6, 2)
+#define SCU1_HWSTRAP2_ROM_CLEAR_SRAM BIT(1)
+#define SCU1_HWSTRAP2_ABR BIT(0)
+#define SCU1_RSTLOG0 0x050
+#define SCU1_RSTLOG0_BMC_CPU BIT(12)
+#define SCU1_RSTLOG0_ABR BIT(2)
+#define SCU1_RSTLOG0_EXTRSTN BIT(1)
+#define SCU1_RSTLOG0_SRST BIT(0)
+#define SCU1_MISC1 0x0c0
+#define SCU1_MISC1_UARTDBG_ROUTE GENMASK(23, 22)
+#define SCU1_MISC1_UART12_ROUTE GENMASK(21, 20)
+#define SCU1_DBGCTL 0x0c8
+#define SCU1_DBGCTL_MASK GENMASK(7, 0)
+#define SCU1_DBGCTL_UARTDBG BIT(6)
+#define SCU1_RNG_DATA 0x0f4
+#define SCU1_RSTCTL1 0x200
+#define SCU1_RSTCTL1_I3C(x) (BIT(16) << (x))
+#define SCU1_RSTCTL1_CLR 0x204
+#define SCU1_RSTCTL1_CLR_I3C(x) (BIT(16) << (x))
+#define SCU1_RSTCTL2 0x220
+#define SCU1_RSTCTL2_LTPI1 BIT(22)
+#define SCU1_RSTCTL2_LTPI0 BIT(20)
+#define SCU1_RSTCTL2_I2C BIT(15)
+#define SCU1_RSTCTL2_CPTRA BIT(9)
+#define SCU1_RSTCTL2_CLR 0x224
+#define SCU1_RSTCTL2_CLR_I2C BIT(15)
+#define SCU1_RSTCTL2_CLR_CPTRA BIT(9)
+#define SCU1_CLKGATE1 0x240
+#define SCU1_CLKGATE1_I3C(x) (BIT(16) << (x))
+#define SCU1_CLKGATE1_I2C BIT(15)
+#define SCU1_CLKGATE1_CLR 0x244
+#define SCU1_CLKGATE1_CLR_I3C(x) (BIT(16) << (x))
+#define SCU1_CLKGATE1_CLR_I2C BIT(15)
+#define SCU1_CLKGATE2 0x260
+#define SCU1_CLKGATE2_LTPI1_TX BIT(19)
+#define SCU1_CLKGATE2_LTPI_AHB BIT(10)
+#define SCU1_CLKGATE2_LTPI0_TX BIT(9)
+#define SCU1_CLKGATE2_CLR 0x264
+
+#endif
diff --git a/arch/arm/include/asm/arch-aspeed/scu_ast2700.h b/arch/arm/include/asm/arch-aspeed/scu_ast2700.h
new file mode 100644
index 00000000000..b973fcc6610
--- /dev/null
+++ b/arch/arm/include/asm/arch-aspeed/scu_ast2700.h
@@ -0,0 +1,514 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) Aspeed Technology Inc.
+ */
+#ifndef _ASM_ARCH_SCU_AST2700_H
+#define _ASM_ARCH_SCU_AST2700_H
+
+#include <linux/types.h>
+
+/* SoC0 SCU Register */
+#define SCU_CPU_REVISION_ID_HW GENMASK(23, 16)
+#define SCU_CPU_REVISION_ID_EFUSE GENMASK(15, 8)
+
+#define SCU_CPU_HWSTRAP_DIS_RVAS BIT(30)
+#define SCU_CPU_HWSTRAP_DP_SRC BIT(29)
+#define SCU_CPU_HWSTRAP_DAC_SRC BIT(28)
+#define SCU_CPU_HWSTRAP_VRAM_SIZE GENMASK(11, 10)
+#define SCU_CPU_HWSTRAP_DIS_CPU BIT(0)
+
+#define SCU_CPU_MISC_DP_RESET_SRC BIT(11)
+#define SCU_CPU_MISC_XDMA_CLIENT_EN BIT(4)
+#define SCU_CPU_MISC_2D_CLIENT_EN BIT(3)
+
+#define SCU_CPU_RST_SSP BIT(30)
+#define SCU_CPU_RST_DPMCU BIT(29)
+#define SCU_CPU_RST_DP BIT(28)
+#define SCU_CPU_RST_XDMA1 BIT(26)
+#define SCU_CPU_RST_XDMA0 BIT(25)
+#define SCU_CPU_RST_EMMC BIT(17)
+#define SCU_CPU_RST_EN_DP_PCI BIT(15)
+#define SCU_CPU_RST_CRT BIT(13)
+#define SCU_CPU_RST_RVAS1 BIT(10)
+#define SCU_CPU_RST_RVAS0 BIT(9)
+#define SCU_CPU_RST_2D BIT(7)
+#define SCU_CPU_RST_VIDEO BIT(6)
+#define SCU_CPU_RST_SOC BIT(5)
+#define SCU_CPU_RST_DDRPHY BIT(1)
+
+#define SCU_CPU_RST2_VGA BIT(12)
+#define SCU_CPU_RST2_E2M1 BIT(11)
+#define SCU_CPU_RST2_E2M0 BIT(10)
+#define SCU_CPU_RST2_TSP BIT(9)
+
+#define SCU_CPU_VGA_FUNC_DAC_OUTPUT GENMASK(11, 10)
+#define SCU_CPU_VGA_FUNC_DP_OUTPUT GENMASK(9, 8)
+#define SCU_CPU_VGA_FUNC_DAC_DISABLE BIT(7)
+
+#define SCU_CPU_PCI_MISC0C_FB_SIZE GENMASK(4, 0)
+
+#define SCU_CPU_PCI_MISC70_EN_XHCI BIT(3)
+#define SCU_CPU_PCI_MISC70_EN_EHCI BIT(2)
+#define SCU_CPU_PCI_MISC70_EN_IPMI BIT(1)
+#define SCU_CPU_PCI_MISC70_EN_VGA BIT(0)
+
+#define SCU_CPU_HPLL_P GENMASK(22, 19)
+#define SCU_CPU_HPLL_N GENMASK(18, 13)
+#define SCU_CPU_HPLL_M GENMASK(12, 0)
+
+#define SCU_CPU_HPLL2_LOCK BIT(31)
+#define SCU_CPU_HPLL2_BWADJ GENMASK(11, 0)
+
+#define SCU_CPU_SSP_TSP_RESET_STS BIT(8)
+#define SCU_CPU_SSP_TSP_SRAM_SD BIT(7)
+#define SCU_CPU_SSP_TSP_SRAM_DSLP BIT(6)
+#define SCU_CPU_SSP_TSP_SRAM_SLP BIT(5)
+#define SCU_CPU_SSP_TSP_NIDEN BIT(4)
+#define SCU_CPU_SSP_TSP_DBGEN BIT(3)
+#define SCU_CPU_SSP_TSP_DBG_ENABLE BIT(2)
+#define SCU_CPU_SSP_TSP_RESET BIT(1)
+#define SCU_CPU_SSP_TSP_ENABLE BIT(0)
+
+/* SoC1 SCU Register */
+#define SCU_IO_HWSTRAP_UFS BIT(23)
+#define SCU_IO_HWSTRAP_EMMC BIT(11)
+#define SCU_IO_HWSTRAP_SECBOOT BIT(5)
+#define SCU_IO_HWSTRAP_LTPI0_EN BIT(3)
+#define SCU_IO_HWSTRAP_LTPI1_EN BIT(1)
+
+/* CLK information */
+#define CLKIN_25M 25000000UL
+
+#define SCU_CPU_CLKGATE1_RVAS1 BIT(28)
+#define SCU_CPU_CLKGATE1_RVAS0 BIT(25)
+#define SCU_CPU_CLKGATE1_E2M1 BIT(19)
+#define SCU_CPU_CLKGATE1_DP BIT(18)
+#define SCU_CPU_CLKGATE1_DAC BIT(17)
+#define SCU_CPU_CLKGATE1_E2M0 BIT(12)
+#define SCU_CPU_CLKGATE1_VGA1 BIT(10)
+#define SCU_CPU_CLKGATE1_VGA0 BIT(5)
+
+/*
+ * Clock divider/multiplier configuration struct.
+ * For H-PLL and M-PLL the formula is
+ * (Output Frequency) = CLKIN * ((M + 1) / (N + 1)) / (P + 1)
+ * M - Numerator
+ * N - Denumerator
+ * P - Post Divider
+ * They have the same layout in their control register.
+ *
+ */
+union ast2700_pll_reg {
+ u32 w;
+ struct {
+ uint16_t m : 13; /* bit[12:0] */
+ uint8_t n : 6; /* bit[18:13] */
+ uint8_t p : 4; /* bit[22:19] */
+ uint8_t off : 1; /* bit[23] */
+ uint8_t bypass : 1; /* bit[24] */
+ uint8_t reset : 1; /* bit[25] */
+ uint8_t reserved : 6; /* bit[31:26] */
+ } b;
+};
+
+struct ast2700_pll_cfg {
+ union ast2700_pll_reg reg;
+ unsigned int ext_reg;
+};
+
+struct ast2700_pll_desc {
+ u32 in;
+ u32 out;
+ struct ast2700_pll_cfg cfg;
+};
+
+struct aspeed_clks {
+ ulong id;
+ const char *name;
+};
+
+#ifndef __ASSEMBLY__
+struct ast2700_scu0 {
+ u32 chip_id1; /* 0x000 */
+ u32 rsv_0x04[3]; /* 0x004 ~ 0x00C */
+ u32 hwstrap1; /* 0x010 */
+ u32 hwstrap1_clr; /* 0x014 */
+ u32 rsv_0x18[2]; /* 0x018 ~ 0x01C */
+ u32 hwstrap1_lock; /* 0x020 */
+ u32 hwstrap1_sec1; /* 0x024 */
+ u32 hwstrap1_sec2; /* 0x028 */
+ u32 hwstrap1_sec3; /* 0x02C */
+ u32 rsv_0x30[8]; /* 0x030 ~ 0x4C */
+ u32 sysrest_log1; /* 0x050 */
+ u32 sysrest_log1_sec1; /* 0x054 */
+ u32 sysrest_log1_sec2; /* 0x058 */
+ u32 sysrest_log1_sec3; /* 0x05C */
+ u32 sysrest_log2; /* 0x060 */
+ u32 sysrest_log2_sec1; /* 0x064 */
+ u32 sysrest_log2_sec2; /* 0x068 */
+ u32 sysrest_log2_sec3; /* 0x06C */
+ u32 sysrest_log3; /* 0x070 */
+ u32 sysrest_log3_sec1; /* 0x074 */
+ u32 sysrest_log3_sec2; /* 0x078 */
+ u32 sysrest_log3_sec3; /* 0x07C */
+ u32 rsv_0x80[8]; /* 0x080 ~ 0x9C */
+ u32 probe_sig_select; /* 0x0A0 */
+ u32 probe_sig_enable1; /* 0x0A4 */
+ u32 probe_sig_enable2; /* 0x0A8 */
+ u32 uart_dbg_rate; /* 0x0AC */
+ u32 rsv_0xB0[4]; /* 0x0B0 ~ 0xBC*/
+ u32 misc; /* 0x0C0 */
+ u32 rsv_0xC4; /* 0x0C4 */
+ u32 debug_ctrl; /* 0x0C8 */
+ u32 rsv_0xCC[5]; /* 0x0CC ~ 0x0DC */
+ u32 free_counter_read_low; /* 0x0E0 */
+ u32 free_counter_read_high; /* 0x0E4 */
+ u32 rsv_0xE8[2]; /* 0x0E8 ~ 0x0EC */
+ u32 random_num_ctrl; /* 0x0F0 */
+ u32 random_num_data; /* 0x0F4 */
+ u32 rsv_0xF8[10]; /* 0x0F8 ~ 0x11C */
+ u32 ssp_ctrl_1; /* 0x120 */
+ u32 ssp_ctrl_2; /* 0x124 */
+ u32 ssp_ctrl_3; /* 0x128 */
+ u32 ssp_ctrl_4; /* 0x12C */
+ u32 ssp_ctrl_5; /* 0x130 */
+ u32 ssp_ctrl_6; /* 0x134 */
+ u32 ssp_ctrl_7; /* 0x138 */
+ u32 rsv_0x13c[1]; /* 0x13C */
+ u32 ssp_remap0_base; /* 0x140 */
+ u32 ssp_remap0_size; /* 0x144 */
+ u32 ssp_remap1_base; /* 0x148 */
+ u32 ssp_remap1_size; /* 0x14c */
+ u32 ssp_remap2_base; /* 0x150 */
+ u32 ssp_remap2_size; /* 0x154 */
+ u32 rsv_0x158[2]; /* 0x158 ~ 0x15C */
+ u32 tsp_ctrl_1; /* 0x160 */
+ u32 rsv_0x164[1]; /* 0x164 */
+ u32 tsp_ctrl_3; /* 0x168 */
+ u32 tsp_ctrl_4; /* 0x16C */
+ u32 tsp_ctrl_5; /* 0x170 */
+ u32 tsp_ctrl_6; /* 0x174 */
+ u32 tsp_ctrl_7; /* 0x178 */
+ u32 rsv_0x17c[6]; /* 0x17C ~ 0x190 */
+ u32 tsp_remap_size; /* 0x194 */
+ u32 rsv_0x198[26]; /* 0x198 ~ 0x1FC */
+ u32 modrst1_ctrl; /* 0x200 */
+ u32 modrst1_clr; /* 0x204 */
+ u32 rsv_0x208[2]; /* 0x208 ~ 0x20C */
+ u32 modrst1_lock; /* 0x210 */
+ u32 modrst1_prot1; /* 0x214 */
+ u32 modrst1_prot2; /* 0x218 */
+ u32 modrst1_prot3; /* 0x21C */
+ u32 modrst2_ctrl; /* 0x220 */
+ u32 modrst2_clr; /* 0x224 */
+ u32 rsv_0x228[2]; /* 0x228 ~ 0x22C */
+ u32 modrst2_lock; /* 0x230 */
+ u32 modrst2_prot1; /* 0x234 */
+ u32 modrst2_prot2; /* 0x238 */
+ u32 modrst2_prot3; /* 0x23C */
+ u32 clkgate_ctrl; /* 0x240 */
+ u32 clkgate_clr; /* 0x244 */
+ u32 rsv_0x248[2]; /* 0x248 */
+ u32 clkgate_lock; /* 0x250 */
+ u32 clkgate_secure1; /* 0x254 */
+ u32 clkgate_secure2; /* 0x258 */
+ u32 clkgate_secure3; /* 0x25c */
+ u32 rsv_0x260[8]; /* 0x260 */
+ u32 clk_sel1; /* 0x280 */
+ u32 clk_sel2; /* 0x284 */
+ u32 clk_sel3; /* 0x288 */
+ u32 rsv_0x28c; /* 0x28c */
+ u32 clk_sel1_lock; /* 0x290 */
+ u32 clk_sel2_lock; /* 0x294 */
+ u32 clk_sel3_lock; /* 0x298 */
+ u32 rsv_0x29c; /* 0x29c */
+ u32 clk_sel1_secure1; /* 0x2a0 */
+ u32 clk_sel1_secure2; /* 0x2a4 */
+ u32 clk_sel1_secure3; /* 0x2a8 */
+ u32 rsv_0x2ac; /* 0x2ac */
+ u32 clk_sel2_secure1; /* 0x2b0 */
+ u32 clk_sel2_secure2; /* 0x2b4 */
+ u32 clk_sel2_secure3; /* 0x2b8 */
+ u32 rsv_0x2bc; /* 0x2bc */
+ u32 clk_sel3_secure1; /* 0x2c0 */
+ u32 clk_sel3_secure2; /* 0x2c4 */
+ u32 clk_sel3_secure3; /* 0x2c8 */
+ u32 rsv_0x2cc[9]; /* 0x2cc */
+ u32 extrst_sel; /* 0x2f0 */
+ u32 rsv_0x2f4[3]; /* 0x2f4 */
+ u32 hpll; /* 0x300 */
+ u32 hpll_ext; /* 0x304 */
+ u32 dpll; /* 0x308 */
+ u32 dpll_ext; /* 0x30C */
+ u32 mpll; /* 0x310 */
+ u32 mpll_ext; /* 0x314 */
+ u32 rsv_0x318[2]; /* 0x318 ~ 0x31C */
+ u32 d1clk_para; /* 0x320 */
+ u32 rsv_0x324[3]; /* 0x324 ~ 0x32C */
+ u32 d2clk_para; /* 0x330 */
+ u32 rsv_0x334[3]; /* 0x334 ~ 0x33C */
+ u32 crt1clk_para; /* 0x340 */
+ u32 rsv_0x344[3]; /* 0x344 ~ 0x34C */
+ u32 crt2clk_para; /* 0x350 */
+ u32 rsv_0x354[3]; /* 0x354 ~ 0x35C */
+ u32 mphyclk_para; /* 0x360 */
+ u32 rsv_0x364[7]; /* 0x364 ~ 0x37C */
+ u32 clkduty_meas_ctrl; /* 0x380 */
+ u32 clkduty1; /* 0x384 */
+ u32 clkduty2; /* 0x368 */
+ u32 clkduty_meas_res; /* 0x38c */
+ u32 rsv_0x390[4]; /* 0x390 ~ 0x39C */
+ u32 freq_counter_ctrl; /* 0x3a0 */
+ u32 freq_counter_cmp; /* 0x3a4 */
+ u32 prog_delay_ring_ctrl0; /* 0x3a8 */
+ u32 prog_delay_ring_ctrl1; /* 0x3ac */
+ u32 freq_counter_readback; /* 0x3b0 */
+ u32 rsv_0x3b4[19]; /* 0x3b4 */
+ u32 pinmux1; /* 0x400 */
+ u32 pinmux2; /* 0x404 */
+ u32 pinmux3; /* 0x408 */
+ u32 rsv_0x40c; /* 0x40C */
+ u32 pinmux4; /* 0x410 */
+ u32 vga_func_ctrl; /* 0x414 */
+ u32 rsv_0x418[2]; /* 0x418 */
+ u32 pinmux_lock0; /* 0x420 */
+ u32 pinmux_lock1; /* 0x424 */
+ u32 pinmux_lock2; /* 0x428 */
+ u32 rsv_0x42c;
+ u32 pinmux_lock3; /* 0x430 */
+ u32 pinmux_lock4; /* 0x434 */
+ u32 rsv_0x438[18];
+ u32 gpio18d0_ioctrl; /* 0x480 */
+ u32 gpio18d1_ioctrl; /* 0x484 */
+ u32 gpio18d2_ioctrl; /* 0x488 */
+ u32 gpio18d3_ioctrl; /* 0x48c */
+ u32 gpio18d4_ioctrl; /* 0x490 */
+ u32 gpio18d5_ioctrl; /* 0x494 */
+ u32 gpio18d6_ioctrl; /* 0x498 */
+ u32 gpio18d7_ioctrl; /* 0x49c */
+ u32 gpio18e0_ioctrl; /* 0x4a0 */
+ u32 gpio18e1_ioctrl; /* 0x4a4 */
+ u32 gpio18e2_ioctrl; /* 0x4a8 */
+ u32 gpio18e3_ioctrl; /* 0x4ac */
+ u32 jtag_ioctrl; /* 0x4b0 */
+ u32 uart_ioctrl; /* 0x4b4 */
+ u32 misc_ioctrl; /* 0x4b8 */
+ u32 rsv_0x4bc[17]; /* 0x4bc ~ 0x4fc */
+ u32 pinmux_seucre0_0; /* 0x500 */
+ u32 pinmux_seucre0_1; /* 0x504 */
+ u32 pinmux_seucre0_2; /* 0x508 */
+ u32 rsv_0x50c;
+ u32 pinmux_seucre0_3; /* 0x510 */
+ u32 pinmux_seucre0_4; /* 0x514 */
+ u32 rsv_0x518[58];
+ u32 pinmux_seucre1_0; /* 0x600 */
+ u32 pinmux_seucre1_1; /* 0x604 */
+ u32 pinmux_seucre1_2; /* 0x608 */
+ u32 rsv_0x60c;
+ u32 pinmux_seucre1_3; /* 0x610 */
+ u32 pinmux_seucre1_4; /* 0x614 */
+ u32 rsv_0x618[58];
+ u32 pinmux_seucre2_0; /* 0x700 */
+ u32 pinmux_seucre2_1; /* 0x704 */
+ u32 pinmux_seucre2_2; /* 0x708 */
+ u32 rsv_0x70c;
+ u32 pinmux_seucre2_3; /* 0x710 */
+ u32 pinmux_seucre2s_4; /* 0x714 */
+ u32 rsv_0x718[26];
+ u32 cpu_scratch[96]; /* 0x780 ~ 0x8FC */
+ u32 vga0_scratch1[4]; /* 0x900 ~ 0x90C */
+ u32 vga1_scratch1[4]; /* 0x910 ~ 0x91C */
+ u32 vga0_scratch2[8]; /* 0x920 ~ 0x93C */
+ u32 vga1_scratch2[8]; /* 0x940 ~ 0x95C */
+ u32 pci_cfg1[3]; /* 0x960 ~ 0x968 */
+ u32 rsv_0x96c; /* 0x96C */
+ u32 pcie_cfg1; /* 0x970 */
+ u32 mmio_decode1; /* 0x974 */
+ u32 reloc_ctrl_decode1[2]; /* 0x978 ~ 0x97C */
+ u32 rsv_0x980[4]; /* 0x980 ~ 0x98C */
+ u32 mbox_decode1; /* 0x990 */
+ u32 shared_sram_decode1[2];/* 0x994 ~ 0x998 */
+ u32 rsv_0x99c; /* 0x99C */
+ u32 pci_cfg2[3]; /* 0x9A0 ~ 0x9A8 */
+ u32 rsv_0x9ac; /* 0x9AC */
+ u32 pcie_cfg2; /* 0x9B0 */
+ u32 mmio_decode2; /* 0x9B4 */
+ u32 reloc_ctrl_decode2[2]; /* 0x9B8 ~ 0x9BC */
+ u32 rsv_0x9c0[4]; /* 0x9C0 ~ 0x9CC */
+ u32 mbox_decode2; /* 0x9D0 */
+ u32 shared_sram_decode2[2];/* 0x9D4 ~ 0x9D8 */
+ u32 rsv_0x9dc[9]; /* 0x9DC ~ 0x9FC */
+ u32 pci0_misc[32]; /* 0xA00 ~ 0xA7C */
+ u32 pci1_misc[32]; /* 0xA80 ~ 0xAFC */
+};
+
+struct ast2700_scu1 {
+ u32 chip_id1; /* 0x000 */
+ u32 rsv_0x04[3]; /* 0x004 ~ 0x00C */
+ u32 hwstrap1; /* 0x010 */
+ u32 hwstrap1_clr; /* 0x014 */
+ u32 rsv_0x18[2]; /* 0x018 ~ 0x01C */
+ u32 hwstrap1_lock; /* 0x020 */
+ u32 hwstrap1_sec1; /* 0x024 */
+ u32 hwstrap1_sec2; /* 0x028 */
+ u32 hwstrap1_sec3; /* 0x02C */
+ u32 hwstrap2; /* 0x030 */
+ u32 hwstrap2_clr; /* 0x034 */
+ u32 rsv_0x38[2]; /* 0x038 ~ 0x03C */
+ u32 hwstrap2_lock; /* 0x040 */
+ u32 hwstrap2_sec1; /* 0x044 */
+ u32 hwstrap2_sec2; /* 0x048 */
+ u32 hwstrap2_sec3; /* 0x04C */
+ u32 sysrest_log1; /* 0x050 */
+ u32 sysrest_log1_sec1; /* 0x054 */
+ u32 sysrest_log1_sec2; /* 0x058 */
+ u32 sysrest_log1_sec3; /* 0x05C */
+ u32 sysrest_log2; /* 0x060 */
+ u32 sysrest_log2_sec1; /* 0x064 */
+ u32 sysrest_log2_sec2; /* 0x068 */
+ u32 sysrest_log2_sec3; /* 0x06C */
+ u32 sysrest_log3; /* 0x070 */
+ u32 sysrest_log3_sec1; /* 0x074 */
+ u32 sysrest_log3_sec2; /* 0x078 */
+ u32 sysrest_log3_sec3; /* 0x07C */
+ u32 sysrest_log4; /* 0x080 */
+ u32 sysrest_log4_sec1; /* 0x084 */
+ u32 sysrest_log4_sec2; /* 0x088 */
+ u32 sysrest_log4_sec3; /* 0x08C */
+ u32 rsv_0x90[7]; /* 0x090 ~ 0xA8 */
+ u32 uart_dbg_rate; /* 0x0AC */
+ u32 rsv_0xB0[4]; /* 0x0B0 ~ 0xBC*/
+ u32 misc; /* 0x0C0 */
+ u32 rsv_0xC4; /* 0x0C4 */
+ u32 debug_ctrl; /* 0x0C8 */
+ u32 rsv_0xCC; /* 0x0CC */
+ u32 dac_ctrl; /* 0x0D0 */
+ u32 dac_crc_ctrl; /* 0x0D4 */
+ u32 rsv_0xD8[2]; /* 0x0D8 ~ 0x0DC */
+ u32 video_input_ctrl; /* 0x0E0 */
+ u32 rsv_0xE4[3]; /* 0x0E4 ~ 0x0EC */
+ u32 random_num_ctrl; /* 0x0F0 */
+ u32 random_num_data; /* 0x0F4 */
+ u32 rsv_0xF0[2]; /* 0x0F8 ~ 0x0FC */
+ u32 rsv_0x100[32]; /* 0x100 ~ 0x17C */
+ u32 scratch[32]; /* 0x180 ~ 0x1FC */
+ u32 modrst1_ctrl; /* 0x200 */
+ u32 modrst1_clr; /* 0x204 */
+ u32 rsv_0x208[2]; /* 0x208 ~ 0x20C */
+ u32 modrst_lock1; /* 0x210 */
+ u32 modrst1_sec1; /* 0x214 */
+ u32 modrst1_sec2; /* 0x218 */
+ u32 modrst1_sec3; /* 0x21C */
+ u32 modrst2_ctrl; /* 0x220 */
+ u32 modrst2_clr; /* 0x224 */
+ u32 rsv_0x228[2]; /* 0x228 ~ 0x22C */
+ u32 modrst2_lock; /* 0x230 */
+ u32 modrst2_prot1; /* 0x234 */
+ u32 modrst2_prot2; /* 0x238 */
+ u32 modrst2_prot3; /* 0x23C */
+ u32 clkgate_ctrl1; /* 0x240 */
+ u32 clkgate_clr1; /* 0x244 */
+ u32 rsv_0x248[2]; /* 0x248 */
+ u32 clkgate_lock1; /* 0x250 */
+ u32 clkgate_secure11; /* 0x254 */
+ u32 clkgate_secure12; /* 0x258 */
+ u32 clkgate_secure13; /* 0x25c */
+ u32 clkgate_ctrl2; /* 0x260 */
+ u32 clkgate_clr2; /* 0x264 */
+ u32 rsv_0x268[2]; /* 0x268 */
+ u32 clkgate_lock2; /* 0x270 */
+ u32 clkgate_secure21; /* 0x274 */
+ u32 clkgate_secure22; /* 0x278 */
+ u32 clkgate_secure23; /* 0x27c */
+ u32 clk_sel1; /* 0x280 */
+ u32 clk_sel2; /* 0x284 */
+ u32 rsv_0x288[2]; /* 0x288 */
+ u32 clk_sel1_lock; /* 0x290 */
+ u32 clk_sel2_lock; /* 0x294 */
+ u32 rsv_0x298[2]; /* 0x298 */
+ u32 clk_sel1_secure1; /* 0x2a0 */
+ u32 clk_sel1_secure2; /* 0x2a4 */
+ u32 rsv_0x2a8[2]; /* 0x2a8 */
+ u32 clk_sel2_secure1; /* 0x2b0 */
+ u32 clk_sel2_secure2; /* 0x2b4 */
+ u32 rsv_0x2b8[2]; /* 0x2b8 */
+ u32 clk_sel3_secure1; /* 0x2c0 */
+ u32 clk_sel3_secure2; /* 0x2c4 */
+ u32 rsv_0x2c8[10]; /* 0x2c8 */
+ u32 extrst_sel1; /* 0x2f0 */
+ u32 extrst_sel2; /* 0x2f4 */
+ u32 rsv_0x2f8[2]; /* 0x2f8 */
+ u32 hpll; /* 0x300 */
+ u32 hpll_ext; /* 0x304 */
+ u32 rsv_0x308[2]; /* 0x308 ~ 0x30C */
+ u32 apll; /* 0x310 */
+ u32 apll_ext; /* 0x314 */
+ u32 rsv_0x318[2]; /* 0x318 ~ 0x31C */
+ u32 dpll; /* 0x320 */
+ u32 dpll_ext; /* 0x324 */
+ u32 rsv_0x328[2]; /* 0x328 ~ 0x32C */
+ u32 uxclk_ctrl; /* 0x330 */
+ u32 huxclk_ctrl; /* 0x334 */
+ u32 rsv_0x338[18]; /* 0x338 ~ 0x37C */
+ u32 clkduty_meas_ctrl; /* 0x380 */
+ u32 clkduty1; /* 0x384 */
+ u32 clkduty2; /* 0x388 */
+ u32 rsv_0x38c; /* 0x38c */
+ u32 mac_delay; /* 0x390 */
+ u32 mac_100m_delay; /* 0x394 */
+ u32 mac_10m_delay; /* 0x398 */
+ u32 rsv_0x39c; /* 0x39c */
+ u32 freq_counter_ctrl; /* 0x3a0 */
+ u32 freq_counter_cmp; /* 0x3a4 */
+ u32 rsv_0x3a8[2]; /* 0x3a8 ~ 0x3aC */
+ u32 usb_ctrl; /* 0x3b0 */
+ u32 usb_lock; /* 0x3b4 */
+ u32 usb_secure1; /* 0x3b8 */
+ u32 usb_secure2; /* 0x3bc */
+ u32 usb_secure3; /* 0x3c0 */
+ u32 rsv_0x3c4[15]; /* 0x3c4 ~ 0x3fc */
+ u32 pinumx1; /* 0x400 */
+ u32 pinumx2; /* 0x404 */
+ u32 pinumx3; /* 0x408 */
+ u32 pinumx4; /* 0x40c */
+ u32 pinumx5; /* 0x410 */
+ u32 pinumx6; /* 0x414 */
+ u32 pinumx7; /* 0x418 */
+ u32 pinumx8; /* 0x41c */
+ u32 pinumx9; /* 0x420 */
+ u32 pinumx10; /* 0x424 */
+ u32 pinumx11; /* 0x428 */
+ u32 pinumx12; /* 0x42c */
+ u32 pinumx13; /* 0x430 */
+ u32 pinumx14; /* 0x434 */
+ u32 pinumx15; /* 0x438 */
+ u32 pinumx16; /* 0x43c */
+ u32 pinumx17; /* 0x440 */
+ u32 pinumx18; /* 0x444 */
+ u32 pinumx19; /* 0x448 */
+ u32 pinumx20; /* 0x44c */
+ u32 pinumx21; /* 0x450 */
+ u32 pinumx22; /* 0x454 */
+ u32 pinumx23; /* 0x458 */
+ u32 pinumx24; /* 0x45c */
+ u32 pinumx25; /* 0x460 */
+ u32 pinumx26; /* 0x464 */
+ u32 pinumx27; /* 0x468 */
+ u32 rsv_0x46c[4]; /* 0x46c ~ 0x478 */
+ u32 pinumx31; /* 0x47c */
+ u32 pull_down_dis[8]; /* 0x480 ~ 0x49c */
+ u32 pin_conf; /* 0x4a0 */
+ u32 rsv_0x4a4[7]; /* 0x4a4 ~ 0x4bc */
+ u32 io_driving0; /* 0x4c0 */
+ u32 io_driving1; /* 0x4c4 */
+ u32 io_driving2; /* 0x4c8 */
+ u32 io_driving3; /* 0x4cc */
+ u32 io_driving4; /* 0x4d0 */
+ u32 io_driving5; /* 0x4d4 */
+ u32 io_driving6; /* 0x4d8 */
+ u32 io_driving7; /* 0x4dc */
+ u32 io_driving8; /* 0x4e0 */
+};
+
+#endif
+#endif
diff --git a/arch/arm/include/asm/arch-aspeed/sdram.h b/arch/arm/include/asm/arch-aspeed/sdram.h
new file mode 100644
index 00000000000..daf48dd6ed1
--- /dev/null
+++ b/arch/arm/include/asm/arch-aspeed/sdram.h
@@ -0,0 +1,137 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) Aspeed Technology Inc.
+ */
+#ifndef __ASM_AST2700_SDRAM_H__
+#define __ASM_AST2700_SDRAM_H__
+
+struct sdrammc_regs {
+ u32 prot_key;
+ u32 intr_status;
+ u32 intr_clear;
+ u32 intr_mask;
+ u32 mcfg;
+ u32 mctl;
+ u32 msts;
+ u32 error_status;
+ u32 actime1;
+ u32 actime2;
+ u32 actime3;
+ u32 actime4;
+ u32 actime5;
+ u32 actime6;
+ u32 actime7;
+ u32 dfi_timing;
+ u32 dcfg;
+ u32 dctl;
+ u32 mrctl;
+ u32 mrwr;
+ u32 mrrd;
+ u32 mr01;
+ u32 mr23;
+ u32 mr45;
+ u32 mr67;
+ u32 refctl;
+ u32 refmng_ctl;
+ u32 refsts;
+ u32 zqctl;
+ u32 ecc_addr_range;
+ u32 ecc_failure_status;
+ u32 ecc_failure_addr;
+ u32 ecc_test_control;
+ u32 ecc_test_status;
+ u32 arbctl;
+ u32 enccfg;
+ u32 protect_lock_set;
+ u32 protect_lock_status;
+ u32 protect_lock_reset;
+ u32 enc_min_addr;
+ u32 enc_max_addr;
+ u32 enc_key[4];
+ u32 enc_iv[3];
+ u32 bistcfg;
+ u32 bist_addr;
+ u32 bist_size;
+ u32 bist_patt;
+ u32 bist_res;
+ u32 bist_fail_addr;
+ u32 bist_fail_data[4];
+ u32 reserved2[2];
+ u32 debug_control;
+ u32 debug_status;
+ u32 phy_intf_status;
+ u32 testcfg;
+ u32 gfmcfg;
+ u32 gfm0ctl;
+ u32 gfm1ctl;
+ u32 reserved3[0xf8];
+};
+
+#define DRAMC_UNLK_KEY 0x1688a8a8
+
+/* offset 0x04 */
+#define DRAMC_IRQSTA_PWRCTL_ERR BIT(16)
+#define DRAMC_IRQSTA_PHY_ERR BIT(15)
+#define DRAMC_IRQSTA_LOWPOWER_DONE BIT(12)
+#define DRAMC_IRQSTA_FREQ_CHG_DONE BIT(11)
+#define DRAMC_IRQSTA_REF_DONE BIT(10)
+#define DRAMC_IRQSTA_ZQ_DONE BIT(9)
+#define DRAMC_IRQSTA_BIST_DONE BIT(8)
+#define DRAMC_IRQSTA_ECC_RCVY_ERR BIT(5)
+#define DRAMC_IRQSTA_ECC_ERR BIT(4)
+#define DRAMC_IRQSTA_PROT_ERR BIT(3)
+#define DRAMC_IRQSTA_OVERSZ_ERR BIT(2)
+#define DRAMC_IRQSTA_MR_DONE BIT(1)
+#define DRAMC_IRQSTA_PHY_INIT_DONE BIT(0)
+
+/* offset 0x14 */
+#define DRAMC_MCTL_WB_SOFT_RESET BIT(24)
+#define DRAMC_MCTL_PHY_CLK_DIS BIT(18)
+#define DRAMC_MCTL_PHY_RESET BIT(17)
+#define DRAMC_MCTL_PHY_POWER_ON BIT(16)
+#define DRAMC_MCTL_FREQ_CHG_START BIT(3)
+#define DRAMC_MCTL_PHY_LOWPOWER_START BIT(2)
+#define DRAMC_MCTL_SELF_REF_START BIT(1)
+#define DRAMC_MCTL_PHY_INIT_START BIT(0)
+
+/* offset 0x40 */
+#define DRAMC_DFICFG_WD_POL BIT(18)
+#define DRAMC_DFICFG_CKE_OUT BIT(17)
+#define DRAMC_DFICFG_RESET BIT(16)
+
+/* offset 0x48 */
+#define DRAMC_MRCTL_ERR_STATUS BIT(31)
+#define DRAMC_MRCTL_READY_STATUS BIT(30)
+#define DRAMC_MRCTL_MR_ADDR BIT(8)
+#define DRAMC_MRCTL_CMD_DLL_RST BIT(7)
+#define DRAMC_MRCTL_CMD_DQ_SEL BIT(6)
+#define DRAMC_MRCTL_CMD_TYPE BIT(2)
+#define DRAMC_MRCTL_CMD_WR_CTL BIT(1)
+#define DRAMC_MRCTL_CMD_START BIT(0)
+
+/* offset 0xC0 */
+#define DRAMC_BISTRES_RUNNING BIT(10)
+#define DRAMC_BISTRES_FAIL BIT(9)
+#define DRAMC_BISTRES_DONE BIT(8)
+#define DRAMC_BISTCFG_INIT_MODE BIT(7)
+#define DRAMC_BISTCFG_PMODE GENMASK(6, 4)
+#define DRAMC_BISTCFG_BMODE GENMASK(3, 2)
+#define DRAMC_BISTCFG_ENABLE BIT(1)
+#define DRAMC_BISTCFG_START BIT(0)
+#define BIST_PMODE_CRC (3)
+#define BIST_BMODE_RW_SWITCH (3)
+
+/* DRAMC048 MR Control Register */
+#define MR_TYPE_SHIFT 2
+#define MR_RW (0 << MR_TYPE_SHIFT)
+#define MR_MPC BIT(2)
+#define MR_VREFCS (2 << MR_TYPE_SHIFT)
+#define MR_VREFCA (3 << MR_TYPE_SHIFT)
+#define MR_ADDRESS_SHIFT 8
+#define MR_ADDR(n) (((n) << MR_ADDRESS_SHIFT) | DRAMC_MRCTL_CMD_WR_CTL)
+#define MR_NUM_SHIFT 4
+#define MR_NUM(n) ((n) << MR_NUM_SHIFT)
+#define MR_DLL_RESET BIT(7)
+#define MR_1T_MODE BIT(16)
+
+#endif
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/sys_proto.h b/arch/arm/include/asm/arch-fsl-layerscape/sys_proto.h
new file mode 100644
index 00000000000..3b78e73c726
--- /dev/null
+++ b/arch/arm/include/asm/arch-fsl-layerscape/sys_proto.h
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2026 Free Mobile - Vincent Jardin
+ *
+ * Layerscape mirror of the i.MX <asm/mach-imx/sys_proto.h>: declares
+ * the SoC-personality helpers consumed by generic drivers that work on
+ * both i.MX and QorIQ/Layerscape parts (e.g. drivers/thermal/imx_tmu.c
+ * for the QorIQ TMU variant).
+ */
+
+#ifndef _ASM_ARCH_FSL_LAYERSCAPE_SYS_PROTO_H
+#define _ASM_ARCH_FSL_LAYERSCAPE_SYS_PROTO_H
+
+#include <linux/types.h>
+
+/*
+ * Per LX2160A Reference Manual, Rev. 1 (10/2021):
+ * - section 1.12.1: "NXP specs max power at 105 degC junction" for
+ * commercial / embedded operating conditions.
+ * - section 28.1: TMU "Accuracy within +/- 3 degC".
+ *
+ * Layerscape SoCs do not expose an OCOTP-style "CPU temp grade" fuse,
+ * so the implementation returns the documented junction-temperature
+ * limit from the data sheet (-40 .. 105 degC commercial range). The
+ * thermal driver subtracts 10 degC for its alert threshold, which
+ * comfortably clears the +/- 3 degC TMU accuracy in both directions.
+ */
+u32 get_cpu_temp_grade(int *minc, int *maxc);
+
+#endif /* _ASM_ARCH_FSL_LAYERSCAPE_SYS_PROTO_H */
diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h
index 25d0f205fde..bbc4b421a02 100644
--- a/arch/arm/include/asm/arch-imx/cpu.h
+++ b/arch/arm/include/asm/arch-imx/cpu.h
@@ -48,6 +48,8 @@
#define MXC_CPU_IMX8MPL 0x187 /* dummy ID */
#define MXC_CPU_IMX8MPD 0x188 /* dummy ID */
#define MXC_CPU_IMX8MPUL 0x189 /* dummy ID */
+#define MXC_CPU_IMX8MPD2 0x18c /* dummy ID */
+#define MXC_CPU_IMX8MP5 0x18d /* dummy ID */
#define MXC_CPU_IMX8QXP_A0 0x90 /* dummy ID */
#define MXC_CPU_IMX8QM 0x91 /* dummy ID */
#define MXC_CPU_IMX8QXP 0x92 /* dummy ID */
diff --git a/arch/arm/include/asm/arch-imx8ulp/imx-regs.h b/arch/arm/include/asm/arch-imx8ulp/imx-regs.h
index a038cc1df33..f9c5e21c14f 100644
--- a/arch/arm/include/asm/arch-imx8ulp/imx-regs.h
+++ b/arch/arm/include/asm/arch-imx8ulp/imx-regs.h
@@ -20,8 +20,6 @@
#define SIM1_BASE_ADDR 0x29290000
-#define WDG3_RBASE 0x292a0000UL
-
#define SIM_SEC_BASE_ADDR 0x2802B000
#define CGC1_SOSCDIV_ADDR 0x292C0108
diff --git a/arch/arm/include/asm/arch-imx9/ddr.h b/arch/arm/include/asm/arch-imx9/ddr.h
index a8e3f7354c7..b0f90b53f64 100644
--- a/arch/arm/include/asm/arch-imx9/ddr.h
+++ b/arch/arm/include/asm/arch-imx9/ddr.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
- * Copyright 2022 NXP
+ * Copyright 2022-2026 NXP
*/
#ifndef __ASM_ARCH_IMX8M_DDR_H
@@ -13,21 +13,21 @@
#define DDR_PHY_BASE 0x4E100000
#define DDRMIX_BLK_CTRL_BASE 0x4E010000
-#define REG_DDR_SDRAM_MD_CNTL (DDR_CTL_BASE + 0x120)
-#define REG_DDR_CS0_BNDS (DDR_CTL_BASE + 0x0)
-#define REG_DDR_CS1_BNDS (DDR_CTL_BASE + 0x8)
+#define REG_DDR_SDRAM_MD_CNTL (DDR_CTL_BASE + 0x120)
+#define REG_DDR_CS0_BNDS (DDR_CTL_BASE + 0x0)
+#define REG_DDR_CS1_BNDS (DDR_CTL_BASE + 0x8)
#define REG_DDRDSR_2 (DDR_CTL_BASE + 0xB24)
-#define REG_DDR_TIMING_CFG_0 (DDR_CTL_BASE + 0x104)
+#define REG_DDR_TIMING_CFG_0 (DDR_CTL_BASE + 0x104)
#define REG_DDR_SDRAM_CFG (DDR_CTL_BASE + 0x110)
-#define REG_DDR_TIMING_CFG_4 (DDR_CTL_BASE + 0x160)
+#define REG_DDR_TIMING_CFG_4 (DDR_CTL_BASE + 0x160)
#define REG_DDR_DEBUG_19 (DDR_CTL_BASE + 0xF48)
-#define REG_DDR_SDRAM_CFG_3 (DDR_CTL_BASE + 0x260)
-#define REG_DDR_SDRAM_CFG_4 (DDR_CTL_BASE + 0x264)
-#define REG_DDR_SDRAM_MD_CNTL_2 (DDR_CTL_BASE + 0x270)
-#define REG_DDR_SDRAM_MPR4 (DDR_CTL_BASE + 0x28C)
-#define REG_DDR_SDRAM_MPR5 (DDR_CTL_BASE + 0x290)
+#define REG_DDR_SDRAM_CFG_3 (DDR_CTL_BASE + 0x260)
+#define REG_DDR_SDRAM_CFG_4 (DDR_CTL_BASE + 0x264)
+#define REG_DDR_SDRAM_MD_CNTL_2 (DDR_CTL_BASE + 0x270)
+#define REG_DDR_SDRAM_MPR4 (DDR_CTL_BASE + 0x28C)
+#define REG_DDR_SDRAM_MPR5 (DDR_CTL_BASE + 0x290)
-#define REG_DDR_ERR_EN (DDR_CTL_BASE + 0x1000)
+#define REG_DDR_ERR_EN (DDR_CTL_BASE + 0x1000)
#define SRC_BASE_ADDR (0x44460000)
#define SRC_DPHY_BASE_ADDR (SRC_BASE_ADDR + 0x1400)
@@ -100,6 +100,52 @@ struct dram_timing_info {
extern struct dram_timing_info dram_timing;
+/* Quick Boot related */
+#define DDRPHY_QB_CSR_SIZE 5168
+#define DDRPHY_QB_ACSM_SIZE (4 * 1024)
+#define DDRPHY_QB_MSB_SIZE 0x200
+#define DDRPHY_QB_PSTATES 0
+#define DDRPHY_QB_PST_SIZE (DDRPHY_QB_PSTATES * 4 * 1024)
+
+/*
+ * This structure needs to be aligned with the one in OEI.
+ */
+struct ddrphy_qb_state {
+ u32 crc; /* Used for ensuring integrity in DRAM */
+#define MAC_LENGTH 8 /* 256 bits, 32-bit aligned */
+ u32 mac[MAC_LENGTH]; /* For 95A0/1 use mac[0] to keep CRC32 value */
+ u8 trained_vrefca_a0;
+ u8 trained_vrefca_a1;
+ u8 trained_vrefca_b0;
+ u8 trained_vrefca_b1;
+ u8 trained_vrefdq_a0;
+ u8 trained_vrefdq_a1;
+ u8 trained_vrefdq_b0;
+ u8 trained_vrefdq_b1;
+ u8 trained_vrefdqu_a0;
+ u8 trained_vrefdqu_a1;
+ u8 trained_vrefdqu_b0;
+ u8 trained_vrefdqu_b1;
+ u8 trained_dramdfe_a0;
+ u8 trained_dramdfe_a1;
+ u8 trained_dramdfe_b0;
+ u8 trained_dramdfe_b1;
+ u8 trained_dramdca_a0;
+ u8 trained_dramdca_a1;
+ u8 trained_dramdca_b0;
+ u8 trained_dramdca_b1;
+ u16 qb_pll_upll_prog0;
+ u16 qb_pll_upll_prog1;
+ u16 qb_pll_upll_prog2;
+ u16 qb_pll_upll_prog3;
+ u16 qb_pll_ctrl1;
+ u16 qb_pll_ctrl4;
+ u16 qb_pll_ctrl5;
+ u16 csr[DDRPHY_QB_CSR_SIZE];
+ u16 acsm[DDRPHY_QB_ACSM_SIZE];
+ u16 pst[DDRPHY_QB_PST_SIZE];
+};
+
void ddr_load_train_firmware(enum fw_type type);
int ddr_init(struct dram_timing_info *timing_info);
int ddr_cfg_phy(struct dram_timing_info *timing_info);
diff --git a/arch/arm/include/asm/arch-imx9/imx-regs.h b/arch/arm/include/asm/arch-imx9/imx-regs.h
index 2d084e5227a..fbf2e6a2b01 100644
--- a/arch/arm/include/asm/arch-imx9/imx-regs.h
+++ b/arch/arm/include/asm/arch-imx9/imx-regs.h
@@ -17,15 +17,6 @@
#define ANATOP_BASE_ADDR 0x44480000UL
-#ifdef CONFIG_IMX94
-#define WDG3_BASE_ADDR 0x49220000UL
-#define WDG4_BASE_ADDR 0x49230000UL
-#else
-#define WDG3_BASE_ADDR 0x42490000UL
-#define WDG4_BASE_ADDR 0x424a0000UL
-#endif
-#define WDG5_BASE_ADDR 0x424b0000UL
-
#define GPIO2_BASE_ADDR 0x43810000UL
#define GPIO3_BASE_ADDR 0x43820000UL
#define GPIO4_BASE_ADDR 0x43840000UL
diff --git a/arch/arm/include/asm/arch-imx9/sys_proto.h b/arch/arm/include/asm/arch-imx9/sys_proto.h
index dead7a99a66..d43e54e72aa 100644
--- a/arch/arm/include/asm/arch-imx9/sys_proto.h
+++ b/arch/arm/include/asm/arch-imx9/sys_proto.h
@@ -22,6 +22,11 @@ int low_drive_freq_update(void *blob);
enum imx9_soc_voltage_mode soc_target_voltage_mode(void);
int get_reset_reason(bool sys, bool lm);
+int imx9_uboot_fixup_by_fuse(void *fdt);
+
+int scmi_get_boot_device_offset(unsigned long *img_off);
+int scmi_get_boot_stage(u8 *stage);
+u8 scmi_get_imgset_sel(void);
#define is_voltage_mode(mode) (soc_target_voltage_mode() == (mode))
diff --git a/arch/arm/include/asm/arch-mx6/clock.h b/arch/arm/include/asm/arch-mx6/clock.h
index 81af89c631f..9c5f3090bd8 100644
--- a/arch/arm/include/asm/arch-mx6/clock.h
+++ b/arch/arm/include/asm/arch-mx6/clock.h
@@ -82,7 +82,7 @@ int enable_lcdif_clock(u32 base_addr, bool enable);
void enable_qspi_clk(int qspi_num);
void enable_thermal_clk(void);
void mxs_set_lcdclk(u32 base_addr, u32 freq);
-void select_ldb_di_clock_source(enum ldb_di_clock clk);
+void select_ldb_di_clock_source(enum ldb_di_clock clk0, enum ldb_di_clock clk1);
void enable_eim_clk(unsigned char enable);
int do_mx6_showclocks(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[]);
diff --git a/arch/arm/include/asm/arch-omap4/clock.h b/arch/arm/include/asm/arch-omap4/clock.h
new file mode 100644
index 00000000000..f020c94428a
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap4/clock.h
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2010
+ * Texas Instruments, <www.ti.com>
+ *
+ * Aneesh V <[email protected]>
+ */
+#ifndef _CLOCKS_OMAP4_H_
+#define _CLOCKS_OMAP4_H_
+
+#define LDELAY 1000000
+
+#include <asm/ti-common/omap_clock.h>
+
+/* ALTCLKSRC */
+#define ALTCLKSRC_MODE_ACTIVE 1
+#define ALTCLKSRC_MODE_MASK 3
+#define ALTCLKSRC_ENABLE_INT_MASK 4
+#define ALTCLKSRC_ENABLE_EXT_MASK 8
+
+/* CM_COREAON_USB_PHY_CORE_CLKCTRL */
+#define USBPHY_CORE_CLKCTRL_OPTFCLKEN_CLK32K BIT(8)
+
+/* CM_L3INIT_USBPHY_CLKCTRL */
+#define USBPHY_CLKCTRL_OPTFCLKEN_PHY_48M_MASK BIT(8)
+
+/* TWL6030 SMPS */
+#define SMPS_REG_ADDR_VCORE1 0x55
+#define SMPS_REG_ADDR_VCORE2 0x5B
+#define SMPS_REG_ADDR_VCORE3 0x61
+/* TWL6032 SMPS */
+#define SMPS_REG_ADDR_SMPS1 0x55
+#define SMPS_REG_ADDR_SMPS2 0x5B
+#define SMPS_REG_ADDR_SMPS5 0x49
+
+/* PMIC */
+#define SMPS_I2C_SLAVE_ADDR 0x12
+
+/* Clock Defines */
+#define V_OSCK 38400000 /* Clock output from T2 */
+#define V_SCLK V_OSCK
+
+struct omap4_scrm_regs {
+ u32 revision; /* 0x0000 */
+ u32 pad00[63];
+ u32 clksetuptime; /* 0x0100 */
+ u32 pmicsetuptime; /* 0x0104 */
+ u32 pad01[2];
+ u32 altclksrc; /* 0x0110 */
+ u32 pad02[2];
+ u32 c2cclkm; /* 0x011c */
+ u32 pad03[56];
+ u32 extclkreq; /* 0x0200 */
+ u32 accclkreq; /* 0x0204 */
+ u32 pwrreq; /* 0x0208 */
+ u32 pad04[1];
+ u32 auxclkreq0; /* 0x0210 */
+ u32 auxclkreq1; /* 0x0214 */
+ u32 auxclkreq2; /* 0x0218 */
+ u32 auxclkreq3; /* 0x021c */
+ u32 auxclkreq4; /* 0x0220 */
+ u32 auxclkreq5; /* 0x0224 */
+ u32 pad05[3];
+ u32 c2cclkreq; /* 0x0234 */
+ u32 pad06[54];
+ u32 auxclk0; /* 0x0310 */
+ u32 auxclk1; /* 0x0314 */
+ u32 auxclk2; /* 0x0318 */
+ u32 auxclk3; /* 0x031c */
+ u32 auxclk4; /* 0x0320 */
+ u32 auxclk5; /* 0x0324 */
+ u32 pad07[54];
+ u32 rsttime_reg; /* 0x0400 */
+ u32 pad08[6];
+ u32 c2crstctrl; /* 0x041c */
+ u32 extpwronrstctrl; /* 0x0420 */
+ u32 pad09[59];
+ u32 extwarmrstst_reg; /* 0x0510 */
+ u32 apewarmrstst_reg; /* 0x0514 */
+ u32 pad10[1];
+ u32 c2cwarmrstst_reg; /* 0x051C */
+};
+
+#endif /* _CLOCKS_OMAP4_H_ */
diff --git a/arch/arm/include/asm/arch-omap4/cpu.h b/arch/arm/include/asm/arch-omap4/cpu.h
new file mode 100644
index 00000000000..4c9ed455833
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap4/cpu.h
@@ -0,0 +1,109 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2006-2010
+ * Texas Instruments, <www.ti.com>
+ */
+
+#ifndef _CPU_H
+#define _CPU_H
+
+#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
+#include <asm/types.h>
+#endif /* !(__KERNEL_STRICT_NAMES || __ASSEMBLY__) */
+
+#include <asm/arch/hardware.h>
+
+#ifndef __KERNEL_STRICT_NAMES
+#ifndef __ASSEMBLY__
+struct gptimer {
+ u32 tidr; /* 0x00 r */
+ u8 res[0xc];
+ u32 tiocp_cfg; /* 0x10 rw */
+ u32 tistat; /* 0x14 r */
+ u32 tisr; /* 0x18 rw */
+ u32 tier; /* 0x1c rw */
+ u32 twer; /* 0x20 rw */
+ u32 tclr; /* 0x24 rw */
+ u32 tcrr; /* 0x28 rw */
+ u32 tldr; /* 0x2c rw */
+ u32 ttgr; /* 0x30 rw */
+ u32 twpc; /* 0x34 r */
+ u32 tmar; /* 0x38 rw */
+ u32 tcar1; /* 0x3c r */
+ u32 tcicr; /* 0x40 rw */
+ u32 tcar2; /* 0x44 r */
+};
+#endif /* __ASSEMBLY__ */
+#endif /* __KERNEL_STRICT_NAMES */
+
+/* enable sys_clk NO-prescale /1 */
+#define GPT_EN ((0x0 << 2) | (0x1 << 1) | (0x1 << 0))
+
+/* Watchdog */
+#ifndef __KERNEL_STRICT_NAMES
+#ifndef __ASSEMBLY__
+struct watchdog {
+ u8 res1[0x34];
+ u32 wwps; /* 0x34 r */
+ u8 res2[0x10];
+ u32 wspr; /* 0x48 rw */
+};
+#endif /* __ASSEMBLY__ */
+#endif /* __KERNEL_STRICT_NAMES */
+
+#define WD_UNLOCK1 0xAAAA
+#define WD_UNLOCK2 0x5555
+
+#define TCLR_ST (0x1 << 0)
+#define TCLR_AR (0x1 << 1)
+#define TCLR_PRE (0x1 << 5)
+
+/* I2C base */
+#define I2C_BASE1 (OMAP44XX_L4_PER_BASE + 0x70000)
+#define I2C_BASE2 (OMAP44XX_L4_PER_BASE + 0x72000)
+#define I2C_BASE3 (OMAP44XX_L4_PER_BASE + 0x60000)
+#define I2C_BASE4 (OMAP44XX_L4_PER_BASE + 0x350000)
+
+/* MUSB base */
+#define MUSB_BASE (OMAP44XX_L4_CORE_BASE + 0xAB000)
+
+/* OMAP4 GPIO registers */
+#define OMAP_GPIO_REVISION 0x0000
+#define OMAP_GPIO_SYSCONFIG 0x0010
+#define OMAP_GPIO_SYSSTATUS 0x0114
+#define OMAP_GPIO_IRQSTATUS1 0x0118
+#define OMAP_GPIO_IRQSTATUS2 0x0128
+#define OMAP_GPIO_IRQENABLE2 0x012c
+#define OMAP_GPIO_IRQENABLE1 0x011c
+#define OMAP_GPIO_WAKE_EN 0x0120
+#define OMAP_GPIO_CTRL 0x0130
+#define OMAP_GPIO_OE 0x0134
+#define OMAP_GPIO_DATAIN 0x0138
+#define OMAP_GPIO_DATAOUT 0x013c
+#define OMAP_GPIO_LEVELDETECT0 0x0140
+#define OMAP_GPIO_LEVELDETECT1 0x0144
+#define OMAP_GPIO_RISINGDETECT 0x0148
+#define OMAP_GPIO_FALLINGDETECT 0x014c
+#define OMAP_GPIO_DEBOUNCE_EN 0x0150
+#define OMAP_GPIO_DEBOUNCE_VAL 0x0154
+#define OMAP_GPIO_CLEARIRQENABLE1 0x0160
+#define OMAP_GPIO_SETIRQENABLE1 0x0164
+#define OMAP_GPIO_CLEARWKUENA 0x0180
+#define OMAP_GPIO_SETWKUENA 0x0184
+#define OMAP_GPIO_CLEARDATAOUT 0x0190
+#define OMAP_GPIO_SETDATAOUT 0x0194
+
+/*
+ * PRCM
+ */
+
+/* PRM */
+#define PRM_BASE 0x4A306000
+#define PRM_DEVICE_BASE (PRM_BASE + 0x1B00)
+
+#define PRM_RSTCTRL PRM_DEVICE_BASE
+#define PRM_RSTCTRL_RESET 0x01
+#define PRM_RSTST (PRM_DEVICE_BASE + 0x4)
+#define PRM_RSTST_WARM_RESET_MASK 0x07EA
+
+#endif /* _CPU_H */
diff --git a/arch/arm/include/asm/arch-omap4/ehci.h b/arch/arm/include/asm/arch-omap4/ehci.h
new file mode 100644
index 00000000000..447c6b1320f
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap4/ehci.h
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * OMAP EHCI port support
+ * Based on LINUX KERNEL
+ * drivers/usb/host/ehci-omap.c and drivers/mfd/omap-usb-host.c
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com
+ * Author: Govindraj R <[email protected]>
+ */
+
+#ifndef _OMAP4_EHCI_H_
+#define _OMAP4_EHCI_H_
+
+#define OMAP_EHCI_BASE (OMAP44XX_L4_CORE_BASE + 0x64C00)
+#define OMAP_UHH_BASE (OMAP44XX_L4_CORE_BASE + 0x64000)
+#define OMAP_USBTLL_BASE (OMAP44XX_L4_CORE_BASE + 0x62000)
+
+/* UHH, TLL and opt clocks */
+#define CM_L3INIT_HSUSBHOST_CLKCTRL 0x4A009358UL
+
+#define HSUSBHOST_CLKCTRL_CLKSEL_UTMI_P1_MASK BIT(24)
+
+/* TLL Register Set */
+#define OMAP_USBTLL_SYSCONFIG_SIDLEMODE BIT(3)
+#define OMAP_USBTLL_SYSCONFIG_ENAWAKEUP BIT(2)
+#define OMAP_USBTLL_SYSCONFIG_SOFTRESET BIT(1)
+#define OMAP_USBTLL_SYSCONFIG_CACTIVITY BIT(8)
+#define OMAP_USBTLL_SYSSTATUS_RESETDONE 1
+
+#define OMAP_UHH_SYSCONFIG_SOFTRESET 1
+#define OMAP_UHH_SYSSTATUS_EHCI_RESETDONE BIT(2)
+#define OMAP_UHH_SYSCONFIG_NOIDLE BIT(2)
+#define OMAP_UHH_SYSCONFIG_NOSTDBY BIT(4)
+
+#define OMAP_UHH_SYSCONFIG_VAL (OMAP_UHH_SYSCONFIG_NOIDLE | \
+ OMAP_UHH_SYSCONFIG_NOSTDBY)
+
+#endif /* _OMAP4_EHCI_H_ */
diff --git a/arch/arm/include/asm/arch-omap4/gpio.h b/arch/arm/include/asm/arch-omap4/gpio.h
new file mode 100644
index 00000000000..aceb3e227c9
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap4/gpio.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2009 Wind River Systems, Inc.
+ * Tom Rix <[email protected]>
+ *
+ * This work is derived from the linux 2.6.27 kernel source
+ * To fetch, use the kernel repository
+ * git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
+ * Use the v2.6.27 tag.
+ *
+ * Below is the original's header including its copyright
+ *
+ * linux/arch/arm/plat-omap/gpio.c
+ *
+ * Support functions for OMAP GPIO
+ *
+ * Copyright (C) 2003-2005 Nokia Corporation
+ * Written by Juha Yrjölä <[email protected]>
+ */
+#ifndef _GPIO_OMAP4_H
+#define _GPIO_OMAP4_H
+
+#include <asm/omap_gpio.h>
+
+#define OMAP_MAX_GPIO 192
+
+#define OMAP44XX_GPIO1_BASE 0x4A310000
+#define OMAP44XX_GPIO2_BASE 0x48055000
+#define OMAP44XX_GPIO3_BASE 0x48057000
+#define OMAP44XX_GPIO4_BASE 0x48059000
+#define OMAP44XX_GPIO5_BASE 0x4805B000
+#define OMAP44XX_GPIO6_BASE 0x4805D000
+
+#endif /* _GPIO_OMAP4_H */
diff --git a/arch/arm/include/asm/arch-omap4/hardware.h b/arch/arm/include/asm/arch-omap4/hardware.h
new file mode 100644
index 00000000000..67e3dae7bce
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap4/hardware.h
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * hardware.h
+ *
+ * hardware specific header
+ *
+ * Copyright (C) 2013, Texas Instruments, Incorporated - https://www.ti.com/
+ */
+
+#ifndef __OMAP_HARDWARE_H
+#define __OMAP_HARDWARE_H
+
+#include <asm/arch/omap.h>
+
+/*
+ * Common hardware definitions
+ */
+
+/* BCH Error Location Module */
+#define ELM_BASE 0x48078000
+
+/* GPMC Base address */
+#define GPMC_BASE 0x50000000
+
+#endif
diff --git a/arch/arm/include/asm/arch-omap4/i2c.h b/arch/arm/include/asm/arch-omap4/i2c.h
new file mode 100644
index 00000000000..c8f2f9716f1
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap4/i2c.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2004-2010
+ * Texas Instruments, <www.ti.com>
+ */
+#ifndef _OMAP4_I2C_H_
+#define _OMAP4_I2C_H_
+
+#define I2C_DEFAULT_BASE I2C_BASE1
+
+#endif /* _OMAP4_I2C_H_ */
diff --git a/arch/arm/include/asm/arch-omap4/mem.h b/arch/arm/include/asm/arch-omap4/mem.h
new file mode 100644
index 00000000000..3026a002db3
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap4/mem.h
@@ -0,0 +1,61 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2006-2008
+ * Texas Instruments, <www.ti.com>
+ *
+ * Author
+ * Mansoor Ahamed <[email protected]>
+ *
+ * Initial Code from:
+ * Richard Woodruff <[email protected]>
+ */
+
+#ifndef _MEM_H_
+#define _MEM_H_
+
+/*
+ * GPMC settings -
+ * Definitions is as per the following format
+ * #define <PART>_GPMC_CONFIG<x> <value>
+ * Where:
+ * PART is the part name e.g. STNOR - Intel Strata Flash
+ * x is GPMC config registers from 1 to 6 (there will be 6 macros)
+ * Value is corresponding value
+ *
+ * For every valid PRCM configuration there should be only one definition of
+ * the same. if values are independent of the board, this definition will be
+ * present in this file if values are dependent on the board, then this should
+ * go into corresponding mem-boardName.h file
+ *
+ * Currently valid part Names are (PART):
+ * M_NAND - Micron NAND
+ * STNOR - STMicrolelctronics M29W128GL
+ */
+#define GPMC_SIZE_256M 0x0
+#define GPMC_SIZE_128M 0x8
+#define GPMC_SIZE_64M 0xC
+#define GPMC_SIZE_32M 0xE
+#define GPMC_SIZE_16M 0xF
+
+#define M_NAND_GPMC_CONFIG1 0x00000800
+#define M_NAND_GPMC_CONFIG2 0x001e1e00
+#define M_NAND_GPMC_CONFIG3 0x001e1e00
+#define M_NAND_GPMC_CONFIG4 0x16051807
+#define M_NAND_GPMC_CONFIG5 0x00151e1e
+#define M_NAND_GPMC_CONFIG6 0x16000f80
+#define M_NAND_GPMC_CONFIG7 0x00000008
+
+#define STNOR_GPMC_CONFIG1 0x00001200
+#define STNOR_GPMC_CONFIG2 0x00101000
+#define STNOR_GPMC_CONFIG3 0x00030301
+#define STNOR_GPMC_CONFIG4 0x10041004
+#define STNOR_GPMC_CONFIG5 0x000C1010
+#define STNOR_GPMC_CONFIG6 0x08070280
+#define STNOR_GPMC_CONFIG7 0x00000F48
+
+/* max number of GPMC Chip Selects */
+#define GPMC_MAX_CS 8
+/* max number of GPMC regs */
+#define GPMC_MAX_REG 7
+
+#endif /* endif _MEM_H_ */
diff --git a/arch/arm/include/asm/arch-omap4/mmc_host_def.h b/arch/arm/include/asm/arch-omap4/mmc_host_def.h
new file mode 100644
index 00000000000..bda9bc7db82
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap4/mmc_host_def.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef MMC_HOST_DEF_H
+#define MMC_HOST_DEF_H
+
+#include <asm/omap_mmc.h>
+
+/*
+ * OMAP HSMMC register definitions
+ */
+
+#define OMAP_HSMMC1_BASE 0x4809C000
+#define OMAP_HSMMC2_BASE 0x480B4000
+#define OMAP_HSMMC3_BASE 0x480AD000
+
+#endif /* MMC_HOST_DEF_H */
diff --git a/arch/arm/include/asm/arch-omap4/mux_omap4.h b/arch/arm/include/asm/arch-omap4/mux_omap4.h
new file mode 100644
index 00000000000..637d920e0f3
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap4/mux_omap4.h
@@ -0,0 +1,325 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2004-2009
+ * Texas Instruments Incorporated
+ * Richard Woodruff <[email protected]>
+ * Aneesh V <[email protected]>
+ * Balaji Krishnamoorthy <[email protected]>
+ */
+#ifndef _MUX_OMAP4_H_
+#define _MUX_OMAP4_H_
+
+#include <asm/types.h>
+
+struct pad_conf_entry {
+ u16 offset;
+ u16 val;
+};
+
+#ifdef CONFIG_OFF_PADCONF
+#define OFF_PD BIT(12)
+#define OFF_PU (3 << 12)
+#define OFF_OUT_PTD (0 << 10)
+#define OFF_OUT_PTU (2 << 10)
+#define OFF_IN BIT(10)
+#define OFF_OUT (0 << 10)
+#define OFF_EN BIT(9)
+#else
+#define OFF_PD (0 << 12)
+#define OFF_PU (0 << 12)
+#define OFF_OUT_PTD (0 << 10)
+#define OFF_OUT_PTU (0 << 10)
+#define OFF_IN (0 << 10)
+#define OFF_OUT (0 << 10)
+#define OFF_EN (0 << 9)
+#endif
+
+#define IEN BIT(8)
+#define IDIS (0 << 8)
+#define PTU (3 << 3)
+#define PTD BIT(3)
+#define EN BIT(3)
+#define DIS (0 << 3)
+
+#define M0 0
+#define M1 1
+#define M2 2
+#define M3 3
+#define M4 4
+#define M5 5
+#define M6 6
+#define M7 7
+
+#define SAFE_MODE M7
+
+#ifdef CONFIG_OFF_PADCONF
+#define OFF_IN_PD (OFF_PD | OFF_IN | OFF_EN)
+#define OFF_IN_PU (OFF_PU | OFF_IN | OFF_EN)
+#define OFF_OUT_PD (OFF_OUT_PTD | OFF_OUT | OFF_EN)
+#define OFF_OUT_PU (OFF_OUT_PTU | OFF_OUT | OFF_EN)
+#else
+#define OFF_IN_PD 0
+#define OFF_IN_PU 0
+#define OFF_OUT_PD 0
+#define OFF_OUT_PU 0
+#endif
+
+#define CORE_REVISION 0x0000
+#define CORE_HWINFO 0x0004
+#define CORE_SYSCONFIG 0x0010
+#define GPMC_AD0 0x0040
+#define GPMC_AD1 0x0042
+#define GPMC_AD2 0x0044
+#define GPMC_AD3 0x0046
+#define GPMC_AD4 0x0048
+#define GPMC_AD5 0x004A
+#define GPMC_AD6 0x004C
+#define GPMC_AD7 0x004E
+#define GPMC_AD8 0x0050
+#define GPMC_AD9 0x0052
+#define GPMC_AD10 0x0054
+#define GPMC_AD11 0x0056
+#define GPMC_AD12 0x0058
+#define GPMC_AD13 0x005A
+#define GPMC_AD14 0x005C
+#define GPMC_AD15 0x005E
+#define GPMC_A16 0x0060
+#define GPMC_A17 0x0062
+#define GPMC_A18 0x0064
+#define GPMC_A19 0x0066
+#define GPMC_A20 0x0068
+#define GPMC_A21 0x006A
+#define GPMC_A22 0x006C
+#define GPMC_A23 0x006E
+#define GPMC_A24 0x0070
+#define GPMC_A25 0x0072
+#define GPMC_NCS0 0x0074
+#define GPMC_NCS1 0x0076
+#define GPMC_NCS2 0x0078
+#define GPMC_NCS3 0x007A
+#define GPMC_NWP 0x007C
+#define GPMC_CLK 0x007E
+#define GPMC_NADV_ALE 0x0080
+#define GPMC_NOE 0x0082
+#define GPMC_NWE 0x0084
+#define GPMC_NBE0_CLE 0x0086
+#define GPMC_NBE1 0x0088
+#define GPMC_WAIT0 0x008A
+#define GPMC_WAIT1 0x008C
+#define C2C_DATA11 0x008E
+#define C2C_DATA12 0x0090
+#define C2C_DATA13 0x0092
+#define C2C_DATA14 0x0094
+#define C2C_DATA15 0x0096
+#define HDMI_HPD 0x0098
+#define HDMI_CEC 0x009A
+#define HDMI_DDC_SCL 0x009C
+#define HDMI_DDC_SDA 0x009E
+#define CSI21_DX0 0x00A0
+#define CSI21_DY0 0x00A2
+#define CSI21_DX1 0x00A4
+#define CSI21_DY1 0x00A6
+#define CSI21_DX2 0x00A8
+#define CSI21_DY2 0x00AA
+#define CSI21_DX3 0x00AC
+#define CSI21_DY3 0x00AE
+#define CSI21_DX4 0x00B0
+#define CSI21_DY4 0x00B2
+#define CSI22_DX0 0x00B4
+#define CSI22_DY0 0x00B6
+#define CSI22_DX1 0x00B8
+#define CSI22_DY1 0x00BA
+#define CAM_SHUTTER 0x00BC
+#define CAM_STROBE 0x00BE
+#define CAM_GLOBALRESET 0x00C0
+#define USBB1_ULPITLL_CLK 0x00C2
+#define USBB1_ULPITLL_STP 0x00C4
+#define USBB1_ULPITLL_DIR 0x00C6
+#define USBB1_ULPITLL_NXT 0x00C8
+#define USBB1_ULPITLL_DAT0 0x00CA
+#define USBB1_ULPITLL_DAT1 0x00CC
+#define USBB1_ULPITLL_DAT2 0x00CE
+#define USBB1_ULPITLL_DAT3 0x00D0
+#define USBB1_ULPITLL_DAT4 0x00D2
+#define USBB1_ULPITLL_DAT5 0x00D4
+#define USBB1_ULPITLL_DAT6 0x00D6
+#define USBB1_ULPITLL_DAT7 0x00D8
+#define USBB1_HSIC_DATA 0x00DA
+#define USBB1_HSIC_STROBE 0x00DC
+#define USBC1_ICUSB_DP 0x00DE
+#define USBC1_ICUSB_DM 0x00E0
+#define SDMMC1_CLK 0x00E2
+#define SDMMC1_CMD 0x00E4
+#define SDMMC1_DAT0 0x00E6
+#define SDMMC1_DAT1 0x00E8
+#define SDMMC1_DAT2 0x00EA
+#define SDMMC1_DAT3 0x00EC
+#define SDMMC1_DAT4 0x00EE
+#define SDMMC1_DAT5 0x00F0
+#define SDMMC1_DAT6 0x00F2
+#define SDMMC1_DAT7 0x00F4
+#define ABE_MCBSP2_CLKX 0x00F6
+#define ABE_MCBSP2_DR 0x00F8
+#define ABE_MCBSP2_DX 0x00FA
+#define ABE_MCBSP2_FSX 0x00FC
+#define ABE_MCBSP1_CLKX 0x00FE
+#define ABE_MCBSP1_DR 0x0100
+#define ABE_MCBSP1_DX 0x0102
+#define ABE_MCBSP1_FSX 0x0104
+#define ABE_PDM_UL_DATA 0x0106
+#define ABE_PDM_DL_DATA 0x0108
+#define ABE_PDM_FRAME 0x010A
+#define ABE_PDM_LB_CLK 0x010C
+#define ABE_CLKS 0x010E
+#define ABE_DMIC_CLK1 0x0110
+#define ABE_DMIC_DIN1 0x0112
+#define ABE_DMIC_DIN2 0x0114
+#define ABE_DMIC_DIN3 0x0116
+#define UART2_CTS 0x0118
+#define UART2_RTS 0x011A
+#define UART2_RX 0x011C
+#define UART2_TX 0x011E
+#define HDQ_SIO 0x0120
+#define I2C1_SCL 0x0122
+#define I2C1_SDA 0x0124
+#define I2C2_SCL 0x0126
+#define I2C2_SDA 0x0128
+#define I2C3_SCL 0x012A
+#define I2C3_SDA 0x012C
+#define I2C4_SCL 0x012E
+#define I2C4_SDA 0x0130
+#define MCSPI1_CLK 0x0132
+#define MCSPI1_SOMI 0x0134
+#define MCSPI1_SIMO 0x0136
+#define MCSPI1_CS0 0x0138
+#define MCSPI1_CS1 0x013A
+#define MCSPI1_CS2 0x013C
+#define MCSPI1_CS3 0x013E
+#define UART3_CTS_RCTX 0x0140
+#define UART3_RTS_SD 0x0142
+#define UART3_RX_IRRX 0x0144
+#define UART3_TX_IRTX 0x0146
+#define SDMMC5_CLK 0x0148
+#define SDMMC5_CMD 0x014A
+#define SDMMC5_DAT0 0x014C
+#define SDMMC5_DAT1 0x014E
+#define SDMMC5_DAT2 0x0150
+#define SDMMC5_DAT3 0x0152
+#define MCSPI4_CLK 0x0154
+#define MCSPI4_SIMO 0x0156
+#define MCSPI4_SOMI 0x0158
+#define MCSPI4_CS0 0x015A
+#define UART4_RX 0x015C
+#define UART4_TX 0x015E
+#define USBB2_ULPITLL_CLK 0x0160
+#define USBB2_ULPITLL_STP 0x0162
+#define USBB2_ULPITLL_DIR 0x0164
+#define USBB2_ULPITLL_NXT 0x0166
+#define USBB2_ULPITLL_DAT0 0x0168
+#define USBB2_ULPITLL_DAT1 0x016A
+#define USBB2_ULPITLL_DAT2 0x016C
+#define USBB2_ULPITLL_DAT3 0x016E
+#define USBB2_ULPITLL_DAT4 0x0170
+#define USBB2_ULPITLL_DAT5 0x0172
+#define USBB2_ULPITLL_DAT6 0x0174
+#define USBB2_ULPITLL_DAT7 0x0176
+#define USBB2_HSIC_DATA 0x0178
+#define USBB2_HSIC_STROBE 0x017A
+#define UNIPRO_TX0 0x017C
+#define UNIPRO_TY0 0x017E
+#define UNIPRO_TX1 0x0180
+#define UNIPRO_TY1 0x0182
+#define UNIPRO_TX2 0x0184
+#define UNIPRO_TY2 0x0186
+#define UNIPRO_RX0 0x0188
+#define UNIPRO_RY0 0x018A
+#define UNIPRO_RX1 0x018C
+#define UNIPRO_RY1 0x018E
+#define UNIPRO_RX2 0x0190
+#define UNIPRO_RY2 0x0192
+#define USBA0_OTG_CE 0x0194
+#define USBA0_OTG_DP 0x0196
+#define USBA0_OTG_DM 0x0198
+#define FREF_CLK1_OUT 0x019A
+#define FREF_CLK2_OUT 0x019C
+#define SYS_NIRQ1 0x019E
+#define SYS_NIRQ2 0x01A0
+#define SYS_BOOT0 0x01A2
+#define SYS_BOOT1 0x01A4
+#define SYS_BOOT2 0x01A6
+#define SYS_BOOT3 0x01A8
+#define SYS_BOOT4 0x01AA
+#define SYS_BOOT5 0x01AC
+#define DPM_EMU0 0x01AE
+#define DPM_EMU1 0x01B0
+#define DPM_EMU2 0x01B2
+#define DPM_EMU3 0x01B4
+#define DPM_EMU4 0x01B6
+#define DPM_EMU5 0x01B8
+#define DPM_EMU6 0x01BA
+#define DPM_EMU7 0x01BC
+#define DPM_EMU8 0x01BE
+#define DPM_EMU9 0x01C0
+#define DPM_EMU10 0x01C2
+#define DPM_EMU11 0x01C4
+#define DPM_EMU12 0x01C6
+#define DPM_EMU13 0x01C8
+#define DPM_EMU14 0x01CA
+#define DPM_EMU15 0x01CC
+#define DPM_EMU16 0x01CE
+#define DPM_EMU17 0x01D0
+#define DPM_EMU18 0x01D2
+#define DPM_EMU19 0x01D4
+#define WAKEUPEVENT_0 0x01D8
+#define WAKEUPEVENT_1 0x01DC
+#define WAKEUPEVENT_2 0x01E0
+#define WAKEUPEVENT_3 0x01E4
+#define WAKEUPEVENT_4 0x01E8
+#define WAKEUPEVENT_5 0x01EC
+#define WAKEUPEVENT_6 0x01F0
+
+#define WKUP_REVISION 0x0000
+#define WKUP_HWINFO 0x0004
+#define WKUP_SYSCONFIG 0x0010
+#define PAD0_SIM_IO 0x0040
+#define PAD1_SIM_CLK 0x0042
+#define PAD0_SIM_RESET 0x0044
+#define PAD1_SIM_CD 0x0046
+#define PAD0_SIM_PWRCTRL 0x0048
+#define PAD1_SR_SCL 0x004A
+#define PAD0_SR_SDA 0x004C
+#define PAD1_FREF_XTAL_IN 0x004E
+#define PAD0_FREF_SLICER_IN 0x0050
+#define PAD1_FREF_CLK_IOREQ 0x0052
+#define PAD0_FREF_CLK0_OUT 0x0054
+#define PAD1_FREF_CLK3_REQ 0x0056
+#define PAD0_FREF_CLK3_OUT 0x0058
+#define PAD1_FREF_CLK4_REQ 0x005A
+#define PAD0_FREF_CLK4_OUT 0x005C
+#define PAD1_SYS_32K 0x005E
+#define PAD0_SYS_NRESPWRON 0x0060
+#define PAD1_SYS_NRESWARM 0x0062
+#define PAD0_SYS_PWR_REQ 0x0064
+#define PAD1_SYS_PWRON_RESET 0x0066
+#define PAD0_SYS_BOOT6 0x0068
+#define PAD1_SYS_BOOT7 0x006A
+#define PAD0_JTAG_NTRST 0x006C
+#define PAD1_JTAG_TCK 0x006D
+#define PAD0_JTAG_RTCK 0x0070
+#define PAD1_JTAG_TMS_TMSC 0x0072
+#define PAD0_JTAG_TDI 0x0074
+#define PAD1_JTAG_TDO 0x0076
+#define PADCONF_WAKEUPEVENT_0 0x007C
+#define CONTROL_SMART1NOPMIO_PADCONF_0 0x05A0
+#define CONTROL_SMART1NOPMIO_PADCONF_1 0x05A4
+#define PADCONF_MODE 0x05A8
+#define CONTROL_XTAL_OSCILLATOR 0x05AC
+#define CONTROL_CONTROL_I2C_2 0x0604
+#define CONTROL_CONTROL_JTAG 0x0608
+#define CONTROL_CONTROL_SYS 0x060C
+#define CONTROL_SPARE_RW 0x0614
+#define CONTROL_SPARE_R 0x0618
+#define CONTROL_SPARE_R_C0 0x061C
+
+#define CONTROL_WKUP_PAD1_FREF_CLK4_REQ 0x4A31E05A
+#endif /* _MUX_OMAP4_H_ */
diff --git a/arch/arm/include/asm/arch-omap4/omap.h b/arch/arm/include/asm/arch-omap4/omap.h
new file mode 100644
index 00000000000..2912bbc6376
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap4/omap.h
@@ -0,0 +1,143 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2010
+ * Texas Instruments, <www.ti.com>
+ *
+ * Authors:
+ * Aneesh V <[email protected]>
+ *
+ * Derived from OMAP3 work by
+ * Richard Woodruff <[email protected]>
+ * Syed Mohammed Khasim <[email protected]>
+ */
+
+#ifndef _OMAP4_H_
+#define _OMAP4_H_
+
+#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
+#include <asm/types.h>
+#endif /* !(__KERNEL_STRICT_NAMES || __ASSEMBLY__) */
+
+#include <linux/sizes.h>
+
+/*
+ * L4 Peripherals - L4 Wakeup and L4 Core now
+ */
+#define OMAP44XX_L4_CORE_BASE 0x4A000000
+#define OMAP44XX_L4_WKUP_BASE 0x4A300000
+#define OMAP44XX_L4_PER_BASE 0x48000000
+
+#define OMAP44XX_DRAM_ADDR_SPACE_START 0x80000000
+#define OMAP44XX_DRAM_ADDR_SPACE_END 0xD0000000
+#define DRAM_ADDR_SPACE_START OMAP44XX_DRAM_ADDR_SPACE_START
+#define DRAM_ADDR_SPACE_END OMAP44XX_DRAM_ADDR_SPACE_END
+
+/* CONTROL_ID_CODE */
+#define CONTROL_ID_CODE 0x4A002204
+
+#define OMAP4_CONTROL_ID_CODE_ES1_0 0x0B85202F
+#define OMAP4_CONTROL_ID_CODE_ES2_0 0x1B85202F
+#define OMAP4_CONTROL_ID_CODE_ES2_1 0x3B95C02F
+#define OMAP4_CONTROL_ID_CODE_ES2_2 0x4B95C02F
+#define OMAP4_CONTROL_ID_CODE_ES2_3 0x6B95C02F
+#define OMAP4460_CONTROL_ID_CODE_ES1_0 0x0B94E02F
+#define OMAP4460_CONTROL_ID_CODE_ES1_1 0x2B94E02F
+#define OMAP4470_CONTROL_ID_CODE_ES1_0 0x0B97502F
+
+/* UART */
+#define UART1_BASE (OMAP44XX_L4_PER_BASE + 0x6a000)
+#define UART2_BASE (OMAP44XX_L4_PER_BASE + 0x6c000)
+#define UART3_BASE (OMAP44XX_L4_PER_BASE + 0x20000)
+
+/* General Purpose Timers */
+#define GPT1_BASE (OMAP44XX_L4_WKUP_BASE + 0x18000)
+#define GPT2_BASE (OMAP44XX_L4_PER_BASE + 0x32000)
+#define GPT3_BASE (OMAP44XX_L4_PER_BASE + 0x34000)
+
+/* Watchdog Timer2 - MPU watchdog */
+#define WDT2_BASE (OMAP44XX_L4_WKUP_BASE + 0x14000)
+
+/*
+ * Hardware Register Details
+ */
+
+/* Watchdog Timer */
+#define WD_UNLOCK1 0xAAAA
+#define WD_UNLOCK2 0x5555
+
+/* GP Timer */
+#define TCLR_ST (0x1 << 0)
+#define TCLR_AR (0x1 << 1)
+#define TCLR_PRE (0x1 << 5)
+
+/* Control Module */
+#define LDOSRAM_ACTMODE_VSET_IN_MASK (0x1F << 5)
+#define LDOSRAM_VOLT_CTRL_OVERRIDE 0x0401040f
+#define CONTROL_EFUSE_1_OVERRIDE 0x1C4D0110
+#define CONTROL_EFUSE_2_OVERRIDE 0x99084000
+
+/* LPDDR2 IO regs */
+#define CONTROL_LPDDR2IO_SLEW_125PS_DRV8_PULL_DOWN 0x1C1C1C1C
+#define CONTROL_LPDDR2IO_SLEW_325PS_DRV8_GATE_KEEPER 0x9E9E9E9E
+#define CONTROL_LPDDR2IO_SLEW_315PS_DRV12_PULL_DOWN 0x7C7C7C7C
+#define LPDDR2IO_GR10_WD_MASK (3 << 17)
+#define CONTROL_LPDDR2IO_3_VAL 0xA0888C0F
+
+/* CONTROL_EFUSE_2 */
+#define CONTROL_EFUSE_2_NMOS_PMOS_PTV_CODE_1 0x00ffc000
+
+#define MMC1_PWRDNZ BIT(26)
+#define MMC1_PBIASLITE_PWRDNZ BIT(22)
+#define MMC1_PBIASLITE_VMODE BIT(21)
+
+#ifndef __ASSEMBLY__
+
+struct s32ktimer {
+ unsigned char res[0x10];
+ unsigned int s32k_cr; /* 0x10 */
+};
+
+#define DEVICE_TYPE_SHIFT (0x8)
+#define DEVICE_TYPE_MASK (0x7 << DEVICE_TYPE_SHIFT)
+
+#endif /* __ASSEMBLY__ */
+
+/*
+ * Non-secure SRAM Addresses
+ * Non-secure RAM starts at 0x40300000 for GP devices. But we keep SRAM_BASE
+ * at 0x40304000(EMU base) so that our code works for both EMU and GP
+ */
+#define NON_SECURE_SRAM_START 0x40304000
+#define NON_SECURE_SRAM_END 0x4030E000 /* Not inclusive */
+#define NON_SECURE_SRAM_IMG_END 0x4030C000
+#define SRAM_SCRATCH_SPACE_ADDR (NON_SECURE_SRAM_IMG_END - SZ_1K)
+/* base address for indirect vectors (internal boot mode) */
+#define SRAM_ROM_VECT_BASE 0x4030D000
+
+/* ABB settings */
+#define OMAP_ABB_SETTLING_TIME 50
+#define OMAP_ABB_CLOCK_CYCLES 16
+
+/* ABB tranxdone mask */
+#define OMAP_ABB_MPU_TXDONE_MASK (0x1 << 7)
+
+#define OMAP44XX_SAR_RAM_BASE 0x4a326000
+#define OMAP_REBOOT_REASON_OFFSET 0xA0C
+#define OMAP_REBOOT_REASON_SIZE 0x0F
+
+/* Boot parameters */
+#ifndef __ASSEMBLY__
+struct omap_boot_parameters {
+ unsigned int boot_message;
+ unsigned int boot_device_descriptor;
+ unsigned char boot_device;
+ unsigned char reset_reason;
+ unsigned char ch_flags;
+};
+
+int omap_reboot_mode(char *mode, unsigned int length);
+int omap_reboot_mode_clear(void);
+int omap_reboot_mode_store(char *mode);
+#endif
+
+#endif
diff --git a/arch/arm/include/asm/arch-omap4/spl.h b/arch/arm/include/asm/arch-omap4/spl.h
new file mode 100644
index 00000000000..d24944af0ae
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap4/spl.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2012
+ * Texas Instruments, <www.ti.com>
+ */
+#ifndef _ASM_ARCH_SPL_H_
+#define _ASM_ARCH_SPL_H_
+
+#define BOOT_DEVICE_NONE 0x00
+#define BOOT_DEVICE_XIP 0x01
+#define BOOT_DEVICE_XIPWAIT 0x02
+#define BOOT_DEVICE_NAND 0x03
+#define BOOT_DEVICE_ONENAND 0x04
+#define BOOT_DEVICE_MMC1 0x05
+#define BOOT_DEVICE_MMC2 0x06
+#define BOOT_DEVICE_MMC2_2 0x07
+#define BOOT_DEVICE_UART 0x43
+#define BOOT_DEVICE_USB 0x45
+
+#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
+#define MMC_BOOT_DEVICES_END BOOT_DEVICE_MMC2_2
+#endif
diff --git a/arch/arm/include/asm/arch-omap4/sys_proto.h b/arch/arm/include/asm/arch-omap4/sys_proto.h
new file mode 100644
index 00000000000..c6e6f6ca480
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap4/sys_proto.h
@@ -0,0 +1,73 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2010
+ * Texas Instruments, <www.ti.com>
+ */
+
+#ifndef _SYS_PROTO_H_
+#define _SYS_PROTO_H_
+
+#include <asm/arch/omap.h>
+#include <asm/arch/clock.h>
+#include <asm/io.h>
+#include <asm/omap_common.h>
+#include <linux/mtd/omap_gpmc.h>
+#include <asm/arch/mux_omap4.h>
+#include <asm/ti-common/sys_proto.h>
+
+#ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
+extern const struct emif_regs emif_regs_elpida_200_mhz_2cs;
+extern const struct emif_regs emif_regs_elpida_380_mhz_1cs;
+extern const struct emif_regs emif_regs_elpida_400_mhz_1cs;
+extern const struct emif_regs emif_regs_elpida_400_mhz_2cs;
+extern const struct dmm_lisa_map_regs lisa_map_2G_x_1_x_2;
+extern const struct dmm_lisa_map_regs lisa_map_2G_x_2_x_2;
+extern const struct dmm_lisa_map_regs ma_lisa_map_2G_x_2_x_2;
+#else
+extern const struct lpddr2_device_details elpida_2G_S4_details;
+extern const struct lpddr2_device_details elpida_4G_S4_details;
+#endif
+
+#ifdef CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
+extern const struct lpddr2_device_timings jedec_default_timings;
+#else
+extern const struct lpddr2_device_timings elpida_2G_S4_timings;
+#endif
+
+struct omap_sysinfo {
+ char *board_string;
+};
+
+extern const struct omap_sysinfo sysinfo;
+
+void gpmc_init(void);
+void watchdog_init(void);
+u32 get_device_type(void);
+void do_set_mux(u32 base, struct pad_conf_entry const *array, int size);
+void set_muxconf_regs(void);
+u32 wait_on_value(u32 read_bit_mask, u32 match_value, void *read_addr,
+ u32 bound);
+void sdelay(unsigned long loops);
+void setup_early_clocks(void);
+void prcm_init(void);
+void do_board_detect(void);
+void bypass_dpll(u32 const base);
+void freq_update_core(void);
+u32 get_sys_clk_freq(void);
+u32 omap4_ddr_clk(void);
+void cancel_out(u32 *num, u32 *den, u32 den_limit);
+void sdram_init(void);
+u32 omap_sdram_size(void);
+u32 cortex_rev(void);
+void save_omap_boot_params(void);
+void init_omap_revision(void);
+void do_io_settings(void);
+void sri2c_init(void);
+int omap_vc_bypass_send_value(u8 sa, u8 reg_addr, u8 reg_data);
+u32 warm_reset(void);
+void force_emif_self_refresh(void);
+void setup_warmreset_time(void);
+
+#define OMAP4_SERVICE_PL310_CONTROL_REG_SET 0x102
+
+#endif
diff --git a/arch/arm/include/asm/arch-omap5/clock.h b/arch/arm/include/asm/arch-omap5/clock.h
index eeb3c6f2a6c..02dcc0e4356 100644
--- a/arch/arm/include/asm/arch-omap5/clock.h
+++ b/arch/arm/include/asm/arch-omap5/clock.h
@@ -9,6 +9,8 @@
#ifndef _CLOCKS_OMAP5_H_
#define _CLOCKS_OMAP5_H_
+#include <asm/ti-common/omap_clock.h>
+
/*
* Assuming a maximum of 1.5 GHz ARM speed and a minimum of 2 cycles per
* loop, allow for a minimum of 2 ms wait (in reality the wait will be
@@ -19,7 +21,6 @@
/* CM_DLL_CTRL */
#define CM_DLL_CTRL_OVERRIDE_SHIFT 0
#define CM_DLL_CTRL_OVERRIDE_MASK (1 << 0)
-#define CM_DLL_CTRL_NO_OVERRIDE 0
/* CM_CLKMODE_DPLL */
#define CM_CLKMODE_DPLL_REGM4XEN_SHIFT 11
@@ -32,20 +33,6 @@
#define CM_CLKMODE_DPLL_DRIFTGUARD_EN_MASK (1 << 8)
#define CM_CLKMODE_DPLL_RAMP_RATE_SHIFT 5
#define CM_CLKMODE_DPLL_RAMP_RATE_MASK (0x7 << 5)
-#define CM_CLKMODE_DPLL_EN_SHIFT 0
-#define CM_CLKMODE_DPLL_EN_MASK (0x7 << 0)
-
-#define CM_CLKMODE_DPLL_DPLL_EN_SHIFT 0
-#define CM_CLKMODE_DPLL_DPLL_EN_MASK 7
-
-#define DPLL_EN_STOP 1
-#define DPLL_EN_MN_BYPASS 4
-#define DPLL_EN_LOW_POWER_BYPASS 5
-#define DPLL_EN_FAST_RELOCK_BYPASS 6
-#define DPLL_EN_LOCK 7
-
-/* CM_IDLEST_DPLL fields */
-#define ST_DPLL_CLK_MASK 1
/* SGX */
#define CLKSEL_GPU_HYD_GCLK_MASK (1 << 25)
@@ -54,24 +41,6 @@
/* CM_CLKSEL_DPLL */
#define CM_CLKSEL_DPLL_DPLL_SD_DIV_SHIFT 24
#define CM_CLKSEL_DPLL_DPLL_SD_DIV_MASK (0xFF << 24)
-#define CM_CLKSEL_DPLL_M_SHIFT 8
-#define CM_CLKSEL_DPLL_M_MASK (0x7FF << 8)
-#define CM_CLKSEL_DPLL_N_SHIFT 0
-#define CM_CLKSEL_DPLL_N_MASK 0x7F
-#define CM_CLKSEL_DCC_EN_SHIFT 22
-#define CM_CLKSEL_DCC_EN_MASK (1 << 22)
-
-/* CM_SYS_CLKSEL */
-#define CM_SYS_CLKSEL_SYS_CLKSEL_MASK 7
-
-/* CM_CLKSEL_CORE */
-#define CLKSEL_CORE_SHIFT 0
-#define CLKSEL_L3_SHIFT 4
-#define CLKSEL_L4_SHIFT 8
-
-#define CLKSEL_CORE_X2_DIV_1 0
-#define CLKSEL_L3_CORE_DIV_2 1
-#define CLKSEL_L4_L3_DIV_2 1
/* CM_ABE_PLL_REF_CLKSEL */
#define CM_ABE_PLL_REF_CLKSEL_CLKSEL_SHIFT 0
@@ -91,57 +60,12 @@
#define DPLL_IVA_CLKSEL_CORE_X2_DIV_2 1
-/* CM_SHADOW_FREQ_CONFIG1 */
-#define SHADOW_FREQ_CONFIG1_FREQ_UPDATE_MASK 1
-#define SHADOW_FREQ_CONFIG1_DLL_OVERRIDE_MASK 4
-#define SHADOW_FREQ_CONFIG1_DLL_RESET_MASK 8
-
-#define SHADOW_FREQ_CONFIG1_DPLL_EN_SHIFT 8
-#define SHADOW_FREQ_CONFIG1_DPLL_EN_MASK (7 << 8)
-
-#define SHADOW_FREQ_CONFIG1_M2_DIV_SHIFT 11
-#define SHADOW_FREQ_CONFIG1_M2_DIV_MASK (0x1F << 11)
-
-/*CM_<clock_domain>__CLKCTRL */
-#define CD_CLKCTRL_CLKTRCTRL_SHIFT 0
-#define CD_CLKCTRL_CLKTRCTRL_MASK 3
-
-#define CD_CLKCTRL_CLKTRCTRL_NO_SLEEP 0
-#define CD_CLKCTRL_CLKTRCTRL_SW_SLEEP 1
-#define CD_CLKCTRL_CLKTRCTRL_SW_WKUP 2
-#define CD_CLKCTRL_CLKTRCTRL_HW_AUTO 3
-
-/* CM_<clock_domain>_<module>_CLKCTRL */
-#define MODULE_CLKCTRL_MODULEMODE_SHIFT 0
-#define MODULE_CLKCTRL_MODULEMODE_MASK 3
-#define MODULE_CLKCTRL_IDLEST_SHIFT 16
-#define MODULE_CLKCTRL_IDLEST_MASK (3 << 16)
-
-#define MODULE_CLKCTRL_MODULEMODE_SW_DISABLE 0
-#define MODULE_CLKCTRL_MODULEMODE_HW_AUTO 1
-#define MODULE_CLKCTRL_MODULEMODE_SW_EXPLICIT_EN 2
-
-#define MODULE_CLKCTRL_IDLEST_FULLY_FUNCTIONAL 0
-#define MODULE_CLKCTRL_IDLEST_TRANSITIONING 1
-#define MODULE_CLKCTRL_IDLEST_IDLE 2
-#define MODULE_CLKCTRL_IDLEST_DISABLED 3
-
-/* CM_L4PER_GPIO4_CLKCTRL */
-#define GPIO4_CLKCTRL_OPTFCLKEN_MASK (1 << 8)
-
-/* CM_L3INIT_HSMMCn_CLKCTRL */
-#define HSMMC_CLKCTRL_CLKSEL_MASK (1 << 24)
-#define HSMMC_CLKCTRL_CLKSEL_DIV_MASK (3 << 25)
-
/* CM_IPU1_IPU1_CLKCTRL CLKSEL MASK */
#define IPU1_CLKCTRL_CLKSEL_MASK BIT(24)
/* CM_L3INIT_SATA_CLKCTRL */
#define SATA_CLKCTRL_OPTFCLKEN_MASK (1 << 8)
-/* CM_WKUP_GPTIMER1_CLKCTRL */
-#define GPTIMER1_CLKCTRL_CLKSEL_MASK (1 << 24)
-
/* CM_CAM_ISS_CLKCTRL */
#define ISS_CLKCTRL_OPTFCLKEN_MASK (1 << 8)
@@ -181,12 +105,6 @@
/* CM_L3INIT_OCP2SCP1_CLKCTRL */
#define OCP2SCP1_CLKCTRL_MODULEMODE_HW (1 << 0)
-/* CM_MPU_MPU_CLKCTRL */
-#define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_SHIFT 24
-#define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_MASK (3 << 24)
-#define MPU_CLKCTRL_CLKSEL_ABE_DIV_MODE_SHIFT 26
-#define MPU_CLKCTRL_CLKSEL_ABE_DIV_MODE_MASK (1 << 26)
-
/* CM_WKUPAON_SCRM_CLKCTRL */
#define OPTFCLKEN_SCRM_PER_SHIFT 9
#define OPTFCLKEN_SCRM_PER_MASK (1 << 9)
@@ -201,12 +119,6 @@
#define RSTTIME1_SHIFT 0
#define RSTTIME1_MASK (0x3ff << 0)
-/* Clock frequencies */
-#define OMAP_SYS_CLK_IND_38_4_MHZ 6
-
-/* PRM_VC_VAL_BYPASS */
-#define PRM_VC_I2C_CHANNEL_FREQ_KHZ 400
-
/* CTRL_CORE_SRCOMP_NORTH_SIDE */
#define USB2PHY_DISCHGDET (1 << 29)
#define USB2PHY_AUTORESUME_EN (1 << 30)
@@ -402,16 +314,4 @@
/* CKO buffer control */
#define CKOBUFFER_CLK_ENABLE_MASK (1 << 28)
-/* AUXCLKx reg fields */
-#define AUXCLK_ENABLE_MASK (1 << 8)
-#define AUXCLK_SRCSELECT_SHIFT 1
-#define AUXCLK_SRCSELECT_MASK (3 << 1)
-#define AUXCLK_CLKDIV_SHIFT 16
-#define AUXCLK_CLKDIV_MASK (0xF << 16)
-
-#define AUXCLK_SRCSELECT_SYS_CLK 0
-#define AUXCLK_SRCSELECT_CORE_DPLL 1
-#define AUXCLK_SRCSELECT_PER_DPLL 2
-#define AUXCLK_SRCSELECT_ALTERNATE 3
-
#endif /* _CLOCKS_OMAP5_H_ */
diff --git a/arch/arm/include/asm/armv8/mmu.h b/arch/arm/include/asm/armv8/mmu.h
index 5359b2ad87b..8e6989810b0 100644
--- a/arch/arm/include/asm/armv8/mmu.h
+++ b/arch/arm/include/asm/armv8/mmu.h
@@ -187,6 +187,13 @@ void walk_pagetable(u64 ttbr, u64 tcr, pte_walker_cb_t cb, void *priv);
*/
void dump_pagetable(u64 ttbr, u64 tcr);
+/**
+ * tlb_debug_lookup() - Perform a software TLB walk printing each stage
+ *
+ * @addr: the address to look-up in the TLB.
+ */
+void tlb_debug_lookup(u64 addr);
+
struct mm_region {
u64 virt;
u64 phys;
diff --git a/arch/arm/include/asm/mach-imx/ahab.h b/arch/arm/include/asm/mach-imx/ahab.h
index 4884f056251..dad170cee47 100644
--- a/arch/arm/include/asm/mach-imx/ahab.h
+++ b/arch/arm/include/asm/mach-imx/ahab.h
@@ -8,7 +8,7 @@
#include <imx_container.h>
-int ahab_auth_cntr_hdr(struct container_hdr *container, u16 length);
+void *ahab_auth_cntr_hdr(struct container_hdr *container, u16 length);
int ahab_auth_release(void);
int ahab_verify_cntr_image(struct boot_img_t *img, int image_index);
diff --git a/arch/arm/include/asm/mach-imx/ele_api.h b/arch/arm/include/asm/mach-imx/ele_api.h
index 04e7f20a2a6..8d779d6ae1b 100644
--- a/arch/arm/include/asm/mach-imx/ele_api.h
+++ b/arch/arm/include/asm/mach-imx/ele_api.h
@@ -30,6 +30,7 @@
#define ELE_START_RNG (0xA3)
#define ELE_CMD_DERIVE_KEY (0xA9)
#define ELE_GENERATE_DEK_BLOB (0xAF)
+#define ELE_V2X_GET_STATE_REQ (0xB2)
#define ELE_ENABLE_PATCH_REQ (0xC3)
#define ELE_RELEASE_RDC_REQ (0xC4)
#define ELE_GET_FW_STATUS_REQ (0xC5)
@@ -141,6 +142,12 @@ struct ele_get_info_data {
u32 reserved[8];
};
+struct v2x_get_state {
+ u8 v2x_state;
+ u8 v2x_power_state;
+ u32 v2x_err_code;
+};
+
int ele_release_rdc(u8 core_id, u8 xrdc, u32 *response);
int ele_auth_oem_ctnr(ulong ctnr_addr, u32 *response);
int ele_release_container(u32 *response);
@@ -166,4 +173,5 @@ int ele_read_shadow_fuse(u32 fuse_id, u32 *fuse_val, u32 *response);
int ele_set_gmid(u32 *response);
int ele_volt_change_start_req(void);
int ele_volt_change_finish_req(void);
+int ele_v2x_get_state(struct v2x_get_state *state, u32 *response);
#endif
diff --git a/arch/arm/include/asm/mach-imx/qb.h b/arch/arm/include/asm/mach-imx/qb.h
new file mode 100644
index 00000000000..a874c9c5e36
--- /dev/null
+++ b/arch/arm/include/asm/mach-imx/qb.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2026 NXP
+ */
+
+#ifndef __IMX_QB_H__
+#define __IMX_QB_H__
+
+#include <stdbool.h>
+
+bool imx_qb_check(void);
+int imx_qb(const char *ifname, const char *dev, bool save);
+void spl_imx_qb_save(void);
+
+#endif
diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h
index ab573413128..d25c08f8fe7 100644
--- a/arch/arm/include/asm/mach-imx/sys_proto.h
+++ b/arch/arm/include/asm/mach-imx/sys_proto.h
@@ -74,9 +74,12 @@ struct bd_info;
#define is_imx8mnud() (is_cpu_type(MXC_CPU_IMX8MNUD))
#define is_imx8mnus() (is_cpu_type(MXC_CPU_IMX8MNUS))
#define is_imx8mp() (is_cpu_type(MXC_CPU_IMX8MP) || is_cpu_type(MXC_CPU_IMX8MPD) || \
- is_cpu_type(MXC_CPU_IMX8MPL) || is_cpu_type(MXC_CPU_IMX8MP6) || is_cpu_type(MXC_CPU_IMX8MPUL))
+ is_cpu_type(MXC_CPU_IMX8MPL) || is_cpu_type(MXC_CPU_IMX8MP6) || is_cpu_type(MXC_CPU_IMX8MPUL) || \
+ is_cpu_type(MXC_CPU_IMX8MP5) || is_cpu_type(MXC_CPU_IMX8MPD2))
#define is_imx8mpd() (is_cpu_type(MXC_CPU_IMX8MPD))
+#define is_imx8mpd2() (is_cpu_type(MXC_CPU_IMX8MPD2))
#define is_imx8mpl() (is_cpu_type(MXC_CPU_IMX8MPL))
+#define is_imx8mp5() (is_cpu_type(MXC_CPU_IMX8MP5))
#define is_imx8mp6() (is_cpu_type(MXC_CPU_IMX8MP6))
#define is_imx8mpul() (is_cpu_type(MXC_CPU_IMX8MPUL))
diff --git a/arch/arm/include/asm/mach-types.h b/arch/arm/include/asm/mach-types.h
index 2713b1d2c55..e73df782d2c 100644
--- a/arch/arm/include/asm/mach-types.h
+++ b/arch/arm/include/asm/mach-types.h
@@ -5050,4 +5050,5 @@
#define MACH_TYPE_NASM25 5112
#define MACH_TYPE_TOMATO 5113
#define MACH_TYPE_OMAP3_MRC3D 5114
+#define MACH_TYPE_OMAP4_VAR_SOM 5115
#endif
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 5e74f41dd97..9945eeb66b8 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -490,7 +490,7 @@ struct omap_sys_ctrl_regs {
u32 ctrl_core_sma_sw_1;
};
-#if defined(CONFIG_OMAP54XX)
+#if defined(CONFIG_OMAP44XX) || defined(CONFIG_OMAP54XX)
struct dpll_params {
u32 m;
u32 n;
@@ -523,7 +523,7 @@ struct dpll_regs {
u32 cm_div_h23_dpll;
u32 cm_div_h24_dpll;
};
-#endif /* CONFIG_OMAP54XX */
+#endif /* CONFIG_OMAP44XX || CONFIG_OMAP54XX */
struct dplls {
const struct dpll_params *mpu;
@@ -547,7 +547,7 @@ struct pmic_data {
int (*pmic_write)(u8 sa, u8 reg_addr, u8 reg_data);
};
-#if defined(CONFIG_OMAP54XX)
+#if defined(CONFIG_OMAP44XX) || defined(CONFIG_OMAP54XX)
enum {
OPP_LOW,
OPP_NOM,
@@ -593,7 +593,7 @@ struct vcores_data {
struct volts eve;
struct volts iva;
};
-#endif /* CONFIG_OMAP54XX */
+#endif /* CONFIG_OMAP44XX || CONFIG_OMAP54XX */
extern struct prcm_regs const **prcm;
extern struct prcm_regs const omap5_es1_prcm;
@@ -626,7 +626,7 @@ const struct dpll_params *get_iva_dpll_params(struct dplls const *);
const struct dpll_params *get_usb_dpll_params(struct dplls const *);
const struct dpll_params *get_abe_dpll_params(struct dplls const *);
-#if defined(CONFIG_OMAP54XX)
+#if defined(CONFIG_OMAP44XX) || defined(CONFIG_OMAP54XX)
void do_enable_clocks(u32 const *clk_domains,
u32 const *clk_modules_hw_auto,
u32 const *clk_modules_explicit_en,
@@ -635,7 +635,7 @@ void do_enable_clocks(u32 const *clk_domains,
void do_disable_clocks(u32 const *clk_domains,
u32 const *clk_modules_disable,
u8 wait_for_disable);
-#endif /* CONFIG_OMAP54XX */
+#endif /* CONFIG_OMAP44XX || CONFIG_OMAP54XX */
void do_enable_ipu_clocks(u32 const *clk_domains,
u32 const *clk_modules_hw_auto,
@@ -653,9 +653,9 @@ void enable_basic_uboot_clocks(void);
void enable_usb_clocks(int index);
void disable_usb_clocks(int index);
-#if defined(CONFIG_OMAP54XX)
+#if defined(CONFIG_OMAP44XX) || defined(CONFIG_OMAP54XX)
void scale_vcores(struct vcores_data const *);
-#endif /* CONFIG_OMAP54XX */
+#endif /* CONFIG_OMAP44XX || CONFIG_OMAP54XX */
int get_voltrail_opp(int rail_offset);
u32 get_offset_code(u32 volt_offset, struct pmic_data *pmic);
void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic);
diff --git a/arch/arm/include/asm/ti-common/omap_clock.h b/arch/arm/include/asm/ti-common/omap_clock.h
new file mode 100644
index 00000000000..4a37b0bc8c3
--- /dev/null
+++ b/arch/arm/include/asm/ti-common/omap_clock.h
@@ -0,0 +1,114 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+#ifndef _OMAP_CLOCK_H_
+#define _OMAP_CLOCK_H_
+
+/* CM_CLKMODE_DPLL */
+#define CM_CLKMODE_DPLL_EN_SHIFT 0
+#define CM_CLKMODE_DPLL_EN_MASK (0x7 << 0)
+
+#define CM_CLKMODE_DPLL_DPLL_EN_SHIFT 0
+#define CM_CLKMODE_DPLL_DPLL_EN_MASK 7
+
+#define DPLL_EN_STOP 1
+#define DPLL_EN_MN_BYPASS 4
+#define DPLL_EN_LOW_POWER_BYPASS 5
+#define DPLL_EN_FAST_RELOCK_BYPASS 6
+#define DPLL_EN_LOCK 7
+
+#define DPLL_NO_LOCK 0
+#define DPLL_LOCK 1
+
+/* CM_IDLEST_DPLL fields */
+#define ST_DPLL_CLK_MASK 1
+
+/* CM_CLKSEL_CORE */
+#define CLKSEL_CORE_SHIFT 0
+#define CLKSEL_L3_SHIFT 4
+#define CLKSEL_L4_SHIFT 8
+
+/* CM_DLL_CTRL */
+#define CM_DLL_CTRL_NO_OVERRIDE 0
+
+/* CM_CLKSEL_DPLL */
+#define CM_CLKSEL_DPLL_N_SHIFT 0
+#define CM_CLKSEL_DPLL_N_MASK 0x7F
+#define CM_CLKSEL_DPLL_M_SHIFT 8
+#define CM_CLKSEL_DPLL_M_MASK (0x7FF << 8)
+#define CM_CLKSEL_DCC_EN_SHIFT 22
+#define CM_CLKSEL_DCC_EN_MASK BIT(22)
+
+#define CLKSEL_CORE_X2_DIV_1 0
+#define CLKSEL_L3_CORE_DIV_2 1
+#define CLKSEL_L4_L3_DIV_2 1
+
+/* CM_SYS_CLKSEL */
+#define CM_SYS_CLKSEL_SYS_CLKSEL_MASK 7
+
+/*CM_<clock_domain>__CLKCTRL */
+#define CD_CLKCTRL_CLKTRCTRL_SHIFT 0
+#define CD_CLKCTRL_CLKTRCTRL_MASK 3
+
+#define CD_CLKCTRL_CLKTRCTRL_NO_SLEEP 0
+#define CD_CLKCTRL_CLKTRCTRL_SW_SLEEP 1
+#define CD_CLKCTRL_CLKTRCTRL_SW_WKUP 2
+#define CD_CLKCTRL_CLKTRCTRL_HW_AUTO 3
+
+/* CM_SHADOW_FREQ_CONFIG1 */
+#define SHADOW_FREQ_CONFIG1_FREQ_UPDATE_MASK 1
+#define SHADOW_FREQ_CONFIG1_DLL_OVERRIDE_MASK 4
+#define SHADOW_FREQ_CONFIG1_DLL_RESET_MASK 8
+
+#define SHADOW_FREQ_CONFIG1_DPLL_EN_SHIFT 8
+#define SHADOW_FREQ_CONFIG1_DPLL_EN_MASK (7 << 8)
+
+#define SHADOW_FREQ_CONFIG1_M2_DIV_SHIFT 11
+#define SHADOW_FREQ_CONFIG1_M2_DIV_MASK (0x1F << 11)
+
+/* CM_<clock_domain>_<module>_CLKCTRL */
+#define MODULE_CLKCTRL_MODULEMODE_SHIFT 0
+#define MODULE_CLKCTRL_MODULEMODE_MASK 3
+#define MODULE_CLKCTRL_IDLEST_SHIFT 16
+#define MODULE_CLKCTRL_IDLEST_MASK (3 << 16)
+
+#define MODULE_CLKCTRL_MODULEMODE_SW_DISABLE 0
+#define MODULE_CLKCTRL_MODULEMODE_HW_AUTO 1
+#define MODULE_CLKCTRL_MODULEMODE_SW_EXPLICIT_EN 2
+
+#define MODULE_CLKCTRL_IDLEST_FULLY_FUNCTIONAL 0
+#define MODULE_CLKCTRL_IDLEST_TRANSITIONING 1
+#define MODULE_CLKCTRL_IDLEST_IDLE 2
+#define MODULE_CLKCTRL_IDLEST_DISABLED 3
+
+/* CM_L4PER_GPIO4_CLKCTRL */
+#define GPIO4_CLKCTRL_OPTFCLKEN_MASK BIT(8)
+
+/* CM_WKUP_GPTIMER1_CLKCTRL */
+#define GPTIMER1_CLKCTRL_CLKSEL_MASK BIT(24)
+
+/* CM_L3INIT_HSMMCn_CLKCTRL */
+#define HSMMC_CLKCTRL_CLKSEL_MASK BIT(24)
+#define HSMMC_CLKCTRL_CLKSEL_DIV_MASK (3 << 25)
+
+/* Clock frequencies */
+#define OMAP_SYS_CLK_IND_38_4_MHZ 6
+
+/* AUXCLKx reg fields */
+#define AUXCLK_ENABLE_MASK BIT(8)
+#define AUXCLK_SRCSELECT_SHIFT 1
+#define AUXCLK_SRCSELECT_MASK (3 << 1)
+#define AUXCLK_CLKDIV_SHIFT 16
+#define AUXCLK_CLKDIV_MASK (0xF << 16)
+#define AUXCLK_CLKDIV_2 1
+
+#define AUXCLK_SRCSELECT_SYS_CLK 0
+#define AUXCLK_SRCSELECT_CORE_DPLL 1
+#define AUXCLK_SRCSELECT_PER_DPLL 2
+#define AUXCLK_SRCSELECT_ALTERNATE 3
+
+/* CM_MPU_MPU_CLKCTRL */
+#define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_SHIFT 24
+#define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_MASK (3 << 24)
+#define MPU_CLKCTRL_CLKSEL_ABE_DIV_MODE_SHIFT 26
+#define MPU_CLKCTRL_CLKSEL_ABE_DIV_MODE_MASK BIT(26)
+
+#endif /* _OMAP_CLOCK_H_ */