2017.09 RC4, Add qemu arm target config, patches rebase

This commit is contained in:
Peter Robinson 2017-09-05 21:18:59 +01:00
parent 3ef111bdbb
commit 00dab5fcba
12 changed files with 1840 additions and 687 deletions

View File

@ -97,6 +97,7 @@ q8_a13_tablet
q8_a23_tablet_800x480
q8_a33_tablet_1024x600
q8_a33_tablet_800x480
qemu_arm
r7-tv-dongle
riotboard
rock

View File

@ -666,51 +666,6 @@ index 626dff8dcd..bbc9685e0e 100644
--
2.13.3
From 76fba480e6ee494e2e01c19bb8952f42a3b6a710 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Mon, 3 Jul 2017 09:15:44 -0400
Subject: [PATCH 12/23] usb: kbd: don't fail with iomux
stdin might not be set, which would cause iomux_doenv() to fail
therefore causing probe_usb_keyboard() to fail. Furthermore if we do
have iomux enabled, the sensible thing (in terms of user experience)
would be to simply add ourselves to the list of stdin devices.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
common/usb_kbd.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index d2d29cc98f..703dd748f5 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -517,7 +517,22 @@ static int probe_usb_keyboard(struct usb_device *dev)
stdinname = getenv("stdin");
#if CONFIG_IS_ENABLED(CONSOLE_MUX)
+ char *devname = DEVNAME;
+ /*
+ * stdin might not be set yet.. either way, with console-mux the
+ * sensible thing to do is add ourselves to the list of stdio
+ * devices:
+ */
+ if (stdinname && !strstr(stdinname, DEVNAME)) {
+ char *newstdin = malloc(strlen(stdinname) + strlen(","DEVNAME) + 1);
+ sprintf(newstdin, "%s,"DEVNAME, stdinname);
+ stdinname = newstdin;
+ } else if (!stdinname) {
+ stdinname = devname;
+ }
error = iomux_doenv(stdin, stdinname);
+ if (stdinname != devname)
+ free(stdinname);
if (error)
return error;
#else
--
2.13.3
From 47f22a41df082c62411389ab5bf6e9ae26d93083 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Wed, 19 Jul 2017 10:39:12 -0400
@ -764,3 +719,48 @@ index d9dc639aeb..626dff8dcd 100644
--
2.13.3
From 76fba480e6ee494e2e01c19bb8952f42a3b6a710 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Mon, 3 Jul 2017 09:15:44 -0400
Subject: [PATCH 12/23] usb: kbd: don't fail with iomux
stdin might not be set, which would cause iomux_doenv() to fail
therefore causing probe_usb_keyboard() to fail. Furthermore if we do
have iomux enabled, the sensible thing (in terms of user experience)
would be to simply add ourselves to the list of stdin devices.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
common/usb_kbd.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index d2d29cc98f..703dd748f5 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -517,7 +517,22 @@
stdinname = env_get("stdin");
#if CONFIG_IS_ENABLED(CONSOLE_MUX)
+ char *devname = DEVNAME;
+ /*
+ * stdin might not be set yet.. either way, with console-mux the
+ * sensible thing to do is add ourselves to the list of stdio
+ * devices:
+ */
+ if (stdinname && !strstr(stdinname, DEVNAME)) {
+ char *newstdin = malloc(strlen(stdinname) + strlen(","DEVNAME) + 1);
+ sprintf(newstdin, "%s,"DEVNAME, stdinname);
+ stdinname = newstdin;
+ } else if (!stdinname) {
+ stdinname = devname;
+ }
error = iomux_doenv(stdin, stdinname);
+ if (stdinname != devname)
+ free(stdinname);
if (error)
return error;
#else
--
2.13.3

View File

