Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UART4 a.k.a. serial4 a.k.a. uartexp a.k.a. ttyS4 Does Not Exist
#1
Hi out there,

we have a tinker board, and it is performing SUPERB!

Except that we cannot bring the UART4 on the pin-header alive.

The other three ares OK (uartbt is reserved for bluetooth).
It does not appear in /proc/iomem as the others:


Code:
root@linaro-alip:~# cat /proc/iomem
00000000-7fffffff : System RAM
  00008000-00ed628b : Kernel code
  01000000-01140eef : Kernel data
...........

ff180000-ff18001f : serial
ff190000-ff19001f : serial
ff1b0000-ff1b001f : serial
.........
ff690000-ff69001f : serial
..........




According to RK3288 TRM it should be at ff1c000, but none.

I've tried a lot of funny things, including these:

Code:
root@linaro-alip:~# cat /boot/hw_intf.conf

#Hardware Interface Config

intf:i2c1=on
intf:i2c4=on
intf:spi0=off
intf:spi2=on
intf:pwm2=off
intf:pwm3=off
intf:uart0=on
intf:uart1=on
intf:uart2=on
intf:uart3=on
intf:uart4=on
intf:uart5=on
intf:serial0=on
intf:serial1=on
intf:serial2=on
intf:serial3=on
intf:serial4=on

but nope.

I've dig down the kernel source but I've found only one
suspicious thing in

20170223-tinker-board-linaro-jessie-alip-kernel-v1.4/arch/arm/mach-rockchip/pm-rk3288.c

at  Line 493:


Code:
static u32 slp_uart_phy[RK3288_UART_NUM]={(0xff180000),(0xff190000),(0xff690000),(0xff1b0000)};

(0xff1c0000) is missing...

Can anybody help me?
We need as much serial ports as possible.

Regards,
Meres5
Reply
#2
Did you try to just add an entry in the rk3288-tinker.dts file ( or rk3288-miniarm.dts depending on the kernel used ) ?

Note that DTS files are found in the arch/arm/boot/dts folder.

Adding something like

&uart4 {
status = "okay";
};

might do the trick.

Try also with a recent kernel, if you can.
Reply
#3
Hi Myy!

Thank you for the quick response.

I've already de-compiled the rk3288-miniarm.dtb  found in /boot
of the running system.
The resulted device tree is quite long, so I've just included the relevant sections here:


Code:
/dts-v1/;

