Commit graph

25 commits

Author SHA1 Message Date
Vicente Bergas
e1d9149e83 arm64: dts: rockchip: Fix USB3 Type-C on rk3399-sapphire
Before this patch, the Type-C port on the Sapphire board is dead.
If setting the 'regulator-always-on' property to 'vcc5v0_typec0'
then the port works for about 4 seconds at start-up. This is a
sample trace with a memory stick plugged in:
1.- The memory stick LED lights on and kernel reports:
[    4.782999] scsi 0:0:0:0: Direct-Access USB DISK PMAP PQ: 0 ANSI: 4
[    5.904580] sd 0:0:0:0: [sdb] 3913344 512-byte logical blocks: (2.00 GB/1.87 GiB)
[    5.906860] sd 0:0:0:0: [sdb] Write Protect is off
[    5.908973] sd 0:0:0:0: [sdb] Mode Sense: 23 00 00 00
[    5.909122] sd 0:0:0:0: [sdb] No Caching mode page found
[    5.911214] sd 0:0:0:0: [sdb] Assuming drive cache: write through
[    5.951585]  sdb: sdb1
[    5.954816] sd 0:0:0:0: [sdb] Attached SCSI removable disk
2.- 4 seconds later the memory stick LED lights off and kernel reports:
[    9.082822] phy phy-ff770000.syscon:usb2-phy@e450.2: charger = USB_DCP_CHARGER
3.- After a minute the kernel reports:
[   71.666761] usb 5-1: USB disconnect, device number 2
It has been checked that, although the LED is off, VBUS is present.

If, instead, the dr_mode is changed to host and the phy-supply changed
accordingly, then it works. It has only been tested in host mode.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2019-06-27 16:40:02 +02:00
Heiko Stuebner
d64420e816 arm64: dts: rockchip: bulk convert gpios to their constant counterparts
Rockchip SoCs use 2 different numbering schemes. Where the gpio-
controllers just count 0-31 for their 32 gpios, the underlying
iomux controller splits these into 4 separate entities A-D.

Device-schematics always use these iomux-values to identify pins,
so to make mapping schematics to devicetree easier Andy Yan introduced
named constants for the pins but so far we only used them on new
additions.

Using a sed-script created by Emil Renner Berthing bulk-convert
the remaining raw gpio numbers into their descriptive counterparts
and also gets rid of the unhelpful RK_FUNC_x -> x and RK_GPIOx -> x
mappings:

/r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 /g
s/<\([^ ][^ ]*  *\)28 /<\1RK_PD4 /g
s/<\([^ ][^ ]*  *\)29 /<\1RK_PD5 /g
s/<\([^ ][^ ]*  *\)30 /<\1RK_PD6 /g
s/<\([^ ][^ ]*  *\)31 /<\1RK_PD7 /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)0 /<\1RK_FUNC_GPIO /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)RK_FUNC_\([1-9]\) /<\1\2 /g