@ -0,0 +1,69 @@
From patchwork Tue Sep 5 18:20:09 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] env: Fix out of tree building of tools-all
X-Patchwork-Submitter: Tom Rini <trini@konsulko.com>
X-Patchwork-Id: 810244
Message-Id: <1504635609-23585-1-git-send-email-trini@konsulko.com>
To: u-boot@lists.denx.de
Date: Tue, 5 Sep 2017 14:20:09 -0400
From: Tom Rini <trini@konsulko.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
With the move of environment code from common/ to env/ a number of
changes needed to be made to various make targets. We missed updating
some of the files required for out of tree builds of the tools. Correct
the 'environ' target to know that we need to work under tools/env/ still
(not tools/environ/) and then update the wrappers in env_attr.c and
env_flags.c to point to the new correct file.
Reported-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
Makefile | 2 +-
tools/env/env_attr.c | 2 +-
tools/env/env_flags.c | 2 +-
tools/env/fw_env.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 792162521155..020ebd50ad22 100644
--- a/Makefile
+++ b/Makefile
@@ -1466,7 +1466,7 @@ checkarmreloc: u-boot
fi
environ: scripts_basic
- $(Q)$(MAKE) $(build)=tools/$@
+ $(Q)$(MAKE) $(build)=tools/env
tools-only: scripts_basic $(version_h) $(timestamp_h)
$(Q)$(MAKE) $(build)=tools
diff --git a/tools/env/env_attr.c b/tools/env/env_attr.c
index 502d4c900bf2..4d8536335c30 100644
--- a/tools/env/env_attr.c
+++ b/tools/env/env_attr.c
@@ -1 +1 @@
-#include "../../common/env_attr.c"
+#include "../../env/attr.c"
diff --git a/tools/env/env_flags.c b/tools/env/env_flags.c
index b261cb8e3907..71e13e2021f6 100644
--- a/tools/env/env_flags.c
+++ b/tools/env/env_flags.c
@@ -1 +1 @@
-#include "../../common/env_flags.c"
+#include "../../env/flags.c"
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 965e1662d702..ab06415898c2 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -755,7 +755,7 @@ static int flash_read_buf (int dev, int fd, void *buf, size_t count,
/*
* If a block is bad, we retry in the next block at the same
- * offset - see common/env_nand.c::writeenv()
+ * offset - see env/nand.c::writeenv()
*/
lseek (fd, blockstart + block_seek, SEEK_SET);

514
qemu-machine-virt-ARM.patch Normal file
View File

@ -0,0 +1,514 @@
From patchwork Wed Aug 30 08:31:34 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,
1/2] PCI: Add driver for a 'pci-host-ecam-generic' host controller
X-Patchwork-Submitter: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
X-Patchwork-Id: 807714
Message-Id: <20170830083135.9183-2-tuomas.tynkkynen@iki.fi>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>
Date: Wed, 30 Aug 2017 11:31:34 +0300
From: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
QEMU emulates such a device with '-machine virt,highmem=off' on ARM.
The 'highmem=off' part is required for things to work as the PCI code
in U-Boot doesn't seem to support 64-bit BARs.
This driver is basically a copy-paste of the Xilinx PCIE driver with the
Xilinx-specific bits removed and compatible string changed... The
generic code should probably be extracted into some sort of library
functions instead of duplicating them before committing this driver.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
---
drivers/pci/Kconfig | 8 ++
drivers/pci/Makefile | 1 +
drivers/pci/pcie_ecam_generic.c | 193 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 202 insertions(+)
create mode 100644 drivers/pci/pcie_ecam_generic.c
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index e2a1c0a409..745161fb9f 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -33,6 +33,14 @@ config PCI_PNP
help
Enable PCI memory and I/O space resource allocation and assignment.
+config PCIE_ECAM_GENERIC
+ bool "Generic PCI-E ECAM support"
+ default n
+ depends on DM_PCI
+ help
+ Say Y here if you want to enable support for generic ECAM-based
+ PCIe controllers, such as the one emulated by QEMU.
+
config PCIE_DW_MVEBU
bool "Enable Armada-8K PCIe driver (DesignWare core)"
default n
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index ad44e83996..5eb12efbf5 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -17,6 +17,7 @@ obj-$(CONFIG_PCI) += pci.o pci_auto_old.o
endif
obj-$(CONFIG_PCI) += pci_auto_common.o pci_common.o
+obj-$(CONFIG_PCIE_ECAM_GENERIC) += pcie_ecam_generic.o
obj-$(CONFIG_FSL_PCI_INIT) += fsl_pci_init.o
obj-$(CONFIG_PCI_INDIRECT_BRIDGE) += pci_indirect.o
obj-$(CONFIG_PCI_GT64120) += pci_gt64120.o
diff --git a/drivers/pci/pcie_ecam_generic.c b/drivers/pci/pcie_ecam_generic.c
new file mode 100644
index 0000000000..039e378cb0
--- /dev/null
+++ b/drivers/pci/pcie_ecam_generic.c
@@ -0,0 +1,193 @@
+/*
+ * Generic PCIE host provided by e.g. QEMU
+ *
+ * Heavily based on drivers/pci/pcie_xilinx.c
+ *
+ * Copyright (C) 2016 Imagination Technologies
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <pci.h>
+
+#include <asm/io.h>
+
+/**
+ * struct generic_ecam_pcie - generic_ecam PCIe controller state
+ * @hose: The parent classes PCI controller state
+ * @cfg_base: The base address of memory mapped configuration space
+ */
+struct generic_ecam_pcie {
+ struct pci_controller hose;
+ void *cfg_base;
+};
+
+/**
+ * pcie_generic_ecam_config_address() - Calculate the address of a config access
+ * @pcie: Pointer to the PCI controller state
+ * @bdf: Identifies the PCIe device to access
+ * @offset: The offset into the device's configuration space
+ * @paddress: Pointer to the pointer to write the calculates address to
+ *
+ * Calculates the address that should be accessed to perform a PCIe
+ * configuration space access for a given device identified by the PCIe
+ * controller device @pcie and the bus, device & function numbers in @bdf. If
+ * access to the device is not valid then the function will return an error
+ * code. Otherwise the address to access will be written to the pointer pointed
+ * to by @paddress.
+ *
+ * Return: 0 on success, else -ENODEV
+ */
+static int pcie_generic_ecam_config_address(struct generic_ecam_pcie *pcie, pci_dev_t bdf,
+ uint offset, void **paddress)
+{
+ unsigned int bus = PCI_BUS(bdf);
+ unsigned int dev = PCI_DEV(bdf);
+ unsigned int func = PCI_FUNC(bdf);
+ void *addr;
+
+ addr = pcie->cfg_base;
+ addr += bus << 20;
+ addr += dev << 15;
+ addr += func << 12;
+ addr += offset;
+ *paddress = addr;
+
+ return 0;
+}
+
+/**
+ * pcie_generic_ecam_read_config() - Read from configuration space
+ * @pcie: Pointer to the PCI controller state
+ * @bdf: Identifies the PCIe device to access
+ * @offset: The offset into the device's configuration space
+ * @valuep: A pointer at which to store the read value
+ * @size: Indicates the size of access to perform
+ *
+ * Read a value of size @size from offset @offset within the configuration
+ * space of the device identified by the bus, device & function numbers in @bdf
+ * on the PCI bus @bus.
+ *
+ * Return: 0 on success, else -ENODEV or -EINVAL
+ */
+static int pcie_generic_ecam_read_config(struct udevice *bus, pci_dev_t bdf,
+ uint offset, ulong *valuep,
+ enum pci_size_t size)
+{
+ struct generic_ecam_pcie *pcie = dev_get_priv(bus);
+ void *address;
+ int err;
+
+ err = pcie_generic_ecam_config_address(pcie, bdf, offset, &address);
+ if (err < 0) {
+ *valuep = pci_get_ff(size);
+ return 0;
+ }
+
+ switch (size) {
+ case PCI_SIZE_8:
+ *valuep = __raw_readb(address);
+ return 0;
+ case PCI_SIZE_16:
+ *valuep = __raw_readw(address);
+ return 0;
+ case PCI_SIZE_32:
+ *valuep = __raw_readl(address);
+ return 0;
+ default:
+ return -EINVAL;
+ }
+}
+
+/**
+ * pcie_generic_ecam_write_config() - Write to configuration space
+ * @pcie: Pointer to the PCI controller state
+ * @bdf: Identifies the PCIe device to access
+ * @offset: The offset into the device's configuration space
+ * @value: The value to write
+ * @size: Indicates the size of access to perform
+ *
+ * Write the value @value of size @size from offset @offset within the
+ * configuration space of the device identified by the bus, device & function
+ * numbers in @bdf on the PCI bus @bus.
+ *
+ * Return: 0 on success, else -ENODEV or -EINVAL
+ */
+static int pcie_generic_ecam_write_config(struct udevice *bus, pci_dev_t bdf,
+ uint offset, ulong value,
+ enum pci_size_t size)
+{
+ struct generic_ecam_pcie *pcie = dev_get_priv(bus);
+ void *address;
+ int err;
+
+ err = pcie_generic_ecam_config_address(pcie, bdf, offset, &address);
+ if (err < 0)
+ return 0;
+
+ switch (size) {
+ case PCI_SIZE_8:
+ __raw_writeb(value, address);
+ return 0;
+ case PCI_SIZE_16:
+ __raw_writew(value, address);
+ return 0;
+ case PCI_SIZE_32:
+ __raw_writel(value, address);
+ return 0;
+ default:
+ return -EINVAL;
+ }
+}
+
+/**
+ * pcie_generic_ecam_ofdata_to_platdata() - Translate from DT to device state
+ * @dev: A pointer to the device being operated on
+ *
+ * Translate relevant data from the device tree pertaining to device @dev into
+ * state that the driver will later make use of. This state is stored in the
+ * device's private data structure.
+ *
+ * Return: 0 on success, else -EINVAL
+ */
+static int pcie_generic_ecam_ofdata_to_platdata(struct udevice *dev)
+{
+ struct generic_ecam_pcie *pcie = dev_get_priv(dev);
+ struct fdt_resource reg_res;
+ DECLARE_GLOBAL_DATA_PTR;
+ int err;
+
+ err = fdt_get_resource(gd->fdt_blob, dev_of_offset(dev), "reg",
+ 0, &reg_res);
+ if (err < 0) {
+ error("\"reg\" resource not found\n");
+ return err;
+ }
+
+ pcie->cfg_base = map_physmem(reg_res.start,
+ fdt_resource_size(&reg_res),
+ MAP_NOCACHE);
+
+ return 0;
+}
+
+static const struct dm_pci_ops pcie_generic_ecam_ops = {
+ .read_config = pcie_generic_ecam_read_config,
+ .write_config = pcie_generic_ecam_write_config,
+};
+
+static const struct udevice_id pcie_generic_ecam_ids[] = {
+ { .compatible = "pci-host-ecam-generic" },
+ { }
+};
+
+U_BOOT_DRIVER(pcie_generic_ecam) = {
+ .name = "pcie_generic_ecam",
+ .id = UCLASS_PCI,
+ .of_match = pcie_generic_ecam_ids,
+ .ops = &pcie_generic_ecam_ops,
+ .ofdata_to_platdata = pcie_generic_ecam_ofdata_to_platdata,
+ .priv_auto_alloc_size = sizeof(struct generic_ecam_pcie),
+};
From patchwork Wed Aug 30 08:31:35 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,2/2] ARM: Add a new arch + board for QEMU's 'virt' machine
X-Patchwork-Submitter: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
X-Patchwork-Id: 807716
Message-Id: <20170830083135.9183-3-tuomas.tynkkynen@iki.fi>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>
Date: Wed, 30 Aug 2017 11:31:35 +0300
From: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
This board builds an U-Boot binary that is bootable with QEMU's 'virt'
machine on ARM. The minimal QEMU command line is:
qemu-system-arm -machine virt,highmem=off -bios u-boot.bin
(Note that the 'highmem=off' parameter to the 'virt' machine is required for
PCI to work in U-Boot.) This command line enables the following:
- u-boot.bin loaded and executing in the emulated flash at address 0x0
- A generated device tree blob placed at the start of RAM
- A freely configurable amount of RAM, described by the DTB
- A PL011 serial port, discoverable via the DTB
- An ARMv7 architected timer
- PSCI for rebooting the system
- A generic ECAM-based PCI host controller, discoverable via the DTB
Additionally, QEMU allows plugging a bunch of useful peripherals to the PCI bus.
The following ones are supported by both U-Boot and Linux:
- To enable a Serial ATA disk via an Intel ICH9 AHCI controller, pass e.g.:
-drive if=none,file=disk.img,id=mydisk -device ich9-ahci,id=ahci -device ide-drive,drive=mydisk,bus=ahci.0
- To enable an Intel E1000 network adapter, pass e.g.:
-net nic,model=e1000 -net user
- To add an EHCI-compliant USB host controller, pass e.g.:
-device usb-ehci,id=ehci
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
---
arch/arm/Kconfig | 10 ++++++++
arch/arm/mach-qemu/Kconfig | 9 +++++++
board/qemu-arm/Makefile | 5 ++++
board/qemu-arm/qemu-arm.c | 35 ++++++++++++++++++++++++++
configs/qemu_arm_defconfig | 27 ++++++++++++++++++++
include/configs/qemu-arm.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 149 insertions(+)
create mode 100644 arch/arm/mach-qemu/Kconfig
create mode 100644 board/qemu-arm/Makefile
create mode 100644 board/qemu-arm/qemu-arm.c
create mode 100644 configs/qemu_arm_defconfig
create mode 100644 include/configs/qemu-arm.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 53d0831935..0d01ba1b73 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -630,6 +630,14 @@ config ARCH_MX5
select CPU_V7
select BOARD_EARLY_INIT_F
+config ARCH_QEMU
+ bool "QEMU Virtual Platform"
+ select CPU_V7
+ select ARCH_SUPPORT_PSCI
+ select DM
+ select DM_SERIAL
+ select OF_CONTROL
+
config ARCH_RMOBILE
bool "Renesas ARM SoCs"
select DM
@@ -1149,6 +1157,8 @@ source "arch/arm/mach-stm32/Kconfig"
source "arch/arm/mach-sunxi/Kconfig"
+source "arch/arm/mach-qemu/Kconfig"
+
source "arch/arm/mach-tegra/Kconfig"
source "arch/arm/mach-uniphier/Kconfig"
diff --git a/arch/arm/mach-qemu/Kconfig b/arch/arm/mach-qemu/Kconfig
new file mode 100644
index 0000000000..89d2a36719
--- /dev/null
+++ b/arch/arm/mach-qemu/Kconfig
@@ -0,0 +1,9 @@
+if ARCH_QEMU
+
+config SYS_BOARD
+ default "qemu-arm"
+
+config SYS_CONFIG_NAME
+ default "qemu-arm"
+
+endif
diff --git a/board/qemu-arm/Makefile b/board/qemu-arm/Makefile
new file mode 100644
index 0000000000..3e9907d983
--- /dev/null
+++ b/board/qemu-arm/Makefile
@@ -0,0 +1,5 @@
+#
+# SPDX-License-Identifier: GPL-2.0
+#
+
+obj-y += qemu-arm.o
diff --git a/board/qemu-arm/qemu-arm.c b/board/qemu-arm/qemu-arm.c
new file mode 100644
index 0000000000..90d7badbf4
--- /dev/null
+++ b/board/qemu-arm/qemu-arm.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2017 Tuomas Tynkkynen
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+#include <common.h>
+#include <fdtdec.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_init(void)
+{
+ return 0;
+}
+
+int dram_init(void)
+{
+ if (fdtdec_setup_memory_size() != 0)
+ return -EINVAL;
+
+ return 0;
+}
+
+int dram_init_banksize(void)
+{
+ fdtdec_setup_memory_banksize();
+
+ return 0;
+}
+
+void *board_fdt_blob_setup(void)
+{
+ /* QEMU loads a generated DTB for us at the start of RAM. */
+ return (void *)CONFIG_SYS_SDRAM_BASE;
+}
diff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig
new file mode 100644
index 0000000000..d34512dd0d
--- /dev/null
+++ b/configs/qemu_arm_defconfig
@@ -0,0 +1,27 @@
+CONFIG_ARM=y
+CONFIG_ARM_SMCCC=y
+CONFIG_ARCH_QEMU=y
+CONFIG_AHCI=y
+CONFIG_DISTRO_DEFAULTS=y
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+# CONFIG_CMD_IMLS is not set
+CONFIG_CMD_PCI=y
+CONFIG_CMD_USB=y
+CONFIG_OF_BOARD=y
+CONFIG_AHCI_PCI=y
+CONFIG_BLK=y
+# CONFIG_MMC is not set
+CONFIG_DM_ETH=y
+CONFIG_E1000=y
+CONFIG_PCI=y
+CONFIG_DM_PCI=y
+CONFIG_PCIE_ECAM_GENERIC=y
+CONFIG_SCSI=y
+CONFIG_DM_SCSI=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_PSCI=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_PCI=y
diff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h
new file mode 100644
index 0000000000..2bcc0efad0
--- /dev/null
+++ b/include/configs/qemu-arm.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2017 Tuomas Tynkkynen
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <linux/sizes.h>
+
+/* Physical memory map */
+#define CONFIG_SYS_TEXT_BASE 0x00000000
+
+#define CONFIG_NR_DRAM_BANKS 1
+#define CONFIG_SYS_SDRAM_BASE 0x40000000
+
+/* The DTB generated by QEMU is placed at start of RAM, stay away from there */
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M)
+#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M)
+#define CONFIG_SYS_MALLOC_LEN SZ_16M
+
+/* QEMU's PL011 serial port is detected via FDT using the device model */
+#define CONFIG_PL01X_SERIAL
+
+/* QEMU implements a 62.5MHz architected timer */
+/* FIXME: can we rely on CNTFREQ instead of hardcoding this fact here? */
+#define CONFIG_SYS_ARCH_TIMER
+#define CONFIG_SYS_HZ 1000
+#define CONFIG_SYS_HZ_CLOCK 62500000
+
+/* Command prompt options */
+#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
+#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
+ sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
+#define CONFIG_SYS_MAXARGS 64 /* max command args */
+
+/* For block devices, QEMU emulates an ICH9 AHCI controller over PCI */
+#define CONFIG_SYS_SCSI_MAX_SCSI_ID 8
+#define CONFIG_SCSI_AHCI
+#define CONFIG_LIBATA
+
+/* Environment options */
+#define CONFIG_ENV_SIZE SZ_64K
+
+#include <config_distro_defaults.h>
+
+#define BOOT_TARGET_DEVICES(func) \
+ func(SCSI, scsi, 0)
+
+#include <config_distro_bootcmd.h>
+
+#define CONFIG_PREBOOT "pci enum"
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "fdt_addr=0x40000000\0" \
+ "scriptaddr=0x40200000\0" \
+ "pxefile_addr_r=0x40300000\0" \
+ "kernel_addr_r=0x40400000\0" \
+ "ramdisk_addr_r=0x44000000\0" \
+ BOOTENV
+
+#endif /* __CONFIG_H */

