Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Dec 2017 23:11:01 +0100
From:      Sylvain Garrigues <sylgar@gmail.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Alexey Dokuchaev <danfe@nsu.ru>, freebsd-arm@freebsd.org
Subject:   Re: How to use our stock armv7-RPI2 images with QEMU?
Message-ID:  <E3F1EBB2-67E0-4B45-AE9A-55831B3FAC53@gmail.com>
In-Reply-To: <CANCZdfqmcce%2B%2B=4dbQ07%2B7pGrryE00hfzuPeu%2BAqaa65ZBLznQ@mail.gmail.com>
References:  <07FDE656-3DBA-4EB6-80F5-A7E25051DB37@gmail.com> <CANCZdfqmcce%2B%2B=4dbQ07%2B7pGrryE00hfzuPeu%2BAqaa65ZBLznQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_683BFFD4-2A66-4B1C-BF0F-FEDDF55D9DC0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Le 19 d=C3=A9c. 2017 =C3=A0 22:36, Warner Losh <imp@bsdimp.com> a =C3=A9cr=
it :
> Any chance the uboot image could be used for the kernel?

As far as I remember, the current u-boot is stuck in an infinite loop =
when run in qemu with -kernel u-boot.bin -machine raspi2, during u-boot =
mmc initialization.=20

The attached ugly patch made u-boot able to go further and recognize =
partitions on the sd image attached to qemu in raspi2 configuration. =
This patch was just for fun, I don=E2=80=99t know what side effects it =
may have. I actually tested it successfully with qemu aarch64 to load =
loader.efi from the RPI3 aarch64 snapshot, but I=E2=80=99m pretty sure =
the same patch would allow u-boot to load loader from an RPI2 armv7 =
snapshot.

Sylvain

--Apple-Mail=_683BFFD4-2A66-4B1C-BF0F-FEDDF55D9DC0
Content-Disposition: attachment;
	filename=u-boot_qemu_raspi2.patch
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="u-boot_qemu_raspi2.patch"
Content-Transfer-Encoding: 7bit

--- u-boot-c253573/include/configs/rpi.h	2017-11-14 02:08:06.000000000 +0100
+++ u-boot.good/include/configs/rpi.h	2017-11-16 22:28:04.792837000 +0100
@@ -149,9 +149,7 @@
 
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 0) \
-	func(USB, usb, 0) \
-	func(PXE, pxe, na) \
-	func(DHCP, dhcp, na)
+	func(USB, usb, 0)
 #include <config_distro_bootcmd.h>
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
--- u-boot-c253573/include/config_distro_bootcmd.h	2017-11-14 02:08:06.000000000 +0100
+++ u-boot.good/include/config_distro_bootcmd.h	2017-11-16 22:21:44.676970000 +0100
@@ -390,8 +390,4 @@
 			"run bootcmd_${target}; "                         \
 		"done\0"
 
-#ifndef CONFIG_BOOTCOMMAND
-#define CONFIG_BOOTCOMMAND "run distro_bootcmd"
-#endif
-
 #endif  /* _CONFIG_CMD_DISTRO_BOOTCMD_H */
--- u-boot-c253573/drivers/mmc/bcm2835_sdhci.c	2017-11-14 02:08:06.000000000 +0100
+++ u-boot.good/drivers/mmc/bcm2835_sdhci.c	2017-11-16 22:05:42.589896000 +0100
@@ -79,11 +79,6 @@
 	 * (Which is just as well - otherwise we'd have to nobble the DMA engine
 	 * too)
 	 */
-	if (reg != SDHCI_BUFFER) {
-		while (timer_get_us() - bcm_host->last_write <
-		       bcm_host->twoticks_delay)
-			;
-	}
 
 	writel(val, host->ioaddr + reg);
 	bcm_host->last_write = timer_get_us();
--- u-boot-c253573/lib/time.c	2017-11-14 02:08:06.000000000 +0100
+++ u-boot.good/lib/time.c	2017-11-16 22:05:25.047340000 +0100
@@ -150,12 +150,6 @@
 
 void __weak __udelay(unsigned long usec)
 {
-	uint64_t tmp;
-
-	tmp = get_ticks() + usec_to_tick(usec);	/* get current timestamp */
-
-	while (get_ticks() < tmp+1)	/* loop till event */
-		 /*NOP*/;
 }
 
 /* ------------------------------------------------------------------------- */
--- u-boot-c253573/Kconfig	2017-11-14 02:08:06.000000000 +0100
+++ u-boot.good/Kconfig	2017-11-16 22:16:47.845851000 +0100
@@ -130,7 +130,7 @@
 	  environments which can tolerate a "non-standard" U-Boot.
 	  Use this only if you really know what you are doing.
 
-if EXPERT
+if 1
 	config SYS_MALLOC_CLEAR_ON_INIT
 	bool "Init with zeros the memory reserved for malloc (slow)"
 	default y
--- u-boot-c253573/drivers/usb/Kconfig	2017-11-14 02:08:06.000000000 +0100
+++ u-boot.good/drivers/usb/Kconfig	2017-11-16 22:17:08.072527000 +0100
@@ -71,7 +71,7 @@
 	  Say Y here if you want to use a USB keyboard for U-Boot command line
 	  input.
 
-if USB_KEYBOARD
+if 1
 
 choice
 	prompt "USB keyboard polling"

--Apple-Mail=_683BFFD4-2A66-4B1C-BF0F-FEDDF55D9DC0--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E3F1EBB2-67E0-4B45-AE9A-55831B3FAC53>