Download raw body.
sys/qcpas: avoid not described interrupt and improve logging
tech@,
Here a diff from my tree which I've tested and used on my Snapdragon
machine for weeks. It contains a few chunks.
The first chunk avoid to establish an interrupt which isn't described in
DTS, and the onther chunks simple improve logging.
Feedback? Ok?
Index: sys/dev/fdt/qcpas.c
===================================================================
RCS file: /home/cvs/src/sys/dev/fdt/qcpas.c,v
diff -u -p -r1.8 qcpas.c
--- sys/dev/fdt/qcpas.c 8 Nov 2024 21:13:34 -0000 1.8
+++ sys/dev/fdt/qcpas.c 2 Mar 2025 20:29:52 -0000
@@ -193,7 +193,10 @@ qcpas_attach(struct device *parent, stru
qcpas_intr_establish(sc, 2, "ready", qcpas_intr_ready);
qcpas_intr_establish(sc, 3, "handover", qcpas_intr_handover);
qcpas_intr_establish(sc, 4, "stop-ack", qcpas_intr_stop_ack);
- qcpas_intr_establish(sc, 5, "shutdown-ack", qcpas_intr_shutdown_ack);
+ /* x1e80100.dtsi hasn't got it only sc8280xp.dtsi has it */
+ if (OF_is_compatible(faa->fa_node, "qcom,sc8280xp-nsp1-pas")) {
+ qcpas_intr_establish(sc, 5, "shutdown-ack", qcpas_intr_shutdown_ack);
+ }
printf("\n");
@@ -243,7 +246,8 @@ qcpas_mountroot(struct device *self)
&dtb_fw, &dtb_fwlen);
if (error) {
printf("%s: failed to load %s: %d\n",
- sc->sc_dev.dv_xname, fwname, error);
+ sc->sc_dev.dv_xname,
+ fwname + strlen(fwname) + 1, error);
return;
}
}
@@ -265,15 +269,20 @@ qcpas_mountroot(struct device *self)
clock_enable(sc->sc_node, "xo");
if (sc->sc_dtb_pas_id) {
- qcpas_mdt_init(sc, sc->sc_dtb_pas_id, dtb_fw, dtb_fwlen);
+ ret = qcpas_mdt_init(sc, sc->sc_dtb_pas_id, dtb_fw, dtb_fwlen);
free(dtb_fw, M_DEVBUF, dtb_fwlen);
+ if (ret != 0) {
+ printf("%s: failed to boot coprocessor (DTB): %d\n",
+ sc->sc_dev.dv_xname, ret);
+ return;
+ }
}
ret = qcpas_mdt_init(sc, sc->sc_pas_id, fw, fwlen);
free(fw, M_DEVBUF, fwlen);
if (ret != 0) {
- printf("%s: failed to boot coprocessor\n",
- sc->sc_dev.dv_xname);
+ printf("%s: failed to boot coprocessor: %d\n",
+ sc->sc_dev.dv_xname, ret);
return;
}
@@ -460,9 +469,11 @@ qcpas_mdt_init(struct qcpas_softc *sc, i
membar_producer();
- if (qcscm_pas_init_image(pas_id,
- QCPAS_DMA_DVA(sc->sc_metadata[idx])) != 0) {
- printf("%s: init image failed\n", sc->sc_dev.dv_xname);
+
+ error = qcscm_pas_init_image(pas_id, QCPAS_DMA_DVA(sc->sc_metadata[idx]));
+ if (error != 0) {
+ printf("%s: init image failed: 0x%x\n",
+ sc->sc_dev.dv_xname, error);
qcpas_dmamem_free(sc, sc->sc_metadata[idx]);
return EINVAL;
}
@@ -503,8 +514,10 @@ qcpas_mdt_init(struct qcpas_softc *sc, i
membar_producer();
- if (qcscm_pas_auth_and_reset(pas_id) != 0) {
- printf("%s: auth and reset failed\n", sc->sc_dev.dv_xname);
+ error = qcscm_pas_auth_and_reset(pas_id);
+ if (error != 0) {
+ printf("%s: auth and reset failed: %d\n",
+ sc->sc_dev.dv_xname, error);
qcpas_dmamem_free(sc, sc->sc_metadata[idx]);
return EINVAL;
}
sys/qcpas: avoid not described interrupt and improve logging