mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Katsuhiro Suzuki <katsuhiro@katsuster.net>,
	Heiko Stuebner <heiko@sntech.de>
Cc: linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] arm64: dts: rockchip: enable HDMI sound nodes for rk3328-rock64
Date: Tue, 1 Sep 2020 13:25:04 +0100	[thread overview]
Message-ID: <cca43999-fd73-2a71-a4f8-894a44f03032@arm.com> (raw)
In-Reply-To: <0e1c3467-0ba0-6b82-4227-40959f0c4b0e@katsuster.net>

On 2020-08-31 02:26, Katsuhiro Suzuki wrote:
> On 2020/08/31 4:16, Heiko Stuebner wrote:
>> Hi,
>>
>> Am Sonntag, 2. August 2020, 17:42:31 CEST schrieb Katsuhiro Suzuki:
>>> This patch enables HDMI sound (I2S0) and Analog sound (I2S1) which
>>> are defined in rk3328.dtsi, and replace SPDIF nodes.
>>>
>>> We can use SPDIF pass-through with suitable ALSA settings and on
>>> mpv or other media players.
>>>    - Settings: 
>>> https://github.com/LibreELEC/LibreELEC.tv/blob/master/projects/Rockchip/filesystem/usr/share/alsa/cards/SPDIF.conf 
>>>
>>>    - Ex.: mpv foo.ac3 --audio-spdif=ac3 
>>> --audio-device='alsa/SPDIF.pcm.iec958.0:SPDIF'
>>>
>>> [Why use simple-audio-card for SPDIF?]
>>>
>>> For newly adding nodes, ASoC guys recommend to use audio-graph-card.
>>> But all other sound nodes for rk3328 have already been defined by
>>> simple-audio-card. In this time, I chose for consistent sound nodes.
>>>
>>> [DMA allocation problem]
>>>
>>> After this patch is applied, UART2 will fail to allocate DMA resources
>>> but UART driver can work fine without DMA.
>>>
>>> This error is related to the DMAC of rk3328 (pl330 or compatible).
>>> DMAC connected to 16 DMA sources. Each sources have ID number that is
>>> called 'Req number' in rk3328 TRM. After this patch is applied total 7
>>> of DMA sources will be activated as follows:
>>>
>>> | Req number | Source | Required  |
>>> |            |        | channels  |
>>> |------------+--------+-----------|
>>> |  8,  9     | SPI0   | 2ch       |
>>> | 11, 12     | I2S0   | 2ch       |
>>> | 14, 15     | I2S1   | 2ch       |
>>> |     10     | SPDIF  | 1ch       |
>>> |------------+--------+-----------|
>>> |            | Total  | 7ch       |
>>> |------------+--------+-----------|
>>> |  6,  7     | UART2  | 2ch       | -> cannot get DMA channels
>>>
>>> Due to rk3328 DMAC specification we can use max 8 channels at same
>>> time. If SPI0/I2S0/I2S1/SPDIF will be activated by this patch,
>>> required DMAC channels reach to 7. So the last two channels (for
>>> UART2) cannot get DMA resources.
>>
>> Wouldn't the dma allocation depend on the probe ordering?
>> Or is this predetermined, so that always uart2 looses its dmas?
>>
> 
> Ah, it's depends on probe ordering when users use kernel modules...
> 
> It's better to disable DMA channels for UART2 for avoiding problem.
> I'll fix and resend patch.

FWIW it seems that since 089b6d365491, DMA is effectively disabled for 
UART2 anyway (unless the user goes out of their way to repurpose it), so 
maybe this is no longer such an immediate concern?

Robin.

  reply	other threads:[~2020-09-01 12:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-02 15:42 Katsuhiro Suzuki
2020-08-30 19:16 ` Heiko Stuebner
2020-08-31  1:26   ` Katsuhiro Suzuki
2020-09-01 12:25     ` Robin Murphy [this message]
2021-01-09 15:39 ` Heiko Stuebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cca43999-fd73-2a71-a4f8-894a44f03032@arm.com \
    --to=robin.murphy@arm.com \
    --cc=heiko@sntech.de \
    --cc=katsuhiro@katsuster.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®