allwinner h616/h618 cpu freq driver

titus <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <[email protected]>
H616 / H618 socs have a slightly different cpu-opp table for the cpu freq to voltage mapping
------------------------------------------------------------------------------------------------------
        opp-table-cpu {
                compatible = "allwinner,sun50i-h616-operating-points";
                nvmem-cells = <0x4c>;
                opp-shared;
                phandle = <0x3>;
                opp-480000000 {

                        clock-latency-ns = <0x3b9b0>;
                        opp-hz = <0x0 0x1c9c3800>;
                        opp-microvolt-speed0 = <0xdbba0 0xdbba0 0x10c8e0>;
                        opp-microvolt-speed1 = <0xdbba0 0xdbba0 0x10c8e0>;
                        opp-microvolt-speed2 = <0xdbba0 0xdbba0 0x10c8e0>;
                };
…..
-----------------------------------------------------------------------------------------
instead of the standard
        opp-table-cpu {
                compatible = "operating-points-v2";
                opp-shared;
                phandle = <0x3>;
                opp-480000000 {

                        opp-hz = <0x0 0x1c9c3800>;
                        opp-microvolt = <0xc8320>;
                        clock-latency-ns = <0x3b9b0>;
                };
…..
----------------------------------------------------------------------------
there are 3 sets of voltages listed and the speed key [0-2] is obtained from the nvmem cell with phandle <0x4c>

the question is how will be the best/recommended method to implement support
1. hack sys/dev/cpufreq/cpufreq_dt.c with a build time option and use ifdefs
2. duplicate the cpufreq_dt.c code and create a cloned driver from scratch
3. create a driver that only looks for compatible = "allwinner,sun50i-h616-operating-points” and then live patches
the fdt (reads the nvmem cell and replace opp-microvolt-speedN = <foo> with opp-microvolt = <foo>

thanks,
 Titus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.