Page MenuHomeFreeBSD

Allwinner A31 add smp support
ClosedPublic

Authored by manu_bidouilliste.com on Feb 19 2016, 3:10 AM.
Tags
Referenced Files
F106101170: D5342.id13497.diff
Wed, Dec 25, 10:18 AM
F106101066: D5342.id13493.diff
Wed, Dec 25, 10:16 AM
F106101021: D5342.id14115.diff
Wed, Dec 25, 10:15 AM
F106100217: D5342.id13496.diff
Wed, Dec 25, 9:56 AM
F106072068: D5342.diff
Tue, Dec 24, 10:25 PM
Unknown Object (File)
Tue, Dec 10, 8:54 PM
Unknown Object (File)
Mon, Dec 9, 12:56 AM
Unknown Object (File)
Sat, Nov 30, 3:56 PM

Details

Summary

Add SMP support to A31.
All allwinner SoC with the same number of core use the same register address for core configuration so we use that.
Move the file from a20/a20_mp.c to aw_mp.c

Test Plan

Apply patch and build kernel

Diff Detail

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

Event Timeline

manu_bidouilliste.com retitled this revision from to Allwinner A31 add smp support.
manu_bidouilliste.com updated this object.
manu_bidouilliste.com edited the test plan for this revision. (Show Details)
manu_bidouilliste.com set the repository for this revision to rS FreeBSD src repository - subversion.
manu_bidouilliste.com added a project: ARM.

Fix a bug, the power off gating reg is in the prcm region in the a31.

sys/arm/allwinner/aw_mp.c
64–65 ↗(On Diff #13493)

Indentation (and below)

114–126 ↗(On Diff #13493)

This is bogus, we should be checking which SoC we are on & mapping based on that.

Split start_ap in two function, one of each supported SoC.
Fix style(9).

jmcneill_invisible.ca added inline comments.
sys/arm/allwinner/aw_mp.c
168 ↗(On Diff #13496)

Missing unmap for prcm handle

237 ↗(On Diff #13496)

Missing unmap for prcm handle

sys/arm/allwinner/aw_mp.c
91 ↗(On Diff #13496)

You can use cp15_l2ctlr_get here, from machine/cpu-v6.h.

92 ↗(On Diff #13496)

Use CPUV7_L2CTLR_NPROC from machine/armreg.h

172 ↗(On Diff #13496)

How similar are the two functions? i.e. could the common bits be pulled out to a helper function?

180 ↗(On Diff #13496)

Split lines should be indented the same number of tabs, followed by 4 spaces.

213 ↗(On Diff #13496)

8?

sys/arm/allwinner/aw_mp.c
213 ↗(On Diff #13496)

We need to write 0xff, 0x7f, 0x3f etc ...
I guess I could add a CPU_POWER_CLAMP_STEPS define.

Merge back into one function and split the diff bits into switch statement.
Use cp15_l2ctlr_get and CPUV7_L2CTLR_NPROC instead of inline assembly.

sys/arm/allwinner/aw_mp.c
115 ↗(On Diff #13497)

I think this code could be reworked a little to add separate functions for the two groups of SoCs. These would just map/unmap the registers, then call into common functions to power on the new CPUs. They should pass in the needed tag and handles, and maybe registers if applicable.

This would help for when we move to start CPUs through the PLATFORM code.

140 ↗(On Diff #13497)

The indentation here was correct

168–169 ↗(On Diff #13497)

This should be tabbed out to the same level as the previous line, followed by 4 spaces. You should then be able to fit both on a single line.

I'll wait till D5466 is commited to update this review.

Update diff to use PLATFORM_SMP bits.

sys/arm/allwinner/aw_mp.c
132–133 ↗(On Diff #13862)

It looks like you don't need to split this line, it should be should enough.

134–135 ↗(On Diff #13862)

These should be on a single line

162 ↗(On Diff #13862)

Do we know the meaning of 3?

Add defines for previously hardcoded value.
Fix minor style(9) issues.

manu_bidouilliste.com added inline comments.
sys/arm/allwinner/aw_mp.c
162 ↗(On Diff #13996)

Yeah, last diff add defines for this value.

jmcneill added inline comments.
sys/arm/allwinner/aw_mp.c
137 ↗(On Diff #13996)

} else { on a single line

151 ↗(On Diff #13996)

} else { on a single line

181 ↗(On Diff #13996)

4 spaces instead of a tab for multi-line if

196 ↗(On Diff #13996)

4 spaces instead of a tab for multi-line if

199 ↗(On Diff #13996)

4 spaces instead of a tab for multi-line if

andrew added a reviewer: andrew.
andrew added inline comments.
sys/arm/conf/A20
34 ↗(On Diff #14025)

options <tab>

This revision is now accepted and ready to land.Mar 4 2016, 11:28 AM
manu_bidouilliste.com edited edge metadata.

Fix space/tab in kernel config files.

This revision now requires review to proceed.Mar 4 2016, 2:42 PM
This revision is now accepted and ready to land.Mar 5 2016, 10:57 AM
andrew edited edge metadata.
This revision was automatically updated to reflect the committed changes.