/ {
        #address-cells = <0x1>;
        #size-cells = <0x1>;
        compatible = "rockchip,rk3288-miniarm", "rockchip,rk3288";
        interrupt-parent = <0x1>;

        chosen {
        };

        aliases {
                i2c0 = "/i2c@ff650000";
                i2c1 = "/i2c@ff140000";
                i2c2 = "/i2c@ff660000";
                i2c3 = "/i2c@ff150000";
                i2c4 = "/i2c@ff160000";
                i2c5 = "/i2c@ff170000";
                mshc0 = "/dwmmc@ff0f0000";
                mshc1 = "/dwmmc@ff0c0000";
                mshc2 = "/dwmmc@ff0d0000";
                mshc3 = "/dwmmc@ff0e0000";
                serial0 = "/serial@ff180000";
                serial1 = "/serial@ff190000";
                serial2 = "/serial@ff690000";
                serial3 = "/serial@ff1b0000";
                serial4 = "/serial@ff1c0000";
                spi0 = "/spi@ff110000";
                spi1 = "/spi@ff120000";
 . . . . . . . . . .
        serial@ff1b0000 {
                compatible = "rockchip,rk3288-uart", "snps,dw-apb-uart";
                reg = <0xff1b0000 0x100>;
                interrupts = <0x0 0x3a 0x4>;
                reg-shift = <0x2>;
                reg-io-width = <0x4>;
                clocks = <0x7 0x50 0x7 0x158>;
                clock-names = "baudclk", "apb_pclk";
                pinctrl-names = "default";
                pinctrl-0 = <0x30>;
                status = "okay";
        };

        serial@ff1c0000 {
                compatible = "rockchip,rk3288-uart", "snps,dw-apb-uart";
                reg = <0xff1c0000 0x100>;
                interrupts = <0x0 0x3b 0x4>;
                reg-shift = <0x2>;
                reg-io-width = <0x4>;
                clocks = <0x7 0x51 0x7 0x159>;
                clock-names = "baudclk", "apb_pclk";
                pinctrl-names = "default";
                pinctrl-0 = <0x31>;
                status = "okay";
        };
. . . . . . . . . . .
        pinctrl {
                compatible = "rockchip,rk3288-pinctrl";
                rockchip,grf = <0xb>;
                rockchip,pmu = <0x6>;
 . . . . . .

                uart3 {

                        uart3-xfer {
                                rockchip,pins = <0x7 0x7 0x1 0x7e 0x7 0x8 0x1 0x7d>;
                                linux,phandle = <0x30>;
                                phandle = <0x30>;
                        };

                        uart3-cts {
                                rockchip,pins = <0x7 0x9 0x1 0x7e>;
                        };

                        uart3-rts {
                                rockchip,pins = <0x7 0xa 0x1 0x7d>;
                        };
                };

                uart4 {

                        uart4-xfer {
                                rockchip,pins = <0x5 0xc 0x3 0x7e 0x5 0xd 0x3 0x7d>;
                                linux,phandle = <0x31>;
                                phandle = <0x31>;
                        };

                        uart4-cts {
                                rockchip,pins = <0x5 0xe 0x3 0x7e>;
                        };

                        uart4-rts {
                                rockchip,pins = <0x5 0xf 0x3 0x7d>;
                        };
                };

It seems 'okay', including the PinMux section.
The other serials (0,1,2,3,) are OK, the one at ff1c0000 was not
mapped into iomem....

Well, a new image might help, but there are a lot of them out there...
Do you know a working constellation where all of all UART's are
known to be fine?

Regards,
M5
Reply
#4
(07-15-2017, 10:58 AM)Meres Five Wrote: Hi Myy!

Thank you for the quick response.

I've already de-compiled the rk3288-miniarm.dtb  found in /boot
of the running system.
The resulted device tree is quite long, so I've just  included the relevant sections here:


Code:
/dts-v1/;

/ {
        #address-cells = <0x1>;
        #size-cells = <0x1>;
        compatible = "rockchip,rk3288-miniarm", "rockchip,rk3288";
        interrupt-parent = <0x1>;

        chosen {
        };

        aliases {
                i2c0 = "/i2c@ff650000";
                i2c1 = "/i2c@ff140000";
                i2c2 = "/i2c@ff660000";
                i2c3 = "/i2c@ff150000";
                i2c4 = "/i2c@ff160000";
                i2c5 = "/i2c@ff170000";
                mshc0 = "/dwmmc@ff0f0000";
                mshc1 = "/dwmmc@ff0c0000";
                mshc2 = "/dwmmc@ff0d0000";
                mshc3 = "/dwmmc@ff0e0000";
                serial0 = "/serial@ff180000";
                serial1 = "/serial@ff190000";
                serial2 = "/serial@ff690000";
                serial3 = "/serial@ff1b0000";
                serial4 = "/serial@ff1c0000";
                spi0 = "/spi@ff110000";
                spi1 = "/spi@ff120000";
 . . . . . . . . . .
        serial@ff1b0000 {
                compatible = "rockchip,rk3288-uart", "snps,dw-apb-uart";
                reg = <0xff1b0000 0x100>;
                interrupts = <0x0 0x3a 0x4>;
                reg-shift = <0x2>;
                reg-io-width = <0x4>;
                clocks = <0x7 0x50 0x7 0x158>;
                clock-names = "baudclk", "apb_pclk";
                pinctrl-names = "default";
                pinctrl-0 = <0x30>;
                status = "okay";
        };

        serial@ff1c0000 {
                compatible = "rockchip,rk3288-uart", "snps,dw-apb-uart";
                reg = <0xff1c0000 0x100>;
                interrupts = <0x0 0x3b 0x4>;
                reg-shift = <0x2>;
                reg-io-width = <0x4>;
                clocks = <0x7 0x51 0x7 0x159>;
                clock-names = "baudclk", "apb_pclk";
                pinctrl-names = "default";
                pinctrl-0 = <0x31>;
                status = "okay";
        };
. . . . . . . . . . .
        pinctrl {
                compatible = "rockchip,rk3288-pinctrl";
                rockchip,grf = <0xb>;
                rockchip,pmu = <0x6>;
 . . . . . .

                uart3 {

                        uart3-xfer {
                                rockchip,pins = <0x7 0x7 0x1 0x7e 0x7 0x8 0x1 0x7d>;
                                linux,phandle = <0x30>;
                                phandle = <0x30>;
                        };

                        uart3-cts {
                                rockchip,pins = <0x7 0x9 0x1 0x7e>;
                        };

                        uart3-rts {
                                rockchip,pins = <0x7 0xa 0x1 0x7d>;
                        };
                };

                uart4 {

                        uart4-xfer {
                                rockchip,pins = <0x5 0xc 0x3 0x7e 0x5 0xd 0x3 0x7d>;
                                linux,phandle = <0x31>;
                                phandle = <0x31>;
                        };

                        uart4-cts {
                                rockchip,pins = <0x5 0xe 0x3 0x7e>;
                        };

                        uart4-rts {
                                rockchip,pins = <0x5 0xf 0x3 0x7d>;
                        };
                };

It seems 'okay', including the PinMux section.
The other serials (0,1,2,3,) are OK, the one at ff1c0000 was not
mapped into iomem....

Well, a new image might help, but there are a lot of them out there...
Do you know a working constellation where all of all UART's are
known to be fine?

Regards,
M5

You might want to give ARMbian linux-image-next-rockchip a try. You can also try with the DTB and kernels I provide, though no testers gave me feedback on UART4 availability, on such image.
Note that I provide two DTB files for Tinkerboards. The official one (patched) : rk3288-tinker.dtb ; and the officious one maintained by Tonymac32 : rk3288-miniarm.dtb.
Also note that these images have issues with reboot, so you'll have to unplug / plug the power cable back after rebooting.
Reply
#5
(07-15-2017, 11:36 AM)Myy Wrote: You might want to give ARMbian linux-image-next-rockchip a try. You can also try with the DTB and kernels I provide, though no testers gave me feedback on UART4 availability, on such image.
Note that I provide two DTB files for Tinkerboards. The official one (patched) : rk3288-tinker.dtb ; and the officious one maintained by Tonymac32 : rk3288-miniarm.dtb.
Also note that these images have issues with reboot, so you'll have to unplug / plug the power cable back after rebooting.

I've tried linux-image-next-rockchip.
No result.
But as I see in /boot/config-4.4.71-rockchip


Code:
#
# Serial drivers
#
CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DMA=y
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set

it is high likely that most oft the distros use this setting.
Only four UARTs unleashed. . .

Time to kernel compilation...
Hard luck.

Thank you for your help,
regards
M5
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)