Skip to contentSkip to conversation

rk3318 A95X Z2 board

RFC PATCH Superseded Johan Jonker 3 participants 10 messages Jun 20, 2020 – Jul 16, 2020

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover rk3318 A95X Z2 board

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

#1 lore raw

RFC PATCH 1/2 dt-bindings: arm: rockchip: add A95X Z2 description

Add A95X Z2 description for a board with rk3318 processor.

---
 Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +5 -0
index d4a404509..3d44b3cf0 100644
@@ -25,6 +25,11 @@ properties:
           - const: vamrs,rock960
           - const: rockchip,rk3399
 
+      - description: A95X Z2
+        items:
+          - const: a95x,z2
+          - const: rockchip,rk3318
+
       - description: Amarula Vyasa RK3288
         items:
           - const: amarula,vyasa-rk3288
Signature · 1 line
2.11.0
maintainer
#2 lore raw

Re: [RFC PATCH v1 1/2] dt-bindings: arm: rockchip: add A95X Z2 description

Quoted 12 lines · Johan Jonker

Add A95X Z2 description for a board with rk3318 processor.

---
 Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +0 -0
index d4a404509..3d44b3cf0 100644

Documentation/devicetree/bindings/arm/rockchip.yaml properties: · line 30

Quoted 6 lines
Documentation/devicetree/bindings/arm/rockchip.yaml +3 -0
@@ -25,6 +25,11 @@ properties:
           - const: vamrs,rock960
           - const: rockchip,rk3399
 
+      - description: A95X Z2
+        items:
+          - const: a95x,z2

Need to document vendor prefix.

Quoted 8 lines
Documentation/devicetree/bindings/arm/rockchip.yaml +2 -0
+          - const: rockchip,rk3318
+
       - description: Amarula Vyasa RK3288
         items:
           - const: amarula,vyasa-rk3288
Signature · 1 line
2.11.0
#3 lore raw

Re: [RFC PATCH v1 1/2] dt-bindings: arm: rockchip: add A95X Z2 description

Hi Rob,

The A95X Z2 boxes are sold by various vendors/manufacturers/web shops. The box it self only shows a label with a model name. Determining the true vendor is a kind of tricky for a outsider of the business.
Could you advise what would be a save choice to the rather rigid vendor requirements.
Is for example this a option:

"^a95x,.*":
description: A95X

Is there someone who can give more info on this subject?

Kind regards,

Johan Jonker

Quoted 30 lines · Rob Herring
Quoted 12 lines · Johan Jonker

Add A95X Z2 description for a board with rk3318 processor.

---
 Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +0 -0
index d4a404509..3d44b3cf0 100644

Documentation/devicetree/bindings/arm/rockchip.yaml properties: · line 30

Quoted 6 lines
Documentation/devicetree/bindings/arm/rockchip.yaml +3 -0
@@ -25,6 +25,11 @@ properties:
           - const: vamrs,rock960
           - const: rockchip,rk3399
 
+      - description: A95X Z2
+        items:
+          - const: a95x,z2

Need to document vendor prefix.

Quoted 8 lines
Documentation/devicetree/bindings/arm/rockchip.yaml +2 -0
+          - const: rockchip,rk3318
+
       - description: Amarula Vyasa RK3288
         items:
           - const: amarula,vyasa-rk3288
Signature · 1 line
2.11.0
#4 lore raw

Re: [RFC PATCH v1 1/2] dt-bindings: arm: rockchip: add A95X Z2 description

Quoted 10 lines · Johan Jonker

Hi Rob,

The A95X Z2 boxes are sold by various vendors/manufacturers/web shops. The box it self only shows a label with a model name. Determining the true vendor is a kind of tricky for a outsider of the business.
Could you advise what would be a save choice to the rather rigid vendor requirements.
Is for example this a option:

Quoted 4 lines
   "^a95x,.*":
     description: A95X

Is there someone who can give more info on this subject?

FWIW we already have some "A95X" branded things attributed to Nexbox in upstream DTs, however, the evidence from scraping around the internet suggests that the closest thing to an original vendor for the "A95X Z2" model is probably these folks:

https://zkmagic.en.alibaba.com/

Robin.

Quoted 43 lines

Kind regards,

Johan Jonker

Quoted 16 lines · Rob Herring
Quoted 15 lines · Johan Jonker

