Page MenuHomeFreeBSD

Allwinner A64 support
ClosedPublic

Authored by jmcneill on Jul 10 2016, 1:23 AM.
Referenced Files
F103684533: D7169.id18294.diff
Thu, Nov 28, 1:05 AM
Unknown Object (File)
Tue, Nov 26, 10:42 AM
Unknown Object (File)
Sun, Nov 24, 11:41 PM
Unknown Object (File)
Thu, Nov 21, 5:13 PM
Unknown Object (File)
Thu, Nov 21, 8:37 AM
Unknown Object (File)
Wed, Nov 20, 6:32 AM
Unknown Object (File)
Wed, Nov 20, 1:51 AM
Unknown Object (File)
Mon, Nov 18, 2:32 PM

Details

Summary

Initial support for Allwinner A64 SoC.

What's working:

  • MMC
  • GPIO / pinctrl
  • Clock controller
  • NMI intc
  • RSB
  • AXP803 PMIC
  • Ethernet
  • MMC
  • USB host controllers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

jmcneill retitled this revision from to Allwinner A64 support.
jmcneill updated this object.
jmcneill edited the test plan for this revision. (Show Details)
jmcneill added reviewers: arm64, ARM.
jmcneill set the repository for this revision to rS FreeBSD src repository - subversion.
jmcneill added projects: arm64, ARM.
sys/arm/allwinner/a10_mmc.c
200 ↗(On Diff #18246)

Can you make it #else /* __aarch64__ */ so it's documented what the else case if for.

sys/arm/allwinner/aw_rtc.c
67

#else /* __arm__ */

sys/arm/allwinner/aw_usbphy.c
44 ↗(On Diff #18246)

Why is this needed?

183–184 ↗(On Diff #18246)

Use %jd and cast phy to an intmax_t

sys/arm/allwinner/clk/aw_gate.c
140

Why not just return? There's no tear down in the failure case that a goto would simplify.

sys/arm64/conf/GENERIC
180–182

These shouldn't be added to GENERIC

sys/conf/files.arm64
95

This is already in sys/conf/files.

manu added inline comments.
sys/arm/allwinner/a10_mmc.c
262 ↗(On Diff #18246)

Maybe it would be better in a separate commit ?

323 ↗(On Diff #18246)

Same thing for the DMA align

sys/arm/allwinner/a64/files.a64
1 ↗(On Diff #18246)

Is this file used ?
Also maybe it need to go into sys/arm64 instead ?

sys/arm/allwinner/aw_rtc.c
65

Also maybe update the RTC driver to have the year min/max stuff into softc so we don't rely on allwinner_soc_family would be better.

sys/arm/allwinner/a10_mmc.c
262 ↗(On Diff #18246)

Agreed

323 ↗(On Diff #18246)

Agreed

sys/arm/allwinner/a64/files.a64
1 ↗(On Diff #18246)

I left it here because I thought we might want to support sun50i in the 32-bit ALLWINNER kernel some day. It doesn't matter to me if files.a64 stays or goes but I think sys/arm is the right place for these files.

sys/arm/allwinner/aw_rtc.c
65

I can remove the dependency on allwinner_soc_family easily but I think refactoring the driver is best left for a separate commit.

Changes based on feedback from andrew and manu.

Update for extres API changes in r302528

I think the following files can just be committed:

a10_ehci.c
a10_gpio.c
a10_mmc.c
a64_padconf.c
a64_r_padconf.c
aw_ccu.c
aw_nmi.c
aw_rsb.c
aw_usbphy.c
options.arm64

sys/arm/allwinner/clk/aw_gate.c
195–199

Can you use ofw_bus_is_compatible here?

Sync with head, some changes from the original diff have been committed.

fdt_is_compatible -> ofw_bus_is_compatible

sys/arm/allwinner/clk/aw_gate.c
47

Is this needed?

sys/arm/allwinner/if_awg.c
82

What is the busdma issue?

sys/arm/allwinner/if_awgreg.h
181

What is the issue?

sys/boot/efi/loader/main.c
414 ↗(On Diff #19600)

This shouldn't be commited with a64 changes.

sys/boot/fdt/dts/arm/a64.dtsi
128

This shouldn't be needed now.

I think most of the .c and .h files are ready, other than if_awg*. I'm undecided on how to handle dts files for arm64 so hold off on adding them for now.

sys/conf/files.arm64
2–25

You should only use soc_allwinner_a64 for SoC specific attachments. For these you should create a new device name.

I'm undecided on how to handle dts files for arm64 so hold off on adding them for now.

Can you talk more about this? We have a bit of a mess at the moment in arm land that's closely related to the u-boot mess that we have that I've started to clean up.

Sync with head, sort devices in GENERIC into device type sections.

Sync with head. Only sun50i/a64 and Pine64 .dts files remain.

Add support for USB-EHCI0/USB-OHCI0 (bottom USB port on Pine64).

Support both USB host controllers on A64. The first host controller shares a PHY with the OTG controller, so we need to configure the PHY appropriately. Now both USB ports work on Pine64.

Use the A64 watchdog to reset the system; the psci reboot method doesn't seem to work.

Sync with head

sys/arm/allwinner/aw_usbphy.c
93 ↗(On Diff #19840)

Not all usbphy nodes have 3 resources, this needs to be modified to support other SoCs.

Support between 2 and 4 USB PHY resources.

Sync with head. The only changes remaining are the new dts files.

Move dts files to boot/fdt/dts/arm64

add Makefile for boot/fdt/dts/arm64

This revision was automatically updated to reflect the committed changes.