Page MenuHomeFreeBSD

Enable SCU unit for Armada38x
ClosedPublic

Authored by bsz_semihalf.com on Nov 19 2015, 12:36 PM.
Tags
Referenced Files
Unknown Object (File)
Wed, May 8, 7:34 AM
Unknown Object (File)
Sat, Apr 27, 6:21 PM
Unknown Object (File)
Sat, Apr 27, 6:03 PM
Unknown Object (File)
Apr 7 2024, 10:05 AM
Unknown Object (File)
Apr 6 2024, 5:25 PM
Unknown Object (File)
Feb 21 2024, 12:13 PM
Unknown Object (File)
Feb 9 2024, 10:55 AM
Unknown Object (File)
Jan 22 2024, 1:43 PM
Subscribers

Details

Summary

Valid SCU operation is necessary for SMP interoperability. Initialization
function armada38x_enable_scu() was added to arm/mv/armada38x/armada38x.c
file.

Obtained from: Semihalf
Sponsored by: Stormshield
Submitted by: Bartosz Szczepanek <bsz@semihalf.com>

Diff Detail

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

Event Timeline

bsz_semihalf.com retitled this revision from to Enable SCU unit for Armada38x and implement fixup from ARM errata.
bsz_semihalf.com updated this object.
bsz_semihalf.com edited the test plan for this revision. (Show Details)
bsz_semihalf.com added reviewers: ian, imp.
bsz_semihalf.com set the repository for this revision to rS FreeBSD src repository - subversion.
bsz_semihalf.com added a project: ARM.
bsz_semihalf.com added a subscriber: zbb.
sys/arm/mv/armada38x/armada38x.c
113 ↗(On Diff #10349)

if (rv != 0)

117 ↗(On Diff #10349)

Why 0x30?

sys/arm/mv/armada38x/armada38x.c
116 ↗(On Diff #10349)

The Linux kernel has an option to enable this which states:

This option enables the workaround for erratum 764369 affecting Cortex-A9 MPCore with two or more processors (all current revisions). Under certain timing circumstances, a data cache line maintenance operation by MVA targeting an Inner Shareable memory region may fail to proceed up to either the Point of Coherency or to the Point of Unification of the system. This workaround adds a DSB instruction before the relevant cache maintenance functions and sets a specific bit in the diagnostic control register of the SCU.

Is there another ptach with the dsb instruction? Or do we always do it so that's not needed.

Also, is there a link to this information from arm? I could only find http://cache.freescale.com/files/32bit/doc/errata/IMX6DQCE.pdf which had very good information about it, but not a link back to arm when I just googled it. Looking at the startup code for the imx6, it's using symbolic names where you use magic numbers below. Maybe this would be a good candidate to be a function in locore for all A9 cores?

sys/arm/mv/armada38x/armada38x.c
116 ↗(On Diff #10349)

You're right, better place for it would be somewhere in code common for other platforms that use A9. I did neither find original ARM documentation for this, but here is some deeper explanation.
In fact I reimplemented it as a part of SCU enabling procedure without delving deeper into the issue it fixes, so better if I get rid of that from this commit. Then better patch (perhaps to locore) with proper dsb barriers (we don't have them, afaik) could be prepared.

bsz_semihalf.com retitled this revision from Enable SCU unit for Armada38x and implement fixup from ARM errata to Enable SCU unit for Armada38x.
bsz_semihalf.com marked 2 inline comments as done.
sys/arm/mv/armada38x/armada38x.c
117 ↗(On Diff #10440)

Erratum 764369 is in the ARM Cortex-A9 processors Software Developers Errata Notice. It seems to be present in all Cortex-A9 revisions so it shouldn't matter which revision you look at.

there are a variety of cortex-a9 common routines we should be able to factor out into common code at this point for things like SCU startup, but I don't think that needs to be part of this work.

sys/arm/mv/armada38x/armada38x.c
117 ↗(On Diff #10440)

Yes, we do have the dsb() part of that erratum fix in place already, all the cache functions in cpu-v6.h begin and end with dsb().

ian edited edge metadata.
This revision is now accepted and ready to land.Dec 9 2015, 11:26 PM
andrew added a reviewer: andrew.
This revision was automatically updated to reflect the committed changes.