View File

@ -1,74 +0,0 @@
From patchwork Fri Aug 25 01:45:31 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] rpi: Enable USB keyboard support
From: Simon Glass <sjg@chromium.org>
X-Patchwork-Id: 805721
Message-Id: <20170825014531.192640-1-sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Fabian Vogt <fvogt@suse.com>, Stephen Warren <swarren@nvidia.com>
Date: Thu, 24 Aug 2017 19:45:31 -0600
This is currently disabled, so USB keyboards are not detected in U_Boot.
Enable this option to fix that.
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---
configs/rpi_2_defconfig | 1 +
configs/rpi_3_32b_defconfig | 1 +
configs/rpi_3_defconfig | 1 +
configs/rpi_defconfig | 1 +
4 files changed, 4 insertions(+)
diff --git a/configs/rpi_2_defconfig b/configs/rpi_2_defconfig
index 63d1e4042d..5150eed79c 100644
--- a/configs/rpi_2_defconfig
+++ b/configs/rpi_2_defconfig
@@ -15,6 +15,7 @@ CONFIG_SYS_PROMPT="U-Boot> "
CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
+CONFIG_DM_KEYBOARD=y
CONFIG_DM_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_BCM2835=y
diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig
index 343cb197a1..caceb85b07 100644
--- a/configs/rpi_3_32b_defconfig
+++ b/configs/rpi_3_32b_defconfig
@@ -16,6 +16,7 @@ CONFIG_SYS_PROMPT="U-Boot> "
CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
+CONFIG_DM_KEYBOARD=y
CONFIG_DM_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_BCM2835=y
diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig
index 6c9f2e32b5..e3dd1b9124 100644
--- a/configs/rpi_3_defconfig
+++ b/configs/rpi_3_defconfig
@@ -16,6 +16,7 @@ CONFIG_SYS_PROMPT="U-Boot> "
CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
+CONFIG_DM_KEYBOARD=y
CONFIG_DM_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_BCM2835=y
diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig
index 6b3cec5ce0..eaf9bb9189 100644
--- a/configs/rpi_defconfig
+++ b/configs/rpi_defconfig
@@ -15,6 +15,7 @@ CONFIG_SYS_PROMPT="U-Boot> "
CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
+CONFIG_DM_KEYBOARD=y
CONFIG_DM_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_BCM2835=y

