1 1
Java475

sun50i-h5-fixup.scr invalid references

Recommended Posts

Hi,

there are invalid references inside sun50i-h5-fixup.scr, I think.

I use NANOPINEO2, myself compiled linux-*-current-sunxi64_20.05.0-trunk_arm64.deb, kernel  5.4.28-sunxi64 #trunk SMP PREEMPT.

 

amrbianEnv.txt (reduced):

        overlay_prefix=sun50i-h5
        overlays=i2c0 uart1 uart2 usbhost1 usbhost2 usbhost3
        param_uart1_rtscts=1
        param_uart2_rtscts=1

 

For example, the row param_uart2_rtscts=1 leads to use following rows of sun50i-h5-fixup.scr:

        fdt get value tmp_phandle1 /soc/pinctrl@1c20800/uart2 phandle
        fdt get value tmp_phandle2 /soc/pinctrl@1c20800/uart2_rts_cts phandle
        fdt set /soc/serial@1c28800 pinctrl-names "default" "default"
        fdt set /soc/serial@1c28800 pinctrl-0 "<${tmp_phandle1}>"
        fdt set /soc/serial@1c28800 pinctrl-1 "<${tmp_phandle2}>"
        env delete tmp_phandle1 tmp_phandle2

 

There are some error messages during boot:

        Applying kernel provided DT fixup script (sun50i-h5-fixup.scr)
        ## Executing script at 44000000
        tmp_bank=A
        tmp_pin=21
        libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
        libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
        libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
        10046717 bytes read in 505 ms (19 MiB/s)

 

As a result, the RTS/CTS handshaking for UART2 is unfunctional. May be for UART1 and UART3 is the same?

 

I think the reason is that there are no paths /soc/pinctrl@1c20800/uart2 and /soc/pinctrl@1c20800/uart2_rts_cts inside the device tree specified by sun50i-h5-nanopi-neo2-v1.1.dtb file.

The right paths are /soc/pinctrl@1c20800/uart2-pins and /soc/pinctrl@1c20800/uart2-rts-cts-pins, I think.

 

Am I right? I've tried easy modification of SCR script - handshaking is now functional, but CRC is bad.

If I am right, what is the right way to correct this? Script change (how properly?), DTB change, DTBO creation, ...?

 

Moreover, look at this reduced listing of /sys/firmware/devicetree/base/soc/pinctrl@1c20800:

        csi-pins
        emac-rgmii-pins
        i2c0-pins
        i2c1-pins
        i2c2-pins
        i2s0-pins
        i2s1-pins
        mmc0-pins
        mmc1-pins
        mmc2-8bit-pins
        spi0-pins
        spi1-pins
        uart0-pa-pins
        uart1-pins
        uart1-rts-cts-pins
        uart2-pins

        uart2_rts_cts
        uart2-rts-cts-pins
        uart3-pins
        uart3-rts-cts-pins
        w1_pins

 

Why are somewhere dashes "-" and somewhere underscores "_" ?

 

Thank you.

Share this post


Link to post
Share on other sites

Nobody knows what is the right way to correct this issue?

Do I have to create my own DTBO?

Thank you.

Share this post


Link to post
Share on other sites
10 hours ago, Java475 said:

Nobody knows what is the right way to correct this issue?

Right ! Good catch ! I seems that dashes/underscores issue appeared when we switched from 4.20.y to 5.0.y and still unfixed in 5.5.y .

I will try to fix that in the following days ...

10 hours ago, Java475 said:

Do I have to create my own DTBO?

In the meantime, Yes, you need to fix the overlay along the fixup script ...

 

EDIT: During a second look, it seems that /proc/device-tree/__symbols__/ has underscores. So, maybe both are working. I will try to figure out ...

 

EDIT2: Here is the commit : https://github.com/armbian/build/commit/281c8546954c7e6ec993c03632d701490464c36f

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
1 1