aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/unaligned.h3
-rw-r--r--include/bootm.h8
-rw-r--r--include/config_distro_bootcmd.h11
-rw-r--r--include/configs/SBx81LIFKW.h119
-rw-r--r--include/configs/advantech_dms-ba16.h1
-rw-r--r--include/configs/apalis_imx6.h1
-rw-r--r--include/configs/at91-sama5_common.h2
-rw-r--r--include/configs/at91sam9260ek.h2
-rw-r--r--include/configs/at91sam9261ek.h2
-rw-r--r--include/configs/at91sam9263ek.h2
-rw-r--r--include/configs/at91sam9m10g45ek.h2
-rw-r--r--include/configs/at91sam9n12ek.h2
-rw-r--r--include/configs/at91sam9rlek.h2
-rw-r--r--include/configs/at91sam9x5ek.h2
-rw-r--r--include/configs/ax25-ae350.h (renamed from include/configs/nx25-ae250.h)55
-rw-r--r--include/configs/bitmain_antminer_s9.h30
-rw-r--r--include/configs/blanche.h30
-rw-r--r--include/configs/clearfog.h16
-rw-r--r--include/configs/colibri_imx6.h1
-rw-r--r--include/configs/dh_imx6.h1
-rw-r--r--include/configs/dns325.h3
-rw-r--r--include/configs/ds414.h3
-rw-r--r--include/configs/ebisu.h33
-rw-r--r--include/configs/emdk.h40
-rw-r--r--include/configs/ge_bx50v3.h17
-rw-r--r--include/configs/goflexhome.h3
-rw-r--r--include/configs/guruplug.h9
-rw-r--r--include/configs/gw_ventana.h1
-rw-r--r--include/configs/ib62x0.h3
-rw-r--r--include/configs/iconnect.h3
-rw-r--r--include/configs/imx6dl-mamoj.h101
-rw-r--r--include/configs/kp_imx53.h112
-rw-r--r--include/configs/kp_imx6q_tpc.h2
-rw-r--r--include/configs/legoev3.h104
-rw-r--r--include/configs/mv-common.h18
-rw-r--r--include/configs/mv-plug-common.h15
-rw-r--r--include/configs/mx31pdk.h2
-rw-r--r--include/configs/mx53ppd.h1
-rw-r--r--include/configs/mx6_common.h3
-rw-r--r--include/configs/mx7_common.h3
-rw-r--r--include/configs/nitrogen6x.h179
-rw-r--r--include/configs/nsa310s.h3
-rw-r--r--include/configs/nsim.h10
-rw-r--r--include/configs/odroid_xu3.h1
-rw-r--r--include/configs/openrd.h3
-rw-r--r--include/configs/pogo_e02.h3
-rw-r--r--include/configs/rcar-gen2-common.h8
-rw-r--r--include/configs/rpi.h73
-rw-r--r--include/configs/sama5d2_xplained.h9
-rw-r--r--include/configs/sheevaplug.h9
-rw-r--r--include/configs/socfpga_common.h46
-rw-r--r--include/configs/stih410-b2260.h1
-rw-r--r--include/configs/stm32f429-discovery.h6
-rw-r--r--include/configs/uniphier.h4
-rw-r--r--include/configs/vining_2000.h1
-rw-r--r--include/configs/xilinx_zynqmp_mini.h1
-rw-r--r--include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h1
-rw-r--r--include/configs/xilinx_zynqmp_zc1751_xm016_dc2.h16
-rw-r--r--include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h3
-rw-r--r--include/configs/xilinx_zynqmp_zcu100.h3
-rw-r--r--include/configs/xilinx_zynqmp_zcu102.h2
-rw-r--r--include/configs/xilinx_zynqmp_zcu104.h2
-rw-r--r--include/configs/xilinx_zynqmp_zcu106.h2
-rw-r--r--include/configs/xilinx_zynqmp_zcu111.h2
-rw-r--r--include/dm/fdtaddr.h22
-rw-r--r--include/dm/read.h32
-rw-r--r--include/dt-bindings/clock/r8a77990-cpg-mssr.h63
-rw-r--r--include/dt-bindings/leds/leds-netxbig.h18
-rw-r--r--include/dt-bindings/leds/leds-ns2.h9
-rw-r--r--include/dt-bindings/pinctrl/pinctrl-snapdragon.h22
-rw-r--r--include/dt_table.h49
-rw-r--r--include/efi_api.h24
-rw-r--r--include/efi_loader.h32
-rw-r--r--include/fastboot-internal.h36
-rw-r--r--include/fastboot.h137
-rw-r--r--include/fb_mmc.h35
-rw-r--r--include/fb_nand.h37
-rw-r--r--include/fdtdec.h1
-rw-r--r--include/fpga.h11
-rw-r--r--include/fs.h10
-rw-r--r--include/fsl_pmic.h41
-rw-r--r--include/image-sparse.h4
-rw-r--r--include/image.h5
-rw-r--r--include/linux/libfdt_env.h6
-rw-r--r--include/linux/usb/otg.h9
-rw-r--r--include/net.h2
-rw-r--r--include/net/fastboot.h21
-rw-r--r--include/netdev.h1
-rw-r--r--include/os.h21
-rw-r--r--include/part_efi.h3
-rw-r--r--include/pci.h15
-rw-r--r--include/phy-sun4i-usb.h34
-rw-r--r--include/power/pmic.h9
-rw-r--r--include/serial.h16
-rw-r--r--include/smbios.h5
-rw-r--r--include/tpm-common.h217
-rw-r--r--include/tpm-v1.h (renamed from include/tpm.h)296
-rw-r--r--include/tpm-v2.h262
-rw-r--r--include/tsi108.h207
-rw-r--r--include/xilinx.h4
-rw-r--r--include/zynqmppl.h3
101 files changed, 1967 insertions, 908 deletions
diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h
index fd0255099a..3d33a5a063 100644
--- a/include/asm-generic/unaligned.h
+++ b/include/asm-generic/unaligned.h
@@ -20,4 +20,7 @@
#error invalid endian
#endif
+/* Allow unaligned memory access */
+void allow_unaligned(void);
+
#endif
diff --git a/include/bootm.h b/include/bootm.h
index 9e42e17987..0501414e0d 100644
--- a/include/bootm.h
+++ b/include/bootm.h
@@ -72,4 +72,12 @@ int bootm_decomp_image(int comp, ulong load, ulong image_start, int type,
void *load_buf, void *image_buf, ulong image_len,
uint unc_len, ulong *load_end);
+/*
+ * boards should define this to disable devices when EFI exits from boot
+ * services.
+ *
+ * TODO(sjg@chromium.org>): Update this to use driver model's device_remove().
+ */
+void board_quiesce_devices(void);
+
#endif
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 8d5feb3ac7..d672e8ebe6 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -99,6 +99,10 @@
#define BOOTEFI_NAME "bootia32.efi"
#elif defined(CONFIG_X86_RUN_64BIT)
#define BOOTEFI_NAME "bootx64.efi"
+#elif defined(CONFIG_CPU_RISCV_32)
+#define BOOTEFI_NAME "bootriscv32.efi"
+#elif defined(CONFIG_CPU_RISCV_64)
+#define BOOTEFI_NAME "bootriscv64.efi"
#endif
#endif
@@ -240,6 +244,7 @@
#if defined(CONFIG_CMD_DHCP)
#if defined(CONFIG_EFI_LOADER)
+/* http://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml */
#if defined(CONFIG_ARM64)
#define BOOTENV_EFI_PXE_ARCH "0xb"
#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00011:UNDI:003000"
@@ -250,6 +255,12 @@
/* Always assume we're running 64bit */
#define BOOTENV_EFI_PXE_ARCH "0x7"
#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00007:UNDI:003000"
+#elif defined(CONFIG_CPU_RISCV_32)
+#define BOOTENV_EFI_PXE_ARCH "0x19"
+#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00025:UNDI:003000"
+#elif defined(CONFIG_CPU_RISCV_64)
+#define BOOTENV_EFI_PXE_ARCH "0x1b"
+#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00027:UNDI:003000"
#else
#error Please specify an EFI client identifier
#endif
diff --git a/include/configs/SBx81LIFKW.h b/include/configs/SBx81LIFKW.h
new file mode 100644
index 0000000000..bcc2c201d2
--- /dev/null
+++ b/include/configs/SBx81LIFKW.h
@@ -0,0 +1,119 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2016 Allied Telesis <www.alliedtelesis.co.nz>
+ */
+
+#ifndef _CONFIG_SBX81LIFKW_H
+#define _CONFIG_SBX81LIFKW_H
+
+/*
+ * High Level Configuration Options (easy to change)
+ */
+#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */
+#define CONFIG_KW88F6281 1 /* SOC Name */
+#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
+#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage.cfg
+#define CONFIG_BUILD_TARGET "u-boot.kwb"
+
+/* additions for new ARM relocation support */
+#define CONFIG_SYS_SDRAM_BASE 0x00000000
+
+#define CONFIG_MD5 /* get_random_hex on krikwood needs MD5 support */
+#define CONFIG_KIRKWOOD_EGIGA_INIT /* Enable GbePort0/1 for kernel */
+#define CONFIG_KIRKWOOD_PCIE_INIT /* Enable PCIE Port0 */
+#define CONFIG_KIRKWOOD_RGMII_PAD_1V8 /* Set RGMII Pad voltage to 1.8V */
+#define CONFIG_KIRKWOOD_GPIO 1
+
+#define CONFIG_MISC_INIT_R /* call misc_init_r */
+
+/*
+ * NS16550 Configuration
+ */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE (-4)
+#define CONFIG_SYS_NS16550_CLK CONFIG_SYS_TCLK
+#define CONFIG_SYS_NS16550_COM1 KW_UART0_BASE
+
+/*
+ * Serial Port configuration
+ * The following definitions let you select what serial you want to use
+ * for your console driver.
+ */
+
+#define CONFIG_CONS_INDEX 1 /*Console on UART0 */
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */
+#define CONFIG_INITRD_TAG 1 /* enable INITRD tag */
+#define CONFIG_SETUP_MEMORY_TAGS 1 /* enable memory tag */
+
+#define MTDPARTS_DEFAULT "mtdparts=spi0.0:768K(boot)ro,256K(boot-env),14M(user),1M(errlog)"
+#define MTDPARTS_MTDOOPS "errlog"
+#define CONFIG_DOS_PARTITION
+
+/*
+ * Environment variables configurations
+ */
+#define CONFIG_ENV_SPI_BUS 0
+#define CONFIG_ENV_SPI_CS 0
+#define CONFIG_ENV_SPI_MAX_HZ 20000000 /* 20Mhz */
+#define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE
+#define CONFIG_ENV_SECT_SIZE 0x40000 /* 256K */
+#define CONFIG_ENV_SIZE 0x02000
+#define CONFIG_ENV_OFFSET 0xc0000 /* env starts here - 768K */
+
+/*
+ * U-Boot bootcode configuration
+ */
+
+#define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 256 kB for monitor */
+#define CONFIG_SYS_MALLOC_LEN (4 << 20) /* Reserve 4.0 MB for malloc */
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Mem map for Linux*/
+
+/* size in bytes reserved for initial data */
+
+#include <asm/arch/config.h>
+/* There is no PHY directly connected so don't ask it for link status */
+#undef CONFIG_SYS_FAULT_ECHO_LINK_DOWN
+
+/*
+ * Other required minimal configurations
+ */
+#define CONFIG_ARCH_CPU_INIT /* call arch_cpu_init() */
+#define CONFIG_NR_DRAM_BANKS 4
+#define CONFIG_SYS_MEMTEST_START 0x00400000 /* 4M */
+#define CONFIG_SYS_MEMTEST_END 0x007fffff /*(_8M -1) */
+#define CONFIG_SYS_RESET_ADDRESS 0xffff0000 /* Rst Vector Adr */
+
+/*
+ * Ethernet Driver configuration
+ */
+#ifdef CONFIG_CMD_NET
+#define CONFIG_NETCONSOLE /* include NetConsole support */
+#define CONFIG_NET_MULTI /* specify more that one ports available */
+#define CONFIG_MII /* expose smi over miiphy interface */
+#define CONFIG_MVGBE /* Enable kirkwood Gbe Controller Driver */
+#define CONFIG_MVGBE_PORTS {1, 0} /* enable a single port */
+#define CONFIG_PHY_BASE_ADR 0x01
+#define CONFIG_ENV_OVERWRITE /* ethaddr can be reprogrammed */
+#endif /* CONFIG_CMD_NET */
+
+/*
+ * Time settings
+ */
+#define CONFIG_RTC_MV
+
+#define CONFIG_SYS_LOAD_ADDR 0x1000000 /* default location for tftp and bootm */
+
+#endif /* _CONFIG_SBX81LIFKW_H */
diff --git a/include/configs/advantech_dms-ba16.h b/include/configs/advantech_dms-ba16.h
index a6e99192ba..8e33d38f97 100644
--- a/include/configs/advantech_dms-ba16.h
+++ b/include/configs/advantech_dms-ba16.h
@@ -45,7 +45,6 @@
/* MMC Configs */
#define CONFIG_FSL_USDHC
#define CONFIG_SYS_FSL_ESDHC_ADDR 0
-#define CONFIG_BOUNCE_BUFFER
/* USB Configs */
#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h
index 00255c80d6..7225c03ac5 100644
--- a/include/configs/apalis_imx6.h
+++ b/include/configs/apalis_imx6.h
@@ -56,7 +56,6 @@
#define CONFIG_SYS_FSL_USDHC_NUM 3
#define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
-#define CONFIG_BOUNCE_BUFFER
/*
* SATA Configs
diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h
index 5af7d1d1d2..30c6cd47ca 100644
--- a/include/configs/at91-sama5_common.h
+++ b/include/configs/at91-sama5_common.h
@@ -57,7 +57,7 @@
#ifdef CONFIG_NAND_BOOT
/* u-boot env in nand flash */
-#define CONFIG_ENV_OFFSET 0xc0000
+#define CONFIG_ENV_OFFSET 0x140000
#define CONFIG_ENV_OFFSET_REDUND 0x100000
#define CONFIG_ENV_SIZE 0x20000
#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
index 433e4a8029..137d7f0bbf 100644
--- a/include/configs/at91sam9260ek.h
+++ b/include/configs/at91sam9260ek.h
@@ -138,7 +138,7 @@
#elif defined(CONFIG_SYS_USE_NANDFLASH)
/* bootstrap + u-boot + env + linux in nandflash */
-#define CONFIG_ENV_OFFSET 0x120000
+#define CONFIG_ENV_OFFSET 0x140000
#define CONFIG_ENV_OFFSET_REDUND 0x100000
#define CONFIG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */
#define CONFIG_BOOTCOMMAND "nand read 0x22000000 0x200000 0x300000; bootm"
diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h
index 6a085dd3e9..9e85259909 100644
--- a/include/configs/at91sam9261ek.h
+++ b/include/configs/at91sam9261ek.h
@@ -125,7 +125,7 @@
#else /* CONFIG_SYS_USE_NANDFLASH */
/* bootstrap + u-boot + env + linux in nandflash */
-#define CONFIG_ENV_OFFSET 0x120000
+#define CONFIG_ENV_OFFSET 0x140000
#define CONFIG_ENV_OFFSET_REDUND 0x100000
#define CONFIG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */
#define CONFIG_BOOTCOMMAND "nand read 0x22000000 0x200000 0x300000; bootm"
diff --git a/include/configs/at91sam9263ek.h b/include/configs/at91sam9263ek.h
index f37ef594e5..4c476fc6a2 100644
--- a/include/configs/at91sam9263ek.h
+++ b/include/configs/at91sam9263ek.h
@@ -234,7 +234,7 @@
#elif CONFIG_SYS_USE_NANDFLASH
/* bootstrap + u-boot + env + linux in nandflash */
-#define CONFIG_ENV_OFFSET 0x120000
+#define CONFIG_ENV_OFFSET 0x140000
#define CONFIG_ENV_OFFSET_REDUND 0x100000
#define CONFIG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */
#define CONFIG_BOOTCOMMAND "nand read 0x22000000 0x200000 0x300000; bootm"
diff --git a/include/configs/at91sam9m10g45ek.h b/include/configs/at91sam9m10g45ek.h
index 25970666c8..bec1558d6b 100644
--- a/include/configs/at91sam9m10g45ek.h
+++ b/include/configs/at91sam9m10g45ek.h
@@ -76,7 +76,7 @@
#ifdef CONFIG_NAND_BOOT
/* bootstrap + u-boot + env in nandflash */
-#define CONFIG_ENV_OFFSET 0x120000
+#define CONFIG_ENV_OFFSET 0x140000
#define CONFIG_ENV_OFFSET_REDUND 0x100000
#define CONFIG_ENV_SIZE 0x20000
diff --git a/include/configs/at91sam9n12ek.h b/include/configs/at91sam9n12ek.h
index b284db36da..a6865b2d6f 100644
--- a/include/configs/at91sam9n12ek.h
+++ b/include/configs/at91sam9n12ek.h
@@ -110,7 +110,7 @@
#elif defined(CONFIG_NAND_BOOT)
/* bootstrap + u-boot + env + linux in nandflash */
-#define CONFIG_ENV_OFFSET 0x120000
+#define CONFIG_ENV_OFFSET 0x140000
#define CONFIG_ENV_OFFSET_REDUND 0x100000
#define CONFIG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */
#define CONFIG_BOOTCOMMAND \
diff --git a/include/configs/at91sam9rlek.h b/include/configs/at91sam9rlek.h
index f805c7590f..5ddb7673e5 100644
--- a/include/configs/at91sam9rlek.h
+++ b/include/configs/at91sam9rlek.h
@@ -86,7 +86,7 @@
#elif CONFIG_SYS_USE_NANDFLASH
/* bootstrap + u-boot + env + linux in nandflash */
-#define CONFIG_ENV_OFFSET 0x120000
+#define CONFIG_ENV_OFFSET 0x140000
#define CONFIG_ENV_OFFSET_REDUND 0x100000
#define CONFIG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */
#define CONFIG_BOOTCOMMAND "nand read 0x22000000 0x200000 0x600000; " \
diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index de10fadfbd..8fc9750945 100644
--- a/include/configs/at91sam9x5ek.h
+++ b/include/configs/at91sam9x5ek.h
@@ -86,7 +86,7 @@
#ifdef CONFIG_NAND_BOOT
/* bootstrap + u-boot + env + linux in nandflash */
-#define CONFIG_ENV_OFFSET 0x120000
+#define CONFIG_ENV_OFFSET 0x140000
#define CONFIG_ENV_OFFSET_REDUND 0x100000
#define CONFIG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */
#define CONFIG_BOOTCOMMAND "nand read " \
diff --git a/include/configs/nx25-ae250.h b/include/configs/ax25-ae350.h
index 930cdbd4e4..b1ca5ac11a 100644
--- a/include/configs/nx25-ae250.h
+++ b/include/configs/ax25-ae350.h
@@ -79,6 +79,44 @@
#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM_0
#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_0 + PHYS_SDRAM_0_SIZE)
+/*
+ * FLASH and environment organization
+ */
+
+/* use CFI framework */
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_FLASH_CFI_DRIVER
+
+#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+#define CONFIG_SYS_CFI_FLASH_STATUS_POLL
+
+/* support JEDEC */
+#ifdef CONFIG_CFI_FLASH
+#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT 1
+#endif/* Do not use CONFIG_FLASH_CFI_LEGACY to detect on board flash */
+#define PHYS_FLASH_1 0x88000000 /* BANK 0 */
+#define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1
+#define CONFIG_SYS_FLASH_BANKS_LIST { PHYS_FLASH_1, }
+#define CONFIG_SYS_MONITOR_BASE PHYS_FLASH_1
+
+#define CONFIG_SYS_FLASH_ERASE_TOUT 120000 /* TO for Flash Erase (ms) */
+#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* TO for Flash Write (ms) */
+
+/* max number of memory banks */
+/*
+ * There are 4 banks supported for this Controller,
+ * but we have only 1 bank connected to flash on board
+*/
+#ifndef CONFIG_SYS_MAX_FLASH_BANKS_DETECT
+#define CONFIG_SYS_MAX_FLASH_BANKS 1
+#endif
+#define CONFIG_SYS_FLASH_BANKS_SIZES {0x4000000}
+
+/* max number of sectors on one chip */
+#define CONFIG_FLASH_SECTOR_SIZE (0x10000*2)
+#define CONFIG_SYS_MAX_FLASH_SECT 512
+
/* environments */
#define CONFIG_ENV_SPI_BUS 0
#define CONFIG_ENV_SPI_CS 0
@@ -104,4 +142,21 @@
/* Increase max gunzip size */
#define CONFIG_SYS_BOOTM_LEN (64 << 20)
+/* When we use RAM as ENV */
+#define CONFIG_ENV_SIZE 0x2000
+
+/* Enable distro boot */
+#define BOOT_TARGET_DEVICES(func) \
+ func(MMC, mmc, 0) \
+ func(DHCP, dhcp, na)
+#include <config_distro_bootcmd.h>
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "kernel_addr_r=0x00080000\0" \
+ "pxefile_addr_r=0x01f00000\0" \
+ "scriptaddr=0x01f00000\0" \
+ "fdt_addr_r=0x02000000\0" \
+ "ramdisk_addr_r=0x02800000\0" \
+ BOOTENV
+
#endif /* __CONFIG_H */
diff --git a/include/configs/bitmain_antminer_s9.h b/include/configs/bitmain_antminer_s9.h
new file mode 100644
index 0000000000..226750215e
--- /dev/null
+++ b/include/configs/bitmain_antminer_s9.h
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * (C) Copyright 2018 Michal Simek <monstr@monstr.eu>
+ */
+
+#ifndef __CONFIG_BITMAIN_ANTMINER_S9_H
+#define __CONFIG_BITMAIN_ANTMINER_S9_H
+
+#define CONFIG_SYS_SDRAM_BASE 0x00000000
+#define CONFIG_SYS_SDRAM_SIZE 0x40000000
+
+#define CONFIG_ENV_SIZE 0x20000
+#define CONFIG_ENV_OFFSET 0x300000
+
+#define CONFIG_BOOTP_SERVERIP
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "autoload=no\0" \
+ "pxefile_addr_r=0x2000000\0" \
+ "scriptaddr=0x3000000\0" \
+ "kernel_addr_r=0x2000000\0" \
+ "fdt_high=0xefff000\0" \
+ "initrd_high=0xefff000\0" \
+ "devnum=0\0" \
+ "wdstop=mw f8005000 ABC000\0" \
+ BOOTENV
+
+#include <configs/zynq-common.h>
+
+#endif /* __CONFIG_BITMAIN_ANTMINER_S9_H */
diff --git a/include/configs/blanche.h b/include/configs/blanche.h
index 8ff82d3489..6df0e9bcc0 100644
--- a/include/configs/blanche.h
+++ b/include/configs/blanche.h
@@ -12,9 +12,9 @@
#include "rcar-gen2-common.h"
/* STACK */
-#define CONFIG_SYS_INIT_SP_ADDR 0xE817FFFC
-#define STACK_AREA_SIZE 0xC000
-#define LOW_LEVEL_MERAM_STACK \
+#define CONFIG_SYS_INIT_SP_ADDR 0x4f000000
+#define STACK_AREA_SIZE 0x00100000
+#define LOW_LEVEL_MERAM_STACK \
(CONFIG_SYS_INIT_SP_ADDR + STACK_AREA_SIZE - 4)
/* MEMORY */
@@ -22,12 +22,6 @@
#define RCAR_GEN2_SDRAM_SIZE (1024u * 1024 * 1024)
#define RCAR_GEN2_UBOOT_SDRAM_SIZE (512 * 1024 * 1024)
-/* SCIF */
-#define CONFIG_CONS_SCIF0
-
-#define CONFIG_SYS_MEMTEST_START (RCAR_GEN2_SDRAM_BASE)
-#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 504 * 1024 * 1024)
-
#undef CONFIG_SYS_MEMTEST_SCRATCH
#undef CONFIG_SYS_LOADS_BAUD_CHANGE
@@ -55,7 +49,6 @@
#undef CONFIG_CMD_SPI
#endif
-
/* Board Clock */
#define RMOBILE_XTAL_CLK 20000000u
#define CONFIG_SYS_CLK_FREQ RMOBILE_XTAL_CLK
@@ -73,21 +66,4 @@
#define CONFIG_ENV_SIZE_REDUND (CONFIG_SYS_MONITOR_LEN)
#endif
-/* Module stop status bits */
-/* INTC-RT */
-#define CONFIG_SMSTP0_ENA 0x00400000
-/* SDHI0 */
-#define CONFIG_SMSTP3_ENA 0x00004000
-/* INTC-SYS, IRQC */
-#define CONFIG_SMSTP4_ENA 0x00000180
-/* SCIF0 */
-#define CONFIG_SMSTP7_ENA 0x00200000
-/* QSPI */
-#define CONFIG_SMSTP9_ENA 0x00020000
-/* SYS-DMAC0 */
-#define CONFIG_RMSTP2_ENA 0x00080000
-
-/* SDHI */
-#define CONFIG_SH_SDHI_FREQ 97500000
-
#endif /* __BLANCHE_H */
diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
index f57f9b21ab..1141aee08b 100644
--- a/include/configs/clearfog.h
+++ b/include/configs/clearfog.h
@@ -21,13 +21,6 @@
* Commands configuration
*/
-/* I2C */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_MVTWSI
-#define CONFIG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE
-#define CONFIG_SYS_I2C_SLAVE 0x0
-#define CONFIG_SYS_I2C_SPEED 100000
-
/* SPI NOR flash default params, used by sf commands */
#define CONFIG_SF_DEFAULT_BUS 1
@@ -62,6 +55,15 @@
#define CONFIG_PCI_SCAN_SHOW
#endif
+/* SATA support */
+#ifdef CONFIG_SCSI
+#define CONFIG_SCSI_AHCI_PLAT
+#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
+#define CONFIG_SYS_SCSI_MAX_LUN 1
+#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
+ CONFIG_SYS_SCSI_MAX_LUN)
+#endif
+
/* Keep device tree and initrd in lower memory so the kernel can access them */
#define RELOCATION_LIMITS_ENV_SETTINGS \
"fdt_high=0x10000000\0" \
diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h
index 49ec0bf108..7e3463e184 100644
--- a/include/configs/colibri_imx6.h
+++ b/include/configs/colibri_imx6.h
@@ -54,7 +54,6 @@
#define CONFIG_SYS_FSL_USDHC_NUM 2
#define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
-#define CONFIG_BOUNCE_BUFFER
/* Network */
#define CONFIG_FEC_MXC
diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h
index 24b35161b6..3e0ac15229 100644
--- a/include/configs/dh_imx6.h
+++ b/include/configs/dh_imx6.h
@@ -33,7 +33,6 @@
#define CONFIG_INITRD_TAG
#define CONFIG_REVISION_TAG
-#define CONFIG_BOUNCE_BUFFER
#define CONFIG_BZIP2
/* Size of malloc() pool */
diff --git a/include/configs/dns325.h b/include/configs/dns325.h
index 5b78785ee2..dec71038bf 100644
--- a/include/configs/dns325.h
+++ b/include/configs/dns325.h
@@ -27,7 +27,8 @@
/*
* Commands configuration
*/
-#define CONFIG_SYS_MVFS
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
#define CONFIG_NR_DRAM_BANKS 1
diff --git a/include/configs/ds414.h b/include/configs/ds414.h
index 5b444542f4..27308c92ff 100644
--- a/include/configs/ds414.h
+++ b/include/configs/ds414.h
@@ -61,7 +61,8 @@
#endif
/* why is this only defined in mv-common.h if CONFIG_DM is undefined? */
-#define CONFIG_SYS_MVFS
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
/*
* mv-common.h should be defined after CMD configs since it used them
diff --git a/include/configs/ebisu.h b/include/configs/ebisu.h
new file mode 100644
index 0000000000..560fe5c45e
--- /dev/null
+++ b/include/configs/ebisu.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * include/configs/ebisu.h
+ * This file is Ebisu board configuration.
+ *
+ * Copyright (C) 2018 Renesas Electronics Corporation
+ */
+
+#ifndef __EBISU_H
+#define __EBISU_H
+
+#undef DEBUG
+
+#include "rcar-gen3-common.h"
+
+/* Ethernet RAVB */
+#define CONFIG_NET_MULTI
+#define CONFIG_BITBANGMII
+#define CONFIG_BITBANGMII_MULTI
+
+/* Board Clock */
+/* XTAL_CLK : 33.33MHz */
+#define CONFIG_SYS_CLK_FREQ 48000000u
+
+/* Generic Timer Definitions (use in assembler source) */
+#define COUNTER_FREQUENCY 0xFE502A /* 16.66MHz from CPclk */
+
+/* Environment in eMMC, at the end of 2nd "boot sector" */
+#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE)
+#define CONFIG_SYS_MMC_ENV_DEV 2
+#define CONFIG_SYS_MMC_ENV_PART 2
+
+#endif /* __EBISU_H */
diff --git a/include/configs/emdk.h b/include/configs/emdk.h
new file mode 100644
index 0000000000..dca13e2fff
--- /dev/null
+++ b/include/configs/emdk.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2018 Synopsys, Inc. All rights reserved.
+ */
+
+#ifndef _CONFIG_EMDK_H_
+#define _CONFIG_EMDK_H_
+
+#include <linux/sizes.h>
+
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
+
+#define CONFIG_SYS_SDRAM_BASE 0x10000000
+#define CONFIG_SYS_SDRAM_SIZE SZ_8M
+
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_1M)
+
+#define CONFIG_SYS_MALLOC_LEN SZ_64K
+#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE
+
+/* Required by DW MMC driver */
+#define CONFIG_BOUNCE_BUFFER
+
+/*
+ * Environment
+ */
+#define CONFIG_ENV_SIZE SZ_4K
+#define CONFIG_BOOTFILE "app.bin"
+#define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "upgrade_image=u-boot.bin\0" \
+ "upgrade=emdk rom unlock && " \
+ "fatload mmc 0 ${loadaddr} ${upgrade_image} && " \
+ "cp.b ${loadaddr} 0 ${filesize} && " \
+ "dcache flush && " \
+ "emdk rom lock\0"
+
+#endif /* _CONFIG_EMDK_H_ */
+
diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h
index 32631a20c3..1b947db9d4 100644
--- a/include/configs/ge_bx50v3.h
+++ b/include/configs/ge_bx50v3.h
@@ -14,19 +14,7 @@
#include <asm/arch/imx-regs.h>
#include <asm/mach-imx/gpio.h>
-#define BX50V3_BOOTARGS_EXTRA
-#if defined(CONFIG_TARGET_GE_B450V3)
-#define CONFIG_BOARD_NAME "General Electric B450v3"
-#elif defined(CONFIG_TARGET_GE_B650V3)
-#define CONFIG_BOARD_NAME "General Electric B650v3"
-#elif defined(CONFIG_TARGET_GE_B850V3)
-#define CONFIG_BOARD_NAME "General Electric B850v3"
-#undef BX50V3_BOOTARGS_EXTRA
-#define BX50V3_BOOTARGS_EXTRA "video=DP-1:1024x768@60 " \
- "video=HDMI-A-1:1024x768@60 "
-#else
-#define CONFIG_BOARD_NAME "General Electric BA16 Generic"
-#endif
+#define CONFIG_BOARD_NAME "General Electric Bx50v3"
#define CONFIG_MXC_UART_BASE UART3_BASE
#define CONSOLE_DEV "ttymxc2"
@@ -62,7 +50,6 @@
/* MMC Configs */
#define CONFIG_FSL_USDHC
#define CONFIG_SYS_FSL_ESDHC_ADDR 0
-#define CONFIG_BOUNCE_BUFFER
/* USB Configs */
#ifdef CONFIG_USB
@@ -113,7 +100,7 @@
"ro rootwait cma=128M " \
"bootcause=${bootcause} " \
"${quiet} console=${console} ${rtc_status} " \
- BX50V3_BOOTARGS_EXTRA "\0" \
+ "${videoargs}" "\0" \
"doquiet=" \
"if ext2load ${dev} ${devnum}:5 0x7000A000 /boot/console; " \
"then setenv quiet; fi\0" \
diff --git a/include/configs/goflexhome.h b/include/configs/goflexhome.h
index 1d9fe29f9e..8b05e0a53d 100644
--- a/include/configs/goflexhome.h
+++ b/include/configs/goflexhome.h
@@ -41,7 +41,8 @@
* Commands configuration
*/
-#define CONFIG_SYS_MVFS /* Picks up Filesystem from mv-common.h */
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
/*
* mv-common.h should be defined after CMD configs since it used them
diff --git a/include/configs/guruplug.h b/include/configs/guruplug.h
index d59cddb002..04b7e944a4 100644
--- a/include/configs/guruplug.h
+++ b/include/configs/guruplug.h
@@ -17,7 +17,9 @@
/*
* Standard filesystems
*/
-#define CONFIG_SYS_MVFS
+#define CONFIG_BZIP2
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
/*
* mv-plug-common.h should be defined after CMD configs since it used them
@@ -37,6 +39,11 @@
*/
#define CONFIG_ENV_SIZE 0x20000 /* 128k */
#define CONFIG_ENV_OFFSET 0xE0000 /* env starts here */
+/*
+ * Environment is right behind U-Boot in flash. Make sure U-Boot
+ * doesn't grow into the environment area.
+ */
+#define CONFIG_BOARD_SIZE_LIMIT CONFIG_ENV_OFFSET
/*
* Default environment variables
diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
index b8eefe3b11..1b7e29ca5e 100644
--- a/include/configs/gw_ventana.h
+++ b/include/configs/gw_ventana.h
@@ -89,7 +89,6 @@
/* eMMC Configs */
#define CONFIG_SUPPORT_EMMC_BOOT
-#define CONFIG_SUPPORT_EMMC_RPMB
/*
* SATA Configs
diff --git a/include/configs/ib62x0.h b/include/configs/ib62x0.h
index 5f071d02b7..a7643166f4 100644
--- a/include/configs/ib62x0.h
+++ b/include/configs/ib62x0.h
@@ -26,7 +26,8 @@
/*
* Commands configuration
*/
-#define CONFIG_SYS_MVFS
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
/*
* mv-common.h should be defined after CMD configs since it used them
diff --git a/include/configs/iconnect.h b/include/configs/iconnect.h
index 66131cca62..1fe4618da5 100644
--- a/include/configs/iconnect.h
+++ b/include/configs/iconnect.h
@@ -28,7 +28,8 @@
/*
* Commands configuration
*/
-#define CONFIG_SYS_MVFS
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
/*
* mv-common.h should be defined after CMD configs since it used them
diff --git a/include/configs/imx6dl-mamoj.h b/include/configs/imx6dl-mamoj.h
new file mode 100644
index 0000000000..5a3c2d68b5
--- /dev/null
+++ b/include/configs/imx6dl-mamoj.h
@@ -0,0 +1,101 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2018 Simone CIANNI <simone.cianni@bticino.it>
+ * Copyright (C) 2018 Raffaele RECALCATI <raffaele.recalcati@bticino.it>
+ * Copyright (C) 2018 Jagan Teki <jagan@amarulasolutions.com>
+ *
+ * Configuration settings for the BTicion i.MX6DL Mamoj board.
+ */
+
+#ifndef __IMX6DL_MAMOJ_CONFIG_H
+#define __IMX6DL_MAMOJ_CONFIG_H
+
+#include <linux/sizes.h>
+#include "mx6_common.h"
+
+/* Size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN (35 * SZ_1M)
+
+/* Total Size of Environment Sector */
+#define CONFIG_ENV_SIZE SZ_128K
+
+/* Allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+
+/* Environment */
+#ifndef CONFIG_ENV_IS_NOWHERE
+/* Environment in MMC */
+# if defined(CONFIG_ENV_IS_IN_MMC)
+# define CONFIG_ENV_OFFSET 0x100000
+# endif
+#endif
+
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "scriptaddr=0x14000000\0" \
+ "fdt_addr_r=0x13000000\0" \
+ "kernel_addr_r=0x10008000\0" \
+ "fdt_high=0xffffffff\0" \
+ "dfu_alt_info_spl=spl raw 0x2 0x400\0" \
+ "dfu_alt_info_uboot=u-boot raw 0x8a 0x11400\0" \
+ BOOTENV
+
+#define BOOT_TARGET_DEVICES(func) \
+ func(MMC, mmc, 2)
+
+#include <config_distro_bootcmd.h>
+#endif
+
+/* UART */
+#define CONFIG_MXC_UART_BASE UART3_BASE
+
+/* MMC */
+#define CONFIG_SYS_MMC_ENV_DEV 2
+#define CONFIG_SUPPORT_EMMC_BOOT
+
+/* Ethernet */
+#define CONFIG_FEC_MXC_PHYADDR 1
+#define CONFIG_MII
+
+/* USB */
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
+#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
+#define CONFIG_MXC_USB_FLAGS 0
+#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
+
+/* Falcon */
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME "args"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
+#define CONFIG_CMD_SPL
+#define CONFIG_SYS_SPL_ARGS_ADDR 0x13000000
+#define CONFIG_CMD_SPL_WRITE_SIZE (128 * SZ_1K)
+
+/* MMC support: args@1MB kernel@2MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800 /* 1MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)
+#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000 /* 2MB */
+
+/* Miscellaneous configurable options */
+#define CONFIG_SYS_MEMTEST_START 0x80000000
+#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x8000000)
+
+#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
+#define CONFIG_SYS_HZ 1000
+
+/* Physical Memory Map */
+#define CONFIG_NR_DRAM_BANKS 1
+#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
+
+#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
+#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
+#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
+
+#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
+ GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
+ CONFIG_SYS_INIT_SP_OFFSET)
+
+/* SPL */
+#include "imx6_spl.h"
+
+#endif /* __IMX6DL_MAMOJ_CONFIG_H */
diff --git a/include/configs/kp_imx53.h b/include/configs/kp_imx53.h
new file mode 100644
index 0000000000..530c3557d0
--- /dev/null
+++ b/include/configs/kp_imx53.h
@@ -0,0 +1,112 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2018
+ * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
+ */
+
+#ifndef __CONFIG_H_
+#define __CONFIG_H_
+
+#include <asm/arch/imx-regs.h>
+#include <linux/sizes.h>
+
+#define CONFIG_SYS_FSL_CLK
+
+/* Size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
+
+/* MMC Configs */
+#define CONFIG_FSL_ESDHC
+#define CONFIG_SYS_FSL_ESDHC_ADDR 0
+#define CONFIG_SYS_FSL_ESDHC_NUM 1
+
+/* Eth Configs */
+#define CONFIG_MII
+
+/* USB Configs */
+#define CONFIG_USB_EHCI_MX5
+#define CONFIG_MXC_USB_PORT 1
+#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
+#define CONFIG_MXC_USB_FLAGS 0
+
+#define CONFIG_SYS_I2C_MXC
+#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
+#define CONFIG_SYS_EEPROM_BUS_NUM 1
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+
+/* Command definition */
+#define CONFIG_LOADADDR 0x72000000 /* loadaddr env var */
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "console=ttymxc1,115200\0" \
+ "fdt_addr=0x75000000\0" \
+ "fdt_high=0xffffffff\0" \
+ "scriptaddr=0x74000000\0" \
+ "kernel_file=fitImage\0"\
+ "rdinit=/sbin/init\0" \
+ "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
+ "upd_image=st.4k\0" \
+ "uboot_file=u-boot.imx\0" \
+ "updargs=setenv bootargs console=${console} ${smp}"\
+ "rdinit=${rdinit} ${debug} ${displayargs}\0" \
+ "loadusb=usb start; " \
+ "fatload usb 0 ${loadaddr} ${upd_image}\0" \
+ "up=if tftp ${loadaddr} ${uboot_file}; then " \
+ "setexpr blkc ${filesize} / 0x200; " \
+ "setexpr blkc ${blkc} + 1; " \
+ "mmc write ${loadaddr} 0x2 ${blkc}" \
+ "; fi\0" \
+ "upwic=setenv wic_file kp-image-kp${boardsoc}${boardtype}.wic; "\
+ "if tftp ${loadaddr} ${wic_file}; then " \
+ "setexpr blkc ${filesize} / 0x200; " \
+ "setexpr blkc ${blkc} + 1; " \
+ "mmc write ${loadaddr} 0x0 ${blkc}" \
+ "; fi\0" \
+ "usbupd=echo Booting update from usb ...; " \
+ "setenv bootargs; " \
+ "run updargs; " \
+ "run loadusb; " \
+ "bootm ${loadaddr}#${fit_config}\0" \
+ BOOTENV
+
+#define CONFIG_BOOTCOMMAND "run usbupd; run distro_bootcmd"
+
+#define BOOT_TARGET_DEVICES(func) \
+ func(MMC, mmc, 0) \
+ func(DHCP, dhcp, na)
+
+#include <config_distro_bootcmd.h>
+
+#define CONFIG_ARP_TIMEOUT 200UL
+
+/* Miscellaneous configurable options */
+#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
+#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
+
+/* Physical Memory Map */
+#define CONFIG_NR_DRAM_BANKS 1
+#define PHYS_SDRAM_1 CSD0_BASE_ADDR
+#define PHYS_SDRAM_1_SIZE (512 * SZ_1M)
+#define PHYS_SDRAM_SIZE (PHYS_SDRAM_1_SIZE)
+
+#define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_1)
+#define CONFIG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR)
+#define CONFIG_SYS_INIT_RAM_SIZE (IRAM_SIZE)
+
+#define CONFIG_SYS_INIT_SP_OFFSET \
+ (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR \
+ (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
+
+/* environment organization */
+#define CONFIG_ENV_OFFSET (SZ_1M)
+#define CONFIG_ENV_SIZE (SZ_8K)
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
+#define CONFIG_SYS_MMC_ENV_DEV 0
+
+#endif /* __CONFIG_H_ */
diff --git a/include/configs/kp_imx6q_tpc.h b/include/configs/kp_imx6q_tpc.h
index d243fc675f..bf3cc174cd 100644
--- a/include/configs/kp_imx6q_tpc.h
+++ b/include/configs/kp_imx6q_tpc.h
@@ -21,8 +21,6 @@
#define CONFIG_INITRD_TAG
#define CONFIG_REVISION_TAG
-#define CONFIG_BOUNCE_BUFFER
-
/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN (4 * SZ_1M)
diff --git a/include/configs/legoev3.h b/include/configs/legoev3.h
index 542b8f072c..7a0511f88e 100644
--- a/include/configs/legoev3.h
+++ b/include/configs/legoev3.h
@@ -39,61 +39,6 @@
#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
-#define CONFIG_SYS_DA850_SYSCFG_SUSPSRC ( \
- DAVINCI_SYSCFG_SUSPSRC_TIMER0 | \
- DAVINCI_SYSCFG_SUSPSRC_SPI0 | \
- DAVINCI_SYSCFG_SUSPSRC_UART1 | \
- DAVINCI_SYSCFG_SUSPSRC_EMAC | \
- DAVINCI_SYSCFG_SUSPSRC_I2C)
-
-/*
- * PLL configuration
- */
-
-#define CONFIG_SYS_DA850_PLL0_PLLM 24
-#define CONFIG_SYS_DA850_PLL1_PLLM 21
-
-/*
- * DDR2 memory configuration
- */
-#define CONFIG_SYS_DA850_DDR2_DDRPHYCR (DV_DDR_PHY_PWRDNEN | \
- DV_DDR_PHY_EXT_STRBEN | \
- (0x4 << DV_DDR_PHY_RD_LATENCY_SHIFT))
-
-#define CONFIG_SYS_DA850_DDR2_SDBCR ( \
- (1 << DV_DDR_SDCR_MSDRAMEN_SHIFT) | \
- (1 << DV_DDR_SDCR_DDREN_SHIFT) | \
- (1 << DV_DDR_SDCR_SDRAMEN_SHIFT) | \
- (1 << DV_DDR_SDCR_BUS_WIDTH_SHIFT) | \
- (0x3 << DV_DDR_SDCR_CL_SHIFT) | \
- (0x2 << DV_DDR_SDCR_IBANK_SHIFT) | \
- (0x2 << DV_DDR_SDCR_PAGESIZE_SHIFT))
-
-/* SDBCR2 is only used if IBANK_POS bit in SDBCR is set */
-#define CONFIG_SYS_DA850_DDR2_SDBCR2 0
-
-#define CONFIG_SYS_DA850_DDR2_SDTIMR ( \
- (14 << DV_DDR_SDTMR1_RFC_SHIFT) | \
- (2 << DV_DDR_SDTMR1_RP_SHIFT) | \
- (2 << DV_DDR_SDTMR1_RCD_SHIFT) | \
- (1 << DV_DDR_SDTMR1_WR_SHIFT) | \
- (5 << DV_DDR_SDTMR1_RAS_SHIFT) | \
- (8 << DV_DDR_SDTMR1_RC_SHIFT) | \
- (1 << DV_DDR_SDTMR1_RRD_SHIFT) | \
- (0 << DV_DDR_SDTMR1_WTR_SHIFT))
-
-#define CONFIG_SYS_DA850_DDR2_SDTIMR2 ( \
- (7 << DV_DDR_SDTMR2_RASMAX_SHIFT) | \
- (0 << DV_DDR_SDTMR2_XP_SHIFT) | \
- (0 << DV_DDR_SDTMR2_ODT_SHIFT) | \
- (17 << DV_DDR_SDTMR2_XSNR_SHIFT) | \
- (199 << DV_DDR_SDTMR2_XSRD_SHIFT) | \
- (0 << DV_DDR_SDTMR2_RTP_SHIFT) | \
- (0 << DV_DDR_SDTMR2_CKE_SHIFT))
-
-#define CONFIG_SYS_DA850_DDR2_SDRCR 0x00000494
-#define CONFIG_SYS_DA850_DDR2_PBBPR 0x30
-
/*
* Serial Driver info
*/
@@ -139,35 +84,60 @@
"if run loadbootscr; then " \
"run bootscript; " \
"else " \
+ "if run loadbootenv; then " \
+ "echo Loaded env from ${bootenvfile};" \
+ "run importbootenv;" \
+ "fi;" \
+ "if test -n $uenvcmd; then " \
+ "echo Running uenvcmd...;" \
+ "run uenvcmd;" \
+ "fi;" \
"if run loadimage; then " \
"run mmcargs; " \
+ "if run loadfdt; then " \
+ "echo Using ${fdtfile}...;" \
+ "run fdtfixup; " \
+ "run fdtboot; "\
+ "fi; " \
"run mmcboot; " \
- "else " \
- "run flashargs; " \
- "run flashboot; " \
"fi; " \
"fi; " \
- "else " \
- "run flashargs; " \
- "run flashboot; " \
- "fi"
+ "fi; "\
+ "run flashargs; " \
+ "run flashboot"
#define CONFIG_EXTRA_ENV_SETTINGS \
- "hostname=EV3\0" \
+ "bootenvfile=uEnv.txt\0" \
+ "fdtfile=da850-lego-ev3.dtb\0" \
"memsize=64M\0" \
"filesyssize=10M\0" \
"verify=n\0" \
"console=ttyS1,115200n8\0" \
"bootscraddr=0xC0600000\0" \
+ "fdtaddr=0xC0600000\0" \
"loadaddr=0xC0007FC0\0" \
"filesysaddr=0xC1180000\0" \
"fwupdateboot=mw 0xFFFF1FFC 0x5555AAAA; reset\0" \
- "mmcargs=setenv bootargs mem=${memsize} console=${console} root=/dev/mmcblk0p2 rw rootwait lpj=747520\0" \
+ "importbootenv=echo Importing environment...; " \
+ "env import -t ${loadaddr} ${filesize}\0" \
+ "loadbootenv=fatload mmc 0 ${loadaddr} ${bootenvfile}\0" \
+ "mmcargs=setenv bootargs console=${console} root=/dev/mmcblk0p2 rw " \
+ "rootwait ${optargs}\0" \
"mmcboot=bootm ${loadaddr}\0" \
- "flashargs=setenv bootargs mem=${memsize} initrd=${filesysaddr},${filesyssize} root=/dev/ram0 rw rootfstype=squashfs console=${console} lpj=747520\0" \
- "flashboot=sf probe 0; sf read ${loadaddr} 0x50000 0x300000; sf read ${filesysaddr} 0x350000 0x960000; bootm ${loadaddr}\0" \
+ "flashargs=setenv bootargs initrd=${filesysaddr},${filesyssize} " \
+ "root=/dev/ram0 rw rootfstype=squashfs console=${console} " \
+ "${optargs}\0" \
+ "flashboot=sf probe 0; " \
+ "sf read ${fdtaddr} 0x40000 0x10000; " \
+ "sf read ${loadaddr} 0x50000 0x400000; " \
+ "sf read ${filesysaddr} 0x450000 0xA00000; " \
+ "run fdtfixup; " \
+ "run fdtboot\0" \
"loadimage=fatload mmc 0 ${loadaddr} uImage\0" \
+ "loadfdt=fatload mmc 0 ${fdtaddr} ${fdtfile}\0" \
+ "fdtfixup=fdt addr ${fdtaddr}; fdt resize; fdt chosen\0" \
+ "fdtboot=bootm ${loadaddr} - ${fdtaddr}\0" \
"loadbootscr=fatload mmc 0 ${bootscraddr} boot.scr\0" \
- "bootscript=source ${bootscraddr}\0" \
+ "bootscript=source ${bootscraddr}\0"
#ifdef CONFIG_CMD_BDI
#define CONFIG_CLOCKS
diff --git a/include/configs/mv-common.h b/include/configs/mv-common.h
index fa9b5bcf3a..79d61c599e 100644
--- a/include/configs/mv-common.h
+++ b/include/configs/mv-common.h
@@ -29,10 +29,6 @@
#define CONFIG_SYS_SDRAM_BASE 0x00000000
/*
- * CLKs configurations
- */
-
-/*
* NS16550 Configuration
*/
#define CONFIG_SYS_NS16550_SERIAL
@@ -101,18 +97,4 @@
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#endif
-/*
- * Common SPI Flash configuration
- */
-#ifdef CONFIG_CMD_SF
-#endif
-
-/*
- * File system
- */
-#ifdef CONFIG_SYS_MVFS
-#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
-#define CONFIG_MTD_PARTITIONS
-#endif
-
#endif /* _MV_COMMON_H */
diff --git a/include/configs/mv-plug-common.h b/include/configs/mv-plug-common.h
index df686dbe4f..81c07a889a 100644
--- a/include/configs/mv-plug-common.h
+++ b/include/configs/mv-plug-common.h
@@ -17,21 +17,6 @@
#define CONFIG_BUILD_TARGET "u-boot.kwb"
/*
- * Compression configuration
- */
-#ifdef CONFIG_SYS_MVFS
-#define CONFIG_BZIP2
-#endif /* CONFIG_SYS_MVFS */
-
-/*
- * Commands configuration
- */
-
-/*
- * Extra file system
- */
-
-/*
* mv-common.h should be defined after CMD configs since it used them
* to enable certain macros
*/
diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
index 583892fed2..3ec3126233 100644
--- a/include/configs/mx31pdk.h
+++ b/include/configs/mx31pdk.h
@@ -16,8 +16,6 @@
#include <asm/arch/imx-regs.h>
/* High Level Configuration Options */
-#define CONFIG_MX31 /* This is a mx31 */
-
#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_INITRD_TAG
diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h
index d8a724c71a..e08e83151f 100644
--- a/include/configs/mx53ppd.h
+++ b/include/configs/mx53ppd.h
@@ -198,7 +198,6 @@
/* FLASH and environment organization */
#define CONFIG_ENV_OFFSET (12 * 64 * 1024)
#define CONFIG_ENV_SIZE (10 * 1024)
-#define CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV 0
#define CONFIG_CMD_FUSE
diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
index a8182b3434..1b2961f68e 100644
--- a/include/configs/mx6_common.h
+++ b/include/configs/mx6_common.h
@@ -15,7 +15,6 @@
#define CONFIG_SYS_PL310_BASE L2_PL310_BASE
#endif
-#define CONFIG_MP
#endif
#define CONFIG_BOARD_POSTCLK_INIT
#define CONFIG_MXC_GPT_HCLK
@@ -51,8 +50,6 @@
/* allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE
-/* Filesystems and image support */
-
/* Miscellaneous configurable options */
#define CONFIG_SYS_CBSIZE 512
#define CONFIG_SYS_MAXARGS 32
diff --git a/include/configs/mx7_common.h b/include/configs/mx7_common.h
index da5a92502b..b0b7e1edd4 100644
--- a/include/configs/mx7_common.h
+++ b/include/configs/mx7_common.h
@@ -36,9 +36,6 @@
#define CONFIG_SYS_CBSIZE 512
#define CONFIG_SYS_MAXARGS 32
-#ifndef CONFIG_SYS_DCACHE_OFF
-#endif
-
/* UART */
#define CONFIG_MXC_UART
diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 5ed88d2654..4e375d88d1 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -79,161 +79,68 @@
#define CONFIG_PREBOOT ""
-#ifdef CONFIG_CMD_SATA
-#define CONFIG_DRIVE_SATA "sata "
+#ifdef CONFIG_CMD_MMC
+#define DISTRO_BOOT_DEV_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
#else
-#define CONFIG_DRIVE_SATA
+#define DISTRO_BOOT_DEV_MMC(func)
#endif
-#ifdef CONFIG_CMD_MMC
-#define CONFIG_DRIVE_MMC "mmc "
+#ifdef CONFIG_CMD_SATA
+#define DISTRO_BOOT_DEV_SATA(func) func(SATA, sata, 0)
#else
-#define CONFIG_DRIVE_MMC
+#define DISTRO_BOOT_DEV_SATA(func)
#endif
#ifdef CONFIG_USB_STORAGE
-#define CONFIG_DRIVE_USB "usb "
+#define DISTRO_BOOT_DEV_USB(func) func(USB, usb, 0)
#else
-#define CONFIG_DRIVE_USB
+#define DISTRO_BOOT_DEV_USB(func)
+#endif
+
+#ifdef CONFIG_CMD_PXE
+#define DISTRO_BOOT_DEV_PXE(func) func(PXE, pxe, na)
+#else
+#define DISTRO_BOOT_DEV_PXE(func)
+#endif
+
+#ifdef CONFIG_CMD_DHCP
+#define DISTRO_BOOT_DEV_DHCP(func) func(DHCP, dhcp, na)
+#else
+#define DISTRO_BOOT_DEV_DHCP(func)
#endif
-#define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC CONFIG_DRIVE_USB
-#define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
#if defined(CONFIG_SABRELITE)
+#define FDTFILE "fdtfile=imx6q-sabrelite.dtb\0"
+#else
+/* FIXME: nitrogen6x covers multiple configs. Define fdtfile for each supported config. */
+#define FDTFILE
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+ DISTRO_BOOT_DEV_MMC(func) \
+ DISTRO_BOOT_DEV_SATA(func) \
+ DISTRO_BOOT_DEV_USB(func) \
+ DISTRO_BOOT_DEV_PXE(func) \
+ DISTRO_BOOT_DEV_DHCP(func)
+
+#include <config_distro_bootcmd.h>
+
#define CONFIG_EXTRA_ENV_SETTINGS \
- "script=boot.scr\0" \
- "uimage=uImage\0" \
"console=ttymxc1\0" \
"fdt_high=0xffffffff\0" \
"initrd_high=0xffffffff\0" \
- "fdt_file=imx6q-sabrelite.dtb\0" \
- "fdt_addr=0x18000000\0" \
- "boot_fdt=try\0" \
+ "fdt_addr_r=0x18000000\0" \
+ FDTFILE \
+ "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
+ "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
+ "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
+ "ramdisk_addr_r=0x13000000\0" \
+ "ramdiskaddr=0x13000000\0" \
"ip_dyn=yes\0" \
"usb_pgood_delay=2000\0" \
- "mmcdevs=0 1\0" \
- "mmcpart=1\0" \
- "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
- "mmcargs=setenv bootargs console=${console},${baudrate} " \
- "root=${mmcroot}\0" \
- "loadbootscript=" \
- "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
- "bootscript=echo Running bootscript from mmc ...; " \
- "source\0" \
- "loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
- "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
- "mmcboot=echo Booting from mmc ...; " \
- "run mmcargs; " \
- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
- "if run loadfdt; then " \
- "bootm ${loadaddr} - ${fdt_addr}; " \
- "else " \
- "if test ${boot_fdt} = try; then " \
- "bootm; " \
- "else " \
- "echo WARN: Cannot load the DT; " \
- "fi; " \
- "fi; " \
- "else " \
- "bootm; " \
- "fi;\0" \
- "netargs=setenv bootargs console=${console},${baudrate} " \
- "root=/dev/nfs " \
- "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
- "netboot=echo Booting from net ...; " \
- "run netargs; " \
- "if test ${ip_dyn} = yes; then " \
- "setenv get_cmd dhcp; " \
- "else " \
- "setenv get_cmd tftp; " \
- "fi; " \
- "${get_cmd} ${uimage}; " \
- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
- "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
- "bootm ${loadaddr} - ${fdt_addr}; " \
- "else " \
- "if test ${boot_fdt} = try; then " \
- "bootm; " \
- "else " \
- "echo WARN: Cannot load the DT; " \
- "fi; " \
- "fi; " \
- "else " \
- "bootm; " \
- "fi;\0"
-
-#define CONFIG_BOOTCOMMAND \
- "for mmcdev in ${mmcdevs}; do " \
- "mmc dev ${mmcdev}; " \
- "if mmc rescan; then " \
- "if run loadbootscript; then " \
- "run bootscript; " \
- "else " \
- "if run loaduimage; then " \
- "run mmcboot; " \
- "fi; " \
- "fi; " \
- "fi; " \
- "done; " \
- "run netboot; "
-#else
-#define CONFIG_EXTRA_ENV_SETTINGS \
- "bootdevs=" CONFIG_DRIVE_TYPES "\0" \
- "umsdevs=" CONFIG_UMSDEVS "\0" \
- "usb_pgood_delay=2000\0" \
- "console=ttymxc1\0" \
- "clearenv=if sf probe || sf probe || sf probe 1 ; then " \
- "sf erase 0xc0000 0x2000 && " \
- "echo restored environment to factory default ; fi\0" \
- "bootcmd=for dtype in ${bootdevs}" \
- "; do " \
- "if itest.s \"xusb\" == \"x${dtype}\" ; then " \
- "usb start ;" \
- "fi; " \
- "for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
- "load " \
- "${dtype} ${disk}:1 " \
- "10008000 " \
- "/6x_bootscript" \
- "&& source 10008000 ; " \
- "done ; " \
- "done; " \
- "setenv stdout serial,vga ; " \
- "echo ; echo 6x_bootscript not found ; " \
- "echo ; echo serial console at 115200, 8N1 ; echo ; " \
- "echo details at http://boundarydevices.com/6q_bootscript ; " \
- "setenv stdout serial;" \
- "setenv stdin serial,usbkbd;" \
- "for dtype in ${umsdevs} ; do " \
- "if itest.s sata == ${dtype}; then " \
- "initcmd='sata init' ;" \
- "else " \
- "initcmd='mmc rescan' ;" \
- "fi; " \
- "for disk in 0 1 ; do " \
- "if $initcmd && $dtype dev $disk ; then " \
- "setenv stdout serial,vga; " \
- "echo expose ${dtype} ${disk} " \
- "over USB; " \
- "ums 0 $dtype $disk ;" \
- "fi; " \
- " done; " \
- "done ;" \
- "setenv stdout serial,vga; " \
- "echo no block devices found;" \
- "\0" \
- "initrd_high=0xffffffff\0" \
- "upgradeu=for dtype in ${bootdevs}" \
- "; do " \
- "for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
- "load ${dtype} ${disk}:1 10008000 " \
- "/6x_upgrade " \
- "&& source 10008000 ; " \
- "done ; " \
- "done\0" \
+ BOOTENV
-#endif
/* Miscellaneous configurable options */
#define CONFIG_SYS_MEMTEST_START 0x10000000
#define CONFIG_SYS_MEMTEST_END 0x10010000
diff --git a/include/configs/nsa310s.h b/include/configs/nsa310s.h
index 4c320522d2..2f90439383 100644
--- a/include/configs/nsa310s.h
+++ b/include/configs/nsa310s.h
@@ -22,7 +22,8 @@
#define CONFIG_BZIP2
/* commands configuration */
-#define CONFIG_SYS_MVFS
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
/*
* mv-common.h should be defined after CMD configs since it used them
diff --git a/include/configs/nsim.h b/include/configs/nsim.h
index 0f22606fee..c3f34a91e4 100644
--- a/include/configs/nsim.h
+++ b/include/configs/nsim.h
@@ -25,16 +25,6 @@
#define CONFIG_SYS_LOAD_ADDR 0x82000000
/*
- * UART configuration
- *
- */
-#define CONFIG_ARC_SERIAL
-
-/*
- * Command line configuration
- */
-
-/*
* Environment settings
*/
#define CONFIG_ENV_SIZE SZ_512
diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h
index 9898c42b8e..f495f6219b 100644
--- a/include/configs/odroid_xu3.h
+++ b/include/configs/odroid_xu3.h
@@ -101,7 +101,6 @@
EXYNOS_FDTFILE_SETTING \
MEM_LAYOUT_ENV_SETTINGS \
BOOTENV \
- "bootdelay=0\0" \
"rootfstype=ext4\0" \
"console=" CONFIG_DEFAULT_CONSOLE "\0"\
"fdtfile=exynos5422-odroidxu3.dtb\0" \
diff --git a/include/configs/openrd.h b/include/configs/openrd.h
index dfdad56dcc..aa5425af02 100644
--- a/include/configs/openrd.h
+++ b/include/configs/openrd.h
@@ -23,7 +23,8 @@
/*
* Commands configuration
*/
-#define CONFIG_SYS_MVFS
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
/*
* mv-common.h should be defined after CMD configs since it used them
diff --git a/include/configs/pogo_e02.h b/include/configs/pogo_e02.h
index 0416baef45..a654df6d6f 100644
--- a/include/configs/pogo_e02.h
+++ b/include/configs/pogo_e02.h
@@ -27,7 +27,8 @@
/*
* Commands configuration
*/
-#define CONFIG_SYS_MVFS
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
/*
* mv-common.h should be defined after CMD configs since it used them
diff --git a/include/configs/rcar-gen2-common.h b/include/configs/rcar-gen2-common.h
index eadf5594c8..231c4ecea4 100644
--- a/include/configs/rcar-gen2-common.h
+++ b/include/configs/rcar-gen2-common.h
@@ -51,4 +51,12 @@
#define CONFIG_ENV_SIZE (CONFIG_ENV_SECT_SIZE)
#define CONFIG_ENV_SIZE_REDUND (CONFIG_SYS_MONITOR_LEN)
+/* SF MTD */
+#if defined(CONFIG_SPI_FLASH_MTD) && !defined(CONFIG_SPL_BUILD)
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#else
+#undef CONFIG_SPI_FLASH_MTD
+#endif
+
#endif /* __RCAR_GEN2_COMMON_H */
diff --git a/include/configs/rpi.h b/include/configs/rpi.h
index 69a22e1700..a97550b732 100644
--- a/include/configs/rpi.h
+++ b/include/configs/rpi.h
@@ -90,44 +90,63 @@
"stdout=serial,vidconsole\0" \
"stderr=serial,vidconsole\0"
+#ifdef CONFIG_ARM64
+#define FDT_HIGH "ffffffffffffffff"
+#define INITRD_HIGH "ffffffffffffffff"
+#else
+#define FDT_HIGH "ffffffff"
+#define INITRD_HIGH "ffffffff"
+#endif
+
/*
* Memory layout for where various images get loaded by boot scripts:
*
* I suspect address 0 is used as the SMP pen on the RPi2, so avoid this.
*
- * fdt_addr_r simply shouldn't overlap anything else. However, the RPi's
- * binary firmware loads a DT to address 0x100, so we choose this address to
- * match it. This allows custom boot scripts to pass this DT on to Linux
- * simply by not over-writing the data at this address. When using U-Boot,
- * U-Boot (and scripts it executes) typicaly ignore the DT loaded by the FW
- * and loads its own DT from disk (triggered by boot.scr or extlinux.conf).
+ * Older versions of the boot firmware place the firmware-loaded DTB at 0x100,
+ * newer versions place it in high memory. So prevent U-Boot from doing its own
+ * DTB + initrd relocation so that we won't accidentally relocate the initrd
+ * over the firmware-loaded DTB and generally try to lay out things starting
+ * from the bottom of RAM.
*
- * pxefile_addr_r can be pretty much anywhere that doesn't conflict with
- * something else. Put it low in memory to avoid conflicts.
+ * kernel_addr_r has different constraints on ARM and Aarch64. For 32-bit ARM,
+ * it must be within the first 128M of RAM in order for the kernel's
+ * CONFIG_AUTO_ZRELADDR option to work. The kernel itself will be decompressed
+ * to 0x8000 but the decompressor clobbers 0x4000-0x8000 as well. The
+ * decompressor also likes to relocate itself to right past the end of the
+ * decompressed kernel, so in total the sum of the compressed and and
+ * decompressed kernel needs to be reserved.
*
- * kernel_addr_r must be within the first 128M of RAM in order for the
- * kernel's CONFIG_AUTO_ZRELADDR option to work. Since the kernel will
- * decompress itself to 0x8000 after the start of RAM, kernel_addr_r
- * should not overlap that area, or the kernel will have to copy itself
- * somewhere else before decompression. Similarly, the address of any other
- * data passed to the kernel shouldn't overlap the start of RAM. Pushing
- * this up to 16M allows for a sizable kernel to be decompressed below the
- * compressed load address.
+ * For Aarch64, the kernel image is uncompressed and must be loaded at
+ * text_offset bytes (specified in the header of the Image) into a 2MB
+ * boundary. The 'booti' command relocates the image if necessary. Linux uses
+ * a default text_offset of 0x80000. In summary, loading at 0x80000
+ * satisfies all these constraints and reserving memory up to 0x02400000
+ * permits fairly large (roughly 36M) kernels.
*
- * scriptaddr can be pretty much anywhere that doesn't conflict with something
- * else. Choosing 32M allows for the compressed kernel to be up to 16M.
+ * scriptaddr and pxefile_addr_r can be pretty much anywhere that doesn't
+ * conflict with something else. Reserving 1M for each of them at
+ * 0x02400000-0x02500000 and 0x02500000-0x02600000 should be plenty.
*
- * ramdisk_addr_r simply shouldn't overlap anything else. Choosing 33M allows
- * for any boot script to be up to 1M, which is hopefully plenty.
+ * On ARM, both the DTB and any possible initrd must be loaded such that they
+ * fit inside the lowmem mapping in Linux. In practice, this usually means not
+ * more than ~700M away from the start of the kernel image but this number can
+ * be larger OR smaller depending on e.g. the 'vmalloc=xxxM' command line
+ * parameter given to the kernel. So reserving memory from low to high
+ * satisfies this constraint again. Reserving 1M at 0x02600000-0x02700000 for
+ * the DTB leaves rest of the free RAM to the initrd starting at 0x02700000.
+ * Even with the smallest possible CPU-GPU memory split of the CPU getting
+ * only 64M, the remaining 25M starting at 0x02700000 should allow quite
+ * large initrds before they start colliding with U-Boot.
*/
#define ENV_MEM_LAYOUT_SETTINGS \
- "fdt_high=ffffffff\0" \
- "initrd_high=ffffffff\0" \
- "fdt_addr_r=0x00000100\0" \
- "pxefile_addr_r=0x00100000\0" \
- "kernel_addr_r=0x01000000\0" \
- "scriptaddr=0x02000000\0" \
- "ramdisk_addr_r=0x02100000\0" \
+ "fdt_high=" FDT_HIGH "\0" \
+ "initrd_high=" INITRD_HIGH "\0" \
+ "kernel_addr_r=0x00080000\0" \
+ "scriptaddr=0x02400000\0" \
+ "pxefile_addr_r=0x02500000\0" \
+ "fdt_addr_r=0x02600000\0" \
+ "ramdisk_addr_r=0x02700000\0"
#define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 0) \
diff --git a/include/configs/sama5d2_xplained.h b/include/configs/sama5d2_xplained.h
index f70ca83b25..b205d8d604 100644
--- a/include/configs/sama5d2_xplained.h
+++ b/include/configs/sama5d2_xplained.h
@@ -43,6 +43,15 @@
"fatload mmc 1:1 0x22000000 zImage; " \
"bootz 0x22000000 - 0x21000000"
+#elif CONFIG_SPI_BOOT
+
+/* bootstrap + u-boot + env in sd card, but kernel + dtb in eMMC */
+#undef CONFIG_BOOTCOMMAND
+
+#define CONFIG_BOOTCOMMAND "ext4load mmc 0:1 0x21000000 /boot/at91-sama5d2_xplained.dtb; " \
+ "ext4load mmc 0:1 0x22000000 /boot/zImage; " \
+ "bootz 0x22000000 - 0x21000000"
+
#endif
/* SPL */
diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 656db45adf..dc6375841e 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -21,7 +21,9 @@
/*
* Standard filesystems
*/
-#define CONFIG_SYS_MVFS
+#define CONFIG_BZIP2
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
/*
* mv-plug-common.h should be defined after CMD configs since it used them
@@ -42,6 +44,11 @@
#define CONFIG_ENV_SIZE 0x20000 /* 128k */
#define CONFIG_ENV_ADDR 0x80000
#define CONFIG_ENV_OFFSET 0x80000 /* env starts here */
+/*
+ * Environment is right behind U-Boot in flash. Make sure U-Boot
+ * doesn't grow into the environment area.
+ */
+#define CONFIG_BOARD_SIZE_LIMIT CONFIG_ENV_OFFSET
/*
* Default environment variables
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 4de2aa7929..acac4a7108 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -5,9 +5,6 @@
#ifndef __CONFIG_SOCFPGA_COMMON_H__
#define __CONFIG_SOCFPGA_COMMON_H__
-/* Virtual target or real hardware */
-#undef CONFIG_SOCFPGA_VIRTUAL_TARGET
-
/*
* High level configuration
*/
@@ -35,10 +32,8 @@
#define CONFIG_SYS_INIT_RAM_ADDR 0xFFE00000
#define CONFIG_SYS_INIT_RAM_SIZE 0x40000 /* 256KB */
#endif
-#define CONFIG_SYS_INIT_SP_OFFSET \
- (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
#define CONFIG_SYS_INIT_SP_ADDR \
- (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
+ (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE)
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
@@ -78,7 +73,7 @@
/*
* Ethernet on SoC (EMAC)
*/
-#if defined(CONFIG_CMD_NET) && !defined(CONFIG_SOCFPGA_VIRTUAL_TARGET)
+#ifdef CONFIG_CMD_NET
#define CONFIG_DW_ALTDESCRIPTOR
#define CONFIG_MII
#endif
@@ -97,11 +92,7 @@
#define CONFIG_SYS_TIMERBASE SOCFPGA_OSC1TIMER0_ADDRESS
#define CONFIG_SYS_TIMER_COUNTS_DOWN
#define CONFIG_SYS_TIMER_COUNTER (CONFIG_SYS_TIMERBASE + 0x4)
-#ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET
-#define CONFIG_SYS_TIMER_RATE 2400000
-#else
#define CONFIG_SYS_TIMER_RATE 25000000
-#endif
/*
* L4 Watchdog
@@ -182,16 +173,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
* Serial Driver
*/
#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE -4
-#ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET
-#define CONFIG_SYS_NS16550_CLK 1000000
-#elif defined(CONFIG_TARGET_SOCFPGA_GEN5)
-#define CONFIG_SYS_NS16550_COM1 SOCFPGA_UART0_ADDRESS
-#define CONFIG_SYS_NS16550_CLK 100000000
-#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
-#define CONFIG_SYS_NS16550_COM1 SOCFPGA_UART1_ADDRESS
-#define CONFIG_SYS_NS16550_CLK 50000000
-#endif
/*
* USB
@@ -245,17 +226,34 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
/*
* SPL
*
- * SRAM Memory layout:
+ * SRAM Memory layout for gen 5:
*
* 0xFFFF_0000 ...... Start of SRAM
* 0xFFFF_xxxx ...... Top of stack (grows down)
* 0xFFFF_yyyy ...... Malloc area
* 0xFFFF_zzzz ...... Global Data
* 0xFFFF_FF00 ...... End of SRAM
+ *
+ * SRAM Memory layout for Arria 10:
+ * 0xFFE0_0000 ...... Start of SRAM (bottom)
+ * 0xFFEx_xxxx ...... Top of stack (grows down to bottom)
+ * 0xFFEy_yyyy ...... Global Data
+ * 0xFFEz_zzzz ...... Malloc area (grows up to top)
+ * 0xFFE3_FFFF ...... End of SRAM (top)
*/
#define CONFIG_SPL_TEXT_BASE CONFIG_SYS_INIT_RAM_ADDR
#define CONFIG_SPL_MAX_SIZE CONFIG_SYS_INIT_RAM_SIZE
+#if defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
+/* SPL memory allocation configuration, this is for FAT implementation */
+#ifndef CONFIG_SYS_SPL_MALLOC_START
+#define CONFIG_SYS_SPL_MALLOC_SIZE 0x00010000
+#define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SYS_INIT_RAM_SIZE - \
+ CONFIG_SYS_SPL_MALLOC_SIZE + \
+ CONFIG_SYS_INIT_RAM_ADDR)
+#endif
+#endif
+
/* SPL SDMMC boot support */
#ifdef CONFIG_SPL_MMC_SUPPORT
#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
@@ -282,7 +280,11 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
/*
* Stack setup
*/
+#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
#define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR
+#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
+#define CONFIG_SPL_STACK CONFIG_SYS_SPL_MALLOC_START
+#endif
/* Extra Environment */
#ifndef CONFIG_SPL_BUILD
diff --git a/include/configs/stih410-b2260.h b/include/configs/stih410-b2260.h
index b4e4619266..d8bf3b6580 100644
--- a/include/configs/stih410-b2260.h
+++ b/include/configs/stih410-b2260.h
@@ -31,6 +31,7 @@
"fdtfile=stih410-b2260.dtb\0" \
"fdt_addr_r=0x47000000\0" \
"scriptaddr=0x50000000\0" \
+ "pxefile_addr_r=0x50100000\0" \
"fdt_high=0xffffffffffffffff\0" \
"initrd_high=0xffffffffffffffff\0" \
"ramdisk_addr_r=0x48000000\0" \
diff --git a/include/configs/stm32f429-discovery.h b/include/configs/stm32f429-discovery.h
index 4fd9c23e4e..46eda1d518 100644
--- a/include/configs/stm32f429-discovery.h
+++ b/include/configs/stm32f429-discovery.h
@@ -22,10 +22,10 @@
#define CONFIG_NR_DRAM_BANKS 1
#define CONFIG_SYS_RAM_CS 1
#define CONFIG_SYS_RAM_FREQ_DIV 2
-#define CONFIG_SYS_RAM_BASE 0xD0000000
+#define CONFIG_SYS_RAM_BASE 0x90000000
#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_RAM_BASE
-#define CONFIG_SYS_LOAD_ADDR 0xD0400000
-#define CONFIG_LOADADDR 0xD0400000
+#define CONFIG_SYS_LOAD_ADDR 0x90400000
+#define CONFIG_LOADADDR 0x90400000
#define CONFIG_SYS_MAX_FLASH_SECT 12
#define CONFIG_SYS_MAX_FLASH_BANKS 2
diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index f710c8fe2a..b631f79df8 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -168,10 +168,10 @@
"run boot_common\0" \
"tftpboot=tftpboot $kernel_addr_load $bootfile && " \
"tftpboot $ramdisk_addr_r $ramdisk_file &&" \
- "tftpboot $fdt_addr_r $fdt_file &&" \
+ "tftpboot $fdt_addr_r $fdtfile &&" \
"run boot_common\0" \
"__nfsboot=tftpboot $kernel_addr_load $bootfile && " \
- "tftpboot $fdt_addr_r $fdt_file &&" \
+ "tftpboot $fdt_addr_r $fdtfile &&" \
"setenv ramdisk_addr_r - &&" \
"run boot_common\0"
#endif
diff --git a/include/configs/vining_2000.h b/include/configs/vining_2000.h
index 0b5f940341..43f986342d 100644
--- a/include/configs/vining_2000.h
+++ b/include/configs/vining_2000.h
@@ -98,7 +98,6 @@
#ifdef CONFIG_ENV_IS_IN_MMC
#define CONFIG_SUPPORT_EMMC_BOOT
-#define CONFIG_SUPPORT_EMMC_RPMB
#define CONFIG_SYS_MMC_ENV_DEV 0 /* USDHC4 eMMC */
/* 0=user, 1=boot0, 2=boot1, * 4..7=general0..3. */
#define CONFIG_SYS_MMC_ENV_PART 1 /* boot0 */
diff --git a/include/configs/xilinx_zynqmp_mini.h b/include/configs/xilinx_zynqmp_mini.h
index 947d3083da..96ff6c9f02 100644
--- a/include/configs/xilinx_zynqmp_mini.h
+++ b/include/configs/xilinx_zynqmp_mini.h
@@ -32,7 +32,6 @@
/* BOOTP options */
#undef CONFIG_BOOTP_BOOTFILESIZE
#undef CONFIG_BOOTP_MAY_FAIL
-#undef CONFIG_CMD_UNZIP
#undef CONFIG_NR_DRAM_BANKS
diff --git a/include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h b/include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h
index 852c2238de..f0ab3f1592 100644
--- a/include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h
+++ b/include/configs/xilinx_zynqmp_zc1751_xm015_dc1.h
@@ -11,7 +11,6 @@
#define CONFIG_ZYNQ_SDHCI0
#define CONFIG_ZYNQ_SDHCI1
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR}
#include <configs/xilinx_zynqmp.h>
diff --git a/include/configs/xilinx_zynqmp_zc1751_xm016_dc2.h b/include/configs/xilinx_zynqmp_zc1751_xm016_dc2.h
deleted file mode 100644
index 2533ab8609..0000000000
--- a/include/configs/xilinx_zynqmp_zc1751_xm016_dc2.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Configuration for Xilinx ZynqMP zc1751 XM016 DC2
- *
- * (C) Copyright 2015 Xilinx, Inc.
- * Michal Simek <michal.simek@xilinx.com>
- */
-
-#ifndef __CONFIG_ZYNQMP_ZC1751_XM016_DC2_H
-#define __CONFIG_ZYNQMP_ZC1751_XM016_DC2_H
-
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB1_XHCI_BASEADDR}
-
-#include <configs/xilinx_zynqmp.h>
-
-#endif /* __CONFIG_ZYNQMP_ZC1751_XM016_DC2_H */
diff --git a/include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h b/include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h
index f7d4ab2800..bd4a0c3178 100644
--- a/include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h
+++ b/include/configs/xilinx_zynqmp_zc1751_xm017_dc3.h
@@ -11,9 +11,6 @@
#define CONFIG_ZYNQ_SDHCI1
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \
- ZYNQMP_USB1_XHCI_BASEADDR}
-
#include <configs/xilinx_zynqmp.h>
#endif /* __CONFIG_ZYNQMP_ZC1751_XM017_DC3_H */
diff --git a/include/configs/xilinx_zynqmp_zcu100.h b/include/configs/xilinx_zynqmp_zcu100.h
index 029347da47..b65d0c1cdd 100644
--- a/include/configs/xilinx_zynqmp_zcu100.h
+++ b/include/configs/xilinx_zynqmp_zcu100.h
@@ -24,9 +24,6 @@
{0, {{I2C_MUX_PCA9548, 0x75, 7} } }, \
}
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \
- ZYNQMP_USB1_XHCI_BASEADDR}
-
#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX
diff --git a/include/configs/xilinx_zynqmp_zcu102.h b/include/configs/xilinx_zynqmp_zcu102.h
index c61e1b5e27..ca11b97c7c 100644
--- a/include/configs/xilinx_zynqmp_zcu102.h
+++ b/include/configs/xilinx_zynqmp_zcu102.h
@@ -35,8 +35,6 @@
#define CONFIG_PCA953X
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR}
-
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
#define CONFIG_ZYNQ_EEPROM_BUS 5
#define CONFIG_ZYNQ_GEM_EEPROM_ADDR 0x54
diff --git a/include/configs/xilinx_zynqmp_zcu104.h b/include/configs/xilinx_zynqmp_zcu104.h
index 8d417f45e0..7e3b9ad705 100644
--- a/include/configs/xilinx_zynqmp_zcu104.h
+++ b/include/configs/xilinx_zynqmp_zcu104.h
@@ -26,8 +26,6 @@
#define CONFIG_PCA953X
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR}
-
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
#include <configs/xilinx_zynqmp.h>
diff --git a/include/configs/xilinx_zynqmp_zcu106.h b/include/configs/xilinx_zynqmp_zcu106.h
index 01ac12a53c..cc2d145ddd 100644
--- a/include/configs/xilinx_zynqmp_zcu106.h
+++ b/include/configs/xilinx_zynqmp_zcu106.h
@@ -35,8 +35,6 @@
#define CONFIG_PCA953X
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR}
-
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
#define CONFIG_ZYNQ_EEPROM_BUS 5
#define CONFIG_ZYNQ_GEM_EEPROM_ADDR 0x54
diff --git a/include/configs/xilinx_zynqmp_zcu111.h b/include/configs/xilinx_zynqmp_zcu111.h
index 3233b37979..8f8cb4f087 100644
--- a/include/configs/xilinx_zynqmp_zcu111.h
+++ b/include/configs/xilinx_zynqmp_zcu111.h
@@ -38,8 +38,6 @@
#define CONFIG_PCA953X
-#define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR}
-
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
#define CONFIG_ZYNQ_EEPROM_BUS 5
#define CONFIG_ZYNQ_GEM_EEPROM_ADDR 0x54
diff --git a/include/dm/fdtaddr.h b/include/dm/fdtaddr.h
index db4c11e083..49a6ffd5f8 100644
--- a/include/dm/fdtaddr.h
+++ b/include/dm/fdtaddr.h
@@ -34,6 +34,28 @@ fdt_addr_t devfdt_get_addr(struct udevice *dev);
void *devfdt_get_addr_ptr(struct udevice *dev);
/**
+ * devfdt_remap_addr() - Return pointer to the memory-mapped I/O address
+ * of the reg property of a device
+ *
+ * @dev: Pointer to a device
+ *
+ * @return Pointer to addr, or NULL if there is no such property
+ */
+void *devfdt_remap_addr(struct udevice *dev);
+
+/**
+ * devfdt_remap_addr_index() - Return indexed pointer to the memory-mapped
+ * I/O address of the reg property of a device
+ * @index: the 'reg' property can hold a list of <addr, size> pairs
+ * and @index is used to select which one is required
+ *
+ * @dev: Pointer to a device
+ *
+ * @return Pointer to addr, or NULL if there is no such property
+ */
+void *devfdt_remap_addr_index(struct udevice *dev, int index);
+
+/**
* devfdt_map_physmem() - Read device address from reg property of the
* device node and map the address into CPU address
* space.
diff --git a/include/dm/read.h b/include/dm/read.h
index 4a725bc923..a27b8554fb 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -113,6 +113,18 @@ int dev_read_size(struct udevice *dev, const char *propname);
fdt_addr_t dev_read_addr_index(struct udevice *dev, int index);
/**
+ * dev_remap_addr_index() - Get the indexed reg property of a device
+ * as a memory-mapped I/O pointer
+ *
+ * @dev: Device to read from
+ * @index: the 'reg' property can hold a list of <addr, size> pairs
+ * and @index is used to select which one is required
+ *
+ * @return pointer or NULL if not found
+ */
+void *dev_remap_addr_index(struct udevice *dev, int index);
+
+/**
* dev_read_addr() - Get the reg property of a device
*
* @dev: Device to read from
@@ -132,6 +144,16 @@ fdt_addr_t dev_read_addr(struct udevice *dev);
void *dev_read_addr_ptr(struct udevice *dev);
/**
+ * dev_remap_addr() - Get the reg property of a device as a
+ * memory-mapped I/O pointer
+ *
+ * @dev: Device to read from
+ *
+ * @return pointer or NULL if not found
+ */
+void *dev_remap_addr(struct udevice *dev);
+
+/**
* dev_read_addr_size() - get address and size from a device property
*
* This does no address translation. It simply reads an property that contains
@@ -482,6 +504,16 @@ static inline void *dev_read_addr_ptr(struct udevice *dev)
return devfdt_get_addr_ptr(dev);
}
+static inline void *dev_remap_addr(struct udevice *dev)
+{
+ return devfdt_remap_addr(dev);
+}
+
+static inline void *dev_remap_addr_index(struct udevice *dev, int index)
+{
+ return devfdt_remap_addr_index(dev, index);
+}
+
static inline fdt_addr_t dev_read_addr_size(struct udevice *dev,
const char *propname,
fdt_size_t *sizep)
diff --git a/include/dt-bindings/clock/r8a77990-cpg-mssr.h b/include/dt-bindings/clock/r8a77990-cpg-mssr.h
new file mode 100644
index 0000000000..c806fce449
--- /dev/null
+++ b/include/dt-bindings/clock/r8a77990-cpg-mssr.h
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2018 Renesas Electronics Corp.
+ */
+#ifndef __DT_BINDINGS_CLOCK_R8A77990_CPG_MSSR_H__
+#define __DT_BINDINGS_CLOCK_R8A77990_CPG_MSSR_H__
+
+#include <dt-bindings/clock/renesas-cpg-mssr.h>
+
+/* r8a77990 CPG Core Clocks */
+#define R8A77990_CLK_Z2 0
+#define R8A77990_CLK_ZR 1
+#define R8A77990_CLK_ZG 2
+#define R8A77990_CLK_ZTR 3
+#define R8A77990_CLK_ZT 4
+#define R8A77990_CLK_ZX 5
+#define R8A77990_CLK_S0D1 6
+#define R8A77990_CLK_S0D3 7
+#define R8A77990_CLK_S0D6 8
+#define R8A77990_CLK_S0D12 9
+#define R8A77990_CLK_S0D24 10
+#define R8A77990_CLK_S1D1 11
+#define R8A77990_CLK_S1D2 12
+#define R8A77990_CLK_S1D4 13
+#define R8A77990_CLK_S2D1 14
+#define R8A77990_CLK_S2D2 15
+#define R8A77990_CLK_S2D4 16
+#define R8A77990_CLK_S3D1 17
+#define R8A77990_CLK_S3D2 18
+#define R8A77990_CLK_S3D4 19
+#define R8A77990_CLK_S0D6C 20
+#define R8A77990_CLK_S3D1C 21
+#define R8A77990_CLK_S3D2C 22
+#define R8A77990_CLK_S3D4C 23
+#define R8A77990_CLK_LB 24
+#define R8A77990_CLK_CL 25
+#define R8A77990_CLK_ZB3 26
+#define R8A77990_CLK_ZB3D2 27
+#define R8A77990_CLK_CR 28
+#define R8A77990_CLK_CRD2 29
+#define R8A77990_CLK_SD0H 30
+#define R8A77990_CLK_SD0 31
+#define R8A77990_CLK_SD1H 32
+#define R8A77990_CLK_SD1 33
+#define R8A77990_CLK_SD3H 34
+#define R8A77990_CLK_SD3 35
+#define R8A77990_CLK_RPC 36
+#define R8A77990_CLK_RPCD2 37
+#define R8A77990_CLK_ZA2 38
+#define R8A77990_CLK_ZA8 39
+#define R8A77990_CLK_Z2D 40
+#define R8A77990_CLK_CANFD 41
+#define R8A77990_CLK_MSO 42
+#define R8A77990_CLK_R 43
+#define R8A77990_CLK_OSC 44
+#define R8A77990_CLK_LV0 45
+#define R8A77990_CLK_LV1 46
+#define R8A77990_CLK_CSI0 47
+#define R8A77990_CLK_POST3 48
+#define R8A77990_CLK_CP 49
+#define R8A77990_CLK_CPEX 50
+
+#endif /* __DT_BINDINGS_CLOCK_R8A77990_CPG_MSSR_H__ */
diff --git a/include/dt-bindings/leds/leds-netxbig.h b/include/dt-bindings/leds/leds-netxbig.h
new file mode 100644
index 0000000000..92658b0310
--- /dev/null
+++ b/include/dt-bindings/leds/leds-netxbig.h
@@ -0,0 +1,18 @@
+/*
+ * This header provides constants for netxbig LED bindings.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef _DT_BINDINGS_LEDS_NETXBIG_H
+#define _DT_BINDINGS_LEDS_NETXBIG_H
+
+#define NETXBIG_LED_OFF 0
+#define NETXBIG_LED_ON 1
+#define NETXBIG_LED_SATA 2
+#define NETXBIG_LED_TIMER1 3
+#define NETXBIG_LED_TIMER2 4
+
+#endif /* _DT_BINDINGS_LEDS_NETXBIG_H */
diff --git a/include/dt-bindings/leds/leds-ns2.h b/include/dt-bindings/leds/leds-ns2.h
new file mode 100644
index 0000000000..fd615749e7
--- /dev/null
+++ b/include/dt-bindings/leds/leds-ns2.h
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _DT_BINDINGS_LEDS_NS2_H
+#define _DT_BINDINGS_LEDS_NS2_H
+
+#define NS_V2_LED_OFF 0
+#define NS_V2_LED_ON 1
+#define NS_V2_LED_SATA 2
+
+#endif
diff --git a/include/dt-bindings/pinctrl/pinctrl-snapdragon.h b/include/dt-bindings/pinctrl/pinctrl-snapdragon.h
new file mode 100644
index 0000000000..615affb6f2
--- /dev/null
+++ b/include/dt-bindings/pinctrl/pinctrl-snapdragon.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * This header provides constants for Qualcomm Snapdragon pinctrl bindings.
+ *
+ * (C) Copyright 2018 Ramon Fried <ramon.fried@gmail.com>
+ *
+ */
+
+#ifndef _DT_BINDINGS_PINCTRL_SNAPDRAGON_H
+#define _DT_BINDINGS_PINCTRL_SNAPDRAGON_H
+
+/* GPIO Drive Strength */
+#define DRIVE_STRENGTH_2MA 0
+#define DRIVE_STRENGTH_4MA 1
+#define DRIVE_STRENGTH_6MA 2
+#define DRIVE_STRENGTH_8MA 3
+#define DRIVE_STRENGTH_10MA 4
+#define DRIVE_STRENGTH_12MA 5
+#define DRIVE_STRENGTH_14MA 6
+#define DRIVE_STRENGTH_16MA 7
+
+#endif
diff --git a/include/dt_table.h b/include/dt_table.h
new file mode 100644
index 0000000000..7fb16e900c
--- /dev/null
+++ b/include/dt_table.h
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * This is from the Android Project,
+ * Repository: https://android.googlesource.com/platform/system/libufdt
+ * File: utils/src/dt_table.h
+ * Commit: 2626d8b9e4d8e8c6cc67ceb1dc4e05a47779785c
+ * Copyright (C) 2017 The Android Open Source Project
+ */
+
+#ifndef DT_TABLE_H
+#define DT_TABLE_H
+
+#include <linux/types.h>
+
+#define DT_TABLE_MAGIC 0xd7b7ab1e
+#define DT_TABLE_DEFAULT_PAGE_SIZE 2048
+#define DT_TABLE_DEFAULT_VERSION 0
+
+struct dt_table_header {
+ u32 magic; /* DT_TABLE_MAGIC */
+ u32 total_size; /* includes dt_table_header + all dt_table_entry
+ * and all dtb/dtbo
+ */
+ u32 header_size; /* sizeof(dt_table_header) */
+
+ u32 dt_entry_size; /* sizeof(dt_table_entry) */
+ u32 dt_entry_count; /* number of dt_table_entry */
+ u32 dt_entries_offset; /* offset to the first dt_table_entry
+ * from head of dt_table_header.
+ * The value will be equal to header_size if
+ * no padding is appended
+ */
+ u32 page_size; /* flash page size we assume */
+ u32 version; /* DTBO image version, the current version is 0.
+ * The version will be incremented when the
+ * dt_table_header struct is updated.
+ */
+};
+
+struct dt_table_entry {
+ u32 dt_size;
+ u32 dt_offset; /* offset from head of dt_table_header */
+
+ u32 id; /* optional, must be zero if unused */
+ u32 rev; /* optional, must be zero if unused */
+ u32 custom[4]; /* optional, must be zero if unused */
+};
+
+#endif
diff --git a/include/efi_api.h b/include/efi_api.h
index 64c27e494b..094be6edf9 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -214,15 +214,15 @@ struct efi_runtime_services {
uint32_t descriptor_version,
struct efi_mem_desc *virtmap);
efi_status_t (*convert_pointer)(unsigned long dbg, void **address);
- efi_status_t (EFIAPI *get_variable)(s16 *variable_name,
- efi_guid_t *vendor, u32 *attributes,
- unsigned long *data_size, void *data);
- efi_status_t (EFIAPI *get_next_variable)(
- unsigned long *variable_name_size,
- s16 *variable_name, efi_guid_t *vendor);
- efi_status_t (EFIAPI *set_variable)(s16 *variable_name,
- efi_guid_t *vendor, u32 attributes,
- unsigned long data_size, void *data);
+ efi_status_t (EFIAPI *get_variable)(u16 *variable_name,
+ efi_guid_t *vendor, u32 *attributes,
+ efi_uintn_t *data_size, void *data);
+ efi_status_t (EFIAPI *get_next_variable_name)(
+ efi_uintn_t *variable_name_size,
+ u16 *variable_name, efi_guid_t *vendor);
+ efi_status_t (EFIAPI *set_variable)(u16 *variable_name,
+ efi_guid_t *vendor, u32 attributes,
+ efi_uintn_t data_size, void *data);
efi_status_t (EFIAPI *get_next_high_mono_count)(
uint32_t *high_count);
void (EFIAPI *reset_system)(enum efi_reset_type reset_type,
@@ -239,9 +239,9 @@ struct efi_runtime_services {
u32 reset_type);
efi_status_t (EFIAPI *query_variable_info)(
u32 attributes,
- u64 maximum_variable_storage_size,
- u64 remaining_variable_storage_size,
- u64 maximum_variable_size);
+ u64 *maximum_variable_storage_size,
+ u64 *remaining_variable_storage_size,
+ u64 *maximum_variable_size);
};
/* EFI event group GUID definitions */
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 2868ca25ab..c66252a7dd 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -75,6 +75,13 @@ const char *__efi_nesting_dec(void);
##__VA_ARGS__); \
})
+#ifdef CONFIG_SYS_CACHELINE_SIZE
+#define EFI_CACHELINE_SIZE CONFIG_SYS_CACHELINE_SIZE
+#else
+/* Just use the greatest cache flush alignment requirement I'm aware of */
+#define EFI_CACHELINE_SIZE 128
+#endif
+
extern struct efi_runtime_services efi_runtime_services;
extern struct efi_system_table systab;
@@ -207,6 +214,13 @@ efi_status_t efi_net_register(void);
/* Called by bootefi to make the watchdog available */
efi_status_t efi_watchdog_register(void);
/* Called by bootefi to make SMBIOS tables available */
+/**
+ * efi_smbios_register() - write out SMBIOS tables
+ *
+ * Called by bootefi to make SMBIOS tables available
+ *
+ * @return 0 if OK, -ENOMEM if no memory is available for the tables
+ */
efi_status_t efi_smbios_register(void);
struct efi_simple_file_system_protocol *
@@ -415,15 +429,15 @@ efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle,
struct efi_system_table *systab);
#endif
-efi_status_t EFIAPI efi_get_variable(s16 *variable_name,
- efi_guid_t *vendor, u32 *attributes,
- unsigned long *data_size, void *data);
-efi_status_t EFIAPI efi_get_next_variable(
- unsigned long *variable_name_size,
- s16 *variable_name, efi_guid_t *vendor);
-efi_status_t EFIAPI efi_set_variable(s16 *variable_name,
- efi_guid_t *vendor, u32 attributes,
- unsigned long data_size, void *data);
+efi_status_t EFIAPI efi_get_variable(u16 *variable_name, efi_guid_t *vendor,
+ u32 *attributes, efi_uintn_t *data_size,
+ void *data);
+efi_status_t EFIAPI efi_get_next_variable_name(efi_uintn_t *variable_name_size,
+ u16 *variable_name,
+ efi_guid_t *vendor);
+efi_status_t EFIAPI efi_set_variable(u16 *variable_name, efi_guid_t *vendor,
+ u32 attributes, efi_uintn_t data_size,
+ void *data);
void *efi_bootmgr_load(struct efi_device_path **device_path,
struct efi_device_path **file_path);
diff --git a/include/fastboot-internal.h b/include/fastboot-internal.h
new file mode 100644
index 0000000000..bf2f2b3c89
--- /dev/null
+++ b/include/fastboot-internal.h
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef _FASTBOOT_INTERNAL_H_
+#define _FASTBOOT_INTERNAL_H_
+
+/**
+ * fastboot_buf_addr - base address of the fastboot download buffer
+ */
+extern void *fastboot_buf_addr;
+
+/**
+ * fastboot_buf_size - size of the fastboot download buffer
+ */
+extern u32 fastboot_buf_size;
+
+/**
+ * fastboot_progress_callback - callback executed during long operations
+ */
+extern void (*fastboot_progress_callback)(const char *msg);
+
+/**
+ * fastboot_getvar() - Writes variable indicated by cmd_parameter to response.
+ *
+ * @cmd_parameter: Pointer to command parameter
+ * @response: Pointer to fastboot response buffer
+ *
+ * Look up cmd_parameter first as an environment variable of the form
+ * fastboot.<cmd_parameter>, if that exists return use its value to set
+ * response.
+ *
+ * Otherwise lookup the name of variable and execute the appropriate
+ * function to return the requested value.
+ */
+void fastboot_getvar(char *cmd_parameter, char *response);
+
+#endif
diff --git a/include/fastboot.h b/include/fastboot.h
index 009f1a72e1..1933b1d98e 100644
--- a/include/fastboot.h
+++ b/include/fastboot.h
@@ -12,10 +12,143 @@
#ifndef _FASTBOOT_H_
#define _FASTBOOT_H_
+#define FASTBOOT_VERSION "0.4"
+
/* The 64 defined bytes plus \0 */
+#define FASTBOOT_COMMAND_LEN (64 + 1)
#define FASTBOOT_RESPONSE_LEN (64 + 1)
-void fastboot_fail(const char *reason);
-void fastboot_okay(const char *reason);
+/**
+ * All known commands to fastboot
+ */
+enum {
+ FASTBOOT_COMMAND_GETVAR = 0,
+ FASTBOOT_COMMAND_DOWNLOAD,
+#if CONFIG_IS_ENABLED(FASTBOOT_FLASH)
+ FASTBOOT_COMMAND_FLASH,
+ FASTBOOT_COMMAND_ERASE,
+#endif
+ FASTBOOT_COMMAND_BOOT,
+ FASTBOOT_COMMAND_CONTINUE,
+ FASTBOOT_COMMAND_REBOOT,
+ FASTBOOT_COMMAND_REBOOT_BOOTLOADER,
+ FASTBOOT_COMMAND_SET_ACTIVE,
+#if CONFIG_IS_ENABLED(FASTBOOT_CMD_OEM_FORMAT)
+ FASTBOOT_COMMAND_OEM_FORMAT,
+#endif
+
+ FASTBOOT_COMMAND_COUNT
+};
+
+/**
+ * fastboot_response() - Writes a response of the form "$tag$reason".
+ *
+ * @tag: The first part of the response
+ * @response: Pointer to fastboot response buffer
+ * @format: printf style format string
+ */
+void fastboot_response(const char *tag, char *response,
+ const char *format, ...)
+ __attribute__ ((format (__printf__, 3, 4)));
+
+/**
+ * fastboot_fail() - Write a FAIL response of the form "FAIL$reason".
+ *
+ * @reason: Pointer to returned reason string
+ * @response: Pointer to fastboot response buffer
+ */
+void fastboot_fail(const char *reason, char *response);
+
+/**
+ * fastboot_okay() - Write an OKAY response of the form "OKAY$reason".
+ *
+ * @reason: Pointer to returned reason string, or NULL to send a bare "OKAY"
+ * @response: Pointer to fastboot response buffer
+ */
+void fastboot_okay(const char *reason, char *response);
+
+/**
+ * fastboot_set_reboot_flag() - Set flag to indicate reboot-bootloader
+ *
+ * Set flag which indicates that we should reboot into the bootloader
+ * following the reboot that fastboot executes after this function.
+ *
+ * This function should be overridden in your board file with one
+ * which sets whatever flag your board specific Android bootloader flow
+ * requires in order to re-enter the bootloader.
+ */
+int fastboot_set_reboot_flag(void);
+
+/**
+ * fastboot_set_progress_callback() - set progress callback
+ *
+ * @progress: Pointer to progress callback
+ *
+ * Set a callback which is invoked periodically during long running operations
+ * (flash and erase). This can be used (for example) by the UDP transport to
+ * send INFO responses to keep the client alive whilst those commands are
+ * executing.
+ */
+void fastboot_set_progress_callback(void (*progress)(const char *msg));
+
+/*
+ * fastboot_init() - initialise new fastboot protocol session
+ *
+ * @buf_addr: Pointer to download buffer, or NULL for default
+ * @buf_size: Size of download buffer, or zero for default
+ */
+void fastboot_init(void *buf_addr, u32 buf_size);
+
+/**
+ * fastboot_boot() - Execute fastboot boot command
+ *
+ * If ${fastboot_bootcmd} is set, run that command to execute the boot
+ * process, if that returns, then exit the fastboot server and return
+ * control to the caller.
+ *
+ * Otherwise execute "bootm <fastboot_buf_addr>", if that fails, reset
+ * the board.
+ */
+void fastboot_boot(void);
+
+/**
+ * fastboot_handle_command() - Handle fastboot command
+ *
+ * @cmd_string: Pointer to command string
+ * @response: Pointer to fastboot response buffer
+ *
+ * Return: Executed command, or -1 if not recognized
+ */
+int fastboot_handle_command(char *cmd_string, char *response);
+
+/**
+ * fastboot_data_remaining() - return bytes remaining in current transfer
+ *
+ * Return: Number of bytes left in the current download
+ */
+u32 fastboot_data_remaining(void);
+
+/**
+ * fastboot_data_download() - Copy image data to fastboot_buf_addr.
+ *
+ * @fastboot_data: Pointer to received fastboot data
+ * @fastboot_data_len: Length of received fastboot data
+ * @response: Pointer to fastboot response buffer
+ *
+ * Copies image data from fastboot_data to fastboot_buf_addr. Writes to
+ * response. fastboot_bytes_received is updated to indicate the number
+ * of bytes that have been transferred.
+ */
+void fastboot_data_download(const void *fastboot_data,
+ unsigned int fastboot_data_len, char *response);
+
+/**
+ * fastboot_data_complete() - Mark current transfer complete
+ *
+ * @response: Pointer to fastboot response buffer
+ *
+ * Set image_size and ${filesize} to the total size of the downloaded image.
+ */
+void fastboot_data_complete(char *response);
#endif /* _FASTBOOT_H_ */
diff --git a/include/fb_mmc.h b/include/fb_mmc.h
index a2d7c4895f..fd5db9eac8 100644
--- a/include/fb_mmc.h
+++ b/include/fb_mmc.h
@@ -3,6 +3,35 @@
* Copyright 2014 Broadcom Corporation.
*/
-void fb_mmc_flash_write(const char *cmd, void *download_buffer,
- unsigned int download_bytes);
-void fb_mmc_erase(const char *cmd);
+#ifndef _FB_MMC_H_
+#define _FB_MMC_H_
+
+/**
+ * fastboot_mmc_get_part_info() - Lookup eMMC partion by name
+ *
+ * @part_name: Named partition to lookup
+ * @dev_desc: Pointer to returned blk_desc pointer
+ * @part_info: Pointer to returned disk_partition_t
+ * @response: Pointer to fastboot response buffer
+ */
+int fastboot_mmc_get_part_info(char *part_name, struct blk_desc **dev_desc,
+ disk_partition_t *part_info, char *response);
+
+/**
+ * fastboot_mmc_flash_write() - Write image to eMMC for fastboot
+ *
+ * @cmd: Named partition to write image to
+ * @download_buffer: Pointer to image data
+ * @download_bytes: Size of image data
+ * @response: Pointer to fastboot response buffer
+ */
+void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
+ u32 download_bytes, char *response);
+/**
+ * fastboot_mmc_flash_erase() - Erase eMMC for fastboot
+ *
+ * @cmd: Named partition to erase
+ * @response: Pointer to fastboot response buffer
+ */
+void fastboot_mmc_erase(const char *cmd, char *response);
+#endif
diff --git a/include/fb_nand.h b/include/fb_nand.h
index 3daae8c4ca..08ab0e28a6 100644
--- a/include/fb_nand.h
+++ b/include/fb_nand.h
@@ -4,6 +4,37 @@
* Copyright 2015 Free Electrons.
*/
-void fb_nand_flash_write(const char *cmd, void *download_buffer,
- unsigned int download_bytes);
-void fb_nand_erase(const char *cmd);
+#ifndef _FB_NAND_H_
+#define _FB_NAND_H_
+
+#include <jffs2/load_kernel.h>
+
+/**
+ * fastboot_nand_get_part_info() - Lookup NAND partion by name
+ *
+ * @part_name: Named device to lookup
+ * @part_info: Pointer to returned part_info pointer
+ * @response: Pointer to fastboot response buffer
+ */
+int fastboot_nand_get_part_info(char *part_name, struct part_info **part_info,
+ char *response);
+
+/**
+ * fastboot_nand_flash_write() - Write image to NAND for fastboot
+ *
+ * @cmd: Named device to write image to
+ * @download_buffer: Pointer to image data
+ * @download_bytes: Size of image data
+ * @response: Pointer to fastboot response buffer
+ */
+void fastboot_nand_flash_write(const char *cmd, void *download_buffer,
+ u32 download_bytes, char *response);
+
+/**
+ * fastboot_nand_flash_erase() - Erase NAND for fastboot
+ *
+ * @cmd: Named device to erase
+ * @response: Pointer to fastboot response buffer
+ */
+void fastboot_nand_erase(const char *cmd, char *response);
+#endif
diff --git a/include/fdtdec.h b/include/fdtdec.h
index 5456a17d1a..c15b2a04a7 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -160,6 +160,7 @@ enum fdt_compat_id {
COMPAT_ALTERA_SOCFPGA_F2SDR2, /* SoCFPGA fpga2SDRAM2 bridge */
COMPAT_ALTERA_SOCFPGA_FPGA0, /* SOCFPGA FPGA manager */
COMPAT_ALTERA_SOCFPGA_NOC, /* SOCFPGA Arria 10 NOC */
+ COMPAT_ALTERA_SOCFPGA_CLK_INIT, /* SOCFPGA Arria 10 clk init */
COMPAT_COUNT,
};
diff --git a/include/fpga.h b/include/fpga.h
index f444093353..195f0bdd57 100644
--- a/include/fpga.h
+++ b/include/fpga.h
@@ -20,6 +20,9 @@
/* device numbers must be non-negative */
#define FPGA_INVALID_DEVICE -1
+#define FPGA_ENC_USR_KEY 1
+#define FPGA_NO_ENC_OR_NO_AUTH 2
+
/* root data type defintions */
typedef enum { /* typedef fpga_type */
fpga_min_type, /* range check value */
@@ -42,6 +45,12 @@ typedef struct { /* typedef fpga_desc */
int fstype;
} fpga_fs_info;
+struct fpga_secure_info {
+ u8 *userkey_addr;
+ u8 authflag;
+ u8 encflag;
+};
+
typedef enum {
BIT_FULL = 0,
BIT_PARTIAL,
@@ -58,6 +67,8 @@ int fpga_load(int devnum, const void *buf, size_t bsize,
bitstream_type bstype);
int fpga_fsload(int devnum, const void *buf, size_t size,
fpga_fs_info *fpga_fsinfo);
+int fpga_loads(int devnum, const void *buf, size_t size,
+ struct fpga_secure_info *fpga_sec_info);
int fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
bitstream_type bstype);
int fpga_dump(int devnum, const void *buf, size_t bsize);
diff --git a/include/fs.h b/include/fs.h
index d703ed5027..163da103b4 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -37,6 +37,16 @@ int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype);
*/
int fs_set_blk_dev_with_part(struct blk_desc *desc, int part);
+/**
+ * fs_get_type_name() - Get type of current filesystem
+ *
+ * Return: Pointer to filesystem name
+ *
+ * Returns a string describing the current filesystem, or the sentinel
+ * "unsupported" for any unrecognised filesystem.
+ */
+const char *fs_get_type_name(void);
+
/*
* Print the list of files on the partition previously set by fs_set_blk_dev(),
* in directory "dirname".
diff --git a/include/fsl_pmic.h b/include/fsl_pmic.h
index 6cab77ecb5..132db81757 100644
--- a/include/fsl_pmic.h
+++ b/include/fsl_pmic.h
@@ -107,6 +107,7 @@ enum {
/* MC34708 Definitions */
#define SWx_VOLT_MASK_MC34708 0x3F
+#define SWx_1_110V_MC34708 0x24
#define SWx_1_250V_MC34708 0x30
#define SWx_1_300V_MC34708 0x34
#define TIMER_MASK_MC34708 0x300
@@ -116,4 +117,44 @@ enum {
#define SWBST_CTRL 31
#define SWBST_AUTO 0x8
+#define MC34708_REG_SW12_OPMODE 28
+
+#define MC34708_SW1AMODE_MASK 0x00000f
+#define MC34708_SW1AMHMODE 0x000010
+#define MC34708_SW1AUOMODE 0x000020
+#define MC34708_SW1DVSSPEED 0x0000c0
+#define MC34708_SW2MODE_MASK 0x03c000
+#define MC34708_SW2MHMODE 0x040000
+#define MC34708_SW2UOMODE 0x080000
+#define MC34708_SW2DVSSPEED 0x300000
+#define MC34708_PLLEN 0x400000
+#define MC34708_PLLX 0x800000
+
+#define MC34708_REG_SW345_OPMODE 29
+
+#define MC34708_SW3MODE_MASK 0x00000f
+#define MC34708_SW3MHMODE 0x000010
+#define MC34708_SW3UOMODE 0x000020
+#define MC34708_SW4AMODE_MASK 0x0003c0
+#define MC34708_SW4AMHMODE 0x000400
+#define MC34708_SW4AUOMODE 0x000800
+#define MC34708_SW4BMODE_MASK 0x00f000
+#define MC34708_SW4BMHMODE 0x010000
+#define MC34708_SW4BUOMODE 0x020000
+#define MC34708_SW5MODE_MASK 0x3c0000
+#define MC34708_SW5MHMODE 0x400000
+#define MC34708_SW5UOMODE 0x800000
+
+#define SW_MODE_OFFOFF 0x00
+#define SW_MODE_PWMOFF 0x01
+#define SW_MODE_PFMOFF 0x03
+#define SW_MODE_APSOFF 0x04
+#define SW_MODE_PWMPWM 0x05
+#define SW_MODE_PWMAPS 0x06
+#define SW_MODE_APSAPS 0x08
+#define SW_MODE_APSPFM 0x0c
+#define SW_MODE_PWMPFM 0x0d
+#define SW_MODE_PFMPFM 0x0f
+
+#define MC34708_TRANSFER_SIZE 3
#endif
diff --git a/include/image-sparse.h b/include/image-sparse.h
index f39dc16617..234c237b84 100644
--- a/include/image-sparse.h
+++ b/include/image-sparse.h
@@ -23,7 +23,7 @@ struct sparse_storage {
lbaint_t blk,
lbaint_t blkcnt);
- void (*mssg)(const char *str);
+ void (*mssg)(const char *str, char *response);
};
static inline int is_sparse_image(void *buf)
@@ -38,4 +38,4 @@ static inline int is_sparse_image(void *buf)
}
int write_sparse_image(struct sparse_storage *info, const char *part_name,
- void *data);
+ void *data, char *response);
diff --git a/include/image.h b/include/image.h
index df701e3470..95d5934344 100644
--- a/include/image.h
+++ b/include/image.h
@@ -922,6 +922,7 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size);
#define FIT_SETUP_PROP "setup"
#define FIT_FPGA_PROP "fpga"
#define FIT_FIRMWARE_PROP "firmware"
+#define FIT_STANDALONE_PROP "standalone"
#define FIT_MAX_HASH_LEN HASH_MAX_DIGEST_SIZE
@@ -987,6 +988,8 @@ int fit_image_get_data_offset(const void *fit, int noffset, int *data_offset);
int fit_image_get_data_position(const void *fit, int noffset,
int *data_position);
int fit_image_get_data_size(const void *fit, int noffset, int *data_size);
+int fit_image_get_data_and_size(const void *fit, int noffset,
+ const void **data, size_t *size);
int fit_image_hash_get_algo(const void *fit, int noffset, char **algo);
int fit_image_hash_get_value(const void *fit, int noffset, uint8_t **value,
@@ -1046,8 +1049,6 @@ int fit_conf_get_node(const void *fit, const char *conf_uname);
int fit_conf_get_prop_node(const void *fit, int noffset,
const char *prop_name);
-void fit_conf_print(const void *fit, int noffset, const char *p);
-
int fit_check_ramdisk(const void *fit, int os_noffset,
uint8_t arch, int verify);
diff --git a/include/linux/libfdt_env.h b/include/linux/libfdt_env.h
index 0d209a6492..e2bf79c7ee 100644
--- a/include/linux/libfdt_env.h
+++ b/include/linux/libfdt_env.h
@@ -6,8 +6,8 @@
* Using the same guard name as that of scripts/dtc/libfdt/libfdt_env.h
* prevents it from being included.
*/
-#ifndef _LIBFDT_ENV_H
-#define _LIBFDT_ENV_H
+#ifndef LIBFDT_ENV_H
+#define LIBFDT_ENV_H
#include <linux/string.h>
@@ -27,5 +27,5 @@ typedef __be64 fdt64_t;
#define strtoul(cp, endp, base) simple_strtoul(cp, endp, base)
-#endif /* _LIBFDT_ENV_H */
+#endif /* LIBFDT_ENV_H */
#endif
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 0b273d8e2e..d2604c5caf 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -25,4 +25,13 @@ enum usb_dr_mode {
*/
enum usb_dr_mode usb_get_dr_mode(int node);
+/**
+ * usb_get_maximum_speed() - Get maximum speed for given device
+ * @node: Node offset to the given device
+ *
+ * The function gets phy interface string from property 'maximum-speed',
+ * and returns the correspondig enum usb_device_speed
+ */
+enum usb_device_speed usb_get_maximum_speed(int node);
+
#endif /* __LINUX_USB_OTG_H */
diff --git a/include/net.h b/include/net.h
index 65f51d77a5..5760685556 100644
--- a/include/net.h
+++ b/include/net.h
@@ -535,7 +535,7 @@ extern int net_restart_wrap; /* Tried all network devices */
enum proto_t {
BOOTP, RARP, ARP, TFTPGET, DHCP, PING, DNS, NFS, CDP, NETCONS, SNTP,
- TFTPSRV, TFTPPUT, LINKLOCAL
+ TFTPSRV, TFTPPUT, LINKLOCAL, FASTBOOT
};
extern char net_boot_file_name[1024];/* Boot File name */
diff --git a/include/net/fastboot.h b/include/net/fastboot.h
new file mode 100644
index 0000000000..68602095d2
--- /dev/null
+++ b/include/net/fastboot.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2016 The Android Open Source Project
+ */
+
+#ifndef __NET_FASTBOOT_H__
+#define __NET_FASTBOOT_H__
+
+/**********************************************************************/
+/*
+ * Global functions and variables.
+ */
+
+/**
+ * Wait for incoming fastboot comands.
+ */
+void fastboot_start_server(void);
+
+/**********************************************************************/
+
+#endif /* __NET_FASTBOOT_H__ */
diff --git a/include/netdev.h b/include/netdev.h
index 79fcee56d4..f27869072f 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -69,7 +69,6 @@ int sh_eth_initialize(bd_t *bis);
int skge_initialize(bd_t *bis);
int smc91111_initialize(u8 dev_num, int base_addr);
int smc911x_initialize(u8 dev_num, int base_addr);
-int tsi108_eth_initialize(bd_t *bis);
int uec_standard_init(bd_t *bis);
int uli526x_initialize(bd_t *bis);
int armada100_fec_register(unsigned long base_addr);
diff --git a/include/os.h b/include/os.h
index 64e89a06c9..c8e0f52d30 100644
--- a/include/os.h
+++ b/include/os.h
@@ -330,4 +330,25 @@ int os_spl_to_uboot(const char *fname);
*/
void os_localtime(struct rtc_time *rt);
+/**
+ * os_setjmp() - Call setjmp()
+ *
+ * Call the host system's setjmp() function.
+ *
+ * @jmp: Buffer to store current execution state
+ * @size: Size of buffer
+ * @return normal setjmp() value if OK, -ENOSPC if @size is too small
+ */
+int os_setjmp(ulong *jmp, int size);
+
+/**
+ * os_longjmp() - Call longjmp()
+ *
+ * Call the host system's longjmp() function.
+ *
+ * @jmp: Buffer where previous execution state was stored
+ * @ret: Value to pass to longjmp()
+ */
+void os_longjmp(ulong *jmp, int ret);
+
#endif
diff --git a/include/part_efi.h b/include/part_efi.h
index 6065c571f3..8525770445 100644
--- a/include/part_efi.h
+++ b/include/part_efi.h
@@ -20,6 +20,7 @@
#include <efi.h>
#define MSDOS_MBR_SIGNATURE 0xAA55
+#define MSDOS_MBR_BOOT_CODE_SIZE 440
#define EFI_PMBR_OSTYPE_EFI 0xEF
#define EFI_PMBR_OSTYPE_EFI_GPT 0xEE
@@ -111,7 +112,7 @@ typedef struct _gpt_entry {
} __packed gpt_entry;
typedef struct _legacy_mbr {
- u8 boot_code[440];
+ u8 boot_code[MSDOS_MBR_BOOT_CODE_SIZE];
__le32 unique_mbr_signature;
__le16 unknown;
struct partition partition_record[4];
diff --git a/include/pci.h b/include/pci.h
index cda6907688..8e27cbfaf1 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -680,8 +680,21 @@ extern int pci_write_config_dword(pci_dev_t dev, int where, u32 val);
void pciauto_region_init(struct pci_region *res);
void pciauto_region_align(struct pci_region *res, pci_size_t size);
void pciauto_config_init(struct pci_controller *hose);
+
+/**
+ * pciauto_region_allocate() - Allocate resources from a PCI resource region
+ *
+ * Allocates @size bytes from the PCI resource @res. If @supports_64bit is
+ * false, the result will be guaranteed to fit in 32 bits.
+ *
+ * @res: PCI region to allocate from
+ * @size: Amount of bytes to allocate
+ * @bar: Returns the PCI bus address of the allocated resource
+ * @supports_64bit: Whether to allow allocations above the 32-bit boundary
+ * @return 0 if successful, -1 on failure
+ */
int pciauto_region_allocate(struct pci_region *res, pci_size_t size,
- pci_addr_t *bar);
+ pci_addr_t *bar, bool supports_64bit);
#if !defined(CONFIG_DM_PCI) || defined(CONFIG_DM_PCI_COMPAT)
extern int pci_hose_read_config_byte_via_dword(struct pci_controller *hose,
diff --git a/include/phy-sun4i-usb.h b/include/phy-sun4i-usb.h
new file mode 100644
index 0000000000..b0a45b2058
--- /dev/null
+++ b/include/phy-sun4i-usb.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2017 Jagan Teki <jagan@amarulasolutions.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __GENERIC_PHY_SUN4I_USB_H
+#define __GENERIC_PHY_SUN4I_USB_H
+
+/**
+ * sun4i_usb_phy_id_detect - detect ID pin of USB PHY
+ *
+ * @phy: USB PHY port to detect ID pin
+ * @return 0 if OK, or a negative error code
+ */
+int sun4i_usb_phy_id_detect(struct phy *phy);
+
+/**
+ * sun4i_usb_phy_vbus_detect - detect VBUS pin of USB PHY
+ *
+ * @phy: USB PHY port to detect VBUS pin
+ * @return 0 if OK, or a negative error code
+ */
+int sun4i_usb_phy_vbus_detect(struct phy *phy);
+
+/**
+ * sun4i_usb_phy_set_squelch_detect() - Enable/disable squelch detect
+ *
+ * @phy: reference to a sun4i usb phy
+ * @enabled: wether to enable or disable squelch detect
+ */
+void sun4i_usb_phy_set_squelch_detect(struct phy *phy, bool enabled);
+
+#endif /*__GENERIC_PHY_SUN4I_USB_H */
diff --git a/include/power/pmic.h b/include/power/pmic.h
index 2ca9365fc8..be9de6b4de 100644
--- a/include/power/pmic.h
+++ b/include/power/pmic.h
@@ -297,6 +297,15 @@ int pmic_reg_write(struct udevice *dev, uint reg, uint value);
*/
int pmic_clrsetbits(struct udevice *dev, uint reg, uint clr, uint set);
+/*
+ * This structure holds the private data for PMIC uclass
+ * For now we store information about the number of bytes
+ * being sent at once to the device.
+ */
+struct uc_pmic_priv {
+ uint trans_len;
+};
+
#endif /* CONFIG_DM_PMIC */
#ifdef CONFIG_POWER
diff --git a/include/serial.h b/include/serial.h
index 384df94ed0..b9ef6d91c9 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -67,6 +67,12 @@ extern int usbtty_tstc(void);
struct udevice;
+enum serial_par {
+ SERIAL_PAR_NONE,
+ SERIAL_PAR_ODD,
+ SERIAL_PAR_EVEN
+};
+
/**
* struct struct dm_serial_ops - Driver model serial operations
*
@@ -143,6 +149,16 @@ struct dm_serial_ops {
*/
int (*loop)(struct udevice *dev, int on);
#endif
+ /**
+ * setparity() - Set up the parity
+ *
+ * Set up a new parity for this device.
+ *
+ * @dev: Device pointer
+ * @parity: parity to use
+ * @return 0 if OK, -ve on error
+ */
+ int (*setparity)(struct udevice *dev, enum serial_par parity);
};
/**
diff --git a/include/smbios.h b/include/smbios.h
index 79880ef5b5..97b9ddce23 100644
--- a/include/smbios.h
+++ b/include/smbios.h
@@ -231,8 +231,9 @@ typedef int (*smbios_write_type)(ulong *addr, int handle);
*
* This writes SMBIOS table at a given address.
*
- * @addr: start address to write SMBIOS table
- * @return: end address of SMBIOS table
+ * @addr: start address to write SMBIOS table. If this is not
+ * 16-byte-aligned then it will be aligned before the table is written
+ * @return: end address of SMBIOS table (and start address for next entry)
*/
ulong write_smbios_table(ulong addr);
diff --git a/include/tpm-common.h b/include/tpm-common.h
new file mode 100644
index 0000000000..734c2c9d53
--- /dev/null
+++ b/include/tpm-common.h
@@ -0,0 +1,217 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2013 The Chromium OS Authors.
+ * Coypright (c) 2013 Guntermann & Drunck GmbH
+ */
+
+#ifndef __TPM_COMMON_H
+#define __TPM_COMMON_H
+
+enum tpm_duration {
+ TPM_SHORT = 0,
+ TPM_MEDIUM = 1,
+ TPM_LONG = 2,
+ TPM_UNDEFINED,
+
+ TPM_DURATION_COUNT,
+};
+
+/*
+ * Here is a partial implementation of TPM commands. Please consult TCG Main
+ * Specification for definitions of TPM commands.
+ */
+
+#define TPM_HEADER_SIZE 10
+
+/* Max buffer size supported by our tpm */
+#define TPM_DEV_BUFSIZE 1260
+
+/**
+ * struct tpm_chip_priv - Information about a TPM, stored by the uclass
+ *
+ * These values must be set up by the device's probe() method before
+ * communcation is attempted. If the device has an xfer() method, this is
+ * not needed. There is no need to set up @buf.
+ *
+ * @duration_ms: Length of each duration type in milliseconds
+ * @retry_time_ms: Time to wait before retrying receive
+ * @pcr_count: Number of PCR per bank
+ * @pcr_select_min: Minimum size in bytes of the pcrSelect array
+ * @buf: Buffer used during the exchanges with the chip
+ */
+struct tpm_chip_priv {
+ uint duration_ms[TPM_DURATION_COUNT];
+ uint retry_time_ms;
+#if defined(CONFIG_TPM_V2)
+ uint pcr_count;
+ uint pcr_select_min;
+#endif
+ u8 buf[TPM_DEV_BUFSIZE + sizeof(u8)]; /* Max buffer size + addr */
+};
+
+/**
+ * struct tpm_ops - low-level TPM operations
+ *
+ * These are designed to avoid loops and delays in the driver itself. These
+ * should be handled in the uclass.
+ *
+ * In gneral you should implement everything except xfer(). Where you need
+ * complete control of the transfer, then xfer() can be provided and will
+ * override the other methods.
+ *
+ * This interface is for low-level TPM access. It does not understand the
+ * concept of localities or the various TPM messages. That interface is
+ * defined in the functions later on in this file, but they all translate
+ * to bytes which are sent and received.
+ */
+struct tpm_ops {
+ /**
+ * open() - Request access to locality 0 for the caller
+ *
+ * After all commands have been completed the caller should call
+ * close().
+ *
+ * @dev: Device to close
+ * @return 0 ok OK, -ve on error
+ */
+ int (*open)(struct udevice *dev);
+
+ /**
+ * close() - Close the current session
+ *
+ * Releasing the locked locality. Returns 0 on success, -ve 1 on
+ * failure (in case lock removal did not succeed).
+ *
+ * @dev: Device to close
+ * @return 0 ok OK, -ve on error
+ */
+ int (*close)(struct udevice *dev);
+
+ /**
+ * get_desc() - Get a text description of the TPM
+ *
+ * @dev: Device to check
+ * @buf: Buffer to put the string
+ * @size: Maximum size of buffer
+ * @return length of string, or -ENOSPC it no space
+ */
+ int (*get_desc)(struct udevice *dev, char *buf, int size);
+
+ /**
+ * send() - send data to the TPM
+ *
+ * @dev: Device to talk to
+ * @sendbuf: Buffer of the data to send
+ * @send_size: Size of the data to send
+ *
+ * Returns 0 on success or -ve on failure.
+ */
+ int (*send)(struct udevice *dev, const u8 *sendbuf, size_t send_size);
+
+ /**
+ * recv() - receive a response from the TPM
+ *
+ * @dev: Device to talk to
+ * @recvbuf: Buffer to save the response to
+ * @max_size: Maximum number of bytes to receive
+ *
+ * Returns number of bytes received on success, -EAGAIN if the TPM
+ * response is not ready, -EINTR if cancelled, or other -ve value on
+ * failure.
+ */
+ int (*recv)(struct udevice *dev, u8 *recvbuf, size_t max_size);
+
+ /**
+ * cleanup() - clean up after an operation in progress
+ *
+ * This is called if receiving times out. The TPM may need to abort
+ * the current transaction if it did not complete, and make itself
+ * ready for another.
+ *
+ * @dev: Device to talk to
+ */
+ int (*cleanup)(struct udevice *dev);
+
+ /**
+ * xfer() - send data to the TPM and get response
+ *
+ * This method is optional. If it exists it is used in preference
+ * to send(), recv() and cleanup(). It should handle all aspects of
+ * TPM communication for a single transfer.
+ *
+ * @dev: Device to talk to
+ * @sendbuf: Buffer of the data to send
+ * @send_size: Size of the data to send
+ * @recvbuf: Buffer to save the response to
+ * @recv_size: Pointer to the size of the response buffer
+ *
+ * Returns 0 on success (and places the number of response bytes at
+ * recv_size) or -ve on failure.
+ */
+ int (*xfer)(struct udevice *dev, const u8 *sendbuf, size_t send_size,
+ u8 *recvbuf, size_t *recv_size);
+};
+
+#define tpm_get_ops(dev) ((struct tpm_ops *)device_get_ops(dev))
+
+#define MAKE_TPM_CMD_ENTRY(cmd) \
+ U_BOOT_CMD_MKENT(cmd, 0, 1, do_tpm_ ## cmd, "", "")
+
+#define TPM_COMMAND_NO_ARG(cmd) \
+int do_##cmd(cmd_tbl_t *cmdtp, int flag, \
+ int argc, char * const argv[]) \
+{ \
+ if (argc != 1) \
+ return CMD_RET_USAGE; \
+ return report_return_code(cmd()); \
+}
+
+/**
+ * tpm_get_desc() - Get a text description of the TPM
+ *
+ * @dev: Device to check
+ * @buf: Buffer to put the string
+ * @size: Maximum size of buffer
+ * @return length of string, or -ENOSPC it no space
+ */
+int tpm_get_desc(struct udevice *dev, char *buf, int size);
+
+/**
+ * tpm_xfer() - send data to the TPM and get response
+ *
+ * This first uses the device's send() method to send the bytes. Then it calls
+ * recv() to get the reply. If recv() returns -EAGAIN then it will delay a
+ * short time and then call recv() again.
+ *
+ * Regardless of whether recv() completes successfully, it will then call
+ * cleanup() to finish the transaction.
+ *
+ * Note that the outgoing data is inspected to determine command type
+ * (ordinal) and a timeout is used for that command type.
+ *
+ * @sendbuf - buffer of the data to send
+ * @send_size size of the data to send
+ * @recvbuf - memory to save the response to
+ * @recv_len - pointer to the size of the response buffer
+ *
+ * Returns 0 on success (and places the number of response bytes at
+ * recv_len) or -ve on failure.
+ */
+int tpm_xfer(struct udevice *dev, const u8 *sendbuf, size_t send_size,
+ u8 *recvbuf, size_t *recv_size);
+
+/**
+ * Initialize TPM device. It must be called before any TPM commands.
+ *
+ * @return 0 on success, non-0 on error.
+ */
+int tpm_init(void);
+
+/**
+ * Retrieve the array containing all the commands.
+ *
+ * @return a cmd_tbl_t array.
+ */
+cmd_tbl_t *get_tpm_commands(unsigned int *size);
+
+#endif /* __TPM_COMMON_H */
diff --git a/include/tpm.h b/include/tpm-v1.h
index c6316329f5..6b4941ef9a 100644
--- a/include/tpm.h
+++ b/include/tpm-v1.h
@@ -4,23 +4,22 @@
* Coypright (c) 2013 Guntermann & Drunck GmbH
*/
-#ifndef __TPM_H
-#define __TPM_H
+#ifndef __TPM_V1_H
+#define __TPM_V1_H
-/*
- * Here is a partial implementation of TPM commands. Please consult TCG Main
- * Specification for definitions of TPM commands.
- */
-
-#define TPM_HEADER_SIZE 10
+#include <tpm-common.h>
-enum tpm_duration {
- TPM_SHORT = 0,
- TPM_MEDIUM = 1,
- TPM_LONG = 2,
- TPM_UNDEFINED,
-
- TPM_DURATION_COUNT,
+/* Useful constants */
+enum {
+ TPM_REQUEST_HEADER_LENGTH = 10,
+ TPM_RESPONSE_HEADER_LENGTH = 10,
+ PCR_DIGEST_LENGTH = 20,
+ DIGEST_LENGTH = 20,
+ TPM_REQUEST_AUTH_LENGTH = 45,
+ TPM_RESPONSE_AUTH_LENGTH = 41,
+ /* some max lengths, valid for RSA keys <= 2048 bits */
+ TPM_KEY12_MAX_LENGTH = 618,
+ TPM_PUBKEY_MAX_LENGTH = 288,
};
enum tpm_startup_type {
@@ -82,13 +81,13 @@ enum tpm_capability_areas {
TPM_CAP_VERSION_VAL = 0x0000001A,
};
-#define TPM_NV_PER_GLOBALLOCK (1U << 15)
-#define TPM_NV_PER_PPREAD (1U << 16)
-#define TPM_NV_PER_PPWRITE (1U << 0)
-#define TPM_NV_PER_READ_STCLEAR (1U << 31)
-#define TPM_NV_PER_WRITE_STCLEAR (1U << 14)
-#define TPM_NV_PER_WRITEDEFINE (1U << 13)
-#define TPM_NV_PER_WRITEALL (1U << 12)
+#define TPM_NV_PER_GLOBALLOCK BIT(15)
+#define TPM_NV_PER_PPREAD BIT(16)
+#define TPM_NV_PER_PPWRITE BIT(0)
+#define TPM_NV_PER_READ_STCLEAR BIT(31)
+#define TPM_NV_PER_WRITE_STCLEAR BIT(14)
+#define TPM_NV_PER_WRITEDEFINE BIT(13)
+#define TPM_NV_PER_WRITEALL BIT(12)
enum {
TPM_PUBEK_SIZE = 256,
@@ -232,211 +231,27 @@ struct tpm_permanent_flags {
u8 disable_full_da_logic_info;
} __packed;
-/* Max buffer size supported by our tpm */
-#define TPM_DEV_BUFSIZE 1260
-
-/**
- * struct tpm_chip_priv - Information about a TPM, stored by the uclass
- *
- * These values must be set up by the device's probe() method before
- * communcation is attempted. If the device has an xfer() method, this is
- * not needed. There is no need to set up @buf.
- *
- * @duration_ms: Length of each duration type in milliseconds
- * @retry_time_ms: Time to wait before retrying receive
- */
-struct tpm_chip_priv {
- uint duration_ms[TPM_DURATION_COUNT];
- uint retry_time_ms;
- u8 buf[TPM_DEV_BUFSIZE + sizeof(u8)]; /* Max buffer size + addr */
-};
-
-/**
- * struct tpm_ops - low-level TPM operations
- *
- * These are designed to avoid loops and delays in the driver itself. These
- * should be handled in the uclass.
- *
- * In gneral you should implement everything except xfer(). Where you need
- * complete control of the transfer, then xfer() can be provided and will
- * override the other methods.
- *
- * This interface is for low-level TPM access. It does not understand the
- * concept of localities or the various TPM messages. That interface is
- * defined in the functions later on in this file, but they all translate
- * to bytes which are sent and received.
- */
-struct tpm_ops {
- /**
- * open() - Request access to locality 0 for the caller
- *
- * After all commands have been completed the caller should call
- * close().
- *
- * @dev: Device to close
- * @return 0 ok OK, -ve on error
- */
- int (*open)(struct udevice *dev);
-
- /**
- * close() - Close the current session
- *
- * Releasing the locked locality. Returns 0 on success, -ve 1 on
- * failure (in case lock removal did not succeed).
- *
- * @dev: Device to close
- * @return 0 ok OK, -ve on error
- */
- int (*close)(struct udevice *dev);
-
- /**
- * get_desc() - Get a text description of the TPM
- *
- * @dev: Device to check
- * @buf: Buffer to put the string
- * @size: Maximum size of buffer
- * @return length of string, or -ENOSPC it no space
- */
- int (*get_desc)(struct udevice *dev, char *buf, int size);
-
- /**
- * send() - send data to the TPM
- *
- * @dev: Device to talk to
- * @sendbuf: Buffer of the data to send
- * @send_size: Size of the data to send
- *
- * Returns 0 on success or -ve on failure.
- */
- int (*send)(struct udevice *dev, const uint8_t *sendbuf,
- size_t send_size);
-
- /**
- * recv() - receive a response from the TPM
- *
- * @dev: Device to talk to
- * @recvbuf: Buffer to save the response to
- * @max_size: Maximum number of bytes to receive
- *
- * Returns number of bytes received on success, -EAGAIN if the TPM
- * response is not ready, -EINTR if cancelled, or other -ve value on
- * failure.
- */
- int (*recv)(struct udevice *dev, uint8_t *recvbuf, size_t max_size);
-
- /**
- * cleanup() - clean up after an operation in progress
- *
- * This is called if receiving times out. The TPM may need to abort
- * the current transaction if it did not complete, and make itself
- * ready for another.
- *
- * @dev: Device to talk to
- */
- int (*cleanup)(struct udevice *dev);
-
- /**
- * xfer() - send data to the TPM and get response
- *
- * This method is optional. If it exists it is used in preference
- * to send(), recv() and cleanup(). It should handle all aspects of
- * TPM communication for a single transfer.
- *
- * @dev: Device to talk to
- * @sendbuf: Buffer of the data to send
- * @send_size: Size of the data to send
- * @recvbuf: Buffer to save the response to
- * @recv_size: Pointer to the size of the response buffer
- *
- * Returns 0 on success (and places the number of response bytes at
- * recv_size) or -ve on failure.
- */
- int (*xfer)(struct udevice *dev, const uint8_t *sendbuf,
- size_t send_size, uint8_t *recvbuf, size_t *recv_size);
-};
-
-#define tpm_get_ops(dev) ((struct tpm_ops *)device_get_ops(dev))
-
-/**
- * tpm_open() - Request access to locality 0 for the caller
- *
- * After all commands have been completed the caller is supposed to
- * call tpm_close().
- *
- * Returns 0 on success, -ve on failure.
- */
-int tpm_open(struct udevice *dev);
-
-/**
- * tpm_close() - Close the current session
- *
- * Releasing the locked locality. Returns 0 on success, -ve 1 on
- * failure (in case lock removal did not succeed).
- */
-int tpm_close(struct udevice *dev);
-
-/**
- * tpm_get_desc() - Get a text description of the TPM
- *
- * @dev: Device to check
- * @buf: Buffer to put the string
- * @size: Maximum size of buffer
- * @return length of string, or -ENOSPC it no space
- */
-int tpm_get_desc(struct udevice *dev, char *buf, int size);
-
-/**
- * tpm_xfer() - send data to the TPM and get response
- *
- * This first uses the device's send() method to send the bytes. Then it calls
- * recv() to get the reply. If recv() returns -EAGAIN then it will delay a
- * short time and then call recv() again.
- *
- * Regardless of whether recv() completes successfully, it will then call
- * cleanup() to finish the transaction.
- *
- * Note that the outgoing data is inspected to determine command type
- * (ordinal) and a timeout is used for that command type.
- *
- * @sendbuf - buffer of the data to send
- * @send_size size of the data to send
- * @recvbuf - memory to save the response to
- * @recv_len - pointer to the size of the response buffer
- *
- * Returns 0 on success (and places the number of response bytes at
- * recv_len) or -ve on failure.
- */
-int tpm_xfer(struct udevice *dev, const uint8_t *sendbuf, size_t send_size,
- uint8_t *recvbuf, size_t *recv_size);
-
-/**
- * Initialize TPM device. It must be called before any TPM commands.
- *
- * @return 0 on success, non-0 on error.
- */
-int tpm_init(void);
-
/**
* Issue a TPM_Startup command.
*
* @param mode TPM startup mode
* @return return code of the operation
*/
-uint32_t tpm_startup(enum tpm_startup_type mode);
+u32 tpm_startup(enum tpm_startup_type mode);
/**
* Issue a TPM_SelfTestFull command.
*
* @return return code of the operation
*/
-uint32_t tpm_self_test_full(void);
+u32 tpm_self_test_full(void);
/**
* Issue a TPM_ContinueSelfTest command.
*
* @return return code of the operation
*/
-uint32_t tpm_continue_self_test(void);
+u32 tpm_continue_self_test(void);
/**
* Issue a TPM_NV_DefineSpace command. The implementation is limited
@@ -448,7 +263,7 @@ uint32_t tpm_continue_self_test(void);
* @param size size of the area
* @return return code of the operation
*/
-uint32_t tpm_nv_define_space(uint32_t index, uint32_t perm, uint32_t size);
+u32 tpm_nv_define_space(u32 index, u32 perm, u32 size);
/**
* Issue a TPM_NV_ReadValue command. This implementation is limited
@@ -460,7 +275,7 @@ uint32_t tpm_nv_define_space(uint32_t index, uint32_t perm, uint32_t size);
* @param count size of output buffer
* @return return code of the operation
*/
-uint32_t tpm_nv_read_value(uint32_t index, void *data, uint32_t count);
+u32 tpm_nv_read_value(u32 index, void *data, u32 count);
/**
* Issue a TPM_NV_WriteValue command. This implementation is limited
@@ -472,7 +287,7 @@ uint32_t tpm_nv_read_value(uint32_t index, void *data, uint32_t count);
* @param length length of data bytes of input buffer
* @return return code of the operation
*/
-uint32_t tpm_nv_write_value(uint32_t index, const void *data, uint32_t length);
+u32 tpm_nv_write_value(u32 index, const void *data, u32 length);
/**
* Issue a TPM_Extend command.
@@ -484,7 +299,7 @@ uint32_t tpm_nv_write_value(uint32_t index, const void *data, uint32_t length);
* command
* @return return code of the operation
*/
-uint32_t tpm_extend(uint32_t index, const void *in_digest, void *out_digest);
+u32 tpm_extend(u32 index, const void *in_digest, void *out_digest);
/**
* Issue a TPM_PCRRead command.
@@ -494,7 +309,7 @@ uint32_t tpm_extend(uint32_t index, const void *in_digest, void *out_digest);
* @param count size of output buffer
* @return return code of the operation
*/
-uint32_t tpm_pcr_read(uint32_t index, void *data, size_t count);
+u32 tpm_pcr_read(u32 index, void *data, size_t count);
/**
* Issue a TSC_PhysicalPresence command. TPM physical presence flag
@@ -503,37 +318,37 @@ uint32_t tpm_pcr_read(uint32_t index, void *data, size_t count);
* @param presence TPM physical presence flag
* @return return code of the operation
*/
-uint32_t tpm_tsc_physical_presence(uint16_t presence);
+u32 tpm_tsc_physical_presence(u16 presence);
/**
* Issue a TPM_ReadPubek command.
*
* @param data output buffer for the public endorsement key
- * @param count size of ouput buffer
+ * @param count size of output buffer
* @return return code of the operation
*/
-uint32_t tpm_read_pubek(void *data, size_t count);
+u32 tpm_read_pubek(void *data, size_t count);
/**
* Issue a TPM_ForceClear command.
*
* @return return code of the operation
*/
-uint32_t tpm_force_clear(void);
+u32 tpm_force_clear(void);
/**
* Issue a TPM_PhysicalEnable command.
*
* @return return code of the operation
*/
-uint32_t tpm_physical_enable(void);
+u32 tpm_physical_enable(void);
/**
* Issue a TPM_PhysicalDisable command.
*
* @return return code of the operation
*/
-uint32_t tpm_physical_disable(void);
+u32 tpm_physical_disable(void);
/**
* Issue a TPM_PhysicalSetDeactivated command.
@@ -541,7 +356,7 @@ uint32_t tpm_physical_disable(void);
* @param state boolean state of the deactivated flag
* @return return code of the operation
*/
-uint32_t tpm_physical_set_deactivated(uint8_t state);
+u32 tpm_physical_set_deactivated(u8 state);
/**
* Issue a TPM_GetCapability command. This implementation is limited
@@ -551,22 +366,21 @@ uint32_t tpm_physical_set_deactivated(uint8_t state);
* @param sub_cap further definition of capability, which is
* limited to be 4-byte wide
* @param cap output buffer for capability information
- * @param count size of ouput buffer
+ * @param count size of output buffer
* @return return code of the operation
*/
-uint32_t tpm_get_capability(uint32_t cap_area, uint32_t sub_cap,
- void *cap, size_t count);
+u32 tpm_get_capability(u32 cap_area, u32 sub_cap, void *cap, size_t count);
/**
- * Issue a TPM_FlushSpecific command for a AUTH ressource.
+ * Issue a TPM_FlushSpecific command for a AUTH resource.
*
* @param auth_handle handle of the auth session
* @return return code of the operation
*/
-uint32_t tpm_terminate_auth_session(uint32_t auth_handle);
+u32 tpm_terminate_auth_session(u32 auth_handle);
/**
- * Issue a TPM_OIAP command to setup an object independant authorization
+ * Issue a TPM_OIAP command to setup an object independent authorization
* session.
* Information about the session is stored internally.
* If there was already an OIAP session active it is terminated and a new
@@ -575,14 +389,14 @@ uint32_t tpm_terminate_auth_session(uint32_t auth_handle);
* @param auth_handle pointer to the (new) auth handle or NULL.
* @return return code of the operation
*/
-uint32_t tpm_oiap(uint32_t *auth_handle);
+u32 tpm_oiap(u32 *auth_handle);
/**
* Ends an active OIAP session.
*
* @return return code of the operation
*/
-uint32_t tpm_end_oiap(void);
+u32 tpm_end_oiap(void);
/**
* Issue a TPM_LoadKey2 (Auth1) command using an OIAP session for authenticating
@@ -595,10 +409,8 @@ uint32_t tpm_end_oiap(void);
* @param key_handle pointer to the key handle
* @return return code of the operation
*/
-uint32_t tpm_load_key2_oiap(uint32_t parent_handle,
- const void *key, size_t key_length,
- const void *parent_key_usage_auth,
- uint32_t *key_handle);
+u32 tpm_load_key2_oiap(u32 parent_handle, const void *key, size_t key_length,
+ const void *parent_key_usage_auth, u32 *key_handle);
/**
* Issue a TPM_GetPubKey (Auth1) command using an OIAP session for
@@ -613,8 +425,8 @@ uint32_t tpm_load_key2_oiap(uint32_t parent_handle,
* of the stored TPM_PUBKEY structure (iff pubkey != NULL).
* @return return code of the operation
*/
-uint32_t tpm_get_pub_key_oiap(uint32_t key_handle, const void *usage_auth,
- void *pubkey, size_t *pubkey_len);
+u32 tpm_get_pub_key_oiap(u32 key_handle, const void *usage_auth, void *pubkey,
+ size_t *pubkey_len);
/**
* Get the TPM permanent flags value
@@ -622,7 +434,7 @@ uint32_t tpm_get_pub_key_oiap(uint32_t key_handle, const void *usage_auth,
* @param pflags Place to put permanent flags
* @return return code of the operation
*/
-uint32_t tpm_get_permanent_flags(struct tpm_permanent_flags *pflags);
+u32 tpm_get_permanent_flags(struct tpm_permanent_flags *pflags);
/**
* Get the TPM permissions
@@ -630,7 +442,7 @@ uint32_t tpm_get_permanent_flags(struct tpm_permanent_flags *pflags);
* @param perm Returns permissions value
* @return return code of the operation
*/
-uint32_t tpm_get_permissions(uint32_t index, uint32_t *perm);
+u32 tpm_get_permissions(u32 index, u32 *perm);
/**
* Flush a resource with a given handle and type from the TPM
@@ -639,7 +451,7 @@ uint32_t tpm_get_permissions(uint32_t index, uint32_t *perm);
* @param resource_type type of the resource
* @return return code of the operation
*/
-uint32_t tpm_flush_specific(uint32_t key_handle, uint32_t resource_type);
+u32 tpm_flush_specific(u32 key_handle, u32 resource_type);
#ifdef CONFIG_TPM_LOAD_KEY_BY_SHA1
/**
@@ -650,8 +462,8 @@ uint32_t tpm_flush_specific(uint32_t key_handle, uint32_t resource_type);
* @param[out] handle The handle of the key (Non-null iff found)
* @return 0 if key was found in TPM; != 0 if not.
*/
-uint32_t tpm_find_key_sha1(const uint8_t auth[20], const uint8_t
- pubkey_digest[20], uint32_t *handle);
+u32 tpm_find_key_sha1(const u8 auth[20], const u8 pubkey_digest[20],
+ u32 *handle);
#endif /* CONFIG_TPM_LOAD_KEY_BY_SHA1 */
/**
@@ -663,6 +475,6 @@ uint32_t tpm_find_key_sha1(const uint8_t auth[20], const uint8_t
* @param count size of output buffer
* @return return code of the operation
*/
-uint32_t tpm_get_random(void *data, uint32_t count);
+u32 tpm_get_random(void *data, u32 count);
-#endif /* __TPM_H */
+#endif /* __TPM_V1_H */
diff --git a/include/tpm-v2.h b/include/tpm-v2.h
new file mode 100644
index 0000000000..780e061975
--- /dev/null
+++ b/include/tpm-v2.h
@@ -0,0 +1,262 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2018 Bootlin
+ * Author: Miquel Raynal <miquel.raynal@bootlin.com>
+ */
+
+#ifndef __TPM_V2_H
+#define __TPM_V2_H
+
+#include <tpm-common.h>
+
+#define TPM2_DIGEST_LEN 32
+
+/**
+ * TPM2 Structure Tags for command/response buffers.
+ *
+ * @TPM2_ST_NO_SESSIONS: the command does not need an authentication.
+ * @TPM2_ST_SESSIONS: the command needs an authentication.
+ */
+enum tpm2_structures {
+ TPM2_ST_NO_SESSIONS = 0x8001,
+ TPM2_ST_SESSIONS = 0x8002,
+};
+
+/**
+ * TPM2 type of boolean.
+ */
+enum tpm2_yes_no {
+ TPMI_YES = 1,
+ TPMI_NO = 0,
+};
+
+/**
+ * TPM2 startup values.
+ *
+ * @TPM2_SU_CLEAR: reset the internal state.
+ * @TPM2_SU_STATE: restore saved state (if any).
+ */
+enum tpm2_startup_types {
+ TPM2_SU_CLEAR = 0x0000,
+ TPM2_SU_STATE = 0x0001,
+};
+
+/**
+ * TPM2 permanent handles.
+ *
+ * @TPM2_RH_OWNER: refers to the 'owner' hierarchy.
+ * @TPM2_RS_PW: indicates a password.
+ * @TPM2_RH_LOCKOUT: refers to the 'lockout' hierarchy.
+ * @TPM2_RH_ENDORSEMENT: refers to the 'endorsement' hierarchy.
+ * @TPM2_RH_PLATFORM: refers to the 'platform' hierarchy.
+ */
+enum tpm2_handles {
+ TPM2_RH_OWNER = 0x40000001,
+ TPM2_RS_PW = 0x40000009,
+ TPM2_RH_LOCKOUT = 0x4000000A,
+ TPM2_RH_ENDORSEMENT = 0x4000000B,
+ TPM2_RH_PLATFORM = 0x4000000C,
+};
+
+/**
+ * TPM2 command codes used at the beginning of a buffer, gives the command.
+ *
+ * @TPM2_CC_STARTUP: TPM2_Startup().
+ * @TPM2_CC_SELF_TEST: TPM2_SelfTest().
+ * @TPM2_CC_CLEAR: TPM2_Clear().
+ * @TPM2_CC_CLEARCONTROL: TPM2_ClearControl().
+ * @TPM2_CC_HIERCHANGEAUTH: TPM2_HierarchyChangeAuth().
+ * @TPM2_CC_PCR_SETAUTHPOL: TPM2_PCR_SetAuthPolicy().
+ * @TPM2_CC_DAM_RESET: TPM2_DictionaryAttackLockReset().
+ * @TPM2_CC_DAM_PARAMETERS: TPM2_DictionaryAttackParameters().
+ * @TPM2_CC_GET_CAPABILITY: TPM2_GetCapibility().
+ * @TPM2_CC_PCR_READ: TPM2_PCR_Read().
+ * @TPM2_CC_PCR_EXTEND: TPM2_PCR_Extend().
+ * @TPM2_CC_PCR_SETAUTHVAL: TPM2_PCR_SetAuthValue().
+ */
+enum tpm2_command_codes {
+ TPM2_CC_STARTUP = 0x0144,
+ TPM2_CC_SELF_TEST = 0x0143,
+ TPM2_CC_CLEAR = 0x0126,
+ TPM2_CC_CLEARCONTROL = 0x0127,
+ TPM2_CC_HIERCHANGEAUTH = 0x0129,
+ TPM2_CC_PCR_SETAUTHPOL = 0x012C,
+ TPM2_CC_DAM_RESET = 0x0139,
+ TPM2_CC_DAM_PARAMETERS = 0x013A,
+ TPM2_CC_GET_CAPABILITY = 0x017A,
+ TPM2_CC_PCR_READ = 0x017E,
+ TPM2_CC_PCR_EXTEND = 0x0182,
+ TPM2_CC_PCR_SETAUTHVAL = 0x0183,
+};
+
+/**
+ * TPM2 return codes.
+ */
+enum tpm2_return_codes {
+ TPM2_RC_SUCCESS = 0x0000,
+ TPM2_RC_BAD_TAG = 0x001E,
+ TPM2_RC_FMT1 = 0x0080,
+ TPM2_RC_HASH = TPM2_RC_FMT1 + 0x0003,
+ TPM2_RC_VALUE = TPM2_RC_FMT1 + 0x0004,
+ TPM2_RC_SIZE = TPM2_RC_FMT1 + 0x0015,
+ TPM2_RC_BAD_AUTH = TPM2_RC_FMT1 + 0x0022,
+ TPM2_RC_HANDLE = TPM2_RC_FMT1 + 0x000B,
+ TPM2_RC_VER1 = 0x0100,
+ TPM2_RC_INITIALIZE = TPM2_RC_VER1 + 0x0000,
+ TPM2_RC_FAILURE = TPM2_RC_VER1 + 0x0001,
+ TPM2_RC_DISABLED = TPM2_RC_VER1 + 0x0020,
+ TPM2_RC_AUTH_MISSING = TPM2_RC_VER1 + 0x0025,
+ TPM2_RC_COMMAND_CODE = TPM2_RC_VER1 + 0x0043,
+ TPM2_RC_AUTHSIZE = TPM2_RC_VER1 + 0x0044,
+ TPM2_RC_AUTH_CONTEXT = TPM2_RC_VER1 + 0x0045,
+ TPM2_RC_NEEDS_TEST = TPM2_RC_VER1 + 0x0053,
+ TPM2_RC_WARN = 0x0900,
+ TPM2_RC_TESTING = TPM2_RC_WARN + 0x000A,
+ TPM2_RC_REFERENCE_H0 = TPM2_RC_WARN + 0x0010,
+ TPM2_RC_LOCKOUT = TPM2_RC_WARN + 0x0021,
+};
+
+/**
+ * TPM2 algorithms.
+ */
+enum tpm2_algorithms {
+ TPM2_ALG_XOR = 0x0A,
+ TPM2_ALG_SHA256 = 0x0B,
+ TPM2_ALG_SHA384 = 0x0C,
+ TPM2_ALG_SHA512 = 0x0D,
+ TPM2_ALG_NULL = 0x10,
+};
+
+/**
+ * Issue a TPM2_Startup command.
+ *
+ * @mode TPM startup mode
+ *
+ * @return code of the operation
+ */
+u32 tpm2_startup(enum tpm2_startup_types mode);
+
+/**
+ * Issue a TPM2_SelfTest command.
+ *
+ * @full_test Asking to perform all tests or only the untested ones
+ *
+ * @return code of the operation
+ */
+u32 tpm2_self_test(enum tpm2_yes_no full_test);
+
+/**
+ * Issue a TPM2_Clear command.
+ *
+ * @handle Handle
+ * @pw Password
+ * @pw_sz Length of the password
+ *
+ * @return code of the operation
+ */
+u32 tpm2_clear(u32 handle, const char *pw, const ssize_t pw_sz);
+
+/**
+ * Issue a TPM2_PCR_Extend command.
+ *
+ * @index Index of the PCR
+ * @digest Value representing the event to be recorded
+ *
+ * @return code of the operation
+ */
+u32 tpm2_pcr_extend(u32 index, const uint8_t *digest);
+
+/**
+ * Issue a TPM2_PCR_Read command.
+ *
+ * @idx Index of the PCR
+ * @idx_min_sz Minimum size in bytes of the pcrSelect array
+ * @data Output buffer for contents of the named PCR
+ * @updates Optional out parameter: number of updates for this PCR
+ *
+ * @return code of the operation
+ */
+u32 tpm2_pcr_read(u32 idx, unsigned int idx_min_sz, void *data,
+ unsigned int *updates);
+
+/**
+ * Issue a TPM2_GetCapability command. This implementation is limited
+ * to query property index that is 4-byte wide.
+ *
+ * @capability Partition of capabilities
+ * @property Further definition of capability, limited to be 4 bytes wide
+ * @buf Output buffer for capability information
+ * @prop_count Size of output buffer
+ *
+ * @return code of the operation
+ */
+u32 tpm2_get_capability(u32 capability, u32 property, void *buf,
+ size_t prop_count);
+
+/**
+ * Issue a TPM2_DictionaryAttackLockReset command.
+ *
+ * @pw Password
+ * @pw_sz Length of the password
+ *
+ * @return code of the operation
+ */
+u32 tpm2_dam_reset(const char *pw, const ssize_t pw_sz);
+
+/**
+ * Issue a TPM2_DictionaryAttackParameters command.
+ *
+ * @pw Password
+ * @pw_sz Length of the password
+ * @max_tries Count of authorizations before lockout
+ * @recovery_time Time before decrementation of the failure count
+ * @lockout_recovery Time to wait after a lockout
+ *
+ * @return code of the operation
+ */
+u32 tpm2_dam_parameters(const char *pw, const ssize_t pw_sz,
+ unsigned int max_tries, unsigned int recovery_time,
+ unsigned int lockout_recovery);
+
+/**
+ * Issue a TPM2_HierarchyChangeAuth command.
+ *
+ * @handle Handle
+ * @newpw New password
+ * @newpw_sz Length of the new password
+ * @oldpw Old password
+ * @oldpw_sz Length of the old password
+ *
+ * @return code of the operation
+ */
+int tpm2_change_auth(u32 handle, const char *newpw, const ssize_t newpw_sz,
+ const char *oldpw, const ssize_t oldpw_sz);
+
+/**
+ * Issue a TPM_PCR_SetAuthPolicy command.
+ *
+ * @pw Platform password
+ * @pw_sz Length of the password
+ * @index Index of the PCR
+ * @digest New key to access the PCR
+ *
+ * @return code of the operation
+ */
+u32 tpm2_pcr_setauthpolicy(const char *pw, const ssize_t pw_sz, u32 index,
+ const char *key);
+
+/**
+ * Issue a TPM_PCR_SetAuthValue command.
+ *
+ * @pw Platform password
+ * @pw_sz Length of the password
+ * @index Index of the PCR
+ * @digest New key to access the PCR
+ * @key_sz Length of the new key
+ *
+ * @return code of the operation
+ */
+u32 tpm2_pcr_setauthvalue(const char *pw, const ssize_t pw_sz, u32 index,
+ const char *key, const ssize_t key_sz);
+
+#endif /* __TPM_V2_H */
diff --git a/include/tsi108.h b/include/tsi108.h
deleted file mode 100644
index 8e246b857e..0000000000
--- a/include/tsi108.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*****************************************************************************
- * (C) Copyright 2003; Tundra Semiconductor Corp.
- * (C) Copyright 2006; Freescale Semiconductor Corp.
- *****************************************************************************/
-
-/*
- * FILENAME: tsi108.h
- *
- * Originator: Alex Bounine
- *
- * DESCRIPTION:
- * Common definitions for the Tundra Tsi108 bridge chip
- *
- */
-
-#ifndef _TSI108_H_
-#define _TSI108_H_
-
-#define TSI108_HLP_REG_OFFSET (0x0000)
-#define TSI108_PCI_REG_OFFSET (0x1000)
-#define TSI108_CLK_REG_OFFSET (0x2000)
-#define TSI108_PB_REG_OFFSET (0x3000)
-#define TSI108_SD_REG_OFFSET (0x4000)
-#define TSI108_MPIC_REG_OFFSET (0x7400)
-
-#define PB_ID (0x000)
-#define PB_RSR (0x004)
-#define PB_BUS_MS_SELECT (0x008)
-#define PB_ISR (0x00C)
-#define PB_ARB_CTRL (0x018)
-#define PB_PVT_CTRL2 (0x034)
-#define PB_SCR (0x400)
-#define PB_ERRCS (0x404)
-#define PB_AERR (0x408)
-#define PB_REG_BAR (0x410)
-#define PB_OCN_BAR1 (0x414)
-#define PB_OCN_BAR2 (0x418)
-#define PB_SDRAM_BAR1 (0x41C)
-#define PB_SDRAM_BAR2 (0x420)
-#define PB_MCR (0xC00)
-#define PB_MCMD (0xC04)
-
-#define HLP_B0_ADDR (0x000)
-#define HLP_B1_ADDR (0x010)
-#define HLP_B2_ADDR (0x020)
-#define HLP_B3_ADDR (0x030)
-
-#define HLP_B0_MASK (0x004)
-#define HLP_B1_MASK (0x014)
-#define HLP_B2_MASK (0x024)
-#define HLP_B3_MASK (0x034)
-
-#define HLP_B0_CTRL0 (0x008)
-#define HLP_B1_CTRL0 (0x018)
-#define HLP_B2_CTRL0 (0x028)
-#define HLP_B3_CTRL0 (0x038)
-
-#define HLP_B0_CTRL1 (0x00C)
-#define HLP_B1_CTRL1 (0x01C)
-#define HLP_B2_CTRL1 (0x02C)
-#define HLP_B3_CTRL1 (0x03C)
-
-#define PCI_CSR (0x004)
-#define PCI_P2O_BAR0 (0x010)
-#define PCI_P2O_BAR0_UPPER (0x014)
-#define PCI_P2O_BAR2 (0x018)
-#define PCI_P2O_BAR2_UPPER (0x01C)
-#define PCI_P2O_BAR3 (0x020)
-#define PCI_P2O_BAR3_UPPER (0x024)
-
-#define PCI_MISC_CSR (0x040)
-#define PCI_P2O_PAGE_SIZES (0x04C)
-
-#define PCI_PCIX_STAT (0x0F4)
-
-#define PCI_IRP_STAT (0x184)
-
-#define PCI_PFAB_BAR0 (0x204)
-#define PCI_PFAB_BAR0_UPPER (0x208)
-#define PCI_PFAB_IO (0x20C)
-#define PCI_PFAB_IO_UPPER (0x210)
-
-#define PCI_PFAB_MEM32 (0x214)
-#define PCI_PFAB_MEM32_REMAP (0x218)
-#define PCI_PFAB_MEM32_MASK (0x21C)
-
-#define CG_PLL0_CTRL0 (0x210)
-#define CG_PLL0_CTRL1 (0x214)
-#define CG_PLL1_CTRL0 (0x220)
-#define CG_PLL1_CTRL1 (0x224)
-#define CG_PWRUP_STATUS (0x234)
-
-#define MPIC_CSR(n) (0x30C + (n * 0x40))
-
-#define SD_CTRL (0x000)
-#define SD_STATUS (0x004)
-#define SD_TIMING (0x008)
-#define SD_REFRESH (0x00C)
-#define SD_INT_STATUS (0x010)
-#define SD_INT_ENABLE (0x014)
-#define SD_INT_SET (0x018)
-#define SD_D0_CTRL (0x020)
-#define SD_D1_CTRL (0x024)
-#define SD_D0_BAR (0x028)
-#define SD_D1_BAR (0x02C)
-#define SD_ECC_CTRL (0x040)
-#define SD_DLL_STATUS (0x250)
-
-#define TS_SD_CTRL_ENABLE (1 << 31)
-
-#define PB_ERRCS_ES (1 << 1)
-#define PB_ISR_PBS_RD_ERR (1 << 8)
-#define PCI_IRP_STAT_P_CSR (1 << 23)
-
-/*
- * I2C : Register address offset definitions
- */
-#define I2C_CNTRL1 (0x00000000)
-#define I2C_CNTRL2 (0x00000004)
-#define I2C_RD_DATA (0x00000008)
-#define I2C_TX_DATA (0x0000000c)
-
-/*
- * I2C : Register Bit Masks and Reset Values
- * definitions for every register
- */
-
-/* I2C_CNTRL1 : Reset Value */
-#define I2C_CNTRL1_RESET_VALUE (0x0000000a)
-
-/* I2C_CNTRL1 : Register Bits Masks Definitions */
-#define I2C_CNTRL1_DEVCODE (0x0000000f)
-#define I2C_CNTRL1_PAGE (0x00000700)
-#define I2C_CNTRL1_BYTADDR (0x00ff0000)
-#define I2C_CNTRL1_I2CWRITE (0x01000000)
-
-/* I2C_CNTRL1 : Read/Write Bit Mask Definition */
-#define I2C_CNTRL1_RWMASK (0x01ff070f)
-
-/* I2C_CNTRL1 : Unused/Reserved bits Definition */
-#define I2C_CNTRL1_RESERVED (0xfe00f8f0)
-
-/* I2C_CNTRL2 : Reset Value */
-#define I2C_CNTRL2_RESET_VALUE (0x00000000)
-
-/* I2C_CNTRL2 : Register Bits Masks Definitions */
-#define I2C_CNTRL2_SIZE (0x00000003)
-#define I2C_CNTRL2_LANE (0x0000000c)
-#define I2C_CNTRL2_MULTIBYTE (0x00000010)
-#define I2C_CNTRL2_START (0x00000100)
-#define I2C_CNTRL2_WR_STATUS (0x00010000)
-#define I2C_CNTRL2_RD_STATUS (0x00020000)
-#define I2C_CNTRL2_I2C_TO_ERR (0x04000000)
-#define I2C_CNTRL2_I2C_CFGERR (0x08000000)
-#define I2C_CNTRL2_I2C_CMPLT (0x10000000)
-
-/* I2C_CNTRL2 : Read/Write Bit Mask Definition */
-#define I2C_CNTRL2_RWMASK (0x0000011f)
-
-/* I2C_CNTRL2 : Unused/Reserved bits Definition */
-#define I2C_CNTRL2_RESERVED (0xe3fcfee0)
-
-/* I2C_RD_DATA : Reset Value */
-#define I2C_RD_DATA_RESET_VALUE (0x00000000)
-
-/* I2C_RD_DATA : Register Bits Masks Definitions */
-#define I2C_RD_DATA_RBYTE0 (0x000000ff)
-#define I2C_RD_DATA_RBYTE1 (0x0000ff00)
-#define I2C_RD_DATA_RBYTE2 (0x00ff0000)
-#define I2C_RD_DATA_RBYTE3 (0xff000000)
-
-/* I2C_RD_DATA : Read/Write Bit Mask Definition */
-#define I2C_RD_DATA_RWMASK (0x00000000)
-
-/* I2C_RD_DATA : Unused/Reserved bits Definition */
-#define I2C_RD_DATA_RESERVED (0x00000000)
-
-/* I2C_TX_DATA : Reset Value */
-#define I2C_TX_DATA_RESET_VALUE (0x00000000)
-
-/* I2C_TX_DATA : Register Bits Masks Definitions */
-#define I2C_TX_DATA_TBYTE0 (0x000000ff)
-#define I2C_TX_DATA_TBYTE1 (0x0000ff00)
-#define I2C_TX_DATA_TBYTE2 (0x00ff0000)
-#define I2C_TX_DATA_TBYTE3 (0xff000000)
-
-/* I2C_TX_DATA : Read/Write Bit Mask Definition */
-#define I2C_TX_DATA_RWMASK (0xffffffff)
-
-/* I2C_TX_DATA : Unused/Reserved bits Definition */
-#define I2C_TX_DATA_RESERVED (0x00000000)
-
-#define TSI108_I2C_OFFSET 0x7000 /* offset for general use I2C channel */
-#define TSI108_I2C_SDRAM_OFFSET 0x4400 /* offset for SPD I2C channel */
-
-#define I2C_EEPROM_DEVCODE 0xA /* standard I2C EEPROM device code */
-
-/* I2C status codes */
-
-#define TSI108_I2C_SUCCESS 0
-#define TSI108_I2C_PARAM_ERR 1
-#define TSI108_I2C_TIMEOUT_ERR 2
-#define TSI108_I2C_IF_BUSY 3
-#define TSI108_I2C_IF_ERROR 4
-
-#endif /* _TSI108_H_ */
diff --git a/include/xilinx.h b/include/xilinx.h
index 9429f51b48..af40befa52 100644
--- a/include/xilinx.h
+++ b/include/xilinx.h
@@ -48,6 +48,8 @@ typedef struct { /* typedef xilinx_desc */
struct xilinx_fpga_op {
int (*load)(xilinx_desc *, const void *, size_t, bitstream_type);
int (*loadfs)(xilinx_desc *, const void *, size_t, fpga_fs_info *);
+ int (*loads)(xilinx_desc *desc, const void *buf, size_t bsize,
+ struct fpga_secure_info *fpga_sec_info);
int (*dump)(xilinx_desc *, const void *, size_t);
int (*info)(xilinx_desc *);
};
@@ -60,6 +62,8 @@ int xilinx_dump(xilinx_desc *desc, const void *buf, size_t bsize);
int xilinx_info(xilinx_desc *desc);
int xilinx_loadfs(xilinx_desc *desc, const void *buf, size_t bsize,
fpga_fs_info *fpga_fsinfo);
+int xilinx_loads(xilinx_desc *desc, const void *buf, size_t bsize,
+ struct fpga_secure_info *fpga_sec_info);
/* Board specific implementation specific function types
*********************************************************************/
diff --git a/include/zynqmppl.h b/include/zynqmppl.h
index a0f4e68a0c..5214db99fb 100644
--- a/include/zynqmppl.h
+++ b/include/zynqmppl.h
@@ -16,6 +16,9 @@
#define ZYNQMP_FPGA_OP_LOAD (1 << 1)
#define ZYNQMP_FPGA_OP_DONE (1 << 2)
+#define ZYNQMP_FPGA_FLAG_AUTHENTICATED BIT(2)
+#define ZYNQMP_FPGA_FLAG_ENCRYPTED BIT(3)
+
#define ZYNQMP_CSU_IDCODE_DEVICE_CODE_SHIFT 15
#define ZYNQMP_CSU_IDCODE_DEVICE_CODE_MASK (0xf << \
ZYNQMP_CSU_IDCODE_DEVICE_CODE_SHIFT)