Device Tree Configuration

JH7110 platform stores all DMIC configuration in the device tree of the kernel. The device tree is listed as follows:
/freelight-u-sdk/linux/arch/riscv/boot/dts/starfive/jh7110.dtsi 
For example, the device tree configuration of JH7110 is as follows:
i2stx: i2stx@100c0000 {
compatible = "snps,designware-i2stx";
reg = <0x0 0x100c0000 0x0 0x1000>;
       interrupt-names = "tx";
       #sound-dai-cells = <0>;
       dmas = <&dma 28 1>;
       dma-names = "rx";
       status = "disabled";
};

i2srx_3ch: i2srx_3ch@100e0000 {
compatible = "snps,designware-i2srx";
       reg = <0x0 0x100e0000 0x0 0x1000>;
       clocks = <&clkgen JH7110_APB0>,
                <&clkgen JH7110_I2SRX0_3CH_CLK_APB>,
                <&clkgen JH7110_AUDIO_ROOT>,
                <&clkgen JH7110_MCLK_INNER>,
                <&clkgen JH7110_I2SRX_3CH_BCLK_MST>,
                <&clkgen JH7110_I2SRX_3CH_LRCK_MST>,
                <&clkgen JH7110_I2SRX0_3CH_BCLK>,
                <&clkgen JH7110_I2SRX0_3CH_LRCK>,
                <&clkgen JH7110_MCLK>,
                <&i2srx_bclk_ext>,
                <&i2srx_lrck_ext>;
       clock-names = "apb0", "3ch-apb",
                     "audioroot", "mclk-inner",
                     "bclk_mst", "3ch-lrck",
                     "rx-bclk", "rx-lrck",
                     "mclk", "bclk-ext",
                     "lrck-ext";
       resets = <&rstgen RSTN_U0_I2SRX_3CH_APB>,
                <&rstgen RSTN_U0_I2SRX_3CH_BCLK>;
       dmas = <&dma 24 1>;
       dma-names = "rx";
       starfive,sys-syscon = <&sys_syscon 0x18 0x34>;
       #sound-dai-cells = <0>;
       status = "disabled";
};

i2stx_4ch0: i2stx_4ch0@120b0000 {
       compatible = "snps,designware-i2stx-4ch0";
       reg = <0x0 0x120b0000 0x0 0x1000>;
       clocks = <&clkgen JH7110_MCLK_INNER>,
                <&clkgen JH7110_I2STX_4CH0_BCLK_MST>,
                <&clkgen JH7110_I2STX_4CH0_LRCK_MST>,
                <&clkgen JH7110_MCLK>,
                <&clkgen JH7110_I2STX0_4CHBCLK>,
                <&clkgen JH7110_I2STX0_4CHLRCK>;
       clock-names = "inner", "bclk-mst",
                     "lrck-mst", "mclk",
                     "bclk0", "lrck0";
       resets = <&rstgen RSTN_U0_I2STX_4CH_APB>,
                <&rstgen RSTN_U0_I2STX_4CH_BCLK>;
       dmas = <&dma 47 1>;
       dma-names = "tx";
       #sound-dai-cells = <0>;
       status = "disabled";
};

i2stx_4ch1: i2stx_4ch1@120c0000 {
compatible = "snps,designware-i2stx-4ch1";
       reg = <0x0 0x120c0000 0x0 0x1000>;
       clocks = <&clkgen JH7110_AUDIO_ROOT>,
                <&clkgen JH7110_MCLK_INNER>,
                <&clkgen JH7110_I2STX_4CH1_BCLK_MST>,
                <&clkgen JH7110_I2STX_4CH1_LRCK_MST>,
                <&clkgen JH7110_MCLK>,
                <&clkgen JH7110_I2STX1_4CHBCLK>,
                <&clkgen JH7110_I2STX1_4CHLRCK>,
                <&clkgen JH7110_MCLK_OUT>,
                <&clkgen JH7110_APB0>,
                <&clkgen JH7110_I2STX1_4CHCLK_APB>,
                <&mclk_ext>,
                <&i2stx_bclk_ext>,
                <&i2stx_lrck_ext>;
       clock-names = "audroot", "mclk_inner", "bclk_mst",
                     "lrck_mst", "mclk", "4chbclk",
                     "4chlrck", "mclk_out",
                     "apb0", "clk_apb",
                     "mclk_ext", "bclk_ext", "lrck_ext";
       resets = <&rstgen RSTN_U1_I2STX_4CH_APB>,
                <&rstgen RSTN_U1_I2STX_4CH_BCLK>;
       dmas = <&dma 48 1>;
       dma-names = "tx";
       #sound-dai-cells = <0>;
       status = "disabled";
};
The following list provides more information for the different nodes in the code block.
  • reg: The basic address and the max offset of the module.
  • clocks: The clocks used by the module. Usually, this parameter is filled with the system clock source or the clock of the module.
  • resets: The reset items used by the module.
  • dmas: The DMA channel used by the module.

    For example, in the code <&dma 48 1>, 48 indicates channel number; 1 indicates burst length is 4.

  • dma-names: The names of the DMA channels, including "rx" for the receiver channel and "tx" for the transceiver channel.
  • status: The status of the module.
    • okay: The module is enabled.
    • disabled: The module is disabled.
  • other: Other parameters for sound card registration and association.
    CAUTION: Do not change this parameter!