Page MenuHomeFreeBSD

Enable pl310 coherent operation in platform init for Armada 38x
ClosedPublic

Authored by mw on Aug 5 2017, 10:30 AM.
Tags
Referenced Files
Unknown Object (File)
Sun, Dec 15, 12:21 PM
Unknown Object (File)
Nov 24 2024, 3:54 AM
Unknown Object (File)
Nov 20 2024, 5:34 PM
Unknown Object (File)
Nov 12 2024, 6:54 PM
Unknown Object (File)
Oct 30 2024, 1:14 PM
Unknown Object (File)
Oct 30 2024, 1:14 PM
Unknown Object (File)
Oct 30 2024, 1:14 PM
Unknown Object (File)
Oct 30 2024, 1:14 PM

Details

Summary

Updating PL310 sotfware context sc_io_coherent field in
platform_pl310_init() routine for Armada 38x helps to avoid
using 'arm,io-coherent' property, which is by default not present
in the device tree node in Linux.

This way another step for DT unification between two operating
systems is done. The improvemnt will also work after enabling
PLATFORM for Marvell ARMv7 SoCs.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

It's some problem that Linux Pl310 driver cannot work properly with HW cache coherency and UP in Linux. By default the property is not present in DT and it's fixed-up when SMP is enabled.

mw edited the summary of this revision. (Show Details)
  • Rebase patch after removing timers' nodes fixup
  • Clarify description of Linux pl310 issue in commit message

Is it something only not present in marvell dts ?
Shouldn't we do something more generic for every platform like checking if the property exists and if not adding it ?

In Linux it's only used by Armada 38x - disabling L2 sync operation is not used in any other device tree, nor via fixup in the platform code. In sys/arm/mv, also other settings strictly related to the coherency are added (coherent dma_tag created for nexus and MBUS configuration).

In such circumstances, do you see a point to do a generic fdt fix-up?

In D11883#246971, @mw wrote:

In Linux it's only used by Armada 38x - disabling L2 sync operation is not used in any other device tree, nor via fixup in the platform code. In sys/arm/mv, also other settings strictly related to the coherency are added (coherent dma_tag created for nexus and MBUS configuration).

In such circumstances, do you see a point to do a generic fdt fix-up?

Nope that's fine with me then :)

This revision is now accepted and ready to land.Aug 7 2017, 2:39 PM

My preference would be for it to be a quirk in the driver over a fixup. fdt_fixup_table breaks moving the mv code into GENERIC.

Hi @andrew

Ok, how about a similar solution as with mpcore timer, i.e. static global in pl310.c, which can be set during platform initialization (see arm_tmr_change_frequency())? What's your opinion?

FYI, GENERIC code for Marvell is ready and working - expect a big patchset very soon :)

Best regards,
Marcin

There is now access to the platform object from outside of platform.c. You could add a method to platform_pl310_if.m to handle this. Each SoC can then implement this if needed.

We already have it. I found a super easy way to get it working - now and after we apply PLATFORM support patch. Simply set:
sc->sc_io_coherent = true;
in pl310_platform_init. No need to parse and fixup fdt.

mw edited edge metadata.
mw retitled this revision from Fix-up Armada 38x cache controller FDT node to Enable pl310 coherent operation in platform init for Armada 38x.
mw edited the summary of this revision. (Show Details)
  • Do not fixup FDT but directly update sc->sc_io_coherent field.
This revision now requires review to proceed.Aug 7 2017, 6:14 PM
This revision is now accepted and ready to land.Aug 7 2017, 10:41 PM
This revision was automatically updated to reflect the committed changes.