mbox series

[v6,0/7] Support Trusted Foundations firmware on Tegra30

Message ID 20190222193426.10747-1-digetx@gmail.com (mailing list archive)
Headers show
Series Support Trusted Foundations firmware on Tegra30 | expand

Message

Dmitry Osipenko Feb. 22, 2019, 7:34 p.m. UTC
Hello,

This patchset adds support for the Trusted Foundations firmware on
NVIDIA Tegra30. Pretty much all of Tegra30 consumer devices have that
firmware and upstream kernel can't boot on those devices without the
firmware support.

Changelog:

v6:     - One patch got messed up accidentally in v5, this is fixed now.

        - Squashed "Support L2 cache maintenance done via firmware" patch
          into the "Add firmware calls..." patch.

        - The l2x0_init() firmware callback is now invoked unconditionally
          because it is always a NO-OP on T114+ and is a NO-OP on T20/30
          if firmware node is missed in device-tree, hence there is no
          need to check the machine's DT compatible as it was done in the
          previous versions of the series.

v5:     - Fixed machine hanging on disabling D-cache during suspend,
          turned out there are slight variations in behaviour between
          firmware version in regards to cache-management. Thanks to
          Robert Yang for reporting the problem and helping with the
          solution.

v4:     - Fixed Thumb2-kernel hanging on Tegra20, turned out it was not a
          good idea to switch CPU into Thumb2 mode right after jumping into
          the reset handler.

        - Moved LP2-mode-set firmware call invocation to a later stage to
          better replicate what downstream kernel does. This change was
          suggested by Robert Yang and fixes system hang on Ouya game
          console.

        - Added references to the original work made by Michał Mirosław
          into commit messages of the relevant patches.

v3:     - Implemented suspend-resume support.

        - Reworked arm/firmware/trusted_foundations.c a tad. Now cache
          is getting properly initialized, cache enabling / disabling is
          supported.

v2:
        - The "Don't apply CPU erratas in insecure mode" patch got some
          cleanup, in particular resolved the messiness in
          __tegra_cpu_reset_handler_data.

        - Added a comment to tf_cache_write_sec(), justifying the warning
          message.

Dmitry Osipenko (7):
  ARM: trusted_foundations: Implement L2 cache initialization callback
  ARM: trusted_foundations: Make prepare_idle call to take mode argument
  ARM: trusted_foundations: Provide information about whether firmware
    is registered
  ARM: tegra: Set up L2 cache using Trusted Foundations firmware
  ARM: tegra: Don't apply CPU erratas in insecure mode
  ARM: tegra: Always boot CPU in ARM-mode
  ARM: tegra: Add firmware calls required for suspend-resume on Tegra30

 arch/arm/firmware/trusted_foundations.c    | 80 +++++++++++++++++++++-
 arch/arm/include/asm/firmware.h            |  2 +-
 arch/arm/include/asm/trusted_foundations.h | 13 ++++
 arch/arm/mach-tegra/cpuidle-tegra114.c     |  3 +-
 arch/arm/mach-tegra/pm.c                   | 49 +++++++++++++
 arch/arm/mach-tegra/reset-handler.S        | 50 +++++++++++---
 arch/arm/mach-tegra/reset.c                |  3 +
 arch/arm/mach-tegra/reset.h                |  9 ++-
 arch/arm/mach-tegra/sleep-tegra20.S        |  4 ++
 arch/arm/mach-tegra/sleep.S                | 14 ++--
 arch/arm/mach-tegra/tegra.c                |  2 +
 11 files changed, 207 insertions(+), 22 deletions(-)

Comments

Dmitry Osipenko Feb. 25, 2019, 5:21 a.m. UTC | #1
В Mon, 25 Feb 2019 05:02:33 +0100
Michał Mirosław <mirq-linux@rere.qmqm.pl> пишет:

