[Letux-kernel] X1600 upstreaming efforts

H. Nikolaus Schaller hns at goldelico.com
Mon Apr 21 08:24:36 CEST 2025


Hi Paul,

> Am 21.04.2025 um 00:25 schrieb Paul Boddie <paul at boddie.org.uk>:
> 
> On Saturday, 19 April 2025 23:35:50 CEST H. Nikolaus Schaller wrote:
>> 
>> 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.
> 
> So, after finally upgrading my distribution, installing the appropriate Python 
> libraries, and then messing around with the absurdly complicated way that one 
> is supposed to "install" Python packages, even if one is going to be 
> developing and effectively running them from their source directory, I had a 
> closer look at this.
> 
> The problem appears to be the special way that the prop_value function treats 
> the aliases node:
> 
>    if nodename in {'__fixups__', 'aliases'}:
>        return data[:-1].decode(encoding='ascii').split('\0')
> 
> This obtains encoded data of the form '\x00\x00\x00\x1b' from the device tree, 
> which it then turns into the strange list of four empty strings that we saw. 
> But this data resembles an encoded 32-bit big-endian integer value of 27, 
> which could plausibly be the phandle index.
> 
> So, I just changed the above to omit 'aliases' and the error disappeared:
> 
>    if nodename in {'__fixups__'}:
>        return data[:-1].decode(encoding='ascii').split('\0')
> 
> Printing out the node dictionary for each node indeed indicated that the 
> phandle started at 27 with aliases and then incremented from there.
> 
> I imagine that this problem is due to some kind of change in the way an 
> underlying library, maybe libfdt, exposes tree data. Maybe aliases nodes 
> didn't have a phandle but now they do, meaning that the uniform decoding done 
> above cannot be done. Instead, the prop_value function should just be allowed 
> to process the properties as normal.
> 
> Running the tool on the device tree produces lots of complaints! One of them 
> will be about the phandle of the aliases node, presumably because the 
> validator assumes that every property in an aliases node is an alias, despite

IMHO the issue are not the phandles in the aliases { properties } but the label/phandle
of the alias node itself (see below).

> the phandle sneaking in. So, the phandle needs to be removed from the 
> node_dict in the code that was raising the TypeError:
> 
>    node_dict = node_props(validator, fdt, nodename, offset)
>    if 'phandle' in node_dict:
>        #print('phandle', node_dict['phandle'])
>        phandles[node_dict['phandle']] = node_dict
>        if nodename == 'aliases':
>            del node_dict['phandle']
> 
> Many of the genuine complaints are fairly trivial: "ok" instead of "okay", 
> "disable" instead of "disabled". There are some complaints about names, value 
> representations, and the groups provided in the aic_pb node. Some of these 
> complaints are not particularly easy to follow.
> 
> Anyway, let me know if these changes aren't understandable.

I did run the same make dtbs_ckeck for the ci20. Result: No such error.

Then I compared the ci20.dts and lx16.dts and found that the aliases node
is part of ci20.dts and x1600.dtsi. So for one it is part of the board.dts and
for the other it is part of the cpu.dtsi. Changing this did not improve. But
we should change this anyways.

Finally I removed the aiases: label and the error is gone... This confirms
your findings that there should be no phandle for aliases (for whatever reasons).

And I have only found three other other example using a label at the aliases node.
Therefore I think nobody dtbs_checked for that case...

