Merge tag 'efi-2020-07-rc2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
authorTom Rini <trini@konsulko.com>
Thu, 30 Apr 2020 19:11:06 +0000 (15:11 -0400)
committerTom Rini <trini@konsulko.com>
Thu, 30 Apr 2020 19:11:06 +0000 (15:11 -0400)
Pull request for UEFI sub-system for efi-2020-07-rc2

This pull request contains bug fixes needed due to the merged changes for
EFI secure boot.

Patches are supplied to identify EFI system partitions.

169 files changed:
arch/arm/Kconfig
arch/arm/cpu/armv8/fsl-layerscape/Kconfig
arch/arm/cpu/armv8/fsl-layerscape/cpu.c
arch/arm/cpu/armv8/fsl-layerscape/fdt.c
arch/arm/cpu/armv8/fsl-layerscape/soc.c
arch/arm/dts/Makefile
arch/arm/dts/fsl-ls1028a-qds-duart.dts [new file with mode: 0644]
arch/arm/dts/fsl-ls1028a-qds-lpuart.dts [new file with mode: 0644]
arch/arm/dts/fsl-ls1028a-qds.dts [deleted file]
arch/arm/dts/fsl-ls1028a-qds.dtsi [new file with mode: 0644]
arch/arm/dts/fsl-ls1028a.dtsi
arch/arm/dts/fsl-ls1043-post.dtsi [new file with mode: 0644]
arch/arm/dts/fsl-ls1043a-rdb.dts
arch/arm/dts/fsl-ls1043a.dtsi
arch/arm/dts/fsl-ls1046-post.dtsi [new file with mode: 0644]
arch/arm/dts/fsl-ls1046a-rdb.dts
arch/arm/dts/fsl-ls1046a.dtsi
arch/arm/dts/fsl-ls1088a-rdb.dts
arch/arm/dts/fsl-ls1088a.dtsi
arch/arm/dts/fsl-ls2080a.dtsi
arch/arm/dts/fsl-ls2088a-rdb-qspi.dts
arch/arm/dts/fsl-lx2160a-rdb.dts
arch/arm/dts/fsl-lx2160a.dtsi
arch/arm/dts/qoriq-fman3-0-10g-0.dtsi [new file with mode: 0644]
arch/arm/dts/qoriq-fman3-0-10g-1.dtsi [new file with mode: 0644]
arch/arm/dts/qoriq-fman3-0-1g-0.dtsi [new file with mode: 0644]
arch/arm/dts/qoriq-fman3-0-1g-1.dtsi [new file with mode: 0644]
arch/arm/dts/qoriq-fman3-0-1g-2.dtsi [new file with mode: 0644]
arch/arm/dts/qoriq-fman3-0-1g-3.dtsi [new file with mode: 0644]
arch/arm/dts/qoriq-fman3-0-1g-4.dtsi [new file with mode: 0644]
arch/arm/dts/qoriq-fman3-0-1g-5.dtsi [new file with mode: 0644]
arch/arm/dts/qoriq-fman3-0.dtsi [new file with mode: 0644]
arch/arm/dts/zynq-cse-nand.dts
arch/arm/dts/zynqmp-e-a2197-00-revA.dts
arch/arm/dts/zynqmp-zcu104-revA.dts
arch/arm/dts/zynqmp-zcu104-revC.dts
arch/arm/dts/zynqmp-zcu111-revA.dts
arch/arm/dts/zynqmp-zcu208-revA.dts
arch/arm/dts/zynqmp-zcu216-revA.dts
arch/arm/include/asm/arch-fsl-layerscape/soc.h
arch/sandbox/dts/test.dts
arch/sandbox/include/asm/global_data.h
arch/x86/cpu/apollolake/fsp_s.c
arch/x86/cpu/coreboot/tables.c
arch/x86/cpu/cpu.c
arch/x86/cpu/i386/cpu.c
arch/x86/cpu/i386/interrupt.c
arch/x86/cpu/start_from_spl.S
arch/x86/include/asm/coreboot_tables.h
arch/x86/include/asm/global_data.h
arch/x86/lib/acpi_table.c
arch/x86/lib/fsp/fsp_dram.c
arch/x86/lib/fsp/fsp_graphics.c
arch/x86/lib/fsp2/fsp_dram.c
arch/x86/lib/fsp2/fsp_init.c
arch/x86/lib/init_helpers.c
board/bitmain/antminer_s9/Makefile
board/freescale/ls1028a/MAINTAINERS
board/freescale/ls1028a/ls1028a.c
board/freescale/ls1043ardb/ls1043ardb.c
board/freescale/ls1046afrwy/ls1046afrwy.c
board/freescale/ls1046aqds/ls1046aqds.c
board/freescale/ls1046ardb/ddr.h
board/freescale/ls1046ardb/ls1046ardb.c
board/freescale/ls1088a/eth_ls1088ardb.c
board/freescale/ls1088a/ls1088a.c
board/freescale/ls2080ardb/eth_ls2080rdb.c
board/freescale/ls2080ardb/ls2080ardb.c
board/freescale/lx2160a/lx2160a.c
board/topic/zynq/Makefile
board/xilinx/common/board.c
board/xilinx/common/board.h [new file with mode: 0644]
board/xilinx/versal/board.c
board/xilinx/zynq/board.c
board/xilinx/zynqmp/zynqmp-zcu104-revA/psu_init_gpl.c
board/xilinx/zynqmp/zynqmp.c
cmd/Kconfig
cmd/Makefile
cmd/acpi.c [new file with mode: 0644]
configs/ls1028aqds_tfa_SECURE_BOOT_defconfig
configs/ls1028aqds_tfa_defconfig
configs/ls1028aqds_tfa_lpuart_defconfig [new file with mode: 0644]
configs/ls1028ardb_tfa_SECURE_BOOT_defconfig
configs/ls1028ardb_tfa_defconfig
configs/ls1043ardb_SECURE_BOOT_defconfig
configs/ls1043ardb_defconfig
configs/ls1043ardb_nand_SECURE_BOOT_defconfig
configs/ls1043ardb_nand_defconfig
configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
configs/ls1043ardb_sdcard_defconfig
configs/ls1043ardb_tfa_SECURE_BOOT_defconfig
configs/ls1043ardb_tfa_defconfig
configs/ls1046ardb_emmc_defconfig
configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
configs/ls1046ardb_qspi_defconfig
configs/ls1046ardb_qspi_spl_defconfig
configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
configs/ls1046ardb_sdcard_defconfig
configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
configs/ls1046ardb_tfa_defconfig
configs/ls1088aqds_defconfig
configs/ls1088aqds_qspi_SECURE_BOOT_defconfig
configs/ls1088aqds_qspi_defconfig
configs/ls1088aqds_sdcard_ifc_defconfig
configs/ls1088aqds_sdcard_qspi_defconfig
configs/ls1088aqds_tfa_defconfig
configs/ls1088ardb_qspi_SECURE_BOOT_defconfig
configs/ls1088ardb_qspi_defconfig
configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig
configs/ls1088ardb_sdcard_qspi_defconfig
configs/ls1088ardb_tfa_SECURE_BOOT_defconfig
configs/ls1088ardb_tfa_defconfig
configs/ls2080aqds_SECURE_BOOT_defconfig
configs/ls2080aqds_defconfig
configs/ls2080aqds_nand_defconfig
configs/ls2080aqds_qspi_defconfig
configs/ls2080aqds_sdcard_defconfig
configs/ls2080ardb_SECURE_BOOT_defconfig
configs/ls2080ardb_defconfig
configs/ls2080ardb_nand_defconfig
configs/ls2081ardb_defconfig
configs/ls2088aqds_tfa_defconfig
configs/ls2088ardb_qspi_SECURE_BOOT_defconfig
configs/ls2088ardb_qspi_defconfig
configs/ls2088ardb_tfa_SECURE_BOOT_defconfig
configs/ls2088ardb_tfa_defconfig
configs/lx2160ardb_tfa_SECURE_BOOT_defconfig
configs/lx2160ardb_tfa_defconfig
configs/xilinx_zynq_virt_defconfig
configs/xilinx_zynqmp_virt_defconfig
configs/zynq_cse_nand_defconfig
doc/arch/x86.rst
doc/device-tree-bindings/device.txt [new file with mode: 0644]
drivers/clk/clk_versal.c
drivers/core/acpi.c
drivers/mmc/sdhci.c
drivers/mmc/zynq_sdhci.c
drivers/mtd/nand/raw/zynq_nand.c
drivers/net/Kconfig
drivers/net/Makefile
drivers/net/fm/eth.c
drivers/net/fm/fm.c
drivers/net/fm/fm.h
drivers/net/fm/init.c
drivers/net/fm/memac.c
drivers/net/fm/memac_phy.c
drivers/net/fsl-mc/mc.c
drivers/net/fsl_ls_mdio.c [new file with mode: 0644]
drivers/net/ldpaa_eth/ldpaa_eth.c
drivers/net/ldpaa_eth/ldpaa_eth.h
drivers/pci/pci-uclass.c
include/acpi/acpi_table.h
include/asm-generic/global_data.h
include/cbfs.h
include/configs/ls1012afrwy.h
include/configs/ls1021atwr.h
include/configs/ls1028aqds.h
include/configs/ls1046a_common.h
include/configs/ls1046aqds.h
include/configs/lx2160a_common.h
include/configs/xilinx_versal.h
include/configs/xilinx_zynqmp.h
include/configs/zynq-common.h
include/dm/acpi.h
include/fsl_mdio.h
include/init.h
include/sdhci.h
lib/acpi/acpi_table.c
test/dm/acpi.c

index 1bcf3450288c54a117fc6e91dffb6ea64c08f3ec..8e67e1c58733c474213738384f9a33e2560060ca 100644 (file)
@@ -475,7 +475,7 @@ config TPL_USE_ARCH_MEMSET
 
 config SET_STACK_SIZE
        bool "Enable an option to set max stack size that can be used"
-       default y if ARCH_VERSAL || ARCH_ZYNQMP
+       default y if ARCH_VERSAL || ARCH_ZYNQMP || ARCH_ZYNQ
        help
          This will enable an option to set max stack size that can be
          used by U-Boot.
@@ -484,6 +484,7 @@ config STACK_SIZE
        hex "Define max stack size that can be used by U-Boot"
        depends on SET_STACK_SIZE
        default 0x4000000 if ARCH_VERSAL || ARCH_ZYNQMP
+       default 0x1000000 if ARCH_ZYNQ
        help
          Define Max stack size that can be used by U-Boot so that the
          initrd_high will be calculated as base stack pointer minus this
index b25639183f807fb42d6c0e54eecefc3b0faf0776..2f75b2cdd3253a78845e3737882b08a70b4e7638 100644 (file)
@@ -46,6 +46,7 @@ config ARCH_LS1028A
        select SYS_FSL_ERRATUM_A009663 if !TFABOOT
        select SYS_FSL_ERRATUM_A009942 if !TFABOOT
        select SYS_FSL_ERRATUM_A050382
+       select RESV_RAM if GIC_V3_ITS
        imply PANIC_HANG
 
 config ARCH_LS1043A
@@ -152,6 +153,7 @@ config ARCH_LS1088A
        select SYS_I2C_MXC_I2C2 if !TFABOOT
        select SYS_I2C_MXC_I2C3 if !TFABOOT
        select SYS_I2C_MXC_I2C4 if !TFABOOT
+       select RESV_RAM if GIC_V3_ITS
        imply SCSI
        imply PANIC_HANG
 
@@ -202,6 +204,7 @@ config ARCH_LS2080A
        select SYS_I2C_MXC_I2C2 if !TFABOOT
        select SYS_I2C_MXC_I2C3 if !TFABOOT
        select SYS_I2C_MXC_I2C4 if !TFABOOT
+       select RESV_RAM if GIC_V3_ITS
        imply DISTRO_DEFAULTS
        imply PANIC_HANG
 
@@ -229,6 +232,7 @@ config ARCH_LX2160A
        select ARCH_EARLY_INIT_R
        select BOARD_EARLY_INIT_F
        select SYS_I2C_MXC
+       select RESV_RAM if GIC_V3_ITS
        imply DISTRO_DEFAULTS
        imply PANIC_HANG
        imply SCSI
index b44389445369c852a6be3b2bcd63c29956221fad..b3f5c2f641fe311a37e2bf9bbdba6c00d0b1a944 100644 (file)
@@ -1156,8 +1156,10 @@ int arch_early_init_r(void)
        fsl_rgmii_init();
 #endif
 #ifdef CONFIG_FMAN_ENET
+#ifndef CONFIG_DM_ETH
        fman_enet_init();
 #endif
+#endif
 #ifdef CONFIG_SYS_DPAA_QBMAN
        setup_qbman_portals();
 #endif
@@ -1379,7 +1381,7 @@ static int tfa_dram_init_banksize(void)
        if (i > 0)
                ret = 0;
 
-#if defined(CONFIG_FSL_MC_ENET) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_RESV_RAM) && !defined(CONFIG_SPL_BUILD)
        /* Assign memory for MC */
 #ifdef CONFIG_SYS_DDR_BLOCK3_BASE
        if (gd->bd->bi_dram[2].size >=
@@ -1402,7 +1404,7 @@ static int tfa_dram_init_banksize(void)
                                board_reserve_ram_top(gd->bd->bi_dram[0].size);
                }
        }
-#endif /* CONFIG_FSL_MC_ENET */
+#endif /* CONFIG_RESV_RAM */
 
        return ret;
 }
@@ -1465,7 +1467,7 @@ int dram_init_banksize(void)
        }
 #endif /* CONFIG_SYS_MEM_RESERVE_SECURE */
 
-#if defined(CONFIG_FSL_MC_ENET) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_RESV_RAM) && !defined(CONFIG_SPL_BUILD)
        /* Assign memory for MC */
 #ifdef CONFIG_SYS_DDR_BLOCK3_BASE
        if (gd->bd->bi_dram[2].size >=
@@ -1488,7 +1490,7 @@ int dram_init_banksize(void)
                                board_reserve_ram_top(gd->bd->bi_dram[0].size);
                }
        }
-#endif /* CONFIG_FSL_MC_ENET */
+#endif /* CONFIG_RESV_RAM */
 
 #ifdef CONFIG_SYS_DP_DDR_BASE_PHY
 #ifdef CONFIG_SYS_DDR_BLOCK3_BASE
index 077438765c8861eef834d6fbbc079436b1035b1c..3bbad827cb61ccbb8b5f35a427a3101a7ebdd38c 100644 (file)
@@ -471,6 +471,10 @@ void ft_cpu_setup(void *blob, bd_t *bd)
        do_fixup_by_path_u32(blob, "/sysclk", "clock-frequency",
                             CONFIG_SYS_CLK_FREQ, 1);
 
+#ifdef CONFIG_GIC_V3_ITS
+       ls_gic_rd_tables_init(blob);
+#endif
+
 #if defined(CONFIG_PCIE_LAYERSCAPE) || defined(CONFIG_PCIE_LAYERSCAPE_GEN4)
        ft_pci_setup(blob, bd);
 #endif
index d0e10cb007be5a2be1ac91dce616470ae77ca7f9..28bb1d740142aabd0f7bfe10c675497fd45bb3b5 100644 (file)
@@ -6,10 +6,12 @@
 
 #include <common.h>
 #include <clock_legacy.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <fsl_immap.h>
 #include <fsl_ifc.h>
 #include <init.h>
+#include <linux/sizes.h>
 #include <asm/arch/fsl_serdes.h>
 #include <asm/arch/soc.h>
 #include <asm/io.h>
@@ -17,6 +19,7 @@
 #include <asm/arch-fsl-layerscape/config.h>
 #include <asm/arch-fsl-layerscape/ns_access.h>
 #include <asm/arch-fsl-layerscape/fsl_icid.h>
+#include <asm/gic-v3.h>
 #ifdef CONFIG_LAYERSCAPE_NS_ACCESS
 #include <fsl_csu.h>
 #endif
 #include <fsl_immap.h>
 #ifdef CONFIG_TFABOOT
 #include <env_internal.h>
+#endif
+#if defined(CONFIG_TFABOOT) || defined(CONFIG_GIC_V3_ITS)
 DECLARE_GLOBAL_DATA_PTR;
 #endif
 
+#ifdef CONFIG_GIC_V3_ITS
+#define PENDTABLE_MAX_SZ       ALIGN(BIT(ITS_MAX_LPI_NRBITS), SZ_64K)
+#define PROPTABLE_MAX_SZ       ALIGN(BIT(ITS_MAX_LPI_NRBITS) / 8, SZ_64K)
+#define GIC_LPI_SIZE           ALIGN(cpu_numcores() * PENDTABLE_MAX_SZ + \
+                               PROPTABLE_MAX_SZ, SZ_1M)
+static int fdt_add_resv_mem_gic_rd_tables(void *blob, u64 base, size_t size)
+{
+       u32 phandle;
+       int err;
+       struct fdt_memory gic_rd_tables;
+
+       gic_rd_tables.start = base;
+       gic_rd_tables.end = base + size - 1;
+       err = fdtdec_add_reserved_memory(blob, "gic-rd-tables", &gic_rd_tables,
+                                        &phandle);
+       if (err < 0)
+               debug("%s: failed to add reserved memory: %d\n", __func__, err);
+
+       return err;
+}
+
+int ls_gic_rd_tables_init(void *blob)
+{
+       u64 gic_lpi_base;
+       int ret;
+
+       gic_lpi_base = ALIGN(gd->arch.resv_ram - GIC_LPI_SIZE, SZ_64K);
+       ret = fdt_add_resv_mem_gic_rd_tables(blob, gic_lpi_base, GIC_LPI_SIZE);
+       if (ret)
+               return ret;
+
+       ret = gic_lpi_tables_init(gic_lpi_base, cpu_numcores());
+       if (ret)
+               debug("%s: failed to init gic-lpi-tables\n", __func__);
+
+       return ret;
+}
+#endif
+
 bool soc_has_dp_ddr(void)
 {
        struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
index ed47fff57110e151bb4268ac84e67764fd8e0ffe..2c123bd6da6eccf1a0b2580ae16d8dc517c2d7a0 100644 (file)
@@ -377,7 +377,8 @@ dtb-$(CONFIG_FSL_LSCH3) += fsl-ls2080a-qds.dtb \
        fsl-ls1088a-rdb.dtb \
        fsl-ls1088a-qds.dtb \
        fsl-ls1028a-rdb.dtb \
-       fsl-ls1028a-qds.dtb \
+       fsl-ls1028a-qds-duart.dtb \
+       fsl-ls1028a-qds-lpuart.dtb \
        fsl-lx2160a-rdb.dtb \
        fsl-lx2160a-qds.dtb
 dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-qds-duart.dtb \
diff --git a/arch/arm/dts/fsl-ls1028a-qds-duart.dts b/arch/arm/dts/fsl-ls1028a-qds-duart.dts
new file mode 100644 (file)
index 0000000..83264e0
--- /dev/null
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Device Tree file for Freescale Layerscape-1028AQDS family SoC.
+ *
+ * Copyright 2020 NXP
+ */
+
+/dts-v1/;
+#include "fsl-ls1028a-qds.dtsi"
+
+/ {
+       chosen {
+               stdout-path = &serial0;
+       };
+};
diff --git a/arch/arm/dts/fsl-ls1028a-qds-lpuart.dts b/arch/arm/dts/fsl-ls1028a-qds-lpuart.dts
new file mode 100644 (file)
index 0000000..063857b
--- /dev/null
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Device Tree file for Freescale Layerscape-1028AQDS family SoC.
+ *
+ * Copyright 2020 NXP
+ */
+
+/dts-v1/;
+#include "fsl-ls1028a-qds.dtsi"
+
+/ {
+       chosen {
+               stdout-path = &lpuart0;
+       };
+};
diff --git a/arch/arm/dts/fsl-ls1028a-qds.dts b/arch/arm/dts/fsl-ls1028a-qds.dts
deleted file mode 100644 (file)
index 029a8e3..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+ OR X11
-/*
- * NXP ls1028AQDS device tree source
- *
- * Copyright 2019 NXP
- *
- */
-
-/dts-v1/;
-
-#include "fsl-ls1028a.dtsi"
-
-/ {
-       model = "NXP Layerscape 1028a QDS Board";
-       compatible = "fsl,ls1028a-qds", "fsl,ls1028a";
-       aliases {
-               spi0 = &fspi;
-       };
-
-};
-
-&dspi0 {
-       status = "okay";
-};
-
-&dspi1 {
-       status = "okay";
-};
-
-&dspi2 {
-       status = "okay";
-};
-
-&esdhc0 {
-       status = "okay";
-};
-
-&esdhc1 {
-       status = "okay";
-
-};
-
-&fspi {
-       status = "okay";
-
-       mt35xu02g0: flash@0 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               compatible = "jedec,spi-nor";
-               spi-max-frequency = <50000000>;
-               reg = <0>;
-               spi-rx-bus-width = <8>;
-               spi-tx-bus-width = <1>;
-       };
-};
-
-&i2c0 {
-       status = "okay";
-       u-boot,dm-pre-reloc;
-
-       fpga@66 {
-               #address-cells = <1>;
-               #size-cells = <0>;
-               compatible = "simple-mfd";
-               reg = <0x66>;
-
-               mux-mdio@54 {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       compatible = "mdio-mux-i2creg";
-                       reg = <0x54>;
-                       #mux-control-cells = <1>;
-                       mux-reg-masks = <0x54 0xf0>;
-                       mdio-parent-bus = <&mdio0>;
-
-                       /* on-board MDIO with a single RGMII PHY */
-                       mdio@00 {
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               reg = <0x00>;
-
-                               qds_phy0: phy@5 {
-                                       reg = <5>;
-                               };
-                       };
-                       /* slot 1 */
-                       slot1: mdio@40 {
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               reg = <0x40>;
-                       };
-                       /* slot 2 */
-                       slot2: mdio@50 {
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               reg = <0x50>;
-                       };
-                       /* slot 3 */
-                       slot3: mdio@60 {
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               reg = <0x60>;
-                       };
-                       /* slot 4 */
-                       slot4: mdio@70 {
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               reg = <0x70>;
-                       };
-               };
-       };
-
-       i2c-mux@77 {
-               compatible = "nxp,pca9547";
-               reg = <0x77>;
-               #address-cells = <1>;
-               #size-cells = <0>;
-       };
-};
-
-&i2c1 {
-       status = "okay";
-
-       rtc@51 {
-               compatible = "pcf2127-rtc";
-               reg = <0x51>;
-       };
-};
-
-&i2c2 {
-       status = "okay";
-};
-
-&i2c3 {
-       status = "okay";
-};
-
-&i2c4 {
-       status = "okay";
-};
-
-&i2c5 {
-       status = "okay";
-};
-
-&i2c6 {
-       status = "okay";
-};
-
-&i2c7 {
-       status = "okay";
-};
-
-&sata {
-       status = "okay";
-};
-
-&serial0 {
-       status = "okay";
-};
-
-&serial1 {
-       status = "okay";
-};
-
-&usb1 {
-       status = "okay";
-};
-
-&usb2 {
-       status = "okay";
-};
-
-&enetc1 {
-       status = "okay";
-       phy-mode = "rgmii";
-       phy-handle = <&qds_phy0>;
-};
-
-&mdio0 {
-       status = "okay";
-};
diff --git a/arch/arm/dts/fsl-ls1028a-qds.dtsi b/arch/arm/dts/fsl-ls1028a-qds.dtsi
new file mode 100644 (file)
index 0000000..4f56f40
--- /dev/null
@@ -0,0 +1,186 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * NXP ls1028AQDS device tree source
+ *
+ * Copyright 2019 NXP
+ *
+ */
+
+/dts-v1/;
+
+#include "fsl-ls1028a.dtsi"
+
+/ {
+       model = "NXP Layerscape 1028a QDS Board";
+       compatible = "fsl,ls1028a-qds", "fsl,ls1028a";
+       aliases {
+               spi0 = &fspi;
+       };
+
+};
+
+&dspi0 {
+       status = "okay";
+};
+
+&dspi1 {
+       status = "okay";
+};
+
+&dspi2 {
+       status = "okay";
+};
+
+&esdhc0 {
+       status = "okay";
+};
+
+&esdhc1 {
+       status = "okay";
+
+};
+
+&fspi {
+       status = "okay";
+
+       mt35xu02g0: flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               spi-max-frequency = <50000000>;
+               reg = <0>;
+               spi-rx-bus-width = <8>;
+               spi-tx-bus-width = <1>;
+       };
+};
+
+&i2c0 {
+       status = "okay";
+       u-boot,dm-pre-reloc;
+
+       fpga@66 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "simple-mfd";
+               reg = <0x66>;
+
+               mux-mdio@54 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "mdio-mux-i2creg";
+                       reg = <0x54>;
+                       #mux-control-cells = <1>;
+                       mux-reg-masks = <0x54 0xf0>;
+                       mdio-parent-bus = <&mdio0>;
+
+                       /* on-board MDIO with a single RGMII PHY */
+                       mdio@00 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <0x00>;
+
+                               qds_phy0: phy@5 {
+                                       reg = <5>;
+                               };
+                       };
+                       /* slot 1 */
+                       slot1: mdio@40 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <0x40>;
+                       };
+                       /* slot 2 */
+                       slot2: mdio@50 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <0x50>;
+                       };
+                       /* slot 3 */
+                       slot3: mdio@60 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <0x60>;
+                       };
+                       /* slot 4 */
+                       slot4: mdio@70 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <0x70>;
+                       };
+               };
+       };
+
+       i2c-mux@77 {
+               compatible = "nxp,pca9547";
+               reg = <0x77>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+       };
+};
+
+&i2c1 {
+       status = "okay";
+
+       rtc@51 {
+               compatible = "pcf2127-rtc";
+               reg = <0x51>;
+       };
+};
+
+&i2c2 {
+       status = "okay";
+};
+
+&i2c3 {
+       status = "okay";
+};
+
+&i2c4 {
+       status = "okay";
+};
+
+&i2c5 {
+       status = "okay";
+};
+
+&i2c6 {
+       status = "okay";
+};
+
+&i2c7 {
+       status = "okay";
+};
+
+&lpuart0 {
+       status = "okay";
+};
+
+&sata {
+       status = "okay";
+};
+
+&serial0 {
+       status = "okay";
+};
+
+&serial1 {
+       status = "okay";
+};
+
+&usb1 {
+       status = "okay";
+};
+
+&usb2 {
+       status = "okay";
+};
+
+&enetc1 {
+       status = "okay";
+       phy-mode = "rgmii";
+       phy-handle = <&qds_phy0>;
+};
+
+&mdio0 {
+       status = "okay";
+};
index 5365bfb1a8e1b0c46707b8a4855583700b390431..9911690e5cf70769e2e9d17c8ba25d975d20fd38 100644 (file)
                status = "disabled";
        };
 
+       lpuart0: serial@2260000 {
+               compatible = "fsl,ls1021a-lpuart";
+               reg = <0x0 0x2260000 0x0 0x1000>;
+               interrupts = <0 232 0x4>;
+               clocks = <&sysclk>;
+               clock-names = "ipg";
+               little-endian;
+               status = "disabled";
+       };
+
+       lpuart1: serial@2270000 {
+               compatible = "fsl,ls1021a-lpuart";
+               reg = <0x0 0x2270000 0x0 0x1000>;
+               interrupts = <0 233 0x4>;
+               clocks = <&sysclk>;
+               clock-names = "ipg";
+               little-endian;
+               status = "disabled";
+       };
+
+       lpuart2: serial@2280000 {
+               compatible = "fsl,ls1021a-lpuart";
+               reg = <0x0 0x2280000 0x0 0x1000>;
+               interrupts = <0 234 0x4>;
+               clocks = <&sysclk>;
+               clock-names = "ipg";
+               little-endian;
+               status = "disabled";
+       };
+
+       lpuart3: serial@2290000 {
+               compatible = "fsl,ls1021a-lpuart";
+               reg = <0x0 0x2290000 0x0 0x1000>;
+               interrupts = <0 235 0x4>;
+               clocks = <&sysclk>;
+               clock-names = "ipg";
+               little-endian;
+               status = "disabled";
+       };
+
+       lpuart4: serial@22a0000 {
+               compatible = "fsl,ls1021a-lpuart";
+               reg = <0x0 0x22a0000 0x0 0x1000>;
+               interrupts = <0 236 0x4>;
+               clocks = <&sysclk>;
+               clock-names = "ipg";
+               little-endian;
+               status = "disabled";
+       };
+
+       lpuart5: serial@22b0000 {
+               compatible = "fsl,ls1021a-lpuart";
+               reg = <0x0 0x22b0000 0x0 0x1000>;
+               interrupts = <0 237 0x4>;
+               clocks = <&sysclk>;
+               clock-names = "ipg";
+               little-endian;
+               status = "disabled";
+       };
+
        usb1: usb3@3100000 {
                compatible = "fsl,layerscape-dwc3";
                reg = <0x0 0x3100000 0x0 0x10000>;
diff --git a/arch/arm/dts/fsl-ls1043-post.dtsi b/arch/arm/dts/fsl-ls1043-post.dtsi
new file mode 100644 (file)
index 0000000..e4eab9e
--- /dev/null
@@ -0,0 +1,48 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * QorIQ FMan v3 device tree nodes for ls1043
+ *
+ * Copyright 2015-2016 Freescale Semiconductor Inc.
+ * Copyright 2020 NXP
+ *
+ */
+
+&soc {
+
+/* include used FMan blocks */
+#include "qoriq-fman3-0.dtsi"
+#include "qoriq-fman3-0-1g-0.dtsi"
+#include "qoriq-fman3-0-1g-1.dtsi"
+#include "qoriq-fman3-0-1g-2.dtsi"
+#include "qoriq-fman3-0-1g-3.dtsi"
+#include "qoriq-fman3-0-1g-4.dtsi"
+#include "qoriq-fman3-0-1g-5.dtsi"
+#include "qoriq-fman3-0-10g-0.dtsi"
+
+};
+
+&fman0 {
+       fsl,erratum-a050385;
+
+       /* these aliases provide the FMan ports mapping */
+       enet0: ethernet@e0000 {
+       };
+
+       enet1: ethernet@e2000 {
+       };
+
+       enet2: ethernet@e4000 {
+       };
+
+       enet3: ethernet@e6000 {
+       };
+
+       enet4: ethernet@e8000 {
+       };
+
+       enet5: ethernet@ea000 {
+       };
+
+       enet6: ethernet@f0000 {
+       };
+};
index 721b158169db43cf42b23bfea044a173d21621cd..6e4ea5b40c7858d99f4023e161f4db16fc20729a 100644 (file)
@@ -3,6 +3,7 @@
  * Device Tree Include file for Freescale Layerscape-1043A family SoC.
  *
  * Copyright (C) 2015, Freescale Semiconductor
+ * Copyright 2020 NXP
  *
  * Mingkai Hu <Mingkai.hu@freescale.com>
  */
 &duart1 {
        status = "okay";
 };
+
+#include "fsl-ls1043-post.dtsi"
+
+&fman0 {
+       ethernet@e0000 {
+               phy-handle = <&qsgmii_phy1>;
+               phy-connection-type = "qsgmii";
+               status = "okay";
+       };
+
+       ethernet@e2000 {
+               phy-handle = <&qsgmii_phy2>;
+               phy-connection-type = "qsgmii";
+               status = "okay";
+       };
+
+       ethernet@e4000 {
+               phy-handle = <&rgmii_phy1>;
+               phy-connection-type = "rgmii-txid";
+               status = "okay";
+       };
+
+       ethernet@e6000 {
+               phy-handle = <&rgmii_phy2>;
+               phy-connection-type = "rgmii-txid";
+               status = "okay";
+       };
+
+       ethernet@e8000 {
+               phy-handle = <&qsgmii_phy3>;
+               phy-connection-type = "qsgmii";
+               status = "okay";
+       };
+
+       ethernet@ea000 {
+               phy-handle = <&qsgmii_phy4>;
+               phy-connection-type = "qsgmii";
+               status = "okay";
+       };
+
+       ethernet@f0000 { /* 10GEC1 */
+               phy-handle = <&aqr105_phy>;
+               phy-connection-type = "xgmii";
+               status = "okay";
+       };
+
+       mdio@fc000 {
+               rgmii_phy1: ethernet-phy@1 {
+                       reg = <0x1>;
+               };
+
+               rgmii_phy2: ethernet-phy@2 {
+                       reg = <0x2>;
+               };
+
+               qsgmii_phy1: ethernet-phy@4 {
+                       reg = <0x4>;
+               };
+
+               qsgmii_phy2: ethernet-phy@5 {
+                       reg = <0x5>;
+               };
+
+               qsgmii_phy3: ethernet-phy@6 {
+                       reg = <0x6>;
+               };
+
+               qsgmii_phy4: ethernet-phy@7 {
+                       reg = <0x7>;
+               };
+       };
+
+       mdio@fd000 {
+               aqr105_phy: ethernet-phy@1 {
+                       compatible = "ethernet-phy-ieee802.3-c45";
+                       interrupts = <0 132 4>;
+                       reg = <0x1>;
+               };
+       };
+};
index b159c3ca732e2dd2304d88f6a77cb8959f8da78f..0a959f0f2d2732e7c828cdc8b626c78c33b62c25 100644 (file)
@@ -31,7 +31,7 @@
                interrupts = <1 9 0xf08>;
        };
 