> On Fri, Feb 22, 2019 at 10:34:19PM +0300, Dmitry Osipenko wrote:
> > Hello,
> > 
> > This patchset adds support for the Trusted Foundations firmware on
> > NVIDIA Tegra30. Pretty much all of Tegra30 consumer devices have
> > that firmware and upstream kernel can't boot on those devices
> > without the firmware support.  
> 
> Hi Dmitry
> 
> I've applied and tested this patchset on my TF300T. Boots and
> suspends/wakes using 'rtcwake -m mem -s 1 -d /dev/rtc1' as the test.
> dmesg attached.
> 
> The exact tree used:
> 	git://rere.qmqm.pl/linux tf300t
> 
> Feel free to add my Tested-by and Signed-off-by on the patches where
> apropriate, and thanks for your work!

Awesome, thank you very much!

Robert, could you please confirm that v6 works for you too?

I'll probably make a v7 with an extra minor clean up and then will add
all the appropriate tags to the patches.
Robert Yang Feb. 25, 2019, 4:58 p.m. UTC | #2
On Mon, Feb 25, 2019 at 08:21:55AM +0300, Dmitry Osipenko wrote:
> В Mon, 25 Feb 2019 05:02:33 +0100
> Michał Mirosław <mirq-linux@rere.qmqm.pl> пишет:
> 
> > On Fri, Feb 22, 2019 at 10:34:19PM +0300, Dmitry Osipenko wrote:
> > > Hello,
> > > 
> > > This patchset adds support for the Trusted Foundations firmware on
> > > NVIDIA Tegra30. Pretty much all of Tegra30 consumer devices have
> > > that firmware and upstream kernel can't boot on those devices
> > > without the firmware support.  
> > 
> > Hi Dmitry
> > 
> > I've applied and tested this patchset on my TF300T. Boots and
> > suspends/wakes using 'rtcwake -m mem -s 1 -d /dev/rtc1' as the test.
> > dmesg attached.
> > 
> > The exact tree used:
> > 	git://rere.qmqm.pl/linux tf300t
> > 
> > Feel free to add my Tested-by and Signed-off-by on the patches where
> > apropriate, and thanks for your work!
> 
> Awesome, thank you very much!
> 
> Robert, could you please confirm that v6 works for you too?
> 

Yes, v6 works on Ouya.

LP1/LP2 suspend tested with 'rtcwake -m mem -s 5'
cpuidle LP2 tested with 'echo 0 | tee /sys/devices/system/cpu/cpu[1-3]/online'
Tested with CONFIG_SMP disabled too.

You can add my Tested-by to this patch set.

> I'll probably make a v7 with an extra minor clean up and then will add
> all the appropriate tags to the patches.
Dmitry Osipenko Feb. 25, 2019, 5:55 p.m. UTC | #3
25.02.2019 19:58, Robert Yang пишет:
> On Mon, Feb 25, 2019 at 08:21:55AM +0300, Dmitry Osipenko wrote:
>> В Mon, 25 Feb 2019 05:02:33 +0100
>> Michał Mirosław <mirq-linux@rere.qmqm.pl> пишет:
>>
>>> On Fri, Feb 22, 2019 at 10:34:19PM +0300, Dmitry Osipenko wrote:
>>>> Hello,
>>>>
>>>> This patchset adds support for the Trusted Foundations firmware on
>>>> NVIDIA Tegra30. Pretty much all of Tegra30 consumer devices have
>>>> that firmware and upstream kernel can't boot on those devices
>>>> without the firmware support.  
>>>
>>> Hi Dmitry
>>>
>>> I've applied and tested this patchset on my TF300T. Boots and
>>> suspends/wakes using 'rtcwake -m mem -s 1 -d /dev/rtc1' as the test.
>>> dmesg attached.
>>>
>>> The exact tree used:
>>> 	git://rere.qmqm.pl/linux tf300t
>>>
>>> Feel free to add my Tested-by and Signed-off-by on the patches where
>>> apropriate, and thanks for your work!
>>
>> Awesome, thank you very much!
>>
>> Robert, could you please confirm that v6 works for you too?
>>
> 
> Yes, v6 works on Ouya.
> 
> LP1/LP2 suspend tested with 'rtcwake -m mem -s 5'
> cpuidle LP2 tested with 'echo 0 | tee /sys/devices/system/cpu/cpu[1-3]/online'
> Tested with CONFIG_SMP disabled too.
> 
> You can add my Tested-by to this patch set.

Great, thank you!