mbox series

[RFC,v1,0/2] rk3318 A95X Z2 board

Message ID 20200620134659.4592-1-jbx6244@gmail.com (mailing list archive)
Headers show
Series rk3318 A95X Z2 board | expand

Message

Johan Jonker June 20, 2020, 1:46 p.m. UTC
status: EXPERIMENTAL
Use on your own risk.

What works:
 uart2
 mmc
 emmc
 sd card
 usb2

What doesn't work:
 vop
 hdmi
 ethernet

Not tested:
 adc key
 av
 bt
 ir
 spdif
 wifi

No support in mainline:
 usb3
 front display

Problems:
 U-boot only starts on emmc, then loads kernel from sd card.
 Need pd_ignore_unused and clk_ignore_unused in command line
 to prevent a crash. Missing power domains?
 Hdmi hotplug detects DVI modes, but marks them all BAD.
 A fixed display mode in the command line also gives no penguins
 on the screen.
 Etc.

Johan Jonker (2):
  dt-bindings: arm: rockchip: add A95X Z2 description
  arm64: dts: rockchip: add rk3318 A95X Z2 board

 .../devicetree/bindings/arm/rockchip.yaml          |   5 +
 arch/arm64/boot/dts/rockchip/Makefile              |   1 +
 arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts    | 417 +++++++++++++++++++++
 3 files changed, 423 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts

--
2.11.0

Comments

Johan Jonker June 22, 2020, 8:01 a.m. UTC | #1
Hi,

BUG report 1:
About phy-rockchip-inno-usb2.c and rk3318.

Goal is to use ttyUSB0 as console in combination with agetty as long as
we don't have a working HDMI signal on a DVI monitor.
Boot with rk3318 starts normal on emmc with U-boot OK. It then loads the
kernel
and initrd on SD card. Log view on ttyS2 works.
At the end of the init process extcon0 sends 2 events sortly after each
other.
usb2 crashes if extcon0 event reports 'USB=0' and 'DCP=1'.
It looks like there's no consistant init (delay?) in the driver or hardware.

Boot only possible with busybox + initrd with no scripts that delay
event handling.
(Un)plug events are unrelayable. Getty only becomes active
if usb cable connected direct to the board(without usb hub).
With systemd only a kernel log scroll, but never able to use ttyUSB0 as
login.

mdev.conf line to catch the events:

extcon[0-9]+    root:root 666 */bin/cat /sys/class/extcon/extcon0/state
> /dev/kmsg

In extlinux.conf clk and pm must be ignored in the kernel command line
to prevent a crash.

label kernel
    kernel /Image
    fdt /rk3318-a95x-z2.dtb
    initrd /rootfs.cpio
    append console=ttyUSB0,115200n8
           console=ttyS2,1500000n8
           pd_ignore_unused
           clk_ignore_unused
           initcall_debug=1
           debug
           drm.debug=0xe
           video=HDMI-A-1:1280x720@60
           earlycon=uart8250,mmio32,0xff130000,keep
           swiotlb=1
           kpti=0
           no_console_suspend=1
           consoleblank=0
           rootwait

Question:
Does anyone have a solution for usb2 or
was there previous discussion/info about this?

Why has rk3328.dtsi incomplete (see TRM) power-domains and qos? Does
that work?
Was rk3318 VOP+HDMI, gmac2phy tested in Linux mainline before?

Kind regards,

Johan

Kernel log with usb2 OK:

[    0.959594] Run /init as init process
[    0.959937]   with arguments:
[    0.960210]     /init
[    0.960416]   with environment:
[    0.960703]     HOME=/
[    0.960917]     TERM=linux
[    0.961562] process '/bin/busybox' started with executable stack
[    0.967474] usb 1-1: new full-speed USB device number 2 using dwc2

[..]

[    6.785160] USB=1
[    6.785160] USB-HOST=0
[    6.785160] SDP=1
[    6.785160] CDP=0
[    6.785160] DCP=0
[    6.785160] SLOW-CHARGER=0
[    6.785165] USB=1
[    6.785165] USB-HOST=0
[    6.785165] SDP=1
[    6.785165] CDP=0
[    6.785165] DCP=0
[    6.785165] SLOW-CHARGER=0
[   13.729625] random: crng init done
[   31.715450] vcc_host_vbus: disabling

Kernel log with usb2 crash:

