Skip to contentSkip to conversation

fsl-imx6ul: add SAI1/2/3 and ASRC as unimplemented devices

PATCH Superseded Guenter Roeck 2 participants 2 messages Aug 10, 2021 Arm i.MX and Layerscape

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fsl-imx6ul: add SAI1/2/3 and ASRC as unimplemented devices

Define SAI1/2/3 and ASRC as unimplemented devices to avoid random Linux kernel crashes.

---
 hw/arm/fsl-imx6ul.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
hw/arm/fsl-imx6ul.c +12 -0
index e0128d7316..48b60eb3ce 100644
@@ -534,6 +534,13 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
      */
     create_unimplemented_device("sdma", FSL_IMX6UL_SDMA_ADDR, 0x4000);
 
+    /*
+     * SAI
+     */
+    create_unimplemented_device("sai1", FSL_IMX6UL_SAI1_ADDR, 0x4000);
+    create_unimplemented_device("sai2", FSL_IMX6UL_SAI2_ADDR, 0x4000);
+    create_unimplemented_device("sai3", FSL_IMX6UL_SAI3_ADDR, 0x4000);
+
     /*
      * PWM
      */
@@ -542,6 +549,11 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
     create_unimplemented_device("pwm3", FSL_IMX6UL_PWM3_ADDR, 0x4000);
     create_unimplemented_device("pwm4", FSL_IMX6UL_PWM4_ADDR, 0x4000);
 
+    /*
+     * ASRC
+     */
+    create_unimplemented_device("asrc", FSL_IMX6UL_ASRC_ADDR, 0x4000);
+
     /*
      * CAN
      */
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Guenter,

Quoted 2 lines · Guenter Roeck

Define SAI1/2/3 and ASRC as unimplemented devices to avoid random Linux kernel crashes.

Relevant dmesg output could be useful.

Quoted 10 lines
---
 hw/arm/fsl-imx6ul.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
hw/arm/fsl-imx6ul.c +0 -0
index e0128d7316..48b60eb3ce 100644

hw/arm/fsl-imx6ul.c static void fsl_imx6ul_realize(DeviceState *dev, Error **errp) · line 538

Quoted 5 lines
hw/arm/fsl-imx6ul.c +2 -0
@@ -534,6 +534,13 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
      */
     create_unimplemented_device("sdma", FSL_IMX6UL_SDMA_ADDR, 0x4000);
 
+    /*
+     * SAI

"Audio SSI (Synchronous Serial Interface)"

hw/arm/fsl-imx6ul.c static void fsl_imx6ul_realize(DeviceState *dev, Error **errp) · line 542

Quoted 4 lines
hw/arm/fsl-imx6ul.c +4 -0
+     */
+    create_unimplemented_device("sai1", FSL_IMX6UL_SAI1_ADDR, 0x4000);
+    create_unimplemented_device("sai2", FSL_IMX6UL_SAI2_ADDR, 0x4000);
+    create_unimplemented_device("sai3", FSL_IMX6UL_SAI3_ADDR, 0x4000);

Hmm I see these named SSI[123] in the datasheet.

The Synchronous Serial Interface (SSI) is a full-duplex serial port that allows communication with external devices using a variety of serial protocols. The SSI supports a wide variety of protocols (SSI normal, SSI network, I2S, and AC-97), bit depths (up to 24 bits per word), and clock/frame sync options.

The three SSIs may support three audio streams (possibly at different sample rates) simultaneously. SSI1, SSI2 and SSI3 are located on the Shared Peripheral Bus. Since the SDMA can directly access SSI1...SSI3 (being on the Shared Peripheral Bus), they can be used for high-bandwidth data transfers in order to optimize bus bandwidth consumption.

Since QEMU models SPI devices in hw/ssi/, having the devices named "sai*" is OK.

hw/arm/fsl-imx6ul.c static void fsl_imx6ul_realize(DeviceState *dev, Error **errp) · line 553

Quoted 10 lines
hw/arm/fsl-imx6ul.c +3 -0
+
     /*
      * PWM
      */
@@ -542,6 +549,11 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
     create_unimplemented_device("pwm3", FSL_IMX6UL_PWM3_ADDR, 0x4000);
     create_unimplemented_device("pwm4", FSL_IMX6UL_PWM4_ADDR, 0x4000);
 
+    /*
+     * ASRC

"Audio ASRC (asynchronous sample rate converter)"

Preferably updating the descriptions:

Quoted 7 lines
hw/arm/fsl-imx6ul.c +3 -0
+     */
+    create_unimplemented_device("asrc", FSL_IMX6UL_ASRC_ADDR, 0x4000);
+
     /*
      * CAN
      */