X-Git-Url: https://git.archive.openwrt.org/?p=openwrt.git;a=blobdiff_plain;f=package%2Fboot%2Fuboot-sunxi%2Fpatches%2F012-sun6i-fix-clock_twi_onoff.patch;fp=package%2Fboot%2Fuboot-sunxi%2Fpatches%2F012-sun6i-fix-clock_twi_onoff.patch;h=9471b39b3b31f75f3cd2a2321b511b03809589ee;hp=0000000000000000000000000000000000000000;hb=3b54f5cb9c4a5789f0eec4a3e0d1ac05236cd092;hpb=d18f9d5f17e190cfbb836a4acff2d96c0d466a2c diff --git a/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch b/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch new file mode 100644 index 0000000000..9471b39b3b --- /dev/null +++ b/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch @@ -0,0 +1,40 @@ +From 730d2f3a41c5ccae71b5008fffdf697d143be68c Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 16 Mar 2016 20:44:51 +0100 +Subject: [PATCH] sunxi: Fix clock_twi_onoff for sun6i + +The clock_sun6i.c implementation was not deasserting the reset for +the regular i2c controllers, this commit fixes this. + +Signed-off-by: Hans de Goede +Acked-by: Ian Campbell +--- + arch/arm/cpu/armv7/sunxi/clock_sun6i.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c +index 700b605..4e1e1a4 100644 +--- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c ++++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c +@@ -100,13 +100,18 @@ int clock_twi_onoff(int port, int state) + return 0; + } + +- /* set the apb clock gate for twi */ +- if (state) ++ /* set the apb clock gate and reset for twi */ ++ if (state) { + setbits_le32(&ccm->apb2_gate, + CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port)); +- else ++ setbits_le32(&ccm->apb2_reset_cfg, ++ 1 << (APB2_RESET_TWI_SHIFT + port)); ++ } else { ++ clrbits_le32(&ccm->apb2_reset_cfg, ++ 1 << (APB2_RESET_TWI_SHIFT + port)); + clrbits_le32(&ccm->apb2_gate, + CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port)); ++ } + + return 0; + }