Something Name Posted August 10, 2023 Posted August 10, 2023 Hello everyone I have some trouble with device tree from Mango Pi. There is no overlays in Mango Pi D1: armbian-add-overlay file.dts => output: D1 is not support for overlays. When start board, command dmesg | grep serial output: @2500000.serial and @2500400.serial. It's okay. When I decompiled sun20i-d1-nezha.dtb file I saw that serial@2500000 and serial@2500400 status = "okay", other serials status = "disable". There are serials: 2500000,2500400,2500800,2500c00,2501000,2501400. So I try, for example, to change status for serial@2500800 from disable to okay. After dtc -I dts -O dtb to the /boot/dtb/allwiner then I did reboot and dmesg | grep serial output only serial@2500000 and serial@2500400, there is no 2500800. What's the problem?:( 0 Quote
Something Name Posted August 10, 2023 Author Posted August 10, 2023 (edited) I cant do anything with this file... I try change pins in pinctrl@200000, I try disable/okay any interface and nothing is going on... Please, help Edited August 10, 2023 by Something Name 0 Quote
going Posted August 10, 2023 Posted August 10, 2023 On 8/10/2023 at 11:04 AM, Something Name said: Please, help Expand Describe in more detail the sequence of actions. Show what is in the /boot/armbianEnv file. Show under the spoiler the file before the changes, what has changed. And see how the dtb was applied directly on a working device: dtc --sort -I fs -O dts /sys/firmware/devicetree/base > $HOME/device_tree.txt 0 Quote
going Posted August 10, 2023 Posted August 10, 2023 On 8/10/2023 at 4:42 AM, Something Name said: serial@2500800 from disable to okay Expand Are you trying to enable UART2? This is the source code: uart2: serial@2500800 { compatible = "snps,dw-apb-uart"; reg = <0x2500800 0x400>; reg-io-width = <4>; reg-shift = <2>; interrupts = <SOC_PERIPHERAL_IRQ(4) IRQ_TYPE_LEVEL_HIGH>; clocks = <&ccu CLK_BUS_UART2>; resets = <&ccu RST_BUS_UART2>; dmas = <&dma 16>, <&dma 16>; dma-names = "tx", "rx"; status = "disabled"; }; Somewhere at the bottom of the text of the dts you need to add something like this: &uart2 { pinctrl-0 = <&uart2_pb_pins>; pinctrl-names = "default"; status = "okay"; }; 0 Quote
Something Name Posted August 10, 2023 Author Posted August 10, 2023 On 8/10/2023 at 12:50 PM, going said: Describe in more detail the sequence of actions. Show what is in the /boot/armbianEnv file. Show under the spoiler the file before the changes, what has changed. And see how the dtb was applied directly on a working device: dtc --sort -I fs -O dts /sys/firmware/devicetree/base > $HOME/device_tree.txt Expand I use this Image for SD https://disk.yandex.ru/d/da8qJ8wyE1hhcQ/Nezha_D1/ArmbianTV/20220722/Armbian_22.08.0-trunk_Nezha_jammy_current_5.19.0_xfce_desktop.img.xz This Image from https://mangopi.org/mqpro After installation there are no /boot/armbianEnv file and /boot/boot.scr files, idk why. What about dtb file: there is /boot/dtb/allwinner/sun20i-d1-nezha.dtb file. I use command: dtc -I dtb -O dtb -f /boot/dtb/allwinner/sun20i-d1-nezha.dtb -o ~/sun20i-d1-nezha.dts In the .dts file I see that serial@2500000 and serial@2500400 status = "okay". Also I see that there are 2500800,2500c00,2501000,2501400 serials. For example I try set serial@2500000 status = "disabled" and set serial@2500800 status = "okay", then I use command: dtc -I dts -O dtb ~/sun20i-d1-nezha.dts -o /boot/dtb/allwinner/sun20i-d1-nezha.dtb && chmod +x /boot/dtb/allwinner/sun20i-d1-nezha.dtb After reboot I use command: dmesg | grep serial and stdout: 2500000.serial on... and 2500400.serial on... Something like this output. So recompiling .dts file with my changes is doing nothing. On 8/10/2023 at 1:20 PM, going said: Are you trying to enable UART2? Expand Yes, I want uart2 and uart3 and uart 4-5 in the future. I need many uarts On 8/10/2023 at 1:20 PM, going said: This is the source code: Expand There are no links at uarts in the .dts file after decompiling of .dtb file that I have after installation of this image. 0 Quote
going Posted August 10, 2023 Posted August 10, 2023 On 8/10/2023 at 5:33 PM, Something Name said: I use command: dtc -I dtb -O dtb -f /boot/dtb/allwinner/sun20i-d1-nezha.dtb -o ~/sun20i-d1-nezha.dts Expand Attach the archive of this received file to the message. highlight the changes with comments. I'll just look at it. 0 Quote
Something Name Posted August 11, 2023 Author Posted August 11, 2023 On 8/10/2023 at 6:42 PM, going said: Attach the archive of this received file to the message. highlight the changes with comments. I'll just look at it. Expand sun20i-d1-nezha.dts.zip at 255 row I try add uart2 pins at 291 I try stop led at 576 I try disable serial@2500000 at 616 I try okay serial@2500800 0 Quote
Solution going Posted August 11, 2023 Solution Posted August 11, 2023 On 8/10/2023 at 5:33 PM, Something Name said: I use this Image for SD https://disk.yandex.ru/d/da8qJ8wyE1hhcQ/Nezha_D1/ArmbianTV/20220722/Armbian_22.08.0-trunk_Nezha_jammy_current_5.19.0_xfce_desktop.img.xz Expand @Something Name The image you are using is something previously from the author Oleg @balbes150. This is some kind of early work. There is no support for allwinner D1 in the upstream kernel 5.19. Support starts with kernel version 6.3 riscv/boot/dts/allwinner/sun20i-d1-nezha.dts I don't think he will want to go back to the old images and support them. Try to use the last option on the 6.5 kernel: Nezha_D1/ArmbianTV/20230710-edge The author will be available soon. He's on vacation today. He will be able to help faster. By the way, it uses the extlinux mechanism to load the kernel. The /boot folder should have a directory of the same name with a boot configuration file. 0 Quote
going Posted August 11, 2023 Posted August 11, 2023 On 8/11/2023 at 4:08 AM, Something Name said: at 255 row I try add uart2 pins at 291 I try stop led at 576 I try disable serial@2500000 at 616 I try okay serial@2500800 Expand I didn't see any obvious crime in your changes. The question of why they are not applied is still open. The only assumption is that the dtb is already in the kernel or in initramfs. Show the contents of the file in the extlinux folder. 0 Quote
Something Name Posted August 11, 2023 Author Posted August 11, 2023 On 8/11/2023 at 8:16 AM, going said: @Something Name The image you are using is something previously from the author Oleg @balbes150. This is some kind of early work. There is no support for allwinner D1 in the upstream kernel 5.19. Support starts with kernel version 6.3 riscv/boot/dts/allwinner/sun20i-d1-nezha.dts I don't think he will want to go back to the old images and support them. Try to use the last option on the 6.5 kernel: Nezha_D1/ArmbianTV/20230710-edge The author will be available soon. He's on vacation today. He will be able to help faster. By the way, it uses the extlinux mechanism to load the kernel. The /boot folder should have a directory of the same name with a boot configuration file. Expand Thanks you I'll try to use this image On 8/11/2023 at 8:26 AM, going said: I didn't see any obvious crime in your changes. The question of why they are not applied is still open. The only assumption is that the dtb is already in the kernel or in initramfs. Show the contents of the file in the extlinux folder. Expand I thought about this. Now I try to use ubuntu risc-v and it works my changes for nezha.dtb with this distribution https://cdimage.ubuntu.com/releases/22.04.3/release/ubuntu-22.04.3-preinstalled-server-riscv64+nezha.img.xz?_ga=2.90554782.566292208.1691731866-284423939.1691731866 Good luck, all the good 0 Quote
going Posted August 11, 2023 Posted August 11, 2023 On 8/11/2023 at 9:10 AM, Something Name said: Now I try to use ubuntu risc-v and it works my changes for nezha.dtb with this distribution https://cdimage.ubuntu.com/releases/22.04.3/release/ubuntu-22.04.3-preinstalled-server-riscv64+nezha.img.xz?_ga=2.90554782.566292208.1691731866-284423939.1691731866 Expand What is the kernel version in ? 0 Quote
Something Name Posted August 11, 2023 Author Posted August 11, 2023 On 8/11/2023 at 9:49 AM, going said: What is the kernel version in ? Expand 5.19.0-1015-allwinner riscv64 1 Quote
Recommended Posts
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.