-       soc {
+       soc: soc {
                compatible = "simple-bus";
                #address-cells = <2>;
                #size-cells = <2>;
diff --git a/arch/arm/dts/fsl-ls1046-post.dtsi b/arch/arm/dts/fsl-ls1046-post.dtsi
new file mode 100644 (file)
index 0000000..2dac6a0
--- /dev/null
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * QorIQ FMan v3 device tree nodes for ls1046
+ *
+ * Copyright 2015-2016 Freescale Semiconductor Inc.
+ * Copyright 2020 NXP
+ *
+ */
+
+&soc {
+
+/* include used FMan blocks */
+#include "qoriq-fman3-0.dtsi"
+#include "qoriq-fman3-0-1g-0.dtsi"
+#include "qoriq-fman3-0-1g-1.dtsi"
+#include "qoriq-fman3-0-1g-2.dtsi"
+#include "qoriq-fman3-0-1g-3.dtsi"
+#include "qoriq-fman3-0-1g-4.dtsi"
+#include "qoriq-fman3-0-1g-5.dtsi"
+#include "qoriq-fman3-0-10g-0.dtsi"
+#include "qoriq-fman3-0-10g-1.dtsi"
+};
+
+&fman0 {
+       /* these aliases provide the FMan ports mapping */
+       enet0: ethernet@e0000 {
+       };
+
+       enet1: ethernet@e2000 {
+       };
+
+       enet2: ethernet@e4000 {
+       };
+
+       enet3: ethernet@e6000 {
+       };
+
+       enet4: ethernet@e8000 {
+       };
+
+       enet5: ethernet@ea000 {
+       };
+
+       enet6: ethernet@f0000 {
+       };
+
+       enet7: ethernet@f2000 {
+       };
+};
index 83e34ab02ad191d430f5210424567bd18281cba9..cac65a7afad9fd36ba83a431fd4e94cf21cbb277 100644 (file)
@@ -3,6 +3,7 @@
  * Device Tree Include file for Freescale Layerscape-1046A family SoC.
  *
  * Copyright 2016, Freescale Semiconductor
+ * Copyright 2020 NXP
  *
  * Mingkai Hu <Mingkai.hu@freescale.com>
  */
 &i2c3 {
        status = "okay";
 };
+
+#include "fsl-ls1046-post.dtsi"
+
+&fman0 {
+       ethernet@e4000 {
+               phy-handle = <&rgmii_phy1>;
+               phy-connection-type = "rgmii-id";
+               status = "okay";
+       };
+
+       ethernet@e6000 {
+               phy-handle = <&rgmii_phy2>;
+               phy-connection-type = "rgmii-id";
+               status = "okay";
+       };
+
+       ethernet@e8000 {
+               phy-handle = <&sgmii_phy1>;
+               phy-connection-type = "sgmii";
+               status = "okay";
+       };
+
+       ethernet@ea000 {
+               phy-handle = <&sgmii_phy2>;
+               phy-connection-type = "sgmii";
+               status = "okay";
+       };
+
+       ethernet@f0000 { /* 10GEC1 */
+               phy-handle = <&aqr106_phy>;
+               phy-connection-type = "xgmii";
+               status = "okay";
+       };
+
+       ethernet@f2000 { /* 10GEC2 */
+               fixed-link = <0 1 1000 0 0>;
+               phy-connection-type = "xgmii";
+               status = "okay";
+       };
+
+       mdio@fc000 {
+               rgmii_phy1: ethernet-phy@1 {
+                       reg = <0x1>;
+               };
+
+               rgmii_phy2: ethernet-phy@2 {
+                       reg = <0x2>;
+               };
+
+               sgmii_phy1: ethernet-phy@3 {
+                       reg = <0x3>;
+               };
+
+               sgmii_phy2: ethernet-phy@4 {
+                       reg = <0x4>;
+               };
+       };
+
+       mdio@fd000 {
+               aqr106_phy: ethernet-phy@0 {
+                       compatible = "ethernet-phy-ieee802.3-c45";
+                       interrupts = <0 131 4>;
+                       reg = <0x0>;
+               };
+       };
+};
index fdf93fd2681a04f759651ff45d452dd85622bed6..4e91d5c9956392d5c1d6460d534b9867bae06760 100644 (file)
@@ -31,7 +31,7 @@
                interrupts = <1 9 0xf08>;
        };
 
-       soc {
+       soc: soc {
                compatible = "simple-bus";
                #address-cells = <2>;
                #size-cells = <2>;
index 0fe351973dc5987f669949d09987b0a144de8e31..46a5780547fe7439387ae00fa2f1e43b9be78877 100644 (file)
        };
 };
 
+&dpmac1 {
+       status = "okay";
+       phy-connection-type = "xgmii";
+};
+
+&dpmac2 {
+       status = "okay";
+       phy-handle = <&mdio2_phy1>;
+       phy-connection-type = "xgmii";
+};
+
+&dpmac3 {
+       status = "okay";
+       phy-handle = <&mdio1_phy5>;
+       phy-connection-type = "qsgmii";
+};
+
+&dpmac4 {
+       status = "okay";
+       phy-handle = <&mdio1_phy6>;
+       phy-connection-type = "qsgmii";
+};
+
+&dpmac5 {
+       status = "okay";
+       phy-handle = <&mdio1_phy7>;
+       phy-connection-type = "qsgmii";
+};
+
+&dpmac6 {
+       status = "okay";
+       phy-handle = <&mdio1_phy8>;
+       phy-connection-type = "qsgmii";
+};
+
+&dpmac7 {
+       status = "okay";
+       phy-handle = <&mdio1_phy1>;
+       phy-connection-type = "qsgmii";
+};
+
+&dpmac8 {
+       status = "okay";
+       phy-handle = <&mdio1_phy2>;
+       phy-connection-type = "qsgmii";
+};
+
+&dpmac9 {
+       status = "okay";
+       phy-handle = <&mdio1_phy3>;
+       phy-connection-type = "qsgmii";
+};
+
+&dpmac10 {
+       status = "okay";
+       phy-handle = <&mdio1_phy4>;
+       phy-connection-type = "qsgmii";
+};
+
+&emdio1 {
+       status = "okay";
+
+       /* Freescale F104 PHY1 */
+       mdio1_phy1: emdio1_phy@1 {
+               reg = <0x1c>;
+               };
+       mdio1_phy2: emdio1_phy@2 {
+               reg = <0x1d>;
+               };
+       mdio1_phy3: emdio1_phy@3 {
+               reg = <0x1e>;
+               };
+       mdio1_phy4: emdio1_phy@4 {
+               reg = <0x1f>;
+       };
+
+       /* F104 PHY2 */
+       mdio1_phy5: emdio1_phy@5 {
+               reg = <0x0c>;
+       };
+       mdio1_phy6: emdio1_phy@6 {
+               reg = <0x0d>;
+       };
+       mdio1_phy7: emdio1_phy@7 {
+               reg = <0x0e>;
+       };
+       mdio1_phy8: emdio1_phy@8 {
+               reg = <0x0f>;
+       };
+};
+
+&emdio2 {
+       status = "okay";
+
+       /* Aquantia AQR105 10G PHY */
+       mdio2_phy1: emdio2_phy@1 {
+               compatible = "ethernet-phy-ieee802.3-c45";
+               interrupts = <0 2 0x4>;
+               reg = <0x0>;
+       };
+};
+
 &i2c0 {
        status = "okay";
        u-boot,dm-pre-reloc;
index abc8b21a112e99edb195cdc83ba6576a7cfb8b19..133cacb93e39c1ae516de257aa7724675dacb359 100644 (file)
                interrupts = <0 32 0x1>; /* edge triggered */
        };
 
-       fsl_mc: fsl-mc@80c000000 {
-               compatible = "fsl,qoriq-mc";
-               reg = <0x00000008 0x0c000000 0 0x40>,    /* MC portal base */
-                     <0x00000000 0x08340000 0 0x40000>; /* MC control reg */
-       };
-
        dspi: dspi@2100000 {
                compatible = "fsl,vf610-dspi";
                #address-cells = <1>;
                method = "smc";
        };
 
+       fsl_mc: fsl-mc@80c000000 {
+               compatible = "fsl,qoriq-mc", "simple-mfd";
+               reg = <0x00000008 0x0c000000 0 0x40>,    /* MC portal base */
+                     <0x00000000 0x08340000 0 0x40000>; /* MC control reg */
+               #address-cells = <3>;
+               #size-cells = <1>;
+
+               /*
+                * Region type 0x0 - MC portals
+                * Region type 0x1 - QBMAN portals
+                */
+               ranges = <0x0 0x0 0x0 0x8 0x0c000000 0x4000000
+                         0x1 0x0 0x0 0x8 0x18000000 0x8000000>;
+
+               dpmacs {
+                       compatible = "simple-mfd";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       dpmac1: dpmac@1 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x1>;
+                               status = "disabled";
+                       };
+
+                       dpmac2: dpmac@2 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x2>;
+                               status = "disabled";
+                       };
+
+                       dpmac3: dpmac@3 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x3>;
+                               status = "disabled";
+                       };
+
+                       dpmac4: dpmac@4 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x4>;
+                               status = "disabled";
+                       };
+
+                       dpmac5: dpmac@5 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x5>;
+                               status = "disabled";
+                       };
+
+                       dpmac6: dpmac@6 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x6>;
+                               status = "disabled";
+                       };
+
+                       dpmac7: dpmac@7 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x7>;
+                               status = "disabled";
+                       };
+
+                       dpmac8: dpmac@8 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x8>;
+                               status = "disabled";
+                       };
+
+                       dpmac9: dpmac@9 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x9>;
+                               status = "disabled";
+                       };
+
+                       dpmac10: dpmac@a {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0xa>;
+                               status = "disabled";
+                       };
+               };
+       };
+
+       emdio1: mdio@8B96000 {
+               compatible = "fsl,ls-mdio";
+               reg = <0x0 0x8B96000 0x0 0x1000>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       emdio2: mdio@8B97000 {
+               compatible = "fsl,ls-mdio";
+               reg = <0x0 0x8B97000 0x0 0x1000>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
 };
index 99ed33af95b4534a8a0e4f4ff66987332d581cf9..fb5777e268e4953b86fc9dea73b82e1f3ee2c957 100644 (file)
                interrupts = <0 32 0x1>; /* edge triggered */
        };
 
-       fsl_mc: fsl-mc@80c000000 {
-               compatible = "fsl,qoriq-mc";
-               reg = <0x00000008 0x0c000000 0 0x40>,    /* MC portal base */
-                     <0x00000000 0x08340000 0 0x40000>; /* MC control reg */
-       };
-
        i2c0: i2c@2000000 {
                status = "disabled";
                compatible = "fsl,vf610-i2c";
                        status = "disabled";
        };
 
+       fsl_mc: fsl-mc@80c000000 {
+               compatible = "fsl,qoriq-mc", "simple-mfd";
+               reg = <0x00000008 0x0c000000 0 0x40>,    /* MC portal base */
+                     <0x00000000 0x08340000 0 0x40000>; /* MC control reg */
+               #address-cells = <3>;
+               #size-cells = <1>;
+
+               /*
+                * Region type 0x0 - MC portals
+                * Region type 0x1 - QBMAN portals
+                */
+               ranges = <0x0 0x0 0x0 0x8 0x0c000000 0x4000000
+                       0x1 0x0 0x0 0x8 0x18000000 0x8000000>;
+
+               dpmacs {
+                       compatible = "simple-mfd";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       dpmac1: dpmac@1 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x1>;
+                               status = "disabled";
+                       };
+
+                       dpmac2: dpmac@2 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x2>;
+                               status = "disabled";
+                       };
+
+                       dpmac3: dpmac@3 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x3>;
+                               status = "disabled";
+                       };
+
+                       dpmac4: dpmac@4 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x4>;
+                               status = "disabled";
+                       };
+
+                       dpmac5: dpmac@5 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x5>;
+                               status = "disabled";
+                       };
+
+                       dpmac6: dpmac@6 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x6>;
+                               status = "disabled";
+                       };
+
+                       dpmac7: dpmac@7 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x7>;
+                               status = "disabled";
+                       };
+
+                       dpmac8: dpmac@8 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x8>;
+                               status = "disabled";
+                       };
+               };
+       };
+
+       emdio1: mdio@8B96000 {
+               compatible = "fsl,ls-mdio";
+               reg = <0x0 0x8B96000 0x0 0x1000>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       emdio2: mdio@8B97000 {
+               compatible = "fsl,ls-mdio";
+               reg = <0x0 0x8B97000 0x0 0x1000>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
 };
index 72b2177b70d9bcdfd6011ca1152a695ddd36b47b..16b9aeec966c0d1663bc97ca1732783be307afd4 100644 (file)
        };
 };
 
+&dpmac1 {
+       status = "okay";
+       phy-handle = <&mdio1_phy1>;
+       phy-connection-type = "xfi";
+};
+
+&dpmac2 {
+       status = "okay";
+       phy-handle = <&mdio1_phy2>;
+       phy-connection-type = "xfi";
+};
+
+&dpmac3 {
+       status = "okay";
+       phy-handle = <&mdio1_phy3>;
+       phy-connection-type = "xfi";
+};
+
+&dpmac4 {
+       status = "okay";
+       phy-handle = <&mdio1_phy4>;
+       phy-connection-type = "xfi";
+};
+
+&dpmac5 {
+       status = "okay";
+       phy-handle = <&mdio2_phy1>;
+       phy-connection-type = "xfi";
+};
+
+&dpmac6 {
+       status = "okay";
+       phy-handle = <&mdio2_phy2>;
+       phy-connection-type = "xfi";
+};
+
+&dpmac7 {
+       status = "okay";
+       phy-handle = <&mdio2_phy3>;
+       phy-connection-type = "xfi";
+};
+
+&dpmac8 {
+       status = "okay";
+       phy-handle = <&mdio2_phy4>;
+       phy-connection-type = "xfi";
+};
+
+&emdio1 {
+       status = "okay";
+
+       /* CS4340 PHYs */
+       mdio1_phy1: emdio1_phy@1 {
+               reg = <0x10>;
+       };
+       mdio1_phy2: emdio1_phy@2 {
+               reg = <0x11>;
+       };
+       mdio1_phy3: emdio1_phy@3 {
+               reg = <0x12>;
+       };
+       mdio1_phy4: emdio1_phy@4 {
+               reg = <0x13>;
+       };
+};
+
+&emdio2 {
+       status = "okay";
+
+       /* AQR405 PHYs */
+       mdio2_phy1: emdio2_phy@1 {
+               compatible = "ethernet-phy-ieee802.3-c45";
+               reg = <0x0>;
+       };
+       mdio2_phy2: emdio2_phy@2 {
+               compatible = "ethernet-phy-ieee802.3-c45";
+               reg = <0x1>;
+       };
+       mdio2_phy3: emdio2_phy@3 {
+               compatible = "ethernet-phy-ieee802.3-c45";
+               reg = <0x2>;
+       };
+       mdio2_phy4: emdio2_phy@4 {
+               compatible = "ethernet-phy-ieee802.3-c45";
+               reg = <0x3>;
+       };
+};
+
 &dspi {
        bus-num = <0>;
        status = "okay";
index 87617ca51f6a67dcd65354d37884de3e597e7b83..d787778de848499e2991b1e71fb9df52e6bcf035 100644 (file)
        };
 };
 
+&dpmac3 {
+       status = "okay";
+       phy-handle = <&aquantia_phy1>;
+       phy-connection-type = "usxgmii";
+};
+
+&dpmac4 {
+       status = "okay";
+       phy-handle = <&aquantia_phy2>;
+       phy-connection-type = "usxgmii";
+};
+
+&dpmac17 {
+       status = "okay";
+       phy-handle = <&rgmii_phy1>;
+       phy-connection-type = "rgmii-id";
+};
+
+&dpmac18 {
+       status = "okay";
+       phy-handle = <&rgmii_phy2>;
+       phy-connection-type = "rgmii-id";
+};
+
+&emdio1 {
+       status = "okay";
+       rgmii_phy1: ethernet-phy@1 {
+               /* AR8035 PHY - "compatible" property not strictly needed */
+               compatible = "ethernet-phy-id004d.d072";
+               reg = <0x1>;
+               /* Poll mode - no "interrupts" property defined */
+       };
+       rgmii_phy2: ethernet-phy@2 {
+               /* AR8035 PHY - "compatible" property not strictly needed */
+               compatible = "ethernet-phy-id004d.d072";
+               reg = <0x2>;
+               /* Poll mode - no "interrupts" property defined */
+       };
+       aquantia_phy1: ethernet-phy@4 {
+               /* AQR107 PHY - "compatible" property not strictly needed */
+               compatible = "ethernet-phy-ieee802.3-c45";
+               interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
+               reg = <0x4>;
+       };
+       aquantia_phy2: ethernet-phy@5 {
+               /* AQR107 PHY - "compatible" property not strictly needed */
+               compatible = "ethernet-phy-ieee802.3-c45";
+               interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
+               reg = <0x5>;
+       };
+};
+
 &esdhc0 {
        status = "okay";
 };
index 42ce4379eceb3b7726e263177b92b692e58de1a6..17ecdc569b37b3060f9424c38bc590c5b070ab04 100644 (file)
                bus-range = <0x0 0xff>;
                ranges = <0x82000000 0x0 0x40000000 0xa8 0x40000000 0x0 0x40000000>;
        };
+
+       fsl_mc: fsl-mc@80c000000 {
+               compatible = "fsl,qoriq-mc", "simple-mfd";
+               reg = <0x00000008 0x0c000000 0 0x40>,
+                     <0x00000000 0x08340000 0 0x40000>;
+               #address-cells = <3>;
+               #size-cells = <1>;
+
+               /*
+                * Region type 0x0 - MC portals
+                * Region type 0x1 - QBMAN portals
+                */
+               ranges = <0x0 0x0 0x0 0x8 0x0c000000 0x4000000
+                         0x1 0x0 0x0 0x8 0x18000000 0x8000000>;
+
+               dpmacs {
+                       compatible = "simple-mfd";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       dpmac3: dpmac@3 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x3>;
+                               status = "disabled";
+                       };
+
+                       dpmac4: dpmac@4 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x4>;
+                               status = "disabled";
+                       };
+
+                       dpmac17: dpmac@11 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x11>;
+                               status = "disabled";
+                       };
+
+                       dpmac18: dpmac@12 {
+                               compatible = "fsl,qoriq-mc-dpmac";
+                               reg = <0x12>;
+                               status = "disabled";
+                       };
+               };
+       };
+
+       /* WRIOP0: 0x8b8_0000, E-MDIO1: 0x1_6000 */
+       emdio1: mdio@8b96000 {
+               compatible = "fsl,ls-mdio";
+               reg = <0x0 0x8b96000 0x0 0x1000>;
+               interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       /* WRIOP0: 0x8b8_0000, E-MDIO2: 0x1_7000 */
+       emdio2: mdio@8b97000 {
+               compatible = "fsl,ls-mdio";
+               reg = <0x0 0x8b97000 0x0 0x1000>;
+               interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
 };
diff --git a/arch/arm/dts/qoriq-fman3-0-10g-0.dtsi b/arch/arm/dts/qoriq-fman3-0-10g-0.dtsi
new file mode 100644 (file)
index 0000000..8f4776e
--- /dev/null
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * QorIQ FMan v3 10g port #0 device tree
+ *
+ * Copyright 2012-2015 Freescale Semiconductor Inc.
+ * Copyright 2020 NXP
+ *
+ */
+
+fman@1a00000 {
+       fman0_rx_0x10: port@90000 {
+               cell-index = <0x10>;
+               compatible = "fsl,fman-v3-port-rx";
+               reg = <0x90000 0x1000>;
+               fsl,fman-10g-port;
+       };
+
+       fman0_tx_0x30: port@b0000 {
+               cell-index = <0x30>;
+               compatible = "fsl,fman-v3-port-tx";
+               reg = <0xb0000 0x1000>;
+               fsl,fman-10g-port;
+       };
+
+       ethernet@f0000 {
+               cell-index = <0x8>;
+               compatible = "fsl,fman-memac";
+               reg = <0xf0000 0x1000>;
+               fsl,fman-ports = <&fman0_rx_0x10 &fman0_tx_0x30>;
+               pcsphy-handle = <&pcsphy6>;
+               status = "disabled";
+       };
+
+       mdio@f1000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+               reg = <0xf1000 0x1000>;
+
+               pcsphy6: ethernet-phy@0 {
+                       reg = <0x0>;
+               };
+       };
+};
diff --git a/arch/arm/dts/qoriq-fman3-0-10g-1.dtsi b/arch/arm/dts/qoriq-fman3-0-10g-1.dtsi
new file mode 100644 (file)
index 0000000..b5eb22f
--- /dev/null
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * QorIQ FMan v3 10g port #1 device tree
+ *
+ * Copyright 2012-2015 Freescale Semiconductor Inc.
+ * Copyright 2020 NXP
+ *
+ */
+
+fman@1a00000 {
+       fman0_rx_0x11: port@91000 {
+               cell-index = <0x11>;
+               compatible = "fsl,fman-v3-port-rx";
+               reg = <0x91000 0x1000>;
+               fsl,fman-10g-port;
+       };
+
+       fman0_tx_0x31: port@b1000 {
+               cell-index = <0x31>;
+               compatible = "fsl,fman-v3-port-tx";
+               reg = <0xb1000 0x1000>;
+               fsl,fman-10g-port;
+       };
+
+       ethernet@f2000 {
+               cell-index = <0x9>;
+               compatible = "fsl,fman-memac";
+               reg = <0xf2000 0x1000>;
+               fsl,fman-ports = <&fman0_rx_0x11 &fman0_tx_0x31>;
+               pcsphy-handle = <&pcsphy7>;
+               status = "disabled";
+       };
+
+       mdio@f3000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+               reg = <0xf3000 0x1000>;
+
+               pcsphy7: ethernet-phy@0 {
+                       reg = <0x0>;
+               };
+       };
+};
diff --git a/arch/arm/dts/qoriq-fman3-0-1g-0.dtsi b/arch/arm/dts/qoriq-fman3-0-1g-0.dtsi
new file mode 100644 (file)
index 0000000..4264d47
--- /dev/null
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * QorIQ FMan v3 1g port #0 device tree
+ *
+ * Copyright 2012-2015 Freescale Semiconductor Inc.
+ * Copyright 2020 NXP
+ *
+ */
+
+fman@1a00000 {
+       fman0_rx_0x08: port@88000 {
+               cell-index = <0x8>;
+               compatible = "fsl,fman-v3-port-rx";
+               reg = <0x88000 0x1000>;
+       };
+
+       fman0_tx_0x28: port@a8000 {
+               cell-index = <0x28>;
+               compatible = "fsl,fman-v3-port-tx";
+               reg = <0xa8000 0x1000>;
+       };
+
+       ethernet@e0000 {
+               cell-index = <0>;
+               compatible = "fsl,fman-memac";
+               reg = <0xe0000 0x1000>;
+               fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
+               ptp-timer = <&ptp_timer0>;
+               pcsphy-handle = <&pcsphy0>;
+               status = "disabled";
+       };
+
+       mdio@e1000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+               reg = <0xe1000 0x1000>;
+
+               pcsphy0: ethernet-phy@0 {
+                       reg = <0x0>;
+               };
+       };
+};
diff --git a/arch/arm/dts/qoriq-fman3-0-1g-1.dtsi b/arch/arm/dts/qoriq-fman3-0-1g-1.dtsi
new file mode 100644 (file)
index 0000000..d60f8c7
--- /dev/null
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * QorIQ FMan v3 1g port #1 device tree
+ *
+ * Copyright 2012-2015 Freescale Semiconductor Inc.
+ * Copyright 2020 NXP
+ *
+ */
+
+fman@1a00000 {
+       fman0_rx_0x09: port@89000 {
+               cell-index = <0x9>;
+               compatible = "fsl,fman-v3-port-rx";
+               reg = <0x89000 0x1000>;
+       };
+
+       fman0_tx_0x29: port@a9000 {
+               cell-index = <0x29>;
+               compatible = "fsl,fman-v3-port-tx";
+               reg = <0xa9000 0x1000>;
+       };
+
+       ethernet@e2000 {
+               cell-index = <1>;
+               compatible = "fsl,fman-memac";
+               reg = <0xe2000 0x1000>;
+               fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>;
+               ptp-timer = <&ptp_timer0>;
+               pcsphy-handle = <&pcsphy1>;
+               status = "disabled";
+       };
+
+       mdio@e3000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+               reg = <0xe3000 0x1000>;
+
+               pcsphy1: ethernet-phy@0 {
+                       reg = <0x0>;
+               };
+       };
+};
diff --git a/arch/arm/dts/qoriq-fman3-0-1g-2.dtsi b/arch/arm/dts/qoriq-fman3-0-1g-2.dtsi
new file mode 100644 (file)
index 0000000..7c5edc0
--- /dev/null
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * QorIQ FMan v3 1g port #2 device tree
+ *
+ * Copyright 2012-2015 Freescale Semiconductor Inc.
+ * Copyright 2020 NXP
+ *
+ */
+
+fman@1a00000 {
+       fman0_rx_0x0a: port@8a000 {
+               cell-index = <0xa>;
+               compatible = "fsl,fman-v3-port-rx";
+               reg = <0x8a000 0x1000>;
+       };
+
+       fman0_tx_0x2a: port@aa000 {
+               cell-index = <0x2a>;
+               compatible = "fsl,fman-v3-port-tx";
+               reg = <0xaa000 0x1000>;
+       };
+
+       ethernet@e4000 {
+               cell-index = <2>;
+               compatible = "fsl,fman-memac";
+               reg = <0xe4000 0x1000>;
+               fsl,fman-ports = <&fman0_rx_0x0a &fman0_tx_0x2a>;
+               ptp-timer = <&ptp_timer0>;
+               pcsphy-handle = <&pcsphy2>;
+               status = "disabled";
+       };
+
+       mdio@e5000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+               reg = <0xe5000 0x1000>;
+
+               pcsphy2: ethernet-phy@0 {
+                       reg = <0x0>;
+               };
+       };
+};
diff --git a/arch/arm/dts/qoriq-fman3-0-1g-3.dtsi b/arch/arm/dts/qoriq-fman3-0-1g-3.dtsi
new file mode 100644 (file)
index 0000000..2d2de58
--- /dev/null
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * QorIQ FMan v3 1g port #3 device tree
+ *
+ * Copyright 2012-2015 Freescale Semiconductor Inc.
+ * Copyright 2020 NXP
+ *
+ */
+
+fman@1a00000 {
+       fman0_rx_0x0b: port@8b000 {
+               cell-index = <0xb>;
+               compatible = "fsl,fman-v3-port-rx";
+               reg = <0x8b000 0x1000>;
+       };
+
+       fman0_tx_0x2b: port@ab000 {
+               cell-index = <0x2b>;
+               compatible = "fsl,fman-v3-port-tx";
+               reg = <0xab000 0x1000>;
+       };
+
+       ethernet@e6000 {
+               cell-index = <3>;
+               compatible = "fsl,fman-memac";
+               reg = <0xe6000 0x1000>;
+               fsl,fman-ports = <&fman0_rx_0x0b &fman0_tx_0x2b>;
+               ptp-timer = <&ptp_timer0>;
+               pcsphy-handle = <&pcsphy3>;
+               status = "disabled";
+       };
+
+       mdio@e7000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+               reg = <0xe7000 0x1000>;
+
+               pcsphy3: ethernet-phy@0 {
+                       reg = <0x0>;
+               };
+       };
+};
diff --git a/arch/arm/dts/qoriq-fman3-0-1g-4.dtsi b/arch/arm/dts/qoriq-fman3-0-1g-4.dtsi
new file mode 100644 (file)
index 0000000..f5a73dc
--- /dev/null
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * QorIQ FMan v3 1g port #4 device tree
+ *
+ * Copyright 2012-2015 Freescale Semiconductor Inc.
+ * Copyright 2020 NXP
+ *
+ */
+
+fman@1a00000 {
+       fman0_rx_0x0c: port@8c000 {
+               cell-index = <0xc>;
+               compatible = "fsl,fman-v3-port-rx";
+               reg = <0x8c000 0x1000>;
+       };
+
+       fman0_tx_0x2c: port@ac000 {
+               cell-index = <0x2c>;
+               compatible = "fsl,fman-v3-port-tx";
+               reg = <0xac000 0x1000>;
+       };
+
+       ethernet@e8000 {
+               cell-index = <4>;
+               compatible = "fsl,fman-memac";
+               reg = <0xe8000 0x1000>;
+               fsl,fman-ports = <&fman0_rx_0x0c &fman0_tx_0x2c>;
+               ptp-timer = <&ptp_timer0>;
+               pcsphy-handle = <&pcsphy4>;
+               status = "disabled";
+       };
+
+       mdio@e9000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+               reg = <0xe9000 0x1000>;
+
+               pcsphy4: ethernet-phy@0 {
+                       reg = <0x0>;
+               };
+       };
+};
diff --git a/arch/arm/dts/qoriq-fman3-0-1g-5.dtsi b/arch/arm/dts/qoriq-fman3-0-1g-5.dtsi
new file mode 100644 (file)
index 0000000..baa5751
--- /dev/null
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * QorIQ FMan v3 1g port #5 device tree
+ *
+ * Copyright 2012-2015 Freescale Semiconductor Inc.
+ * Copyright 2020 NXP
+ *
+ */
+
+fman@1a00000 {
+       fman0_rx_0x0d: port@8d000 {
+               cell-index = <0xd>;
+               compatible = "fsl,fman-v3-port-rx";
+               reg = <0x8d000 0x1000>;
+       };
+
+       fman0_tx_0x2d: port@ad000 {
+               cell-index = <0x2d>;
+               compatible = "fsl,fman-v3-port-tx";
+               reg = <0xad000 0x1000>;
+       };
+
+       ethernet@ea000 {
+               cell-index = <5>;
+               compatible = "fsl,fman-memac";
+               reg = <0xea000 0x1000>;
+               fsl,fman-ports = <&fman0_rx_0x0d &fman0_tx_0x2d>;
+               ptp-timer = <&ptp_timer0>;
+               pcsphy-handle = <&pcsphy5>;
+               status = "disabled";
+       };
+
+       mdio@eb000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+               reg = <0xeb000 0x1000>;
+
+               pcsphy5: ethernet-phy@0 {
+                       reg = <0x0>;
+               };
+       };
+};
diff --git a/arch/arm/dts/qoriq-fman3-0.dtsi b/arch/arm/dts/qoriq-fman3-0.dtsi
new file mode 100644 (file)
index 0000000..82fe796
--- /dev/null
@@ -0,0 +1,82 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * QorIQ FMan v3 device tree
+ *
+ * Copyright 2012-2015 Freescale Semiconductor Inc.
+ * Copyright 2020 NXP
+ *
+ */
+
+fman0: fman@1a00000 {
+       #address-cells = <1>;
+       #size-cells = <1>;
+       cell-index = <0>;
+       compatible = "fsl,fman";
+       ranges = <0x0 0x0 0x1a00000 0xfe000>;
+       reg = <0x0 0x1a00000 0x0 0xfe000>;
+       clocks = <&clockgen 3 0>;
+       clock-names = "fmanclk";
+       fsl,qman-channel-range = <0x800 0x10>;
+       ptimer-handle = <&ptp_timer0>;
+
+       muram@0 {
+               compatible = "fsl,fman-muram";
+               reg = <0x0 0x60000>;
+       };
+
+       fman0_oh_0x2: port@82000 {
+               cell-index = <0x2>;
+               compatible = "fsl,fman-v3-port-oh";
+               reg = <0x82000 0x1000>;
+       };
+
+       fman0_oh_0x3: port@83000 {
+               cell-index = <0x3>;
+               compatible = "fsl,fman-v3-port-oh";
+               reg = <0x83000 0x1000>;
+       };
+
+       fman0_oh_0x4: port@84000 {
+               cell-index = <0x4>;
+               compatible = "fsl,fman-v3-port-oh";
+               reg = <0x84000 0x1000>;
+       };
+
+       fman0_oh_0x5: port@85000 {
+               cell-index = <0x5>;
+               compatible = "fsl,fman-v3-port-oh";
+               reg = <0x85000 0x1000>;
+       };
+
+       fman0_oh_0x6: port@86000 {
+               cell-index = <0x6>;
+               compatible = "fsl,fman-v3-port-oh";
+               reg = <0x86000 0x1000>;
+       };
+
+       fman0_oh_0x7: port@87000 {
+               cell-index = <0x7>;
+               compatible = "fsl,fman-v3-port-oh";
+               reg = <0x87000 0x1000>;
+       };
+
+       mdio0: mdio@fc000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+               reg = <0xfc000 0x1000>;
+       };
+
+       xmdio0: mdio@fd000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
+               reg = <0xfd000 0x1000>;
+       };
+};
+
+ptp_timer0: ptp-timer@1afe000 {
+       compatible = "fsl,fman-ptp-timer";
+       reg = <0x0 0x1afe000 0x0 0x1000>;
+       clocks = <&clockgen 3 0>;
+};
index 1e16d7fab97d178b6dd03ca7e6d383c8c10ea506..32cb3bffcb948e6700a4e53101cbdf5d39dd1fe4 100644 (file)
                #size-cells = <1>;
                ranges;
 
