Page MenuHomeFreeBSD

allwinner: Convert to extres clk/hwreset APIs
ClosedPublic

Authored by jmcneill on Mar 26 2016, 9:40 PM.
Tags
Referenced Files
Unknown Object (File)
Mon, Nov 25, 8:51 PM
Unknown Object (File)
Mon, Nov 25, 8:51 PM
Unknown Object (File)
Sun, Nov 24, 9:54 PM
Unknown Object (File)
Sun, Nov 24, 9:16 PM
Unknown Object (File)
Sun, Nov 24, 6:11 PM
Unknown Object (File)
Sun, Nov 24, 2:14 PM
Unknown Object (File)
Sun, Nov 24, 10:35 AM
Unknown Object (File)
Sun, Nov 24, 8:12 AM

Details

Summary

Convert the Allwinner port from custom clock drivers to the new extres clk/hwreset APIs.

This removes the need for the custom "ccm" node in the Allwinner dts files, allowing us to use more or less unmodified upstream dts files.

As of now, upstream dts does not support the A20 HDMI or display engine, so these nodes are provided in sun7i-a20-hdmi.dtsi.

This patch has been verified across A10, A20, A31, and A31s boards.

Diff Detail

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

Event Timeline

jmcneill retitled this revision from to allwinner: Convert to extres clk/hwreset APIs.
jmcneill updated this object.
jmcneill edited the test plan for this revision. (Show Details)
jmcneill added a reviewer: ARM.
jmcneill set the repository for this revision to rS FreeBSD src repository - subversion.
jmcneill added a project: ARM.
sys/arm/allwinner/a10_hdmi.c
198 ↗(On Diff #14637)

#define<tab>

sys/arm/allwinner/a10_ahci.c
329 ↗(On Diff #14637)

It wold be safer to check if both clocks exist in the dtb before trying to enable them.

358 ↗(On Diff #14637)

This might leave one or both clocks enabled which may not be desirable.

sys/arm/allwinner/a10_codec.c
809–819 ↗(On Diff #14637)

It feels like we need a high level API to optionally set the frequency & enable the clock, it's a common operation. Even better if it can handle multiple clocks & cleanup correctly on failure of one.

manu_bidouilliste.com added inline comments.
sys/arm/conf/A10
61 ↗(On Diff #14637)

Missing uart_snps

sys/arm/conf/A20
81 ↗(On Diff #14637)

This is not needed

sys/boot/fdt/dts/arm/bananapi.dts
29 ↗(On Diff #14637)

Could you integrate the change from D5718 with it ?
The disabled nodes aren't needed.

#include "sun7i-a20-hdmi.dtsi"

/ {

soc@01c00000 {
        hdmi@01c16000 {
                status = "okay";
        };

        hdmiaudio {
                status = "okay";
        };
};

};

&mmc0_pins_a {

allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;

};

sys/boot/fdt/dts/arm/cubieboard.dts
29 ↗(On Diff #14637)

#include "sun7i-a20-hdmi.dtsi"

/ {

soc@01c00000 {
        hdmi@01c16000 {
                status = "okay";
        };

        hdmiaudio {
                status = "okay";
        };
};

};

sys/boot/fdt/dts/arm/olinuxino-lime.dts
29 ↗(On Diff #14637)

#include "sun7i-a20-hdmi.dtsi"

/ {

soc@01c00000 {
        hdmi@01c16000 {
                status = "okay";
        };

        hdmiaudio {
                status = "okay";
        };
};

};

sys/boot/fdt/dts/arm/cubieboard.dts
29 ↗(On Diff #14637)

Do we know if the HDMI code works on sun4i-a10?

sys/arm/conf/A10
61 ↗(On Diff #14637)

Should get sorted out when D5749 is merged.

sys/arm/conf/A20
81 ↗(On Diff #14637)

This should get cleaned up when D5749 gets merged.

mmel added inline comments.
sys/arm/allwinner/a10_codec.c
819 ↗(On Diff #14637)

Settings frequency in consumer driver is not frequent operation, mainly if is fixed. Imho, it's always better to setup base frequency plan for whole SoC at one place (in this case probably in driver for "/clocks" node). Typical consumers of clk_set_freq() are MMC, HDMI or UART - where frequency must be changed at runtime by user or connected device request.

sys/boot/fdt/dts/arm/cubieboard.dts
29 ↗(On Diff #14637)

You're right I forgot, just tested it and it doesn't work.

jmcneill added inline comments.
sys/boot/fdt/dts/arm/olinuxino-lime.dts
29 ↗(On Diff #14637)

Not supported on sun4i-a10 yet.

  • a10_hdmi.c: style fix
  • a10_ahci.c: cleanup clocks on failure paths

Fix some off-by-ones when validating mux input values, and add expected clock indices for sun4i usb clocks.

  • aw_usbphy: Use regulator framework instead of poking GPIOs directly.
  • dts: add HDMI, HDMI audio, and MMC pin setting fixes to bananapi.dts
  • dwc: Split clock initialization between generic dwc and a20 dwc glue based on bindings documents (stmmac.txt, allwinner,sun7i-a20-gmac.txt)
gonzo added a reviewer: gonzo.
This revision is now accepted and ready to land.Apr 6 2016, 11:00 PM
This revision was automatically updated to reflect the committed changes.