View File

@ -15,50 +15,50 @@ diff --git a/configs/rpi_2_defconfig b/configs/rpi_2_defconfig
index 63d1e4042d..98353d0683 100644
--- a/configs/rpi_2_defconfig
+++ b/configs/rpi_2_defconfig
@@ -4,6 +4,7 @@ CONFIG_TARGET_RPI_2=y
@@ -4,6 +4,7 @@
CONFIG_DEFAULT_DEVICE_TREE="bcm2836-rpi-2-b"
CONFIG_DISTRO_DEFAULTS=y
CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_EMBED=y
CONFIG_ENV_FAT_INTERFACE="mmc"
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_SYS_PROMPT="U-Boot> "
diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig
index 343cb197a1..51009bccb9 100644
--- a/configs/rpi_3_32b_defconfig
+++ b/configs/rpi_3_32b_defconfig
@@ -5,6 +5,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
@@ -5,6 +5,7 @@
CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b"
CONFIG_DISTRO_DEFAULTS=y
CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_EMBED=y
CONFIG_ENV_FAT_INTERFACE="mmc"
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_SYS_PROMPT="U-Boot> "
diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig
index 6c9f2e32b5..c3c0185954 100644
--- a/configs/rpi_3_defconfig
+++ b/configs/rpi_3_defconfig
@@ -5,6 +5,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
@@ -5,6 +5,7 @@
CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b"
CONFIG_DISTRO_DEFAULTS=y
CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_EMBED=y
CONFIG_ENV_FAT_INTERFACE="mmc"
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_SYS_PROMPT="U-Boot> "
diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig
index 6b3cec5ce0..ad5be72510 100644
--- a/configs/rpi_defconfig
+++ b/configs/rpi_defconfig
@@ -4,6 +4,7 @@ CONFIG_TARGET_RPI=y
@@ -4,6 +4,7 @@
CONFIG_DEFAULT_DEVICE_TREE="bcm2835-rpi-b"
CONFIG_DISTRO_DEFAULTS=y
CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_EMBED=y
CONFIG_ENV_FAT_INTERFACE="mmc"
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_SYS_PROMPT="U-Boot> "
--
2.13.4