+               smcc: memory-controller@e000e000 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       clock-names = "memclk", "apb_pclk";
+                       clocks = <&clkc 11>, <&clkc 44>;
+                       compatible = "arm,pl353-smc-r2p1", "arm,primecell";
+                       ranges;
+                       reg = <0xe000e000 0x1000>;
+
+                       nand0: flash@e1000000 {
+                               compatible = "arm,pl353-nand-r2p1";
+                               reg = <0xe1000000 0x1000000>;
+                       };
+               };
+
                slcr: slcr@f8000000 {
                        u-boot,dm-pre-reloc;
                        #address-cells = <1>;
index 39b5d7fff9ac78a660d4300e28032683d09232df..bf982e221830485c53d21712d119480aa92c3cf9 100644 (file)
                  "", "", "", "", "", /* 65 - 69 */
                  "", "", "", "", "", /* 70 - 74 */
                  "", "ETH_MDC", "ETH_MDIO", /* 75 - 77, MIO end and EMIO start */
-                 "", "", /* 78 - 79 */
-                 "", "", "", "", "", /* 80 - 84 */
-                 "", "", "", "", "", /* 85 -89 */
+                 "SYSCTLR_VERSAL_MODE0", "SYSCTLR_VERSAL_MODE1", /* 78 - 79 */
+                 "SYSCTLR_VERSAL_MODE2", "SYSCTLR_VERSAL_MODE3", "SYSCTLR_POR_B_LS", "", "", /* 80 - 84 */
+                 "", "", "", "", "", /* 85 - 89 */
                  "", "", "", "", "", /* 90 - 94 */
                  "", "", "", "", "", /* 95 - 99 */
                  "", "", "", "", "", /* 100 - 104 */
                        #size-cells = <0>;
                        reg = <0>;
                        /* u152 IR35215 0x16/0x46 vcc_soc */
-                       /* u160 IRPS5401 0x17/0x47 */
-                       /* u167 IRPS5401 0x1c/0x4c */
-                       /* u175 IRPS5401 0x1d/0x4d */
                        /* u179 ir38164 0x19/0x49 vcco_500 */
                        /* u181 ir38164 0x1a/0x4a vcco_501 */
                        /* u183 ir38164 0x1b/0x4b vcco_502 */
                        /* u189 ir38164 0x20/0x50 mgtyavtt */
                        /* u194 ir38164 0x13/0x43 vdd1_1v8_lp4 */
                        /* u195 ir38164 0x14/0x44 vdd2_1v8_lp4 */
+
+                       irps5401_47: irps5401@47 { /* IRPS5401 - u160 */
+                               compatible = "infineon,irps5401";
+                               reg = <0x47>; /* pmbus / i2c 0x17 */
+                       };
+                       irps5401_4c: irps5401@4c { /* IRPS5401 - u167 */
+                               compatible = "infineon,irps5401";
+                               reg = <0x4c>; /* pmbus / i2c 0x1c */
+                       };
+                       irps5401_4d: irps5401@4d { /* IRPS5401 - u175 */
+                               compatible = "infineon,irps5401";
+                               reg = <0x4d>; /* pmbus / i2c 0x1d */
+                       };
                };
                i2c@1 { /* PMBUS1_INA226 */
                        #address-cells = <1>;
index 3ceb39dce02babdaa9d3c0e9b9cf495387f574a8..a4bd6b800a189bbf77e755ae39dac086a9aaad1e 100644 (file)
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <2>;
-                       irps5401_43: irps54012@43 { /* IRPS5401 - u175 */
-                               #clock-cells = <0>;
+                       irps5401_43: irps5401@43 { /* IRPS5401 - u175 */
                                compatible = "infineon,irps5401";
-                               reg = <0x43>;
+                               reg = <0x43>; /* pmbus / i2c 0x13 */
                        };
-                       irps5401_4d: irps54012@4d { /* IRPS5401 - u180 */
-                               #clock-cells = <0>;
+                       irps5401_44: irps5401@44 { /* IRPS5401 - u180 */
                                compatible = "infineon,irps5401";
-                               reg = <0x4d>;
+                               reg = <0x44>; /* pmbus / i2c 0x14 */
                        };
                };
 
index 7dad4523deb0b43a5e3b9f89a230cac6ed45b79e..d4b3769a27ccae6e212520173d6bf5386ecb803b 100644 (file)
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <2>;
-                       irps5401_43: irps54012@43 { /* IRPS5401 - u175 */
-                               #clock-cells = <0>;
+                       irps5401_43: irps5401@43 { /* IRPS5401 - u175 */
                                compatible = "infineon,irps5401";
-                               reg = <0x43>;
+                               reg = <0x43>; /* pmbus / i2c 0x13 */
                        };
-                       irps5401_4d: irps54012@4d { /* IRPS5401 - u180 */
-                               #clock-cells = <0>;
+                       irps5401_44: irps5401@44 { /* IRPS5401 - u180 */
                                compatible = "infineon,irps5401";
-                               reg = <0x4d>;
+                               reg = <0x44>; /* pmbus / i2c 0x14 */
                        };
                };
 
index d16bf8ac7ac7b68401effc61964ffc85dd03b105..63e285fe9a9aa3a552f18cfaf6f1616d518023f8 100644 (file)
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <2>;
-                       irps5401_43: irps54012@43 { /* IRPS5401 - u53 check these */
-                               #clock-cells = <0>;
+                       irps5401_43: irps5401@43 { /* IRPS5401 - u53 check these */
                                compatible = "infineon,irps5401";
                                reg = <0x43>;
                        };
-                       irps5401_44: irps54012@44 { /* IRPS5401 - u55 */
-                               #clock-cells = <0>;
+                       irps5401_44: irps5401@44 { /* IRPS5401 - u55 */
                                compatible = "infineon,irps5401";
                                reg = <0x44>;
                        };
-                       irps5401_45: irps54012@45 { /* IRPS5401 - u57 */
-                               #clock-cells = <0>;
+                       irps5401_45: irps5401@45 { /* IRPS5401 - u57 */
                                compatible = "infineon,irps5401";
                                reg = <0x45>;
                        };
index 75ecd7a5c203e31ad5596f8851e960379942e104..118a2de96b3ce935ce88e79e6ff4292d06a55de7 100644 (file)
                        /* u112 - ir38164 0x13/0x43 */
                        /* u123 - ir38164 0x1c/0x4c */
 
-                       irps5401_44: irps54012@44 { /* IRPS5401 - u53 */
-                               #clock-cells = <0>;
+                       irps5401_44: irps5401@44 { /* IRPS5401 - u53 */
                                compatible = "infineon,irps5401";
                                reg = <0x44>; /* i2c addr 0x14 */
                        };
-                       irps5401_45: irps54012@45 { /* IRPS5401 - u55 */
-                               #clock-cells = <0>;
+                       irps5401_45: irps5401@45 { /* IRPS5401 - u55 */
                                compatible = "infineon,irps5401";
                                reg = <0x45>; /* i2c addr 0x15 */
                        };
index f3b5edfeb4234f1ea3a8036f41a4182a3ea4c587..e454bfcba797447bc62bc6633982d38730ca3816 100644 (file)
                        /* u112 - ir38164 0x13/0x43 */
                        /* u123 - ir38164 0x1c/0x4c */
 
-                       irps5401_44: irps54012@44 { /* IRPS5401 - u53 */
-                               #clock-cells = <0>;
+                       irps5401_44: irps5401@44 { /* IRPS5401 - u53 */
                                compatible = "infineon,irps5401";
                                reg = <0x44>; /* i2c addr 0x14 */
                        };
-                       irps5401_45: irps54012@45 { /* IRPS5401 - u55 */
-                               #clock-cells = <0>;
+                       irps5401_45: irps5401@45 { /* IRPS5401 - u55 */
                                compatible = "infineon,irps5401";
                                reg = <0x45>; /* i2c addr 0x15 */
                        };
index c62d414aacc9d310627a67a0664ab28f963f5c8e..020548ac6ce635b122cbc0f9865292132286fd60 100644 (file)
@@ -158,6 +158,10 @@ void erratum_a010315(void);
 
 bool soc_has_dp_ddr(void);
 bool soc_has_aiop(void);
+
+#ifdef CONFIG_GIC_V3_ITS
+int ls_gic_rd_tables_init(void *blob);
+#endif
 #endif
 
 #endif /* _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ */
index df9f1835c9e9ff387772e2ea58adedc37215dd01..4bccfbe6e1b1d3fe2ac67df60fd1d167b341f795 100644 (file)
                compatible = "denx,u-boot-acpi-test";
        };
 
+       acpi-test2 {
+               compatible = "denx,u-boot-acpi-test";
+       };
+
        clocks {
                clk_fixed: clk-fixed {
                        compatible = "fixed-clock";
index f4ce72d56602c0b166ccf9a0beaf61852c142c90..f95ddb058a22a4c9ff6980f3d658a8186fded478 100644 (file)
@@ -13,6 +13,7 @@
 struct arch_global_data {
        uint8_t         *ram_buf;       /* emulated RAM buffer */
        void            *text_base;     /* pointer to base of text region */
+       ulong acpi_start;               /* Start address of ACPI tables */
 };
 
 #include <asm-generic/global_data.h>
index 17cf1682ad03d089f3867da0bb01b984f956ad53..7ef169b147f97970518d108a260b9c988c96ca44 100644 (file)
@@ -566,6 +566,8 @@ int arch_fsp_init_r(void)
        struct udevice *dev, *itss;
        int ret;
 
+       if (!ll_boot_init())
+               return 0;
        /*
         * This must be called before any devices are probed. Put any probing
         * into arch_fsps_preinit() above.
index 37e0424b5e6f3516342bd2b9ca4e7c4b16f051fc..0f04c4f8e91c7094e9954dde81eeaa32cd005d78 100644 (file)
@@ -115,20 +115,11 @@ __weak void cb_parse_unhandled(u32 tag, unsigned char *ptr)
 
 static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
 {
+       unsigned char *ptr = addr;
        struct cb_header *header;
-       unsigned char *ptr = (unsigned char *)addr;
        int i;
 
-       for (i = 0; i < len; i += 16, ptr += 16) {
-               header = (struct cb_header *)ptr;
-               if (!strncmp((const char *)header->signature, "LBIO", 4))
-                       break;
-       }
-
-       /* We walked the entire space and didn't find anything. */
-       if (i >= len)
-               return -1;
-
+       header = (struct cb_header *)ptr;
        if (!header->table_bytes)
                return 0;
 
@@ -231,10 +222,13 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
 
 int get_coreboot_info(struct sysinfo_t *info)
 {
-       int ret = cb_parse_header((void *)0x00000000, 0x1000, info);
+       long addr;
+       int ret;
 
-       if (ret != 1)
-               ret = cb_parse_header((void *)0x000f0000, 0x1000, info);
+       addr = locate_coreboot_table();
+       if (addr < 0)
+               return addr;
+       ret = cb_parse_header((void *)addr, 0x1000, info);
 
-       return (ret == 1) ? 0 : -1;
+       return ret == 1 ? 0 : -ENOENT;
 }
index cec04b481b9e3c13d732238621c291c36bcd191e..8526e856d7d47f97726c05ab389da2ade5a403ae 100644 (file)
@@ -239,8 +239,10 @@ int cpu_init_r(void)
        struct udevice *dev;
        int ret;
 
-       if (!ll_boot_init())
+       if (!ll_boot_init()) {
+               uclass_first_device(UCLASS_PCI, &dev);
                return 0;
+       }
 
        ret = x86_init_cpus();
        if (ret)
index c8da7f10e9b611739b821d5d4c004b3acfc482f0..0312a26bbbf5c719e690c32e89e1ea00c29359ed 100644 (file)
@@ -447,10 +447,37 @@ int x86_cpu_init_f(void)
        return 0;
 }
 
+long detect_coreboot_table_at(ulong start, ulong size)
+{
+       u32 *ptr, *end;
+
+       size /= 4;
+       for (ptr = (void *)start, end = ptr + size; ptr < end; ptr += 4) {
+               if (*ptr == 0x4f49424c) /* "LBIO" */
+                       return (long)ptr;
+       }
+
+       return -ENOENT;
+}
+
+long locate_coreboot_table(void)
+{
+       long addr;
+
+       /* We look for LBIO in the first 4K of RAM and again at 960KB */
+       addr = detect_coreboot_table_at(0x0, 0x1000);
+       if (addr < 0)
+               addr = detect_coreboot_table_at(0xf0000, 0x1000);
+
+       return addr;
+}
+
 int x86_cpu_reinit_f(void)
 {
        setup_identity();
        setup_pci_ram_top();
+       if (locate_coreboot_table() >= 0)
+               gd->flags |= GD_FLG_SKIP_LL_INIT;
 
        return 0;
 }
index 4c7e9ea2151e26573d321c23f3301cde892a751a..e67a116ac1acf3111111b84216edf2baaa5b58fc 100644 (file)
@@ -264,6 +264,9 @@ int interrupt_init(void)
        struct udevice *dev;
        int ret;
 
+       if (!ll_boot_init())
+               return 0;
+
        /* Try to set up the interrupt router, but don't require one */
        ret = irq_first_device_type(X86_IRQT_BASE, &dev);
        if (ret && ret != -ENODEV)
@@ -295,8 +298,7 @@ int interrupt_init(void)
         * TODO(sjg@chromium.org): But we don't handle these correctly when
         * booted from EFI.
         */
-       if (ll_boot_init())
-               enable_interrupts();
+       enable_interrupts();
 #endif
 
        return 0;
index 22cab2dd6cedf2956c294e543537c4a7f0b0b011..905c825cdc44d05189dd17451c433a6df6a74582 100644 (file)
 .globl _start
 .type _start, @function
 _start:
-       /* Set up memory using the existing stack */
+       /*
+        * If running from coreboot, CAR is no-longer available. Use the
+        * existing stack, which is large enough.
+        */
+       call    locate_coreboot_table
+       cmp     $0, %eax
+       jge     use_existing_stack
+
        movl    $(CONFIG_SYS_CAR_ADDR + CONFIG_SYS_CAR_SIZE - 4), %eax
 #ifdef CONFIG_DCACHE_RAM_MRC_VAR_SIZE
        subl    $CONFIG_DCACHE_RAM_MRC_VAR_SIZE, %eax
 #endif
+       jmp     2f
        /*
-        * We don't subject CONFIG_DCACHE_RAM_MRC_VAR_SIZE since memory is
+        * We don't subtract CONFIG_DCACHE_RAM_MRC_VAR_SIZE since memory is
         * already set up. This has the happy side-effect of putting gd in a
         * new place separate from SPL, so the memset() in
         * board_init_f_init_reserve() does not cause any problems (otherwise
         * it would zero out the gd and crash)
         */
+       /* Set up memory using the existing stack */
+use_existing_stack:
+       mov     %esp, %eax
+2:
        call    board_init_f_alloc_reserve
        mov     %eax, %esp
 
index 61de0077d72cfcd99b92ea3a131b8afa81a7c132..268284f43c30745ad1634bdb801ba48309a86227 100644 (file)
@@ -343,4 +343,11 @@ void *high_table_malloc(size_t bytes);
  */
 void write_coreboot_table(u32 addr, struct memory_area *cfg_tables);
 
+/**
+ * locate_coreboot_table() - Try to find coreboot tables at standard locations
+ *
+ * @return address of table that was found, or -ve error number
+ */
+long locate_coreboot_table(void);
+
 #endif
index f4c1839104e15ea5ec7952bb2110c93dff7ce29e..4aee2f3e8c46554ef6b40fc18bc94fde96145338 100644 (file)
@@ -123,6 +123,7 @@ struct arch_global_data {
 #ifdef CONFIG_FSP_VERSION2
        struct fsp_header *fsp_s_hdr;   /* Pointer to FSP-S header */
 #endif
+       ulong acpi_start;               /* Start address of ACPI tables */
 };
 
 #endif
index 9346e165d89ba2c8bba38ca94eba2b9b0b93d035..13f1409de815dd7a220ea45a34e1e1f447a16a89 100644 (file)
@@ -10,6 +10,7 @@
 #include <cpu.h>
 #include <dm.h>
 #include <dm/uclass-internal.h>
+#include <mapmem.h>
 #include <serial.h>
 #include <version.h>
 #include <acpi/acpi_table.h>
@@ -19,6 +20,7 @@
 #include <asm/mpspec.h>
 #include <asm/tables.h>
 #include <asm/arch/global_nvs.h>
+#include <dm/acpi.h>
 
 /*
  * IASL compiles the dsdt entries and writes the hex values
@@ -29,139 +31,6 @@ extern const unsigned char AmlCode[];
 /* ACPI RSDP address to be used in boot parameters */
 static ulong acpi_rsdp_addr;
 
-static void acpi_write_rsdp(struct acpi_rsdp *rsdp, struct acpi_rsdt *rsdt,
-                           struct acpi_xsdt *xsdt)
-{
-       memset(rsdp, 0, sizeof(struct acpi_rsdp));
-
-       memcpy(rsdp->signature, RSDP_SIG, 8);
-       memcpy(rsdp->oem_id, OEM_ID, 6);
-
-       rsdp->length = sizeof(struct acpi_rsdp);
-       rsdp->rsdt_address = (u32)rsdt;
-
-       /*
-        * Revision: ACPI 1.0: 0, ACPI 2.0/3.0/4.0: 2
-        *
-        * Some OSes expect an XSDT to be present for RSD PTR revisions >= 2.
-        * If we don't have an ACPI XSDT, force ACPI 1.0 (and thus RSD PTR
-        * revision 0)
-        */
-       if (xsdt == NULL) {
-               rsdp->revision = ACPI_RSDP_REV_ACPI_1_0;
-       } else {
-               rsdp->xsdt_address = (u64)(u32)xsdt;
-               rsdp->revision = ACPI_RSDP_REV_ACPI_2_0;
-       }
-
-       /* Calculate checksums */
-       rsdp->checksum = table_compute_checksum((void *)rsdp, 20);
-       rsdp->ext_checksum = table_compute_checksum((void *)rsdp,
-                       sizeof(struct acpi_rsdp));
-}
-
-void acpi_fill_header(struct acpi_table_header *header, char *signature)
-{
-       memcpy(header->signature, signature, 4);
-       memcpy(header->oem_id, OEM_ID, 6);
-       memcpy(header->oem_table_id, OEM_TABLE_ID, 8);
-       header->oem_revision = U_BOOT_BUILD_DATE;
-       memcpy(header->aslc_id, ASLC_ID, 4);
-}
-
-static void acpi_write_rsdt(struct acpi_rsdt *rsdt)
-{
-       struct acpi_table_header *header = &(rsdt->header);
-
-       /* Fill out header fields */
-       acpi_fill_header(header, "RSDT");
-       header->length = sizeof(struct acpi_rsdt);
-       header->revision = 1;
-
-       /* Entries are filled in later, we come with an empty set */
-
-       /* Fix checksum */
-       header->checksum = table_compute_checksum((void *)rsdt,
-                       sizeof(struct acpi_rsdt));
-}
-
-static void acpi_write_xsdt(struct acpi_xsdt *xsdt)
-{
-       struct acpi_table_header *header = &(xsdt->header);
-
-       /* Fill out header fields */
-       acpi_fill_header(header, "XSDT");
-       header->length = sizeof(struct acpi_xsdt);
-       header->revision = 1;
-
-       /* Entries are filled in later, we come with an empty set */
-
-       /* Fix checksum */
-       header->checksum = table_compute_checksum((void *)xsdt,
-                       sizeof(struct acpi_xsdt));
-}
-
-/**
- * Add an ACPI table to the RSDT (and XSDT) structure, recalculate length
- * and checksum.
- */
-static void acpi_add_table(struct acpi_rsdp *rsdp, void *table)
-{
-       int i, entries_num;
-       struct acpi_rsdt *rsdt;
-       struct acpi_xsdt *xsdt;
-
-       /* The RSDT is mandatory while the XSDT is not */
-       rsdt = (struct acpi_rsdt *)rsdp->rsdt_address;
-
-       /* This should always be MAX_ACPI_TABLES */
-       entries_num = ARRAY_SIZE(rsdt->entry);
-
-       for (i = 0; i < entries_num; i++) {
-               if (rsdt->entry[i] == 0)
-                       break;
-       }
-
-       if (i >= entries_num) {
-               debug("ACPI: Error: too many tables\n");
-               return;
-       }
-
-       /* Add table to the RSDT */
-       rsdt->entry[i] = (u32)table;
-
-       /* Fix RSDT length or the kernel will assume invalid entries */
-       rsdt->header.length = sizeof(struct acpi_table_header) +
-                               sizeof(u32) * (i + 1);
-
-       /* Re-calculate checksum */
-       rsdt->header.checksum = 0;
-       rsdt->header.checksum = table_compute_checksum((u8 *)rsdt,
-                       rsdt->header.length);
-
-       /* The RSDT is mandatory while the XSDT is not */
-       if (!rsdp->xsdt_address)
-               return;
-
-       /*
-        * And now the same thing for the XSDT. We use the same index as for
-        * now we want the XSDT and RSDT to always be in sync in U-Boot
-        */
-       xsdt = (struct acpi_xsdt *)((u32)rsdp->xsdt_address);
-
-       /* Add table to the XSDT */
-       xsdt->entry[i] = (u64)(u32)table;
-
-       /* Fix XSDT length */
-       xsdt->header.length = sizeof(struct acpi_table_header) +
-                               sizeof(u64) * (i + 1);
-
-       /* Re-calculate checksum */
-       xsdt->header.checksum = 0;
-       xsdt->header.checksum = table_compute_checksum((u8 *)xsdt,
-                       xsdt->header.length);
-}
-
 static void acpi_create_facs(struct acpi_facs *facs)
 {
        memset((void *)facs, 0, sizeof(struct acpi_facs));
@@ -487,12 +356,9 @@ static void acpi_create_spcr(struct acpi_spcr *spcr)
 /*
  * QEMU's version of write_acpi_tables is defined in drivers/misc/qfw.c
  */
-ulong write_acpi_tables(ulong start)
+ulong write_acpi_tables(ulong start_addr)
 {
-       u32 current;
-       struct acpi_rsdp *rsdp;
-       struct acpi_rsdt *rsdt;
-       struct acpi_xsdt *xsdt;
+       struct acpi_ctx sctx, *ctx = &sctx;
        struct acpi_facs *facs;
        struct acpi_table_header *dsdt;
        struct acpi_fadt *fadt;
@@ -500,60 +366,39 @@ ulong write_acpi_tables(ulong start)
        struct acpi_madt *madt;
        struct acpi_csrt *csrt;
        struct acpi_spcr *spcr;
+       void *start;
+       ulong addr;
        int i;
 
-       current = start;
+       start = map_sysmem(start_addr, 0);
 
-       /* Align ACPI tables to 16 byte */
-       current = ALIGN(current, 16);
+       debug("ACPI: Writing ACPI tables at %lx\n", start_addr);
 
-       debug("ACPI: Writing ACPI tables at %lx\n", start);
-
-       /* We need at least an RSDP and an RSDT Table */
-       rsdp = (struct acpi_rsdp *)current;
-       current += sizeof(struct acpi_rsdp);
-       current = ALIGN(current, 16);
-       rsdt = (struct acpi_rsdt *)current;
-       current += sizeof(struct acpi_rsdt);
-       current = ALIGN(current, 16);
-       xsdt = (struct acpi_xsdt *)current;
-       current += sizeof(struct acpi_xsdt);
-       /*
-        * Per ACPI spec, the FACS table address must be aligned to a 64 byte
-        * boundary (Windows checks this, but Linux does not).
-        */
-       current = ALIGN(current, 64);
-
-       /* clear all table memory */
-       memset((void *)start, 0, current - start);
-
-       acpi_write_rsdp(rsdp, rsdt, xsdt);
-       acpi_write_rsdt(rsdt);
-       acpi_write_xsdt(xsdt);
+       acpi_setup_base_tables(ctx, start);
 
        debug("ACPI:    * FACS\n");
-       facs = (struct acpi_facs *)current;
-       current += sizeof(struct acpi_facs);
-       current = ALIGN(current, 16);
+       facs = ctx->current;
+       acpi_inc_align(ctx, sizeof(struct acpi_facs));
 
        acpi_create_facs(facs);
 
        debug("ACPI:    * DSDT\n");
-       dsdt = (struct acpi_table_header *)current;
+       dsdt = ctx->current;
        memcpy(dsdt, &AmlCode, sizeof(struct acpi_table_header));
-       current += sizeof(struct acpi_table_header);
-       memcpy((char *)current,
+       acpi_inc(ctx, sizeof(struct acpi_table_header));
+       memcpy(ctx->current,
               (char *)&AmlCode + sizeof(struct acpi_table_header),
               dsdt->length - sizeof(struct acpi_table_header));
-       current += dsdt->length - sizeof(struct acpi_table_header);
-       current = ALIGN(current, 16);
+       acpi_inc_align(ctx, dsdt->length - sizeof(struct acpi_table_header));
 
        /* Pack GNVS into the ACPI table area */
        for (i = 0; i < dsdt->length; i++) {
                u32 *gnvs = (u32 *)((u32)dsdt + i);
                if (*gnvs == ACPI_GNVS_ADDR) {
-                       debug("Fix up global NVS in DSDT to 0x%08x\n", current);
-                       *gnvs = current;
+                       ulong addr = (ulong)map_to_sysmem(ctx->current);
+
+                       debug("Fix up global NVS in DSDT to %#08lx\n", addr);
+                       *gnvs = addr;
                        break;
                }
        }
@@ -563,51 +408,48 @@ ulong write_acpi_tables(ulong start)
        dsdt->checksum = table_compute_checksum((void *)dsdt, dsdt->length);
 
        /* Fill in platform-specific global NVS variables */
-       acpi_create_gnvs((struct acpi_global_nvs *)current);
-       current += sizeof(struct acpi_global_nvs);
-       current = ALIGN(current, 16);
+       acpi_create_gnvs(ctx->current);
+       acpi_inc_align(ctx, sizeof(struct acpi_global_nvs));
 
        debug("ACPI:    * FADT\n");
-       fadt = (struct acpi_fadt *)current;
-       current += sizeof(struct acpi_fadt);
-       current = ALIGN(current, 16);
+       fadt = ctx->current;
+       acpi_inc_align(ctx, sizeof(struct acpi_fadt));
        acpi_create_fadt(fadt, facs, dsdt);
-       acpi_add_table(rsdp, fadt);
+       acpi_add_table(ctx, fadt);
 
        debug("ACPI:    * MADT\n");
-       madt = (struct acpi_madt *)current;
+       madt = ctx->current;
        acpi_create_madt(madt);
-       current += madt->header.length;
-       acpi_add_table(rsdp, madt);
-       current = ALIGN(current, 16);
+       acpi_inc_align(ctx, madt->header.length);
+       acpi_add_table(ctx, madt);
 
        debug("ACPI:    * MCFG\n");
-       mcfg = (struct acpi_mcfg *)current;
+       mcfg = ctx->current;
        acpi_create_mcfg(mcfg);
-       current += mcfg->header.length;
-       acpi_add_table(rsdp, mcfg);
-       current = ALIGN(current, 16);
+       acpi_inc_align(ctx, mcfg->header.length);
+       acpi_add_table(ctx, mcfg);
 
        debug("ACPI:    * CSRT\n");
-       csrt = (struct acpi_csrt *)current;
+       csrt = ctx->current;
        acpi_create_csrt(csrt);
-       current += csrt->header.length;
-       acpi_add_table(rsdp, csrt);
-       current = ALIGN(current, 16);
+       acpi_inc_align(ctx, csrt->header.length);
+       acpi_add_table(ctx, csrt);
 
        debug("ACPI:    * SPCR\n");
-       spcr = (struct acpi_spcr *)current;
+       spcr = ctx->current;
        acpi_create_spcr(spcr);
-       current += spcr->header.length;
-       acpi_add_table(rsdp, spcr);
-       current = ALIGN(current, 16);
+       acpi_inc_align(ctx, spcr->header.length);
+       acpi_add_table(ctx, spcr);
+
+       acpi_write_dev_tables(ctx);
 
-       debug("current = %x\n", current);
+       addr = map_to_sysmem(ctx->current);
+       debug("current = %lx\n", addr);
 
-       acpi_rsdp_addr = (unsigned long)rsdp;
+       acpi_rsdp_addr = (unsigned long)ctx->rsdp;
        debug("ACPI: done\n");
 
-       return current;
+       return addr;
 }
 
 ulong acpi_get_rsdp_addr(void)
index 9ce0ddf0d3d60e57f49e8c0670165f76bee6498c..15e82de2fe184d79684fbc329f1a3b1216527739 100644 (file)
@@ -44,6 +44,14 @@ int dram_init_banksize(void)
        phys_addr_t low_end;
        uint bank;
 
+       if (!ll_boot_init()) {
+               gd->bd->bi_dram[0].start = 0;
+               gd->bd->bi_dram[0].size = gd->ram_size;
+
+               mtrr_add_request(MTRR_TYPE_WRBACK, 0, gd->ram_size);
+               return 0;
+       }
+
        low_end = 0;
        for (bank = 1, hdr = gd->arch.hob_list;
             bank < CONFIG_NR_DRAM_BANKS && !end_of_hob(hdr);
index 226c7e66b3f858f27a834956542c5f0a14c5f3a5..98b762209f9f98d75e09615b67de5122b42c508e 100644 (file)
@@ -78,6 +78,9 @@ static int fsp_video_probe(struct udevice *dev)
        struct vesa_mode_info *vesa = &mode_info.vesa;
        int ret;
 
+       if (!ll_boot_init())
+               return 0;
+
        printf("Video: ");
 
        /* Initialize vesa_mode_info structure */
index c8f2c09b6a77142e795145ee8702db1de91a2169..3869c53c5f9484f19ab9e6b6a25ab297bca103d3 100644 (file)
 #include <asm/fsp/fsp_support.h>
 #include <asm/fsp2/fsp_api.h>
 #include <asm/fsp2/fsp_internal.h>
+#include <linux/sizes.h>
 
 int dram_init(void)
 {
        int ret;
 
+       if (!ll_boot_init()) {
+               /* Use a small and safe amount of 1GB */
+               gd->ram_size = SZ_1G;
+
+               return 0;
+       }
        if (spl_phase() == PHASE_SPL) {
 #ifdef CONFIG_HAVE_ACPI_RESUME
                bool s3wake = gd->arch.prev_sleep_state == ACPI_S3;
@@ -68,6 +75,9 @@ int dram_init(void)
 
 ulong board_get_usable_ram_top(ulong total_size)
 {
+       if (!ll_boot_init())
+               return gd->ram_size;
+
 #if CONFIG_IS_ENABLED(HANDOFF)
        struct spl_handoff *ho = gd->spl_handoff;
 
index da9bd6b45cfb9afef900cc4faa65276653a6a714..c7dc2ea257835f561a4beea177e2d1974029be96 100644 (file)
@@ -23,7 +23,7 @@ int arch_cpu_init_dm(void)
        int ret;
 
        /* Make sure pads are set up early in U-Boot */
-       if (spl_phase() != PHASE_BOARD_F)
+       if (!ll_boot_init() || spl_phase() != PHASE_BOARD_F)
                return 0;
 
        /* Probe all pinctrl devices to set up the pads */
index 5bb55e256fbb966aa047525671b27aaa3437e85d..d906b528b35b5a43f3c1e4c0d40df6d365b62797 100644 (file)
@@ -30,6 +30,9 @@ int init_cache_f_r(void)
                        return ret;
        }
 
+       if (!ll_boot_init())
+               return 0;
+
        /* Initialise the CPU cache(s) */
        return init_cache();
 }
index 93a1e77f72bc4dd2e4f67fdd994e3595bed16219..1af01d6d8082a205fa293b77eaa76e8130025edd 100644 (file)
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 
 obj-y  := board.o
+obj-y  += ../../xilinx/common/board.o
 
 # Remove quotes
 hw-platform-y :=$(shell echo $(CONFIG_DEFAULT_DEVICE_TREE))
index 2c288256985f71d4f4632ef759a53484fc18340a..5b7a8db2facf7d6c52493974190827de18804a5c 100644 (file)
@@ -8,6 +8,7 @@ F:      board/freescale/ls1028a/
 F:     include/configs/ls1028a_common.h
 F:     include/configs/ls1028aqds.h
 F:     configs/ls1028aqds_tfa_defconfig
+F:     configs/ls1028aqds_tfa_lpuart_defconfig
 
 LS1028ARDB BOARD
 M:     Sudhanshu Gupta <sudhanshu.gupta@nxp.com>
index 0b7504aea125faa60f3410179e46a9aad95a1edb..1e2973f0c8f351529f01e47cdd0d6aea3efb7a2b 100644 (file)
@@ -31,6 +31,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int config_board_mux(void)
 {
+#ifndef CONFIG_LPUART
 #if defined(CONFIG_TARGET_LS1028AQDS) && defined(CONFIG_FSL_QIXIS)
        u8 reg;
 
@@ -55,9 +56,18 @@ int config_board_mux(void)
        reg &= ~(0xc0);
        QIXIS_WRITE(brdcfg[15], reg);
 #endif
+#endif
+
        return 0;
 }
 
+#ifdef CONFIG_LPUART
+u32 get_lpuart_clk(void)
+{
+       return gd->bus_clk / CONFIG_SYS_FSL_LPUART_CLK_DIV;
+}
+#endif
+
 int board_init(void)
 {
 #ifdef CONFIG_ENV_IS_NOWHERE
@@ -120,11 +130,33 @@ int misc_init_r(void)
 
 int board_early_init_f(void)
 {
+#ifdef CONFIG_LPUART
+       u8 uart;
+#endif
+
 #ifdef CONFIG_SYS_I2C_EARLY_INIT
        i2c_early_init_f();
 #endif
 
        fsl_lsch3_early_init_f();
+
+#ifdef CONFIG_LPUART
+       /*
+        * Field| Function
+        * --------------------------------------------------------------
+        * 7-6  | Controls I2C3 routing (net CFG_MUX_I2C3):
+        * I2C3 | 11= Routes {SCL, SDA} to LPUART1 header as {SOUT, SIN}.
+        * --------------------------------------------------------------
+        * 5-4  | Controls I2C4 routing (net CFG_MUX_I2C4):
+        * I2C4 |11= Routes {SCL, SDA} to LPUART1 header as {CTS_B, RTS_B}.
+        */
+       /* use lpuart0 as system console */
+       uart = QIXIS_READ(brdcfg[13]);
+       uart &= ~CFG_LPUART_MUX_MASK;
+       uart |= CFG_LPUART_EN;
+       QIXIS_WRITE(brdcfg[13], uart);
+#endif
+
        return 0;
 }
 
index 9bc78d6543dd15c0a218922276675340b3d16ff4..26a192957bea2727cd782cb39eff542c954274c4 100644 (file)
@@ -285,7 +285,9 @@ int ft_board_setup(void *blob, bd_t *bd)
        ft_cpu_setup(blob, bd);
 
 #ifdef CONFIG_SYS_DPAA_FMAN
+#ifndef CONFIG_DM_ETH
        fdt_fixup_fman_ethernet(blob);
+#endif
 #endif
 
        fdt_fixup_icid(blob);
index 8c0abb63a9d8100e5862f0f13b10fd711aa8b208..71ace192e2bc087d084b022796235a947cddaa6c 100644 (file)
@@ -232,7 +232,9 @@ int ft_board_setup(void *blob, bd_t *bd)
        ft_cpu_setup(blob, bd);
 
 #ifdef CONFIG_SYS_DPAA_FMAN
+#ifndef CONFIG_DM_ETH
        fdt_fixup_fman_ethernet(blob);
+#endif
 #endif
 
        fdt_fixup_icid(blob);
index cabd7ee648cd05fdf92f6ab051616b601fbce043..e6648e9d7027e663c1ed594993864a88c6fcae5e 100644 (file)
@@ -462,7 +462,9 @@ int ft_board_setup(void *blob, bd_t *bd)
        ft_cpu_setup(blob, bd);
 
 #ifdef CONFIG_SYS_DPAA_FMAN
+#ifndef CONFIG_DM_ETH
        fdt_fixup_fman_ethernet(blob);
+#endif
        fdt_fixup_board_enet(blob);
 #endif
 
index 3b4d44d4658ddf9046de9e1c011fec9a3ce8cc99..05baef232abed0f55dcc2176486816a738358365 100644 (file)
@@ -32,7 +32,7 @@ static const struct board_specific_parameters udimm0[] = {
        {2,  1350, 0, 8,     6, 0x0708090B, 0x0C0D0E09,},
        {2,  1666, 0, 8,     7, 0x08090A0C, 0x0D0F100B,},
        {2,  1900, 0, 8,     7, 0x09090B0D, 0x0E10120B,},
-       {2,  2300, 0, 8,     9, 0x0A0B0C10, 0x1213140E,},
+       {2,  2300, 0, 8,     7, 0x08090A0E, 0x1011120C,},
        {}
 };
 
index cc6bd883c3d9bb29e5a9c3925ac5089093020bf3..5308cb2e1c7d3db47e6cd3d2e6a48b9ed4165981 100644 (file)
@@ -172,7 +172,9 @@ int ft_board_setup(void *blob, bd_t *bd)
        ft_cpu_setup(blob, bd);
 
 #ifdef CONFIG_SYS_DPAA_FMAN
+#ifndef CONFIG_DM_ETH
        fdt_fixup_fman_ethernet(blob);
+#endif
 #endif
 
        fdt_fixup_icid(blob);
index 01f56db0a1bfc664048eb33b8c813e090e2eeef5..f56ce7d9ae8ea70ee028976ed15f55a51f859431 100644 (file)
@@ -18,6 +18,7 @@
 #include <fsl-mc/fsl_mc.h>
 #include <fsl-mc/ldpaa_wriop.h>
 
+#ifndef CONFIG_DM_ETH
 int board_eth_init(bd_t *bis)
 {
 #if defined(CONFIG_FSL_MC_ENET)
@@ -95,6 +96,7 @@ int board_eth_init(bd_t *bis)
 
        return pci_eth_init(bis);
 }
+#endif
 
 #if defined(CONFIG_RESET_PHY_R)
 void reset_phy(void)
index 0bd397a0beb63b242572f2bae1e4560a49050b1a..225e787c757798ed89c994471264a361189f5ae2 100644 (file)
@@ -801,6 +801,11 @@ int board_init(void)
 #ifdef CONFIG_FSL_LS_PPA
        ppa_init();
 #endif
+
+#if !defined(CONFIG_SYS_EARLY_PCI_INIT) && defined(CONFIG_DM_ETH)
+       pci_init();
+#endif
+
        return 0;
 }
 
index b0f276e8397c5e15c23eae5a7bb52fe98c78e08e..f0f6ca53cb0543fa9cbcc1346822c84ae3146fbf 100644 (file)
@@ -23,6 +23,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int board_eth_init(bd_t *bis)
 {
+#ifndef CONFIG_DM_ETH
 #if defined(CONFIG_FSL_MC_ENET)
        int i, interface;
        struct memac_mdio_info mdio_info;
@@ -99,6 +100,7 @@ int board_eth_init(bd_t *bis)
 
        cpu_eth_init(bis);
 #endif /* CONFIG_FSL_MC_ENET */
+#endif /* !CONFIG_DM_ETH */
 
 #ifdef CONFIG_PHY_AQUANTIA
        /*
@@ -112,7 +114,12 @@ int board_eth_init(bd_t *bis)
        gd->jt->mdio_phydev_for_ethname = mdio_phydev_for_ethname;
        gd->jt->miiphy_set_current_dev = miiphy_set_current_dev;
 #endif
+
+#ifdef CONFIG_DM_ETH
+       return 0;
+#else
        return pci_eth_init(bis);
+#endif
 }
 
 #if defined(CONFIG_RESET_PHY_R)
index 282aaf47fb884359e71740e44903d4001bc51c81..5e2fc7cc9833fffad3d068019e3b140d4ad3203b 100644 (file)
@@ -244,6 +244,10 @@ int board_init(void)
        sec_init();
 #endif
 
+#if !defined(CONFIG_SYS_EARLY_PCI_INIT) && defined(CONFIG_DM_ETH)
+       pci_init();
+#endif
+
        return 0;
 }
 
index 23ea1b6f16aa31cb84708421c9db25da3152bf27..0d94107def4e6adfa08089311b86dc75a788599d 100644 (file)
 #include "../common/vid.h"
 #include <fsl_immap.h>
 #include <asm/arch-fsl-layerscape/fsl_icid.h>
-#include <asm/gic-v3.h>
-#include <cpu_func.h>
 
 #ifdef CONFIG_EMC2305
 #include "../common/emc2305.h"
 #endif
 
-#define GIC_LPI_SIZE                             0x200000
 #ifdef CONFIG_TARGET_LX2160AQDS
 #define CFG_MUX_I2C_SDHC(reg, value)           ((reg & 0x3f) | value)
 #define SET_CFG_MUX1_SDHC1_SDHC(reg)           (reg & 0x3f)
@@ -644,21 +641,6 @@ void board_quiesce_devices(void)
 }
 #endif
 
-#ifdef CONFIG_GIC_V3_ITS
-void fdt_fixup_gic_lpi_memory(void *blob, u64 gic_lpi_base)
-{
-       u32 phandle;
-       int err;
-       struct fdt_memory gic_lpi;
-
-       gic_lpi.start = gic_lpi_base;
-       gic_lpi.end = gic_lpi_base + GIC_LPI_SIZE - 1;
-       err = fdtdec_add_reserved_memory(blob, "gic-lpi", &gic_lpi, &phandle);
-       if (err < 0)
-               debug("failed to add reserved memory: %d\n", err);
-}
-#endif
-
 #ifdef CONFIG_OF_BOARD_SETUP
 int ft_board_setup(void *blob, bd_t *bd)
 {
@@ -670,7 +652,6 @@ int ft_board_setup(void *blob, bd_t *bd)
        u64 mc_memory_base = 0;
        u64 mc_memory_size = 0;
        u16 total_memory_banks;
-       u64 __maybe_unused gic_lpi_base;
 
        ft_cpu_setup(blob, bd);
 
@@ -690,12 +671,6 @@ int ft_board_setup(void *blob, bd_t *bd)
                size[i] = gd->bd->bi_dram[i].size;
        }
 
-#ifdef CONFIG_GIC_V3_ITS
-       gic_lpi_base = gd->arch.resv_ram - GIC_LPI_SIZE;
-       gic_lpi_tables_init(gic_lpi_base, cpu_numcores());
-       fdt_fixup_gic_lpi_memory(blob, gic_lpi_base);
-#endif
-
 #ifdef CONFIG_RESV_RAM
        /* reduce size if reserved memory is within this bank */
        if (gd->arch.resv_ram >= base[0] &&
index becadd2ca743618c98f1356563995e75732afd23..cc100b0f42246ac7844386f9bc63bc41d8d819d2 100644 (file)
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 obj-y  := board.o
+obj-y  += ../../xilinx/common/board.o
 
 # Remove quotes
 hw-platform-y :=$(shell echo $(CONFIG_DEFAULT_DEVICE_TREE))
index e83c692f2174101e634b29364b679730d067ddb7..294a59df77dac3187dcbc06f1fd065bd03446717 100644 (file)
@@ -8,6 +8,8 @@
 #include <asm/sections.h>
 #include <dm/uclass.h>
 #include <i2c.h>
+#include <linux/sizes.h>
+#include "board.h"
 
 int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
 {
@@ -71,3 +73,16 @@ void *board_fdt_blob_setup(void)
        return NULL;
 }
 #endif
+
+int board_late_init_xilinx(void)
+{
+       ulong initrd_hi;
+
+       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);
+
+       return 0;
+}
diff --git a/board/xilinx/common/board.h b/board/xilinx/common/board.h
new file mode 100644 (file)
index 0000000..180dfbc
--- /dev/null
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * (C) Copyright 2020 Xilinx, Inc.
+ * Michal Simek <michal.simek@xilinx.com>
+ */
+
+#ifndef _BOARD_XILINX_COMMON_BOARD_H
+#define _BOARD_XILINX_COMMON_BOARD_H
+
+int board_late_init_xilinx(void);
+
+#endif /* BOARD_XILINX_COMMON_BOARD_H */
index 75aedb092922752f1cbe0ae7af94bcac55233f52..483e3ce2f79a29dee74d9eabcda08be27863b854 100644 (file)
@@ -16,7 +16,7 @@
 #include <dm/device.h>
 #include <dm/uclass.h>
 #include <versalpl.h>
-#include <linux/sizes.h>
+#include "../common/board.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -82,9 +82,23 @@ int board_early_init_r(void)
        return 0;
 }
 
-int board_late_init(void)
+static u8 versal_get_bootmode(void)
 {
+       u8 bootmode;
        u32 reg = 0;
+
+       reg = readl(&crp_base->boot_mode_usr);
+
+       if (reg >> BOOT_MODE_ALT_SHIFT)
+               reg >>= BOOT_MODE_ALT_SHIFT;
+
+       bootmode = reg & BOOT_MODES_MASK;
+
+       return bootmode;
+}
+
+int board_late_init(void)
+{
        u8 bootmode;
        struct udevice *dev;
        int bootseq = -1;
@@ -93,19 +107,13 @@ int board_late_init(void)
        const char *mode;
        char *new_targets;
        char *env_targets;
-       ulong initrd_hi;
 
        if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
                debug("Saved variables - Skipping\n");
                return 0;
        }
 
-       reg = readl(&crp_base->boot_mode_usr);
-
-       if (reg >> BOOT_MODE_ALT_SHIFT)
-               reg >>= BOOT_MODE_ALT_SHIFT;
-
-       bootmode = reg & BOOT_MODES_MASK;
+       bootmode = versal_get_bootmode();
 
        puts("Bootmode: ");
        switch (bootmode) {
@@ -200,13 +208,7 @@ int board_late_init(void)
 
        env_set("boot_targets", new_targets);
 
-       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);
-
-       env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET);
-
-       return 0;
+       return board_late_init_xilinx();
 }
 
 int dram_init_banksize(void)
index 420a5ca663111a04099e093e8483e3f93417e9da..2164eac8d51885b4086254e4e3da28f403b15f1e 100644 (file)
@@ -17,6 +17,7 @@
 #include <zynqpl.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
+#include "../common/board.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -76,9 +77,7 @@ int board_late_init(void)
 
        env_set("boot_targets", new_targets);
 
-       env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET);
-
-       return 0;
+       return board_late_init_xilinx();
 }
 
 #if !defined(CONFIG_SYS_SDRAM_BASE) && !defined(CONFIG_SYS_SDRAM_SIZE)
index 4805e5a3b9143e8bc970871da9f387a0d6534abd..383e3d0c7e132821a24a4a97afbf0f7243cd490f 100644 (file)
@@ -363,6 +363,7 @@ static unsigned long psu_mio_init_data(void)
        psu_mask_write(0xFF18000C, 0x000000FEU, 0x00000002U);
        psu_mask_write(0xFF180010, 0x000000FEU, 0x00000002U);
        psu_mask_write(0xFF180014, 0x000000FEU, 0x00000002U);
+       psu_mask_write(0xFF180018, 0x000000FEU, 0x00000002U);
        psu_mask_write(0xFF180040, 0x000000FEU, 0x00000040U);
        psu_mask_write(0xFF180044, 0x000000FEU, 0x00000040U);
        psu_mask_write(0xFF180048, 0x000000FEU, 0x000000C0U);
@@ -408,7 +409,7 @@ static unsigned long psu_mio_init_data(void)
        psu_mask_write(0xFF18012C, 0x000000FEU, 0x00000002U);
        psu_mask_write(0xFF180130, 0x000000FEU, 0x000000C0U);
        psu_mask_write(0xFF180134, 0x000000FEU, 0x000000C0U);
-       psu_mask_write(0xFF180204, 0x7B3F003FU, 0x52240000U);
+       psu_mask_write(0xFF180204, 0x7B3F007FU, 0x52240000U);
        psu_mask_write(0xFF180208, 0xFFFFE000U, 0x00B02000U);
        psu_mask_write(0xFF18020C, 0x00003FFFU, 0x00000FC0U);
        psu_mask_write(0xFF180138, 0x03FFFFFFU, 0x03FFFFFFU);
index 3c92b1a5825f5a422770f60b617dd56683928997..a2a0d563318ee7bbf783c737b56f353bcada657c 100644 (file)
@@ -26,7 +26,7 @@
 #include <zynqmppl.h>
 #include <zynqmp_firmware.h>
 #include <g_dnl.h>
-#include <linux/sizes.h>
+#include "../common/board.h"
 
 #include "pm_cfg_obj.h"
 
@@ -552,9 +552,26 @@ static int set_fdtfile(void)
        return 0;
 }
 
-int board_late_init(void)
+static u8 zynqmp_get_bootmode(void)
 {
+       u8 bootmode;
        u32 reg = 0;
+       int ret;
+
+       ret = zynqmp_mmio_read((ulong)&crlapb_base->boot_mode, &reg);
+       if (ret)
+               return -EINVAL;
+
+       if (reg >> BOOT_MODE_ALT_SHIFT)
+               reg >>= BOOT_MODE_ALT_SHIFT;
+
+       bootmode = reg & BOOT_MODES_MASK;
+
+       return bootmode;
+}
+
+int board_late_init(void)
+{
        u8 bootmode;
        struct udevice *dev;
        int bootseq = -1;
@@ -564,7 +581,6 @@ int board_late_init(void)
        char *new_targets;
        char *env_targets;
        int ret;
-       ulong initrd_hi;
 
 #if defined(CONFIG_USB_ETHER) && !defined(CONFIG_USB_GADGET_DOWNLOAD)
        usb_ether_init();
@@ -579,14 +595,7 @@ int board_late_init(void)
        if (ret)
                return ret;
 
-       ret = zynqmp_mmio_read((ulong)&crlapb_base->boot_mode, &reg);
-       if (ret)
-               return -EINVAL;
-
-       if (reg >> BOOT_MODE_ALT_SHIFT)
-               reg >>= BOOT_MODE_ALT_SHIFT;
-
-       bootmode = reg & BOOT_MODES_MASK;
+       bootmode = zynqmp_get_bootmode();
 
        puts("Bootmode: ");
        switch (bootmode) {
@@ -691,15 +700,9 @@ int board_late_init(void)
 
        env_set("boot_targets", new_targets);
 
-       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);
-
-       env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET);
-
        reset_reason();
 
-       return 0;
+       return board_late_init_xilinx();
 }
 #endif
 
index 6ce9e5521cd07c83994088ef83020ad08179d81e..157a33081ff144bd3914bc8b3bb0f7f17319c8b4 100644 (file)
@@ -190,6 +190,20 @@ comment "Commands"
 
 menu "Info commands"
 
+config CMD_ACPI
+       bool "acpi"
+       default y if ACPIGEN
+       help
+         List and dump ACPI tables. ACPI (Advanced Configuration and Power
+         Interface) is used mostly on x86 for providing information to the
+         Operating System about devices in the system. The tables are set up
+         by the firmware, typically U-Boot but possibly an earlier firmware
+         module, if U-Boot is chain-loaded from something else. ACPI tables
+         can also include code, to perform hardware-specific tasks required
+         by the Operating Systems. This allows some amount of separation
+         between the firmware and OS, and is particularly useful when you
+         want to make hardware changes without the OS needing to be adjusted.
+
 config CMD_BDI
        bool "bdinfo"
        default y
index 6692ed96c6fe08e6589563ce175572c6992dd31c..974ad48b0af1afb1847998e4301bafacab5bcee4 100644 (file)
@@ -11,6 +11,7 @@ obj-y += help.o
 obj-y += version.o
 
 # command
+obj-$(CONFIG_CMD_ACPI) += acpi.o
 obj-$(CONFIG_CMD_AES) += aes.o
 obj-$(CONFIG_CMD_AB_SELECT) += ab_select.o
 obj-$(CONFIG_CMD_ADC) += adc.o
diff --git a/cmd/acpi.c b/cmd/acpi.c
new file mode 100644 (file)
index 0000000..203bd93
--- /dev/null
@@ -0,0 +1,186 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019 Google LLC
+ * Written by Simon Glass <sjg@chromium.org>
+ */
+#include <common.h>
+#include <command.h>
+#include <mapmem.h>
+#include <acpi/acpi_table.h>
+#include <asm/acpi_table.h>
+#include <dm/acpi.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/**
+ * dump_hdr() - Dump an ACPI header
+ *
+ * If the header is for FACS then it shows the revision information as well
+ *
+ * @hdr: ACPI header to dump
+ */
+static void dump_hdr(struct acpi_table_header *hdr)
+{
+       bool has_hdr = memcmp(hdr->signature, "FACS", ACPI_NAME_LEN);
+
+       printf("%.*s %08lx %06x", ACPI_NAME_LEN, hdr->signature,
+              (ulong)map_to_sysmem(hdr), hdr->length);
+       if (has_hdr) {
+               printf(" (v%02d %.6s %.8s %u %.4s %d)\n", hdr->revision,
+                      hdr->oem_id, hdr->oem_table_id, hdr->oem_revision,
+                      hdr->aslc_id, hdr->aslc_revision);
+       } else {
+               printf("\n");
+       }
+}
+
+/**
+ * find_table() - Look up an ACPI table
+ *
+ * @sig: Signature of table (4 characters, upper case)
+ * @return pointer to table header, or NULL if not found
+ */
+struct acpi_table_header *find_table(const char *sig)
+{
+       struct acpi_rsdp *rsdp;
+       struct acpi_rsdt *rsdt;
+       int len, i, count;
+
+       rsdp = map_sysmem(gd->arch.acpi_start, 0);
+       if (!rsdp)
+               return NULL;
+       rsdt = map_sysmem(rsdp->rsdt_address, 0);
+       len = rsdt->header.length - sizeof(rsdt->header);
+       count = len / sizeof(u32);
+       for (i = 0; i < count; i++) {
+               struct acpi_table_header *hdr;
+
+               hdr = map_sysmem(rsdt->entry[i], 0);
+               if (!memcmp(hdr->signature, sig, ACPI_NAME_LEN))
+                       return hdr;
+               if (!memcmp(hdr->signature, "FACP", ACPI_NAME_LEN)) {
+                       struct acpi_fadt *fadt = (struct acpi_fadt *)hdr;
+
+                       if (!memcmp(sig, "DSDT", ACPI_NAME_LEN) && fadt->dsdt)
+                               return map_sysmem(fadt->dsdt, 0);
+                       if (!memcmp(sig, "FACS", ACPI_NAME_LEN) &&
+                           fadt->firmware_ctrl)
+                               return map_sysmem(fadt->firmware_ctrl, 0);
+               }
+       }
+
+       return NULL;
+}
+
+static int dump_table_name(const char *sig)
+{
+       struct acpi_table_header *hdr;
+
+       hdr = find_table(sig);
+       if (!hdr)
+               return -ENOENT;
+       printf("%.*s @ %08lx\n", ACPI_NAME_LEN, hdr->signature,
+              (ulong)map_to_sysmem(hdr));
+       print_buffer(0, hdr, 1, hdr->length, 0);
+
+       return 0;
+}
+
+static void list_fadt(struct acpi_fadt *fadt)
+{
+       if (fadt->dsdt)
+               dump_hdr(map_sysmem(fadt->dsdt, 0));
+       if (fadt->firmware_ctrl)
+               dump_hdr(map_sysmem(fadt->firmware_ctrl, 0));
+}
+
+static int list_rsdt(struct acpi_rsdt *rsdt, struct acpi_xsdt *xsdt)
+{
+       int len, i, count;
+
+       dump_hdr(&rsdt->header);
+       if (xsdt)
+               dump_hdr(&xsdt->header);
+       len = rsdt->header.length - sizeof(rsdt->header);
+       count = len / sizeof(u32);
+       for (i = 0; i < count; i++) {
+               struct acpi_table_header *hdr;
+
+               if (!rsdt->entry[i])
+                       break;
+               hdr = map_sysmem(rsdt->entry[i], 0);
+               dump_hdr(hdr);
+               if (!memcmp(hdr->signature, "FACP", ACPI_NAME_LEN))
+                       list_fadt((struct acpi_fadt *)hdr);
+               if (xsdt) {
+                       if (xsdt->entry[i] != rsdt->entry[i]) {
+                               printf("   (xsdt mismatch %llx)\n",
+                                      xsdt->entry[i]);
+                       }
+               }
+       }
+
+       return 0;
+}
+
+static int list_rsdp(struct acpi_rsdp *rsdp)
+{
+       struct acpi_rsdt *rsdt;
+       struct acpi_xsdt *xsdt;
+
+       printf("RSDP %08lx %06x (v%02d %.6s)\n", (ulong)map_to_sysmem(rsdp),
+              rsdp->length, rsdp->revision, rsdp->oem_id);
+       rsdt = map_sysmem(rsdp->rsdt_address, 0);
+       xsdt = map_sysmem(rsdp->xsdt_address, 0);
+       list_rsdt(rsdt, xsdt);
+
+       return 0;
+}
+
+static int do_acpi_list(cmd_tbl_t *cmdtp, int flag, int argc,
+                       char *const argv[])
+{
+       struct acpi_rsdp *rsdp;
+
+       rsdp = map_sysmem(gd->arch.acpi_start, 0);
+       if (!rsdp) {
+               printf("No ACPI tables present\n");
+               return 0;
+       }
+       printf("ACPI tables start at %lx\n", gd->arch.acpi_start);
+       list_rsdp(rsdp);
+
+       return 0;
+}
+
+static int do_acpi_dump(cmd_tbl_t *cmdtp, int flag, int argc,
+                       char *const argv[])
+{
+       const char *name;
+       char sig[ACPI_NAME_LEN];
+       int ret;
+
+       if (argc < 2)
+               return CMD_RET_USAGE;
+       name = argv[1];
+       if (strlen(name) != ACPI_NAME_LEN) {
+               printf("Table name '%s' must be four characters\n", name);
+               return CMD_RET_FAILURE;
+       }
+       str_to_upper(name, sig, -1);
+       ret = dump_table_name(sig);
+       if (ret) {
+               printf("Table '%.*s' not found\n", ACPI_NAME_LEN, sig);
+               return CMD_RET_FAILURE;
+       }
+
+       return 0;
+}
+
+static char acpi_help_text[] =
+       "list - list ACPI tables\n"
+       "acpi dump <name> - Dump ACPI table";
+
+U_BOOT_CMD_WITH_SUBCMDS(acpi, "ACPI tables", acpi_help_text,
+       U_BOOT_SUBCMD_MKENT(list, 1, 1, do_acpi_list),
+       U_BOOT_SUBCMD_MKENT(dump, 2, 1, do_acpi_dump));
index ea399d2c1febc65216fb190f0fb86fe734dca764..c19c66fa6842cdae4c04fc61d54357c93287793e 100644 (file)
@@ -28,7 +28,7 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_WDT=y
 CONFIG_CMD_CACHE=y
 CONFIG_OF_CONTROL=y
-CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1028a-qds"
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1028a-qds-duart"
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
@@ -79,3 +79,4 @@ CONFIG_WDT_SP805=y
 CONFIG_RSA=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index dd5195bc770f8e16d841c981898993d258b4718c..82b08a58ecd044d1dfd38bf96a5e6618d421f17e 100644 (file)
@@ -30,7 +30,7 @@ CONFIG_CMD_WDT=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
 CONFIG_OF_CONTROL=y
-CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1028a-qds"
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1028a-qds-duart"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_ADDR=0x20500000
@@ -84,3 +84,4 @@ CONFIG_WDT=y
 CONFIG_WDT_SP805=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
diff --git a/configs/ls1028aqds_tfa_lpuart_defconfig b/configs/ls1028aqds_tfa_lpuart_defconfig
new file mode 100644 (file)
index 0000000..417f292
--- /dev/null
@@ -0,0 +1,88 @@
+CONFIG_ARM=y
+CONFIG_TARGET_LS1028AQDS=y
+CONFIG_TFABOOT=y
+CONFIG_SYS_MALLOC_F_LEN=0x6000
+CONFIG_ENV_SIZE=0x2000
+CONFIG_ENV_SECT_SIZE=0x40000
+CONFIG_ENV_OFFSET=0x500000
+CONFIG_DM_GPIO=y
+CONFIG_FSPI_AHB_EN_4BYTE=y
+CONFIG_NR_DRAM_BANKS=2
+CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
+CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
+CONFIG_AHCI=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_STDOUT_VIA_ALIAS=y
+CONFIG_BOOTDELAY=10
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256 video=1920x1080-32@60 cma=256M"
+CONFIG_SYS_EXTRA_OPTIONS="LPUART"
+CONFIG_MISC_INIT_R=y
+CONFIG_CMD_GREPENV=y
+CONFIG_CMD_DM=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_PCI=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_WDT=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_CACHE=y
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1028a-qds-lpuart"
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_ADDR=0x20500000
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
+CONFIG_DM=y
+CONFIG_SCSI_AHCI=y
+CONFIG_SATA_CEVA=y
+CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
+CONFIG_I2C_DEFAULT_BUS_NUMBER=0
+CONFIG_I2C_MUX=y
+CONFIG_I2C_MUX_PCA954x=y
+CONFIG_DM_MMC=y
+CONFIG_FSL_ESDHC=y
+CONFIG_MTD=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_SPI_FLASH_STMICRO=y
+# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
+CONFIG_PHYLIB=y
+CONFIG_PHY_AQUANTIA=y
+CONFIG_PHY_ATHEROS=y
+CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
+CONFIG_DM_MDIO_MUX=y
+CONFIG_E1000=y
+CONFIG_FSL_ENETC=y
+CONFIG_MDIO_MUX_I2CREG=y
+CONFIG_PCI=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_ECAM_GENERIC=y
+CONFIG_PCIE_LAYERSCAPE=y
+CONFIG_DM_RTC=y
+CONFIG_RTC_PCF2127=y
+CONFIG_SCSI=y
+CONFIG_DM_SCSI=y
+CONFIG_DM_SERIAL=y
+CONFIG_FSL_LPUART=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_FSL_DSPI=y
+CONFIG_NXP_FSPI=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_WDT=y
+CONFIG_WDT_SP805=y
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
index ab0acc8e7cf5424c2ad23eecd69422b720459222..947c4b46132dc46a1e225c477d111ba490d1f178 100644 (file)
@@ -76,3 +76,4 @@ CONFIG_WDT_SP805=y
 CONFIG_RSA=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index 3f64bc3e886a1a892e31c5f871941dc5e3b7691e..ad6de6ca0116800088d9500bcf1f6bcd8ed67466 100644 (file)
@@ -85,3 +85,4 @@ CONFIG_WDT=y
 CONFIG_WDT_SP805=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index 7980e7b785c904ce0bafb10ddf747c104ef9dcdb..911bbef72c36bdd2e5b027d714004b371b6e9a2c 100644 (file)
@@ -14,6 +14,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=60000000.nor:2m@0x100000(nor_bank0_uboot),40m@0x1100000(nor_bank0_fit),7m(nor_bank0_user),2m@0x4100000(nor_bank4_uboot),40m@0x5100000(nor_bank4_fit),-(nor_bank4_user);7e800000.flash:1m(nand_uboot),1m(nand_uboot_env),20m(nand_fit);spi0.0:1m(uboot),5m(kernel),1m(dtb),9m(file_system)"
 CONFIG_MISC_INIT_R=y
 CONFIG_CMD_IMLS=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -40,6 +41,8 @@ CONFIG_SF_DEFAULT_BUS=1
 CONFIG_PHYLIB=y
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
index 588090b7bada193e2437902c759890b27dbf49fc..4a15992f7c45da779c0149f0182f53935cb80b07 100644 (file)
@@ -14,6 +14,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=60000000.nor:2m@0x100000(nor_bank0_uboot),40m@0x1100000(nor_bank0_fit),7m(nor_bank0_user),2m@0x4100000(nor_bank4_uboot),40m@0x5100000(nor_bank4_fit),-(nor_bank4_user);7e800000.flash:1m(nand_uboot),1m(nand_uboot_env),20m(nand_fit);spi0.0:1m(uboot),5m(kernel),1m(dtb),9m(file_system)"
 CONFIG_MISC_INIT_R=y
 CONFIG_CMD_IMLS=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -44,6 +45,8 @@ CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_PCI=y
index 9afa795c26f7a0efaad9d674429b6ac575a951fb..f399b1cbb3733d1963253caf1b954702b0742a9d 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_CMD_IMLS=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -61,6 +62,8 @@ CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_PCI=y
index 6f9319ef8877b00440c6c1431e475fecaacc5e1e..5f794605d6651caf9b2cc418a3746cc63260e51b 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_CMD_IMLS=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -62,6 +63,8 @@ CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_PCI=y
index e899f6089e6c8ee08d8ed141455a6051025fef2c..224321810a5d37b2431272d83164ca2771afe1ca 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_CMD_IMLS=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -59,6 +60,8 @@ CONFIG_SF_DEFAULT_BUS=1
 CONFIG_PHYLIB=y
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
index 1350ef43591e108fee2ca07b70ef767d9e52688b..bf557d7650b399a74cc52bc2100fee6abe0771a9 100644 (file)
@@ -30,6 +30,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_CMD_IMLS=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -61,6 +62,8 @@ CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_PCI=y
index 090325d49510e7cf8f62fcfc9d261fe7b6ea1a46..0f3f920ffdf2da1fc8b59feeaee3705d58e52623 100644 (file)
@@ -16,6 +16,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=60000000.nor:2m@0x100000(nor_bank0_uboot),40m@0x1100000(nor_bank0_fit),7m(nor_bank0_user),2m@0x4100000(nor_bank4_uboot),40m@0x5100000(nor_bank4_fit),-(nor_bank4_user);7e800000.flash:1m(nand_uboot),1m(nand_uboot_env),20m(nand_fit);spi0.0:1m(uboot),5m(kernel),1m(dtb),9m(file_system)"
 CONFIG_MISC_INIT_R=y
 CONFIG_CMD_IMLS=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -42,6 +43,8 @@ CONFIG_SF_DEFAULT_BUS=1
 CONFIG_PHYLIB=y
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
index 66afef95dfe7ea092e5096cd85085148d4fcb805..a62310ccc9a395cbb7ed373b2598245dd2e5de76 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=60000000.nor:2m@0x100000(nor_bank0_uboot),40m@0x1100000(nor_bank0_fit),7m(nor_bank0_user),2m@0x4100000(nor_bank4_uboot),40m@0x5100000(nor_bank4_fit),-(nor_bank4_user);7e800000.flash:1m(nand_uboot),1m(nand_uboot_env),20m(nand_fit);spi0.0:1m(uboot),5m(kernel),1m(dtb),9m(file_system)"
 CONFIG_MISC_INIT_R=y
 CONFIG_CMD_IMLS=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -49,6 +50,8 @@ CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_REALTEK=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_PCI=y
index 2ab210fec07f7ceaddbd3b0b67e9ad6fbe3b8233..def9140fd644c3b6853283c5e2e771e36871fb56 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -59,6 +60,8 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_REALTEK=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_PCI=y
index b6211490fc0020607f5f68a5dffbd2237cceba0c..1f8922293f8c40a9253118818a26d6f7f9e4fca6 100644 (file)
@@ -16,6 +16,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=1550000.spi-0:1m(rcw),15m(u-boot),48m(kernel.itb);7e800000.flash:16m(nand_uboot),48m(nand_kernel),448m(nand_free)"
 CONFIG_MISC_INIT_R=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -40,6 +41,8 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_REALTEK=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_PCI=y
index 2e33e6027380bf230680f2b60596f3614d0bfb7a..8b1b6950fbe18c09ec1341aeefe0721f406d0e40 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=1550000.spi-0:1m(rcw),15m(u-boot),48m(kernel.itb);7e800000.flash:16m(nand_uboot),48m(nand_kernel),448m(nand_free)"
 CONFIG_MISC_INIT_R=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -43,6 +44,8 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_REALTEK=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_PCI=y
index a630b0afc91c3171406ed771eabbdac41ad64680..cbc598dea8032af51c0f453910fef065dfa1ca36 100644 (file)
@@ -34,6 +34,7 @@ CONFIG_SPL_OS_BOOT=y
 CONFIG_SYS_OS_BASE=0x40980000
 CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_CMD_SPL=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -61,6 +62,8 @@ CONFIG_MTD_RAW_NAND=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
 CONFIG_PHY_REALTEK=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
index 8a7cbd02bd8723f364c6b027161e1f0d9c48359e..aeac0a248ed910336b7ea38e976b1b693f2c4401 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -55,6 +56,8 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_REALTEK=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_PCI=y
index 261ddf53e195dbd577518507e5319bc5b659cbb8..878bdf051307c1fbc67812150e93e7711eb15608 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -58,6 +59,8 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_REALTEK=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_PCI=y
index cfc9e4eeb5a55b48455626bc9b9415c026ae6f5c..140da79d0bcaa76282020f4e96ea3b08e671cea9 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=1550000.spi-0:1m(rcw),15m(u-boot),48m(kernel.itb);7e800000.flash:16m(nand_uboot),48m(nand_kernel),448m(nand_free)"
 CONFIG_MISC_INIT_R=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -40,6 +41,8 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_REALTEK=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_PCI=y
index 3a0530ca74f604fe2a2ef47aadc5d04e2d345d46..eab34cd7175ef351c2efa0506f32247d5781a419 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=1550000.spi-0:1m(rcw),15m(u-boot),48m(kernel.itb);7e800000.flash:16m(nand_uboot),48m(nand_kernel),448m(nand_free)"
 CONFIG_MISC_INIT_R=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -45,6 +46,8 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_REALTEK=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_FMAN_ENET=y
 CONFIG_PCI=y
index a02e6ae6dca363c65b4931baa1f8092c837f02d1..69e3a8fbbfc5f7b3584e49b3f3b0a5a39a4eb42d 100644 (file)
@@ -64,3 +64,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_GIC_V3_ITS=y
index 42ada096a348fc006567b9fd67c76e09f84d1c11..3a363790d9b0c424d86748c898219cc1055380b3 100644 (file)
@@ -66,3 +66,4 @@ CONFIG_USB_GADGET=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index b22000cfc167a7a1a526f4143f96eb0023eb15da..117fdd8588e3fdd074a55e8e6eee57a3fcf551b3 100644 (file)
@@ -67,3 +67,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_GADGET=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index 405d35acdcb2f53f7772eb1eb3716a08c4141660..eedee1e88f8a5f24d6cb10a6fc8863abc6f5c048 100644 (file)
@@ -72,3 +72,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_GIC_V3_ITS=y
index 2127fe1e498756929a3d4076b3a7468e0a11b2aa..621c411aca6e02a2c1443ba8a61ae73129b14f32 100644 (file)
@@ -76,3 +76,4 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_GADGET=y
+CONFIG_GIC_V3_ITS=y
index 296f8791e3de7375832763b2d26a981f0421f76a..2bb84e158cdb417b80ffca6158bcf4571c515586 100644 (file)
@@ -84,3 +84,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_GADGET=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index c91d6460699a65b9e007e4315585308c99bddad9..806d7705dea9f184a26e076d007bb7a827cdf3e1 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1088ARDB=y
 CONFIG_SYS_TEXT_BASE=0x20100000
 CONFIG_ENV_SIZE=0x2000
@@ -21,6 +22,7 @@ CONFIG_MISC_INIT_R=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -43,8 +45,11 @@ CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_MII=y
+CONFIG_FSL_LS_MDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
index 4230b63e6b2e81b1a93d5a00df68c91e6e661a14..9b66fd910179aef57f63371da188557c101d1181 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1088ARDB=y
 CONFIG_SYS_TEXT_BASE=0x20100000
 CONFIG_ENV_SIZE=0x2000
@@ -22,6 +23,7 @@ CONFIG_MISC_INIT_R=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -46,8 +48,11 @@ CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_MII=y
+CONFIG_FSL_LS_MDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
index 2b27d7ab5c0e4a2b311ed297e2c60ac66dc0508f..4a15f82e9e528cf4c7509f9546914bdbedb5d9f7 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1088ARDB=y
 CONFIG_SYS_TEXT_BASE=0x80400000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
@@ -33,6 +34,7 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -55,8 +57,11 @@ CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_MII=y
+CONFIG_FSL_LS_MDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
index 0e882513be0b12ea0074616a524df82fe80621b3..1ab1fa3a2f61f31920ed1e094906c70cc78b0a2c 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1088ARDB=y
 CONFIG_SYS_TEXT_BASE=0x80400000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
@@ -32,6 +33,7 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -56,8 +58,11 @@ CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_MII=y
+CONFIG_FSL_LS_MDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
index faa87f4cfc5e0d70cbe38de9fda2830b9717766b..4ad9a66333ae0077486813c48a5a522068770cef 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1088ARDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
@@ -24,6 +25,7 @@ CONFIG_MISC_INIT_R=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -50,8 +52,11 @@ CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_MII=y
+CONFIG_FSL_LS_MDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
index 0037b38f9c82024a860ad7fafd5180336d769ded..7690292db4de00c58b462cb843f143af1ec321f2 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1088ARDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
@@ -25,6 +26,7 @@ CONFIG_MISC_INIT_R=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -55,8 +57,11 @@ CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
 CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_MII=y
+CONFIG_FSL_LS_MDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
index 5c56615f72edd360e2c26204011c27b6133ce86e..4c85b1148f3b7524d8a98e415a85cd41788c435d 100644 (file)
@@ -66,3 +66,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index 429ad46a2f408a8615321f9e373575fb3ca1e955..0f8e22b304f67085343c4eb2917b24fd7a4d75d7 100644 (file)
@@ -67,3 +67,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index 52fc9cb82add133832ea4d81e748baa6c8f12ed9..044177088c90a6496b3e7946a1bcf7a8d675dece 100644 (file)
@@ -74,3 +74,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index ee528f07a74062b2f327601a23af58ec0adf32a9..c159c153da62a4e9e2b2fcf43abc9a451f8059d1 100644 (file)
@@ -66,3 +66,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index 49237fc4fcf6b523ea9acdd0233d41a84029a79a..ac0b635191c70cd3a2726af3f4884872c3c2d2ea 100644 (file)
@@ -73,3 +73,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index a46697a9a3ed7fc82c08554ed035b4e052ad2dba..94087cee01a4fa942244c28ec68b6e2babb55f7a 100644 (file)
@@ -64,3 +64,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index 0102e14ecb8965f483c1c1708709f7ac803c52a8..e9dfc3603eadad48f39e289fb50ff33d1928ea70 100644 (file)
@@ -65,3 +65,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index 3679e7893da43519610ec8beec899e528211e4b3..d1086f976c6edecdbd0332fbca35a8dd7c62578b 100644 (file)
@@ -70,3 +70,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index 31358113e8dc11ddc69d4c769dc6073c229c57b9..032cb406338393e269087855b4fe57632a97171e 100644 (file)
@@ -62,3 +62,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index a5f7e8eb2717c87a91d15b4362fdf039563af1a1..81bc489d19a339777df90a1bacb17e2373e4ab39 100644 (file)
@@ -78,3 +78,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index c7a461948b9934d8b5dfcd12b1aa2865533e049c..2d71baeced7d686d8bcab77c5263e4ecf166693d 100644 (file)
@@ -16,6 +16,7 @@ CONFIG_BOOTDELAY=10
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_MISC_INIT_R=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -39,8 +40,11 @@ CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_CORTINA=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_MII=y
+CONFIG_FSL_LS_MDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
@@ -59,3 +63,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index eae6fa5526ed7f498866a96d805b58e650ba3640..85b8dac99244ea6fbdca2fc99cd9be783943b958 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_BOOTARGS="console=ttyS1,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_MISC_INIT_R=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -45,8 +46,11 @@ CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_CORTINA=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_MII=y
+CONFIG_FSL_LS_MDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
@@ -63,3 +67,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index c62c575f14ae6431b3ea408e072a6ed830cb0fc3..39a69734feaee7e475d00cd4f1979f8d2aa7a042 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_MISC_INIT_R=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -31,7 +32,7 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
 CONFIG_OF_CONTROL=y
-CONFIG_DEFAULT_DEVICE_TREE="fsl-ls2080a-rdb"
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls2088a-rdb-qspi"
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_SATA_CEVA=y
@@ -54,8 +55,11 @@ CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_CORTINA=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_MII=y
+CONFIG_FSL_LS_MDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
@@ -76,3 +80,4 @@ CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index 4cd16ba29096bfb90a9e161490ad7c8415135cbd..34b94394c7cc8d30d52956a2a6f9eedffd9480e4 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_MISC_INIT_R=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -62,8 +63,11 @@ CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_CORTINA=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
 CONFIG_MII=y
+CONFIG_FSL_LS_MDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
@@ -81,3 +85,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
+CONFIG_GIC_V3_ITS=y
index 4341f1eb5ca5c93e73ca8d39a2071c8fdc81139a..23f814fb6ce4f607efcead854d8b2ee9e88977b6 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_BOOTARGS="console=ttyAMA0,115200 root=/dev/ram0 earlycon=pl011,mmio32,0x2
 CONFIG_MISC_INIT_R=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -49,7 +50,10 @@ CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_ATHEROS=y
 CONFIG_PHY_CORTINA=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
+CONFIG_FSL_LS_MDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
index 8dceb089b48aaa3580fe8e04d5d954d8e73060ce..bc654cfee91788b973bb791d70fe8331d4c2213e 100644 (file)
@@ -24,6 +24,7 @@ CONFIG_BOOTARGS="console=ttyAMA0,115200 root=/dev/ram0 earlycon=pl011,mmio32,0x2
 CONFIG_MISC_INIT_R=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -55,7 +56,10 @@ CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_PHY_ATHEROS=y
 CONFIG_PHY_CORTINA=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
+CONFIG_FSL_LS_MDIO=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
index b264529feec46f63a0d37db8af243f10a4b61aba..7441e10d325a7f931ebf6ac0db0d3e4126979176 100644 (file)
@@ -32,12 +32,17 @@ CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_MTD=y
 CONFIG_CMD_NAND_LOCK_UNLOCK=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_MTDPARTS_SPREAD=y
+CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES=y
+CONFIG_CMD_UBI=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc706"
 CONFIG_OF_LIST="zynq-zc702 zynq-zc706 zynq-zc770-xm010 zynq-zc770-xm011 zynq-zc770-xm011-x16 zynq-zc770-xm012 zynq-zc770-xm013 zynq-cc108 zynq-microzed zynq-minized zynq-picozed zynq-zed zynq-zturn zynq-zybo zynq-zybo-z7 zynq-dlc20-rev1.0"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
index 7b09edd78e1bfe7e1e2ab8c15bd7a1f4163e9590..73e8d84b88864baff81c16c8b16e037ef9b1f5fe 100644 (file)
@@ -35,6 +35,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_MTD=y
 CONFIG_CMD_NAND_LOCK_UNLOCK=y
 CONFIG_CMD_POWEROFF=y
 CONFIG_CMD_SDRAM=y
@@ -45,6 +46,10 @@ CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
 CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_MTDPARTS_SPREAD=y
+CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES=y
+CONFIG_CMD_UBI=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="zynqmp-zcu100-revC"
 CONFIG_OF_LIST="avnet-ultra96-rev1 zynqmp-a2197-revA zynqmp-e-a2197-00-revA zynqmp-g-a2197-00-revA zynqmp-m-a2197-01-revA zynqmp-m-a2197-02-revA zynqmp-m-a2197-03-revA zynqmp-p-a2197-00-revA zynqmp-zc1232-revA zynqmp-zc1254-revA zynqmp-zc1751-xm015-dc1 zynqmp-zc1751-xm016-dc2 zynqmp-zc1751-xm017-dc3 zynqmp-zc1751-xm018-dc4 zynqmp-zc1751-xm019-dc5 zynqmp-zcu100-revC zynqmp-zcu102-rev1.1 zynqmp-zcu102-rev1.0 zynqmp-zcu102-revA zynqmp-zcu102-revB zynqmp-zcu104-revA zynqmp-zcu104-revC zynqmp-zcu106-revA zynqmp-zcu111-revA zynqmp-zcu1275-revA zynqmp-zcu1275-revB zynqmp-zcu1285-revA zynqmp-zcu208-revA zynqmp-zcu216-revA"
index 19491c9e47eb7ce1b40ba6ccda68333f3b9edcdd..6a01da2e4e1f263c3746042abbb4a8feaa400b09 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_SYS_DCACHE_OFF=y
 CONFIG_ARCH_ZYNQ=y
 CONFIG_SYS_TEXT_BASE=0x100000
 CONFIG_ENV_SIZE=0x190
-CONFIG_SYS_MALLOC_LEN=0x1000
+CONFIG_SYS_MALLOC_LEN=0x8000
 CONFIG_SPL_STACK_R_ADDR=0x200000
 CONFIG_SPL=y
 CONFIG_SYS_CUSTOM_LDSCRIPT=y
index a441738ad13b2ef6ca3258afd98bd306f95f2d65..c6b70ce61a320c3854803e296662735ba4ff3d47 100644 (file)
@@ -712,6 +712,34 @@ to load a 'u-boot-payload.efi', see below test logs on QEMU.
 See :doc:`../uefi/u-boot_on_efi` and :doc:`../uefi/uefi` for details of
 EFI support in U-Boot.
 
+Chain-loading
+-------------
+U-Boot can be chain-loaded from another bootloader, such as coreboot or
+Slim Bootloader. Typically this is done by building for targets 'coreboot' or
+'slimbootloader'.
+
+For example, at present we have a 'coreboot' target but this runs very
+different code from the bare-metal targets, such as coral. There is very little
+in common between them.
+
+It is useful to be able to boot the same U-Boot on a device, with or without a
+first-stage bootloader. For example, with chromebook_coral, it is helpful for
+testing to be able to boot the same U-Boot (complete with FSP) on bare metal
+and from coreboot. It allows checking of things like CPU speed, comparing
+registers, ACPI tables and the like.
+
+To do this you can use ll_boot_init() in appropriate places to skip init that
+has already been done by the previous stage. This works by setting a
+GD_FLG_NO_LL_INIT flag when U-Boot detects that it is running from another
+bootloader.
+
+With this feature, you can build a bare-metal target and boot it from
+coreboot, for example.
+
+Note that this is a development feature only. It is not intended for use in
+production environments. Also it is not currently part of the automated tests
+so may break in the future.
+
 TODO List
 ---------
 - Audio
diff --git a/doc/device-tree-bindings/device.txt b/doc/device-tree-bindings/device.txt
new file mode 100644 (file)
index 0000000..27bd397
--- /dev/null
@@ -0,0 +1,36 @@
+Devices
+=======
+
+Device bindings are described by their own individual binding files.
+
+U-Boot provides for some optional properties which are documented here. See
+also hid-over-i2c.txt which describes HID devices. See also
+Documentation/firmware-guide/acpi/enumeration.rst in the Linux kernel for
+the acpi,compatible property.
+
+ - acpi,has-power-resource : (boolean) true if this device has a power resource.
+    This causes an ACPI PowerResource to be written containing the properties
+    provided by this binding, to describe how to handle powering the device up
+    and down using GPIOs
+ - acpi,compatible : compatible string to report
+ - acpi,ddn : Contains the string to use as the _DDN (DOS (Disk Operating
+    System) Device Name)
+ - acpi,hid : Contains the string to use as the HID (Hardware ID)
+    identifier _HID
+ - acpi,uid : _UID value for device
+ - linux,probed : Tells U-Boot to add 'linux,probed' to the ACPI tables so that
+    Linux will only load the driver if the device can be detected (e.g. on I2C
+    bus). Note that this is an out-of-tree Linux feature.
+
+
+Example
+-------
+
+elan_touchscreen: elan-touchscreen@10 {
+       compatible = "i2c-chip";
+       reg = <0x10>;
+       acpi,hid = "ELAN0001";
+       acpi,ddn = "ELAN Touchscreen";
+       interrupts-extended = <&acpi_gpe GPIO_21_IRQ IRQ_TYPE_EDGE_FALLING>;
+       linux,probed;
+};
index d3673a5c8b816043a32178f040c623f8f7818782..075a08380d844cd69eafa30355b3e4997d95282f 100644 (file)
@@ -503,6 +503,9 @@ static u64 versal_clock_calc(u32 clk_id)
             NODE_CLASS_MASK) == NODE_SUBCLASS_CLOCK_REF)
                return versal_clock_ref(clk_id);
 
+       if (!parent_id)
+               return 0;
+
        clk_rate = versal_clock_calc(parent_id);
 
        if (versal_clock_div(clk_id)) {
@@ -526,7 +529,7 @@ static int versal_clock_get_rate(u32 clk_id, u64 *clk_rate)
             NODE_CLASS_MASK) == NODE_SUBCLASS_CLOCK_OUT &&
            ((clk_id >> NODE_CLASS_SHIFT) &
             NODE_CLASS_MASK) == NODE_CLASS_CLOCK) {
-               if (!versal_clock_gate(clk_id))
+               if (!versal_clock_gate(clk_id) && !versal_clock_mux(clk_id))
                        return -EINVAL;
                *clk_rate = versal_clock_calc(clk_id);
                return 0;
index ba50d688fef41b7ef900aec5ce1c2f4b5f06da1c..e09905cf2a066bcc0d49868b9748b6c664d8246e 100644 (file)
 #include <common.h>
 #include <dm.h>
 #include <dm/acpi.h>
+#include <dm/device-internal.h>
 #include <dm/root.h>
 
+/* Type of method to call */
+enum method_t {
+       METHOD_WRITE_TABLES,
+};
+
+/* Prototype for all methods */
+typedef int (*acpi_method)(const struct udevice *dev, struct acpi_ctx *ctx);
+
 int acpi_copy_name(char *out_name, const char *name)
 {
        strncpy(out_name, name, ACPI_NAME_LEN);
@@ -31,3 +40,56 @@ int acpi_get_name(const struct udevice *dev, char *out_name)
 
        return -ENOSYS;
 }
+
+acpi_method acpi_get_method(struct udevice *dev, enum method_t method)
+{
+       struct acpi_ops *aops;
+
+       aops = device_get_acpi_ops(dev);
+       if (aops) {
+               switch (method) {
+               case METHOD_WRITE_TABLES:
+                       return aops->write_tables;
+               }
+       }
+
+       return NULL;
+}
+
+int acpi_recurse_method(struct acpi_ctx *ctx, struct udevice *parent,
+                       enum method_t method)
+{
+       struct udevice *dev;
+       acpi_method func;
+       int ret;
+
+       func = acpi_get_method(parent, method);
+       if (func) {
+               log_debug("\n");
+               log_debug("- %s %p\n", parent->name, func);
+               ret = device_ofdata_to_platdata(parent);
+               if (ret)
+                       return log_msg_ret("ofdata", ret);
+               ret = func(parent, ctx);
+               if (ret)
+                       return log_msg_ret("func", ret);
+       }
+       device_foreach_child(dev, parent) {
+               ret = acpi_recurse_method(ctx, dev, method);
+               if (ret)
+                       return log_msg_ret("recurse", ret);
+       }
+
+       return 0;
+}
+
+int acpi_write_dev_tables(struct acpi_ctx *ctx)
+{
+       int ret;
+
+       log_debug("Writing device tables\n");
+       ret = acpi_recurse_method(ctx, dm_root(), METHOD_WRITE_TABLES);
+       log_debug("Writing finished, err=%d\n", ret);
+
+       return ret;
+}
index 520c9f9feba7036fe03bddb7caaa6b50f3fcdbc6..372dc0a820174c2708131e2b52905e82bf0574f6 100644 (file)
@@ -839,8 +839,7 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
                cfg->host_caps &= ~MMC_MODE_HS_52MHz;
        }
 
-       if (!(cfg->voltages & MMC_VDD_165_195) ||
-           (host->quirks & SDHCI_QUIRK_NO_1_8_V))
+       if (!(cfg->voltages & MMC_VDD_165_195))
                caps_1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 |
                            SDHCI_SUPPORT_DDR50);
 
index da3ff53da10d2c71079b07d26530f8aaec3b6019..18925d01fa0b2ef5145f829ca9527e0274669ee0 100644 (file)
@@ -22,14 +22,12 @@ DECLARE_GLOBAL_DATA_PTR;
 struct arasan_sdhci_plat {
        struct mmc_config cfg;
        struct mmc mmc;
-       unsigned int f_max;
 };
 
 struct arasan_sdhci_priv {
        struct sdhci_host *host;
        u8 deviceid;
        u8 bank;
-       u8 no_1p8;
 };
 
 #if defined(CONFIG_ARCH_ZYNQMP)
@@ -238,8 +236,11 @@ static int arasan_sdhci_probe(struct udevice *dev)
        host->quirks |= SDHCI_QUIRK_BROKEN_HISPD_MODE;
 #endif
 
-       if (priv->no_1p8)
-               host->quirks |= SDHCI_QUIRK_NO_1_8_V;
+       plat->cfg.f_max = CONFIG_ZYNQ_SDHCI_MAX_FREQ;
+
+       ret = mmc_of_parse(dev, &plat->cfg);
+       if (ret)
+               return ret;
 
        host->max_clk = clock;
 
@@ -247,7 +248,7 @@ static int arasan_sdhci_probe(struct udevice *dev)
        host->mmc->dev = dev;
        host->mmc->priv = host;
 
-       ret = sdhci_setup_cfg(&plat->cfg, host, plat->f_max,
+       ret = sdhci_setup_cfg(&plat->cfg, host, plat->cfg.f_max,
                              CONFIG_ZYNQ_SDHCI_MIN_FREQ);
        if (ret)
                return ret;
@@ -258,7 +259,6 @@ static int arasan_sdhci_probe(struct udevice *dev)
 
 static int arasan_sdhci_ofdata_to_platdata(struct udevice *dev)
 {
-       struct arasan_sdhci_plat *plat = dev_get_platdata(dev);
        struct arasan_sdhci_priv *priv = dev_get_priv(dev);
 
        priv->host = calloc(1, sizeof(struct sdhci_host));
@@ -277,10 +277,7 @@ static int arasan_sdhci_ofdata_to_platdata(struct udevice *dev)
 
        priv->deviceid = dev_read_u32_default(dev, "xlnx,device_id", -1);
        priv->bank = dev_read_u32_default(dev, "xlnx,mio_bank", -1);
-       priv->no_1p8 = dev_read_bool(dev, "no-1-8-v");
 
-       plat->f_max = dev_read_u32_default(dev, "max-frequency",
-                                          CONFIG_ZYNQ_SDHCI_MAX_FREQ);
        return 0;
 }
 
index 0aea83dac0e66a8cb86f4f77296c735704be43bc..39412974183107ea1cfbd1adc3999ac613b9a13a 100644 (file)
@@ -845,7 +845,7 @@ static void zynq_nand_cmd_function(struct mtd_info *mtd, unsigned int command,
        if (curr_cmd->end_cmd_valid == ZYNQ_NAND_CMD_PHASE)
                end_cmd_valid = 1;
 
-       if (curr_cmd->end_cmd == NAND_CMD_NONE)
+       if (curr_cmd->end_cmd == (u8)NAND_CMD_NONE)
                end_cmd = 0x0;
        else
                end_cmd = curr_cmd->end_cmd;
index 4d1013c98466ad58c00077b177c7453aebffcac9..bc518f218da6827bf3efa1ffa37e55bf8cdfb8e5 100644 (file)
@@ -640,4 +640,11 @@ config MVMDIO
 
          This driver is used by the MVPP2 and MVNETA drivers.
 
+config FSL_LS_MDIO
+       bool "NXP Layerscape MDIO interface support"
+       depends on DM_MDIO
+       help
+         This driver supports the MDIO bus found on the Fman 10G Ethernet MACs and
+         on the mEMAC (which supports both Clauses 22 and 45).
+
 endif # NETDEVICES
index 6e0a68834d972850692789b14d490babcbd1debd..6d9b8772b1a5fcc3b6bf1cc39d391daf55162eef 100644 (file)
@@ -83,3 +83,4 @@ obj-y += mscc_eswitch/
 obj-$(CONFIG_HIGMACV300_ETH) += higmacv300.o
 obj-$(CONFIG_MDIO_SANDBOX) += mdio_sandbox.o
 obj-$(CONFIG_FSL_ENETC) += fsl_enetc.o fsl_enetc_mdio.o
+obj-$(CONFIG_FSL_LS_MDIO) += fsl_ls_mdio.o
index 88019c9a88cc729852b967af64312d5d613251d1..5f1a0233525cf56b1efd7346b4cca0568f72f801 100644 (file)
@@ -1,10 +1,17 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2009-2012 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  *     Dave Liu <daveliu@freescale.com>
  */
 #include <common.h>
 #include <asm/io.h>
+#ifdef CONFIG_DM_ETH
+#include <dm.h>
+#include <dm/ofnode.h>
+#include <linux/compat.h>
+#include <phy_interface.h>
+#endif
 #include <malloc.h>
 #include <net.h>
 #include <hwconfig.h>
 
 #include "fm.h"
 
+#ifndef CONFIG_DM_ETH
 static struct eth_device *devlist[NUM_FM_PORTS];
 static int num_controllers;
+#endif
 
 #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) && !defined(BITBANGMII)
 
@@ -37,10 +46,18 @@ static void dtsec_configure_serdes(struct fm_eth *priv)
 #ifdef CONFIG_SYS_FMAN_V3
        u32 value;
        struct mii_dev bus;
-       bus.priv = priv->mac->phyregs;
        bool sgmii_2500 = (priv->enet_if ==
                        PHY_INTERFACE_MODE_SGMII_2500) ? true : false;
-       int i = 0;
+       int i = 0, j;
+
+#ifndef CONFIG_DM_ETH
+       bus.priv = priv->mac->phyregs;
+#else
+       bus.priv = priv->pcs_mdio;
+#endif
+       bus.read = memac_mdio_read;
+       bus.write = memac_mdio_write;
+       bus.reset = memac_mdio_reset;
 
 qsgmii_loop:
        /* SGMII IF mode + AN enable only for 1G SGMII, not for 2.5G */
@@ -51,6 +68,10 @@ qsgmii_loop:
        else
                value = PHY_SGMII_IF_MODE_SGMII | PHY_SGMII_IF_MODE_AN;
 
+       for (j = 0; j <= 3; j++)
+               debug("dump PCS reg %#x: %#x\n", j,
+                     memac_mdio_read(&bus, i, MDIO_DEVAD_NONE, j));
+
        memac_mdio_write(&bus, i, MDIO_DEVAD_NONE, 0x14, value);
 
        /* Dev ability according to SGMII specification */
@@ -98,9 +119,8 @@ qsgmii_loop:
 #endif
 }
 
-static void dtsec_init_phy(struct eth_device *dev)
+static void dtsec_init_phy(struct fm_eth *fm_eth)
 {
-       struct fm_eth *fm_eth = dev->priv;
 #ifndef CONFIG_SYS_FMAN_V3
        struct dtsec *regs = (struct dtsec *)CONFIG_SYS_FSL_FM1_DTSEC1_ADDR;
 
@@ -114,10 +134,10 @@ static void dtsec_init_phy(struct eth_device *dev)
                dtsec_configure_serdes(fm_eth);
 }
 
+#ifndef CONFIG_DM_ETH
 #ifdef CONFIG_PHYLIB
-static int tgec_is_fibre(struct eth_device *dev)
+static int tgec_is_fibre(struct fm_eth *fm)
 {
-       struct fm_eth *fm = dev->priv;
        char phyopt[20];
 
        sprintf(phyopt, "fsl_fm%d_xaui_phy", fm->fm_index + 1);
@@ -125,6 +145,7 @@ static int tgec_is_fibre(struct eth_device *dev)
        return hwconfig_arg_cmp(phyopt, "xfi");
 }
 #endif
+#endif /* CONFIG_DM_ETH */
 #endif
 
 static u16 muram_readw(u16 *addr)
@@ -168,6 +189,8 @@ static void bmi_rx_port_disable(struct fm_bmi_rx_port *rx_port)
        /* wait until the rx port is not busy */
        while ((in_be32(&rx_port->fmbm_rst) & FMBM_RST_BSY) && timeout--)
                ;
+       if (!timeout)
+               printf("%s - timeout\n", __func__);
 }
 
 static void bmi_rx_port_init(struct fm_bmi_rx_port *rx_port)
@@ -196,6 +219,8 @@ static void bmi_tx_port_disable(struct fm_bmi_tx_port *tx_port)
        /* wait until the tx port is not busy */
        while ((in_be32(&tx_port->fmbm_tst) & FMBM_TST_BSY) && timeout--)
                ;
+       if (!timeout)
+               printf("%s - timeout\n", __func__);
 }
 
 static void bmi_tx_port_init(struct fm_bmi_tx_port *tx_port)
@@ -435,23 +460,39 @@ static void fmc_tx_port_graceful_stop_disable(struct fm_eth *fm_eth)
        sync();
 }
 
+#ifndef CONFIG_DM_ETH
 static int fm_eth_open(struct eth_device *dev, bd_t *bd)
+#else
+static int fm_eth_open(struct udevice *dev)
+#endif
 {
-       struct fm_eth *fm_eth;
+#ifndef CONFIG_DM_ETH
+       struct fm_eth *fm_eth = dev->priv;
+#else
+       struct eth_pdata *pdata = dev_get_platdata(dev);
+       struct fm_eth *fm_eth = dev_get_priv(dev);
+#endif
+       unsigned char *enetaddr;
        struct fsl_enet_mac *mac;
 #ifdef CONFIG_PHYLIB
        int ret;
 #endif
 
-       fm_eth = (struct fm_eth *)dev->priv;
        mac = fm_eth->mac;
 
+#ifndef CONFIG_DM_ETH
+       enetaddr = &dev->enetaddr[0];
+#else
+       enetaddr = pdata->enetaddr;
+#endif
+
        /* setup the MAC address */
-       if (dev->enetaddr[0] & 0x01) {
-               printf("%s: MacAddress is multcast address\n",  __func__);
-               return 1;
+       if (enetaddr[0] & 0x01) {
+               printf("%s: MacAddress is multicast address\n", __func__);
+               enetaddr[0] = 0;
+               enetaddr[5] = fm_eth->num;
        }
-       mac->set_mac_addr(mac, dev->enetaddr);
+       mac->set_mac_addr(mac, enetaddr);
 
        /* enable bmi Rx port */
        setbits_be32(&fm_eth->rx_port->fmbm_rcfg, FMBM_RCFG_EN);
@@ -466,8 +507,12 @@ static int fm_eth_open(struct eth_device *dev, bd_t *bd)
        if (fm_eth->phydev) {
                ret = phy_startup(fm_eth->phydev);
                if (ret) {
+#ifndef CONFIG_DM_ETH
                        printf("%s: Could not initialize\n",
                               fm_eth->phydev->dev->name);
+#else
+                       printf("%s: Could not initialize\n", dev->name);
+#endif
                        return ret;
                }
        } else {
@@ -481,6 +526,8 @@ static int fm_eth_open(struct eth_device *dev, bd_t *bd)
 
        /* set the MAC-PHY mode */
        mac->set_if_mode(mac, fm_eth->enet_if, fm_eth->phydev->speed);
+       debug("MAC IF mode %d, speed %d, link %d\n", fm_eth->enet_if,
+             fm_eth->phydev->speed, fm_eth->phydev->link);
 
        if (!fm_eth->phydev->link)
                printf("%s: No link.\n", fm_eth->phydev->dev->name);
@@ -488,7 +535,11 @@ static int fm_eth_open(struct eth_device *dev, bd_t *bd)
        return fm_eth->phydev->link ? 0 : -1;
 }
 
+#ifndef CONFIG_DM_ETH
 static void fm_eth_halt(struct eth_device *dev)
+#else
+static void fm_eth_halt(struct udevice *dev)
+#endif
 {
        struct fm_eth *fm_eth;
        struct fsl_enet_mac *mac;
@@ -511,7 +562,11 @@ static void fm_eth_halt(struct eth_device *dev)
 #endif
 }
 
+#ifndef CONFIG_DM_ETH
 static int fm_eth_send(struct eth_device *dev, void *buf, int len)
+#else
+static int fm_eth_send(struct udevice *dev, void *buf, int len)
+#endif
 {
        struct fm_eth *fm_eth;
        struct fm_port_global_pram *pram;
@@ -569,20 +624,50 @@ static int fm_eth_send(struct eth_device *dev, void *buf, int len)
        return 1;
 }
 
-static int fm_eth_recv(struct eth_device *dev)
+static struct fm_port_bd *fm_eth_free_one(struct fm_eth *fm_eth,
+                                         struct fm_port_bd *rxbd)
 {
-       struct fm_eth *fm_eth;
        struct fm_port_global_pram *pram;
-       struct fm_port_bd *rxbd, *rxbd_base;
-       u16 status, len;
-       u32 buf_lo, buf_hi;
-       u8 *data;
+       struct fm_port_bd *rxbd_base;
        u16 offset_out;
-       int ret = 1;
 
-       fm_eth = (struct fm_eth *)dev->priv;
        pram = fm_eth->rx_pram;
-       rxbd = fm_eth->cur_rxbd;
+
+       /* clear the RxBDs */
+       muram_writew(&rxbd->status, RxBD_EMPTY);
+       muram_writew(&rxbd->len, 0);
+       sync();
+
+       /* advance RxBD */
+       rxbd++;
+       rxbd_base = (struct fm_port_bd *)fm_eth->rx_bd_ring;
+       if (rxbd >= (rxbd_base + RX_BD_RING_SIZE))
+               rxbd = rxbd_base;
+
+       /* update RxQD */
+       offset_out = muram_readw(&pram->rxqd.offset_out);
+       offset_out += sizeof(struct fm_port_bd);
+       if (offset_out >= muram_readw(&pram->rxqd.bd_ring_size))
+               offset_out = 0;
+       muram_writew(&pram->rxqd.offset_out, offset_out);
+       sync();
+
+       return rxbd;
+}
+
+#ifndef CONFIG_DM_ETH
+static int fm_eth_recv(struct eth_device *dev)
+#else
+static int fm_eth_recv(struct udevice *dev, int flags, uchar **packetp)
+#endif
+{
+       struct fm_eth *fm_eth = (struct fm_eth *)dev->priv;
+       struct fm_port_bd *rxbd = fm_eth->cur_rxbd;
+       u32 buf_lo, buf_hi;
+       u16 status, len;
+       int ret = -1;
+       u8 *data;
+
        status = muram_readw(&rxbd->status);
 
        while (!(status & RxBD_EMPTY)) {
@@ -591,38 +676,40 @@ static int fm_eth_recv(struct eth_device *dev)
                        buf_lo = in_be32(&rxbd->buf_ptr_lo);
                        data = (u8 *)((ulong)(buf_hi << 16) << 16 | buf_lo);
                        len = muram_readw(&rxbd->len);
+#ifndef CONFIG_DM_ETH
                        net_process_received_packet(data, len);
+#else
+                       *packetp = data;
+                       return len;
+#endif
                } else {
                        printf("%s: Rx error\n", dev->name);
                        ret = 0;
                }
 
-               /* clear the RxBDs */
-               muram_writew(&rxbd->status, RxBD_EMPTY);
-               muram_writew(&rxbd->len, 0);
-               sync();
+               /* free current bd, advance to next one */
+               rxbd = fm_eth_free_one(fm_eth, rxbd);
 
-               /* advance RxBD */
-               rxbd++;
-               rxbd_base = (struct fm_port_bd *)fm_eth->rx_bd_ring;
-               if (rxbd >= (rxbd_base + RX_BD_RING_SIZE))
-                       rxbd = rxbd_base;
                /* read next status */
                status = muram_readw(&rxbd->status);
-
-               /* update RxQD */
-               offset_out = muram_readw(&pram->rxqd.offset_out);
-               offset_out += sizeof(struct fm_port_bd);
-               if (offset_out >= muram_readw(&pram->rxqd.bd_ring_size))
-                       offset_out = 0;
-               muram_writew(&pram->rxqd.offset_out, offset_out);
-               sync();
        }
        fm_eth->cur_rxbd = (void *)rxbd;
 
        return ret;
 }
 
+#ifdef CONFIG_DM_ETH
+static int fm_eth_free_pkt(struct udevice *dev, uchar *packet, int length)
+{
+       struct fm_eth *fm_eth = (struct fm_eth *)dev->priv;
+
+       fm_eth->cur_rxbd = fm_eth_free_one(fm_eth, fm_eth->cur_rxbd);
+
+       return 0;
+}
+#endif /* CONFIG_DM_ETH */
+
+#ifndef CONFIG_DM_ETH
 static int fm_eth_init_mac(struct fm_eth *fm_eth, struct ccsr_fman *reg)
 {
        struct fsl_enet_mac *mac;
@@ -678,22 +765,75 @@ static int fm_eth_init_mac(struct fm_eth *fm_eth, struct ccsr_fman *reg)
 
        return 0;
 }
+#else /* CONFIG_DM_ETH */
+static int fm_eth_init_mac(struct fm_eth *fm_eth, void *reg)
+{
+#ifndef CONFIG_SYS_FMAN_V3
+       void *mdio;
+#endif
+
+       fm_eth->mac = kzalloc(sizeof(*fm_eth->mac), GFP_KERNEL);
+       if (!fm_eth->mac)
+               return -ENOMEM;
 
-static int init_phy(struct eth_device *dev)
+#ifndef CONFIG_SYS_FMAN_V3
+       mdio = fman_mdio(fm_eth->dev->parent, fm_eth->mac_type, fm_eth->num);
+       debug("MDIO %d @ %p\n", fm_eth->num, mdio);
+#endif
+
+       switch (fm_eth->mac_type) {
+#ifdef CONFIG_SYS_FMAN_V3
+       case FM_MEMAC:
+               init_memac(fm_eth->mac, reg, NULL, MAX_RXBUF_LEN);
+               break;
+#else
+       case FM_DTSEC:
+               init_dtsec(fm_eth->mac, reg, mdio, MAX_RXBUF_LEN);
+               break;
+       case FM_TGEC:
+               init_tgec(fm_eth->mac, reg, mdio, MAX_RXBUF_LEN);
+               break;
+#endif
+       }
+
+       return 0;
+}
+#endif /* CONFIG_DM_ETH */
+
+static int init_phy(struct fm_eth *fm_eth)
 {
-       struct fm_eth *fm_eth = dev->priv;
 #ifdef CONFIG_PHYLIB
+       u32 supported = PHY_GBIT_FEATURES;
+#ifndef CONFIG_DM_ETH
        struct phy_device *phydev = NULL;
-       u32 supported;
+#endif
+
+       if (fm_eth->type == FM_ETH_10G_E)
+               supported = PHY_10G_FEATURES;
+       if (fm_eth->enet_if == PHY_INTERFACE_MODE_SGMII_2500)
+               supported |= SUPPORTED_2500baseX_Full;
 #endif
 
        if (fm_eth->type == FM_ETH_1G_E)
-               dtsec_init_phy(dev);
+               dtsec_init_phy(fm_eth);
 
+#ifdef CONFIG_DM_ETH
+#ifdef CONFIG_PHYLIB
+#ifdef CONFIG_DM_MDIO
+       fm_eth->phydev = dm_eth_phy_connect(fm_eth->dev);
+       if (!fm_eth->phydev)
+               return -ENODEV;
+#endif
+       fm_eth->phydev->advertising &= supported;
+       fm_eth->phydev->supported &= supported;
+
+       phy_config(fm_eth->phydev);
+#endif
+#else /* CONFIG_DM_ETH */
 #ifdef CONFIG_PHYLIB
        if (fm_eth->bus) {
-               phydev = phy_connect(fm_eth->bus, fm_eth->phyaddr, dev,
-                                       fm_eth->enet_if);
+               phydev = phy_connect(fm_eth->bus, fm_eth->phyaddr, fm_eth->dev,
+                                    fm_eth->enet_if);
                if (!phydev) {
                        printf("Failed to connect\n");
                        return -1;
@@ -711,7 +851,7 @@ static int init_phy(struct eth_device *dev)
        } else {
                supported = SUPPORTED_10000baseT_Full;
 
-               if (tgec_is_fibre(dev))
+               if (tgec_is_fibre(fm_eth))
                        phydev->port = PORT_FIBRE;
        }
 
@@ -722,10 +862,11 @@ static int init_phy(struct eth_device *dev)
 
        phy_config(phydev);
 #endif
-
+#endif /* CONFIG_DM_ETH */
        return 0;
 }
 
+#ifndef CONFIG_DM_ETH
 int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info)
 {
        struct eth_device *dev;
@@ -784,7 +925,7 @@ int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info)
        if (ret)
                return ret;
 
-       init_phy(dev);
+       init_phy(fm_eth);
 
        /* clear the ethernet address */
        for (i = 0; i < 6; i++)
@@ -793,3 +934,201 @@ int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info)
 
        return 0;
 }
+#else /* CONFIG_DM_ETH */
+#ifdef CONFIG_PHYLIB
+phy_interface_t fman_read_sys_if(struct udevice *dev)
+{
+       const char *if_str;
+
+       if_str = ofnode_read_string(dev->node, "phy-connection-type");
+       debug("MAC system interface mode %s\n", if_str);
+
+       return phy_get_interface_by_name(if_str);
+}
+#endif
+
+static int fm_eth_bind(struct udevice *dev)
+{
+       char mac_name[11];
+       u32 fm, num;
+
+       if (ofnode_read_u32(ofnode_get_parent(dev->node), "cell-index", &fm)) {
+               printf("FMan node property cell-index missing\n");
+               return -EINVAL;
+       }
+
+       if (dev && dev_read_u32(dev, "cell-index", &num)) {
+               printf("FMan MAC node property cell-index missing\n");
+               return -EINVAL;
+       }
+
+       sprintf(mac_name, "fm%d-mac%d", fm + 1, num + 1);
+       device_set_name(dev, mac_name);
+
+       debug("%s - binding %s\n", __func__, mac_name);
+
+       return 0;
+}
+
+static struct udevice *fm_get_internal_mdio(struct udevice *dev)
+{
+       struct ofnode_phandle_args phandle = {.node = ofnode_null()};
+       struct udevice *mdiodev;
+
+       if (dev_read_phandle_with_args(dev, "pcsphy-handle", NULL,
+                                      0, 0, &phandle) ||
+           !ofnode_valid(phandle.node)) {
+               if (dev_read_phandle_with_args(dev, "tbi-handle", NULL,
+                                              0, 0, &phandle) ||
+                   !ofnode_valid(phandle.node)) {
+                       printf("Issue reading pcsphy-handle/tbi-handle for MAC %s\n",
+                              dev->name);
+                       return NULL;
+               }
+       }
+
+       if (uclass_get_device_by_ofnode(UCLASS_MDIO,
+                                       ofnode_get_parent(phandle.node),
+                                       &mdiodev)) {
+               printf("can't find MDIO bus for node %s\n",
+                      ofnode_get_name(ofnode_get_parent(phandle.node)));
+               return NULL;
+       }
+       debug("Found internal MDIO bus %p\n", mdiodev);
+
+       return mdiodev;
+}
+
+static int fm_eth_probe(struct udevice *dev)
+{
+       struct fm_eth *fm_eth = (struct fm_eth *)dev->priv;
+       struct ofnode_phandle_args args;
+       void *reg;
+       int ret, index;
+
+       debug("%s enter for dev %p fm_eth %p - %s\n", __func__, dev, fm_eth,
+             (dev) ? dev->name : "-");
+
+       if (fm_eth->dev) {
+               printf("%s already probed, exit\n", (dev) ? dev->name : "-");
+               return 0;
+       }
+
+       fm_eth->dev = dev;
+       fm_eth->fm_index = fman_id(dev->parent);
+       reg = (void *)(uintptr_t)dev_read_addr(dev);
+       fm_eth->mac_type = dev_get_driver_data(dev);
+#ifdef CONFIG_PHYLIB
+       fm_eth->enet_if = fman_read_sys_if(dev);
+#else
+       fm_eth->enet_if = PHY_INTERFACE_MODE_SGMII;
+       printf("%s: warning - unable to determine interface type\n", __func__);
+#endif
+       switch (fm_eth->mac_type) {
+#ifndef CONFIG_SYS_FMAN_V3
+       case FM_TGEC:
+               fm_eth->type = FM_ETH_10G_E;
+               break;
+       case FM_DTSEC:
+#else
+       case FM_MEMAC:
+               /* default to 1G, 10G is indicated by port property in dts */
+#endif
+               fm_eth->type = FM_ETH_1G_E;
+               break;
+       }
+
+       if (dev_read_u32(dev, "cell-index", &fm_eth->num)) {
+               printf("FMan MAC node property cell-index missing\n");
+               return -EINVAL;
+       }
+
+       if (dev_read_phandle_with_args(dev, "fsl,fman-ports", NULL,
+                                      0, 0, &args))
+               goto ports_ref_failure;
+       index = ofnode_read_u32_default(args.node, "cell-index", 0);
+       if (index <= 0)
+               goto ports_ref_failure;
+       fm_eth->rx_port = fman_port(dev->parent, index);
+
+       if (ofnode_read_bool(args.node, "fsl,fman-10g-port"))
+               fm_eth->type = FM_ETH_10G_E;
+
+       if (dev_read_phandle_with_args(dev, "fsl,fman-ports", NULL,
+                                      0, 1, &args))
+               goto ports_ref_failure;
+       index = ofnode_read_u32_default(args.node, "cell-index", 0);
+       if (index <= 0)
+               goto ports_ref_failure;
+       fm_eth->tx_port = fman_port(dev->parent, index);
+
+       /* set the ethernet max receive length */
+       fm_eth->max_rx_len = MAX_RXBUF_LEN;
+
+       switch (fm_eth->enet_if) {
+       case PHY_INTERFACE_MODE_QSGMII:
+               /* all PCS blocks are accessed on one controller */
+               if (fm_eth->num != 0)
+                       break;
+       case PHY_INTERFACE_MODE_SGMII:
+       case PHY_INTERFACE_MODE_SGMII_2500:
+               fm_eth->pcs_mdio = fm_get_internal_mdio(dev);
+               break;
+       default:
+               break;
+       }
+
+       /* init global mac structure */
+       ret = fm_eth_init_mac(fm_eth, reg);
+       if (ret)
+               return ret;
+
+       /* startup the FM im */
+       ret = fm_eth_startup(fm_eth);
+
+       if (!ret)
+               ret = init_phy(fm_eth);
+
+       return ret;
+
+ports_ref_failure:
+       printf("Issue reading fsl,fman-ports for MAC %s\n", dev->name);
+       return -ENOENT;
+}
+
+static int fm_eth_remove(struct udevice *dev)
+{
+       return 0;
+}
+
+static const struct eth_ops fm_eth_ops = {
+       .start = fm_eth_open,
+       .send = fm_eth_send,
+       .recv = fm_eth_recv,
+       .free_pkt = fm_eth_free_pkt,
+       .stop = fm_eth_halt,
+};
+
+static const struct udevice_id fm_eth_ids[] = {
+#ifdef CONFIG_SYS_FMAN_V3
+       { .compatible = "fsl,fman-memac", .data = FM_MEMAC },
+#else
+       { .compatible = "fsl,fman-dtsec", .data = FM_DTSEC },
+       { .compatible = "fsl,fman-xgec", .data = FM_TGEC },
+#endif
+       {}
+};
+
+U_BOOT_DRIVER(eth_fman) = {
+       .name = "eth_fman",
+       .id = UCLASS_ETH,
+       .of_match = fm_eth_ids,
+       .bind = fm_eth_bind,
+       .probe = fm_eth_probe,
+       .remove = fm_eth_remove,
+       .ops = &fm_eth_ops,
+       .priv_auto_alloc_size = sizeof(struct fm_eth),
+       .platdata_auto_alloc_size = sizeof(struct eth_pdata),
+       .flags = DM_FLAG_ALLOC_PRIV_DMA,
+};
+#endif /* CONFIG_DM_ETH */
index 7a081b9d03035c686574fc71de5b2f3ed6157a74..8ab18163954ca79a1ec8ecfab124e37321d32dfa 100644 (file)
@@ -9,6 +9,9 @@
 #include <asm/io.h>
 #include <linux/errno.h>
 #include <u-boot/crc.h>
+#ifdef CONFIG_DM_ETH
+#include <dm.h>
+#endif
 
 #include "fm.h"
 #include <fsl_qe.h>            /* For struct qe_firmware */
@@ -529,3 +532,80 @@ int fm_init_common(int index, struct ccsr_fman *reg)
        return fm_init_bmi(index, &reg->fm_bmi_common);
 }
 #endif