[    0.940666] Run /init as init process
[    0.941005]   with arguments:
[    0.941280]     /init
[    0.941490]   with environment:
[    0.941781]     HOME=/
[    0.941999]     TERM=linux
[    0.942536] process '/bin/busybox' started with executable stack
[    0.967442] usb 1-1: new full-speed USB device number 2 using dwc2

[..]

[    7.300792] USB=0
[    7.300792] USB-HOST=0
[    7.300792] SDP=0
[    7.300792] CDP=0
[    7.300792] DCP=1
[    7.300792] SLOW-CHARGER=0
Johan Jonker June 25, 2020, 8:38 a.m. UTC | #2
Hi,

Status update.

On 6/20/20 3:46 PM, Johan Jonker wrote:
> status: EXPERIMENTAL

> What works:
>  uart2
>  mmc
>  emmc
>  sd card
>  usb2

///////////////////////////

USB2:

The usb2 port only works reliable with:

	dr_mode = "host";

Question for Heiko:
Should we change that in rk3328.dtsi or in rk3318-a95x-z2.dts?

///////////////////////////

USB3:

The usb3 port does work with the drivers phy-rockchip-inno-usb3.c and
dwc3-rockchip-inno.c. This work around however still gives a warning for
storage devices..

Disconnect a ttyUSB device gives this log:

[   25.215260] cp210x 4-1:1.0: cp210x converter detected
[   25.219970] usb 4-1: cp210x converter now attached to ttyUSB1

[..]

[   27.413766] usb 4-1: USB disconnect, device number 2
[   27.415492] cp210x ttyUSB1: cp210x converter now disconnected from
ttyUSB1
[   27.416517] cp210x 4-1:1.0: device disconnected

When we disconnect a USB Mass Storage device it give a warning about the
cable.

[   61.597606] usb 5-1: new SuperSpeed Gen 1 USB device number 2 using
xhci-hcd
[   61.622267] usb-storage 5-1:1.0: USB Mass Storage device detected
[   61.624285] scsi host0: usb-storage 5-1:1.0

[..]

[   81.238511] usb 5-1: USB disconnect, device number 2

[..]

[   83.737413] usb usb5-port1: Cannot enable. Maybe the USB cable is bad?
[   86.370725] usb usb5-port1: attempt power cycle

///////////////////////////

adc-key test OK with:

./evtest

///////////////////////////

ir test OK with:

./insmod  gpio-ir-recv.ko
./ir-keytable -w /usr/etc/rc-keymaps/protocols/a95x_z2.toml
./evtest

The remote control has 2 buttons for KEY_VOLUMEDOWN and KEY_VOLUMEUP.
The linux definitions have only definitions for 1 key set.

Question:

How can I differentiate between them?

a95x_z2.toml:

[[protocols]]
name = "a95_z2"
protocol = "nec"
variant = "nec"
[protocols.scancodes]
0xdf1c = "KEY_POWER"
0xdff1 = "KEY_POWER2"
0xdff2 = "KEY_VIDEO_NEXT"
0xdff3 = "KEY_MUTE"
0xdff4 = "KEY_VOLUMEDOWN"
0xdff5 = "KEY_VOLUMEUP"
0xdf4b = "KEY_PROG1"
0xdf4f = "KEY_PROG2"
0xdf01 = "KEY_PLAY"
0xdf5f = "KEY_HELP"
0xdf5c = "KEY_VOLUMEDOWN"
0xdf5d = "KEY_VOLUMEUP"
0xdf42 = "KEY_HOME"
0xdf0a = "KEY_BACK"
0xdf1a = "KEY_UP"
0xdf47 = "KEY_LEFT"
0xdf07 = "KEY_RIGHT"
0xdf48 = "KEY_DOWN"
0xdf06 = "KEY_OK"
0xdf03 = "KEY_REPLY"
0xdf18 = "KEY_MENU"
0xdf54 = "KEY_1"
0xdf16 = "KEY_2"
0xdf15 = "KEY_3"
0xdf50 = "KEY_4"
0xdf12 = "KEY_5"
0xdf11 = "KEY_6"
0xdf4c = "KEY_7"
0xdf0e = "KEY_8"
0xdf0d = "KEY_9"
0xdf41 = "KEY_FN"
0xdf0c = "KEY_0"
0xdf10 = "KEY_DELETE"

///////////////////////////