Jump to content

Mango Pi MQ-Pro (D1) Device Tree. Try to "okay" serial


Something Name
Go to solution Solved by going,

Recommended Posts

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?:(

Link to comment
Share on other sites

1 час назад, Something Name сказал:

Please, help

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

Link to comment
Share on other sites

8 часов назад, Something Name сказал:

serial@2500800 from disable to okay

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";
};

 

Link to comment
Share on other sites

4 часа назад, going сказал:

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

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.

 

4 часа назад, going сказал:

Are you trying to enable UART2?

Yes, I want uart2 and uart3 and uart 4-5 in the future. I need many uarts :)

4 часа назад, going сказал:

This is the source code:

There are no links at uarts in the .dts file after decompiling of .dtb file that I have after installation of this image.

Link to comment
Share on other sites

1 час назад, Something Name сказал:

I use command: dtc -I dtb -O dtb -f /boot/dtb/allwinner/sun20i-d1-nezha.dtb -o ~/sun20i-d1-nezha.dts

Attach the archive of this received file to the message. highlight the changes with comments.
I'll just look at it.

Link to comment
Share on other sites

  • Solution
14 часов назад, Something Name сказал:

@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.

 

Link to comment
Share on other sites

4 часа назад, Something Name сказал:

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

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.

Link to comment
Share on other sites

48 минут назад, going сказал:

@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.

Thanks you :)

I'll try to use this image :)

39 минут назад, going сказал:

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.

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 :)

Link to comment
Share on other sites

38 минут назад, Something Name сказал:

What is the kernel version in ?

Link to comment
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...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines