From 6f287c700c5fad924585dee1308477aa9e73ae50 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Tue, 10 Aug 2021 10:56:07 -0700 Subject: [PATCH] fsl-imx7: Instantiate SAI1/2/3 as unimplemented devices Instantiate SAI1/2/3 as unimplemented devices to avoid Linux kernel crashes such as the following. Unhandled fault: external abort on non-linefetch (0x808) at 0xd19b0000 pgd = (ptrval) [d19b0000] *pgd=82711811, *pte=308a0653, *ppte=308a0453 Internal error: : 808 [#1] SMP ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.14.0-rc5 #1 ... [] (regmap_mmio_write32le) from [] (regmap_mmio_write+0x3c/0x54) [] (regmap_mmio_write) from [] (_regmap_write+0x4c/0x1f0) [] (_regmap_write) from [] (regmap_write+0x3c/0x60) [] (regmap_write) from [] (fsl_sai_runtime_resume+0x9c/0x1ec) [] (fsl_sai_runtime_resume) from [] (__rpm_callback+0x3c/0x108) [] (__rpm_callback) from [] (rpm_callback+0x60/0x64) [] (rpm_callback) from [] (rpm_resume+0x5cc/0x808) [] (rpm_resume) from [] (__pm_runtime_resume+0x60/0xa0) [] (__pm_runtime_resume) from [] (fsl_sai_probe+0x2b8/0x65c) [] (fsl_sai_probe) from [] (platform_probe+0x58/0xb8) [] (platform_probe) from [] (really_probe.part.0+0x9c/0x334) [] (really_probe.part.0) from [] (__driver_probe_device+0xa0/0x138) [] (__driver_probe_device) from [] (driver_probe_device+0x30/0xc8) [] (driver_probe_device) from [] (__driver_attach+0x90/0x130) [] (__driver_attach) from [] (bus_for_each_dev+0x78/0xb8) [] (bus_for_each_dev) from [] (bus_add_driver+0xf0/0x1d8) [] (bus_add_driver) from [] (driver_register+0x88/0x118) [] (driver_register) from [] (do_one_initcall+0x7c/0x3a4) [] (do_one_initcall) from [] (kernel_init_freeable+0x198/0x22c) [] (kernel_init_freeable) from [] (kernel_init+0x10/0x128) [] (kernel_init) from [] (ret_from_fork+0x14/0x38) Signed-off-by: Guenter Roeck Message-id: 20210810175607.538090-1-linux@roeck-us.net Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/arm/fsl-imx7.c | 7 +++++++ include/hw/arm/fsl-imx7.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c index 2ff2cab924..149885f2b8 100644 --- a/hw/arm/fsl-imx7.c +++ b/hw/arm/fsl-imx7.c @@ -467,6 +467,13 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp) create_unimplemented_device("can1", FSL_IMX7_CAN1_ADDR, FSL_IMX7_CANn_SIZE); create_unimplemented_device("can2", FSL_IMX7_CAN2_ADDR, FSL_IMX7_CANn_SIZE); + /* + * SAI (Audio SSI (Synchronous Serial Interface)) + */ + create_unimplemented_device("sai1", FSL_IMX7_SAI1_ADDR, FSL_IMX7_SAIn_SIZE); + create_unimplemented_device("sai2", FSL_IMX7_SAI2_ADDR, FSL_IMX7_SAIn_SIZE); + create_unimplemented_device("sai2", FSL_IMX7_SAI3_ADDR, FSL_IMX7_SAIn_SIZE); + /* * OCOTP */ diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h index f5d527a490..1c5fa6fd67 100644 --- a/include/hw/arm/fsl-imx7.h +++ b/include/hw/arm/fsl-imx7.h @@ -174,6 +174,11 @@ enum FslIMX7MemoryMap { FSL_IMX7_UART6_ADDR = 0x30A80000, FSL_IMX7_UART7_ADDR = 0x30A90000, + FSL_IMX7_SAI1_ADDR = 0x308A0000, + FSL_IMX7_SAI2_ADDR = 0x308B0000, + FSL_IMX7_SAI3_ADDR = 0x308C0000, + FSL_IMX7_SAIn_SIZE = 0x10000, + FSL_IMX7_ENET1_ADDR = 0x30BE0000, FSL_IMX7_ENET2_ADDR = 0x30BF0000,