rockchip: rk3188: Switch to new i2c IP blocks

A patch from »rockchip: rk3188: fixups and armclk speedup« in state Mainline for u-boot

From: Heiko Stuebner <heiko@...> Date: Mon, 20 Mar 2017 10:16:43 +0100

Commit-Message

The rk3066/rk3188 introduced new i2c IP blocks but kept the old ones around just in case. The default also points to these old controllers. The "new" blocks proved stable and nobody ever used the old ones anywhere, not in the kernel and not in U-Boot, so to be able to reuse the already existing driver make the rk3188 switch to the new ones in U-Boot as well. Signed-off-by: Heiko Stuebner <heiko@...>

Patch-Comment

arch/arm/mach-rockchip/rk3188-board-spl.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)

Statistics

  • 21 lines added
  • 0 lines removed

Changes

------------------ arch/arm/mach-rockchip/rk3188-board-spl.c -------------------
index affd959f86..14847a7b1b 100644
@@ -17,6 +17,7 @@
#include <asm/io.h>
#include <asm/arch/bootrom.h>
#include <asm/arch/clock.h>
+#include <asm/arch/grf_rk3188.h>
#include <asm/arch/hardware.h>
#include <asm/arch/periph.h>
#include <asm/arch/pmu_rk3188.h>
@@ -102,6 +103,7 @@ void board_init_f(ulong dummy)
{
struct udevice *pinctrl, *dev;
struct rk3188_pmu *pmu;
+ struct rk3188_grf *grf;
int ret;
/* Example code showing how to enable the debug UART on RK3188 */
@@ -154,6 +156,25 @@ void board_init_f(ulong dummy)
error("pmu syscon returned %ld\n", PTR_ERR(pmu));
SAVE_SP_ADDR = readl(&pmu->sys_reg[2]);
+ /* init common grf settings */
+ grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
+ if (IS_ERR(grf)) {
+ error("grf syscon returned %ld\n", PTR_ERR(grf));
+ } else {
+ /* make i2c controllers use the new IP */
+ rk_clrsetreg(&grf->soc_con1,
+ RKI2C4_SEL_MASK << RKI2C4_SEL_SHIFT |
+ RKI2C3_SEL_MASK << RKI2C3_SEL_SHIFT |
+ RKI2C2_SEL_MASK << RKI2C2_SEL_SHIFT |
+ RKI2C1_SEL_MASK << RKI2C1_SEL_SHIFT |
+ RKI2C0_SEL_MASK << RKI2C0_SEL_SHIFT,
+ RKI2C4_SEL_MASK << RKI2C4_SEL_SHIFT |
+ RKI2C3_SEL_MASK << RKI2C3_SEL_SHIFT |
+ RKI2C2_SEL_MASK << RKI2C2_SEL_SHIFT |
+ RKI2C1_SEL_MASK << RKI2C1_SEL_SHIFT |
+ RKI2C0_SEL_MASK << RKI2C0_SEL_SHIFT);
+ }
+
ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
if (ret) {
debug("Pinctrl init failed: %d\n", ret);
 
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...