iMac:master hns$ fgrep aliases -R arch/*/boot | fgrep aliases: | fgrep -v .tmp
arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi: aliases: aliases {
arch/arm/boot/dts/nxp/imx/imx6dl-yapp43-common.dtsi: aliases: aliases {
arch/arm/boot/dts/samsung/s5pv210-aries.dtsi: aliases: aliases {
arch/mips/boot/dts/ingenic/x1600.dtsi: aliases: aliases {
iMac:master hns$ 

So we now have passed this hurdle and see the real weak points of our DTS.

I did not see complains about ok/okay and disable/disabled, but it looks as
if we have to add patches for some bindings documents.

The attached log is what I get for lx16 after fixing some (not yet included in v6.15-rc3).
There are a lot of warnings for other devices, for example I have a fix for openpandora-sound...

BR and thanks,
Nikolaus

  DTC [C] arch/mips/boot/dts/ingenic/lx16.dtb - due to target missing
arch/mips/boot/dts/ingenic/lx16.dtb: /: failed to match any schema with compatible: ['goldelico,letux-x16', 'ingenic,halley6_v10', 'ingenic,x1600']
arch/mips/boot/dts/ingenic/lx16.dtb: /: failed to match any schema with compatible: ['goldelico,letux-x16', 'ingenic,halley6_v10', 'ingenic,x1600']
arch/mips/boot/dts/ingenic/lx16.dtb: /: failed to match any schema with compatible: ['goldelico,letux-x16', 'ingenic,halley6_v10', 'ingenic,x1600']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: / (goldelico,letux-x16): memory: False schema does not allow {'device_type': ['memory'], 'reg': [[0, 33554432]]}
from schema $id: http://devicetree.org/schemas/root-node.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /cpus/cpu at 0: failed to match any schema with compatible: ['ingenic,xburst']
arch/mips/boot/dts/ingenic/lx16.dtb: /cpufreq-dt: failed to match any schema with compatible: ['ingenic,x1600-cpufreq']
arch/mips/boot/dts/ingenic/lx16.dtb: /core-intc at 10001000: failed to match any schema with compatible: ['ingenic,x1600-intc']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: timer at 12000000 (ingenic,x1000-ost): '#interrupt-cells', 'interrupt-controller' do not match any of the regexes: 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/timer/ingenic,sysost.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: clock-controller at 10000000 (ingenic,x1600-cgu): 'little-endian' does not match any of the regexes: '^mac-phy-ctrl@[a-f0-9]+$', '^usb-phy@[a-f0-9]+$', 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/clock/ingenic,cgu.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: clock-controller at 10000000 (ingenic,x1600-cgu): clock-names: ['ext', 'rtc', 'clk12m'] is too long
from schema $id: http://devicetree.org/schemas/clock/ingenic,cgu.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: clock-controller at 10000000 (ingenic,x1600-cgu): clocks: [[3], [4], [5]] is too long
from schema $id: http://devicetree.org/schemas/clock/ingenic,cgu.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /apb/sadc at 10070000: failed to match any schema with compatible: ['ingenic,x1600-sadc']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: sadc at 10070000 (ingenic,x1600-sadc): status: 'oneOf' conditional failed, one must be fixed:
['ok'] is not of type 'object'
'ok' is not one of ['okay', 'disabled', 'reserved', 'fail', 'fail-needs-probe']
from schema $id: http://devicetree.org/schemas/dt-core.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /apb/timer at 10002000: failed to match any schema with compatible: ['ingenic,x1600-tcu', 'simple-mfd']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: timer at 10002000 (ingenic,x1600-tcu): status: 'oneOf' conditional failed, one must be fixed:
['ok'] is not of type 'object'
'ok' is not one of ['okay', 'disabled', 'reserved', 'fail', 'fail-needs-probe']
from schema $id: http://devicetree.org/schemas/dt-core.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /apb/timer at 10002000/watchdog at 0: failed to match any schema with compatible: ['ingenic,x1600-watchdog', 'ingenic,jz4780-watchdog']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: rtc at 10003000 (ingenic,x1600-rtc): clock-names: ['rtc', 'ext', 'pclk'] is too long
from schema $id: http://devicetree.org/schemas/rtc/ingenic,rtc.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: rtc at 10003000 (ingenic,x1600-rtc): clocks: [[1, 1], [1, 0], [1, 13]] is too long
from schema $id: http://devicetree.org/schemas/rtc/ingenic,rtc.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: rtc at 10003000 (ingenic,x1600-rtc): compatible: 'oneOf' conditional failed, one must be fixed:
['ingenic,x1600-rtc', 'ingenic,jz4780-rtc'] is too long
'ingenic,x1600-rtc' is not one of ['ingenic,jz4740-rtc', 'ingenic,jz4760-rtc']
'ingenic,jz4725b-rtc' was expected
'ingenic,x1600-rtc' is not one of ['ingenic,jz4770-rtc', 'ingenic,jz4780-rtc']
'ingenic,jz4740-rtc' was expected
'ingenic,jz4760-rtc' was expected
from schema $id: http://devicetree.org/schemas/rtc/ingenic,rtc.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: rtc at 10003000 (ingenic,x1600-rtc): Unevaluated properties are not allowed ('clock-names', 'clocks', 'compatible', 'power-on-press-ms' were unexpected)
from schema $id: http://devicetree.org/schemas/rtc/ingenic,rtc.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /apb/rtc at 10003000: failed to match any schema with compatible: ['ingenic,x1600-rtc', 'ingenic,jz4780-rtc']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: rtc at 10003000 (ingenic,x1600-rtc): status: 'oneOf' conditional failed, one must be fixed:
['ok'] is not of type 'object'
'ok' is not one of ['okay', 'disabled', 'reserved', 'fail', 'fail-needs-probe']
from schema $id: http://devicetree.org/schemas/dt-core.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: pinctrl at 10010000 (ingenic,x1600-pinctrl): ingenic,num-chips: 'anyOf' conditional failed, one must be fixed:
[4] is not of type 'object'
from schema $id: http://devicetree.org/schemas/pinctrl/ingenic,pinctrl.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: pinctrl at 10010000 (ingenic,x1600-pinctrl): ingenic,regs-offset: 'anyOf' conditional failed, one must be fixed:
[256] is not of type 'object'
from schema $id: http://devicetree.org/schemas/pinctrl/ingenic,pinctrl.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: pinctrl at 10010000 (ingenic,x1600-pinctrl): fixme: 'anyOf' conditional failed, one must be fixed:
'ingenic,pinmux' does not match any of the regexes: 'pinctrl-[0-9]+'
True is not of type 'object'
[8, 17, 22] is not of type 'object'
from schema $id: http://devicetree.org/schemas/pinctrl/ingenic,pinctrl.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /apb/serial at 10030000: failed to match any schema with compatible: ['ingenic,x1600-uart']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: serial at 10030000 (ingenic,x1600-uart): 'pinctrl-0' is a dependency of 'pinctrl-names'
from schema $id: http://devicetree.org/schemas/pinctrl/pinctrl-consumer.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /apb/serial at 10031000: failed to match any schema with compatible: ['ingenic,x1600-uart']
arch/mips/boot/dts/ingenic/lx16.dtb: /apb/serial at 10032000: failed to match any schema with compatible: ['ingenic,x1600-uart']
arch/mips/boot/dts/ingenic/lx16.dtb: /apb/serial at 10033000: failed to match any schema with compatible: ['ingenic,x1600-uart']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: serial at 10033000 (ingenic,x1600-uart): 'pinctrl-0' is a dependency of 'pinctrl-names'
from schema $id: http://devicetree.org/schemas/pinctrl/pinctrl-consumer.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /apb/spi at 10043000: failed to match any schema with compatible: ['ingenic,x1600-spi']
arch/mips/boot/dts/ingenic/lx16.dtb: /apb/slv at 10045000: failed to match any schema with compatible: ['ingenic,slv']
arch/mips/boot/dts/ingenic/lx16.dtb: /apb/dtrng at 10072000: failed to match any schema with compatible: ['ingenic,dtrng']
arch/mips/boot/dts/ingenic/lx16.dtb: /apb/otg_phy at 10007800: failed to match any schema with compatible: ['ingenic,x1600-phy']
arch/mips/boot/dts/ingenic/lx16.dtb: /apb/aic at 10079000: failed to match any schema with compatible: ['ingenic,x1600-i2s']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: ahb2 (simple-bus): $nodename:0: 'ahb2' does not match '^([a-z][a-z0-9\\-]+-bus|bus|localbus|soc|axi|ahb|apb)(@.+)?$'
from schema $id: http://devicetree.org/schemas/simple-bus.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /ahb2/mmc at 13460000/wlan at 0: failed to match any schema with compatible: ['espressif,esp_sdio']
arch/mips/boot/dts/ingenic/lx16.dtb: /ahb2/can at 13560000: failed to match any schema with compatible: ['ingenic,x1600-can']
arch/mips/boot/dts/ingenic/lx16.dtb: /ahb2/can at 13570000: failed to match any schema with compatible: ['ingenic,x1600-can']
arch/mips/boot/dts/ingenic/lx16.dtb: /ahb2/cdbus at 13430000: failed to match any schema with compatible: ['ingenic,x1600-cdbus']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: cdbus at 13430000 (ingenic,x1600-cdbus): status: 'oneOf' conditional failed, one must be fixed:
['ok'] is not of type 'object'
'ok' is not one of ['okay', 'disabled', 'reserved', 'fail', 'fail-needs-probe']
from schema $id: http://devicetree.org/schemas/dt-core.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /ahb2/aes at 13430000: failed to match any schema with compatible: ['ingenic,aes']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: aes at 13430000 (ingenic,aes): status: 'oneOf' conditional failed, one must be fixed:
['ok'] is not of type 'object'
'ok' is not one of ['okay', 'disabled', 'reserved', 'fail', 'fail-needs-probe']
from schema $id: http://devicetree.org/schemas/dt-core.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /ahb2/hash at 13470000: failed to match any schema with compatible: ['ingenic,hash']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: hash at 13470000 (ingenic,hash): status: 'oneOf' conditional failed, one must be fixed:
['ok'] is not of type 'object'
'ok' is not one of ['okay', 'disabled', 'reserved', 'fail', 'fail-needs-probe']
from schema $id: http://devicetree.org/schemas/dt-core.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: mac at 134b0000 (ingenic,x1600-mac): 'ingenic,mac-mode', 'ingenic,mode-reg', 'ingenic,phy-clk-freq', 'ingenic,pwr-gpio', 'ingenic,rst-gpio', 'ingenic,rst-ms' do not match any of the regexes: 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/net/ingenic,mac.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /ahb2/sfc at 13440000: failed to match any schema with compatible: ['ingenic,x1600-sfc']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: dma at 13420000 (ingenic,jz4780-dma): $nodename:0: 'dma at 13420000' does not match '^dma-controller(@.*)?$'
from schema $id: http://devicetree.org/schemas/dma/ingenic,dma.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: dma at 13420000 (ingenic,jz4780-dma): interrupts: [[3], [4]] is too long
from schema $id: http://devicetree.org/schemas/dma/ingenic,dma.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: dma at 13420000 (ingenic,jz4780-dma): Unevaluated properties are not allowed ('interrupts' was unexpected)
from schema $id: http://devicetree.org/schemas/dma/ingenic,dma.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /ahb2/mcu at 13420000: failed to match any schema with compatible: ['ingenic,x1600-mcu']
arch/mips/boot/dts/ingenic/lx16.dtb: /ahb2/pwm at 134c0000: failed to match any schema with compatible: ['ingenic,x1600-pwm']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: otg at 13500000 (ingenic,x1600-otg): $nodename:0: 'otg at 13500000' does not match '^usb(@.*)?'
from schema $id: http://devicetree.org/schemas/usb/dwc2.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: otg at 13500000 (ingenic,x1600-otg): Unevaluated properties are not allowed ('device-using-dma', 'g-use-dma' were unexpected)
from schema $id: http://devicetree.org/schemas/usb/dwc2.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /ahb2/efuse at 13540000: failed to match any schema with compatible: ['ingenic,x1600-efuse']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: ahb1 (simple-bus): $nodename:0: 'ahb1' does not match '^([a-z][a-z0-9\\-]+-bus|bus|localbus|soc|axi|ahb|apb)(@.+)?$'
from schema $id: http://devicetree.org/schemas/simple-bus.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: ahb0 (simple-bus): $nodename:0: 'ahb0' does not match '^([a-z][a-z0-9\\-]+-bus|bus|localbus|soc|axi|ahb|apb)(@.+)?$'
from schema $id: http://devicetree.org/schemas/simple-bus.yaml#
arch/mips/boot/dts/ingenic/lx16.dtb: /ahb0/cim at 13060000: failed to match any schema with compatible: ['ingenic,x1600-cim']
arch/mips/boot/dts/ingenic/lx16.dtb: /ahb0/dpu at 13050000: failed to match any schema with compatible: ['ingenic,x1600-dpu']
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: aliases: 'spi_slv0' does not match any of the regexes: '^[a-z][a-z0-9\\-]*$', 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/aliases.yaml#
/Volumes/CaseSensitive/master/arch/mips/boot/dts/ingenic/lx16.dtb: gpio_keys (gpio-keys): 'bootsel0', 'bootsel1', 'wakeup' do not match any of the regexes: '^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$', 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml#



More information about the Letux-kernel mailing list