View File

@ -1 +1 @@
SHA512 (u-boot-2017.09-rc2.tar.bz2) = a0cf9db7d2226cb8f10ab0f9c4010aca024d48193df3c15ded38d08bb7c3fda2f2901621f66d6437c03de7980689c92e27793fdc375a51935b87c6c65ba93f9f
SHA512 (u-boot-2017.09-rc4.tar.bz2) = 3fbada7aab3208e5ec43fe675776da7d9a36acd793c84aadcd52bc6f18a040565e3d3639c0b1801a33a959ee56757331da4630f0de5fa7b46c7ae3b2666e5cf2

File diff suppressed because it is too large Load Diff

View File

@ -1,81 +0,0 @@
From aeac5d911f15e3d17ca857b6e0830e770b4e6db1 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Tue, 22 Aug 2017 15:52:50 +0100
Subject: [PATCH] sun7i: fix gmac rename
---
arch/arm/include/asm/arch-sunxi/sys_proto.h | 2 +-
board/sunxi/Makefile | 2 +-
include/configs/sunxi-common.h | 2 +-
scripts/build-whitelist.sh | 2 +-
scripts/config_whitelist.txt | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm/include/asm/arch-sunxi/sys_proto.h b/arch/arm/include/asm/arch-sunxi/sys_proto.h
index a373319a2b..096510b787 100644
--- a/arch/arm/include/asm/arch-sunxi/sys_proto.h
+++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h
@@ -24,7 +24,7 @@ void sdelay(unsigned long);
void return_to_fel(uint32_t lr, uint32_t sp);
/* Board / SoC level designware gmac init */
-#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC
+#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUN7I_GMAC
void eth_init_board(void);
#else
static inline void eth_init_board(void) {}
diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile
index f4411f01c3..526cb72a51 100644
--- a/board/sunxi/Makefile
+++ b/board/sunxi/Makefile
@@ -9,7 +9,7 @@
# SPDX-License-Identifier: GPL-2.0+
#
obj-y += board.o
-obj-$(CONFIG_SUNXI_GMAC) += gmac.o
+obj-$(CONFIG_SUN7I_GMAC) += gmac.o
ifndef CONFIG_SPL_BUILD
obj-$(CONFIG_SUNXI_AHCI) += ahci.o
endif
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 212862acd1..1373b1f037 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -294,7 +294,7 @@ extern int soft_i2c_gpio_scl;
#define CONFIG_MII /* MII PHY management */
#endif
-#ifdef CONFIG_SUNXI_GMAC
+#ifdef CONFIG_SUN7I_GMAC
#define CONFIG_PHY_ADDR 1
#define CONFIG_MII /* MII PHY management */
#define CONFIG_PHY_REALTEK
diff --git a/scripts/build-whitelist.sh b/scripts/build-whitelist.sh
index 7d8160d5f2..0f102a0585 100755
--- a/scripts/build-whitelist.sh
+++ b/scripts/build-whitelist.sh
@@ -16,7 +16,7 @@ export LC_ALL=C LC_COLLATE=C
# SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)
#
# We want this to produce:
-# CONFIG_SUNXI_GMAC
+# CONFIG_SUN7I_GMAC
# CONFIG_AHCI
# CONFIG_SATAPWR
#
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 6c628c878c..024dcd6a1e 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -2308,7 +2308,7 @@ CONFIG_STV0991_HZ_CLOCK
CONFIG_ST_SMI
CONFIG_SUNXI_AHCI
CONFIG_SUNXI_EMAC
-CONFIG_SUNXI_GMAC
+CONFIG_SUN7I_GMAC
CONFIG_SUNXI_GPIO
CONFIG_SUNXI_MAX_FB_SIZE
CONFIG_SUNXI_USB_PHYS
--
2.13.5

