Page MenuHomeFreeBSD

Add basic support for Marvell Armada38x
ClosedPublic

Authored by bsz_semihalf.com on Nov 19 2015, 11:35 AM.
Tags
Referenced Files
Unknown Object (File)
Thu, Nov 14, 4:18 PM
Unknown Object (File)
Tue, Nov 12, 6:02 PM
Unknown Object (File)
Wed, Nov 6, 7:55 PM
Unknown Object (File)
Tue, Oct 29, 3:25 PM
Unknown Object (File)
Oct 20 2024, 7:21 AM
Unknown Object (File)
Oct 16 2024, 9:53 AM
Unknown Object (File)
Oct 3 2024, 8:43 PM
Unknown Object (File)
Oct 2 2024, 6:06 AM
Subscribers

Details

Summary

This commit introduces initial support for Marvell Armada38x platform.
Changes:

  • Import common DTS files for Armada38x SoCs and DTS file for A388-GP board from Linux 4.2
  • Add ARMADA38X kernel configuration
  • Add option SOC_MV_ARMADA38X and set MV_PCI_PORTS
  • Add list of files to compile
  • Implement get_tclk(), get_sar_value(), cpu_reset() functions
  • Add CPU ID and SoC numbers

Obtained from: Semihalf
Sponsored by: Stormshield
Submitted by: Michal Stanek <mst@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 Add basic support for Marvell Armada38x.
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.
imp edited edge metadata.

These changes look good, though I'd prefer having the dts files in the right place.
I do know, however, that doing that is a bit convoluted and will be happy to fix things
up when I do the next dts import from Linux.

sys/boot/fdt/dts/arm/armada-380.dtsi
1 ↗(On Diff #10337)

If this is a verbatim copy of the Linux code, and the Linux code contains the BSDL, these files belong in sys/gnu/dts/arm instead, ideally through our vendor tree for this.

This revision is now accepted and ready to land.Nov 19 2015, 2:40 PM

I don't think this is quite ready.

sys/arm/conf/ARMADA38X
12 ↗(On Diff #10337)

Odd indentation, it should be options<space><tab>FOO

17–19 ↗(On Diff #10337)

Is the port not able to use local storage?

21–23 ↗(On Diff #10337)

Why do you need this?

31–32 ↗(On Diff #10337)

Why are these needed?

49–53 ↗(On Diff #10337)

Why have these if they are commented out?

79–80 ↗(On Diff #10337)

Why have these?

84–88 ↗(On Diff #10337)

More commented out options?

94–97 ↗(On Diff #10337)

Can you not load the dtb from disk?

sys/arm/mv/armada38x/armada38x.c
56 ↗(On Diff #10337)

This should be #if defined(EARLY_PRINTF).

sys/arm/mv/armada38x/files.armada38x
5 ↗(On Diff #10337)

This should come from sys/conf/files.arm

6 ↗(On Diff #10337)

Use options gic

sys/arm/mv/armada38x/std.armada38x
7 ↗(On Diff #10337)

Do you need this? i.e. do you need the trampoline kernel?

12 ↗(On Diff #10337)

This should be unneeded

sys/arm/mv/mv_common.c
2212–2216 ↗(On Diff #10337)

On a side note, this should be something like:

#error Unsupported SoC
sys/arm/conf/ARMADA38X
17–19 ↗(On Diff #10337)

Not yet. Storage devices will be added in next chunk of support for this SoC. Currently the only supported root device is md.

79–80 ↗(On Diff #10337)

Some of these commented devices will be uncommented after we submit further commits. However, I can remove these for now, if you wish.

sys/arm/mv/armada38x/files.armada38x
6 ↗(On Diff #10337)

Is there a point to do this? We always need GIC (it's primary interrupt controller here - I don't think somebody would want not to use it), and including gic.c in standard doesn't interfere with other platforms (as this is files.armada38x).

sys/arm/conf/ARMADA38X
21–23 ↗(On Diff #10337)

SOCDEV_PA, _VA are required for EARLY_PRINTF. We use EARLY_PRINTF for debugging reasons.

94–97 ↗(On Diff #10337)

As for now we are not using loader, so static dtb is required.

bsz_semihalf.com updated this object.
bsz_semihalf.com edited edge metadata.

Corrected issues pointed by Andrew.
Added "Sponsored by".

This revision now requires review to proceed.Nov 20 2015, 1:35 PM
sys/arm/conf/ARMADA38X
21–23 ↗(On Diff #10337)

If you are still debugging the early boot why are you submitting the code? This should only be needed when things don't work.

sys/arm/mv/armada38x/files.armada38x
6 ↗(On Diff #10337)

Because sys/arm/foo/files.foo should only be used for files within sys/arm/foo. I've recently cleaned up most of the placed we pull in files in sys/arm/arm/* and moved them to files.arm.

bsz_semihalf.com edited edge metadata.

Removed some makeoptions from std file.

Removed early_printf. andrew, please let me know if there are any other issues (I think I corrected everything you pointed).

sys/arm/mv/armada38x/std.armada38x
8 ↗(On Diff #11099)

Also, there is no reason to set KERNVIRTADDR to anything other than 0xc0000000 these days. The only reason we used to set any low-order bits was to influence where loader(8) loaded the image or to match where u-boot loaded the image. Now those bits have no influence and the kernel can be loaded on any 2MB boundary.

ian edited edge metadata.
This revision is now accepted and ready to land.Dec 13 2015, 5:29 PM

Can you clean up your kernel config to be closer to the other armv6 configs? I've been working on reducing the diff between them to help us find the common parts.

sys/arm/conf/ARMADA38X
24–25 ↗(On Diff #11099)

Why do you need NO_FFS_SNAPSHOT and NO_SWAPPING?

sys/arm/mv/armada38x/files.armada38x
3 ↗(On Diff #11099)

This should be device mpcore_timer in your config.

8 ↗(On Diff #11099)

Why is this here?

bsz_semihalf.com edited edge metadata.

Added device mpcore_timer, removed unneccessary options, corrected tabs after device.

This revision now requires review to proceed.Dec 15 2015, 9:52 AM
sys/arm/mv/armada38x/std.armada38x
9 ↗(On Diff #11299)

I tried to set it to 0xc0000000 - doesn't boot (doesn't event print anything).

sys/arm/mv/armada38x/std.armada38x
9 ↗(On Diff #11299)

That sounds like a serious bug that needs to be investigated then. In theory, any kernvirtaddr at all should work for armv6 now, and I know for sure c0000000 works on imx6, and beaglebone. It now also works on dreamplug/kirkwood as of a couple days ago, so there's nothing in the mv-specific common code to prevent it.

sys/arm/mv/armada38x/std.armada38x
9 ↗(On Diff #11299)

Disregard my previous comment. It was matter of -DNO_CLEAN - after complete rebuild that works fine. I'll correct the commit.

This revision was automatically updated to reflect the committed changes.