mbox series

[0/8] Support for NVDEC on Tegra234

Message ID 20220906132823.2390953-1-cyndis@kapsi.fi (mailing list archive)
Headers show
Series Support for NVDEC on Tegra234 | expand

Message

Mikko Perttunen Sept. 6, 2022, 1:28 p.m. UTC
From: Mikko Perttunen <mperttunen@nvidia.com>

Hi all,

this series adds support for the HW video decoder, NVDEC,
on Tegra234 (Orin). The main change is a switch from Falcon
to RISC-V for the internal microcontroller, which brings along
a change in how the engine is booted. Otherwise it is backwards
compatible with earlier versions.

In previous iterations, firmware was simply loaded from disk and
written into engine internal memory. Now, the engine has a
bootrom that loads the firmware from a carveout where it has been
loaded by the system bootloader; however, we still need to tell it
where that carveout is loaded and some offsets into it. For that,
the first patch adds a new memory controller API to query the
carveout address. The offsets are read from device tree -- the
expectation is that at flashing time (when the firmware is also
flashed), the flasher also delivers a device tree overlay with
values corresponding to the flashed firmware.

The currently available Linux for Tegra release doesn't yet
include this device tree overlay flashing, and the firmware version
it contains is incompatible with this series. The plan is to fix
that for the next Linux for Tegra release, but if necessary, we
can postpone merging of this series to once those changes are
available.

Thanks!
Mikko

Mikko Perttunen (8):
  memory: tegra: Add API for retrieving carveout bounds
  dt-bindings: Add headers for NVDEC on Tegra234
  dt-bindings: Add bindings for Tegra234 NVDEC
  arm64: tegra: Add NVDEC on Tegra234
  gpu: host1x: Add stream ID register data for NVDEC on Tegra234
  drm/tegra: nvdec: Support multiple clocks
  drm/tegra: Add code for booting RISC-V based engines
  drm/tegra: Add Tegra234 support to NVDEC driver

 .../gpu/host1x/nvidia,tegra210-nvdec.yaml     | 118 ++++++++++--
 arch/arm64/boot/dts/nvidia/tegra234.dtsi      |  27 +++
 drivers/gpu/drm/tegra/Makefile                |   3 +-
 drivers/gpu/drm/tegra/drm.c                   |   1 +
 drivers/gpu/drm/tegra/nvdec.c                 | 171 +++++++++++++++---
 drivers/gpu/drm/tegra/riscv.c                 | 106 +++++++++++
 drivers/gpu/drm/tegra/riscv.h                 |  30 +++
 drivers/gpu/host1x/dev.c                      |  12 ++
 drivers/memory/tegra/mc.c                     |  23 +++
 drivers/memory/tegra/tegra234.c               |   5 +
 include/dt-bindings/clock/tegra234-clock.h    |   4 +
 include/dt-bindings/memory/tegra234-mc.h      |   3 +
 .../dt-bindings/power/tegra234-powergate.h    |   1 +
 include/dt-bindings/reset/tegra234-reset.h    |   1 +
 include/soc/tegra/mc.h                        |  11 ++
 15 files changed, 470 insertions(+), 46 deletions(-)
 create mode 100644 drivers/gpu/drm/tegra/riscv.c
 create mode 100644 drivers/gpu/drm/tegra/riscv.h

Comments

Krzysztof Kozlowski Sept. 6, 2022, 5:50 p.m. UTC | #1
On 06/09/2022 15:28, Mikko Perttunen wrote:
> From: Mikko Perttunen <mperttunen@nvidia.com>
> 
> Hi all,
> 
> this series adds support for the HW video decoder, NVDEC,
> on Tegra234 (Orin). The main change is a switch from Falcon
> to RISC-V for the internal microcontroller, which brings along
> a change in how the engine is booted. Otherwise it is backwards
> compatible with earlier versions.

You need to describe the dependencies, otherwise I would be free to go
with applying memory controllers part.

Best regards,
Krzysztof
Mikko Perttunen Sept. 7, 2022, 5:27 a.m. UTC | #2
On 9/6/22 20:50, Krzysztof Kozlowski wrote:
> On 06/09/2022 15:28, Mikko Perttunen wrote:
>> From: Mikko Perttunen <mperttunen@nvidia.com>
>>
>> Hi all,
>>
>> this series adds support for the HW video decoder, NVDEC,
>> on Tegra234 (Orin). The main change is a switch from Falcon
>> to RISC-V for the internal microcontroller, which brings along
>> a change in how the engine is booted. Otherwise it is backwards
>> compatible with earlier versions.
> 
> You need to describe the dependencies, otherwise I would be free to go
> with applying memory controllers part.

Hi Krzysztof,

the memory controller patch can be applied independently.

Thanks,
Mikko

> 
> Best regards,
> Krzysztof
Krzysztof Kozlowski Sept. 7, 2022, 10:58 a.m. UTC | #3
On 07/09/2022 07:27, Mikko Perttunen wrote:
> On 9/6/22 20:50, Krzysztof Kozlowski wrote:
>> On 06/09/2022 15:28, Mikko Perttunen wrote:
>>> From: Mikko Perttunen <mperttunen@nvidia.com>
>>>
>>> Hi all,
>>>
>>> this series adds support for the HW video decoder, NVDEC,
>>> on Tegra234 (Orin). The main change is a switch from Falcon
>>> to RISC-V for the internal microcontroller, which brings along
>>> a change in how the engine is booted. Otherwise it is backwards
>>> compatible with earlier versions.
>>
>> You need to describe the dependencies, otherwise I would be free to go
>> with applying memory controllers part.
> 
> Hi Krzysztof,
> 
> the memory controller patch can be applied independently.

OK then... but looking at the code it does not seem to. Anyway kbuild
robot complained so I expect v2.

Best regards,
Krzysztof
Mikko Perttunen Sept. 7, 2022, 11:05 a.m. UTC | #4
On 7.9.2022 13.58, Krzysztof Kozlowski wrote:
> On 07/09/2022 07:27, Mikko Perttunen wrote:
>> On 9/6/22 20:50, Krzysztof Kozlowski wrote:
>>> On 06/09/2022 15:28, Mikko Perttunen wrote:
>>>> From: Mikko Perttunen <mperttunen@nvidia.com>
>>>>
>>>> Hi all,
>>>>
>>>> this series adds support for the HW video decoder, NVDEC,
>>>> on Tegra234 (Orin). The main change is a switch from Falcon
>>>> to RISC-V for the internal microcontroller, which brings along
>>>> a change in how the engine is booted. Otherwise it is backwards
>>>> compatible with earlier versions.
>>>
>>> You need to describe the dependencies, otherwise I would be free to go
>>> with applying memory controllers part.
>>
>> Hi Krzysztof,
>>
>> the memory controller patch can be applied independently.
> 
> OK then... but looking at the code it does not seem to. Anyway kbuild
> robot complained so I expect v2.

Ah, indeed, though patch 1 can be applied on top of current trees, patch 
8 does require patch 1 to be there first. Which is, thinking about it 
now, necessary information as well..

Thanks for the reviews.

Mikko

> 
> Best regards,
> Krzysztof