How to enable UART port in Android 10 source

Hi, @goenjoy @Terry
Is UART0 activated on android 10 source? Which port is used? ttyS0? I need to connect GPS receiver.
Is UART1 used for Linux logs? Is it ttyFIQ0?

I try to add this changes, but it does not work.

@goenjoy please follow up this.

:sweat:

The ttyS2 did not appear in /dev.


Have these changes been made?

Yes.

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
index 7ba54d5…4a38a38 100755
— a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
@@ -945,7 +945,12 @@
};

&uart2 {
-status = “disabled”;
+status = “okay”;
+};
+
+&fiq_debugger {
+rockchip,serial-id = <0xffffffff>;
+status = “okay”;
};

&usbdrd3_0 {

and

diff --git a/ueventd.rockchip.rc b/ueventd.rockchip.rc
index 8e1df3c…20422c6 100755
— a/ueventd.rockchip.rc
+++ b/ueventd.rockchip.rc
@@ -53,8 +53,11 @@
/dev/compassirq 0660 system system

+# for GPS
-#/dev/ttyS3 0600 gps gps
/dev/gps 0660 gps gps
+/dev/ttyACM* 0660 gps gps
+/dev/ttyS2 0666 gps gps
+/dev/ttyUSB* 0666 gps gps
+/dev/ttyGPS* 0666 gps gps

/dev folder contains ttyS0 and ttyFIQ0 only.

I double checked this changes and rebuilt ROM again. It works on Android PIE only.

Sorry, we went on a tour last week. This is a platform bug. It takes time to solve the problem.

1 Like

@davemf

--- a/arch/arm64/boot/dts/rockchip/rk3399-android.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-android.dtsi
@@ -67,6 +67,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&uart2c_xfer>;
                interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH 0>;
+               status = "disabled";
        };
 
        reserved-memory {
@@ -154,7 +155,7 @@
 };
 
 &uart2 {
-       status = "disabled";
+       status = "okay";
 };

--- a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
@@ -951,10 +951,6 @@
-&uart2 {
-       status = "disabled";
-};
-

image

1 Like

Thank you!
What about GNSS HIDL service?

@goenjoy
After this changes, port ttyS2 was activated.
But if I try to read from port (cat dev/ttyS2), board freezed. Only reboot unfreezes board.
This logcat from device.

--- a/arch/arm64/boot/dts/rockchip/rk3399-android.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-android.dtsi
@@ -49,7 +49,7 @@
        compatible = "rockchip,android", "rockchip,rk3399";
 
        chosen: chosen {
-               bootargs = "earlycon=uart8250,mmio32,0xff1a0000 swiotlb=1 coherent_pool=1m";
+               bootargs = "swiotlb=1 coherent_pool=1m";
        };
 
        cpuinfo {
@@ -67,6 +67,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&uart2c_xfer>;
                interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH 0>;
+               status = "disabled";
        };
 
        reserved-memory {
@@ -154,7 +155,7 @@
 };
 
 &uart2 {
-       status = "disabled";
+       status = "okay";
 };

--- a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
@@ -951,10 +951,6 @@
-&uart2 {
-       status = "disabled";
-};
-

hlm@Server:/device/rockchip/common$ git diff
diff --git a/recovery/etc/init.rc b/recovery/etc/init.rc
index 2ed0ea6..f6cf0a0 100644
--- a/recovery/etc/init.rc
+++ b/recovery/etc/init.rc
@@ -94,7 +94,7 @@ service healthd /sbin/healthd -r
     seclabel u:r:healthd:s0
 
 service recovery /sbin/recovery
-    console
+    # console
     seclabel u:r:recovery:s0

--- a/init.rk30board.rc
+++ b/init.rk30board.rc
    
+       #add for ttyS2
+       chmod 777 /dev/ttyS2
1 Like