UPSTREAM: rockchip: rk3399-puma: set gpio4cd iodomain to 1.8V

The PCIe reset signal is connected to GPIO4_C6 on the Puma
module. This pin is supplied by 1.8V, but the default iodomain
setting is 3.0V and in this situation the pin is unable to go
high.

Linux assumes that this signal works in early boot
as PCIe is probed before loading the iodomain driver.

Make PCIe work in Linux by setting the gpio4cd iodomain to 1.8V.

Change-Id: I131ca6147b490a89cc913ce398dc163c99efd9f2
Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit aa41220f6f7c79284ce5880e2533f81c125237a4)
This commit is contained in:
Jakob Unterwurzacher 2017-12-15 16:23:14 +01:00 committed by Kever Yang
parent 6a2ff3f44f
commit 83c6e7dea9
1 changed files with 19 additions and 0 deletions

View File

@ -8,13 +8,17 @@
#include <dm.h>
#include <misc.h>
#include <spl.h>
#include <syscon.h>
#include <usb.h>
#include <dm/pinctrl.h>
#include <dm/uclass-internal.h>
#include <asm/io.h>
#include <asm/gpio.h>
#include <asm/setup.h>
#include <asm/arch/clock.h>
#include <asm/arch/cru_rk3399.h>
#include <asm/arch/hardware.h>
#include <asm/arch/grf_rk3399.h>
#include <asm/arch/periph.h>
#include <power/regulator.h>
#include <u-boot/sha256.h>
@ -180,10 +184,25 @@ static void setup_serial(void)
#endif
}
static void setup_iodomain(void)
{
const u32 GRF_IO_VSEL_GPIO4CD_SHIFT = 3;
struct rk3399_grf_regs *grf =
syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
/*
* Set bit 3 in GRF_IO_VSEL so PCIE_RST# works (pin GPIO4_C6).
* Linux assumes that PCIE_RST# works out of the box as it probes
* PCIe before loading the iodomain driver.
*/
rk_setreg(&grf->io_vsel, 1 << GRF_IO_VSEL_GPIO4CD_SHIFT);
}
int misc_init_r(void)
{
setup_serial();
setup_macaddr();
setup_iodomain();
return 0;
}