[Letux-kernel] X1600 upstreaming efforts

H. Nikolaus Schaller hns at goldelico.com
Sat Apr 19 23:35:50 CEST 2025


Hi Paul,

Great!

> Am 19.04.2025 um 16:08 schrieb Paul Boddie <paul at boddie.org.uk>:
> 
> On Saturday, 19 April 2025 13:55:53 CEST H. Nikolaus Schaller wrote:
>> 
>> any ideas what this python error means?
> 
> [...]
> 
>>  File
>> "/Users/hns/Library/Python/3.11/lib/python/site-packages/dtschema/dtb.py",
>> line 289, in fdt_scan_node phandles[node_dict['phandle']] = node_dict
>>    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
>> TypeError: unhashable type: 'list'
> 
> Sources for browsing are here:
> 
> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/dtb.py#L289
> 
> What it literally means is that the key presented to the dictionary (map, 
> hashtable) cannot be hashed because it is a list, which is mutable and thus 
> unsuitable. Here, the key is node_dict['phandle'] and the dictionary is 
> phandles.
> 
> Evidently, a list of phandles is produced for the phandle property of 
> whichever node is involved. However, the specification indicates that it 
> should be a single value:
> 
> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#phandle
> 
> Maybe uncommenting the print function call at line 288 in the code would 
> reveal which node is causing the problem and in which file. Perhaps the 
> nodename could be shown, too:
> 
>    print(nodename, 'phandle', node_dict['phandle'])
> 
> Running with -v would also show the filename involved.

Well, this is difficult to run with -v if it is invoked inside some Linux make.

But the idea to print the nodename results in:

  SCHEMA  Documentation/devicetree/bindings/processed-schema.json - due to target missing
/Volumes/CaseSensitive/master/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml: ignoring, error in schema: properties: bus-flags
/Volumes/CaseSensitive/master/Documentation/devicetree/bindings/power/supply/bq2429x.yaml: ignoring, error in schema: properties: monitored-battery
/Volumes/CaseSensitive/master/Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml: epd-thermal-zone: missing type definition
Warning: Duplicate compatible "rockchip,rk3588-pcie3-phy" found in schemas matching "$id":
http://devicetree.org/schemas/phy/rockchip,pcie3-phy.yaml#
http://devicetree.org/schemas/phy/rockchip-pcie3-phy.yaml#
Warning: Duplicate compatible "rockchip,rk3568-pcie3-phy" found in schemas matching "$id":
http://devicetree.org/schemas/phy/rockchip,pcie3-phy.yaml#
http://devicetree.org/schemas/phy/rockchip-pcie3-phy.yaml#
  UPD     include/config/kernel.release
  DTC [C] arch/mips/boot/dts/ingenic/lx16.dtb - due to target missing
nodename aliases phandle ['', '', '', '']
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/dt-validate", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/hns/Library/Python/3.11/lib/python/site-packages/dtschema/dtb_validate.py", line 158, in main
    sg.check_dtb(filename)
  File "/Users/hns/Library/Python/3.11/lib/python/site-packages/dtschema/dtb_validate.py", line 93, in check_dtb
    dt = self.validator.decode_dtb(f.read())
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hns/Library/Python/3.11/lib/python/site-packages/dtschema/validator.py", line 591, in decode_dtb
    return [dtschema.dtb.fdt_unflatten(self, dtb)]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hns/Library/Python/3.11/lib/python/site-packages/dtschema/dtb.py", line 522, in fdt_unflatten
    dt = fdt_scan_node(validator, fdt, '/', offset)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hns/Library/Python/3.11/lib/python/site-packages/dtschema/dtb.py", line 294, in fdt_scan_node
    node = fdt_scan_node(validator, fdt, nodename, offset)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hns/Library/Python/3.11/lib/python/site-packages/dtschema/dtb.py", line 289, in fdt_scan_node
    phandles[node_dict['phandle']] = node_dict
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
TypeError: unhashable type: 'list'
  DTC [C] arch/mips/boot/dts/ingenic/alpha400.dtb - due to target missing
nodename cpu at 0 phandle 36
nodename interrupt-controller phandle 2
nodename interrupt-controller at 10001000 phandle 8
nodename ext phandle 3

Ok, it is the "aliases" node. Let's look what we have in x1600.dtsi:

/ {
	#address-cells = <1>;
	#size-cells = <1>;
	compatible = "ingenic,x1600";

	aliases: aliases {
		i2c0 = &i2c0;
		i2c1 = &i2c1;
		uart0 = &uart0;
		uart1 = &uart1;
		uart2 = &uart2;
		uart3 = &uart3;
		mac0 = &mac0;
		spi0 = &spi0;
		spi_slv0 = &spi_slv0;
		pwm = &pwm;
		can0 = &can0;
		can1 = &can1;
		mmc0 = &mmc0;
		mmc1 = &mmc1;
	};

	cpus: cpus {
		#address-cells = <1>;
		#size-cells = <0>;

		cpu0: cpu at 0 {
			device_type = "cpu";
			compatible = "ingenic,xburst";
			reg = <0x000>;
			clock-frequency = <800000000>;

			clocks = <&cgu X1600_CLK_CPU>;
			clock-names = "cpu";
		};

	};
...

This looks good. But we do not even have a scheme defining the x1600...

So to me it is still not clear what triggers the TypeError.

Or is one of the &node; references in the aliases list broken/invalid?
But they all look ok. So we need another clever idea to understand this.

BR and thanks,
Nikolaus



More information about the Letux-kernel mailing list