Page MenuHomeFreeBSD

Allwinner DTS update
ClosedPublic

Authored by manu_bidouilliste.com on Jan 5 2016, 2:11 AM.
Tags
Referenced Files
Unknown Object (File)
Wed, May 1, 6:37 PM
Unknown Object (File)
Apr 8 2024, 7:46 PM
Unknown Object (File)
Mar 6 2024, 12:59 AM
Unknown Object (File)
Mar 2 2024, 7:54 PM
Unknown Object (File)
Feb 20 2024, 5:55 PM
Unknown Object (File)
Feb 20 2024, 1:55 AM
Unknown Object (File)
Feb 14 2024, 4:43 AM
Unknown Object (File)
Feb 8 2024, 12:06 PM

Details

Summary

This diff :

  • update Allwinner drivers to use the "compatible" string from vendor DTS
  • Convert some drivers to EARLY_DRIVER_MODULE so they attach at the right time
  • Convert A10 and A20 to FDT_PLATFORM
  • Add two function named allwinner_soc_type() and allwinner_soc_family() which return the SoC type and family based on fdt platform init
  • Add a generic A10 kernel config file
  • A20 now use generic_timer and ARM_INTRNG
  • Add two new custom dts file for Olimex boards (we need custom one because one doesn't have chosen or aliases node for the serial and the serial needs our busy-detect property)
  • Update our custom DTS file for a10 and a20 to use the same compatible property names as the vendor ones.
  • Update vendor DTS file for allwinner
Test Plan

Apply patch.
Build kernel.
Boot kernel on ARM board.

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 update.
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.

How far are we now from Linux dts files?

In D4792#101671, @imp wrote:

How far are we now from Linux dts files?

For the Olimex board, linux dts file are used but we still need custom one for the clock control module (the linux one doesn't have it declared) and for the chosen/aliases node for serial.
I don't have a Bananapi or Cubieboard but I think that they will need the same custom ones on top of the Linux DTS.

Set the phy-mode of the gmac to rgmii-bpi so 1000bps link works better

First pass

sys/arm/allwinner/a10_clk.c
113 ↗(On Diff #12178)

This should be indented 4 spaces

sys/arm/allwinner/a10_gpio.c
376–377 ↗(On Diff #12178)

You can use ofw_bus_find_compatible here.

498 ↗(On Diff #12178)

4 spaces

sys/arm/allwinner/a10_machdep.c
62 ↗(On Diff #12178)

Missing newline

122 ↗(On Diff #12178)

This should be:

u_int
alwinner_soc_type(void)
{
127 ↗(On Diff #12178)

And here

sys/arm/allwinner/a20/a20_cpu_cfg.c
121 ↗(On Diff #12178)

4 spaces

sys/arm/allwinner/a20/a20_machdep.c
63 ↗(On Diff #12178)

missing newline

123–131 ↗(On Diff #12178)

These should be in a common file to allow A10 and A20 to be built together

sys/arm/allwinner/aintc.c
163 ↗(On Diff #12178)

4 spaces

sys/arm/allwinner/allwinner_machdep.h
1 ↗(On Diff #12178)

Why as this file a copy of an existing file?

5 ↗(On Diff #12178)

Was it?

31 ↗(On Diff #12178)

Should be

#define<TAB>_ALLWINNER_MACHDEP_H_
33 ↗(On Diff #12178)

This should be unneeded as you will have already included it before including this file

sys/arm/allwinner/timer.c
140 ↗(On Diff #12178)

What's this needed for?

356 ↗(On Diff #12178)

4 spaces

sys/arm/conf/A10
2 ↗(On Diff #12178)

You should update the CUBIEBOARD config file to include this one & only add the options it that don't appear here

sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts
1 ↗(On Diff #12178)

Why is this file a copy?

43 ↗(On Diff #12178)

I don't think this is needed anymore

sys/arm/allwinner/a10_gpio.c
376–377 ↗(On Diff #12178)

I meant ofw_bus_search_compatible

Next diff correct style(9) and all the comment above.

sys/arm/allwinner/allwinner_machdep.h
1 ↗(On Diff #12178)

No, I don t know if git or phab thinks that.

5 ↗(On Diff #12178)

No just a bad copy/paste error

sys/arm/allwinner/timer.c
140 ↗(On Diff #12178)

Left over or early code, thanks for notice this.

sys/arm/conf/A10
2 ↗(On Diff #12178)

CUBIEBOARD should be removed and user should use A10 directly, I'm just waiting for some user to confirm that A10 work on this board as I don't have it myself. But for now every person that had it don't anymore.

sys/boot/fdt/dts/arm/olimex-a20-som-evb.dts
1 ↗(On Diff #12178)

No, I just copy the licence, I don't know if it git or phab that thinks that.

43 ↗(On Diff #12178)

Next diff will take care of that.

manu_bidouilliste.com marked 5 inline comments as done.

Fix style(9) issues.
Update to latest DTS.
Merge machdep files so A10 and A20 could be compiled together.
Use ofw_bus_search_compatible where appropriate.

manu_bidouilliste.com retitled this revision from Allwinner update to Allwinner DTS update.

FDT_PLATFORM was commited.
This new diff:

  • Update drivers to parse upstream compatible props
  • Update our custom DTS to use the same compatible props
  • Convert some driver to EARLY driver because of the order of the upstream DTS.
  • Add a generic A10 kernel config
  • Make A20 use generic_timer
  • Update the upstream DTS.

Last diff also include conversion for cubieboard2 to upstream DTS.
Confirmed by jmcneill.

sys/arm/allwinner/a10_ehci.c
101 ↗(On Diff #12736)

The newline here was correct

sys/arm/allwinner/a10_gpio.c
503 ↗(On Diff #12645)

Why _LAST?

manu_bidouilliste.com added inline comments.
sys/arm/allwinner/a10_gpio.c
503 ↗(On Diff #12772)

This is not needed anymore, I put it to do test when converting to EARLY_DRIVER

With EARLY_DRIVER_MODULE we normally add BUS_PASS_ORDER_MIDDLE to the pass to allow other drivers to hook in before it if needed.

sys/arm/allwinner/a10_gpio.c
503 ↗(On Diff #12772)

We normally use _MIDDLE to allow other drivers to attach earlier if needed

manu_bidouilliste.com marked an inline comment as done.

Update diff since the DTS from Linux have now been imported.

sys/arm/allwinner/allwinner_machdep.c
66 ↗(On Diff #13151)

Extra whitespace change

sys/arm/allwinner/timer.c
148–155 ↗(On Diff #13151)

This could be:

if (!ofw_bus_is_compatible(...))
  return (ENXIO);

soc_family = allwinner_soc_family();
if (soc_family != ...)
  return (ENXIO);
sys/arm/conf/A10
53 ↗(On Diff #13151)

Is this needed? It's better to get this from ubldr.

sys/arm/conf/A10
53 ↗(On Diff #13151)

Totally unneeded, it was just to reflect what the comment is saying.

sys/arm/conf/A10
53 ↗(On Diff #13151)

Ok, you should remove it and the comment.

sys/arm/conf/A10
53 ↗(On Diff #13151)

Ok, should I also remove the one from A20 too while I'm here ?

sys/arm/conf/A10
53 ↗(On Diff #13151)

Yes, if it also uses ubldr.

Update diff based on andrew comments.

andrew added a reviewer: andrew.
This revision is now accepted and ready to land.Feb 9 2016, 7:29 PM
This revision was automatically updated to reflect the committed changes.