From: Jakob Unterwurzacher Date: Fri, 15 Dec 2017 15:23:14 +0000 (+0100) Subject: rockchip: rk3399-puma: set gpio4cd iodomain to 1.8V X-Git-Tag: v2018.01-rc2~2^2~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=aa41220f6f7c79284ce5880e2533f81c125237a4;p=u-boot 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. Signed-off-by: Jakob Unterwurzacher Acked-by: Philipp Tomsich Reviewed-by: Philipp Tomsich --- diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c index 27e3823d52..c6690fa069 100644 --- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c +++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c @@ -8,13 +8,17 @@ #include #include #include +#include #include #include #include +#include #include #include #include #include +#include +#include #include #include #include @@ -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; }