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)
Tue, Apr 9, 11:38 PM
Unknown Object (File)
Tue, Apr 9, 7:43 PM
Unknown Object (File)
Tue, Apr 9, 7:42 PM
Unknown Object (File)
Jan 29 2024, 6:57 PM
Unknown Object (File)
Jan 26 2024, 11:57 AM
Unknown Object (File)
Jan 6 2024, 3:48 AM
Unknown Object (File)
Dec 22 2023, 10:19 PM
Unknown Object (File)
Dec 22 2023, 12:49 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.