Page MenuHomeFreeBSD

Enable SCU unit for Armada38x
ClosedPublic

Authored by bsz_semihalf.com on Nov 19 2015, 12:36 PM.
Tags
Referenced Files
F106167114: D4220.diff
Thu, Dec 26, 12:05 PM
Unknown Object (File)
Tue, Dec 24, 2:17 AM
Unknown Object (File)
Mon, Dec 16, 12:13 PM
Unknown Object (File)
Thu, Dec 12, 8:28 AM
Unknown Object (File)
Nov 17 2024, 8:36 PM
Unknown Object (File)
Nov 17 2024, 4:16 PM
Unknown Object (File)
Oct 26 2024, 2:17 AM
Unknown Object (File)
Oct 23 2024, 8:09 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 Skipped
Unit
Tests Skipped

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
114

if (rv != 0)

118

Why 0x30?

sys/arm/mv/armada38x/armada38x.c
117

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
117

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

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

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.