Suggested-by: Emil Renner Berthing <esmil@mailme.dk>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Acked-by: Robin Murphy <robin.murphy@arm.com>
2019-04-11 14:38:00 +02:00
Vicente Bergas
5a2a93f1ee arm64: dts: rockchip: move backlight from rk3399 sapphire to excavator
The backlight is for the eDP panel and it has the connector on the excavator baseboard.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-11-05 08:40:51 +01:00
Vicente Bergas
d840db386a arm64: dts: rockchip: add chosen node on rk3399-sapphire
In order to use earlycon, the stdout-path property needs to be set
in the chosen node.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-11-05 08:40:51 +01:00
Vicente Bergas
6d25207830 arm64: dts: rockchip: add fan on rk3399-sapphire board
The Sapphire board has a 12V fan. So, adding it to the DTS.
There is no power supply directly connected, it needs the baseboard to
work.
If the board is used standalone then a hardware modification is needed.
On the Sapphire board there is an unpopulated resistor to connect it to
VBUS_TYPEC, which is usually 5V (too low) and can range up to 20V
(too high).
I tested it for a week connected to VCC_SYS which is 8.4V and proved to
be more than enough for the required cooling needs. This is the
connection described in the comment.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-11-05 08:40:51 +01:00
Vicente Bergas
88a20edf76 arm64: dts: rockchip: Fix microSD in rk3399 sapphire board
The microSD card slot in the Sapphire board is not working because of
several issues:
 1.- The vmmc power supply is missing in the DTS. It is capable of 3.0V
 and has a GPIO-based enable control.
 2.- The vqmmc power supply can provide up to 3.3V, but it is capped in
 the DTS to just 3.0V because of the vmmc capability. This results in a
 conflict from the mmc driver requesting an unsupportable voltage range
 from 3.3V to 3.0V (min > max) as reported in dmesg. So, extend the
 range up to 3.3V. The hw should be able to stand this 0.3V tolerance.
 See mmc_regulator_set_vqmmc in drivers/mmc/core/core.c.
 3.- The card detect signal is non-working. There is a known conflict
 with jtag, but the workaround in drivers/soc/rockchip/grf.c does not
 work. Adding the broken-cd attribute to the DTS fixes the issue.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-09-22 22:49:22 +02:00
Vicente Bergas
78f26da3ff arm64: dts: rockchip: Add type-c port supply on rk3399-sapphire board
Add the gpio-controlled regulator and add the supply to the otg-port of phy0.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-09-10 19:16:26 +02:00
Vicente Bergas
707fa9e37f arm64: dts: rockchip: remove dvs2 pinctrl from pmic on rk3399-sapphire
On the board DVS2 is disabled and not connected, see schematic, page 16.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-09-10 14:05:55 +02:00
Vicente Bergas
bcdb578a5f arm64: dts: rockchip: Fix VCC5V0_HOST_EN on rk3399-sapphire
The pin is GPIO4-D1 not GPIO1-D1, see schematic, page 15 for reference.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-09-10 14:03:52 +02:00
Vicente Bergas
07736689dc arm64: dts: rockchip: re-order vcc_sys on rk3399-sapphire
Fix alphabetical order.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-09-10 14:02:28 +02:00
Heiko Stuebner
4486baca66 arm64: dts: rockchip: generalize rk3399 #sound-dai-cells
The soc spdif and i2s controllers always only have one compontent, so
always require #sound-dai-cells to be 0. Therefore there is no need to
duplicate this property in individual boards.

So move them to rk3399.dtsi.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-06-20 01:15:55 +02:00
Vicente Bergas
ea41d63b54 arm64: dts: rockchip: enable hdmi sound on rk3399-sapphire
Simply enable the hdmi-sound simple-audio-card on the
sapphire board.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-06-20 01:15:55 +02:00
Klaus Goger
4ee99cebd4 arm64: dts: rockchip: use SPDX-License-Identifier
Update all 64bit rockchip devicetree files to use SPDX-License-Identifiers.