Add A95X Z2 description for a board with rk3318 processor.

---
  Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
  1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +0 -0
index d4a404509..3d44b3cf0 100644
@@ -25,6 +25,11 @@ properties:
            - const: vamrs,rock960
            - const: rockchip,rk3399
 
Quoted 14 lines

Documentation/devicetree/bindings/arm/rockchip.yaml properties: · line 30

Quoted 3 lines
Documentation/devicetree/bindings/arm/rockchip.yaml +3 -0
+      - description: A95X Z2
+        items:
+          - const: a95x,z2

Need to document vendor prefix.

Quoted 8 lines
Documentation/devicetree/bindings/arm/rockchip.yaml +2 -0
+          - const: rockchip,rk3318
+
        - description: Amarula Vyasa RK3288
          items:
            - const: amarula,vyasa-rk3288
Signature · 1 line
2.11.0

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

#5 lore raw

Re: [RFC PATCH v1 1/2] dt-bindings: arm: rockchip: add A95X Z2 description

Quoted 14 lines · Robin Murphy
Quoted 13 lines · Johan Jonker

Hi Rob,

The A95X Z2 boxes are sold by various vendors/manufacturers/web shops. The box it self only shows a label with a model name. Determining the true vendor is a kind of tricky for a outsider of the business.
Could you advise what would be a save choice to the rather rigid vendor requirements.
Is for example this a option:

   "^a95x,.*":
     description: A95X

Quoted 8 lines
Quoted 1 line

Is there someone who can give more info on this subject?

FWIW we already have some "A95X" branded things attributed to Nexbox in upstream DTs, however, the evidence from scraping around the internet suggests that the closest thing to an original vendor for the "A95X Z2" model is probably these folks:

https://zkmagic.en.alibaba.com/

That's where I got my update/backup img from.
A mail was sent, but what if they all claim to be a 'official' or 'direct' store?

option 1:

- description: A95X Z2
items:
- const: a95x,z2

"^a95x,.*":
description: A95X

or option 2:

- description: Zkmagic A95X Z2
items:
- const: zkmagic,a95x-z2

"^zkmagic,.*":
description: Shenzhen Zkmagic Technology Co., Ltd.

I'ld rather prefer a short neutral name like option 1 just to be save. ;) For the completeness there seems to be:
a95x a2
a95x a3
a95x f1
a95x f2
a95x f3
a95x max
a95x max plus
a95x r1
a95x r2
a95x r3
a95x r5
a95x z2
a95x z2 +

Any advice welcome..

Johan

Quoted 46 lines

Robin.

Quoted 43 lines

Kind regards,

Johan Jonker

Quoted 8 lines · Rob Herring
Quoted 7 lines · Johan Jonker

Add A95X Z2 description for a board with rk3318 processor.

---
  Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++

  1 file changed, 5 insertions(+)
Quoted 22 lines
Quoted 11 lines
Documentation/devicetree/bindings/arm/rockchip.yaml +0 -0
index d4a404509..3d44b3cf0 100644
@@ -25,6 +25,11 @@ properties:

            - const: vamrs,rock960
            - const: rockchip,rk3399
  +      - description: A95X Z2
+        items:
+          - const: a95x,z2

Need to document vendor prefix.

Quoted 8 lines

+          - const: rockchip,rk3318
+
        - description: Amarula Vyasa RK3288
          items:
            - const: amarula,vyasa-rk3288
--
2.11.0