View File

@ -1,309 +0,0 @@
From patchwork Wed Aug 23 11:41:33 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,1/4] mmc: sunxi: fix legacy MMC initialisation
From: Maxime Ripard <maxime.ripard@free-electrons.com>
X-Patchwork-Id: 804954
Message-Id: <20170823114136.10919-2-maxime.ripard@free-electrons.com>
To: Jagan Teki <jagan@openedev.com>, Jaehoon Chung <jh80.chung@samsung.com>,
Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Wed, 23 Aug 2017 13:41:33 +0200
The driver-model rework changed, among other things, the way the private
data were moved around. It now uses the private field in the struct mmc.
However, the mmc_create argument was changed in the process to always pass
the array we used to have to store our private structures.
The basically means that all the MMC driver instances will now have the
private data of the first instance, which obviously doesn't work very well.
Pass the proper pointer to mmc_create.
Fixes: 034e226bc77e ("dm: mmc: sunxi: Pass private data around explicitly")
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Tested-by: Chen-Yu Tsai <wens@csie.org>
Tested-by: Jagan Teki <jagan@openedev.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
---
drivers/mmc/sunxi_mmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index 588574fab6a9..30f1f76e9f8c 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -498,7 +498,7 @@ struct mmc *sunxi_mmc_init(int sdc_no)
if (ret)
return NULL;
- return mmc_create(cfg, mmc_host);
+ return mmc_create(cfg, priv);
}
#else
From patchwork Wed Aug 23 11:41:34 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,2/4] arm: sunxi: compile spl_boot_device even for U-Boot
From: Maxime Ripard <maxime.ripard@free-electrons.com>
X-Patchwork-Id: 804955
Message-Id: <20170823114136.10919-3-maxime.ripard@free-electrons.com>
To: Jagan Teki <jagan@openedev.com>, Jaehoon Chung <jh80.chung@samsung.com>,
Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Wed, 23 Aug 2017 13:41:34 +0200
U-Boot itself might need to identify the boot device, for example to be
able to tell where to load the kernel from when several options are
possible.
Remove the guard preventing it from being compiled.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Tested-by: Chen-Yu Tsai <wens@csie.org>
---
arch/arm/mach-sunxi/board.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index 65b1ebd83787..f5e977b4183d 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -14,9 +14,7 @@
#include <mmc.h>
#include <i2c.h>
#include <serial.h>
-#ifdef CONFIG_SPL_BUILD
#include <spl.h>
-#endif
#include <asm/gpio.h>
#include <asm/io.h>
#include <asm/arch/clock.h>
@@ -210,7 +208,6 @@ void s_init(void)
eth_init_board();
}
-#ifdef CONFIG_SPL_BUILD
DECLARE_GLOBAL_DATA_PTR;
/* The sunxi internal brom will try to loader external bootloader
@@ -261,6 +258,7 @@ u32 spl_boot_mode(const u32 boot_device)
return MMCSD_MODE_RAW;
}
+#ifdef CONFIG_SPL_BUILD
void board_init_f(ulong dummy)
{
spl_init();
From patchwork Wed Aug 23 11:41:35 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,3/4] sunxi: Use spl_boot_device
From: Maxime Ripard <maxime.ripard@free-electrons.com>
X-Patchwork-Id: 804957
Message-Id: <20170823114136.10919-4-maxime.ripard@free-electrons.com>
To: Jagan Teki <jagan@openedev.com>, Jaehoon Chung <jh80.chung@samsung.com>,
Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Wed, 23 Aug 2017 13:41:35 +0200
Our current board code duplicates a bit the spl_boot_device logic. Now that
we can use that function in the full-flavoured U-Boot, remove that
duplication and call the function instead.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
board/sunxi/board.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 800f412b383d..e1d48140878f 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -32,6 +32,7 @@
#include <libfdt.h>
#include <nand.h>
#include <net.h>
+#include <spl.h>
#include <sy8106a.h>
#include <asm/setup.h>
@@ -720,11 +721,14 @@ static void setup_environment(const void *fdt)
int misc_init_r(void)
{
__maybe_unused int ret;
+ uint boot;
setenv("fel_booted", NULL);
setenv("fel_scriptaddr", NULL);
+
+ boot = spl_boot_device();
/* determine if we are running in FEL mode */
- if (!is_boot0_magic(SPL_ADDR + 4)) { /* eGON.BT0 */
+ if (boot == BOOT_DEVICE_BOARD) {
setenv("fel_booted", "1");
parse_spl_header(SPL_ADDR);
}
From patchwork Wed Aug 23 11:41:36 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,4/4] sunxi: Remove the MMC index hack
From: Maxime Ripard <maxime.ripard@free-electrons.com>
X-Patchwork-Id: 804956
Message-Id: <20170823114136.10919-5-maxime.ripard@free-electrons.com>
To: Jagan Teki <jagan@openedev.com>, Jaehoon Chung <jh80.chung@samsung.com>,
Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Wed, 23 Aug 2017 13:41:36 +0200
The current code, if there's both an eMMC and an MMC slot available on the
board, will swap the MMC indices based on whether we booted from the eMMC
or the MMC. This way, the MMC we're supposed to boot on will always have
the index 0.
However, this causes various issues, for example when using other
components that base their behaviour on the MMC index, such as fastboot.
Let's remove that hack, and take the opposite approach. The MMC will always
have the same index, but the bootcmd will pick the same device than the one
we booted from. This is done through the introduction of the mmc_bootdev
environment variable that will be filled by the board code based on the
boot device informations we can get from the SoC.
In order to not introduce regressions, we also need to adjust the fastboot
MMC device and the environment device in order to set it to the eMMC, over
the MMC, like it used to be the case.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Tested-by: Chen-Yu Tsai <wens@csie.org>
---
board/sunxi/board.c | 20 ++++++--------------
include/configs/sunxi-common.h | 36 ++++++++++++++++++++++++++++++------
2 files changed, 36 insertions(+), 20 deletions(-)
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index e1d48140878f..664c7d2d8126 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -492,20 +492,6 @@ int board_mmc_init(bd_t *bis)
return -1;
#endif
-#if !defined(CONFIG_SPL_BUILD) && CONFIG_MMC_SUNXI_SLOT_EXTRA == 2
- /*
- * On systems with an emmc (mmc2), figure out if we are booting from
- * the emmc and if we are make it "mmc dev 0" so that boot.scr, etc.
- * are searched there first. Note we only do this for u-boot proper,
- * not for the SPL, see spl_boot_device().
- */
- if (readb(SPL_ADDR + 0x28) == SUNXI_BOOTED_FROM_MMC2) {
- /* Booting from emmc / mmc2, swap */
- mmc0->block_dev.devnum = 1;
- mmc1->block_dev.devnum = 0;
- }
-#endif
-
return 0;
}
#endif
@@ -725,12 +711,18 @@ int misc_init_r(void)
setenv("fel_booted", NULL);
setenv("fel_scriptaddr", NULL);
+ setenv("mmc_bootdev", NULL);
boot = spl_boot_device();
/* determine if we are running in FEL mode */
if (boot == BOOT_DEVICE_BOARD) {
setenv("fel_booted", "1");
parse_spl_header(SPL_ADDR);
+ /* or if we booted from MMC, and which one */
+ } else if (boot == BOOT_DEVICE_MMC1) {
+ setenv("mmc_bootdev", "0");
+ } else if (boot == BOOT_DEVICE_MMC2) {
+ setenv("mmc_bootdev", "1");
}
setup_environment(gd->fdt_blob);
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 07c7ffd7f204..79dc3dddd0cc 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -148,7 +148,13 @@
#endif
#if defined(CONFIG_ENV_IS_IN_MMC)
-#define CONFIG_SYS_MMC_ENV_DEV 0 /* first detected MMC controller */
+#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
+/* If we have two devices (most likely eMMC + MMC), favour the eMMC */
+#define CONFIG_SYS_MMC_ENV_DEV 1
+#else
+/* Otherwise, use the only device we have */
+#define CONFIG_SYS_MMC_ENV_DEV 0
+#endif
#define CONFIG_SYS_MMC_MAX_DEVICE 4
#elif defined(CONFIG_ENV_IS_NOWHERE)
#define CONFIG_ENV_SIZE (128 << 10)
@@ -328,9 +334,15 @@ extern int soft_i2c_gpio_scl;
#define CONFIG_FASTBOOT_FLASH
#ifdef CONFIG_MMC
+#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
+/* If we have two devices (most likely eMMC + MMC), favour the eMMC */
+#define CONFIG_FASTBOOT_FLASH_MMC_DEV 1
+#else
+/* Otherwise, use the only device we have */
#define CONFIG_FASTBOOT_FLASH_MMC_DEV 0
#endif
#endif
+#endif
#ifdef CONFIG_USB_FUNCTION_MASS_STORAGE
#endif
@@ -405,15 +417,28 @@ extern int soft_i2c_gpio_scl;
"ramdisk ram " RAMDISK_ADDR_R " 0x4000000\0"
#ifdef CONFIG_MMC
-#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
-#define BOOT_TARGET_DEVICES_MMC_EXTRA(func) func(MMC, mmc, 1)
+#define BOOTENV_DEV_MMC_AUTO(devtypeu, devtypel, instance) \
+ BOOTENV_DEV_MMC(MMC, mmc, 0) \
+ BOOTENV_DEV_MMC(MMC, mmc, 1) \
+ "bootcmd_mmc_auto=" \
+ "if test ${mmc_bootdev} -eq 1; then " \
+ "run bootcmd_mmc1; " \
+ "run bootcmd_mmc0; " \
+ "elif test ${mmc_bootdev} -eq 0; then " \
+ "run bootcmd_mmc0; " \
+ "run bootcmd_mmc1; " \
+ "fi\0"
+
+#define BOOTENV_DEV_NAME_MMC_AUTO(devtypeu, devtypel, instance) \
+ "mmc_auto "
+
+#define BOOT_TARGET_DEVICES_MMC(func) func(MMC_AUTO, mmc_auto, na)
#else
-#define BOOT_TARGET_DEVICES_MMC_EXTRA(func)
+#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
#endif
#else
#define BOOT_TARGET_DEVICES_MMC(func)
-#define BOOT_TARGET_DEVICES_MMC_EXTRA(func)
#endif
#ifdef CONFIG_AHCI
@@ -441,7 +466,6 @@ extern int soft_i2c_gpio_scl;
#define BOOT_TARGET_DEVICES(func) \
func(FEL, fel, na) \
BOOT_TARGET_DEVICES_MMC(func) \
- BOOT_TARGET_DEVICES_MMC_EXTRA(func) \
BOOT_TARGET_DEVICES_SCSI(func) \
BOOT_TARGET_DEVICES_USB(func) \
func(PXE, pxe, na) \

