Jump to content

RockPi-E enabling UART1 and OTG using custom DT overlays


djjerdog

Recommended Posts

I wanted to share 2 custom overlays I've created and tested for the RockPi E to enable UART1 and OTG via the GPIO.

 

Create file rockchip-uart1.dts

/dts-v1/;
/ {
	compatible = "rockchip,rk3328";
	fragment@0 {
		target-path = "/serial@ff120000";
		__overlay__ {
			pinctrl-0 = < 0x23 >;
			status = "okay";
		};
	};
};

 

Create file rockchip-otg.dts

/dts-v1/;
/ {
	compatible = "rockchip,rk3328";
	fragment@0 {
		target-path = "/usb@ff580000";
		__overlay__ {
			dr_mode = "otg";			
		};
	};
};

 

 

Install and enable overlays:
sudo armbian-add-overlay rockchip-uart1.dts
sudo armbian-add-overlay rockchip-otg.dts

Link to comment
Share on other sites

  • Werner featured this topic

Hi,

 

I have followed the procedure above to make it work, however I have an issue still. I am on armbian 21.08.1 Buster with Linux 5.10.60, the latest available. For information I have make this work with the legacy kernel so my wiring is fine.

 

#sudo dd bs=1M if=/dev/zero of=/piusb.bin count=64

#mkfs.ext4 -t ext4 /piusb.bin -O ^has_journal 

#sudo modprobe g_mass_storage file=/piusb.bin stall=0 removable=1 ro=1

#dmesg |tail -20

[   58.531943] Mass Storage Function, version: 2009/09/11
[   58.531983] LUN: removable file: (no medium)
[   58.532430] LUN: removable read only file: /piusb.bin
[   58.532452] Number of LUNs=1
[   58.532861] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
[   58.532882] g_mass_storage gadget: userspace failed to provide iSerialNumber
[   58.532896] g_mass_storage gadget: g_mass_storage ready
[   58.532921] dwc2 ff580000.usb: bound driver g_mass_storage
[   58.548704] dwc2 ff580000.usb: dwc2_core_reset: HANG! Soft Reset timeout GRSTCTL_CSFTRST

 

Do you know what can make this dwc2_core_reset: HANG?

 

Thank you,

Armandooooo

Link to comment
Share on other sites

Hi, I've also created a overlay for the Realtek 8211f NIC for RockPi E HW version 1.21 that I want to share.

 

Just place the file somewhere on your SBC and issue:

armbian-add-overlay <FILENAME>

(add sudo if needed in front) and reboot afterwards.

 

/dts-v1/;
/ {
	compatible = "rockchip,rk3328";
	fragment@0 {
		target-path = "/ethernet@ff540000";
		__overlay__ {
			snps,reset-delays-us = <0 20000 100000>;
			tx_delay = <0x1a>;
			rx_delay = <0x14>;
		};
	};
	fragment@1 {
		target-path = "/ethernet@ff540000/mdio";
		__overlay__ {
			ethernet-phy@1 {
				compatible = "ethernet-phy-id001c.c916", "ethernet-phy-ieee802.3-c22";
				reset-assert-us = <20000>;
				reset-deassert-us = <100000>;
				max-speed = <1000>;
			};
		};
	};
};

 

Link to comment
Share on other sites

@Igor can this overlay (one post above that) be added to the overlays for Rockpi E? I haven't found a way to contact the maintainer krachlatte about that.

With the overlay the RTL8211F will be supported which is currently listed as not supported on the Rockpi E Armbian page here:

grafik.png.b4bc72a1b5f6e9caf3397535974eccbd.png

 

Everything is working and I've already deployed a few PiKVM instances with that overlay, see here.

Link to comment
Share on other sites

4 hours ago, ich777 said:

can this overlay (one post above that) be added to the overlays for Rockpi E?

 

Open a PR here https://github.com/armbian/build/tree/main/patch/kernel/archive/rockchip-6.1/overlay

 

4 hours ago, ich777 said:

I haven't found a way to contact the maintainer krachlatte about that.

 

If he doesn't want to be contacted, there is nothing we can do. This is volunteering position at best effort principle. Some have time, interests and love, some don't. When we notice maintainer becomes unresponsive, board is (at release cycle) moved from "Standard" to "Community support" unless someone else take it over ...

 

https://github.com/ich777/pikvm-rockpi-e

This would be much better to be done as extension to the build framework.
Examples:
https://github.com/armbian/os/blob/main/userpatches/extensions/ha.sh

https://github.com/armbian/os/blob/main/userpatches/extensions/openhab.sh

Docs:
https://docs.armbian.com/Developer-Guide_Extensions/

There is another person, that is around, doing similar https://github.com/srepac/kvmd-armbian perhaps teaming up and do it properly & maintainable? And with IMO less efforts.

Link to comment
Share on other sites

vor 20 Stunden schrieb Igor:

Open a PR here

PR created. Thanks for the quick response.

 

BTW, I have two other patches that enable the UART1 on the GPIOs and that enable the USB2.0 on the GPIOs on the Rockpi E, is that something that is from interest or better speaking worth a PR since the UART1 overlay that is already available is not working correctly for me.

 

vor 20 Stunden schrieb Igor:

This would be much better to be done as extension to the build framework.

Thanks for the hint, I have to look into that but I have to say that currently my time is really limited but I already thought about something like that.

Edited by ich777
Link to comment
Share on other sites

I'd recommend submitting PRs for what you think is necessary.  You will get better feedback there than here in the forum as more developers follow the GitHub activity than the forums.

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