+
+#ifdef CONFIG_DM_ETH
+struct fman_priv {
+       struct ccsr_fman *reg;
+       unsigned int fman_id;
+};
+
+static const struct udevice_id fman_ids[] = {
+       { .compatible = "fsl,fman" },
+       {}
+};
+
+static int fman_probe(struct udevice *dev)
+{
+       struct fman_priv *priv = dev_get_priv(dev);
+
+       priv->reg = (struct ccsr_fman *)(uintptr_t)dev_read_addr(dev);
+
+       if (dev_read_u32(dev, "cell-index", &priv->fman_id)) {
+               printf("FMan node property cell-index missing\n");
+               return -EINVAL;
+       }
+
+       return fm_init_common(priv->fman_id, priv->reg);
+}
+
+static int fman_remove(struct udevice *dev)
+{
+       return 0;
+}
+
+int fman_id(struct udevice *dev)
+{
+       struct fman_priv *priv = dev_get_priv(dev);
+
+       return priv->fman_id;
+}
+
+void *fman_port(struct udevice *dev, int num)
+{
+       struct fman_priv *priv = dev_get_priv(dev);
+
+       return &priv->reg->port[num - 1].fm_bmi;
+}
+
+void *fman_mdio(struct udevice *dev, enum fm_mac_type type, int num)
+{
+       struct fman_priv *priv = dev_get_priv(dev);
+       void *res = NULL;
+
+       switch (type) {
+#ifdef CONFIG_SYS_FMAN_V3
+       case FM_MEMAC:
+               res = &priv->reg->memac[num].fm_memac_mdio;
+               break;
+#else
+       case FM_DTSEC:
+               res = &priv->reg->mac_1g[num].fm_mdio.miimcfg;
+               break;
+       case FM_TGEC:
+               res = &priv->reg->mac_10g[num].fm_10gec_mdio;
+               break;
+#endif
+       }
+       return res;
+}
+
+U_BOOT_DRIVER(fman) = {
+       .name = "fman",
+       .id = UCLASS_SIMPLE_BUS,
+       .of_match = fman_ids,
+       .probe = fman_probe,
+       .remove = fman_remove,
+       .priv_auto_alloc_size = sizeof(struct fman_priv),
+       .flags = DM_FLAG_ALLOC_PRIV_DMA,
+};
+#endif /* CONFIG_DM_ETH */
index e5deaf52c5a190ffc4bf2f5106c89d72a652a549..2379b3a11cabeb37bf3c93aa72f340d34a2d0a4f 100644 (file)
@@ -57,6 +57,18 @@ struct fm_port_bd {
 #define TxBD_READY             0x8000
 #define TxBD_LAST              BD_LAST
 
+#ifdef CONFIG_DM_ETH
+enum fm_mac_type {
+#ifdef CONFIG_SYS_FMAN_V3
+       FM_MEMAC,
+#else
+       FM_DTSEC,
+       FM_TGEC,
+#endif
+};
+#endif
+
+/* Fman ethernet private struct */
 /* Rx/Tx queue descriptor */
 struct fm_port_qd {
        u16 gen;
@@ -101,6 +113,11 @@ int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info);
 phy_interface_t fman_port_enet_if(enum fm_port port);
 void fman_disable_port(enum fm_port port);
 void fman_enable_port(enum fm_port port);
+int fman_id(struct udevice *dev);
+void *fman_port(struct udevice *dev, int num);
+#ifdef CONFIG_DM_ETH
+void *fman_mdio(struct udevice *dev, enum fm_mac_type type, int num);
+#endif
 
 struct fsl_enet_mac {
        void *base; /* MAC controller registers base address */
@@ -126,7 +143,13 @@ struct fm_eth {
        struct mii_dev *bus;
        struct phy_device *phydev;
        int phyaddr;
+#ifndef CONFIG_DM_ETH
        struct eth_device *dev;
+#else
+       enum fm_mac_type mac_type;
+       struct udevice *dev;
+       struct udevice *pcs_mdio;
+#endif
        int max_rx_len;
        struct fm_port_global_pram *rx_pram; /* Rx parameter table */
        struct fm_port_global_pram *tx_pram; /* Tx parameter table */
index f896e80b6d921ab471ed19fb85413953453bc796..8669d21afb1277bb72d2d493b6af91e4ee1e73d9 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "fm.h"
 
+#ifndef CONFIG_DM_ETH
 struct fm_eth_info fm_info[] = {
 #if (CONFIG_SYS_NUM_FM1_DTSEC >= 1)
        FM_DTSEC_INFO_INITIALIZER(1, 1),
@@ -380,3 +381,4 @@ int is_qsgmii_riser_card(struct mii_dev *bus, int phy_base_addr,
 
        return 0;
 }
+#endif /* CONFIG_DM_ETH */
index bed8f14aeeccb994e56d1658d1837cf405c96304..77ea083782650c718bb710d08773a30f80626082 100644 (file)
@@ -137,6 +137,7 @@ static void memac_set_interface_mode(struct fsl_enet_mac *mac,
 void init_memac(struct fsl_enet_mac *mac, void *base,
                void *phyregs, int max_rx_len)
 {
+       debug("%s: @ %p, mdio @ %p\n", __func__, base, phyregs);
        mac->base = base;
        mac->phyregs = phyregs;
        mac->max_rx_len = max_rx_len;
index c2ef1b4e737ecd8dc9112ce7596b922e51a55ea7..4cbfbc70ab530c231d80a564fc3b22abec642560 100644 (file)
 #define memac_setbits_32(a, v) setbits_be32(a, v)
 #endif
 
+#ifdef CONFIG_DM_ETH
+struct fm_mdio_priv {
+       struct memac_mdio_controller *regs;
+};
+#endif
+
 static u32 memac_in_32(u32 *reg)
 {
 #ifdef CONFIG_SYS_MEMAC_LITTLE_ENDIAN
@@ -39,10 +45,23 @@ static u32 memac_in_32(u32 *reg)
 int memac_mdio_write(struct mii_dev *bus, int port_addr, int dev_addr,
                        int regnum, u16 value)
 {
+       struct memac_mdio_controller *regs;
        u32 mdio_ctl;
-       struct memac_mdio_controller *regs = bus->priv;
        u32 c45 = 1; /* Default to 10G interface */
 
+#ifndef CONFIG_DM_ETH
+       regs = bus->priv;
+#else
+       struct fm_mdio_priv *priv;
+
+       if (!bus->priv)
+               return -EINVAL;
+       priv = dev_get_priv(bus->priv);
+       regs = priv->regs;
+       debug("memac_mdio_write(regs %p, port %d, dev %d, reg %d, val %#x)\n",
+             regs, port_addr, dev_addr, regnum, value);
+#endif
+
        if (dev_addr == MDIO_DEVAD_NONE) {
                c45 = 0; /* clause 22 */
                dev_addr = regnum & 0x1f;
@@ -84,13 +103,26 @@ int memac_mdio_write(struct mii_dev *bus, int port_addr, int dev_addr,
 int memac_mdio_read(struct mii_dev *bus, int port_addr, int dev_addr,
                        int regnum)
 {
+       struct memac_mdio_controller *regs;
        u32 mdio_ctl;
-       struct memac_mdio_controller *regs = bus->priv;
        u32 c45 = 1;
 
+#ifndef CONFIG_DM_ETH
+       regs = bus->priv;
+#else
+       struct fm_mdio_priv *priv;
+
+       if (!bus->priv)
+               return -EINVAL;
+       priv = dev_get_priv(bus->priv);
+       regs = priv->regs;
+#endif
+
        if (dev_addr == MDIO_DEVAD_NONE) {
+#ifndef CONFIG_DM_ETH
                if (!strcmp(bus->name, DEFAULT_FM_TGEC_MDIO_NAME))
                        return 0xffff;
+#endif
                c45 = 0; /* clause 22 */
                dev_addr = regnum & 0x1f;
                memac_clrbits_32(&regs->mdio_stat, MDIO_STAT_ENC);
@@ -133,6 +165,7 @@ int memac_mdio_reset(struct mii_dev *bus)
        return 0;
 }
 
+#ifndef CONFIG_DM_ETH
 int fm_memac_mdio_init(bd_t *bis, struct memac_mdio_info *info)
 {
        struct mii_dev *bus = mdio_alloc();
@@ -167,3 +200,105 @@ int fm_memac_mdio_init(bd_t *bis, struct memac_mdio_info *info)
 
        return mdio_register(bus);
 }
+
+#else /* CONFIG_DM_ETH */
+#if defined(CONFIG_PHYLIB) && defined(CONFIG_DM_MDIO)
+static int fm_mdio_read(struct udevice *dev, int addr, int devad, int reg)
+{
+       struct mdio_perdev_priv *pdata = (dev) ? dev_get_uclass_priv(dev) :
+                                                NULL;
+
+       if (pdata && pdata->mii_bus)
+               return memac_mdio_read(pdata->mii_bus, addr, devad, reg);
+
+       return -1;
+}
+
+static int fm_mdio_write(struct udevice *dev, int addr, int devad, int reg,
+                        u16 val)
+{
+       struct mdio_perdev_priv *pdata = (dev) ? dev_get_uclass_priv(dev) :
+                                                NULL;
+
+       if (pdata && pdata->mii_bus)
+               return memac_mdio_write(pdata->mii_bus, addr, devad, reg, val);
+
+       return -1;
+}
+
+static int fm_mdio_reset(struct udevice *dev)
+{
+       struct mdio_perdev_priv *pdata = (dev) ? dev_get_uclass_priv(dev) :
+                                                NULL;
+
+       if (pdata && pdata->mii_bus)
+               return memac_mdio_reset(pdata->mii_bus);
+
+       return -1;
+}
+
+static const struct mdio_ops fm_mdio_ops = {
+       .read = fm_mdio_read,
+       .write = fm_mdio_write,
+       .reset = fm_mdio_reset,
+};
+
+static const struct udevice_id fm_mdio_ids[] = {
+       { .compatible = "fsl,fman-memac-mdio" },
+       {}
+};
+
+static int fm_mdio_probe(struct udevice *dev)
+{
+       struct fm_mdio_priv *priv = (dev) ? dev_get_priv(dev) : NULL;
+       struct mdio_perdev_priv *pdata = (dev) ? dev_get_uclass_priv(dev) :
+                                                NULL;
+
+       if (!dev) {
+               printf("%s dev = NULL\n", __func__);
+               return -1;
+       }
+       if (!priv) {
+               printf("dev_get_priv(dev %p) = NULL\n", dev);
+               return -1;
+       }
+       priv->regs = (void *)(uintptr_t)dev_read_addr(dev);
+       debug("%s priv %p @ regs %p, pdata %p\n", __func__,
+             priv, priv->regs, pdata);
+
+       /*
+        * On some platforms like B4860, default value of MDIO_CLK_DIV bits
+        * in mdio_stat(mdio_cfg) register generates MDIO clock too high
+        * (much higher than 2.5MHz), violating the IEEE specs.
+        * On other platforms like T1040, default value of MDIO_CLK_DIV bits
+        * is zero, so MDIO clock is disabled.
+        * So, for proper functioning of MDIO, MDIO_CLK_DIV bits needs to
+        * be properly initialized.
+        * The default NEG bit should be '1' as per FMANv3 RM, but on platforms
+        * like T2080QDS, this bit default is '0', which leads to MDIO failure
+        * on XAUI PHY, so set this bit definitely.
+        */
+       if (priv && priv->regs && priv->regs->mdio_stat)
+               memac_setbits_32(&priv->regs->mdio_stat,
+                                MDIO_STAT_CLKDIV(258) | MDIO_STAT_NEG);
+
+       return 0;
+}
+
+static int fm_mdio_remove(struct udevice *dev)
+{
+       return 0;
+}
+
+U_BOOT_DRIVER(fman_mdio) = {
+       .name = "fman_mdio",
+       .id = UCLASS_MDIO,
+       .of_match = fm_mdio_ids,
+       .probe = fm_mdio_probe,
+       .remove = fm_mdio_remove,
+       .ops = &fm_mdio_ops,
+       .priv_auto_alloc_size = sizeof(struct fm_mdio_priv),
+       .platdata_auto_alloc_size = sizeof(struct mdio_perdev_priv),
+};
+#endif /* CONFIG_PHYLIB && CONFIG_DM_MDIO */
+#endif /* CONFIG_DM_ETH */
index 07bbcc9b2311b87e8dd57bc1653284f0831f4357..fee372968a38e65f7ea2d5d01e1670b45767f53c 100644 (file)
@@ -174,9 +174,21 @@ enum mc_fixup_type {
 };
 
 static int mc_fixup_mac_addr(void *blob, int nodeoffset,
+#ifdef CONFIG_DM_ETH
+                            const char *propname, struct udevice *eth_dev,
+#else
                             const char *propname, struct eth_device *eth_dev,
+#endif
                             enum mc_fixup_type type)
 {
+#ifdef CONFIG_DM_ETH
+       struct eth_pdata *plat = dev_get_platdata(eth_dev);
+       unsigned char *enetaddr = plat->enetaddr;
+       int eth_index = eth_dev->seq;
+#else
+       unsigned char *enetaddr = eth_dev->enetaddr;
+       int eth_index = eth_dev->index;
+#endif
        int err = 0, len = 0, size, i;
        unsigned char env_enetaddr[ARP_HLEN];
        unsigned int enetaddr_32[ARP_HLEN];
@@ -184,23 +196,22 @@ static int mc_fixup_mac_addr(void *blob, int nodeoffset,
 
        switch (type) {
        case MC_FIXUP_DPL:
-       /* DPL likes its addresses on 32 * ARP_HLEN bits */
-       for (i = 0; i < ARP_HLEN; i++)
-               enetaddr_32[i] = cpu_to_fdt32(eth_dev->enetaddr[i]);
-       val = enetaddr_32;
-       len = sizeof(enetaddr_32);
-       break;
-
+               /* DPL likes its addresses on 32 * ARP_HLEN bits */
+               for (i = 0; i < ARP_HLEN; i++)
+                       enetaddr_32[i] = cpu_to_fdt32(enetaddr[i]);
+               val = enetaddr_32;
+               len = sizeof(enetaddr_32);
+               break;
        case MC_FIXUP_DPC:
-       val = eth_dev->enetaddr;
-       len = ARP_HLEN;
-       break;
+               val = enetaddr;
+               len = ARP_HLEN;
+               break;
        }
 
        /* MAC address property present */
        if (fdt_get_property(blob, nodeoffset, propname, NULL)) {
                /* u-boot MAC addr randomly assigned - leave the present one */
-               if (!eth_env_get_enetaddr_by_index("eth", eth_dev->index,
+               if (!eth_env_get_enetaddr_by_index("eth", eth_index,
                                                   env_enetaddr))
                        return err;
        } else {
@@ -250,7 +261,11 @@ const char *dpl_get_connection_endpoint(void *blob, char *endpoint)
 }
 
 static int mc_fixup_dpl_mac_addr(void *blob, int dpmac_id,
+#ifdef CONFIG_DM_ETH
+                                struct udevice *eth_dev)
+#else
                                 struct eth_device *eth_dev)
+#endif
 {
        int objoff = fdt_path_offset(blob, "/objects");
        int dpmacoff = -1, dpnioff = -1;
@@ -334,7 +349,11 @@ void fdt_fsl_mc_fixup_iommu_map_entry(void *blob)
 }
 
 static int mc_fixup_dpc_mac_addr(void *blob, int dpmac_id,
+#ifdef CONFIG_DM_ETH
+                                struct udevice *eth_dev)
+#else
                                 struct eth_device *eth_dev)
+#endif
 {
        int nodeoffset = fdt_path_offset(blob, "/board_info/ports"), noff;
        int err = 0;
@@ -377,8 +396,13 @@ static int mc_fixup_dpc_mac_addr(void *blob, int dpmac_id,
 static int mc_fixup_mac_addrs(void *blob, enum mc_fixup_type type)
 {
        int i, err = 0, ret = 0;
-       char ethname[ETH_NAME_LEN];
+#ifdef CONFIG_DM_ETH
+#define ETH_NAME_LEN 20
+       struct udevice *eth_dev;
+#else
        struct eth_device *eth_dev;
+#endif
+       char ethname[ETH_NAME_LEN];
 
        for (i = WRIOP1_DPMAC1; i < NUM_WRIOP_PORTS; i++) {
                /* port not enabled */
diff --git a/drivers/net/fsl_ls_mdio.c b/drivers/net/fsl_ls_mdio.c
new file mode 100644 (file)
index 0000000..6d8332d
--- /dev/null
@@ -0,0 +1,146 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2020 NXP
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <errno.h>
+#include <miiphy.h>
+#include <asm/io.h>
+#include <fsl_memac.h>
+
+#ifdef CONFIG_SYS_MEMAC_LITTLE_ENDIAN
+#define memac_out_32(a, v)     out_le32(a, v)
+#define memac_clrbits_32(a, v) clrbits_le32(a, v)
+#define memac_setbits_32(a, v) setbits_le32(a, v)
+#else
+#define memac_out_32(a, v)     out_be32(a, v)
+#define memac_clrbits_32(a, v) clrbits_be32(a, v)
+#define memac_setbits_32(a, v) setbits_be32(a, v)
+#endif
+
+static u32 memac_in_32(u32 *reg)
+{
+#ifdef CONFIG_SYS_MEMAC_LITTLE_ENDIAN
+       return in_le32(reg);
+#else
+       return in_be32(reg);
+#endif
+}
+
+struct fsl_ls_mdio_priv {
+       void *regs_base;
+};
+
+static u32 fsl_ls_mdio_setup_operation(struct udevice *dev, int addr, int devad,
+                                      int reg)
+{
+       struct fsl_ls_mdio_priv *priv = dev_get_priv(dev);
+       struct memac_mdio_controller *regs;
+       u32 mdio_ctl;
+       u32 c45 = 1;
+
+       regs = (struct memac_mdio_controller *)(priv->regs_base);
+       if (devad == MDIO_DEVAD_NONE) {
+               c45 = 0; /* clause 22 */
+               devad = reg & 0x1f;
+               memac_clrbits_32(&regs->mdio_stat, MDIO_STAT_ENC);
+       } else {
+               memac_setbits_32(&regs->mdio_stat, MDIO_STAT_ENC);
+       }
+
+       /* Wait till the bus is free */
+       while ((memac_in_32(&regs->mdio_stat)) & MDIO_STAT_BSY)
+               ;
+
+       /* Set the Port and Device Addrs */
+       mdio_ctl = MDIO_CTL_PORT_ADDR(addr) | MDIO_CTL_DEV_ADDR(devad);
+       memac_out_32(&regs->mdio_ctl, mdio_ctl);
+
+       /* Set the register address */
+       if (c45)
+               memac_out_32(&regs->mdio_addr, reg & 0xffff);
+
+       /* Wait till the bus is free */
+       while ((memac_in_32(&regs->mdio_stat)) & MDIO_STAT_BSY)
+               ;
+
+       return mdio_ctl;
+}
+
+static int dm_fsl_ls_mdio_read(struct udevice *dev, int addr,
+                              int devad, int reg)
+{
+       struct fsl_ls_mdio_priv *priv = dev_get_priv(dev);
+       struct memac_mdio_controller *regs;
+       u32 mdio_ctl;
+
+       regs = (struct memac_mdio_controller *)(priv->regs_base);
+       mdio_ctl = fsl_ls_mdio_setup_operation(dev, addr, devad, reg);
+
+       /* Initiate the read */
+       mdio_ctl |= MDIO_CTL_READ;
+       memac_out_32(&regs->mdio_ctl, mdio_ctl);
+
+       /* Wait till the MDIO write is complete */
+       while ((memac_in_32(&regs->mdio_data)) & MDIO_DATA_BSY)
+               ;
+
+       /* Return all Fs if nothing was there */
+       if (memac_in_32(&regs->mdio_stat) & MDIO_STAT_RD_ER)
+               return 0xffff;
+
+       return memac_in_32(&regs->mdio_data) & 0xffff;
+}
+
+static int dm_fsl_ls_mdio_write(struct udevice *dev, int addr, int devad,
+                               int reg, u16 val)
+{
+       struct fsl_ls_mdio_priv *priv = dev_get_priv(dev);
+       struct memac_mdio_controller *regs;
+
+       regs = (struct memac_mdio_controller *)(priv->regs_base);
+       fsl_ls_mdio_setup_operation(dev, addr, devad, reg);
+
+       /* Write the value to the register */
+       memac_out_32(&regs->mdio_data, MDIO_DATA(val));
+
+       /* Wait till the MDIO write is complete */
+       while ((memac_in_32(&regs->mdio_data)) & MDIO_DATA_BSY)
+               ;
+
+       return 0;
+}
+
+static const struct mdio_ops fsl_ls_mdio_ops = {
+       .read = dm_fsl_ls_mdio_read,
+       .write = dm_fsl_ls_mdio_write,
+};
+
+static int fsl_ls_mdio_probe(struct udevice *dev)
+{
+       struct fsl_ls_mdio_priv *priv = dev_get_priv(dev);
+       struct memac_mdio_controller *regs;
+
+       priv->regs_base = dev_read_addr_ptr(dev);
+       regs = (struct memac_mdio_controller *)(priv->regs_base);
+
+       memac_setbits_32(&regs->mdio_stat,
+                        MDIO_STAT_CLKDIV(258) | MDIO_STAT_NEG);
+
+       return 0;
+}
+
+static const struct udevice_id fsl_ls_mdio_of_ids[] = {
+       { .compatible = "fsl,ls-mdio" },
+};
+
+U_BOOT_DRIVER(fsl_ls_mdio) = {
+       .name = "fsl_ls_mdio",
+       .id = UCLASS_MDIO,
+       .of_match = fsl_ls_mdio_of_ids,
+       .probe = fsl_ls_mdio_probe,
+       .ops = &fsl_ls_mdio_ops,
+       .priv_auto_alloc_size = sizeof(struct fsl_ls_mdio_priv),
+};
index a3b9c152b256825b97bddc3d1a247de93c605495..48343dce1c4ff6e186d2177d0cfbf59c45162f93 100644 (file)
@@ -12,6 +12,7 @@
 #include <net.h>
 #include <hwconfig.h>
 #include <phy.h>
+#include <miiphy.h>
 #include <linux/compat.h>
 #include <fsl-mc/fsl_dpmac.h>
 
 #include "ldpaa_eth.h"
 
 #ifdef CONFIG_PHYLIB
+#ifdef CONFIG_DM_ETH
+static void init_phy(struct udevice *dev)
+{
+       struct ldpaa_eth_priv *priv = dev_get_priv(dev);
+
+       priv->phy = dm_eth_phy_connect(dev);
+
+       if (!priv->phy)
+               return;
+
+       phy_config(priv->phy);
+}
+#else
 static int init_phy(struct eth_device *dev)
 {
        struct ldpaa_eth_priv *priv = (struct ldpaa_eth_priv *)dev->priv;
@@ -63,6 +77,7 @@ static int init_phy(struct eth_device *dev)
        return ret;
 }
 #endif
+#endif
 
 #ifdef DEBUG
 
@@ -128,9 +143,15 @@ static void ldpaa_eth_get_dpni_counter(void)
        }
 }
 
+#ifdef CONFIG_DM_ETH
+static void ldpaa_eth_get_dpmac_counter(struct udevice *dev)
+{
+       struct ldpaa_eth_priv *priv = dev_get_priv(dev);
+#else
 static void ldpaa_eth_get_dpmac_counter(struct eth_device *net_dev)
 {
        struct ldpaa_eth_priv *priv = (struct ldpaa_eth_priv *)net_dev->priv;
+#endif
        int err = 0;
        u64 value;
 
@@ -263,9 +284,16 @@ error:
        return;
 }
 
+#ifdef CONFIG_DM_ETH
+static int ldpaa_eth_pull_dequeue_rx(struct udevice *dev,
+                                    int flags, uchar **packetp)
+{
+       struct ldpaa_eth_priv *priv = dev_get_priv(dev);
+#else
 static int ldpaa_eth_pull_dequeue_rx(struct eth_device *dev)
 {
        struct ldpaa_eth_priv *priv = (struct ldpaa_eth_priv *)dev->priv;
+#endif
        const struct ldpaa_dq *dq;
        const struct dpaa_fd *fd;
        int i = 5, err = 0, status;
@@ -322,9 +350,15 @@ static int ldpaa_eth_pull_dequeue_rx(struct eth_device *dev)
        return err;
 }
 
+#ifdef CONFIG_DM_ETH
+static int ldpaa_eth_tx(struct udevice *dev, void *buf, int len)
+{
+       struct ldpaa_eth_priv *priv = dev_get_priv(dev);
+#else
 static int ldpaa_eth_tx(struct eth_device *net_dev, void *buf, int len)
 {
        struct ldpaa_eth_priv *priv = (struct ldpaa_eth_priv *)net_dev->priv;
+#endif
        struct dpaa_fd fd;
        u64 buffer_start;
        int data_offset, err;
@@ -400,15 +434,33 @@ error:
        return err;
 }
 
+static struct phy_device *ldpaa_get_phydev(struct ldpaa_eth_priv *priv)
+{
+#ifdef CONFIG_DM_ETH
+       return priv->phy;
+#else
+#ifdef CONFIG_PHYLIB
+       struct phy_device *phydev = NULL;
+       int phy_num;
+
+       /* start the phy devices one by one and update the dpmac state */
+       for (phy_num = 0; phy_num < WRIOP_MAX_PHY_NUM; phy_num++) {
+               phydev = wriop_get_phy_dev(priv->dpmac_id, phy_num);
+               if (phydev)
+                       return phydev;
+       }
+       return NULL;
+#endif
+       return NULL;
+#endif
+}
+
 static int ldpaa_get_dpmac_state(struct ldpaa_eth_priv *priv,
                                 struct dpmac_link_state *state)
 {
        phy_interface_t enet_if;
-       int phys_detected;
-#ifdef CONFIG_PHYLIB
        struct phy_device *phydev = NULL;
-       int err, phy_num;
-#endif
+       int err;
 
        /* let's start off with maximum capabilities */
        enet_if = wriop_get_enet_if(priv->dpmac_id);
@@ -420,39 +472,28 @@ static int ldpaa_get_dpmac_state(struct ldpaa_eth_priv *priv,
                state->rate = SPEED_1000;
                break;
        }
-       state->up = 1;
 
-       phys_detected = 0;
-#ifdef CONFIG_PHYLIB
+       state->up = 1;
        state->options |= DPMAC_LINK_OPT_AUTONEG;
+       phydev = ldpaa_get_phydev(priv);
 
-       /* start the phy devices one by one and update the dpmac state */
-       for (phy_num = 0; phy_num < WRIOP_MAX_PHY_NUM; phy_num++) {
-               phydev = wriop_get_phy_dev(priv->dpmac_id, phy_num);
-               if (!phydev)
-                       continue;
-
-               phys_detected++;
+       if (phydev) {
                err = phy_startup(phydev);
                if (err) {
                        printf("%s: Could not initialize\n", phydev->dev->name);
                        state->up = 0;
-                       break;
-               }
-               if (phydev->link) {
+               } else if (phydev->link) {
                        state->rate = min(state->rate, (uint32_t)phydev->speed);
                        if (!phydev->duplex)
                                state->options |= DPMAC_LINK_OPT_HALF_DUPLEX;
                        if (!phydev->autoneg)
                                state->options &= ~DPMAC_LINK_OPT_AUTONEG;
                } else {
-                       /* break out of loop even if one phy is down */
                        state->up = 0;
-                       break;
                }
        }
-#endif
-       if (!phys_detected)
+
+       if (!phydev)
                state->options &= ~DPMAC_LINK_OPT_AUTONEG;
 
        if (!state->up) {
@@ -464,9 +505,16 @@ static int ldpaa_get_dpmac_state(struct ldpaa_eth_priv *priv,
        return 0;
 }
 
+#ifdef CONFIG_DM_ETH
+static int ldpaa_eth_open(struct udevice *dev)
+{
+       struct eth_pdata *plat = dev_get_platdata(dev);
+       struct ldpaa_eth_priv *priv = dev_get_priv(dev);
+#else
 static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd)
 {
        struct ldpaa_eth_priv *priv = (struct ldpaa_eth_priv *)net_dev->priv;
+#endif
        struct dpmac_link_state dpmac_link_state = { 0 };
 #ifdef DEBUG
        struct dpni_link_state link_state;
@@ -474,8 +522,13 @@ static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd)
        int err = 0;
        struct dpni_queue d_queue;
 
+#ifdef CONFIG_DM_ETH
+       if (eth_is_active(dev))
+               return 0;
+#else
        if (net_dev->state == ETH_STATE_ACTIVE)
                return 0;
+#endif
 
        if (get_mc_boot_status() != 0) {
                printf("ERROR (MC is not booted)\n");
@@ -515,8 +568,13 @@ static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd)
        if (err)
                goto err_dpni_bind;
 
+#ifdef CONFIG_DM_ETH
+       err = dpni_add_mac_addr(dflt_mc_io, MC_CMD_NO_FLAGS,
+                               dflt_dpni->dpni_handle, plat->enetaddr);
+#else
        err = dpni_add_mac_addr(dflt_mc_io, MC_CMD_NO_FLAGS,
                                dflt_dpni->dpni_handle, net_dev->enetaddr);
+#endif
        if (err) {
                printf("dpni_add_mac_addr() failed\n");
                return err;
@@ -589,22 +647,34 @@ err_dpmac_setup:
        return err;
 }
 
+#ifdef CONFIG_DM_ETH
+static void ldpaa_eth_stop(struct udevice *dev)
+{
+       struct ldpaa_eth_priv *priv = dev_get_priv(dev);
+#else
 static void ldpaa_eth_stop(struct eth_device *net_dev)
 {
        struct ldpaa_eth_priv *priv = (struct ldpaa_eth_priv *)net_dev->priv;
-       int err = 0;
-#ifdef CONFIG_PHYLIB
-       struct phy_device *phydev = NULL;
-       int phy_num;
 #endif
+       struct phy_device *phydev = NULL;
+       int err = 0;
 
+#ifdef CONFIG_DM_ETH
+       if (!eth_is_active(dev))
+               return;
+#else
        if ((net_dev->state == ETH_STATE_PASSIVE) ||
            (net_dev->state == ETH_STATE_INIT))
                return;
+#endif
 
 #ifdef DEBUG
        ldpaa_eth_get_dpni_counter();
+#ifdef CONFIG_DM_ETH
+       ldpaa_eth_get_dpmac_counter(dev);
+#else
        ldpaa_eth_get_dpmac_counter(net_dev);
+#endif
 #endif
 
        err = dprc_disconnect(dflt_mc_io, MC_CMD_NO_FLAGS,
@@ -628,13 +698,9 @@ static void ldpaa_eth_stop(struct eth_device *net_dev)
        if (err < 0)
                printf("dpni_disable() failed\n");
 
-#ifdef CONFIG_PHYLIB
-       for (phy_num = 0; phy_num < WRIOP_MAX_PHY_NUM; phy_num++) {
-               phydev = wriop_get_phy_dev(priv->dpmac_id, phy_num);
-               if (phydev)
-                       phy_shutdown(phydev);
-       }
-#endif
+       phydev = ldpaa_get_phydev(priv);
+       if (phydev)
+               phy_shutdown(phydev);
 
        /* Free DPBP handle and reset. */
        ldpaa_dpbp_free();
@@ -1027,6 +1093,107 @@ static int ldpaa_dpni_bind(struct ldpaa_eth_priv *priv)
        return 0;
 }
 
+#ifdef CONFIG_DM_ETH
+static int ldpaa_eth_probe(struct udevice *dev)
+{
+       struct ofnode_phandle_args phandle;
+
+       /* Nothing to do if there is no "phy-handle" in the DTS node */
+       if (dev_read_phandle_with_args(dev, "phy-handle", NULL,
+                                      0, 0, &phandle)) {
+               return 0;
+       }
+
+       init_phy(dev);
+
+       return 0;
+}
+
+static uint32_t ldpaa_eth_get_dpmac_id(struct udevice *dev)
+{
+       int port_node = dev_of_offset(dev);
+
+       return fdtdec_get_uint(gd->fdt_blob, port_node, "reg", -1);
+}
+
+static const char *ldpaa_eth_get_phy_mode_str(struct udevice *dev)
+{
+       int port_node = dev_of_offset(dev);
+       const char *phy_mode_str;
+
+       phy_mode_str = fdt_getprop(gd->fdt_blob, port_node,
+                                  "phy-connection-type", NULL);
+       if (phy_mode_str)
+               return phy_mode_str;
+
+       phy_mode_str = fdt_getprop(gd->fdt_blob, port_node, "phy-mode", NULL);
+       return phy_mode_str;
+}
+
+static int ldpaa_eth_bind(struct udevice *dev)
+{
+       const char *phy_mode_str = NULL;
+       uint32_t dpmac_id;
+       char eth_name[16];
+       int phy_mode = -1;
+
+       phy_mode_str = ldpaa_eth_get_phy_mode_str(dev);
+       if (phy_mode_str)
+               phy_mode = phy_get_interface_by_name(phy_mode_str);
+       if (phy_mode == -1) {
+               dev_err(dev, "incorrect phy mode\n");
+               return -EINVAL;
+       }
+
+       dpmac_id = ldpaa_eth_get_dpmac_id(dev);
+       if (dpmac_id == -1) {
+               dev_err(dev, "missing reg field from the dpmac node\n");
+               return -EINVAL;
+       }
+
+       sprintf(eth_name, "DPMAC%d@%s", dpmac_id, phy_mode_str);
+       device_set_name(dev, eth_name);
+
+       return 0;
+}
+
+static int ldpaa_eth_ofdata_to_platdata(struct udevice *dev)
+{
+       struct ldpaa_eth_priv *priv = dev_get_priv(dev);
+       const char *phy_mode_str;
+
+       priv->dpmac_id = ldpaa_eth_get_dpmac_id(dev);
+       phy_mode_str = ldpaa_eth_get_phy_mode_str(dev);
+       priv->phy_mode = phy_get_interface_by_name(phy_mode_str);
+
+       return 0;
+}
+
+static const struct eth_ops ldpaa_eth_ops = {
+       .start  = ldpaa_eth_open,
+       .send   = ldpaa_eth_tx,
+       .recv   = ldpaa_eth_pull_dequeue_rx,
+       .stop   = ldpaa_eth_stop,
+};
+
+static const struct udevice_id ldpaa_eth_of_ids[] = {
+       { .compatible = "fsl,qoriq-mc-dpmac" },
+};
+
+U_BOOT_DRIVER(ldpaa_eth) = {
+       .name = "ldpaa_eth",
+       .id = UCLASS_ETH,
+       .of_match = ldpaa_eth_of_ids,
+       .ofdata_to_platdata = ldpaa_eth_ofdata_to_platdata,
+       .bind = ldpaa_eth_bind,
+       .probe = ldpaa_eth_probe,
+       .ops = &ldpaa_eth_ops,
+       .priv_auto_alloc_size = sizeof(struct ldpaa_eth_priv),
+       .platdata_auto_alloc_size = sizeof(struct eth_pdata),
+};
+
+#else
+
 static int ldpaa_eth_netdev_init(struct eth_device *net_dev,
                                 phy_interface_t enet_if)
 {
@@ -1099,3 +1266,4 @@ err_netdev_init:
 
        return err;
 }
+#endif
index 3f9154b5bbcdf674cb81eed3dc456da47d20155c..e90513e56f9a76fbbaeb822876fbdd39ba9dbeef 100644 (file)
@@ -116,7 +116,13 @@ struct ldpaa_fas {
                                         LDPAA_ETH_FAS_TIDE)
 
 struct ldpaa_eth_priv {
+#ifdef CONFIG_DM_ETH
+       struct phy_device *phy;
+       int phy_mode;
+       bool started;
+#else
        struct eth_device *net_dev;
+#endif
        uint32_t dpmac_id;
        uint16_t dpmac_handle;
 
index d2e10d6868ab278469c32d049d0e1662ed4718e8..7f46e901fb236d6309403bfd447655ca1224f7f0 100644 (file)
@@ -1009,7 +1009,7 @@ static int pci_uclass_post_probe(struct udevice *bus)
        if (ret)
                return ret;
 
-       if (CONFIG_IS_ENABLED(PCI_PNP) &&
+       if (CONFIG_IS_ENABLED(PCI_PNP) && ll_boot_init() &&
            (!hose->skip_auto_config_until_reloc ||
             (gd->flags & GD_FLG_RELOC))) {
                ret = pci_auto_config_devices(bus);
@@ -1031,7 +1031,7 @@ static int pci_uclass_post_probe(struct udevice *bus)
         * Note we only call this 1) after U-Boot is relocated, and 2)
         * root bus has finished probing.
         */
-       if ((gd->flags & GD_FLG_RELOC) && (bus->seq == 0)) {
+       if ((gd->flags & GD_FLG_RELOC) && bus->seq == 0 && ll_boot_init()) {
                ret = fsp_init_phase_pci();
                if (ret)
                        return ret;
index 194be9aa589bb3d66821ccbd0f14f98fb96a24da..3681c5c8ed91039de7fb4a708e026376d39ec9d9 100644 (file)
@@ -23,6 +23,8 @@
 
 #if !defined(__ACPI__)
 
+struct acpi_ctx;
+
 /*
  * RSDP (Root System Description Pointer)
  * Note: ACPI 1.0 didn't have length, xsdt_address, and ext_checksum
@@ -505,6 +507,69 @@ int acpi_get_table_revision(enum acpi_tables table);
  */
 int acpi_create_dmar(struct acpi_dmar *dmar, enum dmar_flags flags);
 
+/**
+ * acpi_fill_header() - Set up a new table header
+ *
+ * This sets all fields except length, revision, checksum and aslc_revision
+ *
+ * @header: ACPI header to update
+ * @signature: Table signature to use (4 characters)
+ */
+void acpi_fill_header(struct acpi_table_header *header, char *signature);
+
+/**
+ * acpi_align() - Align the ACPI output pointer to a 16-byte boundary
+ *
+ * @ctx: ACPI context
+ */
+void acpi_align(struct acpi_ctx *ctx);
+
+/**
+ * acpi_align64() - Align the ACPI output pointer to a 64-byte boundary
+ *
+ * @ctx: ACPI context
+ */
+void acpi_align64(struct acpi_ctx *ctx);
+
+/**
+ * acpi_inc() - Increment the ACPI output pointer by a bit
+ *
+ * The pointer is NOT aligned afterwards.
+ *
+ * @ctx: ACPI context
+ * @amount: Amount to increment by
+ */
+void acpi_inc(struct acpi_ctx *ctx, uint amount);
+
+/**
+ * acpi_inc_align() - Increment the ACPI output pointer by a bit and align
+ *
+ * The pointer is aligned afterwards to a 16-byte boundary
+ *
+ * @ctx: ACPI context
+ * @amount: Amount to increment by
+ */
+void acpi_inc_align(struct acpi_ctx *ctx, uint amount);
+
+/**
+ * acpi_add_table() - Add a new table to the RSDP and XSDT
+ *
+ * @ctx: ACPI context
+ * @table: Table to add
+ * @return 0 if OK, -E2BIG if too many tables
+ */
+int acpi_add_table(struct acpi_ctx *ctx, void *table);
+
+/**
+ * acpi_setup_base_tables() - Set up context along with RSDP, RSDT and XSDT
+ *
+ * Set up the context with the given start position. Some basic tables are
+ * always needed, so set them up as well.
+ *
+ * @ctx: Context to set up
+ */
+void acpi_setup_base_tables(struct acpi_ctx *ctx, void *start);
+
 #endif /* !__ACPI__*/
 
 #include <asm/acpi_table.h>
index d9e220cfe3582eaf2bca571495cb7dd3ac0d13ba..8c78792cc98bf4d27f5668981857cf8d68fca3e4 100644 (file)
@@ -166,5 +166,6 @@ typedef struct global_data {
 #define GD_FLG_SPL_EARLY_INIT  0x04000 /* Early SPL init is done          */
 #define GD_FLG_LOG_READY       0x08000 /* Log system is ready for use     */
 #define GD_FLG_WDT_READY       0x10000 /* Watchdog is ready for use       */
+#define GD_FLG_SKIP_LL_INIT    0x20000 /* Don't perform low-level init    */
 
 #endif /* __ASM_GENERIC_GBL_DATA_H */
index f3bc8ca24afe573405ec39d428649898c476ad3b..d915f9426d8201ea1ca9989dc267b676352bf378 100644 (file)
@@ -135,7 +135,7 @@ void file_cbfs_get_next(const struct cbfs_cachenode **file);
  */
 const struct cbfs_cachenode *file_cbfs_find(const char *name);
 
-struct cbfs_priv *priv;
+struct cbfs_priv;
 
 /**
  * cbfs_find_file() - Find a file in a given CBFS
index 6143e9731e508901329cd6a9278d906b0eabc179..4d4c1a04f2942704cac559624b9a999803b6804c 100644 (file)
@@ -33,7 +33,8 @@
 #undef BOOT_TARGET_DEVICES
 #define BOOT_TARGET_DEVICES(func) \
        func(MMC, mmc, 0) \
-       func(USB, usb, 0)
+       func(USB, usb, 0) \
+       func(DHCP, dhcp, na)
 #endif
 
 #undef FSL_QSPI_FLASH_SIZE
                        "env exists secureboot "        \
                        "&& esbc_validate ${scripthdraddr};"    \
                "source ${scriptaddr}\0"          \
-       "installer=load mmc 0:2 $load_addr "    \
-                  "/flex_installer_arm64.itb; "        \
-                  "bootm $load_addr#$BOARD\0"  \
-       "qspi_bootcmd=pfe stop; echo Trying load from qspi..;"  \
-               "sf probe && sf read $load_addr "       \
-               "$kernel_addr $kernel_size; env exists secureboot "     \
-               "&& sf read $kernelheader_addr_r $kernelheader_addr "   \
-               "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \
-               "bootm $load_addr#$BOARD\0"     \
        "sd_bootcmd=pfe stop; echo Trying load from sd card..;"         \
                "mmcinfo; mmc read $load_addr "                 \
                "$kernel_addr_sd $kernel_size_sd ;"             \
index a6289850ca1a1abbc50da03571ca3c5667fa9897..45ce460dca2a2d7a10d289a213d805b8fce06e3e 100644 (file)
 
 #ifdef CONFIG_LPUART
 #define CONFIG_EXTRA_ENV_SETTINGS       \
-       "bootargs=root=/dev/ram0 rw console=ttyLP0,115200 $othbootargs\0" \
+       "bootargs=root=/dev/ram0 rw console=ttyLP0,115200 "     \
+               "cma=64M@0x0-0xb0000000\0" \
        "initrd_high=0xffffffff\0"      \
        "fdt_addr=0x64f00000\0"         \
        "kernel_addr=0x65000000\0"      \
                "$kernel_size && bootm $load_addr#$board\0"
 #else
 #define CONFIG_EXTRA_ENV_SETTINGS      \
-       "bootargs=root=/dev/ram0 rw console=ttyS0,115200 $othbootargs\0" \
+       "bootargs=root=/dev/ram0 rw console=ttyS0,115200 "      \
+               "cma=64M@0x0-0xb0000000\0" \
        "initrd_high=0xffffffff\0"      \
        "fdt_addr=0x64f00000\0"         \
        "kernel_addr=0x61000000\0"      \
index 818b994b907cd36d46d6de117538fda08a7d92be..b91016987b2145f99c697b8bb644384293c0a8a4 100644 (file)
 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
 #endif
 
+/* LPUART */
+#ifdef CONFIG_LPUART
+#define CONFIG_LPUART_32B_REG
+#define CFG_LPUART_MUX_MASK    0xf0
+#define CFG_LPUART_EN          0xf0
+#endif
+
 /* SATA */
 #define CONFIG_SCSI_AHCI_PLAT
 
index e80c2996ef9647e21e2dad0a4fd06eb57d68047f..24db23b3c37b3ad936ccebd400c504536f63f7bb 100644 (file)
 #define LS1046A_BOOT_SRC_AND_HDR\
        "boot_scripts=ls1046afrwy_boot.scr\0"   \
        "boot_script_hdr=hdr_ls1046afrwy_bs.out\0"
+#elif defined(CONFIG_TARGET_LS1046AQDS)
+#define LS1046A_BOOT_SRC_AND_HDR\
+       "boot_scripts=ls1046aqds_boot.scr\0"    \
+       "boot_script_hdr=hdr_ls1046aqds_bs.out\0"
 #else
 #define LS1046A_BOOT_SRC_AND_HDR\
        "boot_scripts=ls1046ardb_boot.scr\0"    \
        "ramdisk_size=0x2000000\0"              \
        "bootm_size=0x10000000\0"               \
        "fdt_addr=0x64f00000\0"                 \
-       "kernel_addr=0x65000000\0"              \
+       "kernel_addr=0x61000000\0"              \
        "scriptaddr=0x80000000\0"               \
        "scripthdraddr=0x80080000\0"            \
        "fdtheader_addr_r=0x80100000\0"         \
                "&& sf read $kernelheader_addr_r $kernelheader_start "  \
                "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \
                "bootm $load_addr#$board\0"             \
+       "nand_bootcmd=echo Trying load from nand..;"      \
+               "nand info; nand read $load_addr "         \
+               "$kernel_start $kernel_size; env exists secureboot "    \
+               "&& nand read $kernelheader_addr_r $kernelheader_start " \
+               "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \
+               "bootm $load_addr#$board\0"             \
+       "nor_bootcmd=echo Trying load from nor..;"      \
+               "cp.b $kernel_addr $load_addr "         \
+               "$kernel_size; env exists secureboot "  \
+               "&& cp.b $kernelheader_addr $kernelheader_addr_r "      \
+               "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \
+               "bootm $load_addr#$board\0"     \
        "sd_bootcmd=echo Trying load from SD ..;"       \
                "mmcinfo; mmc read $load_addr "         \
                "$kernel_addr_sd $kernel_size_sd && "   \
index 2a46c98195566d2b265eb078f43229329730ef5b..9ff248cefad1cb1b3353690ecf968220e4e1bd90 100644 (file)
@@ -437,19 +437,27 @@ unsigned long get_board_ddr_clk(void);
 
 #undef CONFIG_BOOTCOMMAND
 #ifdef CONFIG_TFABOOT
-#define QSPI_NOR_BOOTCOMMAND           "sf probe && sf read $kernel_load "    \
-                                       "e0000 f00000 && bootm $kernel_load"
-#define IFC_NOR_BOOTCOMMAND            "cp.b $kernel_start $kernel_load "     \
-                                       "$kernel_size && bootm $kernel_load"
-#define SD_BOOTCOMMAND         "mmc info; mmc read $kernel_load"     \
-                                       "$kernel_addr_sd $kernel_size_sd && bootm $kernel_load"
+#define IFC_NAND_BOOTCOMMAND "run distro_bootcmd; run nand_bootcmd; "  \
+                          "env exists secureboot && esbc_halt;;"
+#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd; run nor_bootcmd"     \
+                          "env exists secureboot && esbc_halt;;"
+#define IFC_NOR_BOOTCOMMAND "run distro_bootcmd; run nor_bootcmd; "    \
+                          "env exists secureboot && esbc_halt;;"
+#define SD_BOOTCOMMAND "run distro_bootcmd; run sd_bootcmd; "  \
+                          "env exists secureboot && esbc_halt;;"
 #else
-#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
-#define CONFIG_BOOTCOMMAND             "sf probe && sf read $kernel_load "    \
-                                       "e0000 f00000 && bootm $kernel_load"
+#if defined(CONFIG_QSPI_BOOT)
+#define CONFIG_BOOTCOMMAND "run distro_bootcmd; run nor_bootcmd; "     \
+                          "env exists secureboot && esbc_halt;;"
+#elif defined(CONFIG_NAND_BOOT)
+#define CONFIG_BOOTCOMMAND "run distro_bootcmd; run nand_bootcmd; "    \
+                          "env exists secureboot && esbc_halt;;"
+#elif defined(CONFIG_SD_BOOT)
+#define CONFIG_BOOTCOMMAND "run distro_bootcmd; run sd_bootcmd; "      \
+                          "env exists secureboot && esbc_halt;;"
 #else
-#define CONFIG_BOOTCOMMAND             "cp.b $kernel_start $kernel_load "     \
-                                       "$kernel_size && bootm $kernel_load"
+#define CONFIG_BOOTCOMMAND "run distro_bootcmd; run nor_bootcmd; "     \
+                          "env exists secureboot && esbc_halt;;"
 #endif
 #endif
 
index d47abf6e65799ddd32fcfb90ee58fe75974b7e45..5ab924457efb75aa6653b02cf2ffb80ba67760cc 100644 (file)
@@ -207,6 +207,16 @@ unsigned long get_board_ddr_clk(void);
        "esbc_validate 0x80680000 ;"            \
        "fsl_mc start mc 0x80a00000 0x80e00000\0"
 
+#define SD2_MC_INIT_CMD                                \
+       "mmc dev 1; mmc read 0x80a00000 0x5000 0x1200;" \
+       "mmc read 0x80e00000 0x7000 0x800;"     \
+       "env exists secureboot && "             \
+       "mmc read 0x80640000 0x3200 0x20 && "   \
+       "mmc read 0x80680000 0x3400 0x20 && "   \
+       "esbc_validate 0x80640000 && "          \
+       "esbc_validate 0x80680000 ;"            \
+       "fsl_mc start mc 0x80a00000 0x80e00000\0"
+
 #define EXTRA_ENV_SETTINGS                     \
        "hwconfig=fsl_ddr:bank_intlv=auto\0"    \
        "ramdisk_addr=0x800000\0"               \
@@ -274,11 +284,11 @@ unsigned long get_board_ddr_clk(void);
                "env exists secureboot && esbc_halt;"
 
 #define SD2_BOOTCOMMAND                                                \
-               "env exists mcinitcmd && mmcinfo; "             \
+               "mmc dev 1; env exists mcinitcmd && mmcinfo; "  \
                "mmc read 0x80d00000 0x6800 0x800; "            \
                "env exists mcinitcmd && env exists secureboot "        \
-               " && mmc read 0x80780000 0x3C00 0x20 "          \
-               "&& esbc_validate 0x80780000;env exists mcinitcmd "     \
+               " && mmc read 0x806C0000 0x3600 0x20 "          \
+               "&& esbc_validate 0x806C0000;env exists mcinitcmd "     \
                "&& fsl_mc lazyapply dpl 0x80d00000;"           \
                "run distro_bootcmd;run sd2_bootcmd;"           \
                "env exists secureboot && esbc_halt;"
index dec5001b5fe460852b1aaaa3adbb572a7bb85a2d..0c259a181f1080eb084642684b7539e74ebfc076 100644 (file)
 #define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
        "bootcmd_xspi0=sf probe 0 0 0 && " \
        "sf read $scriptaddr $script_offset_f $script_size_f && " \
-       "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0"
+       "echo XSPI: Trying to boot script at ${scriptaddr} && " \
+       "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
 
 #define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
        "xspi "
 #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
 
 #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
-       "bootcmd_jtag=source $scriptaddr; echo SCRIPT FAILED: continuing...;\0"
+       "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
+               "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
 
 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
        "jtag "
 
 #define BOOTENV_DEV_DFU_USB(devtypeu, devtypel, instance) \
        "bootcmd_dfu_usb=setenv dfu_alt_info boot.scr ram $scriptaddr " \
-       "$script_size_f; dfu 0 ram 0 && source $scriptaddr; " \
-       "echo SCRIPT FAILED: continuing...;\0"
+       "$script_size_f; dfu 0 ram 0 && " \
+       "echo DFU: Trying to boot script at ${scriptaddr} && " \
+       "source ${scriptaddr}; " \
+       "echo DFU: SCRIPT FAILED: continuing...;\0"
 
 #define BOOTENV_DEV_NAME_DFU_USB(devtypeu, devtypel, instance) \
        "dfu_usb "
index 010738363d13eb3f25c4662ba72d5efecc5b7d94..eddc2b4020068f0d9e1553b0d9962cfa2e6a8fbe 100644 (file)
 #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
        "bootcmd_" #devtypel #instance "=sf probe " #instance " 0 0 && " \
                       "sf read $scriptaddr $script_offset_f $script_size_f && " \
-                      "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0"
+                      "echo QSPI: Trying to boot script at ${scriptaddr} && " \
+                      "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0"
 
 #define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
        #devtypel #instance " "
 #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
        "bootcmd_" #devtypel #instance "= nand info && " \
                       "nand read $scriptaddr $script_offset_f $script_size_f && " \
-                      "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0"
+                      "echo NAND: Trying to boot script at ${scriptaddr} && " \
+                      "source ${scriptaddr}; echo NAND: SCRIPT FAILED: continuing...;\0"
 
 #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
        #devtypel #instance " "
 #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
 
 #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
-       "bootcmd_jtag=source $scriptaddr; echo SCRIPT FAILED: continuing...;\0"
+       "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
+               "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
 
 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
        "jtag "
index 1eaf65b0a2a105ef8a63dc227365946395e6099c..a93172b02cd6692315fc9349dd54965a6422cdab 100644 (file)
 #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
        "bootcmd_qspi=sf probe 0 0 0 && " \
                      "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \
-                     "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0"
+                     "echo QSPI: Trying to boot script at ${scriptaddr} && " \
+                     "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0"
 
 #define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
        "qspi "
 #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
        "bootcmd_nand=nand info && " \
                      "nand read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \
-                     "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0"
+                     "echo NAND: Trying to boot script at ${scriptaddr} && " \
+                     "source ${scriptaddr}; echo NAND: SCRIPT FAILED: continuing...;\0"
 
 #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
        "nand "
 #define BOOTENV_DEV_NOR(devtypeu, devtypel, instance) \
        "script_offset_nor=0xE2FC0000\0"        \
        "bootcmd_nor=cp.b ${script_offset_nor} ${scriptaddr} ${script_size_f} && " \
-                    "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0"
+                    "echo NOR: Trying to boot script at ${scriptaddr} && " \
+                    "source ${scriptaddr}; echo NOR: SCRIPT FAILED: continuing...;\0"
 
 #define BOOTENV_DEV_NAME_NOR(devtypeu, devtypel, instance) \
        "nor "
 #define BOOT_TARGET_DEVICES_JTAG(func)  func(JTAG, jtag, na)
 
 #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
-       "bootcmd_jtag=source $scriptaddr; echo SCRIPT FAILED: continuing...;\0"
+       "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
+               "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
 
 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
        "jtag "
 #ifndef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS      \
        "fdt_high=0x20000000\0"         \
-       "initrd_high=0x20000000\0"      \
        "scriptaddr=0x20000\0"  \
        "script_size_f=0x40000\0"       \
        "fdt_addr_r=0x1f00000\0"        \
index 49257914ffdfd6504d75c7271f7fc2ea37de8556..7563a4c60a72d0852dac168ae134d52cc172eaa2 100644 (file)
 
 #if !defined(__ACPI__)
 
+/**
+ * struct acpi_ctx - Context used for writing ACPI tables
+ *
+ * This contains a few useful pieces of information used when writing
+ *
+ * @current: Current address for writing
+ * @rsdp: Pointer to the Root System Description Pointer, typically used when
+ *     adding a new table. The RSDP holds pointers to the RSDT and XSDT.
+ * @rsdt: Pointer to the Root System Description Table
+ * @xsdt: Pointer to the Extended System Description Table
+ */
+struct acpi_ctx {
+       void *current;
+       struct acpi_rsdp *rsdp;
+       struct acpi_rsdt *rsdt;
+       struct acpi_xsdt *xsdt;
+};
+
 /**
  * struct acpi_ops - ACPI operations supported by driver model
  */
@@ -38,6 +56,15 @@ struct acpi_ops {
         *      other error
         */
        int (*get_name)(const struct udevice *dev, char *out_name);
+
+       /**
+        * write_tables() - Write out any tables required by this device
+        *
+        * @dev: Device to write
+        * @ctx: ACPI context to use
+        * @return 0 if OK, -ve on error
+        */
+       int (*write_tables)(const struct udevice *dev, struct acpi_ctx *ctx);
 };
 
 #define device_get_acpi_ops(dev)       ((dev)->driver->acpi_ops)
@@ -72,6 +99,16 @@ int acpi_get_name(const struct udevice *dev, char *out_name);
  */
 int acpi_copy_name(char *out_name, const char *name);
 
+/**
+ * acpi_write_dev_tables() - Write ACPI tables required by devices
+ *
+ * This scans through all devices and tells them to write any tables they want
+ * to write.
+ *
+ * @return 0 if OK, -ve if any device returned an error
+ */
+int acpi_write_dev_tables(struct acpi_ctx *ctx);
+
 #endif /* __ACPI__ */
 
 #endif
index b87346ce7ca1a401fb03b79236c059c0b836bf68..8857d50910e7672d5d146ae603f6d3eb7275757a 100644 (file)
@@ -53,6 +53,7 @@ int memac_mdio_write(struct mii_dev *bus, int port_addr, int dev_addr,
                int regnum, u16 value);
 int memac_mdio_read(struct mii_dev *bus, int port_addr, int dev_addr,
                int regnum);
+int memac_mdio_reset(struct mii_dev *bus);
 
 struct fsl_pq_mdio_info {
        struct tsec_mii_mng __iomem *regs;
index 9ef88c966bef025992e6265ce9feccd7c467a671..b5a167b6edb0194a08b1de235d3f970a5bb4e013 100644 (file)
@@ -20,7 +20,7 @@ struct global_data;
 #ifdef CONFIG_EFI_STUB
 #define ll_boot_init() false
 #else
-#define ll_boot_init() true
+#define ll_boot_init() (!(gd->flags & GD_FLG_SKIP_LL_INIT))
 #endif
 
 /*
index aa4378fd5797cf6db4ca129ab3a14283082008fb..0ef8c2ed62d815d5edde433d81e38525705d393a 100644 (file)
 #define SDHCI_QUIRK_BROKEN_HISPD_MODE  BIT(5)
 #define SDHCI_QUIRK_WAIT_SEND_CMD      (1 << 6)
 #define SDHCI_QUIRK_USE_WIDE8          (1 << 8)
-#define SDHCI_QUIRK_NO_1_8_V           (1 << 9)
 
 /* to make gcc happy */
 struct sdhci_host;
index 4633dcb948883eb8c24e6c7430ed340984b5c834..1c253af3bfd122ac448bc0daacb18701140db5e8 100644 (file)
@@ -6,12 +6,14 @@
  */
 
 #include <common.h>
-#include <acpi/acpi_table.h>
 #include <dm.h>
 #include <cpu.h>
+#include <mapmem.h>
+#include <tables_csum.h>
+#include <version.h>
+#include <acpi/acpi_table.h>
+#include <dm/acpi.h>
 
-/* Temporary change to ensure bisectability */
-#ifndef CONFIG_SANDBOX
 int acpi_create_dmar(struct acpi_dmar *dmar, enum dmar_flags flags)
 {
        struct acpi_table_header *header = &dmar->header;
@@ -37,7 +39,6 @@ int acpi_create_dmar(struct acpi_dmar *dmar, enum dmar_flags flags)
 
        return 0;
 }
-#endif
 
 int acpi_get_table_revision(enum acpi_tables table)
 {
@@ -91,3 +92,173 @@ int acpi_get_table_revision(enum acpi_tables table)
                return -EINVAL;
        }
 }
+
+void acpi_fill_header(struct acpi_table_header *header, char *signature)
+{
+       memcpy(header->signature, signature, 4);
+       memcpy(header->oem_id, OEM_ID, 6);
+       memcpy(header->oem_table_id, OEM_TABLE_ID, 8);
+       header->oem_revision = U_BOOT_BUILD_DATE;
+       memcpy(header->aslc_id, ASLC_ID, 4);
+}
+
+void acpi_align(struct acpi_ctx *ctx)
+{
+       ctx->current = (void *)ALIGN((ulong)ctx->current, 16);
+}
+
+void acpi_align64(struct acpi_ctx *ctx)
+{
+       ctx->current = (void *)ALIGN((ulong)ctx->current, 64);
+}
+
+void acpi_inc(struct acpi_ctx *ctx, uint amount)
+{
+       ctx->current += amount;
+}
+
+void acpi_inc_align(struct acpi_ctx *ctx, uint amount)
+{
+       ctx->current += amount;
+       acpi_align(ctx);
+}
+
+/**
+ * Add an ACPI table to the RSDT (and XSDT) structure, recalculate length
+ * and checksum.
+ */
+int acpi_add_table(struct acpi_ctx *ctx, void *table)
+{
+       int i, entries_num;
+       struct acpi_rsdt *rsdt;
+       struct acpi_xsdt *xsdt;
+
+       /* The RSDT is mandatory while the XSDT is not */
+       rsdt = ctx->rsdt;
+
+       /* This should always be MAX_ACPI_TABLES */
+       entries_num = ARRAY_SIZE(rsdt->entry);
+
+       for (i = 0; i < entries_num; i++) {
+               if (rsdt->entry[i] == 0)
+                       break;
+       }
+
+       if (i >= entries_num) {
+               log_err("ACPI: Error: too many tables\n");
+               return -E2BIG;
+       }
+
+       /* Add table to the RSDT */
+       rsdt->entry[i] = map_to_sysmem(table);
+
+       /* Fix RSDT length or the kernel will assume invalid entries */
+       rsdt->header.length = sizeof(struct acpi_table_header) +
+                               (sizeof(u32) * (i + 1));
+
+       /* Re-calculate checksum */
+       rsdt->header.checksum = 0;
+       rsdt->header.checksum = table_compute_checksum((u8 *)rsdt,
+                                                      rsdt->header.length);
+
+       /*
+        * And now the same thing for the XSDT. We use the same index as for
+        * now we want the XSDT and RSDT to always be in sync in U-Boot
+        */
+       xsdt = ctx->xsdt;
+
+       /* Add table to the XSDT */
+       xsdt->entry[i] = map_to_sysmem(table);
+
+       /* Fix XSDT length */
+       xsdt->header.length = sizeof(struct acpi_table_header) +
+                               (sizeof(u64) * (i + 1));
+
+       /* Re-calculate checksum */
+       xsdt->header.checksum = 0;
+       xsdt->header.checksum = table_compute_checksum((u8 *)xsdt,
+                                                      xsdt->header.length);
+
+       return 0;
+}
+
+static void acpi_write_rsdp(struct acpi_rsdp *rsdp, struct acpi_rsdt *rsdt,
+                           struct acpi_xsdt *xsdt)
+{
+       memset(rsdp, 0, sizeof(struct acpi_rsdp));
+
+       memcpy(rsdp->signature, RSDP_SIG, 8);
+       memcpy(rsdp->oem_id, OEM_ID, 6);
+
+       rsdp->length = sizeof(struct acpi_rsdp);
+       rsdp->rsdt_address = map_to_sysmem(rsdt);
+
+       rsdp->xsdt_address = map_to_sysmem(xsdt);
+       rsdp->revision = ACPI_RSDP_REV_ACPI_2_0;
+
+       /* Calculate checksums */
+       rsdp->checksum = table_compute_checksum(rsdp, 20);
+       rsdp->ext_checksum = table_compute_checksum(rsdp,
+                                                   sizeof(struct acpi_rsdp));
+}
+
+static void acpi_write_rsdt(struct acpi_rsdt *rsdt)
+{
+       struct acpi_table_header *header = &rsdt->header;
+
+       /* Fill out header fields */
+       acpi_fill_header(header, "RSDT");
+       header->length = sizeof(struct acpi_rsdt);
+       header->revision = 1;
+
+       /* Entries are filled in later, we come with an empty set */
+
+       /* Fix checksum */
+       header->checksum = table_compute_checksum(rsdt,
+                                                 sizeof(struct acpi_rsdt));
+}
+
+static void acpi_write_xsdt(struct acpi_xsdt *xsdt)
+{
+       struct acpi_table_header *header = &xsdt->header;
+
+       /* Fill out header fields */
+       acpi_fill_header(header, "XSDT");
+       header->length = sizeof(struct acpi_xsdt);
+       header->revision = 1;
+
+       /* Entries are filled in later, we come with an empty set */
+
+       /* Fix checksum */
+       header->checksum = table_compute_checksum(xsdt,
+                                                 sizeof(struct acpi_xsdt));
+}
+
+void acpi_setup_base_tables(struct acpi_ctx *ctx, void *start)
+{
+       ctx->current = start;
+
+       /* Align ACPI tables to 16 byte */
+       acpi_align(ctx);
+       gd->arch.acpi_start = map_to_sysmem(ctx->current);
+
+       /* We need at least an RSDP and an RSDT Table */
+       ctx->rsdp = ctx->current;
+       acpi_inc_align(ctx, sizeof(struct acpi_rsdp));
+       ctx->rsdt = ctx->current;
+       acpi_inc_align(ctx, sizeof(struct acpi_rsdt));
+       ctx->xsdt = ctx->current;
+       acpi_inc_align(ctx, sizeof(struct acpi_xsdt));
+
+       /* clear all table memory */
+       memset((void *)start, '\0', ctx->current - start);
+
+       acpi_write_rsdp(ctx->rsdp, ctx->rsdt, ctx->xsdt);
+       acpi_write_rsdt(ctx->rsdt);
+       acpi_write_xsdt(ctx->xsdt);
+       /*
+        * Per ACPI spec, the FACS table address must be aligned to a 64 byte
+        * boundary (Windows checks this, but Linux does not).
+        */
+       acpi_align64(ctx);
+}
index e7b8abd55690ee9d79710758b85592ff83c60698..176d207a5544da01843ccb3dc615aa52f248671f 100644 (file)
@@ -7,13 +7,36 @@
  */
 
 #include <common.h>
+#include <console.h>
 #include <dm.h>
+#include <malloc.h>
+#include <mapmem.h>
+#include <version.h>
+#include <tables_csum.h>
+#include <version.h>
 #include <acpi/acpi_table.h>
 #include <dm/acpi.h>
 #include <dm/test.h>
 #include <test/ut.h>
 
 #define ACPI_TEST_DEV_NAME     "ABCD"
+#define BUF_SIZE               4096
+
+static int testacpi_write_tables(const struct udevice *dev,
+                                struct acpi_ctx *ctx)
+{
+       struct acpi_dmar *dmar;
+       int ret;
+
+       dmar = (struct acpi_dmar *)ctx->current;
+       acpi_create_dmar(dmar, DMAR_INTR_REMAP);
+       ctx->current += sizeof(struct acpi_dmar);
+       ret = acpi_add_table(ctx, dmar);
+       if (ret)
+               return log_msg_ret("add", ret);
+
+       return 0;
+}
 
 static int testacpi_get_name(const struct udevice *dev, char *out_name)
 {
@@ -22,6 +45,7 @@ static int testacpi_get_name(const struct udevice *dev, char *out_name)
 
 struct acpi_ops testacpi_ops = {
        .get_name       = testacpi_get_name,
+       .write_tables   = testacpi_write_tables,
 };
 
 static const struct udevice_id testacpi_ids[] = {
@@ -68,8 +92,6 @@ static int dm_test_acpi_get_table_revision(struct unit_test_state *uts)
 DM_TEST(dm_test_acpi_get_table_revision,
        DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
 
-/* Temporary change to ensure bisectability */
-#ifndef CONFIG_SANDBOX
 /* Test acpi_create_dmar() */
 static int dm_test_acpi_create_dmar(struct unit_test_state *uts)
 {
@@ -82,4 +104,214 @@ static int dm_test_acpi_create_dmar(struct unit_test_state *uts)
        return 0;
 }
 DM_TEST(dm_test_acpi_create_dmar, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
-#endif
+
+/* Test acpi_fill_header() */
+static int dm_test_acpi_fill_header(struct unit_test_state *uts)
+{
+       struct acpi_table_header hdr;
+
+       /* Make sure these 5 fields are not changed */
+       hdr.length = 0x11;
+       hdr.revision = 0x22;
+       hdr.checksum = 0x33;
+       hdr.aslc_revision = 0x44;
+       acpi_fill_header(&hdr, "ABCD");
+
+       ut_asserteq_mem("ABCD", hdr.signature, sizeof(hdr.signature));
+       ut_asserteq(0x11, hdr.length);
+       ut_asserteq(0x22, hdr.revision);
+       ut_asserteq(0x33, hdr.checksum);
+       ut_asserteq_mem(OEM_ID, hdr.oem_id, sizeof(hdr.oem_id));
+       ut_asserteq_mem(OEM_TABLE_ID, hdr.oem_table_id,
+                       sizeof(hdr.oem_table_id));
+       ut_asserteq(U_BOOT_BUILD_DATE, hdr.oem_revision);
+       ut_asserteq_mem(ASLC_ID, hdr.aslc_id, sizeof(hdr.aslc_id));
+       ut_asserteq(0x44, hdr.aslc_revision);
+
+       return 0;
+}
+DM_TEST(dm_test_acpi_fill_header, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* Test ACPI write_tables() */
+static int dm_test_acpi_write_tables(struct unit_test_state *uts)
+{
+       struct acpi_dmar *dmar;
+       struct acpi_ctx ctx;
+       void *buf;
+
+       buf = malloc(BUF_SIZE);
+       ut_assertnonnull(buf);
+
+       acpi_setup_base_tables(&ctx, buf);
+       dmar = ctx.current;
+       ut_assertok(acpi_write_dev_tables(&ctx));
+
+       /*
+        * We should have two dmar tables, one for each "denx,u-boot-acpi-test"
+        * device
+        */
+       ut_asserteq_ptr(dmar + 2, ctx.current);
+       ut_asserteq(DMAR_INTR_REMAP, dmar->flags);
+       ut_asserteq(32 - 1, dmar->host_address_width);
+
+       ut_asserteq(DMAR_INTR_REMAP, dmar[1].flags);
+       ut_asserteq(32 - 1, dmar[1].host_address_width);
+
+       /* Check that the pointers were added correctly */
+       ut_asserteq(map_to_sysmem(dmar), ctx.rsdt->entry[0]);
+       ut_asserteq(map_to_sysmem(dmar + 1), ctx.rsdt->entry[1]);
+       ut_asserteq(0, ctx.rsdt->entry[2]);
+
+       ut_asserteq(map_to_sysmem(dmar), ctx.xsdt->entry[0]);
+       ut_asserteq(map_to_sysmem(dmar + 1), ctx.xsdt->entry[1]);
+       ut_asserteq(0, ctx.xsdt->entry[2]);
+
+       return 0;
+}
+DM_TEST(dm_test_acpi_write_tables, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* Test basic ACPI functions */
+static int dm_test_acpi_basic(struct unit_test_state *uts)
+{
+       struct acpi_ctx ctx;
+
+       /* Check align works */
+       ctx.current = (void *)5;
+       acpi_align(&ctx);
+       ut_asserteq_ptr((void *)16, ctx.current);
+
+       /* Check that align does nothing if already aligned */
+       acpi_align(&ctx);
+       ut_asserteq_ptr((void *)16, ctx.current);
+       acpi_align64(&ctx);
+       ut_asserteq_ptr((void *)64, ctx.current);
+       acpi_align64(&ctx);
+       ut_asserteq_ptr((void *)64, ctx.current);
+
+       /* Check incrementing */
+       acpi_inc(&ctx, 3);
+       ut_asserteq_ptr((void *)67, ctx.current);
+       acpi_inc_align(&ctx, 3);
+       ut_asserteq_ptr((void *)80, ctx.current);
+
+       return 0;
+}
+DM_TEST(dm_test_acpi_basic, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* Test acpi_setup_base_tables */
+static int dm_test_acpi_setup_base_tables(struct unit_test_state *uts)
+{
+       struct acpi_rsdp *rsdp;
+       struct acpi_rsdt *rsdt;
+       struct acpi_xsdt *xsdt;
+       struct acpi_ctx ctx;
+       void *buf, *end;
+
+       /*
+        * Use an unaligned address deliberately, by allocating an aligned
+        * address and then adding 4 to it
+        */
+       buf = memalign(64, BUF_SIZE);
+       ut_assertnonnull(buf);
+       acpi_setup_base_tables(&ctx, buf + 4);
+       ut_asserteq(map_to_sysmem(PTR_ALIGN(buf + 4, 16)), gd->arch.acpi_start);
+
+       rsdp = buf + 16;
+       ut_asserteq_ptr(rsdp, ctx.rsdp);
+       ut_assertok(memcmp(RSDP_SIG, rsdp->signature, sizeof(rsdp->signature)));
+       ut_asserteq(sizeof(*rsdp), rsdp->length);
+       ut_assertok(table_compute_checksum(rsdp, 20));
+       ut_assertok(table_compute_checksum(rsdp, sizeof(*rsdp)));
+
+       rsdt = PTR_ALIGN((void *)rsdp + sizeof(*rsdp), 16);
+       ut_asserteq_ptr(rsdt, ctx.rsdt);
+       ut_assertok(memcmp("RSDT", rsdt->header.signature, ACPI_NAME_LEN));
+       ut_asserteq(sizeof(*rsdt), rsdt->header.length);
+       ut_assertok(table_compute_checksum(rsdt, sizeof(*rsdt)));
+
+       xsdt = PTR_ALIGN((void *)rsdt + sizeof(*rsdt), 16);
+       ut_asserteq_ptr(xsdt, ctx.xsdt);
+       ut_assertok(memcmp("XSDT", xsdt->header.signature, ACPI_NAME_LEN));
+       ut_asserteq(sizeof(*xsdt), xsdt->header.length);
+       ut_assertok(table_compute_checksum(xsdt, sizeof(*xsdt)));
+
+       end = PTR_ALIGN((void *)xsdt + sizeof(*xsdt), 64);
+       ut_asserteq_ptr(end, ctx.current);
+
+       ut_asserteq(map_to_sysmem(rsdt), rsdp->rsdt_address);
+       ut_asserteq(map_to_sysmem(xsdt), rsdp->xsdt_address);
+
+       return 0;
+}
+DM_TEST(dm_test_acpi_setup_base_tables,
+       DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* Test 'acpi list' command */
+static int dm_test_acpi_cmd_list(struct unit_test_state *uts)
+{
+       struct acpi_ctx ctx;
+       ulong addr;
+       void *buf;
+
+       buf = memalign(16, BUF_SIZE);
+       ut_assertnonnull(buf);
+       acpi_setup_base_tables(&ctx, buf);
+
+       ut_assertok(acpi_write_dev_tables(&ctx));
+
+       console_record_reset();
+       run_command("acpi list", 0);
+       addr = (ulong)map_to_sysmem(buf);
+       ut_assert_nextline("ACPI tables start at %lx", addr);
+       ut_assert_nextline("RSDP %08lx %06lx (v02 U-BOOT)", addr,
+                          sizeof(struct acpi_rsdp));
+       addr = ALIGN(addr + sizeof(struct acpi_rsdp), 16);
+       ut_assert_nextline("RSDT %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+                          addr, sizeof(struct acpi_table_header) +
+                          2 * sizeof(u32), U_BOOT_BUILD_DATE);
+       addr = ALIGN(addr + sizeof(struct acpi_rsdt), 16);
+       ut_assert_nextline("XSDT %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+                          addr, sizeof(struct acpi_table_header) +
+                          2 * sizeof(u64), U_BOOT_BUILD_DATE);
+       addr = ALIGN(addr + sizeof(struct acpi_xsdt), 64);
+       ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+                          addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
+       addr = ALIGN(addr + sizeof(struct acpi_dmar), 16);
+       ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+                          addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
+       ut_assert_console_end();
+
+       return 0;
+}
+DM_TEST(dm_test_acpi_cmd_list, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* Test 'acpi dump' command */
+static int dm_test_acpi_cmd_dump(struct unit_test_state *uts)
+{
+       struct acpi_ctx ctx;
+       ulong addr;
+       void *buf;
+
+       buf = memalign(16, BUF_SIZE);
+       ut_assertnonnull(buf);
+       acpi_setup_base_tables(&ctx, buf);
+
+       ut_assertok(acpi_write_dev_tables(&ctx));
+
+       /* First search for a non-existent table */
+       console_record_reset();
+       run_command("acpi dump rdst", 0);
+       ut_assert_nextline("Table 'RDST' not found");
+       ut_assert_console_end();
+
+       /* Now a real table */
+       console_record_reset();
+       run_command("acpi dump dmar", 0);
+       addr = ALIGN(map_to_sysmem(ctx.xsdt) + sizeof(struct acpi_xsdt), 64);
+       ut_assert_nextline("DMAR @ %08lx", addr);
+       ut_assert_nextlines_are_dump(0x30);
+       ut_assert_console_end();
+
+       return 0;
+}
+DM_TEST(dm_test_acpi_cmd_dump, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);