[PATCH v11 03/10] riscv: Update Canaan Kendryte K210 device tree

Damien Le Moal Damien.LeMoal at wdc.com
Fri Jan 15 00:56:04 EST 2021


On Thu, 2021-01-14 at 15:32 -0800, Palmer Dabbelt wrote:
> On Mon, 11 Jan 2021 16:58:41 PST (-0800), Damien Le Moal wrote:
> > Update the Canaan Kendryte K210 base device tree k210.dtsi to define
> > all peripherals of the SoC, their clocks and reset lines. The device
> > tree file k210.dts is renamed to k210_generic.dts and becomes the
> > default value selection of the SOC_CANAAN_K210_DTB_BUILTIN_SOURCE
> > configuration option. No device beside the serial console is defined by
> > this device tree. This makes this generic device tree suitable for use
> > with a builtin initramfs with all known K210 based boards.
> > 
> > These changes result in the K210_CLK_ACLK clock ID to be unused and
> > removed from the dt-bindings k210-clk.h header file.
> > 
> > Most updates to the k210.dtsi file come from Sean Anderson's work on
> > U-Boot support for the K210.
> > 
> > Signed-off-by: Damien Le Moal <damien.lemoal at wdc.com>
> > Reviewed-by: Anup Patel <anup at brainfault.org>
> > ---
> >  arch/riscv/Kconfig.socs                     |   2 +-
> >  arch/riscv/boot/dts/canaan/k210.dts         |  23 -
> >  arch/riscv/boot/dts/canaan/k210.dtsi        | 551 +++++++++++++++++++-
> >  arch/riscv/boot/dts/canaan/k210_generic.dts |  46 ++
> >  include/dt-bindings/clock/k210-clk.h        |   1 -
> >  5 files changed, 573 insertions(+), 50 deletions(-)
> >  delete mode 100644 arch/riscv/boot/dts/canaan/k210.dts
> >  create mode 100644 arch/riscv/boot/dts/canaan/k210_generic.dts
> 
> [Snipping this to the relevant bits, in case you missed it before.]
> 
> > @@ -81,40 +107,515 @@ in0: oscillator {
> >  	soc {
> >  		#address-cells = <1>;
> >  		#size-cells = <1>;
> > -		compatible = "kendryte,k210-soc", "simple-bus";
> > +		compatible = "canaan,k210-soc", "simple-bus";
> >  		ranges;
> >  		interrupt-parent = <&plic0>;
> > 
> > -		sysctl: sysctl at 50440000 {
> > -			compatible = "kendryte,k210-sysctl", "simple-mfd";
> > -			reg = <0x50440000 0x1000>;
> > -			#clock-cells = <1>;
> > +		debug0: debug at 0 {
> > +			compatible = "canaan,k210-debug", "riscv,debug";
> 
> I'm still getting lots of warnings about undocumented DT compatible strings
> from checpatch.  Some of them might be in flight, but I don't see many of them
> (including both of these debug ones) having been defined anywhere.  We went
> through a whole process to sort out the SiFive DT naming conventions, I don't
> want to just circumvent that for the Canaan stuff by merging it as-is.

I fixed all warnings generated by make dtbs_check. Nothing shows up now.
I removed most of the "canaan,k210-xxx" compatible strings for nodes that have
a well defined driver, according to the driver binding docs (that is the same
as other boards/SoC which do not add an SoC specific compatible string). That
is only for the IP blocks that do not need a specific tweak/quirk. The
DesignWare SPI is the exception, but that one is already documented. For the
ones I did not remove, I added documentation (e.g. boards under
riscv/canaan.yaml). I also fixed several nodes and several existing yaml files.
E.g. The sifive gpio requires a clocks property but the K210 sifive gpio does
not have any software controllable clock defined. So for that one, there is a
cannan,k210-gpiohs compatible string added and the clocks property is made
optional if that string is used.

What remains is some checkpatch.pl warnings about undocumented compatible
strings for the disabled nodes that have no Linux driver. But I am not removing
these.

Finishing polishing the clock driver and retesting now. I will soon send v12
with these fixes.


-- 
Damien Le Moal
Western Digital


More information about the linux-riscv mailing list