-
Notifications
You must be signed in to change notification settings - Fork 18
add pixel kernel support #5
Comments
I'm now at the point where I can observe a panic attempting to mount an unspecified rootfs, but only via attaching a breakpoint to |
I FINALLY have pixel 3 kernel booting in QEMU! The SCM driver is problematic, as it's not really set up to simply disable diff --git a/arch/arm64/configs/b1c1_defconfig b/arch/arm64/configs/b1c1_defconfig
index 7fe71e955b6b..d31a64a00a3b 100644
--- a/arch/arm64/configs/b1c1_defconfig
+++ b/arch/arm64/configs/b1c1_defconfig
@@ -80,7 +80,6 @@ CONFIG_SWP_EMULATION=y
CONFIG_CP15_BARRIER_EMULATION=y
CONFIG_SETEND_EMULATION=y
# CONFIG_ARM64_VHE is not set
-CONFIG_RANDOMIZE_BASE=y
# CONFIG_EFI is not set
CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE=y
CONFIG_BUILD_ARM64_DTC="dtc"
@@ -338,6 +337,8 @@ CONFIG_FPR_FPC=y
# CONFIG_LEGACY_PTYS is not set
# CONFIG_DEVMEM is not set
# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_MSM_GENI=y
CONFIG_SERIAL_MSM_GENI_CONSOLE=y
CONFIG_DIAG_CHAR=y
@@ -601,6 +602,8 @@ CONFIG_NLS_ISO8859_1=y
CONFIG_PRINTK_TIME=y
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF4=y
+CONFIG_GDB_SCRIPTS=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DETECT_HUNG_TASK=y
CONFIG_PANIC_TIMEOUT=1
diff --git a/drivers/soc/qcom/scm-boot.c b/drivers/soc/qcom/scm-boot.c
index 369fb27ff447..c8dd34006649 100644
--- a/drivers/soc/qcom/scm-boot.c
+++ b/drivers/soc/qcom/scm-boot.c
@@ -15,6 +15,8 @@
#include <soc/qcom/scm.h>
#include <soc/qcom/scm-boot.h>
+#ifdef CONFIG_QCOM_SCM
+
/*
* Set the cold/warm boot address for one of the CPU cores.
*/
@@ -109,3 +111,4 @@ int scm_is_mc_boot_available(void)
return scm_is_call_available(SCM_SVC_BOOT, SCM_BOOT_ADDR_MC);
}
EXPORT_SYMBOL(scm_is_mc_boot_available);
+#endif // CONFIG_QCOM_SCM
diff --git a/drivers/soc/qcom/scm.c b/drivers/soc/qcom/scm.c
index e6ab0d718d56..a74efdfab0c0 100644
--- a/drivers/soc/qcom/scm.c
+++ b/drivers/soc/qcom/scm.c
@@ -138,6 +138,8 @@ struct scm_response {
#endif
+#ifdef CONFIG_QCOM_SCM
+
/**
* scm_command_to_response() - Get a pointer to a scm_response
* @cmd: command
@@ -1260,3 +1262,5 @@ bool scm_is_secure_device(void)
return false;
}
EXPORT_SYMBOL(scm_is_secure_device);
+
+#endif // CONFIG_QCOM_SCM
diff --git a/include/soc/qcom/scm.h b/include/soc/qcom/scm.h
index fa64d5d38875..91357bf1644d 100644
--- a/include/soc/qcom/scm.h
+++ b/include/soc/qcom/scm.h
@@ -94,6 +94,10 @@ struct scm_desc {
u64 x5;
};
+#if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE) && defined(CONFIG_QCOM_SCM)
+#undef CONFIG_QCOM_SCM
+#endif
+
#ifdef CONFIG_QCOM_SCM
extern int scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf, size_t cmd_len,
void *resp_buf, size_t resp_len); $ ./aarch64-softmmu/qemu-system-aarch64 -machine virt,gic_version=3 -cpu cortex-a57 -nographic -smp 1 -append "console=ttyAMA0 root=/dev/ram0" -m 2048 -kernel /android0/kernel-blueline/out/android-msm-bluecross-4.9/private/msm-google/arch/arm64/boot/Image -initrd /android1/buildroot/output/images/rootfs.cpio
$ ./aarch64-softmmu/qemu-system-aarch64 --version
QEMU emulator version 2.10.95
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers |
It looks to be a bit simpler than that, actually. After you enable pl011, the problematic function is diff --git a/arch/arm64/configs/b1c1_defconfig b/arch/arm64/configs/b1c1_defconfig
index fb95698804ac..b858b2d2963e 100644
--- a/arch/arm64/configs/b1c1_defconfig
+++ b/arch/arm64/configs/b1c1_defconfig
@@ -323,6 +323,8 @@ CONFIG_FPR_FPC=y
# CONFIG_LEGACY_PTYS is not set
# CONFIG_DEVMEM is not set
# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_MSM_GENI=y
CONFIG_SERIAL_MSM_GENI_CONSOLE=y
CONFIG_HW_RANDOM_MSM_LEGACY=y
@@ -528,7 +530,7 @@ CONFIG_QCOM_MEMORY_DUMP_V2=y
CONFIG_QCOM_BUS_SCALING=y
CONFIG_QCOM_BUS_CONFIG_RPMH=y
CONFIG_QCOM_SECURE_BUFFER=y
-CONFIG_QCOM_EARLY_RANDOM=y
+CONFIG_QCOM_EARLY_RANDOM=n
CONFIG_MSM_SMEM=y
CONFIG_MSM_GLINK=y
CONFIG_MSM_GLINK_LOOPBACK_SERVER=y It works, until it crashes since I didn't supply a userspace:
|
Yes but...
IIRC, that also involved an |
That comes from:
I'm not sure there are smc calls involved there, but perhaps there are? Moving the rng init calls to happen 4 seconds after the system has booted in a delayed work struct (not that this actually makes sense for the rng) doesn't make the problem go away; that tasks hangs indefinitely. This is testing, by the way, with qemu's So I suppose there are two routes: augment qemu's trustzone stuff to include a bunch of qcom functions, or figure out how to conditionalize calling smc in the first place. I assume it's not called by other drivers, for example, because their probe function fails before it can get to that point. |
Hi, Without trying to necro-bump this issue (it's still open). Does anyone tried to do the same thing with a Pixel 4a kernel ? After successfully testing your solutions (enabling PL011 and disabling QCOM_EARLY_RANDOM) on a Pixel 3 kernel, I tried the same thing on a Pixel 4a but not logs. (on qemu v7.0.0-1586-g9b1f588549, for cortex-a76) |
predicated on booting those in qemu, which is itself an effort. WIP
The text was updated successfully, but these errors were encountered: