[PATCH 13/13] arm: qemu: Move GUIDs to the C file

Simon Glass sjg at chromium.org
Sat Jan 28 23:00:28 CET 2023


These are only used in one place, so move them there.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 board/emulation/qemu-arm/qemu-arm.c | 10 ++++++++++
 configs/qemu_arm64_defconfig        |  1 +
 configs/qemu_arm_defconfig          |  1 +
 include/configs/qemu-arm.h          | 12 ------------
 test/boot/bootdev.c                 | 25 ++++++++++++++-----------
 test/boot/bootstd_common.h          |  2 +-
 6 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
index 3df3e41c0b2..dae37640bc5 100644
--- a/board/emulation/qemu-arm/qemu-arm.c
+++ b/board/emulation/qemu-arm/qemu-arm.c
@@ -15,6 +15,16 @@
 #include <virtio.h>
 
 #include <linux/kernel.h>
+#include <linux/sizes.h>
+
+/* GUIDs for capsule updatable firmware images */
+#define QEMU_ARM_UBOOT_IMAGE_GUID \
+	EFI_GUID(0xf885b085, 0x99f8, 0x45af, 0x84, 0x7d, \
+		 0xd5, 0x14, 0x10, 0x7a, 0x4a, 0x2c)
+
+#define QEMU_ARM64_UBOOT_IMAGE_GUID \
+	EFI_GUID(0x058b7d83, 0x50d5, 0x4c47, 0xa1, 0x95, \
+		 0x60, 0xd8, 0x6a, 0xd3, 0x41, 0xc4)
 
 #ifdef CONFIG_ARM64
 #include <asm/armv8/mmu.h>
diff --git a/configs/qemu_arm64_defconfig b/configs/qemu_arm64_defconfig
index 40aec927fc9..f66ad32fc9b 100644
--- a/configs/qemu_arm64_defconfig
+++ b/configs/qemu_arm64_defconfig
@@ -72,3 +72,4 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_PCI=y
 CONFIG_TPM=y
+CONFIG_HUSH_PARSER=y
diff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig
index ad02526a5dc..c2e25c1d6bc 100644
--- a/configs/qemu_arm_defconfig
+++ b/configs/qemu_arm_defconfig
@@ -74,3 +74,4 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_PCI=y
 CONFIG_TPM=y
+CONFIG_HUSH_PARSER=y
diff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h
index 77ab5738254..e296f398798 100644
--- a/include/configs/qemu-arm.h
+++ b/include/configs/qemu-arm.h
@@ -6,21 +6,9 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#include <linux/sizes.h>
-
 /* Physical memory map */
-
 #define CFG_SYS_SDRAM_BASE		0x40000000
 
-/* GUIDs for capsule updatable firmware images */
-#define QEMU_ARM_UBOOT_IMAGE_GUID \
-	EFI_GUID(0xf885b085, 0x99f8, 0x45af, 0x84, 0x7d, \
-		 0xd5, 0x14, 0x10, 0x7a, 0x4a, 0x2c)
-
-#define QEMU_ARM64_UBOOT_IMAGE_GUID \
-	EFI_GUID(0x058b7d83, 0x50d5, 0x4c47, 0xa1, 0x95, \
-		 0x60, 0xd8, 0x6a, 0xd3, 0x41, 0xc4)
-
 /* For timer, QEMU emulates an ARMv7/ARMv8 architected timer */
 
 #endif /* __CONFIG_H */
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index ef5215bbcec..7beee9258d0 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -316,11 +316,12 @@ static int bootdev_test_hunter(struct unit_test_state *uts)
 	ut_assert_nextline("   5        ide              ide_bootdev");
 	ut_assert_nextline("   2        mmc              mmc_bootdev");
 	ut_assert_nextline("   4        nvme             nvme_bootdev");
+	ut_assert_nextline("   4        qfw              qfw_bootdev");
 	ut_assert_nextline("   4        scsi             scsi_bootdev");
 	ut_assert_nextline("   4        spi_flash        sf_bootdev");
 	ut_assert_nextline("   5        usb              usb_bootdev");
 	ut_assert_nextline("   4        virtio           virtio_bootdev");
-	ut_assert_nextline("(total hunters: 9)");
+	ut_assert_nextline("(total hunters: 10)");
 	ut_assert_console_end();
 
 	ut_assertok(bootdev_hunt("usb1", false));
@@ -328,8 +329,8 @@ static int bootdev_test_hunter(struct unit_test_state *uts)
 		"Bus usb at 1: scanning bus usb at 1 for devices... 5 USB Device(s) found");
 	ut_assert_console_end();
 
-	/* USB is sixth in the list, so bit 7 */
-	ut_asserteq(BIT(7), std->hunters_used);
+	/* USB is 7th in the list, so bit 8 */
+	ut_asserteq(BIT(8), std->hunters_used);
 
 	return 0;
 }
@@ -350,7 +351,7 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts)
 	ut_assert_nextline("Prio  Used  Uclass           Hunter");
 	ut_assert_nextlinen("----");
 	ut_assert_nextline("   6        ethernet         eth_bootdev");