All devicetrees claim to be either GPL or X11 while the actual license
text is MIT. Therefore we use MIT for the SPDX tag as X11 is clearly
wrong.

Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Acked-by: Brian Norris <briannorris@chromium.org>
Acked-by: Matthias Brugger <mbrugger@suse.com>
Acked-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-06-17 09:31:57 +02:00
Vicente Bergas
2bbb0c0e6a arm64: dts: rockchip: move rk3399-sapphire PCIe to excavator baseboard
The PCIe signals are routed through the connector to the baseboard.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-04-16 14:13:13 +02:00
Enric Balletbo i Serra
ec9cd35924 arm64: dts: rockchip: enable typec-phy for rk3399-sapphire
Commit c301b327ae ("arm64: dts: rockchip: add usb3-phy otg-port
support for rk3399") caused a regression regarding the USB3 type-A port.
During boot, the following message appears a few times:

  dwc3: failed to initialize core

The driver is deferred waiting for the typec-phy, but this never happens
bceause is disabled. So, enable it.

The offending commit was reverted in 4.16-rc but can be re-applied
after enabling the typec phys.

Reported-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Tested-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-04-16 14:13:13 +02:00
Arnd Bergmann
fd553821a9 The rk3399 gained support its Cadence displayport controller and some
minor additions like pins for 2ch i2s0 and the cif test clocks as well
 as a default rate for ACLK_VIO that should be 400MHz according to the TRM.
 
 The rk3328 got uart dmas fixed - a non-critical fix, as nobody was using
 that so far.
 
 New boards are the rk3328-based roc-rk3328-cc, the rk3368-based Lion-SOM
 + baseborad from Theobroma Systems and a standalone variant of the Sapphire
 board, as a lot of people where using that without the Exkavator baseboard.
 
 Sapphire also saw a lot of small cleanups of things that are not part
 of the actual Sapphire board, but the baseboard instead. The rk3399-puma
 board got i2s and tsadc support and Gru got its DP node enabled.
 -----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCAAuFiEE7v+35S2Q1vLNA3Lx86Z5yZzRHYEFAlqpTQoQHGhlaWtvQHNu
 dGVjaC5kZQAKCRDzpnnJnNEdgZ0uCACl6GsROypjpCGLtCsxlaAXdjk0EuBI3rzy
 wW2AkmeJQHvMPYIAodVUTqEJW7w2M4V0LbF1YOzebSyLMckejKy2jQGNcjQeQ//p
 QAIilflqxqYHTzx9Abv1EpX9uYVsLA46TUnInHAlo+SyDcDAx5/D37oASS+EvlKS
 AHniQE5XfH/zf/0ASRqyzKXI+rxhovinUCeVxsJmWS5+jUchUy/PTgx3OBnTahd+
 JYjEOygTfPJoVXI3LBsQhuZdGZAVoCrDETsur8tMBBHwUHDQxy2rpLwzqv72C+SR
 kdO93Xgjz1+mML3qivJPKYPlc4OabFKgP9BzMnBsALJPXykX7cQw
 =Ay+8
 -----END PGP SIGNATURE-----

Merge tag 'v4.17-rockchip-dts64-1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into next/dt

Pull "Rockchip dts64 changes for 4.17" from Heiko Stübner:

The rk3399 gained support its Cadence displayport controller and some
minor additions like pins for 2ch i2s0 and the cif test clocks as well
as a default rate for ACLK_VIO that should be 400MHz according to the TRM.

The rk3328 got uart dmas fixed - a non-critical fix, as nobody was using
that so far.

New boards are the rk3328-based roc-rk3328-cc, the rk3368-based Lion-SOM
+ baseborad from Theobroma Systems and a standalone variant of the Sapphire
board, as a lot of people where using that without the Exkavator baseboard.

Sapphire also saw a lot of small cleanups of things that are not part
of the actual Sapphire board, but the baseboard instead. The rk3399-puma
board got i2s and tsadc support and Gru got its DP node enabled.

* tag 'v4.17-rockchip-dts64-1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  arm64: dts: rockchip: remove keep-power-in-suspend from sdhci of rk3399-sapphire
  arm64: dts: rockchip: assign clock rate for ACLK_VIO on rk3399
  arm64: dts: rockchip: add a standalone version of the rk3399 sapphire
  arm64: dts: rockchip: move rk3399-sapphire pwr_btn to daughterboard
  arm64: dts: rockchip: move rk3399-sapphire i2s2 to daughterboard
  arm64: dts: rockchip: move rk3399-sapphire sdio to excavator baseboard
  arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou
  arm64: dts: rockchip: move i2s0 node from baseboard to SoM on rk3399-puma
  arm64: dts: rockchip: vdd_log on rk3399-sapphire is not an i2c slave
  arm64: dts: rockchip: add Haikou baseboard with RK3368-uQ7 SoM
  arm64: dts: rockchip: add RK3368-uQ7 (Lion) SoM
  dt-bindings: add RK3368-uQ7 SoM and EVK base board
  arm64: dts: rockchip: Fix RK3328 UART DMAs
  arm64: dts: rockchip: enable DP for rk3399-gru
  arm64: dts: rockchip: add cdn-dp node for rk3399.
  arm64: dts: rockchip: add i2s0-2ch-bus pins on rk3399
  arm64: dts: rockchip: enable tsadc on rk3399-puma
  arm64: dts: rockchip: add roc-rk3328-cc board
  arm64: dts: rockchip: Add cif test clocks for rk3399
2018-03-28 17:17:00 +02:00
Shawn Lin
3783f1eb8a arm64: dts: rockchip: remove keep-power-in-suspend from sdhci of rk3399-sapphire
sdhci for rk3399-sapphire works for eMMC but keep-power-in-suspend
is an optional property for SDIO.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-03-13 13:01:03 +01:00
Vicente Bergas
3811c91524 arm64: dts: rockchip: move rk3399-sapphire pwr_btn to daughterboard
The power button is located on the daughterboard.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-02-20 10:35:31 +01:00
Vicente Bergas
43798872d8 arm64: dts: rockchip: move rk3399-sapphire i2s2 to daughterboard
The i2s2 drives the HDMI audio, which has the connector on the daughterboard.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-02-20 10:34:01 +01:00
Heiko Stuebner
64ca41a8ff arm64: dts: rockchip: move rk3399-sapphire sdio to excavator baseboard
The sdio signals are routed through the connector to the baseboard,
where the wifi module is also located. So move the sdio node to
the excavator as well.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Vicente Bergas <vicencb@gmail.com>
2018-02-20 10:33:55 +01:00
Vicente Bergas
51923db733 arm64: dts: rockchip: vdd_log on rk3399-sapphire is not an i2c slave
The vdd_log power supply is controlled by a PWM pin, not by i2c
register access. There is a boot message that reports an error
about not being able to bring that supply up.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-02-19 06:58:32 +01:00
Shawn Lin
2b7d2ed1af arm64: dts: rockchip: correct ep-gpios for rk3399-sapphire
The endpoint control gpio for rk3399-sapphire boards is gpio2_a4,
so correct it now.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2018-02-12 09:39:01 +01:00
Shawn Lin
b31ce30417 arm64: dts: rockchip: correct vqmmc voltage for rk3399 platforms
The vcc_sd or vcc_sdio used for IO voltage for sdmmc and sdio
interface on rk3399 platform have a limitation that it can't be
larger than 3.0v, otherwise it has a potential risk for the chip.
Correct all of them.

Fixes: 171582e00d ("arm64: dts: rockchip: add support for firefly-rk3399 board")
Fixes: 2c66fc34e9 ("arm64: dts: rockchip: add RK3399-Q7 (Puma) SoM")
Fixes: 8164a84cca ("arm64: dts: rockchip: Add support for rk3399 sapphire SOM")
Cc: stable@vger.kernel.org
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-10-17 20:07:00 +02:00
Heiko Stuebner
ed562b2f39 arm64: dts: rockchip: remove num-slots property from rk3399-sapphire
When adding the rk3399 sapphire som, two more of the recently removed
num-slots properties of dw-mmc nodes slipped in.
Remove them again.

Fixes: 8164a84cca ("arm64: dts: rockchip: Add support for rk3399 sapphire SOM")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-13 13:56:30 +02:00
Jacob Chen
8164a84cca arm64: dts: rockchip: Add support for rk3399 sapphire SOM
Add support for the rk3399 sapphire SOM board.
This board works in a combination with the excavator main board.

You can get more info from below link:
http://opensource.rock-chips.com/wiki_Excavator_sapphire_board

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-08-06 17:35:19 +02:00