View File

@ -1,8 +1,8 @@
%global candidate rc2
%global candidate rc4
Name: uboot-tools
Version: 2017.09
Release: 0.4%{?candidate:.%{candidate}}%{?dist}
Release: 0.5%{?candidate:.%{candidate}}%{?dist}
Summary: U-Boot utilities
License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+
URL: http://www.denx.de/wiki/U-Boot
@ -16,18 +16,17 @@ Source4: aarch64-chromebooks
# Fedoraisms patches, general fixes
Patch1: uefi-use-Fedora-specific-path-name.patch
Patch2: uefi-fixes.patch
Patch3: env-Fix-out-of-tree-building-of-tools-all.patch
# Board fixes and enablement
Patch10: dragonboard-fixes.patch
Patch11: mx6-Initial-Hummingboard-2-support.patch
Patch12: sti-STiH410-B2260-support.patch
Patch13: rpi-Revert-dm-Drop-CONFIG_OF_EMBED.patch
Patch14: rpi-Enable-USB-keyboard-support.patch
Patch15: sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch
Patch16: sunxi-mmc-fixes.patch
Patch11: rpi-Revert-dm-Drop-CONFIG_OF_EMBED.patch
Patch12: qemu-machine-virt-ARM.patch
Patch13: sti-STiH410-B2260-support.patch
# Patch17: sunxi-dm-pine64.patch
# Patch14: mvebu-enable-generic-distro-boot-config.patch
# Patch15: mx6-Initial-Hummingboard-2-support.patch
# Patch16: sunxi-dm-pine64.patch
# Patch17: mvebu-enable-generic-distro-boot-config.patch
BuildRequires: bc
BuildRequires: dtc
@ -37,6 +36,7 @@ BuildRequires: openssl-devel
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-libfdt
BuildRequires: SDL-devel
BuildRequires: swig
%ifarch %{arm} aarch64
BuildRequires: vboot-utils
@ -107,7 +107,7 @@ do
echo "Building board: $board"
mkdir builds/$(echo $board)/
# ATF selection, needs improving, suggestions of ATF SoC to Board matrix welcome
sun50i=(pine64_plus bananapi_m64 nanopi_neo2 orangepi_pc2 orangepi_prime orangepi_win orangepi_zero_plus2 sopine_baseboard)
sun50i=(pine64_plus a64-olinuxino bananapi_m64 nanopi_a64 nanopi_neo2 orangepi_pc2 orangepi_prime orangepi_win orangepi_zero_plus2 sopine_baseboard)
if [[ " ${sun50i[*]} " == *" $board "* ]]; then
echo "Board: $board using sun50iw1p1"
cp /usr/share/arm-trusted-firmware/sun50iw1p1/bl31.bin builds/$(echo $board)/
@ -278,6 +278,10 @@ cp -p board/warp7/README builds/docs/README.warp7
%endif
%changelog
* Tue Sep 5 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.09-0.5.rc4
- 2017.09 RC4
- Add qemu arm target config
* Fri Aug 25 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.09-0.4.rc2
- Raspberry Pi and Allwinner fixes
- Enable some new devices

View File

@ -2340,17 +2340,3 @@ index 4b78f6d556..4a19fabdb3 100644
struct efi_device_path *file_path,
--
2.13.3
diff --git a/lib/efi_loader/efi_gop.c b/lib/efi_loader/efi_gop.c
index e063e0c79b..411a8c9226 100644
--- a/lib/efi_loader/efi_gop.c
+++ b/lib/efi_loader/efi_gop.c
@@ -137,7 +137,7 @@ int efi_gop_register(void)
struct udevice *vdev;
/* We only support a single video output device for now */
- if (uclass_first_device(UCLASS_VIDEO, &vdev))
+ if (uclass_first_device(UCLASS_VIDEO, &vdev) || !vdev)
return -1;
struct video_priv *priv = dev_get_uclass_priv(vdev);