-	ut_assert_skip_to_line("(total hunters: 9)");
+	ut_assert_skip_to_line("(total hunters: 10)");
 	ut_assert_console_end();
 
 	/* Use the MMC hunter and see that it updates */
@@ -358,7 +359,7 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts)
 	ut_assertok(run_command("bootdev hunt -l", 0));
 	ut_assert_skip_to_line("   5        ide              ide_bootdev");
 	ut_assert_nextline("   2     *  mmc              mmc_bootdev");
-	ut_assert_skip_to_line("(total hunters: 9)");
+	ut_assert_skip_to_line("(total hunters: 10)");
 	ut_assert_console_end();
 
 	/* Scan all hunters */
@@ -376,6 +377,7 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts)
 	/* mmc hunter has already been used so should not run again */
 
 	ut_assert_nextline("Hunting with: nvme");
+	ut_assert_nextline("Hunting with: qfw");
 	ut_assert_nextline("Hunting with: scsi");
 	ut_assert_nextline("scanning bus for devices...");
 	ut_assert_skip_to_line("Hunting with: spi_flash");
@@ -394,11 +396,12 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts)
 	ut_assert_nextline("   5     *  ide              ide_bootdev");
 	ut_assert_nextline("   2     *  mmc              mmc_bootdev");
 	ut_assert_nextline("   4     *  nvme             nvme_bootdev");
+	ut_assert_nextline("   4     *  qfw              qfw_bootdev");
 	ut_assert_nextline("   4     *  scsi             scsi_bootdev");
 	ut_assert_nextline("   4     *  spi_flash        sf_bootdev");
 	ut_assert_nextline("   5     *  usb              usb_bootdev");
 	ut_assert_nextline("   4     *  virtio           virtio_bootdev");
-	ut_assert_nextline("(total hunters: 9)");
+	ut_assert_nextline("(total hunters: 10)");
 	ut_assert_console_end();
 
 	ut_asserteq(GENMASK(MAX_HUNTER, 0), std->hunters_used);
@@ -585,8 +588,8 @@ static int bootdev_test_next_label(struct unit_test_state *uts)
 	ut_asserteq_str("scsi.id0lun0.bootdev", dev->name);
 	ut_asserteq(BOOTFLOW_METHF_SINGLE_UCLASS, mflags);
 
-	/* SCSI is sixth in the list, so bit 5 */
-	ut_asserteq(BIT(MMC_HUNTER) | BIT(5), std->hunters_used);
+	/* SCSI is 7th in the list, so bit 6 */
+	ut_asserteq(BIT(MMC_HUNTER) | BIT(6), std->hunters_used);
 
 	ut_assertok(bootdev_next_label(&iter, &dev, &mflags));
 	ut_assert_console_end();
@@ -596,7 +599,7 @@ static int bootdev_test_next_label(struct unit_test_state *uts)
 		    mflags);
 
 	/* dhcp: Ethernet is first so bit 0 */
-	ut_asserteq(BIT(MMC_HUNTER) | BIT(5) | BIT(0), std->hunters_used);
+	ut_asserteq(BIT(MMC_HUNTER) | BIT(6) | BIT(0), std->hunters_used);
 
 	ut_assertok(bootdev_next_label(&iter, &dev, &mflags));
 	ut_assert_console_end();
@@ -606,7 +609,7 @@ static int bootdev_test_next_label(struct unit_test_state *uts)
 		    mflags);
 
 	/* pxe: Ethernet is first so bit 0 */
-	ut_asserteq(BIT(MMC_HUNTER) | BIT(5) | BIT(0), std->hunters_used);
+	ut_asserteq(BIT(MMC_HUNTER) | BIT(6) | BIT(0), std->hunters_used);
 
 	mflags = 123;
 	ut_asserteq(-ENODEV, bootdev_next_label(&iter, &dev, &mflags));
@@ -614,7 +617,7 @@ static int bootdev_test_next_label(struct unit_test_state *uts)
 	ut_assert_console_end();
 
 	/* no change */
-	ut_asserteq(BIT(MMC_HUNTER) | BIT(5) | BIT(0), std->hunters_used);
+	ut_asserteq(BIT(MMC_HUNTER) | BIT(6) | BIT(0), std->hunters_used);
 
 	return 0;
 }
diff --git a/test/boot/bootstd_common.h b/test/boot/bootstd_common.h
index 136a79b5178..4a126e43ff4 100644
--- a/test/boot/bootstd_common.h
+++ b/test/boot/bootstd_common.h
@@ -21,7 +21,7 @@
 #define TEST_VERNUM		0x00010002
 
 enum {
-	MAX_HUNTER	= 8,
+	MAX_HUNTER	= 9,
 	MMC_HUNTER	= 3,	/* ID of MMC hunter */
 };
 
-- 
2.39.1.456.gfc5497dd1b-goog



More information about the U-Boot mailing list