Add support for IPQ8064 SoC. All the debug vector are taken from old
pre-dt linux-msm source.
To correctly setup the debug oscillator, it's required to operate on 2
different clk, the CXO oscillator and the PDM clock. Then we operate ton
the CLK_TEST reg and we setup the required vector. With the use of
define we abstract everything for the high speed and the low speed
clocks.
The CXO oscillator runs at 25Mhz and a different xo_rate is required
than the current default one.
We can also test the 2 CPU speed and the current L2 speed using the APCS
CLK_DIAG reg. To test this we need to setup a special test vector in
CLK_TEST and then operate on the APCS reg.
For these special clock a different fixed_div is needed to be set.
There is currently a bug (probably a hw bug) where the CPU clock of the
2 core is half broken, the correct clock is reported but only for one of
the core, the other core will always report a wrong clock. Operating on
the CPU mux makes the CLK_DIAG report the correct freq on one of the 2
core from the test vector.
Also the L2 clock seems to be half broken with high speed freq. (still
has to be confirmed and maybe it's the L2 HFPLL wrongly configured for
some reason and on high frequency > 1GHz reports not precise frequency)
Note that we currently use a fixed_div of 8 for these special clock.
This should be used only for ipq8064 v3 SoC but it was never found an
ipq8064 v1 SoC, where 2 should be used as fixed_div.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add convenient macro GENMASK to calculate masks from bits similar to how
it's implemented in kernel linux tools.
This is useful to better describe some specific define instead of using
comments and raw HEX values.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Some device have a different rate for the xo debug oscillator. Add
support for defining custom xo rate in the primary debug mux.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Some xo require special value to set it to /4 divisor. Introduce
xo_div4_val to handle this special implementation.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Unsigned long have a different size in 32 bit system and this cause the
malfunction of debugcc returning wrong frequency. Use 64bit unsigned int
to correctly support 32 bit system and provide correct frequency.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Enforcing a primary+leaf configuration does not walk for all the cases.
Some clocks (msm8996 CPU) have more muxes to be powered on. Other (MCCC)
do not require GCC at all. Make clock measurement more versatile by
reworking GCC + optional leaf into a chain of muxes.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Having a template file with replacement macros is a bit cleaner than
encoding the setup of the file in `meson.build` and piping that through
`echo` with caputred variables.
Unfortunately there appears to be no support for repetition, to e.g.
expand a list of platform names into the various uses (array with comma-
separation, or individual `extern struct` declarations, forcing us to
have some form of string expansion within `meson.build`).
Fix the following error:
../debugcc.c: In function 'mmap_mux':
../debugcc.c:295:40: error: format '%zx' expects argument of type 'size_t', but argument 2 has type 'long unsigned int' [-Werror=format=]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Switch to meson as a build system. Define a list of supported platforms
and use it to generate platforms list and the symlink targets.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>