HiFiBerry .dts file for i.MX8M should not work?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HiFiBerry .dts file for i.MX8M should not work?

Jump to solution
1,193 Views
JohnOldfield
Contributor II

In imx_5.4.70_2.3.0 branch there is a DTS file for the HiFiBerry Raspberry Pi audio HAT to support i.MX8MNano EVK:

https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8mn-evk-h...

I don't see how this could work because:

1) Pin 12 on EVK expansion connector, which Pi HATs need for I2S BCLK, routes to an I2C-connected GPIO expander, not to an SAI5 pin.

2) The alternate mode settings for SAI5 pins in the .dts don't map correctly to the other required Pi HAT I2S pins (pins 35, 38 & 40) except for RxD0.

Can anyone confirm whether this .dts file was tested with a HiFiBerry HAT. Or, can anyone confirm whether this is intended to be used only with a modified HiFiBerry with cuts and jumpers to reroute the I2S pins?

Note: Similar questions should also apply to two other .dts files:

https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8mn-evk-i...

https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm64/boot/dts/freescale/imx8mn-evk-i...

 

0 Kudos
Reply
1 Solution
1,149 Views
JohnOldfield
Contributor II

Answering my own question:

I can confirm that to use this device tree file with a HiFiBerry DAC+ audio hat, you must modify the DAC+ board, or make an adapter for the 2x20 pin header, to re-route the I2S related pins to match what Raspberry Pi hats expect. The affected pins on the 2x20 pin header are 12, 35, 38 & 40.

This is because on the EVK's 2x20 pin expansion header, the pins from SAI5, even with the alternate GPIO pin mode settings specified in the .dts file, appear on different pins. The I2C pins work fine as-is.

Also note:

There is a regular and Pro version of the DAC+ board. The Pro version includes two oscillators. The original HiFiBerry DAC+ device driver for Raspberry Pi auto-detects whether you have a Pro or regular version of the DAC+ board, but the NXP driver imx-pcm512x.c does not, and assumes a Pro.

To use a regular DAC+ hat, you need to comment out the two lines in the .dts file selecting bitclock-master and frame-master to force slave mode, and also comment out the two lines defining the two non-existent external oscillators.

View solution in original post

0 Kudos
Reply
3 Replies
1,150 Views
JohnOldfield
Contributor II

Answering my own question:

I can confirm that to use this device tree file with a HiFiBerry DAC+ audio hat, you must modify the DAC+ board, or make an adapter for the 2x20 pin header, to re-route the I2S related pins to match what Raspberry Pi hats expect. The affected pins on the 2x20 pin header are 12, 35, 38 & 40.

This is because on the EVK's 2x20 pin expansion header, the pins from SAI5, even with the alternate GPIO pin mode settings specified in the .dts file, appear on different pins. The I2C pins work fine as-is.

Also note:

There is a regular and Pro version of the DAC+ board. The Pro version includes two oscillators. The original HiFiBerry DAC+ device driver for Raspberry Pi auto-detects whether you have a Pro or regular version of the DAC+ board, but the NXP driver imx-pcm512x.c does not, and assumes a Pro.

To use a regular DAC+ hat, you need to comment out the two lines in the .dts file selecting bitclock-master and frame-master to force slave mode, and also comment out the two lines defining the two non-existent external oscillators.

0 Kudos
Reply
1,132 Views
JohnOldfield
Contributor II

Another follow up in case anyone wants to build on this .dts file to use a Raspberry Pi audio hat that has input audio as well as output (i.e. something other than a DAC-only hat).

In the included imx8mn-evk.dts, where &sai5 is defined, you must comment out the line:
     fsl,sai-asynchronous;

With this line in, sai5 gets configured to require separate clock & sync for Rx and Tx, which won't work with Raspberry Pi hats since the 2x20 expansion connector only provides the Tx clock & sync pins.

Commenting out this line reverts to the default where Rx shares the Tx clock & sync pin.

Tags (1)
0 Kudos
Reply
1,182 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello JohnOldfield,

Yes, This is a based dtb to HiFiBerry, but they are not tested, since you find they are routing the i2s in a bad way, I will say to developers to fix it.

 

Regards

 

0 Kudos
Reply