F: arch/x86/
F: cmd/x86/
+XEN
+M: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
+M: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
+S: Maintained
+F: arch/arm/cpu/armv8/xen/
+F: arch/arm/include/asm/xen.h
+F: arch/arm/include/asm/xen/
+F: cmd/pvblock.c
+F: drivers/serial/serial_xen.c
+F: drivers/xen/
+F: include/pvblock.h
+F: include/xen/
+F: include/xen.h
+F: lib/sscanf.c
+F: test/lib/sscanf.c
+
XTENSA
M: Max Filippov <jcmvbkbc@gmail.com>
S: Maintained
Enables an 'i2c edid' command which can read EDID
information over I2C from an attached LCD display.
-- Splash Screen Support: CONFIG_SPLASH_SCREEN
-
- If this option is set, the environment is checked for
- a variable "splashimage". If found, the usual display
- of logo, copyright and system information on the LCD
- is suppressed and the BMP image at the address
- specified in "splashimage" is loaded instead. The
- console is redirected to the "nulldev", too. This
- allows for a "silent" boot where a splash screen is
- loaded very quickly after power-on.
-
- CONFIG_SPLASHIMAGE_GUARD
-
- If this option is set, then U-Boot will prevent the environment
- variable "splashimage" from being set to a problematic address
- (see doc/README.displaying-bmps).
- This option is useful for targets where, due to alignment
- restrictions, an improperly aligned BMP image will cause a data
- abort. If you think you will not have problems with unaligned
- accesses (for example because your toolchain prevents them)
- there is no need to set this option.
-
- CONFIG_SPLASH_SCREEN_ALIGN
-
- If this option is set the splash image can be freely positioned
- on the screen. Environment variable "splashpos" specifies the
- position as "x,y". If a positive number is given it is used as
- number of pixel from left/top. If a negative number is given it
- is used as number of pixel from right/bottom. You can also
- specify 'm' for centering the image.
-
- Example:
- setenv splashpos m,m
- => image at center of screen
-
- setenv splashpos 30,20
- => image at x = 30 and y = 20
-
- setenv splashpos -10,m
- => vertically centered image
- at x = dspWidth - bmpWidth - 9
-
- Gzip compressed BMP image support: CONFIG_VIDEO_BMP_GZIP
If this option is set, additionally to standard BMP
select DM_SERIAL
select OF_CONTROL
imply BOARD_LATE_INIT
+ imply ENV_VARS_UBOOT_RUNTIME_CONFIG
config ARCH_VF610
bool "Freescale Vybrid"
imply CMD_CLK
imply CMD_DM
imply CMD_SPL
+ imply ENV_VARS_UBOOT_RUNTIME_CONFIG
imply FAT_WRITE
config ARCH_ZYNQMP_R5
select ZYNQMP_IPI
imply BOARD_LATE_INIT
imply CMD_DM
+ imply ENV_VARS_UBOOT_RUNTIME_CONFIG
imply FAT_WRITE
imply MP
imply DM_USB_GADGET
select USB
select DM_USB
+config TARGET_TOTAL_COMPUTE
+ bool "Support Total Compute Platform"
+ select ARM64
+ select PL01X_SERIAL
+ select DM
+ select DM_SERIAL
+ select DM_MMC
+ select DM_GPIO
+
config TARGET_LS2080A_EMU
bool "Support ls2080a_emu"
select ARCH_LS2080A
source "arch/arm/mach-nexell/Kconfig"
+source "board/armltd/total_compute/Kconfig"
+
source "board/bosch/shc/Kconfig"
source "board/bosch/guardian/Kconfig"
source "board/CarMediaLab/flea3/Kconfig"
source "board/xilinx/Kconfig"
source "board/xilinx/zynq/Kconfig"
source "board/xilinx/zynqmp/Kconfig"
+source "board/xilinx/versal/Kconfig"
source "board/phytium/durian/Kconfig"
source "board/xen/xenguest_arm64/Kconfig"
dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7622-rfb.dtb \
mt7623a-unielec-u7623-02-emmc.dtb \
- mt7622-bpi-r64.dtb \
+ mt7622-bananapi-bpi-r64.dtb \
mt7623n-bananapi-bpi-r2.dtb \
mt7629-rfb.dtb \
mt8512-bm1-emmc.dtb \
dtb-$(CONFIG_TARGET_VEXPRESS_CA9X4) += vexpress-v2p-ca9.dtb
dtb-$(CONFIG_TARGET_VEXPRESS_CA15_TC2) += vexpress-v2p-ca15_a7.dtb
+dtb-$(CONFIG_TARGET_TOTAL_COMPUTE) += total_compute.dtb
+
dtb-$(CONFIG_TARGET_DURIAN) += phytium-durian.dtb
dtb-$(CONFIG_TARGET_PRESIDIO_ASIC) += ca-presidio-engboard.dtb
/* microSD card slot */
&sdhci1 {
status = "okay";
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
clock-frequency = <199998000>;
max-frequency = <50000000>;
no-1-8-v;
/* Micron MTFC8GAKAJCN-4M 8 GB eMMC */
&sdhci0 {
status = "okay";
- xlnx,mio_bank = <0>;
+ xlnx,mio-bank = <0>;
clock-frequency = <199998000>;
};
&eeprom {
partitions {
compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
- vpd {
- offset = <0>;
- size = <1022>;
+ vpd@0 {
+ reg = <0 1022>;
};
- bootcount: bootcount {
- offset = <1022>;
- size = <2>;
+ bootcount: bootcount@1022 {
+ reg = <1022 2>;
};
};
};
&eeprom {
partitions {
compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
- vpd {
- offset = <0>;
- size = <1022>;
+ vpd@0 {
+ reg = <0 1022>;
};
bootcount: bootcount {
- offset = <1022>;
- size = <2>;
+ reg = <1022 2>;
};
};
};
output-low;
};
};
+
+&ssusb {
+ status = "okay";
+};
+
+&u3phy {
+ status = "okay";
+};
full-duplex;
};
};
+
+&ssusb {
+ status = "okay";
+};
+
+&u3phy {
+ status = "okay";
+};
status = "disabled";
};
+ ssusbsys: ssusbsys@1a000000 {
+ compatible = "mediatek,mt7622-ssusbsys",
+ "syscon";
+ reg = <0x1a000000 0x1000>;
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ };
+
pciesys: pciesys@1a100800 {
compatible = "mediatek,mt7622-pciesys", "syscon";
reg = <0x1a100800 0x1000>;
};
};
+ ssusb: usb@1a0c0000 {
+ compatible = "mediatek,mt7622-xhci",
+ "mediatek,mtk-xhci";
+ reg = <0x1a0c0000 0x01000>,
+ <0x1a0c4700 0x0100>;
+ reg-names = "mac", "ippc";
+ interrupts = <GIC_SPI 232 IRQ_TYPE_LEVEL_LOW>;
+ power-domains = <&scpsys MT7629_POWER_DOMAIN_HIF1>;
+ clocks = <&ssusbsys CLK_SSUSB_SYS_EN>,
+ <&ssusbsys CLK_SSUSB_REF_EN>,
+ <&ssusbsys CLK_SSUSB_MCU_EN>,
+ <&ssusbsys CLK_SSUSB_DMA_EN>;
+ clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck";
+ phys = <&u2port0 PHY_TYPE_USB2>,
+ <&u3port0 PHY_TYPE_USB3>,
+ <&u2port1 PHY_TYPE_USB2>;
+ status = "disabled";
+ };
+
+ u3phy: usb-phy@1a0c4000 {
+ compatible = "mediatek,mt7622-u3phy",
+ "mediatek,generic-tphy-v1";
+ reg = <0x1a0c4000 0x700>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+ status = "disabled";
+
+ u2port0: usb-phy@1a0c4800 {
+ reg = <0x1a0c4800 0x0100>;
+ #phy-cells = <1>;
+ clocks = <&ssusbsys CLK_SSUSB_U2_PHY_EN>;
+ clock-names = "ref";
+ };
+
+ u3port0: usb-phy@1a0c4900 {
+ reg = <0x1a0c4900 0x0700>;
+ #phy-cells = <1>;
+ };
+
+ u2port1: usb-phy@1a0c5000 {
+ reg = <0x1a0c5000 0x0100>;
+ #phy-cells = <1>;
+ clocks = <&ssusbsys CLK_SSUSB_U2_PHY_1P_EN>;
+ clock-names = "ref";
+ };
+ };
+
ethsys: syscon@1b000000 {
compatible = "mediatek,mt7622-ethsys", "syscon";
reg = <0x1b000000 0x1000>;
};
};
+ usb1: usb@1a1c0000 {
+ compatible = "mediatek,mt7623-xhci", "mediatek,mtk-xhci";
+ reg = <0x1a1c0000 0x1000>, <0x1a1c4700 0x0100>;
+ reg-names = "mac", "ippc";
+ power-domains = <&scpsys MT7623_POWER_DOMAIN_HIF>;
+ clocks = <&hifsys CLK_HIFSYS_USB0PHY>, <&topckgen CLK_TOP_ETHIF_SEL>;
+ clock-names = "sys_ck", "ref_ck";
+ phys = <&u2port0 PHY_TYPE_USB2>, <&u3port0 PHY_TYPE_USB3>;
+ status = "disabled";
+ };
+
+ u3phy1: usb-phy@1a1c4000 {
+ compatible = "mediatek,mt7623-tphy", "mediatek,generic-tphy-v1";
+
+ reg = <0x1a1c4000 0x0700>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+ status = "disabled";
+
+ u2port0: usb-phy@1a1c4800 {
+ reg = <0x1a1c4800 0x0100>;
+ #phy-cells = <1>;
+ clocks = <&topckgen CLK_TOP_USB_PHY48M>;
+ clock-names = "ref";
+ };
+
+ u3port0: usb-phy@1a1c4900 {
+ reg = <0x1a1c4900 0x0700>;
+ #phy-cells = <1>;
+ clocks = <&clk26m>;
+ clock-names = "ref";
+ };
+ };
+
+ usb2: usb@1a240000 {
+ compatible = "mediatek,mt7623-xhci", "mediatek,mtk-xhci";
+ reg = <0x1a240000 0x1000>, <0x1a244700 0x0100>;
+ reg-names = "mac", "ippc";
+ power-domains = <&scpsys MT7623_POWER_DOMAIN_HIF>;
+ clocks = <&hifsys CLK_HIFSYS_USB1PHY>, <&topckgen CLK_TOP_ETHIF_SEL>;
+ clock-names = "sys_ck", "ref_ck";
+ phys = <&u2port1 PHY_TYPE_USB2>, <&u3port1 PHY_TYPE_USB3>;
+ status = "disabled";
+ };
+
u3phy2: usb-phy@1a244000 {
compatible = "mediatek,generic-tphy-v1";
reg = <0x1a244000 0x0700>;
pinctrl-0 = <&uart2_pins_a>;
status = "okay";
};
+
+&usb1 {
+ status = "okay";
+};
+
+&u3phy1 {
+ status = "okay";
+};
+
+&usb2 {
+ status = "okay";
+};
+
+&u3phy2 {
+ status = "okay";
+};
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2020 Arm Limited
+ */
+
+/dts-v1/;
+
+/ {
+ model = "total_compute";
+ compatible = "arm,total_compute";
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ sysreg: sysreg@1c010000 {
+ compatible = "arm,vexpress-sysreg";
+ reg = <0x0 0x001c010000 0x0 0x1000>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ fixed_3v3: v2m-3v3 {
+ compatible = "regulator-fixed";
+ regulator-name = "3V3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ mmci@1c050000 {
+ compatible = "arm,pl180", "arm,primecell";
+ reg = <0x0 0x001c050000 0x0 0x1000>;
+ cd-gpios = <&sysreg 0 0>;
+ arm,primecell-periphid = <0x00880180>;
+ wp-gpios = <&sysreg 1 0>;
+ bus-width = <8>;
+ max-frequency = <12000000>;
+ vmmc-supply = <&fixed_3v3>;
+ clocks = <&clock24mhz>, <&clock24mhz>;
+ clock-names = "mclk", "apb_pclk";
+ };
+
+ clock24mhz: clock24mhz {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <24000000>;
+ clock-output-names = "bp:clock24mhz";
+ };
+};
clocks = <&clk25 &clk25>;
xlnx,device_id = <0>;
no-1-8-v;
- xlnx,mio_bank = <0>;
+ xlnx,mio-bank = <0>;
#stream-id-cells = <1>;
};
};
clocks = <&clk25 &clk25>;
xlnx,device_id = <1>;
no-1-8-v;
- xlnx,mio_bank = <0>;
+ xlnx,mio-bank = <0>;
#stream-id-cells = <1>;
};
};
status = "okay";
no-1-8-v;
disable-wp;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
};
&gem0 {
non-removable;
disable-wp;
bus-width = <8>;
- xlnx,mio_bank = <0>;
+ xlnx,mio-bank = <0>;
};
&uart0 { /* uart0 MIO38-39 */
non-removable;
disable-wp;
bus-width = <8>;
- xlnx,mio_bank = <0>; /* FIXME tap delay */
+ xlnx,mio-bank = <0>; /* FIXME tap delay */
};
&uart0 { /* uart0 MIO38-39 */
status = "disable";
no-1-8-v;
disable-wp;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
};
&gem0 {
non-removable;
disable-wp;
bus-width = <8>;
- xlnx,mio_bank = <0>; /* FIXME tap delay */
+ xlnx,mio-bank = <0>; /* FIXME tap delay */
};
&uart0 { /* uart0 MIO38-39 */
status = "disable";
no-1-8-v;
disable-wp;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
};
&gem0 {
non-removable;
disable-wp;
bus-width = <8>;
- xlnx,mio_bank = <0>; /* FIXME tap delay */
+ xlnx,mio-bank = <0>; /* FIXME tap delay */
};
&uart0 { /* uart0 MIO38-39 */
status = "disable";
no-1-8-v;
disable-wp;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
};
&gem0 {
non-removable;
disable-wp;
bus-width = <8>;
- xlnx,mio_bank = <0>;
+ xlnx,mio-bank = <0>;
};
&uart0 { /* uart0 MIO38-39 */
status = "okay";
no-1-8-v;
disable-wp;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
};
&gem0 {
non-removable;
disable-wp; /* We don't have a write-protect detection */
bus-width = <8>;
- xlnx,mio_bank = <0>;
+ xlnx,mio-bank = <0>;
};
/* SD1 with level shifter */
&sdhci1 {
status = "okay";
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
disable-wp; /* We don't have a write-protect detection */
bus-width = <4>;
};
&sdhci0 {
status = "okay";
bus-width = <8>;
- xlnx,mio_bank = <0>;
+ xlnx,mio-bank = <0>;
};
/* SD1 with level shifter */
* This property should be removed for supporting UHS mode
*/
no-1-8-v;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
};
&uart0 {
status = "okay";
no-1-8-v;
disable-wp;
- xlnx,mio_bank = <0>;
+ xlnx,mio-bank = <0>;
};
&sdhci1 {
status = "okay";
bus-width = <0x4>;
- xlnx,mio_bank = <0>;
+ xlnx,mio-bank = <0>;
non-removable;
disable-wp;
cap-power-off-card;
* removed for supporting UHS mode
*/
no-1-8-v;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
};
&serdes {
&sdhci1 {
status = "okay";
no-1-8-v;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
disable-wp;
};
&sdhci1 {
status = "okay";
no-1-8-v;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
disable-wp;
};
* This property should be removed for supporting UHS mode
*/
no-1-8-v;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
};
&serdes {
* This property should be removed for supporting UHS mode
*/
no-1-8-v;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
};
&serdes {
* removed for supporting UHS mode
*/
no-1-8-v;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
};
* This property should be removed for supporting UHS mode
*/
no-1-8-v;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
};
* This property should be removed for supporting UHS mode
*/
no-1-8-v;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
};
&serdes {
* This property should be removed for supporting UHS mode
*/
no-1-8-v;
- xlnx,mio_bank = <1>;
+ xlnx,mio-bank = <1>;
};
&serdes {
!defined(CONFIG_ARCH_BCM6858) && !defined(CONFIG_ARCH_BCM63158) && \
!defined(CONFIG_ARCH_ROCKCHIP) && !defined(CONFIG_ARCH_ASPEED) && \
!defined(CONFIG_ARCH_U8500) && !defined(CONFIG_CORTINA_PLATFORM) && \
- !defined(CONFIG_TARGET_BCMNS3)
+ !defined(CONFIG_TARGET_BCMNS3) && !defined(CONFIG_TARGET_TOTAL_COMPUTE)
#include <asm/arch/gpio.h>
#endif
#include <asm-generic/gpio.h>
* Ethernet Driver configuration
*/
#ifdef CONFIG_CMD_NET
-#define CONFIG_NETCONSOLE /* include NetConsole support */
#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN /* detect link using phy */
#define CONFIG_RESET_PHY_R /* use reset_phy() to init mv8831116 PHY */
#endif /* CONFIG_CMD_NET */
TCM_SPLIT,
};
-#define PAYLOAD_ARG_CNT 4U
-
void tcm_init(u8 mode);
void mem_map_fill(void);
#ifndef _ASM_ARCH_SYS_PROTO_H
#define _ASM_ARCH_SYS_PROTO_H
-#define PAYLOAD_ARG_CNT 5
-
#define ZYNQMP_CSU_SILICON_VER_MASK 0xF
#define KEY_PTR_LEN 32
void initialize_tcm(bool mode);
void mem_map_fill(void);
-int chip_id(unsigned char id);
#if defined(CONFIG_SYS_MEM_RSVD_FOR_MMU) || defined(CONFIG_DEFINE_TCM_OCM_MMAP)
void tcm_init(u8 mode);
#endif
if (node < 0)
return node;
- base = fdtdec_get_addr(blob, node, "reg");
+ base = fdtdec_get_addr_size_auto_parent(blob, 0, node, "reg", 0,
+ NULL, false);
if (base == FDT_ADDR_T_NONE)
return FDT_ADDR_T_NONE;
unsigned long asid);
#endif
void sbi_set_timer(uint64_t stime_value);
+long sbi_get_spec_version(void);
+int sbi_get_impl_id(void);
int sbi_probe_extension(int ext);
#endif
}
/**
+ * sbi_get_spec_version() - get current SBI specification version
+ *
+ * Return: version id
+ */
+long sbi_get_spec_version(void)
+{
+ struct sbiret ret;
+
+ ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_GET_SPEC_VERSION,
+ 0, 0, 0, 0, 0, 0);
+ if (!ret.error)
+ if (ret.value)
+ return ret.value;
+
+ return -ENOTSUPP;
+}
+
+/**
+ * sbi_get_impl_id() - get SBI implementation ID
+ *
+ * Return: implementation ID
+ */
+int sbi_get_impl_id(void)
+{
+ struct sbiret ret;
+
+ ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_GET_IMP_ID,
+ 0, 0, 0, 0, 0, 0);
+ if (!ret.error)
+ if (ret.value)
+ return ret.value;
+
+ return -ENOTSUPP;
+}
+
+/**
* sbi_probe_extension() - Check if an SBI extension ID is supported or not.
* @extid: The extension ID to be probed.
*
{
typedef void __noreturn (*image_entry_riscv_t)(ulong hart, void *dtb);
void *fdt_blob;
- int ret;
+ __maybe_unused int ret;
#if CONFIG_IS_ENABLED(LOAD_FIT) || CONFIG_IS_ENABLED(LOAD_FIT_FULL)
fdt_blob = spl_image->fdt_addr;
__u_boot_sandbox_option_start = .;
_u_boot_sandbox_getopt : { KEEP(*(.u_boot_sandbox_getopt)) }
__u_boot_sandbox_option_end = .;
-
- __bss_start = .;
}
INSERT AFTER .data;
{
*(.__efi_runtime_rel_stop)
}
-
- __bss_start = .;
}
INSERT BEFORE .data;
};
bind-test {
+ compatible = "simple-bus";
bind-test-child1 {
compatible = "sandbox,phy";
#phy-cells = <1>;
reg = <0x2c>;
compatible = "i2c-eeprom";
sandbox,emul = <&emul_eeprom>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ bootcount_i2c: bootcount@10 {
+ reg = <10 2>;
+ };
+ };
};
rtc_0: rtc@43 {
offset = <0x13>;
};
+ bootcount {
+ compatible = "u-boot,bootcount-i2c-eeprom";
+ i2c-eeprom = <&bootcount_i2c>;
+ };
+
adc@0 {
compatible = "sandbox,adc";
vdd-supply = <&buck2>;
--- /dev/null
+if TARGET_TOTAL_COMPUTE
+
+config SYS_BOARD
+ default "total_compute"
+
+config SYS_VENDOR
+ default "armltd"
+
+config SYS_CONFIG_NAME
+ default "total_compute"
+
+endif
--- /dev/null
+TOTAL_COMPUTE BOARD
+M: Usama Arif <usama.arif@arm.com>
+S: Maintained
+F: board/armltd/total_compute/
+F: include/configs/total_compute.h
+F: configs/total_compute_defconfig
+F: arch/arm/dts/total_compute.dts
--- /dev/null
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2020 Arm Limited
+# Usama Arif <usama.arif@arm.com>
+
+obj-y := total_compute.o
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2020 Arm Limited
+ * Usama Arif <usama.arif@arm.com>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <dm/platform_data/serial_pl01x.h>
+#include <asm/armv8/mmu.h>
+
+static const struct pl01x_serial_platdata serial_platdata = {
+ .base = UART0_BASE,
+ .type = TYPE_PL011,
+ .clock = CONFIG_PL011_CLOCK,
+};
+
+U_BOOT_DEVICE(total_compute_serials) = {
+ .name = "serial_pl01x",
+ .platdata = &serial_platdata,
+};
+
+static struct mm_region total_compute_mem_map[] = {
+ {
+ .virt = 0x0UL,
+ .phys = 0x0UL,
+ .size = 0x80000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ .virt = 0x80000000UL,
+ .phys = 0x80000000UL,
+ .size = 0xff80000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE
+ }, {
+ /* List terminator */
+ 0,
+ }
+};
+
+struct mm_region *mem_map = total_compute_mem_map;
+
+int board_init(void)
+{
+ return 0;
+}
+
+int dram_init(void)
+{
+ gd->ram_size = PHYS_SDRAM_1_SIZE;
+ return 0;
+}
+
+int dram_init_banksize(void)
+{
+ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+
+ return 0;
+}
+
+/* Nothing to be done here as handled by PSCI interface */
+void reset_cpu(ulong addr)
+{
+}
F: arch/riscv/dts/k210.dtsi
F: arch/riscv/dts/k210-maix-bit.dts
F: board/sipeed/maix/
-F: configs/sipeed_maix_bitm_defconfig
+F: configs/sipeed_maix*_defconfig
F: doc/board/sipeed/
F: include/configs/sipeed-maix.h
F: include/dt-bindings/*/k210-sysctl.h
XEN GUEST FOR ARM64
-M: Andrii Anisov <andrii_anisov@epam.com>
+M: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
+M: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
S: Maintained
F: board/xen/xenguest_arm64/
F: doc/board/xen/
return 0;
}
-int board_early_init_f(void)
-{
- return 0;
-}
-
int print_cpuinfo(void)
{
printf("Xen virtual CPU\n");
#include <linux/sizes.h>
#include "board.h"
+#if defined(CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET)
int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
{
int ret = -EINVAL;
-
-#if defined(CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET)
struct udevice *dev;
ofnode eeprom;
debug("%s: I2C EEPROM MAC address read failed\n", __func__);
else
debug("%s: I2C EEPROM MAC %pM\n", __func__, ethaddr);
-#endif
return ret;
}
+#endif
#if defined(CONFIG_OF_BOARD) || defined(CONFIG_OF_SEPARATE)
void *board_fdt_blob_setup(void)
int board_late_init_xilinx(void)
{
- ulong initrd_hi;
+ u32 ret = 0;
+ phys_size_t bootm_size = gd->ram_size;
+
+ if (CONFIG_IS_ENABLED(ARCH_ZYNQ))
+ bootm_size = min(bootm_size, (phys_size_t)(SZ_512M + SZ_256M));
- env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET);
+ ret |= env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET);
- initrd_hi = gd->start_addr_sp - CONFIG_STACK_SIZE;
- initrd_hi = round_down(initrd_hi, SZ_16M);
- env_set_addr("initrd_high", (void *)initrd_hi);
+ ret |= env_set_addr("bootm_low", (void *)gd->ram_base);
+ ret |= env_set_addr("bootm_size", (void *)bootm_size);
+
+ if (ret)
+ printf("%s: Saving run time variables FAILED\n", __func__);
return 0;
}
--- /dev/null
+# Copyright (c) 2020, Xilinx, Inc.
+#
+# SPDX-License-Identifier: GPL-2.0
+
+if ARCH_VERSAL
+
+config CMD_VERSAL
+ bool "Enable Versal specific commands"
+ default y
+ depends on ZYNQMP_FIRMWARE
+ help
+ Enable Versal specific commands.
+
+endif
#
obj-y := board.o
+obj-$(CONFIG_CMD_VERSAL) += cmds.o
obj-y += ../common/board.o
return 0;
}
+ if (!CONFIG_IS_ENABLED(ENV_VARS_UBOOT_RUNTIME_CONFIG))
+ return 0;
+
bootmode = versal_get_bootmode();
puts("Bootmode: ");
int dram_init(void)
{
- if (fdtdec_setup_mem_size_base() != 0)
+ if (fdtdec_setup_mem_size_base_lowest() != 0)
return -EINVAL;
return 0;
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * (C) Copyright 2020 Xilinx, Inc.
+ * Michal Simek <michal.simek@xilinx.com>
+ */
+
+#include <cpu_func.h>
+#include <command.h>
+#include <common.h>
+#include <log.h>
+#include <memalign.h>
+#include <versalpl.h>
+#include <zynqmp_firmware.h>
+
+static int do_versal_load_pdi(struct cmd_tbl *cmdtp, int flag, int argc,
+ char * const argv[])
+{
+ u32 buf_lo, buf_hi;
+ u32 ret_payload[PAYLOAD_ARG_CNT];
+ ulong addr, *pdi_buf;
+ size_t len;
+ int ret;
+
+ if (argc != cmdtp->maxargs) {
+ debug("pdi_load: incorrect parameters passed\n");
+ return CMD_RET_USAGE;
+ }
+
+ addr = simple_strtol(argv[2], NULL, 16);
+ if (!addr) {
+ debug("pdi_load: zero pdi_data address\n");
+ return CMD_RET_USAGE;
+ }
+
+ len = simple_strtoul(argv[3], NULL, 16);
+ if (!len) {
+ debug("pdi_load: zero size\n");
+ return CMD_RET_USAGE;
+ }
+
+ pdi_buf = (ulong *)ALIGN((ulong)addr, ARCH_DMA_MINALIGN);
+ if ((ulong)addr != (ulong)pdi_buf) {
+ memcpy((void *)pdi_buf, (void *)addr, len);
+ debug("Pdi addr:0x%lx aligned to 0x%lx\n",
+ addr, (ulong)pdi_buf);
+ }
+
+ flush_dcache_range((ulong)pdi_buf, (ulong)pdi_buf + len);
+
+ buf_lo = lower_32_bits((ulong)pdi_buf);
+ buf_hi = upper_32_bits((ulong)pdi_buf);
+
+ ret = xilinx_pm_request(VERSAL_PM_LOAD_PDI, VERSAL_PM_PDI_TYPE, buf_lo,
+ buf_hi, 0, ret_payload);
+ if (ret)
+ printf("PDI load failed with err: 0x%08x\n", ret);
+
+ return ret;
+}
+
+static struct cmd_tbl cmd_versal_sub[] = {
+ U_BOOT_CMD_MKENT(loadpdi, 4, 1, do_versal_load_pdi, "", ""),
+};
+
+/**
+ * do_versal - Handle the "versal" command-line command
+ * @cmdtp: Command data struct pointer
+ * @flag: Command flag
+ * @argc: Command-line argument count
+ * @argv: Array of command-line arguments
+ *
+ * Processes the versal specific commands
+ *
+ * Return: return 0 on success, Error value if command fails.
+ * CMD_RET_USAGE incase of incorrect/missing parameters.
+ */
+static int do_versal(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
+{
+ struct cmd_tbl *c;
+ int ret = CMD_RET_USAGE;
+
+ if (argc < 2)
+ return CMD_RET_USAGE;
+
+ c = find_cmd_tbl(argv[1], &cmd_versal_sub[0],
+ ARRAY_SIZE(cmd_versal_sub));
+ if (c)
+ ret = c->cmd(c, flag, argc, argv);
+
+ return cmd_process_error(c, ret);
+}
+
+#ifdef CONFIG_SYS_LONGHELP
+static char versal_help_text[] =
+ "loadpdi addr len - Load pdi image\n"
+ "load pdi image at ddr address 'addr' with pdi image size 'len'\n"
+;
+#endif
+
+U_BOOT_CMD(versal, 4, 1, do_versal,
+ "versal sub-system",
+ versal_help_text
+)
+
#include <common.h>
#include <init.h>
+#include <log.h>
#include <dm/uclass.h>
#include <env.h>
#include <fdtdec.h>
char *new_targets;
char *env_targets;
+ if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
+ debug("Saved variables - Skipping\n");
+ return 0;
+ }
+
+ if (!CONFIG_IS_ENABLED(ENV_VARS_UBOOT_RUNTIME_CONFIG))
+ return 0;
+
switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) {
case ZYNQ_BM_QSPI:
mode = "qspi";
};
#endif
-int chip_id(unsigned char id)
-{
- struct pt_regs regs;
- int val = -EINVAL;
-
- if (current_el() != 3) {
- regs.regs[0] = ZYNQMP_SIP_SVC_CSU_DMA_CHIPID;
- regs.regs[1] = 0;
- regs.regs[2] = 0;
- regs.regs[3] = 0;
-
- smc_call(®s);
-
- /*
- * SMC returns:
- * regs[0][31:0] = status of the operation
- * regs[0][63:32] = CSU.IDCODE register
- * regs[1][31:0] = CSU.version register
- * regs[1][63:32] = CSU.IDCODE2 register
- */
- switch (id) {
- case IDCODE:
- regs.regs[0] = upper_32_bits(regs.regs[0]);
- regs.regs[0] &= ZYNQMP_CSU_IDCODE_DEVICE_CODE_MASK |
- ZYNQMP_CSU_IDCODE_SVD_MASK;
- regs.regs[0] >>= ZYNQMP_CSU_IDCODE_SVD_SHIFT;
- val = regs.regs[0];
- break;
- case VERSION:
- regs.regs[1] = lower_32_bits(regs.regs[1]);
- regs.regs[1] &= ZYNQMP_CSU_SILICON_VER_MASK;
- val = regs.regs[1];
- break;
- case IDCODE2:
- regs.regs[1] = lower_32_bits(regs.regs[1]);
- regs.regs[1] >>= ZYNQMP_CSU_VERSION_EMPTY_SHIFT;
- val = regs.regs[1];
- break;
- default:
- printf("%s, Invalid Req:0x%x\n", __func__, id);
- }
- } else {
- switch (id) {
- case IDCODE:
- val = readl(ZYNQMP_CSU_IDCODE_ADDR);
- val &= ZYNQMP_CSU_IDCODE_DEVICE_CODE_MASK |
- ZYNQMP_CSU_IDCODE_SVD_MASK;
- val >>= ZYNQMP_CSU_IDCODE_SVD_SHIFT;
- break;
- case VERSION:
- val = readl(ZYNQMP_CSU_VER_ADDR);
- val &= ZYNQMP_CSU_SILICON_VER_MASK;
- break;
- default:
- printf("%s, Invalid Req:0x%x\n", __func__, id);
- }
- }
-
- return val;
-}
-
#define ZYNQMP_VERSION_SIZE 9
#define ZYNQMP_PL_STATUS_BIT 9
#define ZYNQMP_IPDIS_VCU_BIT 8
u32 i, id, ver, j;
char *buf;
static char name[ZYNQMP_VERSION_SIZE];
+ u32 ret_payload[PAYLOAD_ARG_CNT];
+
+ xilinx_pm_request(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload);
+
+ /*
+ * Firmware returns:
+ * payload[0][31:0] = status of the operation
+ * payload[1]] = IDCODE
+ * payload[2][19:0] = Version
+ * payload[2][28:20] = EXTENDED_IDCODE
+ * payload[2][29] = PL_INIT
+ */
+
+ /* Get IDCODE field */
+ id = ret_payload[1];
+ id &= ZYNQMP_CSU_IDCODE_DEVICE_CODE_MASK | ZYNQMP_CSU_IDCODE_SVD_MASK;
+ id >>= ZYNQMP_CSU_IDCODE_SVD_SHIFT;
- id = chip_id(IDCODE);
- ver = chip_id(IDCODE2);
+ /* Shift silicon version info */
+ ver = ret_payload[2] >> ZYNQMP_CSU_VERSION_EMPTY_SHIFT;
+
+ debug("%s, ID: 0x%0X, Ver: 0x%0X\r\n", __func__, id, ver);
for (i = 0; i < ARRAY_SIZE(zynqmp_devices); i++) {
if (zynqmp_devices[i].id == id) {
#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ZYNQMPPL) && \
!defined(CONFIG_SPL_BUILD) || (defined(CONFIG_SPL_FPGA_SUPPORT) && \
defined(CONFIG_SPL_BUILD))
- if (current_el() != 3) {
- zynqmppl.name = zynqmp_get_silicon_idcode_name();
- printf("Chip ID:\t%s\n", zynqmppl.name);
- fpga_init();
- fpga_add(fpga_xilinx, &zynqmppl);
- }
+ zynqmppl.name = zynqmp_get_silicon_idcode_name();
+ printf("Chip ID:\t%s\n", zynqmppl.name);
+ fpga_init();
+ fpga_add(fpga_xilinx, &zynqmppl);
#endif
if (current_el() == 3)
char *compatible, *fdtfile;
const char *suffix = ".dtb";
const char *vendor = "xilinx/";
+ int fdt_compat_len;
if (env_get("fdtfile"))
return 0;
- compatible = (char *)fdt_getprop(gd->fdt_blob, 0, "compatible", NULL);
- if (compatible) {
+ compatible = (char *)fdt_getprop(gd->fdt_blob, 0, "compatible",
+ &fdt_compat_len);
+ if (compatible && fdt_compat_len) {
+ char *name;
+
debug("Compatible: %s\n", compatible);
- /* Discard vendor prefix */
- strsep(&compatible, ",");
+ name = strchr(compatible, ',');
+ if (!name)
+ return -EINVAL;
- fdtfile = calloc(1, strlen(vendor) + strlen(compatible) +
+ name++;
+
+ fdtfile = calloc(1, strlen(vendor) + strlen(name) +
strlen(suffix) + 1);
if (!fdtfile)
return -ENOMEM;
- sprintf(fdtfile, "%s%s%s", vendor, compatible, suffix);
+ sprintf(fdtfile, "%s%s%s", vendor, name, suffix);
env_set("fdtfile", fdtfile);
free(fdtfile);
return 0;
}
+ if (!CONFIG_IS_ENABLED(ENV_VARS_UBOOT_RUNTIME_CONFIG))
+ return 0;
+
ret = set_fdtfile();
if (ret)
return ret;
help
Read system EEPROM data block in ONIE Tlvinfo format from SPL.
+config CMD_SBI
+ bool "sbi"
+ depends on RISCV_SMODE && SBI_V02
+ help
+ Display information about the SBI implementation.
+
endmenu
menu "Boot commands"
#include <dm.h>
#include <dm/device-internal.h>
#include <dm/lists.h>
+#include <dm/root.h>
#include <dm/uclass-internal.h>
static int bind_by_class_index(const char *uclass, int index,
}
ofnode = ofnode_path(path);
- ret = device_bind_with_driver_data(parent, drv, ofnode_get_name(ofnode),
- 0, ofnode, &dev);
+ ret = lists_bind_fdt(parent, ofnode, &dev, false);
+
if (!dev || ret) {
printf("Unable to bind. err:%d\n", ret);
return ret;
/**
* do_bootefi_exec() - execute EFI binary
*
+ * The image indicated by @handle is started. When it returns the allocated
+ * memory for the @load_options is freed.
+ *
* @handle: handle of loaded image
+ * @load_options: load options
* Return: status code
*
* Load the EFI binary into a newly assigned memory unwinding the relocation
clkp = dev_get_clk_ptr(dev);
if (device_get_uclass_id(dev) == UCLASS_CLK && clkp) {
+ depth++;
rate = clk_get_rate(clkp);
- printf(" %-12u %8d ", rate, clkp->enable_count);
-
- for (i = depth; i >= 0; i--) {
- is_last = (last_flag >> i) & 1;
- if (i) {
- if (is_last)
- printf(" ");
- else
- printf("| ");
- } else {
- if (is_last)
- printf("`-- ");
- else
- printf("|-- ");
+ printf(" %-12u %8d ", rate, clkp->enable_count);
+
+ for (i = depth; i >= 0; i--) {
+ is_last = (last_flag >> i) & 1;
+ if (i) {
+ if (is_last)
+ printf(" ");
+ else
+ printf("| ");
+ } else {
+ if (is_last)
+ printf("`-- ");
+ else
+ printf("|-- ");
+ }
}
- }
- printf("%s\n", dev->name);
+ printf("%s\n", dev->name);
}
list_for_each_entry(child, &dev->child_head, sibling_node) {
is_last = list_is_last(&child->sibling_node, &dev->child_head);
- show_clks(child, depth + 1, (last_flag << 1) | is_last);
+ show_clks(child, depth, (last_flag << 1) | is_last);
}
}
srcbz = srcdesc->blksz;
destbz = destdesc->blksz;
- if ((srcbz * (buffersize / srcbz) != buffersize) &&
+ if ((srcbz * (buffersize / srcbz) != buffersize) ||
(destbz * (buffersize / destbz) != buffersize)) {
printf("failed: cannot match device block sizes\n");
return 1;
switch (unit[0]) {
case 'g':
case 'G':
- requested *= 1024;
+ requested *= 1024 * 1024 * 1024;
+ break;
case 'm':
case 'M':
- requested *= 1024;
+ requested *= 1024 * 1024;
+ break;
case 'k':
case 'K':
requested *= 1024;
argc--;
argv++;
addr = simple_strtoul(argv[0], &ep, 16);
- if (*ep != ',')
+ if (*ep != ':')
return CMD_RET_USAGE;
/* 0 should be allowed for delete */
# SPDX-License-Identifier: GPL-2.0+
obj-$(CONFIG_CMD_EXCEPTION) += exception.o
+obj-$(CONFIG_CMD_SBI) += sbi.o
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * The 'sbi' command displays information about the SBI implementation.
+ *
+ * Copyright (c) 2020, Heinrich Schuchardt <xypron.glpk@gmx.de>
+ */
+
+#include <common.h>
+#include <command.h>
+#include <asm/sbi.h>
+
+struct sbi_ext {
+ const u32 id;
+ const char *name;
+};
+
+static struct sbi_ext extensions[] = {
+ { 0x00000000, "sbi_set_timer" },
+ { 0x00000001, "sbi_console_putchar" },
+ { 0x00000002, "sbi_console_getchar" },
+ { 0x00000003, "sbi_clear_ipi" },
+ { 0x00000004, "sbi_send_ipi" },
+ { 0x00000005, "sbi_remote_fence_i" },
+ { 0x00000006, "sbi_remote_sfence_vma" },
+ { 0x00000007, "sbi_remote_sfence_vma_asid" },
+ { 0x00000008, "sbi_shutdown" },
+ { 0x00000010, "SBI Base Functionality" },
+ { 0x54494D45, "Timer Extension" },
+ { 0x00735049, "IPI Extension" },
+ { 0x52464E43, "RFENCE Extension" },
+ { 0x0048534D, "Hart State Management Extension" },
+};
+
+static int do_sbi(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
+{
+ int i;
+ long ret;
+
+ ret = sbi_get_spec_version();
+ if (ret >= 0)
+ printf("SBI %ld.%ld\n", ret >> 24, ret & 0xffffff);
+ ret = sbi_get_impl_id();
+ if (ret >= 0) {
+ switch (ret) {
+ case 0:
+ printf("Berkeley Boot Loader (BBL)\n");
+ break;
+ case 1:
+ printf("OpenSBI\n");
+ break;
+ case 2:
+ printf("Xvisor\n");
+ break;
+ case 3:
+ printf("KVM\n");
+ break;
+ default:
+ printf("Unknown implementation\n");
+ break;
+ }
+ }
+ printf("Extensions:\n");
+ for (i = 0; i < ARRAY_SIZE(extensions); ++i) {
+ ret = sbi_probe_extension(extensions[i].id);
+ if (ret > 0)
+ printf(" %s\n", extensions[i].name);
+ }
+ return 0;
+}
+
+#ifdef CONFIG_SYS_LONGHELP
+static char sbi_help_text[] =
+ "- display SBI spec version, implementation, and available extensions";
+
+#endif
+
+U_BOOT_CMD_COMPLETE(
+ sbi, 1, 0, do_sbi,
+ "display SBI information",
+ sbi_help_text, NULL
+);
removed (for example a USB keyboard) then this option can be
enabled to ensure this is handled correctly.
+config SPL_SYS_STDIO_DEREGISTER
+ bool "Allow deregistering stdio devices in SPL"
+ help
+ Generally there is no need to deregister stdio devices since they
+ are never deactivated. But if a stdio device is used which can be
+ removed (for example a USB keyboard) then this option can be
+ enabled to ensure this is handled correctly. This is very rarely
+ needed in SPL.
+
+config SYS_DEVICE_NULLDEV
+ bool "Enable a null device for stdio"
+ default y if SPLASH_SCREEN || SYS_STDIO_DEREGISTER
+ help
+ Enable creation of a "nulldev" stdio device. This allows silent
+ operation of the console by setting stdout to "nulldev". Enable
+ this to use a serial console under board control.
+
endmenu
menu "Logging"
config AVB_VERIFY
bool "Build Android Verified Boot operations"
- depends on LIBAVB && FASTBOOT
+ depends on LIBAVB
depends on PARTITION_UUIDS
help
This option enables compilation of bootloader-dependent operations,
* Helpers to access MMC, similar to drivers/fastboot/fb_mmc.c.
* Helpers to alloc/init/free avb ops.
+if AVB_VERIFY
+
+config AVB_BUF_ADDR
+ hex "Define AVB buffer address"
+ default FASTBOOT_BUF_ADDR
+ help
+ AVB requires a buffer for memory transactions. This variable defines the
+ buffer address.
+
+config AVB_BUF_SIZE
+ hex "Define AVB buffer SIZE"
+ default FASTBOOT_BUF_SIZE
+ help
+ AVB requires a buffer for memory transactions. This variable defines the
+ buffer size.
+
+endif # AVB_VERIFY
+
config SPL_HASH
bool # "Support hashing API (SHA1, SHA256, etc.)"
help
#include <avb_verify.h>
#include <blk.h>
#include <cpu_func.h>
-#include <fastboot.h>
#include <image.h>
#include <malloc.h>
#include <part.h>
static int init_func_i2c(void)
{
puts("I2C: ");
-#ifdef CONFIG_SYS_I2C
i2c_init_all();
-#else
- i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-#endif
puts("ready\n");
return 0;
}
#include <stdio_dev.h>
#include <serial.h>
#include <splash.h>
-
-#if defined(CONFIG_SYS_I2C)
#include <i2c.h>
-#endif
#include <dm/device-internal.h>
struct stdio_dev *stdio_devices[] = { NULL, NULL, NULL };
char *stdio_names[MAX_FILES] = { "stdin", "stdout", "stderr" };
-#if defined(CONFIG_SPLASH_SCREEN) && !defined(CONFIG_SYS_DEVICE_NULLDEV)
-#define CONFIG_SYS_DEVICE_NULLDEV 1
-#endif
-
-#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
-#define CONFIG_SYS_DEVICE_NULLDEV 1
-#endif
-
-#ifdef CONFIG_SYS_DEVICE_NULLDEV
static void nulldev_putc(struct stdio_dev *dev, const char c)
{
/* nulldev is empty! */
/* nulldev is empty! */
return 0;
}
-#endif
static void stdio_serial_putc(struct stdio_dev *dev, const char c)
{
dev.tstc = stdio_serial_tstc;
stdio_register (&dev);
-#ifdef CONFIG_SYS_DEVICE_NULLDEV
- memset (&dev, 0, sizeof (dev));
+ if (CONFIG_IS_ENABLED(SYS_DEVICE_NULLDEV)) {
+ memset(&dev, '\0', sizeof(dev));
- strcpy (dev.name, "nulldev");
- dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT;
- dev.putc = nulldev_putc;
- dev.puts = nulldev_puts;
- dev.getc = nulldev_input;
- dev.tstc = nulldev_input;
+ strcpy(dev.name, "nulldev");
+ dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT;
+ dev.putc = nulldev_putc;
+ dev.puts = nulldev_puts;
+ dev.getc = nulldev_input;
+ dev.tstc = nulldev_input;
- stdio_register (&dev);
-#endif
+ stdio_register(&dev);
+ }
}
/**************************************************************************
*/
struct list_head* stdio_get_list(void)
{
- return &(devs.list);
+ return &devs.list;
}
-#ifdef CONFIG_DM_VIDEO
/**
* stdio_probe_device() - Find a device which provides the given stdio device
*
return 0;
}
-#endif
struct stdio_dev *stdio_get_by_name(const char *name)
{
if (!name)
return NULL;
- list_for_each(pos, &(devs.list)) {
+ list_for_each(pos, &devs.list) {
sdev = list_entry(pos, struct stdio_dev, list);
if (strcmp(sdev->name, name) == 0)
return sdev;
}
-#ifdef CONFIG_DM_VIDEO
- /*
- * We did not find a suitable stdio device. If there is a video
- * driver with a name starting with 'vidconsole', we can try probing
- * that in the hope that it will produce the required stdio device.
- *
- * This function is sometimes called with the entire value of
- * 'stdout', which may include a list of devices separate by commas.
- * Obviously this is not going to work, so we ignore that case. The
- * call path in that case is console_init_r() -> search_device() ->
- * stdio_get_by_name().
- */
- if (!strncmp(name, "vidconsole", 10) && !strchr(name, ',') &&
- !stdio_probe_device(name, UCLASS_VIDEO, &sdev))
- return sdev;
-#endif
+ if (IS_ENABLED(CONFIG_DM_VIDEO)) {
+ /*
+ * We did not find a suitable stdio device. If there is a video
+ * driver with a name starting with 'vidconsole', we can try
+ * probing that in the hope that it will produce the required
+ * stdio device.
+ *
+ * This function is sometimes called with the entire value of
+ * 'stdout', which may include a list of devices separate by
+ * commas. Obviously this is not going to work, so we ignore
+ * that case. The call path in that case is
+ * console_init_r() -> search_device() -> stdio_get_by_name()
+ */
+ if (!strncmp(name, "vidconsole", 10) && !strchr(name, ',') &&
+ !stdio_probe_device(name, UCLASS_VIDEO, &sdev))
+ return sdev;
+ }
return NULL;
}
-struct stdio_dev* stdio_clone(struct stdio_dev *dev)
+struct stdio_dev *stdio_clone(struct stdio_dev *dev)
{
struct stdio_dev *_dev;
- if(!dev)
+ if (!dev)
return NULL;
_dev = calloc(1, sizeof(struct stdio_dev));
-
- if(!_dev)
+ if (!_dev)
return NULL;
memcpy(_dev, dev, sizeof(struct stdio_dev));
struct stdio_dev *_dev;
_dev = stdio_clone(dev);
- if(!_dev)
+ if (!_dev)
return -ENODEV;
- list_add_tail(&(_dev->list), &(devs.list));
+ list_add_tail(&_dev->list, &devs.list);
if (devp)
*devp = _dev;
return stdio_register_dev(dev, NULL);
}
-/* deregister the device "devname".
- * returns 0 if success, -1 if device is assigned and 1 if devname not found
- */
-#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
int stdio_deregister_dev(struct stdio_dev *dev, int force)
{
- int l;
struct list_head *pos;
char temp_names[3][16];
+ int i;
/* get stdio devices (ListRemoveItem changes the dev list) */
- for (l=0 ; l< MAX_FILES; l++) {
- if (stdio_devices[l] == dev) {
+ for (i = 0 ; i < MAX_FILES; i++) {
+ if (stdio_devices[i] == dev) {
if (force) {
- strcpy(temp_names[l], "nulldev");
+ strcpy(temp_names[i], "nulldev");
continue;
}
/* Device is assigned -> report error */
- return -1;
+ return -EBUSY;
}
- memcpy (&temp_names[l][0],
- stdio_devices[l]->name,
- sizeof(temp_names[l]));
+ memcpy(&temp_names[i][0], stdio_devices[i]->name,
+ sizeof(temp_names[i]));
}
- list_del(&(dev->list));
+ list_del(&dev->list);
free(dev);
- /* reassign Device list */
- list_for_each(pos, &(devs.list)) {
+ /* reassign device list */
+ list_for_each(pos, &devs.list) {
dev = list_entry(pos, struct stdio_dev, list);
- for (l=0 ; l< MAX_FILES; l++) {
- if(strcmp(dev->name, temp_names[l]) == 0)
- stdio_devices[l] = dev;
+ for (i = 0 ; i < MAX_FILES; i++) {
+ if (strcmp(dev->name, temp_names[i]) == 0)
+ stdio_devices[i] = dev;
}
}
+
return 0;
}
struct stdio_dev *dev;
dev = stdio_get_by_name(devname);
-
if (!dev) /* device not found */
return -ENODEV;
return stdio_deregister_dev(dev, force);
}
-#endif /* CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER) */
int stdio_init_tables(void)
{
#endif /* CONFIG_NEEDS_MANUAL_RELOC */
/* Initialize the list */
- INIT_LIST_HEAD(&(devs.list));
+ INIT_LIST_HEAD(&devs.list);
return 0;
}
int stdio_add_devices(void)
{
-#ifdef CONFIG_DM_KEYBOARD
struct udevice *dev;
struct uclass *uc;
int ret;
- /*
- * For now we probe all the devices here. At some point this should be
- * done only when the devices are required - e.g. we have a list of
- * input devices to start up in the stdin environment variable. That
- * work probably makes more sense when stdio itself is converted to
- * driver model.
- *
- * TODO(sjg@chromium.org): Convert changing uclass_first_device() etc.
- * to return the device even on error. Then we could use that here.
- */
- ret = uclass_get(UCLASS_KEYBOARD, &uc);
- if (ret)
- return ret;
-
- /* Don't report errors to the caller - assume that they are non-fatal */
- uclass_foreach_dev(dev, uc) {
- ret = device_probe(dev);
+ if (IS_ENABLED(CONFIG_DM_KEYBOARD)) {
+ /*
+ * For now we probe all the devices here. At some point this
+ * should be done only when the devices are required - e.g. we
+ * have a list of input devices to start up in the stdin
+ * environment variable. That work probably makes more sense
+ * when stdio itself is converted to driver model.
+ *
+ * TODO(sjg@chromium.org): Convert changing
+ * uclass_first_device() etc. to return the device even on
+ * error. Then we could use that here.
+ */
+ ret = uclass_get(UCLASS_KEYBOARD, &uc);
if (ret)
- printf("Failed to probe keyboard '%s'\n", dev->name);
+ return ret;
+
+ /*
+ * Don't report errors to the caller - assume that they are
+ * non-fatal
+ */
+ uclass_foreach_dev(dev, uc) {
+ ret = device_probe(dev);
+ if (ret)
+ printf("Failed to probe keyboard '%s'\n",
+ dev->name);
+ }
}
-#endif
#ifdef CONFIG_SYS_I2C
i2c_init_all();
-#else
#endif
-#ifdef CONFIG_DM_VIDEO
- /*
- * If the console setting is not in environment variables then
- * console_init_r() will not be calling iomux_doenv() (which calls
- * search_device()). So we will not dynamically add devices by
- * calling stdio_probe_device().
- *
- * So just probe all video devices now so that whichever one is
- * required will be available.
- */
-#ifndef CONFIG_SYS_CONSOLE_IS_IN_ENV
- struct udevice *vdev;
-# ifndef CONFIG_DM_KEYBOARD
- int ret;
-# endif
-
- for (ret = uclass_first_device(UCLASS_VIDEO, &vdev);
- vdev;
- ret = uclass_next_device(&vdev))
- ;
- if (ret)
- printf("%s: Video device failed (ret=%d)\n", __func__, ret);
-#endif /* !CONFIG_SYS_CONSOLE_IS_IN_ENV */
-#if defined(CONFIG_SPLASH_SCREEN) && defined(CONFIG_CMD_BMP)
- splash_display();
-#endif /* CONFIG_SPLASH_SCREEN && CONFIG_CMD_BMP */
-#else
-# if defined(CONFIG_LCD)
- drv_lcd_init ();
-# endif
-# if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
- drv_video_init ();
-# endif
-#endif /* CONFIG_DM_VIDEO */
+ if (IS_ENABLED(CONFIG_DM_VIDEO)) {
+ /*
+ * If the console setting is not in environment variables then
+ * console_init_r() will not be calling iomux_doenv() (which
+ * calls search_device()). So we will not dynamically add
+ * devices by calling stdio_probe_device().
+ *
+ * So just probe all video devices now so that whichever one is
+ * required will be available.
+ */
+ struct udevice *vdev;
+ int ret;
+
+ if (!IS_ENABLED(CONFIG_SYS_CONSOLE_IS_IN_ENV)) {
+ for (ret = uclass_first_device(UCLASS_VIDEO, &vdev);
+ vdev;
+ ret = uclass_next_device(&vdev))
+ ;
+ if (ret)
+ printf("%s: Video device failed (ret=%d)\n",
+ __func__, ret);
+ }
+ if (IS_ENABLED(CONFIG_SPLASH_SCREEN) &&
+ IS_ENABLED(CONFIG_CMD_BMP))
+ splash_display();
+ } else {
+ if (IS_ENABLED(CONFIG_LCD))
+ drv_lcd_init();
+ if (IS_ENABLED(CONFIG_VIDEO) || IS_ENABLED(CONFIG_CFB_CONSOLE))
+ drv_video_init();
+ }
+
#if defined(CONFIG_KEYBOARD) && !defined(CONFIG_DM_KEYBOARD)
- drv_keyboard_init ();
+ drv_keyboard_init();
#endif
- drv_system_init ();
- serial_stdio_init ();
+ drv_system_init();
+ serial_stdio_init();
#ifdef CONFIG_USB_TTY
- drv_usbtty_init ();
-#endif
-#ifdef CONFIG_NETCONSOLE
- drv_nc_init ();
+ drv_usbtty_init();
#endif
+ if (IS_ENABLED(CONFIG_NETCONSOLE))
+ drv_nc_init();
#ifdef CONFIG_JTAG_CONSOLE
- drv_jtag_console_init ();
-#endif
-#ifdef CONFIG_CBMEM_CONSOLE
- cbmemc_init();
+ drv_jtag_console_init();
#endif
+ if (IS_ENABLED(CONFIG_CBMEM_CONSOLE))
+ cbmemc_init();
return 0;
}
CONFIG_TARGET_M5249EVB=y
CONFIG_DEFAULT_DEVICE_TREE="M5249EVB"
CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_SYS_DEVICE_NULLDEV=y
# CONFIG_DISPLAY_BOARDINFO is not set
# CONFIG_CMDLINE_EDITING is not set
# CONFIG_AUTOBOOT is not set
CONFIG_USE_ENV_SPI_MAX_HZ=y
CONFIG_ENV_SPI_MAX_HZ=20000000
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_DM_PCA953X=y
CONFIG_DM_I2C=y
CONFIG_USE_ENV_SPI_MAX_HZ=y
CONFIG_ENV_SPI_MAX_HZ=20000000
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_DM_PCA953X=y
CONFIG_DM_I2C=y
# CONFIG_VIDEO_BPP32 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_DISPLAY=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_IMX_WATCHDOG=y
# CONFIG_EFI_LOADER is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_DISPLAY=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_IMX_WATCHDOG=y
# CONFIG_EFI_LOADER is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_DISPLAY=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_IMX_WATCHDOG=y
# CONFIG_EFI_LOADER is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_DISPLAY=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_IMX_WATCHDOG=y
# CONFIG_EFI_LOADER is not set
CONFIG_SYS_MMC_ENV_PART=2
CONFIG_BOOTP_SEND_HOSTNAME=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_SPL_DM=y
CONFIG_SPL_DM_SEQ_ALIAS=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_BOOTP_SEND_HOSTNAME=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_SPL_DM=y
CONFIG_SPL_DM_SEQ_ALIAS=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_BOOTP_SEND_HOSTNAME=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_SPL_DM=y
CONFIG_SPL_DM_SEQ_ALIAS=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_BOOTP_SEND_HOSTNAME=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
# CONFIG_DM_DEVICE_REMOVE is not set
CONFIG_SPL_DM_SEQ_ALIAS=y
# CONFIG_OF_TRANSLATE is not set
CONFIG_SYS_WHITE_ON_BLACK=y
# CONFIG_PANEL is not set
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT=y
CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
CONFIG_DM_VIDEO=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SOURCE=y
CONFIG_FDT_FIXUP_PARTITIONS=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_FDT_FIXUP_PARTITIONS=y
# CONFIG_VIDEO_BPP32 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_FDT_FIXUP_PARTITIONS=y
CONFIG_CI_UDC=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_ENV_VARS_UBOOT_CONFIG=y
CONFIG_USE_BOOTARGS=y
CONFIG_BOOTARGS="console=tty0 console=ttyS0,115200"
+CONFIG_SYS_DEVICE_NULLDEV=y
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_DISPLAY_BOARDINFO_LATE=y
# CONFIG_CMDLINE_EDITING is not set
# CONFIG_VIDEO_BPP8 is not set
# CONFIG_VIDEO_BPP16 is not set
CONFIG_VIDEO_FSL_DCU_FB=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_FDT_FIXUP_PARTITIONS=y
# CONFIG_EFI_UNICODE_CAPITALIZATION is not set
CONFIG_USE_ENV_SPI_MAX_HZ=y
CONFIG_ENV_SPI_MAX_HZ=20000000
CONFIG_ENV_ADDR=0x70000
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_SATA_MV=y
CONFIG_BLK=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_MVSATA_IDE=y
CONFIG_MTD=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_MVSATA_IDE=y
CONFIG_MTD=y
CONFIG_CI_UDC=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT=y
CONFIG_CI_UDC=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT=y
CONFIG_OF_CONTROL=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_MVSATA_IDE=y
CONFIG_BLK=y
CONFIG_OF_CONTROL=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
+CONFIG_NETCONSOLE=y
# CONFIG_MMC is not set
CONFIG_MTD=y
CONFIG_MTD_RAW_NAND=y
CONFIG_USE_ENV_SPI_MAX_HZ=y
CONFIG_ENV_SPI_MAX_HZ=50000000
CONFIG_ENV_ADDR=0x100000
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_MVSATA_IDE=y
CONFIG_BLK=y
CONFIG_USE_ENV_SPI_MAX_HZ=y
CONFIG_ENV_SPI_MAX_HZ=50000000
CONFIG_ENV_ADDR=0x3D0000
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_MVSATA_IDE=y
CONFIG_BLK=y
CONFIG_MII=y
CONFIG_VIDEO=y
# CONFIG_CFB_CONSOLE is not set
+CONFIG_SPLASH_SCREEN=y
CONFIG_MII=y
CONFIG_VIDEO=y
# CONFIG_CFB_CONSOLE is not set
+CONFIG_SPLASH_SCREEN=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_FLASH=y
CONFIG_ENV_ADDR=0xFFF84000
+CONFIG_NETCONSOLE=y
CONFIG_MVSATA_IDE=y
# CONFIG_MMC is not set
CONFIG_MTD_NOR_FLASH=y
CONFIG_OF_CONTROL=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_MVSATA_IDE=y
CONFIG_BLK=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_MVSATA_IDE=y
CONFIG_BLK=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_SYS_MMC_ENV_PART=1
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_DWC_AHSATA=y
CONFIG_SUPPORT_EMMC_RPMB=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_SYS_MMC_ENV_PART=1
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_DWC_AHSATA=y
CONFIG_SUPPORT_EMMC_RPMB=y
CONFIG_ENV_IS_IN_NAND=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_DWC_AHSATA=y
CONFIG_SUPPORT_EMMC_RPMB=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_MVSATA_IDE=y
# CONFIG_MMC is not set
CONFIG_MTD=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
# CONFIG_MMC is not set
CONFIG_MTD=y
CONFIG_MTD_RAW_NAND=y
# CONFIG_VIDEO_BPP32 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
# CONFIG_VIDEO_BPP32 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
# CONFIG_VIDEO_BPP32 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_IMX_WATCHDOG=y
# CONFIG_VIDEO_BPP32 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_DM_VIDEO=y
CONFIG_BACKLIGHT_GPIO=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_SHA1=y
CONFIG_SHA256=y
CONFIG_HEXDUMP=y
CONFIG_USE_ENV_SPI_MAX_HZ=y
CONFIG_ENV_SPI_MAX_HZ=20000000
CONFIG_ENV_ADDR=0x70000
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_SATA_MV=y
CONFIG_BLK=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_MESON=y
CONFIG_VIDEO_DT_SIMPLEFB=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_MESON=y
CONFIG_VIDEO_DT_SIMPLEFB=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_ENV_IS_IN_EEPROM=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_BOOTCOUNT_LIMIT=y
CONFIG_BOOTCOUNT_RAM=y
# CONFIG_MMC is not set
CONFIG_ENV_IS_IN_EEPROM=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_BOOTCOUNT_LIMIT=y
CONFIG_BOOTCOUNT_RAM=y
# CONFIG_MMC is not set
CONFIG_ENV_IS_IN_EEPROM=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_BOOTCOUNT_LIMIT=y
CONFIG_BOOTCOUNT_RAM=y
# CONFIG_MMC is not set
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_BOOTCOUNT_LIMIT=y
CONFIG_BOOTCOUNT_RAM=y
# CONFIG_MMC is not set
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_BOOTCOUNT_LIMIT=y
CONFIG_BOOTCOUNT_RAM=y
# CONFIG_MMC is not set
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_BOOTCOUNT_LIMIT=y
CONFIG_BOOTCOUNT_RAM=y
# CONFIG_MMC is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_MESON=y
CONFIG_VIDEO_DT_SIMPLEFB=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_MESON=y
CONFIG_VIDEO_DT_SIMPLEFB=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_MESON=y
CONFIG_VIDEO_DT_SIMPLEFB=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_MESON=y
CONFIG_VIDEO_DT_SIMPLEFB=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_SATA_MV=y
CONFIG_BLK=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_SATA_MV=y
CONFIG_BLK=y
# CONFIG_VIDEO_BPP32 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASHIMAGE_GUARD=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
+CONFIG_SPLASH_SOURCE=y
CONFIG_WATCHDOG_TIMEOUT_MSECS=8000
CONFIG_IMX_WATCHDOG=y
CONFIG_SYS_WHITE_ON_BLACK=y
# CONFIG_PANEL is not set
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
CONFIG_VIDEO=y
+CONFIG_SPLASH_SCREEN=y
CONFIG_OF_LIBFDT=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_SMSC95XX=y
CONFIG_VIDEO=y
+CONFIG_SPLASH_SCREEN=y
CONFIG_OF_LIBFDT=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_SMSC95XX=y
CONFIG_VIDEO=y
+CONFIG_SPLASH_SCREEN=y
CONFIG_OF_LIBFDT=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_SMSC95XX=y
CONFIG_VIDEO=y
+CONFIG_SPLASH_SCREEN=y
CONFIG_OF_LIBFDT=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_SMSC95XX=y
CONFIG_VIDEO=y
+CONFIG_SPLASH_SCREEN=y
CONFIG_OF_LIBFDT=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_SMSC95XX=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
CONFIG_OF_LIBFDT=y
CONFIG_USB_ETHER_MCS7830=y
CONFIG_USB_ETHER_SMSC95XX=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
CONFIG_OF_LIBFDT=y
CONFIG_SYS_WHITE_ON_BLACK=y
# CONFIG_PANEL is not set
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_DWC_AHSATA=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
# CONFIG_VIDEO_BPP32 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
# CONFIG_VIDEO_BPP32 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_VIDEO=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_CI_UDC=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_USB_STORAGE=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_VIDEO=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_ERRNO_STR=y
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_VIDEO=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_ERRNO_STR=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_MVSATA_IDE=y
CONFIG_BLK=y
CONFIG_USE_ENV_SPI_MAX_HZ=y
CONFIG_ENV_SPI_MAX_HZ=20000000
CONFIG_ENV_ADDR=0x70000
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_SATA_MV=y
CONFIG_BLK=y
CONFIG_USE_ENV_SPI_MAX_HZ=y
CONFIG_ENV_SPI_MAX_HZ=20000000
CONFIG_ENV_ADDR=0x70000
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_SATA_MV=y
CONFIG_BLK=y
CONFIG_USE_ENV_SPI_MAX_HZ=y
CONFIG_ENV_SPI_MAX_HZ=20000000
CONFIG_ENV_ADDR=0x70000
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_SATA_MV=y
CONFIG_BLK=y
CONFIG_USE_ENV_SPI_MAX_HZ=y
CONFIG_ENV_SPI_MAX_HZ=20000000
CONFIG_ENV_ADDR=0x70000
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_SATA_MV=y
CONFIG_BLK=y
CONFIG_USE_ENV_SPI_MAX_HZ=y
CONFIG_ENV_SPI_MAX_HZ=20000000
CONFIG_ENV_ADDR=0x70000
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_SATA_MV=y
CONFIG_BLK=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0x12000000
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0x12000000
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_DWC_AHSATA=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_DWC_AHSATA=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0x12000000
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0x12000000
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_VIDEO=y
CONFIG_CFB_CONSOLE_ANSI=y
# CONFIG_VGA_AS_SINGLE_DEVICE is not set
+CONFIG_SPLASH_SCREEN=y
# CONFIG_GZIP is not set
CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_DWC_AHSATA=y
CONFIG_FSL_USDHC=y
# CONFIG_VIDEO_BPP32 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_MVSATA_IDE=y
# CONFIG_MMC is not set
CONFIG_MTD=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_MESON=y
CONFIG_VIDEO_DT_SIMPLEFB=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_SMBIOS_MANUFACTURER="Hardkernel Co., Ltd."
CONFIG_DM_VIDEO=y
CONFIG_VIDEO_MESON=y
CONFIG_VIDEO_DT_SIMPLEFB=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_MVSATA_IDE=y
# CONFIG_MMC_HW_PARTITIONING is not set
CONFIG_MTD=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_MVSATA_IDE=y
# CONFIG_MMC_HW_PARTITIONING is not set
CONFIG_MTD=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_MVSATA_IDE=y
# CONFIG_MMC_HW_PARTITIONING is not set
CONFIG_MTD=y
# CONFIG_VIDEO_BPP8 is not set
# CONFIG_VIDEO_BPP32 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
+CONFIG_SPLASH_SOURCE=y
CONFIG_OF_LIBFDT_OVERLAY=y
# CONFIG_EFI_LOADER is not set
CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
CONFIG_CI_UDC=y
CONFIG_VIDEO=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_CI_UDC=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
CONFIG_CI_UDC=y
CONFIG_VIDEO=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_CI_UDC=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_SYS_WHITE_ON_BLACK=y
# CONFIG_PANEL is not set
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
CONFIG_CI_UDC=y
CONFIG_VIDEO=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_CI_UDC=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_CI_UDC=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
CONFIG_CI_UDC=y
CONFIG_VIDEO=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_CI_UDC=y
CONFIG_DM_VIDEO=y
CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
# CONFIG_MMC is not set
CONFIG_MTD=y
CONFIG_MTD_RAW_NAND=y
# CONFIG_VIDEO_SW_CURSOR is not set
CONFIG_SYS_CONSOLE_BG_COL=0xff
CONFIG_SYS_CONSOLE_FG_COL=0x00
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_SYS_WHITE_ON_BLACK=y
# CONFIG_PANEL is not set
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT=y
CONFIG_SYS_WHITE_ON_BLACK=y
# CONFIG_PANEL is not set
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT=y
CONFIG_SPL_OF_LIBFDT=y
# CONFIG_VIDEO_SW_CURSOR is not set
CONFIG_SYS_CONSOLE_BG_COL=0xff
CONFIG_SYS_CONSOLE_FG_COL=0x00
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_VIDEO_NX_RGB=y
CONFIG_VIDEO_NX_LVDS=y
CONFIG_VIDEO_NX_HDMI=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
+CONFIG_SPLASH_SOURCE=y
CONFIG_ERRNO_STR=y
CONFIG_VIDEO_SANDBOX_SDL=y
CONFIG_OSD=y
CONFIG_SANDBOX_OSD=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_WDT=y
CONFIG_WDT_SANDBOX=y
CONFIG_FS_CBFS=y
CONFIG_DM_BOOTCOUNT_RTC=y
CONFIG_BUTTON=y
CONFIG_BUTTON_GPIO=y
+CONFIG_DM_BOOTCOUNT_I2C_EEPROM=y
CONFIG_CLK=y
CONFIG_CLK_COMPOSITE_CCF=y
CONFIG_SANDBOX_CLK_CCF=y
CONFIG_VIDEO_DSI_HOST_SANDBOX=y
CONFIG_OSD=y
CONFIG_SANDBOX_OSD=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_W1=y
CONFIG_W1_GPIO=y
CONFIG_W1_EEPROM=y
CONFIG_VIDEO_SANDBOX_SDL=y
CONFIG_OSD=y
CONFIG_SANDBOX_OSD=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_FS_CBFS=y
CONFIG_FS_CRAMFS=y
# CONFIG_SPL_USE_TINY_PRINTF is not set
CONFIG_CMD_FAT=y
CONFIG_ENV_OVERWRITE=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_MXS_GPIO=y
CONFIG_MMC_MXS=y
CONFIG_CONS_INDEX=0
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_MESON=y
CONFIG_VIDEO_DT_SIMPLEFB=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_MESON=y
CONFIG_VIDEO_DT_SIMPLEFB=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_OF_CONTROL=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_NAND=y
+CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_MVSATA_IDE=y
CONFIG_MTD=y
--- /dev/null
+CONFIG_RISCV=y
+CONFIG_SYS_TEXT_BASE=0x80020000
+CONFIG_TARGET_SIPEED_MAIX=y
+CONFIG_ARCH_RV64I=y
+CONFIG_RISCV_SMODE=y
+CONFIG_STACK_SIZE=0x100000
+# CONFIG_NET is not set
+# CONFIG_INPUT is not set
+# CONFIG_DM_ETH is not set
+# CONFIG_EFI_UNICODE_CAPITALIZATION is not set
CONFIG_VIDEO_STM32=y
CONFIG_VIDEO_STM32_MAX_XRES=480
CONFIG_VIDEO_STM32_MAX_YRES=640
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_VIDEO_STM32_DSI=y
CONFIG_VIDEO_STM32_MAX_XRES=480
CONFIG_VIDEO_STM32_MAX_YRES=800
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_OF_LIBFDT_OVERLAY=y
--- /dev/null
+CONFIG_ARM=y
+CONFIG_TARGET_TOTAL_COMPUTE=y
+CONFIG_SYS_TEXT_BASE=0xe0000000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x2a00000
+CONFIG_NR_DRAM_BANKS=2
+CONFIG_DEFAULT_DEVICE_TREE="total_compute"
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_ANDROID_BOOT_IMAGE=y
+CONFIG_FIT=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_LEGACY_IMAGE_FORMAT=y
+CONFIG_BOOTDELAY=5
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyAMA0 debug user_debug=31 earlycon=pl011,0x7ff80000 loglevel=9 androidboot.hardware=total_compute video=640x480-32@60 androidboot.boot_devices=1c050000.mmci ip=dhcp androidboot.selinux=permissive"
+# CONFIG_USE_BOOTCOMMAND is not set
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_AVB_VERIFY=y
+CONFIG_AVB_BUF_ADDR=0x90000000
+CONFIG_AVB_BUF_SIZE=0x10000000
+CONFIG_SYS_PROMPT="TOTAL_COMPUTE# "
+# CONFIG_CMD_CONSOLE is not set
+# CONFIG_CMD_XIMG is not set
+# CONFIG_CMD_EDITENV is not set
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0xff000000
+CONFIG_CMD_ARMFLASH=y
+CONFIG_CMD_GPT=y
+# CONFIG_RANDOM_UUID is not set
+# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MMC=y
+# CONFIG_CMD_ITEST is not set
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_CACHE=y
+# CONFIG_CMD_MISC is not set
+CONFIG_CMD_AVB=y
+CONFIG_CMD_UBI=y
+# CONFIG_ISO_PARTITION is not set
+CONFIG_OF_CONTROL=y
+# CONFIG_NET is not set
+CONFIG_CLK=y
+# CONFIG_MMC_WRITE is not set
+CONFIG_ARM_PL180_MMCI=y
+CONFIG_MTD=y
+CONFIG_MTD_NOR_FLASH=y
+CONFIG_FLASH_CFI_DRIVER=y
+CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
+CONFIG_SYS_FLASH_PROTECTION=y
+CONFIG_SYS_FLASH_CFI=y
+CONFIG_LIBAVB=y
+CONFIG_OF_LIBFDT_OVERLAY=y
# CONFIG_VIDEO_BPP32 is not set
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_VIDEO_IPUV3=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_ARM=y
CONFIG_POSITION_INDEPENDENT=y
+CONFIG_TARGET_XENGUEST_ARM64=y
CONFIG_SYS_TEXT_BASE=0x40080000
CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_IDENT_STRING=" xenguest"
-CONFIG_TARGET_XENGUEST_ARM64=y
CONFIG_BOOTDELAY=10
-
CONFIG_SYS_PROMPT="xenguest# "
-
-CONFIG_CMD_NET=n
-CONFIG_CMD_BDI=n
-CONFIG_CMD_BOOTD=n
-CONFIG_CMD_BOOTEFI=n
-CONFIG_CMD_BOOTEFI_HELLO_COMPILE=n
-CONFIG_CMD_ELF=n
+# CONFIG_CMD_BDI is not set
+# CONFIG_CMD_BOOTD is not set
+# CONFIG_CMD_ELF is not set
+# CONFIG_CMD_GO is not set
+# CONFIG_CMD_IMI is not set
+# CONFIG_CMD_XIMG is not set
+# CONFIG_CMD_EXPORTENV is not set
+# CONFIG_CMD_IMPORTENV is not set
+# CONFIG_CMD_EDITENV is not set
+# CONFIG_CMD_SAVEENV is not set
+# CONFIG_CMD_ENV_EXISTS is not set
+# CONFIG_CMD_CRC32 is not set
+# CONFIG_CMD_LZMADEC is not set
+# CONFIG_CMD_UNZIP is not set
+# CONFIG_CMD_LOADB is not set
+# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_PVBLOCK=y
+# CONFIG_CMD_ECHO is not set
+# CONFIG_CMD_ITEST is not set
+# CONFIG_CMD_SOURCE is not set
+# CONFIG_CMD_SETEXPR is not set
+# CONFIG_CMD_NET is not set
+# CONFIG_CMD_MISC is not set
CONFIG_CMD_EXT4=y
CONFIG_CMD_FAT=y
-CONFIG_CMD_GO=n
-CONFIG_CMD_RUN=n
-CONFIG_CMD_IMI=n
-CONFIG_CMD_IMLS=n
-CONFIG_CMD_XIMG=n
-CONFIG_CMD_EXPORTENV=n
-CONFIG_CMD_IMPORTENV=n
-CONFIG_CMD_EDITENV=n
-CONFIG_CMD_ENV_EXISTS=n
-CONFIG_CMD_MEMORY=y
-CONFIG_CMD_CRC32=n
-CONFIG_CMD_DM=n
-CONFIG_CMD_LOADB=n
-CONFIG_CMD_LOADS=n
-CONFIG_CMD_FLASH=n
-CONFIG_CMD_GPT=n
-CONFIG_CMD_FPGA=n
-CONFIG_CMD_ECHO=n
-CONFIG_CMD_ITEST=n
-CONFIG_CMD_SOURCE=n
-CONFIG_CMD_SETEXPR=n
-CONFIG_CMD_MISC=n
-CONFIG_CMD_UNZIP=n
-CONFIG_CMD_LZMADEC=n
-CONFIG_CMD_SAVEENV=n
-CONFIG_CMD_UMS=n
-
-CONFIG_CMD_PVBLOCK=y
-
-#CONFIG_USB=n
-# CONFIG_ISO_PARTITION is not set
-
-#CONFIG_EFI_PARTITION=y
-# CONFIG_EFI_LOADER is not set
-
+CONFIG_OF_BOARD=y
CONFIG_DM=y
# CONFIG_MMC is not set
-CONFIG_DM_SERIAL=y
# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
-
-CONFIG_OF_BOARD=y
-CONFIG_OF_LIBFDT=y
+CONFIG_DM_SERIAL=y
+# CONFIG_EFI_LOADER is not set
CONFIG_CMD_FAT=y
CONFIG_ENV_OVERWRITE=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NETCONSOLE=y
CONFIG_MXS_GPIO=y
CONFIG_MMC_MXS=y
CONFIG_CONS_INDEX=0
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_BOOTDELAY=5
+CONFIG_USE_PREBOOT=y
# CONFIG_DISPLAY_CPUINFO is not set
CONFIG_BOARD_EARLY_INIT_R=y
CONFIG_SYS_PROMPT="Versal> "
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_CADENCE=y
CONFIG_MISC=y
+CONFIG_I2C_EEPROM=y
+CONFIG_SYS_I2C_EEPROM_ADDR=0x0
+CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
CONFIG_MMC_IO_VOLTAGE=y
CONFIG_MMC_UHS_SUPPORT=y
CONFIG_MMC_HS400_SUPPORT=y
CONFIG_FIT_VERBOSE=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_SPL_LOAD_FIT_ADDRESS=0x10000000
+CONFIG_USE_PREBOOT=y
# CONFIG_DISPLAY_CPUINFO is not set
CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_BOARD_EARLY_INIT_R=y
CONFIG_SCSI_AHCI=y
CONFIG_SATA_CEVA=y
CONFIG_CLK_ZYNQMP=y
+CONFIG_DFU_TFTP=y
CONFIG_DFU_RAM=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_FASTBOOT_FLASH=y
- When the console devices have been initialized, "stdout" and
"stderr" are set to "nulldev", so subsequent messages are
suppressed automatically. Make sure to enable "nulldev" by
- #defining CONFIG_SYS_DEVICE_NULLDEV in your board config file.
+ enabling CONFIG_SYS_DEVICE_NULLDEV in your board defconfig file.
- When booting a linux kernel, the "bootargs" are fixed up so that
the argument "console=" will be in the command line, no matter how
Err: serial@38000000
=>
+OpenSBI
+^^^^^^^
+
+OpenSBI is an open source supervisor execution environment implementing the
+RISC-V Supervisor Binary Interface Specification [1]. One of its features is
+to intercept run-time exceptions, e.g. for unaligned access or illegal
+instructions, and to emulate the failing instructions.
+
+The OpenSBI source can be downloaded via:
+
+.. code-block:: bash
+
+ git clone https://github.com/riscv/opensbi
+
+As OpenSBI will be loaded at 0x80000000 we have to adjust the U-Boot text base.
+Furthermore we have to enable building U-Boot for S-mode::
+
+ CONFIG_SYS_TEXT_BASE=0x80020000
+ CONFIG_RISCV_SMODE=y
+
+Both settings are contained in sipeed_maix_smode_defconfig so we can build
+U-Boot with:
+
+.. code-block:: bash
+
+ make sipeed_maix_smode_defconfig
+ make
+
+To build OpenSBI with U-Boot as a payload:
+
+.. code-block:: bash
+
+ cd opensbi
+ make \
+ PLATFORM=kendryte/k210 \
+ FW_PAYLOAD=y \
+ FW_PAYLOAD_OFFSET=0x20000 \
+ FW_PAYLOAD_PATH=<path to U-Boot>/u-boot-dtb.bin
+
+The value of FW_PAYLOAD_OFFSET must match CONFIG_SYS_TEXT_BASE - 0x80000000.
+
+The file to flash is build/platform/kendryte/k210/firmware/fw_payload.bin.
+
Loading Images
^^^^^^^^^^^^^^
interrupts)
0x8801f000 0x1000 credits
========== ========= ===========
+
+Links
+-----
+
+[1] https://github.com/riscv/riscv-sbi-doc
+ RISC-V Supervisor Binary Interface Specification
--- /dev/null
+.. SPDX-License-Identifier: GPL-2.0+
+.. sectionauthor:: Patrice Chotard <patrice.chotard@st.com>
+
+Binding/unbinding a driver
+==========================
+
+This document aims to describe the bind and unbind commands.
+
+For debugging purpose, it should be useful to bind or unbind a driver from
+the U-boot command line.
+
+The unbind command calls the remove device driver callback and unbind the
+device from its driver.
+
+The bind command binds a device to its driver.
+
+In some cases it can be useful to be able to bind a device to a driver from
+the command line.
+The obvious example is for versatile devices such as USB gadget.
+Another use case is when the devices are not yet ready at startup and
+require some setup before the drivers are bound (ex: FPGA which bitsream is
+fetched from a mass storage or ethernet)
+
+usage:
+
+bind <node path> <driver>
+bind <class> <index> <driver>
+
+unbind <node path>
+unbind <class> <index>
+unbind <class> <index> <driver>
+
+Where:
+ - <node path> is the node's device tree path
+ - <class> is one of the class available in the list given by the "dm uclass"
+ command or first column of "dm tree" command.
+ - <index> is the index of the parent's node (second column of "dm tree" output).
+ - <driver> is the driver name to bind given by the "dm drivers" command or the by
+ the fourth column of "dm tree" output.
+
+example:
+
+bind usb_dev_generic 0 usb_ether
+unbind usb_dev_generic 0 usb_ether
+or
+unbind eth 1
+
+bind /ocp/omap_dwc3@48380000/usb@48390000 usb_ether
+unbind /ocp/omap_dwc3@48380000/usb@48390000
.. toctree::
:maxdepth: 2
+ bind
debugging
design
ethernet
120832 bytes read in 7 ms (16.5 MiB/s)
=> bootefi ${kernel_addr_r} ${fdt_addr_r}
+The bootefi command uses the device, the file name, and the file size
+(environment variable 'filesize') of the most recently loaded file when setting
+up the binary for execution. So the UEFI binary should be loaded last.
+
The environment variable 'bootargs' is passed as load options in the UEFI system
table. The Linux kernel EFI stub uses the load options as command line
arguments.
Now in U-Boot install the keys on your board::
fatload mmc 0:1 <tmpaddr> PK.auth
- setenv -e -nv -bs -rt -at -i <tmpaddr>,$filesize PK
+ setenv -e -nv -bs -rt -at -i <tmpaddr>:$filesize PK
fatload mmc 0:1 <tmpaddr> KEK.auth
- setenv -e -nv -bs -rt -at -i <tmpaddr>,$filesize KEK
+ setenv -e -nv -bs -rt -at -i <tmpaddr>:$filesize KEK
fatload mmc 0:1 <tmpaddr> db.auth
- setenv -e -nv -bs -rt -at -i <tmpaddr>,$filesize db
+ setenv -e -nv -bs -rt -at -i <tmpaddr>:$filesize db
Set up boot parameters on your board::
Executing the boot manager
~~~~~~~~~~~~~~~~~~~~~~~~~~
-The UEFI specification foresees to define boot entries and boot sequence via UEFI
-variables. Booting according to these variables is possible via::
+The UEFI specification foresees to define boot entries and boot sequence via
+UEFI variables. Booting according to these variables is possible via::
bootefi bootmgr [fdt address]
-As of U-Boot v2018.03 UEFI variables are not persisted and cannot be set at
-runtime.
+As of U-Boot v2020.10 UEFI variables cannot be set at runtime. The U-Boot
+command 'efidebug' can be used to set the variables.
Executing the built in hello world application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
board_ahci_enable();
- ahci_probe_scsi(dev, (ulong)devfdt_get_addr_ptr(dev));
+ ahci_probe_scsi(dev, dev_read_addr(dev));
return 0;
}
/*
* MTK SATA platform driver
*
- * (C) Copyright 2020
- * Mediatek
+ * Copyright (C) 2020 MediaTek Inc.
*
- * Author: Frank Wunderlich <frank-w@public-files.de>
- * based on https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/ata/ahci_mtk.c
* Author: Ryder Lee <ryder.lee@mediatek.com>
+ * Author: Frank Wunderlich <frank-w@public-files.de>
*/
#include <common.h>
{
struct ast2500_clk_priv *priv = dev_get_priv(dev);
- priv->scu = devfdt_get_addr_ptr(dev);
- if (IS_ERR(priv->scu))
- return PTR_ERR(priv->scu);
+ priv->scu = dev_read_addr_ptr(dev);
+ if (!priv->scu)
+ return -EINVAL;
return 0;
}
dev = dev_get_parent(dev);
- plat->reg_base = (struct at91_pmc *)devfdt_get_addr_ptr(dev);
+ plat->reg_base = dev_read_addr_ptr(dev);
return 0;
}
dev_periph_container = dev_get_parent(dev);
dev_pmc = dev_get_parent(dev_periph_container);
- plat->reg_base = (struct at91_pmc *)devfdt_get_addr_ptr(dev_pmc);
+ plat->reg_base = dev_read_addr_ptr(dev_pmc);
return 0;
}
}
clk = &composite->clk;
+ clk->flags = flags;
ret = clk_register(clk, UBOOT_DM_CLK_COMPOSITE, name,
parent_names[clk_composite_get_parent(clk)]);
if (ret) {
/* register the clock */
clk = &div->clk;
+ clk->flags = flags;
ret = clk_register(clk, UBOOT_DM_CLK_CCF_DIVIDER, name, parent_name);
if (ret) {
fix->mult = mult;
fix->div = div;
clk = &fix->clk;
+ clk->flags = flags;
ret = clk_register(clk, UBOOT_DM_CLK_IMX_FIXED_FACTOR, name,
parent_name);
#endif
clk = &gate->clk;
+ clk->flags = flags;
ret = clk_register(clk, UBOOT_DM_CLK_GATE, name, parent_name);
if (ret) {
*/
#include <common.h>
-#include <asm/io.h>
-#include <malloc.h>
+#include <clk.h>
#include <clk-uclass.h>
#include <dm/device.h>
#include <dm/devres.h>
+#include <dm/uclass.h>
#include <linux/bitops.h>
+#include <malloc.h>
+#include <asm/io.h>
#include <linux/clk-provider.h>
-#include <clk.h>
-#include "clk.h"
#include <linux/err.h>
+#include "clk.h"
#define UBOOT_DM_CLK_CCF_MUX "ccf_clk_mux"
if (mux->flags & CLK_MUX_HIWORD_MASK) {
reg = mux->mask << (mux->shift + 16);
} else {
+#if CONFIG_IS_ENABLED(SANDBOX_CLK_CCF)
+ reg = mux->io_mux_val;
+#else
reg = readl(mux->reg);
+#endif
reg &= ~(mux->mask << mux->shift);
}
val = val << mux->shift;
reg |= val;
+#if CONFIG_IS_ENABLED(SANDBOX_CLK_CCF)
+ mux->io_mux_val = reg;
+#else
writel(reg, mux->reg);
+#endif
return 0;
}
+static ulong clk_mux_get_rate(struct clk *clk)
+{
+ struct clk_mux *mux = to_clk_mux(clk_dev_binded(clk) ?
+ dev_get_clk_ptr(clk->dev) : clk);
+ struct udevice *parent;
+ struct clk *pclk;
+ int err, index;
+
+ index = clk_mux_get_parent(clk);
+ if (index >= mux->num_parents)
+ return -EFAULT;
+
+ err = uclass_get_device_by_name(UCLASS_CLK, mux->parent_names[index],
+ &parent);
+ if (err)
+ return err;
+
+ pclk = dev_get_clk_ptr(parent);
+ if (!pclk)
+ return -ENODEV;
+
+ return clk_get_rate(pclk);
+}
+
const struct clk_ops clk_mux_ops = {
- .get_rate = clk_generic_get_rate,
+ .get_rate = clk_mux_get_rate,
.set_parent = clk_mux_set_parent,
};
#endif
clk = &mux->clk;
+ clk->flags = flags;
/*
* Read the current mux setup - so we assign correct parent.
*
* Changing parent would require changing internals of udevice struct
- * for the corresponding clock (to do that define .set_parent() method.
+ * for the corresponding clock (to do that define .set_parent() method).
*/
ret = clk_register(clk, UBOOT_DM_CLK_CCF_MUX, name,
parent_names[clk_mux_get_parent(clk)]);
ret = uclass_get_device_by_name(UCLASS_CLK, parent_name, &parent);
if (ret) {
- printf("%s: name: %s parent: %s [0x%p]\n",
- __func__, name, parent->name, parent);
+ printf("%s: failed to get %s device (parent of %s)\n",
+ __func__, parent_name, name);
+ } else {
+ debug("%s: name: %s parent: %s [0x%p]\n", __func__, name,
+ parent->name, parent);
}
- debug("%s: name: %s parent: %s [0x%p]\n", __func__, name, parent->name,
- parent);
-
drv = lists_driver_lookup_name(drv_name);
if (!drv) {
printf("%s: %s is not a valid driver name\n",
gate->state = 0;
clk = &gate->clk;
+ clk->flags = flags;
ret = clk_register(clk, "sandbox_clk_gate2", name, parent_name);
if (ret) {
clk_dm(SANDBOX_CLK_ECSPI_ROOT,
sandbox_clk_divider("ecspi_root", "pll3_60m", ®, 19, 6));
+ reg = 0;
+ clk_dm(SANDBOX_CLK_ECSPI0,
+ sandbox_clk_gate("ecspi0", "ecspi_root", ®, 0, 0));
+
clk_dm(SANDBOX_CLK_ECSPI1,
sandbox_clk_gate2("ecspi1", "ecspi_root", base + 0x6c, 0));
reg = BIT(28) | BIT(24) | BIT(16);
clk_dm(SANDBOX_CLK_I2C,
sandbox_clk_composite("i2c", i2c_sels, ARRAY_SIZE(i2c_sels),
- ®, 0));
+ ®, CLK_SET_RATE_UNGATE));
clk_dm(SANDBOX_CLK_I2C_ROOT,
sandbox_clk_gate2("i2c_root", "i2c", base + 0x7c, 0));
#define CLOCK_NODE_TYPE_DIV 4
#define CLOCK_NODE_TYPE_GATE 6
-enum pm_query_id {
- PM_QID_INVALID,
- PM_QID_CLOCK_GET_NAME,
- PM_QID_CLOCK_GET_TOPOLOGY,
- PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS,
- PM_QID_CLOCK_GET_PARENTS,
- PM_QID_CLOCK_GET_ATTRIBUTES,
- PM_QID_PINCTRL_GET_NUM_PINS,
- PM_QID_PINCTRL_GET_NUM_FUNCTIONS,
- PM_QID_PINCTRL_GET_NUM_FUNCTION_GROUPS,
- PM_QID_PINCTRL_GET_FUNCTION_NAME,
- PM_QID_PINCTRL_GET_FUNCTION_GROUPS,
- PM_QID_PINCTRL_GET_PIN_GROUPS,
- PM_QID_CLOCK_GET_NUM_CLOCKS,
- PM_QID_CLOCK_GET_MAX_DIVISOR,
-};
-
enum clk_type {
CLK_TYPE_OUTPUT,
CLK_TYPE_EXTERNAL,
uint n, foutiic, fvcoiic, mint;
u64 mfrac;
- n = (2215000000U + fout / 2) / fout;
if (fout < 417000000U)
n = 2 * ((2215000000U / 2 + fout / 2) / fout);
else
imx_clk_pfd("pll2_pfd0_352m", "pll2_bus", base + 0x100, 0));
clk_dm(IMX6QDL_CLK_PLL2_PFD2_396M,
imx_clk_pfd("pll2_pfd2_396m", "pll2_bus", base + 0x100, 2));
+ clk_dm(IMX6QDL_CLK_PLL6,
+ imx_clk_pllv3(IMX_PLLV3_ENET, "pll6", "osc", base + 0xe0, 0x3));
+ clk_dm(IMX6QDL_CLK_PLL6_ENET,
+ imx_clk_gate("pll6_enet", "pll6", base + 0xe0, 13));
/* CCM clocks */
base = dev_read_addr_ptr(dev);
clk_dm(IMX6QDL_CLK_I2C2,
imx_clk_gate2("i2c2", "ipg_per", base + 0x70, 8));
+ clk_dm(IMX6QDL_CLK_ENET, imx_clk_gate2("enet", "ipg", base + 0x6c, 10));
+ clk_dm(IMX6QDL_CLK_ENET_REF,
+ imx_clk_fixed_factor("enet_ref", "pll6_enet", 1, 1));
+
return 0;
}
#define UBOOT_DM_CLK_IMX_PLLV3_SYS "imx_clk_pllv3_sys"
#define UBOOT_DM_CLK_IMX_PLLV3_USB "imx_clk_pllv3_usb"
#define UBOOT_DM_CLK_IMX_PLLV3_AV "imx_clk_pllv3_av"
+#define UBOOT_DM_CLK_IMX_PLLV3_ENET "imx_clk_pllv3_enet"
#define PLL_NUM_OFFSET 0x10
#define PLL_DENOM_OFFSET 0x20
u32 enable_bit;
u32 div_mask;
u32 div_shift;
+ unsigned long ref_clock;
};
#define to_clk_pllv3(_clk) container_of(_clk, struct clk_pllv3, clk)
.set_rate = clk_pllv3_av_set_rate,
};
+static ulong clk_pllv3_enet_get_rate(struct clk *clk)
+{
+ struct clk_pllv3 *pll = to_clk_pllv3(clk);
+
+ return pll->ref_clock;
+}
+
+static const struct clk_ops clk_pllv3_enet_ops = {
+ .enable = clk_pllv3_generic_enable,
+ .disable = clk_pllv3_generic_disable,
+ .get_rate = clk_pllv3_enet_get_rate,
+};
+
struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
const char *parent_name, void __iomem *base,
u32 div_mask)
pll->div_shift = 0;
pll->powerup_set = false;
break;
+ case IMX_PLLV3_ENET:
+ drv_name = UBOOT_DM_CLK_IMX_PLLV3_ENET;
+ pll->ref_clock = 500000000;
+ break;
default:
kfree(pll);
return ERR_PTR(-ENOTSUPP);
.ops = &clk_pllv3_av_ops,
.flags = DM_FLAG_PRE_RELOC,
};
+
+U_BOOT_DRIVER(clk_pllv3_enet) = {
+ .name = UBOOT_DM_CLK_IMX_PLLV3_ENET,
+ .id = UCLASS_CLK,
+ .ops = &clk_pllv3_enet_ops,
+};
.flags = CLK_GATE_NO_SETCLR_INV | CLK_PARENT_TOPCKGEN, \
}
+static const struct mtk_gate_regs ssusb_cg_regs = {
+ .set_ofs = 0x30,
+ .clr_ofs = 0x30,
+ .sta_ofs = 0x30,
+};
+
+#define GATE_SSUSB(_id, _parent, _shift) { \
+ .id = _id, \
+ .parent = _parent, \
+ .regs = &ssusb_cg_regs, \
+ .shift = _shift, \
+ .flags = CLK_GATE_NO_SETCLR_INV | CLK_PARENT_TOPCKGEN, \
+}
+
static const struct mtk_gate sgmii_cgs[] = {
GATE_SGMII(CLK_SGMII_TX250M_EN, CLK_TOP_SSUSB_TX250M, 2),
GATE_SGMII(CLK_SGMII_RX250M_EN, CLK_TOP_SSUSB_EQ_RX250M, 3),
GATE_SGMII(CLK_SGMII_CDR_FB, CLK_TOP_SSUSB_CDR_FB, 5),
};
+static const struct mtk_gate ssusb_cgs[] = {
+ GATE_SSUSB(CLK_SSUSB_U2_PHY_1P_EN, CLK_TOP_TO_U2_PHY_1P, 0),
+ GATE_SSUSB(CLK_SSUSB_U2_PHY_EN, CLK_TOP_TO_U2_PHY, 1),
+ GATE_SSUSB(CLK_SSUSB_REF_EN, CLK_TOP_TO_USB3_REF, 5),
+ GATE_SSUSB(CLK_SSUSB_SYS_EN, CLK_TOP_TO_USB3_SYS, 6),
+ GATE_SSUSB(CLK_SSUSB_MCU_EN, CLK_TOP_AXI_SEL, 7),
+ GATE_SSUSB(CLK_SSUSB_DMA_EN, CLK_TOP_HIF_SEL, 8),
+};
+
static const struct mtk_clk_tree mt7622_clk_tree = {
.xtal_rate = 25 * MHZ,
.xtal2_rate = 25 * MHZ,
int ret = 0;
if (IS_ENABLED(CONFIG_RESET_MEDIATEK)) {
-// PCIESYS uses in linux also 0x34 = ETHSYS reset controller
ret = mediatek_reset_bind(dev, ETHSYS_HIFSYS_RST_CTRL_OFS, 1);
if (ret)
debug("Warning: failed to bind reset controller\n");
return mtk_common_clk_gate_init(dev, &mt7622_clk_tree, sgmii_cgs);
}
+static int mt7622_ssusbsys_probe(struct udevice *dev)
+{
+ return mtk_common_clk_gate_init(dev, &mt7622_clk_tree, ssusb_cgs);
+}
+
static const struct udevice_id mt7622_apmixed_compat[] = {
{ .compatible = "mediatek,mt7622-apmixedsys" },
{ }
{ }
};
+static const struct udevice_id mt7622_ssusbsys_compat[] = {
+ { .compatible = "mediatek,mt7622-ssusbsys" },
+ { }
+};
+
U_BOOT_DRIVER(mtk_mcucfg) = {
.name = "mt7622-mcucfg",
.id = UCLASS_SYSCON,
.priv_auto_alloc_size = sizeof(struct mtk_cg_priv),
.ops = &mtk_clk_gate_ops,
};
+
+U_BOOT_DRIVER(mtk_clk_ssusbsys) = {
+ .name = "mt7622-clock-ssusbsys",
+ .id = UCLASS_CLK,
+ .of_match = mt7622_ssusbsys_compat,
+ .probe = mt7622_ssusbsys_probe,
+ .priv_auto_alloc_size = sizeof(struct mtk_cg_priv),
+ .ops = &mtk_clk_gate_ops,
+};
void *devfdt_get_addr_ptr(const struct udevice *dev)
{
- return (void *)(uintptr_t)devfdt_get_addr_index(dev, 0);
+ fdt_addr_t addr = devfdt_get_addr_index(dev, 0);
+
+ return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)(uintptr_t)addr;
}
void *devfdt_remap_addr_index(const struct udevice *dev, int index)
int ofnode_read_addr_cells(ofnode node)
{
- if (ofnode_is_np(node))
+ if (ofnode_is_np(node)) {
return of_n_addr_cells(ofnode_to_np(node));
- else /* NOTE: this call should walk up the parent stack */
- return fdt_address_cells(gd->fdt_blob, ofnode_to_offset(node));
+ } else {
+ int parent = fdt_parent_offset(gd->fdt_blob,
+ ofnode_to_offset(node));
+
+ return fdt_address_cells(gd->fdt_blob, parent);
+ }
}
int ofnode_read_size_cells(ofnode node)
{
- if (ofnode_is_np(node))
+ if (ofnode_is_np(node)) {
return of_n_size_cells(ofnode_to_np(node));
- else /* NOTE: this call should walk up the parent stack */
- return fdt_size_cells(gd->fdt_blob, ofnode_to_offset(node));
+ } else {
+ int parent = fdt_parent_offset(gd->fdt_blob,
+ ofnode_to_offset(node));
+
+ return fdt_size_cells(gd->fdt_blob, parent);
+ }
}
int ofnode_read_simple_addr_cells(ofnode node)
if (!(zynqmp_power.tx_chan.dev) || !(&zynqmp_power.rx_chan.dev))
return -EINVAL;
+ debug("%s, Sending IPI message with ID: 0x%0x\n", __func__, req[0]);
msg.buf = (u32 *)req;
msg.len = req_len;
ret = mbox_send(&zynqmp_power.tx_chan, &msg);
return ret;
}
-static int send_req(const u32 *req, size_t req_len, u32 *res, size_t res_maxlen)
-{
- if (IS_ENABLED(CONFIG_SPL_BUILD) || current_el() == 3)
- return ipi_req(req, req_len, res, res_maxlen);
-
- return xilinx_pm_request(req[0], 0, 0, 0, 0, res);
-}
-
unsigned int zynqmp_firmware_version(void)
{
int ret;
* asking PMUFW again.
**/
if (pm_api_version == ZYNQMP_PM_VERSION_INVALID) {
- const u32 request[] = { PM_GET_API_VERSION };
- ret = send_req(request, ARRAY_SIZE(request), ret_payload, 2);
+ ret = xilinx_pm_request(PM_GET_API_VERSION, 0, 0, 0, 0,
+ ret_payload);
if (ret)
panic("PMUFW is not found - Please load it!\n");
*/
void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size)
{
- const u32 request[] = {
- PM_SET_CONFIGURATION,
- (u32)((u64)cfg_obj)
- };
- u32 response = 0;
int err;
+ u32 ret_payload[PAYLOAD_ARG_CNT];
printf("Loading new PMUFW cfg obj (%ld bytes)\n", size);
- err = send_req(request, ARRAY_SIZE(request), &response, 1);
+ err = xilinx_pm_request(PM_SET_CONFIGURATION, (u32)(u64)cfg_obj, 0, 0,
+ 0, ret_payload);
if (err == XST_PM_NO_ACCESS) {
printf("PMUFW no permission to change config object\n");
return;
if (err)
printf("Cannot load PMUFW configuration object (%d)\n", err);
- if (response)
- printf("PMUFW returned 0x%08x status!\n", response);
+ if (ret_payload[0])
+ printf("PMUFW returned 0x%08x status!\n", ret_payload[0]);
- if ((err || response) && IS_ENABLED(CONFIG_SPL_BUILD))
+ if ((err || ret_payload[0]) && IS_ENABLED(CONFIG_SPL_BUILD))
panic("PMUFW config object loading failed in EL3\n");
}
int __maybe_unused xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2,
u32 arg3, u32 *ret_payload)
{
- /*
- * Added SIP service call Function Identifier
- * Make sure to stay in x0 register
- */
- struct pt_regs regs;
+ debug("%s at EL%d, API ID: 0x%0x\n", __func__, current_el(), api_id);
- if (current_el() == 3) {
- printf("%s: Can't call SMC from EL3 context\n", __func__);
+ if (IS_ENABLED(CONFIG_SPL_BUILD) || current_el() == 3) {
+#if defined(CONFIG_ZYNQMP_IPI)
+ /*
+ * Use fixed payload and arg size as the EL2 call. The firmware
+ * is capable to handle PMUFW_PAYLOAD_ARG_CNT bytes but the
+ * firmware API is limited by the SMC call size
+ */
+ u32 regs[] = {api_id, arg0, arg1, arg2, arg3};
+
+ ipi_req(regs, PAYLOAD_ARG_CNT, ret_payload, PAYLOAD_ARG_CNT);
+#else
return -EPERM;
- }
-
- regs.regs[0] = PM_SIP_SVC | api_id;
- regs.regs[1] = ((u64)arg1 << 32) | arg0;
- regs.regs[2] = ((u64)arg3 << 32) | arg2;
-
- smc_call(®s);
+#endif
+ } else {
+ /*
+ * Added SIP service call Function Identifier
+ * Make sure to stay in x0 register
+ */
+ struct pt_regs regs;
+
+ regs.regs[0] = PM_SIP_SVC | api_id;
+ regs.regs[1] = ((u64)arg1 << 32) | arg0;
+ regs.regs[2] = ((u64)arg3 << 32) | arg2;
+
+ smc_call(®s);
+
+ if (ret_payload) {
+ ret_payload[0] = (u32)regs.regs[0];
+ ret_payload[1] = upper_32_bits(regs.regs[0]);
+ ret_payload[2] = (u32)regs.regs[1];
+ ret_payload[3] = upper_32_bits(regs.regs[1]);
+ ret_payload[4] = (u32)regs.regs[2];
+ }
- if (ret_payload) {
- ret_payload[0] = (u32)regs.regs[0];
- ret_payload[1] = upper_32_bits(regs.regs[0]);
- ret_payload[2] = (u32)regs.regs[1];
- ret_payload[3] = upper_32_bits(regs.regs[1]);
- ret_payload[4] = (u32)regs.regs[2];
}
-
- return regs.regs[0];
+ return (ret_payload) ? ret_payload[0] : 0;
}
static const struct udevice_id zynqmp_firmware_ids[] = {
#include <linux/errno.h>
#include <linux/printk.h>
#include <linux/psci.h>
+#include <asm/system.h>
#define DRIVER_NAME "psci"
{
const char *method;
+#if defined(CONFIG_ARM64)
+ if (current_el() == 3)
+ return -EINVAL;
+#endif
+
method = ofnode_read_string(dev_ofnode(dev), "method");
if (!method) {
pr_warn("missing \"method\" property\n");
ulong bin_buf;
int ret;
u32 buf_lo, buf_hi;
- u32 ret_payload[5];
+ u32 ret_payload[PAYLOAD_ARG_CNT];
bin_buf = versal_align_dma_buffer((ulong *)buf, bsize);
config ZYNQ_GPIO
bool "Zynq GPIO driver"
- depends on DM_GPIO && (ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL)
- default y
+ depends on DM_GPIO
+ default y if ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL
help
Supports GPIO access on Zynq SoC.
clk_free(&clk);
#if CONFIG_IS_ENABLED(OF_CONTROL)
- plat->base_addr = (uint32_t)devfdt_get_addr_ptr(dev);
+ plat->base_addr = dev_read_addr(dev);
#endif
plat->bank_name = at91_get_bank_name(plat->base_addr);
port->regs = (struct at91_port *)plat->base_addr;
u32 shift, bit_per_gpio, activate, deactivate, gpio_count;
const u8 *defaults;
- hcg->regs = (u32 *)devfdt_get_addr_ptr(dev);
+ hcg->regs = dev_read_addr_ptr(dev);
gpio_count = dev_read_u32_default(dev, "gpio-count", 1);
shift = dev_read_u32_default(dev, "gpio-first-shift", 0);
bit_per_gpio = dev_read_u32_default(dev, "gpio-bit-per-line", 1);
config SYS_I2C_CADENCE
tristate "Cadence I2C Controller"
- depends on DM_I2C && (ARCH_ZYNQ || ARM64)
+ depends on DM_I2C
help
Say yes here to select Cadence I2C Host Controller. This controller is
e.g. used by Xilinx Zynq.
struct ast_i2c_priv *priv = dev_get_priv(dev);
int ret;
- priv->regs = devfdt_get_addr_ptr(dev);
- if (IS_ERR(priv->regs))
- return PTR_ERR(priv->regs);
+ priv->regs = dev_read_addr_ptr(dev);
+ if (!priv->regs)
+ return -EINVAL;
ret = clk_get_by_index(dev, 0, &priv->clk);
if (ret < 0) {
int ret;
if (!priv->regs)
- priv->regs = (struct i2c_regs *)devfdt_get_addr_ptr(bus);
+ priv->regs = dev_read_addr_ptr(bus);
dev_read_u32(bus, "i2c-scl-rising-time-ns", &priv->scl_rise_time_ns);
dev_read_u32(bus, "i2c-scl-falling-time-ns", &priv->scl_fall_time_ns);
dev_read_u32(bus, "i2c-sda-hold-time-ns", &priv->sda_hold_time_ns);
{
struct mv_i2c_priv *priv = dev_get_priv(bus);
- priv->base = (void *)devfdt_get_addr_ptr(bus);
+ priv->base = dev_read_addr_ptr(bus);
return 0;
}
{
struct mvtwsi_i2c_dev *dev = dev_get_priv(bus);
- dev->base = devfdt_get_addr_ptr(bus);
+ dev->base = dev_read_addr_ptr(bus);
if (!dev->base)
return -ENOMEM;
static int mvtwsi_i2c_bind(struct udevice *bus)
{
- struct mvtwsi_registers *twsi = devfdt_get_addr_ptr(bus);
+ struct mvtwsi_registers *twsi = dev_read_addr_ptr(bus);
/* Disable the hidden slave in i2c0 of these platforms */
if ((IS_ENABLED(CONFIG_ARMADA_38X) || IS_ENABLED(CONFIG_ARCH_KIRKWOOD))
struct ipi_int_regs {
u32 trig; /* 0x0 */
u32 obs; /* 0x4 */
- u32 ist; /* 0x8 */
- u32 imr; /* 0xC */
- u32 ier; /* 0x10 */
- u32 idr; /* 0x14 */
+ u32 dummy0;
+ u32 dummy1;
+ u32 isr; /* 0x10 */
+ u32 imr; /* 0x14 */
+ u32 ier; /* 0x18 */
+ u32 idr; /* 0x1C */
};
#define ipi_int_apu ((struct ipi_int_regs *)IPI_INT_REG_BASE_APU)
struct zynqmp_ipi *zynqmp = dev_get_priv(chan->dev);
u32 *mbx = (u32 *)zynqmp->local_res_regs;
+ /*
+ * PMU Firmware does not trigger IPI interrupt for API call responses so
+ * there is no need to check ISR flags
+ */
for (size_t i = 0; i < msg->len; i++)
msg->buf[i] = readl(&mbx[i]);
static int i2c_eeprom_partition_ofdata_to_platdata(struct udevice *dev)
{
struct i2c_eeprom_partition *priv = dev_get_priv(dev);
- u32 offset, size;
+ u32 reg[2];
int ret;
- ret = dev_read_u32(dev, "offset", &offset);
+ ret = dev_read_u32_array(dev, "reg", reg, 2);
if (ret)
return ret;
- ret = dev_read_u32(dev, "size", &size);
- if (ret)
- return ret;
+ if (!reg[1])
+ return -EINVAL;
+
+ priv->offset = reg[0];
+ priv->size = reg[1];
- priv->offset = offset;
- priv->size = size;
+ debug("%s: base %x, size %x\n", __func__, priv->offset, priv->size);
return 0;
}
config MMC_SDHCI_ZYNQ
bool "Arasan SDHCI controller support"
- depends on ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL
depends on DM_MMC && OF_CONTROL && BLK
depends on MMC_SDHCI
help
if (ret)
return ret;
- plat->mci = (struct atmel_mci *)devfdt_get_addr_ptr(dev);
+ plat->mci = dev_read_addr_ptr(dev);
atmel_mci_setup_cfg(dev);
"sdhci-caps-mask", 0);
dt_caps = dev_read_u64_default(host->mmc->dev,
"sdhci-caps", 0);
- caps = ~(u32)dt_caps_mask &
+ caps = ~lower_32_bits(dt_caps_mask) &
sdhci_readl(host, SDHCI_CAPABILITIES);
- caps |= (u32)dt_caps;
+ caps |= lower_32_bits(dt_caps);
#else
caps = sdhci_readl(host, SDHCI_CAPABILITIES);
#endif
/* Check whether the clock multiplier is supported or not */
if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
#if CONFIG_IS_ENABLED(DM_MMC)
- caps_1 = ~(u32)(dt_caps_mask >> 32) &
+ caps_1 = ~upper_32_bits(dt_caps_mask) &
sdhci_readl(host, SDHCI_CAPABILITIES_1);
- caps_1 |= (u32)(dt_caps >> 32);
+ caps_1 |= upper_32_bits(dt_caps);
#else
caps_1 = sdhci_readl(host, SDHCI_CAPABILITIES_1);
#endif
if (host->quirks & SDHCI_QUIRK_BROKEN_VOLTAGE)
cfg->voltages |= host->voltages;
- cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_4BIT;
+ if (caps & SDHCI_CAN_DO_HISPD)
+ cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz;
+
+ cfg->host_caps |= MMC_MODE_4BIT;
/* Since Host Controller Version3.0 */
if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
u32 fifo_depth;
int ret;
- host->ioaddr = devfdt_get_addr_ptr(dev);
+ host->ioaddr = dev_read_addr_ptr(dev);
/*
* If fifo-depth is unset don't set fifoth_val - we will try to
return PTR_ERR(priv->host->ioaddr);
priv->deviceid = dev_read_u32_default(dev, "xlnx,device_id", -1);
- priv->bank = dev_read_u32_default(dev, "xlnx,mio_bank", -1);
+ priv->bank = dev_read_u32_default(dev, "xlnx,mio-bank", 0);
return 0;
}
This driver supports DEC DC2114x Fast ethernet chips.
config XILINX_AXIEMAC
- depends on DM_ETH && (MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP)
+ depends on DM_ETH
select PHYLIB
select MII
bool "Xilinx AXI Ethernet"
This MAC is present in Xilinx Microblaze, Zynq and ZynqMP SoCs.
config XILINX_EMACLITE
- depends on DM_ETH && (MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP || MIPS)
+ depends on DM_ETH
select PHYLIB
select MII
bool "Xilinx Ethernetlite"
This MAC is present in Xilinx Microblaze, Zynq and ZynqMP SoCs.
config ZYNQ_GEM
- depends on DM_ETH && (ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL)
+ depends on DM_ETH
select PHYLIB
bool "Xilinx Ethernet GEM"
help
tphy->dev = dev;
tphy->version = dev_get_driver_data(dev);
- /* v1 has shared banks */
+ /* v1 has shared banks for usb/pcie mode, */
+ /* but not for sata mode */
if (tphy->version == MTK_TPHY_V1) {
tphy->sif_base = dev_read_addr_ptr(dev);
- if (!tphy->sif_base)
- return -ENOENT;
}
dev_for_each_subnode(subnode, dev) {
#include <dm.h>
#include <generic-phy.h>
+#define DRIVER_DATA 0x12345678
+
struct sandbox_phy_priv {
bool initialized;
bool on;
return 0;
}
+static int sandbox_phy_bind(struct udevice *dev)
+{
+ if (dev_get_driver_data(dev) != DRIVER_DATA)
+ return -ENODATA;
+
+ return 0;
+}
+
static int sandbox_phy_probe(struct udevice *dev)
{
struct sandbox_phy_priv *priv = dev_get_priv(dev);
};
static const struct udevice_id sandbox_phy_ids[] = {
- { .compatible = "sandbox,phy" },
+ { .compatible = "sandbox,phy_no_driver_data",
+ },
+
+ { .compatible = "sandbox,phy",
+ .data = DRIVER_DATA
+ },
{ }
};
U_BOOT_DRIVER(phy_sandbox) = {
.name = "phy_sandbox",
.id = UCLASS_PHY,
+ .bind = sandbox_phy_bind,
.of_match = sandbox_phy_ids,
.ops = &sandbox_phy_ops,
.probe = sandbox_phy_probe,
return -EINVAL;
}
- priv->base_reg = devfdt_get_addr_ptr(dev);
- if (priv->base_reg == (void *)FDT_ADDR_T_NONE) {
+ priv->base_reg = dev_read_addr_ptr(dev);
+ if (!priv->base_reg) {
debug("%s: Failed to get base address\n", __func__);
return -EINVAL;
}
priv->info.size = get_ram_size((long *)priv->info.base,
ddr_size);
- debug("%s : %lx\n", __func__, priv->info.size);
+ debug("%s : %lx\n", __func__, (uintptr_t)priv->info.size);
/* check memory access for all memory */
if (priv->info.size != ddr_size) {
printf("DDR invalid size : 0x%lx, expected 0x%lx\n",
- priv->info.size, (uintptr_t)ddr_size);
+ (uintptr_t)priv->info.size, (uintptr_t)ddr_size);
return -EINVAL;
}
u32 modrst_offset;
void __iomem *membase;
- membase = devfdt_get_addr_ptr(dev);
+ membase = dev_read_addr_ptr(dev);
modrst_offset = dev_read_u32_default(dev, "altr,modrst-offset", 0x10);
data->modrst_base = membase + modrst_offset;
{
struct mvebu_platdata *plat = dev_get_platdata(dev);
- plat->base = devfdt_get_addr_ptr(dev);
+ plat->base = dev_read_addr_ptr(dev);
return 0;
}
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
- plat->base = devfdt_get_addr_ptr(bus);
+ plat->base = dev_read_addr_ptr(bus);
plat->frequency =
fdtdec_get_int(blob, node, "spi-max-frequency", 12500000);
{
struct socfpga_sysreset_data *data = dev_get_priv(dev);
- data->rstmgr_base = devfdt_get_addr_ptr(dev);
+ data->rstmgr_base = dev_read_addr_ptr(dev);
return 0;
}
{
struct ast_timer_priv *priv = dev_get_priv(dev);
- priv->regs = devfdt_get_addr_ptr(dev);
- if (IS_ERR(priv->regs))
- return PTR_ERR(priv->regs);
+ priv->regs = dev_read_addr_ptr(dev);
+ if (!priv->regs)
+ return -EINVAL;
priv->tmc = ast_get_timer_counter(priv->regs, AST_TICK_TIMER);
{
struct atmel_pit_platdata *plat = dev_get_platdata(dev);
- plat->regs = (struct atmel_pit_regs *)devfdt_get_addr_ptr(dev);
+ plat->regs = dev_read_addr_ptr(dev);
return 0;
}
{
struct zynq_ehci_priv *priv = dev_get_priv(dev);
- priv->ehci = (struct usb_ehci *)devfdt_get_addr_ptr(dev);
+ priv->ehci = dev_read_addr_ptr(dev);
if (!priv->ehci)
return -EINVAL;
out On-screen Display (OSD) used on gdsys FPGAs to control dynamic
textual overlays of the display outputs.
+config SPLASH_SCREEN
+ bool "Show a splash-screen image"
+ help
+ If this option is set, the environment is checked for a variable
+ "splashimage". If found, the usual display of logo, copyright and
+ system information on the LCD is suppressed and the BMP image at the
+ address specified in "splashimage" is loaded instead. The console is
+ redirected to the "nulldev", too. This allows for a "silent" boot
+ where a splash screen is loaded very quickly after power-on.
+
+ The splash_screen_prepare() function is a weak function defined in
+ common/splash.c. It is called as part of the splash screen display
+ sequence. It gives the board an opportunity to prepare the splash
+ image data before it is processed and sent to the frame buffer by
+ U-Boot. Define your own version to use this feature.
+
+config SPLASHIMAGE_GUARD
+ bool "Support unaligned BMP images"
+ depends on SPLASH_SCREEN
+ help
+ If this option is set, then U-Boot will prevent the environment
+ variable "splashimage" from being set to a problematic address
+ (see doc/README.displaying-bmps).
+
+ This option is useful for targets where, due to alignment
+ restrictions, an improperly aligned BMP image will cause a data
+ abort. If you think you will not have problems with unaligned
+ accesses (for example because your toolchain prevents them)
+ there is no need to set this option.
+
+config SPLASH_SCREEN_ALIGN
+ bool "Allow positioning the splash image anywhere on the display"
+ depends on SPLASH_SCREEN || CMD_BMP
+ help
+ If this option is set the splash image can be freely positioned
+ on the screen. Environment variable "splashpos" specifies the
+ position as "x,y". If a positive number is given it is used as
+ number of pixel from left/top. If a negative number is given it
+ is used as number of pixel from right/bottom. You can also
+ specify 'm' for centering the image.
+
+ Example:
+ setenv splashpos m,m
+ => image at center of screen
+
+ setenv splashpos 30,20
+ => image at x = 30 and y = 20
+
+ setenv splashpos -10,m
+ => vertically centered image
+ at x = dspWidth - bmpWidth - 9
+
+config SPLASH_SOURCE
+ bool "Control the source of the splash image"
+ depends on SPLASH_SCREEN
+ help
+ Use the splash_source.c library. This library provides facilities to
+ declare board specific splash image locations, routines for loading
+ splash image from supported locations, and a way of controlling the
+ selected splash location using the "splashsource" environment
+ variable.
+
+ This CONFIG works as follows:
+
+ - If splashsource is set to a supported location name as defined by
+ board code, use that splash location.
+ - If splashsource is undefined, use the first splash location as
+ default.
+ - If splashsource is set to an unsupported value, do not load a splash
+ screen.
+
+ A splash source location can describe either storage with raw data, a
+ storage formatted with a file system or a FIT image. In case of a
+ filesystem, the splash screen data is loaded as a file. The name of
+ the splash screen file can be controlled with the environment variable
+ "splashfile".
+
+ To enable loading the splash image from a FIT image, CONFIG_FIT must
+ be enabled. The FIT image has to start at the 'offset' field address
+ in the selected splash location. The name of splash image within the
+ FIT shall be specified by the environment variable "splashfile".
+
+ In case the environment variable "splashfile" is not defined the
+ default name 'splash.bmp' will be used.
+
endmenu
return ret;
desc->blksz = 512;
+ desc->log2blksz = 9;
virtio_cread(dev, struct virtio_blk_config, capacity, &cap);
desc->lba = cap;
{
struct ast_wdt_priv *priv = dev_get_priv(dev);
- priv->regs = devfdt_get_addr_ptr(dev);
- if (IS_ERR(priv->regs))
- return PTR_ERR(priv->regs);
+ priv->regs = dev_read_addr_ptr(dev);
+ if (!priv->regs)
+ return -EINVAL;
return 0;
}
nflags = gnttab_table[ref].flags;
do {
- if ((flags = nflags) & (GTF_reading | GTF_writing)) {
+ flags = nflags;
+ if ((flags) & (GTF_reading | GTF_writing)) {
printf("WARNING: g.e. still in use! (%x)\n", flags);
return 0;
}
snprintf(path, sizeof(path), "%s/state", dev->backend);
snprintf(nodename, sizeof(nodename), "%s/state", dev->nodename);
- if ((err = xenbus_switch_state(XBT_NIL, nodename,
- XenbusStateClosing)) != NULL) {
+ err = xenbus_switch_state(XBT_NIL, nodename, XenbusStateClosing);
+ if (err) {
printf("%s: error changing state to %d: %s\n", __func__,
XenbusStateClosing, err);
goto close;
err = xenbus_wait_for_state_change(path, &state);
free(err);
- if ((err = xenbus_switch_state(XBT_NIL, nodename,
- XenbusStateClosed)) != NULL) {
+ err = xenbus_switch_state(XBT_NIL, nodename, XenbusStateClosed);
+ if (err) {
printf("%s: error changing state to %d: %s\n", __func__,
XenbusStateClosed, err);
goto close;
free(err);
}
- if ((err = xenbus_switch_state(XBT_NIL, nodename,
- XenbusStateInitialising)) != NULL) {
+ err = xenbus_switch_state(XBT_NIL, nodename, XenbusStateInitialising);
+ if (err) {
printf("%s: error changing state to %d: %s\n", __func__,
XenbusStateInitialising, err);
goto close;
#include "sqfs_filesystem.h"
#include "sqfs_utils.h"
-struct squashfs_ctxt {
- struct disk_partition cur_part_info;
- struct blk_desc *cur_dev;
- struct squashfs_super_block *sblk;
-};
-
static struct squashfs_ctxt ctxt;
static int sqfs_disk_read(__u32 block, __u32 nr_blocks, void *buf)
struct squashfs_super_block *sblk = ctxt.sblk;
unsigned long dest_len;
int block, offset, ret;
- u16 header, comp_type;
-
- comp_type = get_unaligned_le16(&sblk->compression);
+ u16 header;
if (inode_fragment_index >= get_unaligned_le32(&sblk->fragments))
return -EINVAL;
header = get_unaligned_le16(metadata_buffer + table_offset);
metadata = metadata_buffer + table_offset + SQFS_HEADER_SIZE;
+ if (!metadata) {
+ ret = -ENOMEM;
+ goto free_buffer;
+ }
+
entries = malloc(SQFS_METADATA_BLOCK_SIZE);
if (!entries) {
ret = -ENOMEM;
if (SQFS_COMPRESSED_METADATA(header)) {
src_len = SQFS_METADATA_SIZE(header);
dest_len = SQFS_METADATA_BLOCK_SIZE;
- ret = sqfs_decompress(comp_type, entries, &dest_len, metadata,
+ ret = sqfs_decompress(&ctxt, entries, &dest_len, metadata,
src_len);
if (ret) {
ret = -EINVAL;
*/
static int sqfs_tokenize(char **tokens, int count, const char *str)
{
+ int i, j, ret = 0;
char *aux, *strc;
- int i, j;
strc = strdup(str);
if (!strc)
if (!strcmp(strc, "/")) {
tokens[0] = strdup(strc);
if (!tokens[0]) {
- free(strc);
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto free_strc;
}
} else {
for (j = 0; j < count; j++) {
if (!tokens[j]) {
for (i = 0; i < j; i++)
free(tokens[i]);
- free(strc);
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto free_strc;
}
}
}
+free_strc:
free(strc);
- return 0;
+ return ret;
}
/*
{
struct squashfs_super_block *sblk = ctxt.sblk;
char *path, *target, **sym_tokens, *res, *rem;
+ struct squashfs_ldir_inode *ldir = NULL;
int j, ret, new_inode_number, offset;
struct squashfs_symlink_inode *sym;
- struct squashfs_ldir_inode *ldir;
struct squashfs_dir_inode *dir;
struct fs_dir_stream *dirsp;
struct fs_dirent *dent;
{
struct squashfs_super_block *sblk = ctxt.sblk;
u64 start, n_blks, table_offset, table_size;
- int j, ret = 0, metablks_count, comp_type;
+ int j, ret = 0, metablks_count;
unsigned char *src_table, *itb;
u32 src_len, dest_offset = 0;
- unsigned long dest_len;
+ unsigned long dest_len = 0;
bool compressed;
- comp_type = get_unaligned_le16(&sblk->compression);
table_size = get_unaligned_le64(&sblk->directory_table_start) -
get_unaligned_le64(&sblk->inode_table_start);
start = get_unaligned_le64(&sblk->inode_table_start) /
sqfs_read_metablock(itb, table_offset, &compressed, &src_len);
if (compressed) {
dest_len = SQFS_METADATA_BLOCK_SIZE;
- ret = sqfs_decompress(comp_type, *inode_table +
+ ret = sqfs_decompress(&ctxt, *inode_table +
dest_offset, &dest_len,
src_table, src_len);
if (ret) {
goto free_itb;
}
+ dest_offset += dest_len;
} else {
memcpy(*inode_table + (j * SQFS_METADATA_BLOCK_SIZE),
src_table, src_len);
* Offsets to the decompression destination, to the metadata
* buffer 'itb' and to the decompression source, respectively.
*/
- dest_offset += dest_len;
+
table_offset += src_len + SQFS_HEADER_SIZE;
src_table += src_len + SQFS_HEADER_SIZE;
}
static int sqfs_read_directory_table(unsigned char **dir_table, u32 **pos_list)
{
u64 start, n_blks, table_offset, table_size;
- int j, ret = 0, metablks_count = -1, comp_type;
struct squashfs_super_block *sblk = ctxt.sblk;
+ int j, ret = 0, metablks_count = -1;
unsigned char *src_table, *dtb;
u32 src_len, dest_offset = 0;
- unsigned long dest_len;
+ unsigned long dest_len = 0;
bool compressed;
- comp_type = get_unaligned_le16(&sblk->compression);
-
/* DIRECTORY TABLE */
table_size = get_unaligned_le64(&sblk->fragment_table_start) -
get_unaligned_le64(&sblk->directory_table_start);
sqfs_read_metablock(dtb, table_offset, &compressed, &src_len);
if (compressed) {
dest_len = SQFS_METADATA_BLOCK_SIZE;
- ret = sqfs_decompress(comp_type, *dir_table +
+ ret = sqfs_decompress(&ctxt, *dir_table +
(j * SQFS_METADATA_BLOCK_SIZE),
&dest_len, src_table, src_len);
if (ret) {
dest_offset += dest_len;
break;
}
+
+ dest_offset += dest_len;
} else {
memcpy(*dir_table + (j * SQFS_METADATA_BLOCK_SIZE),
src_table, src_len);
* Offsets to the decompression destination, to the metadata
* buffer 'dtb' and to the decompression source, respectively.
*/
- dest_offset += dest_len;
table_offset += src_len + SQFS_HEADER_SIZE;
src_table += src_len + SQFS_HEADER_SIZE;
}
ctxt.sblk = sblk;
+ ret = sqfs_decompressor_init(&ctxt);
+
+ if (ret) {
+ ctxt.cur_dev = NULL;
+ free(ctxt.sblk);
+ return -EINVAL;
+ }
+
return 0;
}
finfo->start = get_unaligned_le32(®->start_block);
finfo->frag = SQFS_IS_FRAGMENTED(get_unaligned_le32(®->fragment));
+ if (finfo->size < 1 || finfo->offset < 0 || finfo->start < 0)
+ return -EINVAL;
+
if (finfo->frag) {
datablk_count = finfo->size / le32_to_cpu(blksz);
ret = sqfs_frag_lookup(get_unaligned_le32(®->fragment),
if (ret < 0)
return -EINVAL;
finfo->comp = true;
+ if (fentry->size < 1 || fentry->start < 0)
+ return -EINVAL;
} else {
datablk_count = DIV_ROUND_UP(finfo->size, le32_to_cpu(blksz));
}
finfo->start = get_unaligned_le64(&lreg->start_block);
finfo->frag = SQFS_IS_FRAGMENTED(get_unaligned_le32(&lreg->fragment));
+ if (finfo->size < 1 || finfo->offset < 0 || finfo->start < 0)
+ return -EINVAL;
+
if (finfo->frag) {
datablk_count = finfo->size / le32_to_cpu(blksz);
ret = sqfs_frag_lookup(get_unaligned_le32(&lreg->fragment),
if (ret < 0)
return -EINVAL;
finfo->comp = true;
+ if (fentry->size < 1 || fentry->start < 0)
+ return -EINVAL;
} else {
datablk_count = DIV_ROUND_UP(finfo->size, le32_to_cpu(blksz));
}
char *dir, *fragment_block, *datablock = NULL, *data_buffer = NULL;
char *fragment, *file, *resolved, *data;
u64 start, n_blks, table_size, data_offset, table_offset;
- int ret, j, i_number, comp_type, datablk_count = 0;
+ int ret, j, i_number, datablk_count = 0;
struct squashfs_super_block *sblk = ctxt.sblk;
struct squashfs_fragment_block_entry frag_entry;
struct squashfs_file_info finfo = {0};
*actread = 0;
- comp_type = get_unaligned_le16(&sblk->compression);
-
/*
* sqfs_opendir will uncompress inode and directory tables, and will
* return a pointer to the directory that contains the requested file.
/* Load the data */
if (SQFS_COMPRESSED_BLOCK(finfo.blk_sizes[j])) {
dest_len = get_unaligned_le32(&sblk->block_size);
- ret = sqfs_decompress(comp_type, datablock, &dest_len,
+ ret = sqfs_decompress(&ctxt, datablock, &dest_len,
data, table_size);
if (ret)
goto free_buffer;
goto free_fragment;
}
- ret = sqfs_decompress(comp_type, fragment_block, &dest_len,
+ ret = sqfs_decompress(&ctxt, fragment_block, &dest_len,
(void *)fragment + table_offset,
frag_entry.size);
if (ret) {
{
free(ctxt.sblk);
ctxt.cur_dev = NULL;
+ sqfs_decompressor_cleanup(&ctxt);
}
void sqfs_closedir(struct fs_dir_stream *dirs)
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
+
+#if IS_ENABLED(CONFIG_LZO)
+#include <linux/lzo.h>
+#endif
+
#if IS_ENABLED(CONFIG_ZLIB)
#include <u-boot/zlib.h>
#endif
+#if IS_ENABLED(CONFIG_ZSTD)
+#include <linux/zstd.h>
+#endif
+
#include "sqfs_decompressor.h"
-#include "sqfs_filesystem.h"
#include "sqfs_utils.h"
+int sqfs_decompressor_init(struct squashfs_ctxt *ctxt)
+{
+ u16 comp_type = get_unaligned_le16(&ctxt->sblk->compression);
+
+ switch (comp_type) {
+#if IS_ENABLED(CONFIG_LZO)
+ case SQFS_COMP_LZO:
+ break;
+#endif
+#if IS_ENABLED(CONFIG_ZLIB)
+ case SQFS_COMP_ZLIB:
+ break;
+#endif
+#if IS_ENABLED(CONFIG_ZSTD)
+ case SQFS_COMP_ZSTD:
+ ctxt->zstd_workspace = malloc(ZSTD_DCtxWorkspaceBound());
+ if (!ctxt->zstd_workspace)
+ return -ENOMEM;
+ break;
+#endif
+ default:
+ printf("Error: unknown compression type.\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+void sqfs_decompressor_cleanup(struct squashfs_ctxt *ctxt)
+{
+ u16 comp_type = get_unaligned_le16(&ctxt->sblk->compression);
+
+ switch (comp_type) {
+#if IS_ENABLED(CONFIG_LZO)
+ case SQFS_COMP_LZO:
+ break;
+#endif
+#if IS_ENABLED(CONFIG_ZLIB)
+ case SQFS_COMP_ZLIB:
+ break;
+#endif
+#if IS_ENABLED(CONFIG_ZSTD)
+ case SQFS_COMP_ZSTD:
+ free(ctxt->zstd_workspace);
+ break;
+#endif
+ }
+}
+
#if IS_ENABLED(CONFIG_ZLIB)
static void zlib_decompression_status(int ret)
{
}
#endif
-int sqfs_decompress(u16 comp_type, void *dest, unsigned long *dest_len,
- void *source, u32 lenp)
+#if IS_ENABLED(CONFIG_ZSTD)
+static int sqfs_zstd_decompress(struct squashfs_ctxt *ctxt, void *dest,
+ unsigned long dest_len, void *source, u32 src_len)
+{
+ ZSTD_DCtx *ctx;
+ size_t wsize;
+ int ret;
+
+ wsize = ZSTD_DCtxWorkspaceBound();
+ ctx = ZSTD_initDCtx(ctxt->zstd_workspace, wsize);
+ ret = ZSTD_decompressDCtx(ctx, dest, dest_len, source, src_len);
+
+ return ZSTD_isError(ret);
+}
+#endif /* CONFIG_ZSTD */
+
+int sqfs_decompress(struct squashfs_ctxt *ctxt, void *dest,
+ unsigned long *dest_len, void *source, u32 src_len)
{
+ u16 comp_type = get_unaligned_le16(&ctxt->sblk->compression);
int ret = 0;
switch (comp_type) {
+#if IS_ENABLED(CONFIG_LZO)
+ case SQFS_COMP_LZO: {
+ size_t lzo_dest_len = *dest_len;
+ ret = lzo1x_decompress_safe(source, src_len, dest, &lzo_dest_len);
+ if (ret) {
+ printf("LZO decompression failed. Error code: %d\n", ret);
+ return -EINVAL;
+ }
+
+ break;
+ }
+#endif
#if IS_ENABLED(CONFIG_ZLIB)
case SQFS_COMP_ZLIB:
- ret = uncompress(dest, dest_len, source, lenp);
+ ret = uncompress(dest, dest_len, source, src_len);
if (ret) {
zlib_decompression_status(ret);
return -EINVAL;
break;
#endif
+#if IS_ENABLED(CONFIG_ZSTD)
+ case SQFS_COMP_ZSTD:
+ ret = sqfs_zstd_decompress(ctxt, dest, *dest_len, source, src_len);
+ if (ret) {
+ printf("ZSTD Error code: %d\n", ZSTD_getErrorCode(ret));
+ return -EINVAL;
+ }
+
+ break;
+#endif
default:
printf("Error: unknown compression type.\n");
return -EINVAL;
#define SQFS_DECOMPRESSOR_H
#include <stdint.h>
+#include "sqfs_filesystem.h"
#define SQFS_COMP_ZLIB 1
#define SQFS_COMP_LZMA 2
struct squashfs_lzo_opts *lzo;
};
-int sqfs_decompress(u16 comp_type, void *dest, unsigned long *dest_len,
- void *source, u32 lenp);
+int sqfs_decompress(struct squashfs_ctxt *ctxt, void *dest,
+ unsigned long *dest_len, void *source, u32 src_len);
+int sqfs_decompressor_init(struct squashfs_ctxt *ctxt);
+void sqfs_decompressor_cleanup(struct squashfs_ctxt *ctxt);
#endif /* SQFS_DECOMPRESSOR_H */
return -EINVAL;
}
+ if (offset < 0)
+ return -EINVAL;
+
for (j = 0; j < m_count; j++) {
if (m_list[j] == start_block)
return (++j * SQFS_METADATA_BLOCK_SIZE) + offset;
#define SQFS_FILESYSTEM_H
#include <asm/unaligned.h>
-#include <stdint.h>
#include <fs.h>
+#include <part.h>
+#include <stdint.h>
#define SQFS_UNCOMPRESSED_DATA 0x0002
#define SQFS_MAGIC_NUMBER 0x73717368
__le64 export_table_start;
};
+struct squashfs_ctxt {
+ struct disk_partition cur_part_info;
+ struct blk_desc *cur_dev;
+ struct squashfs_super_block *sblk;
+#if IS_ENABLED(CONFIG_ZSTD)
+ void *zstd_workspace;
+#endif
+};
+
struct squashfs_directory_index {
u32 index;
u32 start;
int sqfs_read_metablock(unsigned char *file_mapping, int offset,
bool *compressed, u32 *data_size)
{
- unsigned char *data;
+ const unsigned char *data;
u16 header;
data = file_mapping + offset;
header = get_unaligned((u16 *)data);
+ if (!header || !data)
+ return -EINVAL;
+
*compressed = SQFS_COMPRESSED_METADATA(header);
*data_size = SQFS_METADATA_SIZE(header);
static inline size_t get_sector_buf_size(void)
{
- return (size_t)CONFIG_FASTBOOT_BUF_SIZE;
+ return (size_t)CONFIG_AVB_BUF_SIZE;
}
static inline void *get_sector_buf(void)
{
- return map_sysmem(CONFIG_FASTBOOT_BUF_ADDR, CONFIG_FASTBOOT_BUF_SIZE);
+ return map_sysmem(CONFIG_AVB_BUF_ADDR, CONFIG_AVB_BUF_SIZE);
}
static inline bool is_buf_unaligned(void *buffer)
/* LCD */
#ifdef CONFIG_CMD_BMP
-#define CONFIG_SPLASH_SCREEN
#define CONFIG_LCD_LOGO
#define CONFIG_SHARP_LQ035Q7DH06
#endif
*/
#undef CONFIG_BOOTP_BOOTFILESIZE
-#define CONFIG_SYS_DEVICE_NULLDEV 1 /* include nulldev device */
-
#define CONFIG_SYS_LOAD_ADDR 0x200000 /* default load address */
/*
* 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_MVGBE /* Enable kirkwood Gbe Controller Driver */
#define CONFIG_MVGBE_PORTS {1, 0} /* enable a single port */
* 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_MVGBE /* Enable kirkwood Gbe Controller Driver */
#define CONFIG_MVGBE_PORTS {1, 0} /* enable a single port */
/* Framebuffer */
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
/* Framebuffer and LCD */
#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
/* Framebuffer */
/* check this console not needed, after test remove it */
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_IMX_VIDEO_SKIP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_NET_RETRY_COUNT 10
/* Network console */
-#define CONFIG_NETCONSOLE 1
#define CONFIG_BOOTP_MAY_FAIL /* if we don't have DHCP environment */
/* As stated above, the following choices are optional. */
/* Framebuffer */
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
/* Display */
#define CONFIG_IMX_HDMI
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SOURCE
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_MXS
#define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
#define CONFIG_VIDEO_LOGO
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
/* Framebuffer and LCD */
#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#if defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO)
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_BOOTP_BOOTFILESIZE
#endif
-#define CONFIG_SYS_DEVICE_NULLDEV 1
-
/*
* Clock Configuration
*/
#define CONFIG_SKIP_LOWLEVEL_INIT
#ifdef CONFIG_VIDEO_FSL_DCU_FB
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_SYS_FSL_DCU_LE
*/
#ifdef CONFIG_CMD_NET
#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
-#define CONFIG_NETCONSOLE
#endif
/*
#define CONFIG_BOOT_RETRY_TIME -1
#define CONFIG_RESET_TO_RETRY
-#define CONFIG_SPLASH_SCREEN
#define CONFIG_HW_WATCHDOG
/* Network hardware configuration */
#define CONFIG_DRIVER_EP93XX_MAC
#define CONFIG_MII_SUPPRESS_PREAMBLE
-#undef CONFIG_NETCONSOLE
/* SDRAM configuration */
#if defined(CONFIG_EDB9301) || defined(CONFIG_EDB9302) || \
#define CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION /* don't randomize MAC */
#define CONFIG_PHY_BASE_ADR 0x8
#define CONFIG_RESET_PHY_R /* use reset_phy() to init mv8831116 PHY */
-#define CONFIG_NETCONSOLE /* include NetConsole support */
#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN /* detect link using phy */
#endif
/* Framebuffer */
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
#define CONFIG_MXC_USB_FLAGS 0
#define CONFIG_USBD_HS
-#define CONFIG_NETCONSOLE
/* Framebuffer and LCD */
#define CONFIG_VIDEO_LOGO
#define CONFIG_IMX_HDMI
#define CONFIG_IMX_VIDEO_SKIP
#define CONFIG_VIDEO_BMP_LOGO
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_HIDE_LOGO_VERSION /* Custom config to hide U-boot version */
/* Miscellaneous configurable options */
#ifdef CONFIG_VIDEO_IPUV3
# define CONFIG_IMX_VIDEO_SKIP
-# define CONFIG_SPLASH_SCREEN
-# define CONFIG_SPLASH_SCREEN_ALIGN
# define CONFIG_BMP_16BPP
# define CONFIG_VIDEO_BMP_RLE8
# define CONFIG_VIDEO_LOGO
#ifdef CONFIG_DM_VIDEO
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
*/
#ifdef CONFIG_CMD_NET
#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
-#define CONFIG_NETCONSOLE
#endif
/*
*/
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_GZIP
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASHIMAGE_GUARD
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20)
/* LVDS display */
#define CONFIG_SYS_LDB_CLOCK 33260000
#define CONFIG_IMX_VIDEO_SKIP
-#define CONFIG_SPLASH_SOURCE
/* IIM Fuses */
#define CONFIG_FSL_IIM
#define CONFIG_BMP_16BPP
#define CONFIG_BMP_24BPP
#define CONFIG_BMP_32BPP
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define STDOUT_CFG "vidconsole,serial"
#else
#define STDOUT_CFG "serial"
/* Framebuffer support */
#ifdef CONFIG_VIDEO
#define CONFIG_VIDEO_LOGO
-#define CONFIG_SPLASH_SCREEN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_GZIP
/* Framebuffer support */
#ifdef CONFIG_VIDEO
#define CONFIG_VIDEO_LOGO
-#define CONFIG_SPLASH_SCREEN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_GZIP
/* Framebuffer and LCD */
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
/* Framebuffer and LCD */
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
/* Framebuffer */
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
/* Framebuffer */
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#ifdef CONFIG_VIDEO
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#if defined(CONFIG_DM_VIDEO)
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#ifdef CONFIG_VIDEO
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024)
#define CONFIG_USBD_HS
-#define CONFIG_NETCONSOLE
#define CONFIG_MXC_UART_BASE UART2_BASE
/* Framebuffer and LCD */
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_VIDEO_BMP_GZIP
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (6 * 1024 * 1024)
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define VIDEO_FB_16BPP_PIXEL_SWAP
#define VIDEO_FB_16BPP_WORD_SWAP
-#define CONFIG_SPLASH_SCREEN
/* functions for cfb_console */
#define VIDEO_KBD_INIT_FCT rx51_kp_init()
#define CONFIG_MXC_USB_FLAGS 0
/* Gadget part */
#define CONFIG_USBD_HS
-#define CONFIG_NETCONSOLE
#endif
/* Video output */
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_IMX_HDMI
/* Ethernet driver configuration */
#ifdef CONFIG_CMD_NET
-#define CONFIG_NETCONSOLE
#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
#define CONFIG_PHY_BASE_ADR 1
#define CONFIG_RESET_PHY_R
#ifndef CONFIG_SPL_BUILD
#ifdef CONFIG_DM_VIDEO
#define CONFIG_VIDEO_LOGO
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
-#define CONFIG_SPLASH_SOURCE
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_BMP_16BPP
/* Framebuffer */
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#ifdef CONFIG_VIDEO
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#ifdef CONFIG_DM_VIDEO
#define CONFIG_VIDEO_MXS
#define CONFIG_VIDEO_LOGO
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#if defined(CONFIG_VIDEO)
#define CONFIG_VIDEO_DA8XX
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#if defined(CONFIG_VIDEO)
#define CONFIG_VIDEO_DA8XX
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_VIDEO_BMP_LOGO
#define CONFIG_VIDEO_LOGO
-#define CONFIG_SPLASH_SCREEN
-
#ifdef CONFIG_VIDEO_LOGO
#ifdef CONFIG_DM_VIDEO
#endif
#ifdef CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SOURCE 1
-#define CONFIG_SPLASH_SCREEN_ALIGN 1
#define SPLASH_FILE logo.bmp
#endif
#define LCD_BPP LCD_COLOR16
#define CONFIG_LCD_BMP_RLE8
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_KEYBOARD
#ifdef CONFIG_CMD_USB
#define CONFIG_EHCI_MXS_PORT0
#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-
-#define CONFIG_NETCONSOLE
#endif
/* The rest of the configuration is shared */
#define CONFIG_BMP_16BPP
#define CONFIG_BMP_24BPP
#define CONFIG_BMP_32BPP
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#endif
#endif /* __CONFIG_H */
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Configuration for Total Compute platform. Parts were derived from other ARM
+ * configurations.
+ * (C) Copyright 2020 Arm Limited
+ * Usama Arif <usama.arif@arm.com>
+ */
+
+#ifndef __TOTAL_COMPUTE_H
+#define __TOTAL_COMPUTE_H
+
+#define CONFIG_REMAKE_ELF
+
+/* Link Definitions */
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
+
+#define CONFIG_SYS_BOOTM_LEN (64 << 20)
+
+#define UART0_BASE 0x7ff80000
+
+/* Size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (8 << 20))
+
+/* PL011 Serial Configuration */
+#define CONFIG_PL011_CLOCK 7372800
+
+/* Miscellaneous configurable options */
+#define CONFIG_SYS_LOAD_ADDR 0x90000000
+
+/* Physical Memory Map */
+#define PHYS_SDRAM_1 0x80000000
+/* Top 48MB reserved for secure world use */
+#define DRAM_SEC_SIZE 0x03000000
+#define PHYS_SDRAM_1_SIZE 0x80000000 - DRAM_SEC_SIZE
+#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
+
+#define CONFIG_ARM_PL180_MMCI_BASE 0x001c050000
+#define CONFIG_SYS_MMC_MAX_BLK_COUNT 127
+#define CONFIG_ARM_PL180_MMCI_CLOCK_FREQ 12000000
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "bootm_size=0x20000000\0" \
+ "load_addr=0xa0000000\0" \
+ "kernel_addr_r=0x80080000\0" \
+ "initrd_addr_r=0x88000000\0" \
+ "fdt_addr_r=0x83000000\0"
+/*
+ * If vbmeta partition is present, boot Android with verification using AVB.
+ * Else if system partition is present (no vbmeta partition), boot Android
+ * without verification (for development purposes).
+ * Else boot FIT image.
+ */
+#define CONFIG_BOOTCOMMAND \
+ "if part number mmc 0 vbmeta is_avb; then" \
+ " echo MMC with vbmeta partition detected.;" \
+ " echo starting Android Verified boot.;" \
+ " avb init 0; " \
+ " if avb verify; then " \
+ " set bootargs $bootargs $avb_bootargs; " \
+ " part start mmc 0 boot boot_start; " \
+ " part size mmc 0 boot boot_size; " \
+ " mmc read ${load_addr} ${boot_start} ${boot_size}; " \
+ " bootm ${load_addr} ${load_addr} ${fdt_addr_r}; " \
+ " else; " \
+ " echo AVB verification failed.; " \
+ " exit; " \
+ " fi; " \
+ "elif part number mmc 0 system is_non_avb_android; then " \
+ " booti ${kernel_addr_r} ${initrd_addr_r} ${fdt_addr_r};" \
+ "else;" \
+ " echo Booting FIT image.;" \
+ " bootm ${load_addr} ${load_addr} ${fdt_addr_r}; " \
+ "fi;"
+
+/* Monitor Command Prompt */
+#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
+#define CONFIG_SYS_MAXARGS 64 /* max command args */
+
+#define CONFIG_SYS_FLASH_BASE 0x0C000000
+/* 256 x 256KiB sectors */
+#define CONFIG_SYS_MAX_FLASH_SECT 256
+
+#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_32BIT
+#define CONFIG_SYS_MAX_FLASH_BANKS 1
+
+#define CONFIG_SYS_FLASH_EMPTY_INFO /* flinfo indicates empty blocks */
+#define FLASH_MAX_SECTOR_SIZE 0x00040000
+
+#endif /* __TOTAL_COMPUTE_H */
/* Framebuffer */
#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_BMP_16BPP
#define CONFIG_VIDEO_LOGO
#define CONFIG_VIDEO_BMP_LOGO
#include <linux/types.h>
#endif
-#define CONFIG_BOARD_EARLY_INIT_F
-
#define CONFIG_EXTRA_ENV_SETTINGS
#undef CONFIG_NR_DRAM_BANKS
#define CONFIG_OF_SYSTEM_SETUP
-#define CONFIG_CMDLINE_TAG 1
-#define CONFIG_INITRD_TAG 1
-
-#define CONFIG_CMD_RUN
-
#undef CONFIG_EXTRA_ENV_SETTINGS
#define CONFIG_EXTRA_ENV_SETTINGS \
"loadimage=ext4load pvblock 0 0x90000000 /boot/Image;\0" \
#ifdef CONFIG_CMD_USB
#define CONFIG_EHCI_MXS_PORT0
#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-
-#define CONFIG_NETCONSOLE
#endif
/* The rest of the configuration is shared */
#define DFU_ALT_INFO_RAM \
"dfu_ram_info=" \
"setenv dfu_alt_info " \
- "Image ram $kernel_addr_r $kernel_size_r\\\\;" \
+ "Image ram 80000 $kernel_size_r\\\\;" \
"system.dtb ram $fdt_addr_r $fdt_size_r\0" \
"dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
"thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
#define CONFIG_CLOCKS
#define ENV_MEM_LAYOUT_SETTINGS \
- "fdt_high=10000000\0" \
"fdt_addr_r=0x40000000\0" \
"fdt_size_r=0x400000\0" \
"pxefile_addr_r=0x10000000\0" \
#define DFU_ALT_INFO_RAM \
"dfu_ram_info=" \
"setenv dfu_alt_info " \
- "Image ram $kernel_addr $kernel_size\\\\;" \
- "system.dtb ram $fdt_addr $fdt_size\0" \
+ "Image ram 80000 $kernel_size_r\\\\;" \
+ "system.dtb ram $fdt_addr_r $fdt_size_r\0" \
"dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
- "thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
+ "thor_ram=run dfu_ram_info && thordown 0 ram 0\0" \
+ "dfu_ram_tftp=run dfu_ram_info && setenv updatefile boot && " \
+ "setenv loadaddr 10000000 && dfu tftp ram 0\0"
#define DFU_ALT_INFO \
DFU_ALT_INFO_RAM
#define CONFIG_CLOCKS
#define ENV_MEM_LAYOUT_SETTINGS \
- "fdt_high=10000000\0" \
"fdt_addr_r=0x40000000\0" \
+ "fdt_size_r=0x400000\0" \
"pxefile_addr_r=0x10000000\0" \
"kernel_addr_r=0x18000000\0" \
+ "kernel_size_r=0x10000000\0" \
"scriptaddr=0x20000000\0" \
"ramdisk_addr_r=0x02100000\0" \
"script_size_f=0x80000\0" \
#include <configs/xilinx_zynqmp_mini.h>
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE + 0x20000)
-#define CONFIG_SYS_MALLOC_LEN 0x2000
+#define CONFIG_SYS_MALLOC_LEN 0x1a00
#endif /* __CONFIG_ZYNQMP_MINI_QSPI_H */
/* Default environment */
#ifndef CONFIG_EXTRA_ENV_SETTINGS
#define CONFIG_EXTRA_ENV_SETTINGS \
- "fdt_high=0x20000000\0" \
"scriptaddr=0x20000\0" \
"script_size_f=0x40000\0" \
"fdt_addr_r=0x1f00000\0" \
static inline void *dev_read_addr_ptr(const struct udevice *dev)
{
- void *addr = devfdt_get_addr_ptr(dev);
-
- return ((fdt_addr_t)(uintptr_t)addr == FDT_ADDR_T_NONE) ? NULL : addr;
+ return devfdt_get_addr_ptr(dev);
}
static inline fdt_addr_t dev_read_addr_pci(const struct udevice *dev)
static inline int dev_read_addr_cells(const struct udevice *dev)
{
- /* NOTE: this call should walk up the parent stack */
- return fdt_address_cells(gd->fdt_blob, dev_of_offset(dev));
+ int parent = fdt_parent_offset(gd->fdt_blob, dev_of_offset(dev));
+
+ return fdt_address_cells(gd->fdt_blob, parent);
}
static inline int dev_read_size_cells(const struct udevice *dev)
{
- /* NOTE: this call should walk up the parent stack */
- return fdt_size_cells(gd->fdt_blob, dev_of_offset(dev));
+ int parent = fdt_parent_offset(gd->fdt_blob, dev_of_offset(dev));
+
+ return fdt_size_cells(gd->fdt_blob, parent);
}
static inline int dev_read_simple_addr_cells(const struct udevice *dev)
const char *path,
struct efi_device_path **device,
struct efi_device_path **file);
+ssize_t efi_dp_check_length(const struct efi_device_path *dp,
+ const size_t maxlen);
#define EFI_DP_TYPE(_dp, _type, _subtype) \
(((_dp)->type == DEVICE_PATH_TYPE_##_type) && \
* @data: buffer to which the variable value is copied
* @timep: authentication time (seconds since start of epoch)
* Return: status code
-
*/
efi_status_t __efi_runtime
efi_get_variable_mem(u16 *variable_name, const efi_guid_t *vendor, u32 *attributes,
int fdtdec_setup_mem_size_base(void);
/**
+ * fdtdec_setup_mem_size_base_lowest() - decode and setup gd->ram_size and
+ * gd->ram_start by lowest available memory base
+ *
+ * Decode the /memory 'reg' property to determine the lowest start of the memory
+ * bank bank and populate the global data with it.
+ *
+ * This function should be called from a boards dram_init(). This helper
+ * function allows for boards to query the device tree for DRAM size and start
+ * address instead of hard coding the value in the case where the memory size
+ * and start address cannot be detected automatically.
+ *
+ * @return 0 if OK, -EINVAL if the /memory node or reg property is missing or
+ * invalid
+ */
+int fdtdec_setup_mem_size_base_lowest(void);
+
+/**
* fdtdec_setup_memory_banksize() - decode and populate gd->bd->bi_dram
*
* Decode the /memory 'reg' property to determine the address and size of the
#include <clk.h>
#include <test/export.h>
+#include <asm/io.h>
#define K210_PLL_CLKR GENMASK(3, 0)
#define K210_PLL_CLKF GENMASK(9, 4)
#ifdef CONFIG_UNIT_TEST
TEST_STATIC int k210_pll_calc_config(u32 rate, u32 rate_in,
struct k210_pll_config *best);
+
+#ifndef nop
#define nop()
#endif
+#endif
+
extern const struct clk_ops k210_pll_ops;
struct clk *k210_register_pll_struct(const char *name, const char *parent_name,
#ifndef SIZE_MAX
#define SIZE_MAX (~(size_t)0)
#endif
+#ifndef SSIZE_MAX
+#define SSIZE_MAX ((ssize_t)(SIZE_MAX >> 1))
+#endif
#define U8_MAX ((u8)~0U)
#define S8_MAX ((s8)(U8_MAX>>1))
reg, shift, width, 0);
}
+static inline struct clk *sandbox_clk_gate(const char *name, const char *parent,
+ void __iomem *reg, u8 bit_idx,
+ u8 clk_gate_flags)
+{
+ return clk_register_gate(NULL, name, parent, CLK_SET_RATE_PARENT,
+ reg, bit_idx, clk_gate_flags, NULL);
+}
+
struct clk *sandbox_clk_register_gate2(struct device *dev, const char *name,
const char *parent_name,
unsigned long flags,
/*
* PROTOTYPES
*/
-int stdio_register (struct stdio_dev * dev);
+int stdio_register(struct stdio_dev *dev);
int stdio_register_dev(struct stdio_dev *dev, struct stdio_dev **devp);
/**
*/
int stdio_init(void);
-void stdio_print_current_devices(void);
-#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
+void stdio_print_current_devices(void);
int stdio_deregister(const char *devname, int force);
-int stdio_deregister_dev(struct stdio_dev *dev, int force);
-#endif
-struct list_head* stdio_get_list(void);
-struct stdio_dev* stdio_get_by_name(const char* name);
-struct stdio_dev* stdio_clone(struct stdio_dev *dev);
-#ifdef CONFIG_LCD
-int drv_lcd_init (void);
-#endif
-#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
-int drv_video_init (void);
-#endif
-#ifdef CONFIG_KEYBOARD
-int drv_keyboard_init (void);
-#endif
-#ifdef CONFIG_USB_TTY
-int drv_usbtty_init (void);
-#endif
-#ifdef CONFIG_NETCONSOLE
-int drv_nc_init (void);
-#endif
-#ifdef CONFIG_JTAG_CONSOLE
-int drv_jtag_console_init (void);
-#endif
-#ifdef CONFIG_CBMEM_CONSOLE
+/**
+ * stdio_deregister_dev() - deregister the device "devname".
+ *
+ * @dev: Stdio device to deregister
+ * @force: true to force deregistration even if in use
+ *
+ * returns 0 on success, -EBUSY if device is assigned
+ */
+int stdio_deregister_dev(struct stdio_dev *dev, int force);
+struct list_head *stdio_get_list(void);
+struct stdio_dev *stdio_get_by_name(const char *name);
+struct stdio_dev *stdio_clone(struct stdio_dev *dev);
+
+int drv_lcd_init(void);
+int drv_video_init(void);
+int drv_keyboard_init(void);
+int drv_usbtty_init(void);
+int drv_nc_init(void);
+int drv_jtag_console_init(void);
int cbmemc_init(void);
-#endif
#endif
-/*
- * SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0
*
* (C) 2006, Steven Smith <sos22@cam.ac.uk>
* (C) 2006, Grzegorz Milos <gm281@cam.ac.uk>
PM_API_MAX,
};
+enum pm_query_id {
+ PM_QID_INVALID = 0,
+ PM_QID_CLOCK_GET_NAME = 1,
+ PM_QID_CLOCK_GET_TOPOLOGY = 2,
+ PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS = 3,
+ PM_QID_CLOCK_GET_PARENTS = 4,
+ PM_QID_CLOCK_GET_ATTRIBUTES = 5,
+ PM_QID_PINCTRL_GET_NUM_PINS = 6,
+ PM_QID_PINCTRL_GET_NUM_FUNCTIONS = 7,
+ PM_QID_PINCTRL_GET_NUM_FUNCTION_GROUPS = 8,
+ PM_QID_PINCTRL_GET_FUNCTION_NAME = 9,
+ PM_QID_PINCTRL_GET_FUNCTION_GROUPS = 10,
+ PM_QID_PINCTRL_GET_PIN_GROUPS = 11,
+ PM_QID_CLOCK_GET_NUM_CLOCKS = 12,
+ PM_QID_CLOCK_GET_MAX_DIVISOR = 13,
+};
+
#define PM_SIP_SVC 0xc2000000
#define ZYNQMP_PM_VERSION_MAJOR 1
#define PMUFW_V1_0 ((1 << ZYNQMP_PM_VERSION_MAJOR_SHIFT) | 0)
+/*
+ * Return payload size
+ * Not every firmware call expects the same amount of return bytes, however the
+ * firmware driver always copies 5 bytes from RX buffer to the ret_payload
+ * buffer. Therefore allocating with this defined value is recommended to avoid
+ * overflows.
+ */
+#define PAYLOAD_ARG_CNT 5U
+
unsigned int zynqmp_firmware_version(void);
void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size);
int xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2,
if (*size < len)
return EFI_INVALID_PARAMETER;
lo->file_path = (struct efi_device_path *)data;
- /*
- * TODO: validate device path. There should be an end node within
- * the indicated file_path_length.
- */
+ if (efi_dp_check_length(lo->file_path, len) < 0)
+ return EFI_INVALID_PARAMETER;
data += len;
*size -= len;
return EFI_SUCCESS;
}
+
+/**
+ * efi_dp_check_length() - check length of a device path
+ *
+ * @dp: pointer to device path
+ * @maxlen: maximum length of the device path
+ * Return:
+ * * length of the device path if it is less or equal @maxlen
+ * * -1 if the device path is longer then @maxlen
+ * * -1 if a device path node has a length of less than 4
+ * * -EINVAL if maxlen exceeds SSIZE_MAX
+ */
+ssize_t efi_dp_check_length(const struct efi_device_path *dp,
+ const size_t maxlen)
+{
+ ssize_t ret = 0;
+ u16 len;
+
+ if (maxlen > SSIZE_MAX)
+ return -EINVAL;
+ for (;;) {
+ len = dp->length;
+ if (len < 4)
+ return -1;
+ ret += len;
+ if (ret > maxlen)
+ return -1;
+ if (dp->type == DEVICE_PATH_TYPE_END &&
+ dp->sub_type == DEVICE_PATH_SUB_TYPE_END)
+ return ret;
+ dp = (const struct efi_device_path *)((const u8 *)dp + len);
+ }
+}
* efi_reset_system() - reset system
*
* This function implements the ResetSystem() runtime service after
- * SetVirtualAddressMap() is called. It only executes an endless loop.
+ * SetVirtualAddressMap() is called. As this placeholder cannot reset the
+ * system it simply return to the caller.
+ *
* Boards may override the helpers below to implement reset functionality.
*
* See the Unified Extensible Firmware Interface (UEFI) specification for
efi_status_t reset_status,
unsigned long data_size, void *reset_data)
{
- /* Nothing we can do */
- while (1) { }
+ return;
}
/**
efi_selftest_memory.o \
efi_selftest_open_protocol.o \
efi_selftest_register_notify.o \
+efi_selftest_reset.o \
efi_selftest_set_virtual_address_map.o \
efi_selftest_textinput.o \
efi_selftest_textinputex.o \
* Copyright (c) 2017 Heinrich Schuchardt <xypron.glpk@gmx.de>
*/
+#include <command.h>
#include <efi_selftest.h>
#include <vsprintf.h>
/* Reset system */
efi_st_printf("Preparing for reset. Press any key...\n");
efi_st_get_key();
- runtime->reset_system(EFI_RESET_WARM, EFI_NOT_READY,
- sizeof(reset_message), reset_message);
+
+ if (IS_ENABLED(CONFIG_EFI_HAVE_RUNTIME_RESET))
+ runtime->reset_system(EFI_RESET_WARM, EFI_NOT_READY,
+ sizeof(reset_message), reset_message);
+ else
+ do_reset(NULL, 0, 0, NULL);
+
efi_st_printf("\n");
efi_st_error("Reset failed\n");
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * efi_selftest_reset
+ *
+ * Copyright (c) 2020 Heinrich Schuchardt <xypron.glpk@gmx.de>
+ *
+ * This test checks the following service at boot time or runtime:
+ * ResetSystem()
+ */
+
+#include <efi_selftest.h>
+
+static struct efi_runtime_services *runtime;
+
+/*
+ * Setup unit test.
+ *
+ * @handle: handle of the loaded image
+ * @systable: system table
+ * @return: EFI_ST_SUCCESS for success
+ */
+static int setup(const efi_handle_t handle,
+ const struct efi_system_table *systable)
+{
+ runtime = systable->runtime;
+ return EFI_ST_SUCCESS;
+}
+
+/*
+ * Execute unit test.
+ *
+ * @return: EFI_ST_SUCCESS for success
+ */
+static int execute(void)
+{
+ u16 reset_data[] = L"Reset by selftest";
+
+ runtime->reset_system(EFI_RESET_COLD, EFI_SUCCESS,
+ sizeof(reset_data), reset_data);
+ efi_st_error("Reset failed.\n");
+ return EFI_ST_FAILURE;
+}
+
+EFI_UNIT_TEST(reset) = {
+ .name = "reset system",
+ .phase = EFI_EXECUTE_BEFORE_BOOTTIME_EXIT,
+ .setup = setup,
+ .execute = execute,
+ .on_request = true,
+};
+
+EFI_UNIT_TEST(resetrt) = {
+ .name = "reset system runtime",
+ .phase = EFI_SETUP_BEFORE_BOOTTIME_EXIT,
+ .setup = setup,
+ .execute = execute,
+ .on_request = true,
+};
#include <asm/sections.h>
#include <linux/ctype.h>
#include <linux/lzo.h>
+#include <linux/ioport.h>
DECLARE_GLOBAL_DATA_PTR;
int fdtdec_setup_mem_size_base(void)
{
- int ret, mem;
- struct fdt_resource res;
+ int ret;
+ ofnode mem;
+ struct resource res;
- mem = fdt_path_offset(gd->fdt_blob, "/memory");
- if (mem < 0) {
+ mem = ofnode_path("/memory");
+ if (!ofnode_valid(mem)) {
debug("%s: Missing /memory node\n", __func__);
return -EINVAL;
}
- ret = fdt_get_resource(gd->fdt_blob, mem, "reg", 0, &res);
+ ret = ofnode_read_resource(mem, 0, &res);
if (ret != 0) {
debug("%s: Unable to decode first memory bank\n", __func__);
return -EINVAL;
#if defined(CONFIG_NR_DRAM_BANKS)
-static int get_next_memory_node(const void *blob, int mem)
+ofnode get_next_memory_node(ofnode mem)
{
do {
- mem = fdt_node_offset_by_prop_value(gd->fdt_blob, mem,
- "device_type", "memory", 7);
- } while (!fdtdec_get_is_enabled(blob, mem));
+ mem = ofnode_by_prop_value(mem, "device_type", "memory", 7);
+ } while (!ofnode_is_available(mem));
return mem;
}
int fdtdec_setup_memory_banksize(void)
{
- int bank, ret, mem, reg = 0;
- struct fdt_resource res;
+ int bank, ret, reg = 0;
+ struct resource res;
+ ofnode mem = ofnode_null();
- mem = get_next_memory_node(gd->fdt_blob, -1);
- if (mem < 0) {
+ mem = get_next_memory_node(mem);
+ if (!ofnode_valid(mem)) {
debug("%s: Missing /memory node\n", __func__);
return -EINVAL;
}
for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {
- ret = fdt_get_resource(gd->fdt_blob, mem, "reg", reg++, &res);
- if (ret == -FDT_ERR_NOTFOUND) {
+ ret = ofnode_read_resource(mem, reg++, &res);
+ if (ret < 0) {
reg = 0;
- mem = get_next_memory_node(gd->fdt_blob, mem);
- if (mem == -FDT_ERR_NOTFOUND)
+ mem = get_next_memory_node(mem);
+ if (ofnode_valid(mem))
break;
- ret = fdt_get_resource(gd->fdt_blob, mem, "reg", reg++, &res);
- if (ret == -FDT_ERR_NOTFOUND)
+ ret = ofnode_read_resource(mem, reg++, &res);
+ if (ret < 0)
break;
}
- if (ret != 0) {
+
+ if (ret != 0)
return -EINVAL;
- }
gd->bd->bi_dram[bank].start = (phys_addr_t)res.start;
gd->bd->bi_dram[bank].size =
return 0;
}
+
+int fdtdec_setup_mem_size_base_lowest(void)
+{
+ int bank, ret, reg = 0;
+ struct resource res;
+ unsigned long base;
+ phys_size_t size;
+ ofnode mem = ofnode_null();
+
+ gd->ram_base = (unsigned long)~0;
+
+ mem = get_next_memory_node(mem);
+ if (!ofnode_valid(mem)) {
+ debug("%s: Missing /memory node\n", __func__);
+ return -EINVAL;
+ }
+
+ for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {
+ ret = ofnode_read_resource(mem, reg++, &res);
+ if (ret < 0) {
+ reg = 0;
+ mem = get_next_memory_node(mem);
+ if (ofnode_valid(mem))
+ break;
+
+ ret = ofnode_read_resource(mem, reg++, &res);
+ if (ret < 0)
+ break;
+ }
+
+ if (ret != 0)
+ return -EINVAL;
+
+ base = (unsigned long)res.start;
+ size = (phys_size_t)(res.end - res.start + 1);
+
+ if (gd->ram_base > base && size) {
+ gd->ram_base = base;
+ gd->ram_size = size;
+ debug("%s: Initial DRAM base %lx size %lx\n",
+ __func__, base, (unsigned long)size);
+ }
+ }
+
+ return 0;
+}
#endif
#if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
if (flags & SUPPRESS) {
size_t sum = 0;
- if ((n = inr) < width) {
+ n = inr;
+ if (n < width) {
sum += n;
width -= n;
inp += n;
CONFIG_SPI_IDLE_VAL
CONFIG_SPI_LENGTH
CONFIG_SPI_N25Q256A_RESET
-CONFIG_SPLASHIMAGE_GUARD
-CONFIG_SPLASH_SCREEN
-CONFIG_SPLASH_SCREEN_ALIGN
-CONFIG_SPLASH_SOURCE
CONFIG_SPLL_FREQ
CONFIG_SPL_
CONFIG_SPL_ATMEL_SIZE
CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
CONFIG_SYS_DEFAULT_VIDEO_MODE
CONFIG_SYS_DEF_EEPROM_ADDR
-CONFIG_SYS_DEVICE_NULLDEV
CONFIG_SYS_DFU_DATA_BUF_SIZE
CONFIG_SYS_DFU_MAX_FILE_SIZE
CONFIG_SYS_DIAG_ADDR
ut_assertok(dm_bootcount_get(dev, &val));
ut_assert(val == 0xab);
+ ut_assertok(uclass_get_device(UCLASS_BOOTCOUNT, 1, &dev));
+ ut_assertok(dm_bootcount_set(dev, 0));
+ ut_assertok(dm_bootcount_get(dev, &val));
+ ut_assert(val == 0);
+ ut_assertok(dm_bootcount_set(dev, 0xab));
+ ut_assertok(dm_bootcount_get(dev, &val));
+ ut_assert(val == 0xab);
+
return 0;
}
ret = clk_get_by_id(SANDBOX_CLK_ECSPI_ROOT, &clk);
ut_assertok(ret);
ut_asserteq_str("ecspi_root", clk->dev->name);
+ ut_asserteq(CLK_SET_RATE_PARENT, clk->flags);
/* Test for clk_get_parent_rate() */
ret = clk_get_by_id(SANDBOX_CLK_ECSPI1, &clk);
ut_assertok(ret);
ut_asserteq_str("ecspi1", clk->dev->name);
+ ut_asserteq(CLK_SET_RATE_PARENT, clk->flags);
+
+ rate = clk_get_parent_rate(clk);
+ ut_asserteq(rate, 20000000);
+
+ /* test the gate of CCF */
+ ret = clk_get_by_id(SANDBOX_CLK_ECSPI0, &clk);
+ ut_assertok(ret);
+ ut_asserteq_str("ecspi0", clk->dev->name);
+ ut_asserteq(CLK_SET_RATE_PARENT, clk->flags);
rate = clk_get_parent_rate(clk);
ut_asserteq(rate, 20000000);
ret = clk_get_by_id(SANDBOX_CLK_USDHC1_SEL, &clk);
ut_assertok(ret);
ut_asserteq_str("usdhc1_sel", clk->dev->name);
+ ut_asserteq(CLK_SET_RATE_NO_REPARENT, clk->flags);
rate = clk_get_parent_rate(clk);
ut_asserteq(rate, 60000000);
+ rate = clk_get_rate(clk);
+ ut_asserteq(rate, 60000000);
+
+ ret = clk_get_by_id(SANDBOX_CLK_PLL3_80M, &pclk);
+ ut_assertok(ret);
+
+ ret = clk_set_parent(clk, pclk);
+ ut_assertok(ret);
+
+ rate = clk_get_rate(clk);
+ ut_asserteq(rate, 80000000);
+
ret = clk_get_by_id(SANDBOX_CLK_USDHC2_SEL, &clk);
ut_assertok(ret);
ut_asserteq_str("usdhc2_sel", clk->dev->name);
+ ut_asserteq(CLK_SET_RATE_NO_REPARENT, clk->flags);
rate = clk_get_parent_rate(clk);
ut_asserteq(rate, 80000000);
pclk = clk_get_parent(clk);
ut_asserteq_str("pll3_80m", pclk->dev->name);
+ ut_asserteq(CLK_SET_RATE_PARENT, pclk->flags);
+
+ rate = clk_get_rate(clk);
+ ut_asserteq(rate, 80000000);
+
+ ret = clk_get_by_id(SANDBOX_CLK_PLL3_60M, &pclk);
+ ut_assertok(ret);
+
+ ret = clk_set_parent(clk, pclk);
+ ut_assertok(ret);
+
+ rate = clk_get_rate(clk);
+ ut_asserteq(rate, 60000000);
/* Test the composite of CCF */
ret = clk_get_by_id(SANDBOX_CLK_I2C, &clk);
ut_assertok(ret);
ut_asserteq_str("i2c", clk->dev->name);
+ ut_asserteq(CLK_SET_RATE_UNGATE, clk->flags);
rate = clk_get_rate(clk);
ut_asserteq(rate, 60000000);
ut_assert(phy2.dev != phy3.dev);
/* Try to get a non-existing phy */
- ut_asserteq(-ENODEV, uclass_get_device(UCLASS_PHY, 3, &dev));
+ ut_asserteq(-ENODEV, uclass_get_device(UCLASS_PHY, 4, &dev));
ut_asserteq(-ENODATA, generic_phy_get_by_name(parent,
"phy_not_existing", &phy1_method1));
}
DM_TEST(dm_test_fdt_translation, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+static int dm_test_fdt_get_addr_ptr_flat(struct unit_test_state *uts)
+{
+ struct udevice *gpio, *dev;
+ void *ptr;
+
+ /* Test for missing reg property */
+ ut_assertok(uclass_first_device_err(UCLASS_GPIO, &gpio));
+ ut_assertnull(devfdt_get_addr_ptr(gpio));
+
+ ut_assertok(uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, true, &dev));
+ ptr = devfdt_get_addr_ptr(dev);
+ ut_asserteq_ptr((void *)0x8000, ptr);
+
+ return 0;
+}
+DM_TEST(dm_test_fdt_get_addr_ptr_flat,
+ UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE);
+
static int dm_test_fdt_remap_addr_flat(struct unit_test_state *uts)
{
struct udevice *dev;
# (C) Copyright 2018
# Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
obj-y += cmd_ut_lib.o
+obj-$(CONFIG_EFI_LOADER) += efi_device_path.o
obj-$(CONFIG_EFI_SECURE_BOOT) += efi_image_region.o
obj-y += hexdump.o
obj-y += lmb.o
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Test device path functions
+ *
+ * Copyright (c) 2020 Heinrich Schuchardt <xypron.glpk@gmx.de>
+ */
+
+#include <common.h>
+#include <efi_loader.h>
+#include <test/lib.h>
+#include <test/test.h>
+#include <test/ut.h>
+
+static int lib_test_efi_dp_check_length(struct unit_test_state *uts)
+{
+ /* end of device path */
+ u8 d1[] __aligned(2) = {
+ 0x7f, 0xff, 0x04, 0x00 };
+ /* device path node with length less then 4 */
+ u8 d2[] __aligned(2) = {
+ 0x01, 0x02, 0x02, 0x00, 0x04, 0x00, 0x7f, 0xff, 0x04, 0x00 };
+ /* well formed device path */
+ u8 d3[] __aligned(2) = {
+ 0x03, 0x02, 0x08, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x7f, 0xff, 0x04, 0x00 };
+
+ struct efi_device_path *p1 = (struct efi_device_path *)d1;
+ struct efi_device_path *p2 = (struct efi_device_path *)d2;
+ struct efi_device_path *p3 = (struct efi_device_path *)d3;
+
+ ut_asserteq((ssize_t)-EINVAL, efi_dp_check_length(p1, SIZE_MAX));
+ ut_asserteq((ssize_t)sizeof(d1), efi_dp_check_length(p1, sizeof(d1)));
+ ut_asserteq((ssize_t)sizeof(d1),
+ efi_dp_check_length(p1, sizeof(d1) + 4));
+ ut_asserteq((ssize_t)-1, efi_dp_check_length(p1, sizeof(d1) - 1));
+
+ ut_asserteq((ssize_t)-1, efi_dp_check_length(p2, sizeof(d2)));
+
+ ut_asserteq((ssize_t)-1, efi_dp_check_length(p3, sizeof(d3) - 1));
+ ut_asserteq((ssize_t)sizeof(d3), efi_dp_check_length(p3, sizeof(d3)));
+ ut_asserteq((ssize_t)sizeof(d3), efi_dp_check_length(p3, SSIZE_MAX));
+ ut_asserteq((ssize_t)-EINVAL,
+ efi_dp_check_length(p3, (size_t)SSIZE_MAX + 1));
+ ut_asserteq((ssize_t)sizeof(d3),
+ efi_dp_check_length(p3, sizeof(d3) + 4));
+
+ return 0;
+}
+
+LIB_TEST(lib_test_efi_dp_check_length, 0);
def in_tree(response, name, uclass, drv, depth, last_child):
lines = [x.strip() for x in response.splitlines()]
- leaf = ' ' * 4 * depth;
- if not last_child:
- leaf = leaf + r'\|'
- else:
- leaf = leaf + '`'
+ leaf = ''
+ if depth != 0:
+ leaf = ' ' + ' ' * (depth - 1) ;
+ if not last_child:
+ leaf = leaf + r'\|'
+ else:
+ leaf = leaf + '`'
+
leaf = leaf + '-- ' + name
- line = (r' *{:10.10} [0-9]* \[ [ +] \] {:20.20} {}$'
+ line = (r' *{:10.10} [0-9]* \[ [ +] \] {:20.20} [` |]{}$'
.format(uclass, drv, leaf))
prog = re.compile(line)
for l in lines:
@pytest.mark.buildconfigspec('cmd_bind')
def test_bind_unbind_with_node(u_boot_console):
- #bind /bind-test. Device should come up as well as its children
- response = u_boot_console.run_command('bind /bind-test simple_bus')
- assert response == ''
tree = u_boot_console.run_command('dm tree')
assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
assert in_tree(tree, 'bind-test-child1', 'phy', 'phy_sandbox', 1, False)
# Test Case 1b, PK without AUTHENTICATED_WRITE_ACCESS
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -i 4000000,$filesize PK'])
+ 'setenv -e -nv -bs -rt -i 4000000:$filesize PK'])
assert 'Failed to set EFI variable' in ''.join(output)
with u_boot_console.log.section('Test Case 1c'):
# Test Case 1c, install PK
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK',
'printenv -e -n PK'])
assert 'PK:' in ''.join(output)
# Test Case 1d, db/dbx without KEK
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db'])
assert 'Failed to set EFI variable' in ''.join(output)
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx'])
assert 'Failed to set EFI variable' in ''.join(output)
with u_boot_console.log.section('Test Case 1e'):
# Test Case 1e, install KEK
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -i 4000000,$filesize KEK'])
+ 'setenv -e -nv -bs -rt -i 4000000:$filesize KEK'])
assert 'Failed to set EFI variable' in ''.join(output)
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'printenv -e -n KEK'])
assert 'KEK:' in ''.join(output)
# Test Case 1f, install db
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -i 4000000,$filesize db'])
+ 'setenv -e -nv -bs -rt -i 4000000:$filesize db'])
assert 'Failed to set EFI variable' in ''.join(output)
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'printenv -e -n -guid d719b2cb-3d3a-4596-a3bc-dad00e67656f db'])
assert 'Failed to set EFI variable' not in ''.join(output)
assert 'db:' in ''.join(output)
# Test Case 1g, install dbx
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 dbx.auth',
- 'setenv -e -nv -bs -rt -i 4000000,$filesize dbx'])
+ 'setenv -e -nv -bs -rt -i 4000000:$filesize dbx'])
assert 'Failed to set EFI variable' in ''.join(output)
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 dbx.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx',
'printenv -e -n -guid d719b2cb-3d3a-4596-a3bc-dad00e67656f dbx'])
assert 'Failed to set EFI variable' not in ''.join(output)
assert 'dbx:' in ''.join(output)
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK',
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'printenv -e -n -guid d719b2cb-3d3a-4596-a3bc-dad00e67656f db'])
assert 'Failed to set EFI variable' not in ''.join(output)
assert 'db:' in ''.join(output)
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db1.auth',
- 'setenv -e -nv -bs -rt -i 4000000,$filesize db'])
+ 'setenv -e -nv -bs -rt -i 4000000:$filesize db'])
assert 'Failed to set EFI variable' in ''.join(output)
with u_boot_console.log.section('Test Case 2b'):
# Test Case 2b, update without correct signature
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db.esl',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db'])
assert 'Failed to set EFI variable' in ''.join(output)
with u_boot_console.log.section('Test Case 2c'):
# Test Case 2c, update with correct signature
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db1.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'printenv -e -n -guid d719b2cb-3d3a-4596-a3bc-dad00e67656f db'])
assert 'Failed to set EFI variable' not in ''.join(output)
assert 'db:' in ''.join(output)
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK',
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'printenv -e -n -guid d719b2cb-3d3a-4596-a3bc-dad00e67656f db'])
assert 'Failed to set EFI variable' not in ''.join(output)
assert 'db:' in ''.join(output)
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db1.auth',
- 'setenv -e -nv -bs -rt -a -i 4000000,$filesize db'])
+ 'setenv -e -nv -bs -rt -a -i 4000000:$filesize db'])
assert 'Failed to set EFI variable' in ''.join(output)
with u_boot_console.log.section('Test Case 3b'):
# Test Case 3b, update without correct signature
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db.esl',
- 'setenv -e -nv -bs -rt -at -a -i 4000000,$filesize db'])
+ 'setenv -e -nv -bs -rt -at -a -i 4000000:$filesize db'])
assert 'Failed to set EFI variable' in ''.join(output)
with u_boot_console.log.section('Test Case 3c'):
# Test Case 3c, update with correct signature
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db1.auth',
- 'setenv -e -nv -bs -rt -at -a -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -a -i 4000000:$filesize db',
'printenv -e -n -guid d719b2cb-3d3a-4596-a3bc-dad00e67656f db'])
assert 'Failed to set EFI variable' not in ''.join(output)
assert 'db:' in ''.join(output)
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK',
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'printenv -e -n -guid d719b2cb-3d3a-4596-a3bc-dad00e67656f db'])
assert 'Failed to set EFI variable' not in ''.join(output)
assert 'db:' in ''.join(output)
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK',
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'printenv -e -n PK'])
assert 'Failed to set EFI variable' not in ''.join(output)
assert 'PK:' in ''.join(output)
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 PK_null.esl',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK',
'printenv -e -n PK'])
assert 'Failed to set EFI variable' in ''.join(output)
assert 'PK:' in ''.join(output)
# Test Case 5b, Uninstall PK with correct signature
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 PK_null.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK',
'printenv -e -n PK'])
assert 'Failed to set EFI variable' not in ''.join(output)
assert '\"PK\" not defined' in ''.join(output)
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
'efidebug boot add 1 HELLO1 host 0:1 /helloworld.efi.signed ""',
# Test Case 2b, authenticated by db
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
'efidebug boot next 2',
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx',
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
'efidebug boot add 1 HELLO host 0:1 /helloworld.efi.signed ""',
# Test Case 3b, rejected by dbx even if db allows
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
'efidebug boot next 1',
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 dbx_hash.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx',
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
'efidebug boot add 1 HELLO host 0:1 /helloworld.efi.signed ""',
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
'efidebug boot add 1 HELLO host 0:1 /helloworld.efi.signed_2sigs ""',
# Test Case 5b, authenticated if both signatures are verified
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db1.auth',
- 'setenv -e -nv -bs -rt -at -a -i 4000000,$filesize db'])
+ 'setenv -e -nv -bs -rt -at -a -i 4000000:$filesize db'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
'efidebug boot next 1',
# certificate) is revoked
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 dbx_hash.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
'efidebug boot next 1',
# Test Case 5d, rejected if both of signatures are revoked
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 dbx_hash1.auth',
- 'setenv -e -nv -bs -rt -at -a -i 4000000,$filesize dbx'])
+ 'setenv -e -nv -bs -rt -at -a -i 4000000:$filesize dbx'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
'efidebug boot next 1',
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 db_hello_signed.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
'efidebug boot add 1 HELLO host 0:1 /helloworld.efi.signed ""',
# Test Case 6b, rejected by TEST_db certificate in dbx
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 dbx_db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
'efidebug boot next 1',
# Test Case 6c, rejected by image's digest in dbx
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'fatload host 0:1 4000000 dbx_hello_signed.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
'efidebug boot next 1',
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 db_c.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
# Test Case 2b, signed and authenticated by root CA
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db_b.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'efidebug boot next 1',
'efidebug test bootmgr'])
assert '\'HELLO_abc\' failed' in ''.join(output)
# Test Case 2c, signed and authenticated by root CA
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db_c.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'efidebug boot next 1',
'efidebug test bootmgr'])
assert 'Hello, world!' in ''.join(output)
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 dbx_b.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx',
'fatload host 0:1 4000000 db_c.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
# Test Case 3b, revoked by root CA in dbx
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 dbx_c.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx',
'efidebug boot next 1',
'efidebug test bootmgr'])
assert '\'HELLO_abc\' failed' in ''.join(output)
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 db_hello.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db',
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
'fatload host 0:1 4000000 db_hello.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize dbx',
'fatload host 0:1 4000000 KEK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize KEK',
'fatload host 0:1 4000000 PK.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize PK'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
# Test Case 3b, rejected by dbx even if db allows
output = u_boot_console.run_command_list([
'fatload host 0:1 4000000 db_hello.auth',
- 'setenv -e -nv -bs -rt -at -i 4000000,$filesize db'])
+ 'setenv -e -nv -bs -rt -at -i 4000000:$filesize db'])
assert 'Failed to set EFI variable' not in ''.join(output)
output = u_boot_console.run_command_list([
import os
import random
import string
+import subprocess
def sqfs_get_random_letters(size):
letters = []
file.write(content)
file.close()
-# generate image with three files and a symbolic link
-def sqfs_generate_image(cons):
- src = os.path.join(cons.config.build_dir, "sqfs_src/")
- dest = os.path.join(cons.config.build_dir, "sqfs")
- os.mkdir(src)
- sqfs_generate_file(src + "frag_only", 100)
- sqfs_generate_file(src + "blks_frag", 5100)
- sqfs_generate_file(src + "blks_only", 4096)
- os.symlink("frag_only", src + "sym")
- os.system("mksquashfs " + src + " " + dest + " -b 4096 -always-use-fragments")
-
-# removes all files created by sqfs_generate_image()
-def sqfs_clean(cons):
- src = os.path.join(cons.config.build_dir, "sqfs_src/")
- dest = os.path.join(cons.config.build_dir, "sqfs")
- os.remove(src + "frag_only")
- os.remove(src + "blks_frag")
- os.remove(src + "blks_only")
- os.remove(src + "sym")
- os.rmdir(src)
- os.remove(dest)
+class Compression:
+ def __init__(self, name, files, sizes, block_size = 4096):
+ self.name = name
+ self.files = files
+ self.sizes = sizes
+ self.mksquashfs_opts = " -b " + str(block_size) + " -comp " + self.name
+
+ def add_opt(self, opt):
+ self.mksquashfs_opts += " " + opt
+
+ def gen_image(self, build_dir):
+ src = os.path.join(build_dir, "sqfs_src/")
+ os.mkdir(src)
+ for (f, s) in zip(self.files, self.sizes):
+ sqfs_generate_file(src + f, s)
+
+ # the symbolic link always targets the first file
+ os.symlink(self.files[0], src + "sym")
+
+ sqfs_img = os.path.join(build_dir, "sqfs-" + self.name)
+ i_o = src + " " + sqfs_img
+ opts = self.mksquashfs_opts
+ try:
+ subprocess.run(["mksquashfs " + i_o + opts], shell = True, check = True)
+ except:
+ print("mksquashfs error. Compression type: " + self.name)
+ raise RuntimeError
+
+ def clean_source(self, build_dir):
+ src = os.path.join(build_dir, "sqfs_src/")
+ for f in self.files:
+ os.remove(src + f)
+ os.remove(src + "sym")
+ os.rmdir(src)
+
+ def cleanup(self, build_dir):
+ self.clean_source(build_dir)
+ sqfs_img = os.path.join(build_dir, "sqfs-" + self.name)
+ os.remove(sqfs_img)
+
+files = ["blks_only", "blks_frag", "frag_only"]
+sizes = [4096, 5100, 100]
+gzip = Compression("gzip", files, sizes)
+zstd = Compression("zstd", files, sizes)
+lzo = Compression("lzo", files, sizes)
+
+# use fragment blocks for files larger than block_size
+gzip.add_opt("-always-use-fragments")
+zstd.add_opt("-always-use-fragments")
+
+# avoid fragments if lzo is used
+lzo.add_opt("-no-fragments")
+
+comp_opts = [gzip, zstd, lzo]
@pytest.mark.buildconfigspec('fs_squashfs')
@pytest.mark.requiredtool('mksquashfs')
def test_sqfs_load(u_boot_console):
- cons = u_boot_console
- sqfs_generate_image(cons)
+ build_dir = u_boot_console.config.build_dir
command = "sqfsload host 0 $kernel_addr_r "
- path = os.path.join(cons.config.build_dir, "sqfs")
- try:
+ for opt in comp_opts:
+ # generate and load the squashfs image
+ try:
+ opt.gen_image(build_dir)
+ except RuntimeError:
+ opt.clean_source(build_dir)
+ # skip unsupported compression types
+ continue
+
+ path = os.path.join(build_dir, "sqfs-" + opt.name)
output = u_boot_console.run_command("host bind 0 " + path)
+
output = u_boot_console.run_command(command + "xxx")
assert "File not found." in output
- output = u_boot_console.run_command(command + "frag_only")
- assert "100 bytes read in" in output
- output = u_boot_console.run_command(command + "blks_frag")
- assert "5100 bytes read in" in output
- output = u_boot_console.run_command(command + "blks_only")
- assert "4096 bytes read in" in output
+
+ for (f, s) in zip(opt.files, opt.sizes):
+ try:
+ output = u_boot_console.run_command(command + f)
+ assert str(s) in output
+ except:
+ assert False
+ opt.cleanup(build_dir)
+
+ # test symbolic link
output = u_boot_console.run_command(command + "sym")
- assert "100 bytes read in" in output
- except:
- sqfs_clean(cons)
- sqfs_clean(cons)
+ assert str(opt.sizes[0]) in output
+
+ # remove generated files
+ opt.cleanup(build_dir)
@pytest.mark.buildconfigspec('fs_squashfs')
@pytest.mark.requiredtool('mksquashfs')
def test_sqfs_ls(u_boot_console):
- cons = u_boot_console
- sqfs_generate_image(cons)
- path = os.path.join(cons.config.build_dir, "sqfs")
- try:
+ build_dir = u_boot_console.config.build_dir
+ for opt in comp_opts:
+ try:
+ opt.gen_image(build_dir)
+ except RuntimeError:
+ opt.clean_source(build_dir)
+ # skip unsupported compression types
+ continue
+ path = os.path.join(build_dir, "sqfs-" + opt.name)
output = u_boot_console.run_command("host bind 0 " + path)
- output = u_boot_console.run_command("sqfsls host 0")
- assert "4 file(s), 0 dir(s)" in output
- assert "<SYM> sym" in output
- output = u_boot_console.run_command("sqfsls host 0 xxx")
- assert "** Cannot find directory. **" in output
- except:
- sqfs_clean(cons)
- sqfs_clean(cons)
+
+ try:
+ # list files in root directory
+ output = u_boot_console.run_command("sqfsls host 0")
+ assert str(len(opt.files) + 1) + " file(s), 0 dir(s)" in output
+ assert "<SYM> sym" in output
+ output = u_boot_console.run_command("sqfsls host 0 xxx")
+ assert "** Cannot find directory. **" in output
+ except:
+ opt.cleanup(build_dir)
+ assert False
+ opt.cleanup(build_dir)
#
from collections import OrderedDict
+import glob
import os
import sys
from patman import tools
return node
return None
+def GetEntryModules(include_testing=True):
+ """Get a set of entry class implementations
+
+ Returns:
+ Set of paths to entry class filenames
+ """
+ our_path = os.path.dirname(os.path.realpath(__file__))
+ glob_list = glob.glob(os.path.join(our_path, 'etype/*.py'))
+ return set([os.path.splitext(os.path.basename(item))[0]
+ for item in glob_list
+ if include_testing or '_testing' not in item])
+
def WriteEntryDocs(modules, test_missing=None):
"""Write out documentation for all entries
data extracted from the entry
"""
global Image
- from image import Image
+ from binman.image import Image
image = Image.FromFile(image_fname)
entry = image.FindEntryPath(entry_path)
return 0
# Put these here so that we can import this module without libfdt
- from image import Image
+ from binman.image import Image
from binman import state
if args.cmd in ['ls', 'extract', 'replace']:
from binman import elf
from binman import elf_test
from binman import fmap_util
-from binman import main
from binman import state
from dtoc import fdt
from dtoc import fdt_util
from binman.etype import fdtmap
from binman.etype import image_header
-from image import Image
+from binman.image import Image
from patman import command
from patman import test_util
from patman import tools
def testEntryDocs(self):
"""Test for creation of entry documentation"""
with test_util.capture_sys_output() as (stdout, stderr):
- control.WriteEntryDocs(main.GetEntryModules())
+ control.WriteEntryDocs(control.GetEntryModules())
self.assertTrue(len(stdout.getvalue()) > 0)
def testEntryDocsMissing(self):
"""Test handling of missing entry documentation"""
with self.assertRaises(ValueError) as e:
with test_util.capture_sys_output() as (stdout, stderr):
- control.WriteEntryDocs(main.GetEntryModules(), 'u_boot')
+ control.WriteEntryDocs(control.GetEntryModules(), 'u_boot')
self.assertIn('Documentation is missing for modules: u_boot',
str(e.exception))
import unittest
-from image import Image
+from binman.image import Image
from patman.test_util import capture_sys_output
class TestImage(unittest.TestCase):
"""See README for more information"""
from distutils.sysconfig import get_python_lib
-import glob
import os
import site
import sys
from binman import fdt_test
from binman import ftest
from binman import image_test
- from binman import test
import doctest
result = unittest.TestResult()
return test_util.ReportResult('binman', test_name, result)
-def GetEntryModules(include_testing=True):
- """Get a set of entry class implementations
-
- Returns:
- Set of paths to entry class filenames
- """
- glob_list = glob.glob(os.path.join(our_path, 'etype/*.py'))
- return set([os.path.splitext(os.path.basename(item))[0]
- for item in glob_list
- if include_testing or '_testing' not in item])
-
def RunTestCoverage(toolpath):
"""Run the tests and check that we get 100% coverage"""
- glob_list = GetEntryModules(False)
+ glob_list = control.GetEntryModules(False)
all_set = set([os.path.splitext(os.path.basename(item))[0]
for item in glob_list if '_testing' not in item])
extra_args = ''
args.toolpath)
elif args.cmd == 'entry-docs':
- control.WriteEntryDocs(GetEntryModules())
+ control.WriteEntryDocs(control.GetEntryModules())
else:
try:
--- /dev/null
+# SPDX-License-Identifier: GPL-2.0+
+
+from distutils.core import setup
+setup(name='binman',
+ version='1.0',
+ license='GPL-2.0+',
+ scripts=['binman'],
+ packages=['binman', 'binman.etype'],
+ package_dir={'binman': ''},
+ package_data={'binman': ['README', 'README.entries']},
+ classifiers=['Environment :: Console',
+ 'Topic :: Software Development :: Embedded Systems'])
--- /dev/null
+# SPDX-License-Identifier: GPL-2.0+
+
+from distutils.core import setup
+setup(name='dtoc',
+ version='1.0',
+ license='GPL-2.0+',
+ scripts=['dtoc'],
+ packages=['dtoc'],
+ package_dir={'dtoc': ''},
+ package_data={'dtoc': ['README']},
+ classifiers=['Environment :: Console',
+ 'Topic :: Software Development :: Embedded Systems'])
if dirpath == os.path.join('include', 'generated'):
continue
for filename in filenames:
- if not filename.endswith(('~', '.dts', '.dtsi')):
+ if not filename.endswith(('~', '.dts', '.dtsi', '.bin',
+ '.elf')):
header_path = os.path.join(dirpath, filename)
# This file contains UTF-16 data and no CONFIG symbols
if header_path == 'include/video_font_data.h':