_______________________________________________
Linux-rockchip mailing list [email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

#6 lore raw

Re: [RFC PATCH v1 1/2] dt-bindings: arm: rockchip: add A95X Z2 description

Quoted 22 lines · Johan Jonker
Quoted 21 lines · Robin Murphy
Quoted 10 lines · Johan Jonker

Hi Rob,

The A95X Z2 boxes are sold by various vendors/manufacturers/web shops. The box it self only shows a label with a model name. Determining the true vendor is a kind of tricky for a outsider of the business.
Could you advise what would be a save choice to the rather rigid vendor requirements.
Is for example this a option:

Quoted 4 lines

   "^a95x,.*":
     description: A95X

Is there someone who can give more info on this subject?

FWIW we already have some "A95X" branded things attributed to Nexbox in upstream DTs, however, the evidence from scraping around the internet suggests that the closest thing to an original vendor for the "A95X Z2" model is probably these folks:

Quoted 5 lines
Quoted 1 line

https://zkmagic.en.alibaba.com/

That's where I got my update/backup img from.
A mail was sent, but what if they all claim to be a 'official' or 'direct' store?

Well, at some point we have to make a judgement call if the facts aren't easy to come by, but it's already clear that "A95X" is not a vendor but some kind of generic model name apparently used by multiple vendors. We already have "nexbox,a95x" as a binding for another model, and a plausible idea of who's responsible for this one, so I think "zkmagic,a95x-z2" would be the appropriate binding here. It's hardly the end of the world if it's not 100% accurate, but that's no excuse not to at least try.

Robin.

Quoted 86 lines

option 1:

- description: A95X Z2
items:
- const: a95x,z2

   "^a95x,.*":
     description: A95X

or option 2:

- description: Zkmagic A95X Z2
items:
- const: zkmagic,a95x-z2

"^zkmagic,.*":
description: Shenzhen Zkmagic Technology Co., Ltd.

I'ld rather prefer a short neutral name like option 1 just to be save. ;) For the completeness there seems to be:
a95x a2
a95x a3
a95x f1
a95x f2
a95x f3
a95x max
a95x max plus
a95x r1
a95x r2
a95x r3
a95x r5
a95x z2
a95x z2 +

Any advice welcome..

Johan

Quoted 46 lines

Robin.

Quoted 43 lines

Kind regards,

Johan Jonker

Quoted 8 lines · Rob Herring
Quoted 7 lines · Johan Jonker

Add A95X Z2 description for a board with rk3318 processor.

---
   Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
   1 file changed, 5 insertions(+)
Quoted 22 lines

Documentation/devicetree/bindings/arm/rockchip.yaml properties: · line 29

Quoted 11 lines
Documentation/devicetree/bindings/arm/rockchip.yaml +2 -0
index d4a404509..3d44b3cf0 100644
@@ -25,6 +25,11 @@ properties:
             - const: vamrs,rock960
             - const: rockchip,rk3399
   +      - description: A95X Z2
+        items:
+          - const: a95x,z2

Need to document vendor prefix.

Quoted 8 lines
Documentation/devicetree/bindings/arm/rockchip.yaml +2 -0
+          - const: rockchip,rk3318
+
         - description: Amarula Vyasa RK3288
           items:
             - const: amarula,vyasa-rk3288
Signature · 1 line
2.11.0

_______________________________________________
Linux-rockchip mailing list [email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

#7 lore raw

RFC PATCH 2/2 arm64: dts: rockchip: add rk3318 A95X Z2 board

In reply to Johan Jonker

The rk3318 A95X Z2 boards are sold as TV box.
No further documentation is given, but from the dts files extracted it seems that the rk3318 processor is simulair to the rk3328. This dts file contains only the basic nodes that have support in the mainline kernel.

Features:

CPU: RK3318 Quad-Core Cortex-A53
GPU: Mali-450
RAM: 2/4GB DDR3
ROM: EMMC 16/32/64GB
HDMI: HDMI 2.0a for 4k@60Hz
Ethernet: 10/100M standard RJ-45
WiFi: 2.4G+5G WIFI, 802.11 b/g/n
Bluetooth: 4.0
1 x USB 3.0
1 x USB 2.0
1 x Micro SD card slot
1 x SPDIF
1 x AV
1 x DC IN

---
 arch/arm64/boot/dts/rockchip/Makefile           |   1 +
 arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts | 417 ++++++++++++++++++++++++
 2 files changed, 418 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts
arch/arm64/boot/dts/rockchip/Makefile +1 -0
index b87b1f773..aa508bc4a 100644
@@ -2,6 +2,7 @@
 dtb-$(CONFIG_ARCH_ROCKCHIP) += px30-evb.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-evb.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-roc-cc.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3318-a95x-z2.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-odroid-go2.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-a1.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-evb.dtb
arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts new file +417 -0

417 lines not on this page · raw message

Signature · 1 line
2.11.0
#8 lore raw
In reply to Johan Jonker

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

Quoted 1 line

/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
#9 lore raw
In reply to Johan Jonker

Hi,

Status update.

Quoted 8 lines · Johan Jonker

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"

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