Page MenuHomeFreeBSD

Use PLATFORM for initializing Marvell ArmadaXP and Armada38X
ClosedPublic

Authored by mkm_semihalf.com on Mar 19 2018, 5:55 PM.
Tags
Referenced Files
Unknown Object (File)
Feb 10 2024, 10:50 PM
Unknown Object (File)
Dec 27 2023, 8:04 PM
Unknown Object (File)
Dec 27 2023, 8:04 PM
Unknown Object (File)
Dec 27 2023, 8:04 PM
Unknown Object (File)
Dec 27 2023, 8:04 PM
Unknown Object (File)
Dec 27 2023, 8:04 PM
Unknown Object (File)
Dec 27 2023, 8:03 PM
Unknown Object (File)
Dec 27 2023, 7:47 PM
Subscribers

Details

Summary

Spliting armv5 and armv7 machdep is necessary for adding Armada38X and
ArmadaXP to GENERIC config.
PLATFORM framework checks SOC type in FDT and will select proper
initialization function implementation during runtime.
Pointers to SoC specific implementation are stored in array of
platform_method_t and provided to framework by FDT_PLATFORM_DEF macro.
PLATFORM framework supports also reset function. To simplify implementation
cpu_reset is moved from mv_common to armv5 and armv7 machdep.

Armada38X and ArmadaXP share now common list of files.

Diff Detail

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

Event Timeline

sys/arm/conf/ARMADAXP
97 ↗(On Diff #40456)

Why is it needed?

sys/arm/mv/armada38x/armada38x_pl310.c
46–47 ↗(On Diff #40456)

These should be with the other machine includes above.

sys/arm/mv/armadaxp/armadaxp_mp.c
52 ↗(On Diff #40456)

This should be with the other machine includes

sys/arm/mv/armv7_machdep.c
1 ↗(On Diff #40456)

This file should have a mv_ prefix, e.g. mv_armv7_machdep.c. If not it may conflict with another generic file.

263 ↗(On Diff #40456)

Do these need to be global?

sys/arm/conf/ARMADAXP
97 ↗(On Diff #40456)

Hi,

From now on, for Marvell ARMv7 platforms there is a common file (mv_armv7_machdep.c), where PLATFORMMETHODs are assigned, among them 3 PL310-related for Armada 38x:

PLATFORMMETHOD(platform_pl310_init, mv_a38x_platform_pl310_init),
PLATFORMMETHOD(platform_pl310_write_ctrl, mv_a38x_platform_pl310_write_ctrl),
PLATFORMMETHOD(platform_pl310_write_debug, mv_a38x_platform_pl310_write_debug),

All is fine for configs: GENERIC and ARMADA38X, but ARMADAXP compilation will fail. Unless you don't insist on all non-GENERIC configs removal, 'device pl310' must be added to ARMADAXP, so that it can still compile.

mkm_semihalf.com marked 4 inline comments as done.
sys/arm/conf/ARMADAXP
97 ↗(On Diff #40456)

You don't need to include these functions in the kernel when not building for a platform that doesn't support them.

sys/arm/mv/mv_armv7_machdep.c
444–461 ↗(On Diff #40551)

You should put these under

#if defined(SOC_MV_ARMADA38X)
...
#endif
sys/arm/mv/mv_armv7_machdep.c
444–461 ↗(On Diff #40551)

What's actually the purpose of such ifdef? In this file we define methods for A38x / AXP finally reaching the code without any ifdef (SOC_MV_...) and I'd like to keep it this way :)

sys/arm/conf/ARMADAXP
97 ↗(On Diff #40456)

Right, that makes sense- now I get your point.

mkm_semihalf.com marked 2 inline comments as done.
mkm_semihalf.com edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Apr 4 2018, 8:29 AM
This revision was automatically updated to reflect the committed changes.