From: Frank Wunderlich <linux@fw-web.de>
To: barebox@lists.infradead.org
Cc: Frank Wunderlich <frank-w@public-files.de>
Subject: [urgent] ARM: rockchip: fix iodomain for r2pro V1.0
Date: Sat, 14 May 2022 17:56:09 +0200 [thread overview]
Message-ID: <20220514155609.8306-1-linux@fw-web.de> (raw)
From: Frank Wunderlich <frank-w@public-files.de>
Current code sets vccio4 and vccio6 both to 1v8. R2Pro v1.0 needs 3v3
setting on vccio4, else gmac0 (switch for lan-ports) will be damaged.
IO-domain is per default 3v3 so only vccio6 needs to be set to 1v8 and
clear this bit in the 3v3 register.
Fixes: 8ba96c5942d6 ("ARM: rockchip: add BPI-R2-Pro V00 board")
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
arch/arm/boards/rockchip-rk3568-bpi-r2pro/lowlevel.c | 9 ++++++---
arch/arm/mach-rockchip/include/mach/rockchip.h | 3 +++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boards/rockchip-rk3568-bpi-r2pro/lowlevel.c b/arch/arm/boards/rockchip-rk3568-bpi-r2pro/lowlevel.c
index 4c5b4751b3fb..2a6e0700233a 100644
--- a/arch/arm/boards/rockchip-rk3568-bpi-r2pro/lowlevel.c
+++ b/arch/arm/boards/rockchip-rk3568-bpi-r2pro/lowlevel.c
@@ -17,10 +17,13 @@ static noinline void rk3568_start(void *fdt_blob_fixed_offset)
void *fdt;
/*
- * Enable vccio4 1.8V and vccio6 1.8V
- * Needed for GMAC to work.
+ * set iodomain vccio6 to 1.8V needed for GMAC1 to work.
+ * vccio4 (gmac0/switch) needs to stay at 3v3 (default)
*/
- writel(RK_SETBITS(0x50), 0xfdc20140);
+ //set bit 6 in PMU_GRF_IO_VSEL0 for vccio6 1v8
+ writel(RK_SETBITS(BIT(6)), PMU_GRF_IO_VSEL0);
+ //clear bit 6 for 3v3 as it was set to 1v8
+ writel(RK_CLRBITS(BIT(6)), PMU_GRF_IO_VSEL1);
fdt = fdt_blob_fixed_offset;
diff --git a/arch/arm/mach-rockchip/include/mach/rockchip.h b/arch/arm/mach-rockchip/include/mach/rockchip.h
index f24db36f0161..ff8b1109f858 100644
--- a/arch/arm/mach-rockchip/include/mach/rockchip.h
+++ b/arch/arm/mach-rockchip/include/mach/rockchip.h
@@ -23,6 +23,9 @@ static inline int rk3288_init(void)
#ifdef CONFIG_ARCH_RK3568
int rk3568_init(void);
+#define PMU_GRF 0xfdc20000
+#define PMU_GRF_IO_VSEL0 (PMU_GRF + 0x140)
+#define PMU_GRF_IO_VSEL1 (PMU_GRF + 0x144)
#else
static inline int rk3568_init(void)
{
--
2.25.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2022-05-14 15:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-14 15:56 Frank Wunderlich [this message]
2022-05-16 8:37 ` Sascha Hauer
2022-05-16 8:41 ` Sascha Hauer
2022-05-16 9:11 ` Frank Wunderlich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220514155609.8306-1-linux@fw-web.de \
--to=linux@fw-web.de \
--cc=barebox@lists.infradead.org \
--cc=frank-w@public-files.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox