From: Jagan Teki <jagan@amarulasolutions.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 2/2] rockchip: rk3288: Add OF board setup
Date: Sat, 4 Jul 2020 14:45:03 +0530 [thread overview]
Message-ID: <20200704091503.71121-2-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20200704091503.71121-1-jagan@amarulasolutions.com>
The new rk3288 revision rk3288w has some changes with respect
to legacy rk3288 like hclk_vio in cru and usb host0 ohci.
Linux clock driver already handle this via rockchip,rk3288w-cru
compatible.
USB ohci host can enable via dts for rk3288w based boards.
So, add fdt board setup code to update cru compatible with
rk3288w-cru compatible if the SOC revision is RK3288W.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v2:
- use soc detection helper
- add cru compatible change for rk3288w
arch/arm/mach-rockchip/Kconfig | 1 +
arch/arm/mach-rockchip/rk3288/rk3288.c | 33 ++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index b1008a5058..822d8d4e9c 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -98,6 +98,7 @@ config ROCKCHIP_RK322X
config ROCKCHIP_RK3288
bool "Support Rockchip RK3288"
select CPU_V7A
+ select OF_BOARD_SETUP
select SUPPORT_SPL
select SPL
select SUPPORT_TPL
diff --git a/arch/arm/mach-rockchip/rk3288/rk3288.c b/arch/arm/mach-rockchip/rk3288/rk3288.c
index 804abe8a1b..9c873d2b6a 100644
--- a/arch/arm/mach-rockchip/rk3288/rk3288.c
+++ b/arch/arm/mach-rockchip/rk3288/rk3288.c
@@ -13,6 +13,7 @@
#include <asm/io.h>
#include <asm/arch-rockchip/bootrom.h>
#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cpu.h>
#include <asm/arch-rockchip/cru.h>
#include <asm/arch-rockchip/hardware.h>
#include <asm/arch-rockchip/grf_rk3288.h>
@@ -115,6 +116,38 @@ int rk_board_late_init(void)
return rk3288_board_late_init();
}
+#if defined(CONFIG_OF_BOARD_SETUP)
+
+static int ft_rk3288w_setup(void *blob)
+{
+ const char *path;
+ int offs, ret;
+
+ path = "/clock-controller at ff760000";
+ offs = fdt_path_offset(blob, path);
+ if (offs < 0) {
+ debug("failed to found fdt path %s\n", path);
+ return offs;
+ }
+
+ ret = fdt_setprop_string(blob, offs, "compatible", "rockchip,rk3288w-cru");
+ if (ret) {
+ printf("failed to set rk3288w-cru compatible (ret=%d)\n", ret);
+ return ret;
+ }
+
+ return ret;
+}
+
+int ft_board_setup(void *blob, bd_t *bd)
+{
+ if (soc_is_rk3288w())
+ return ft_rk3288w_setup(blob);
+
+ return 0;
+}
+#endif
+
static int do_clock(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
--
2.25.1
next prev parent reply other threads:[~2020-07-04 9:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-04 9:15 [PATCH v2 1/2] rockchip: Add SoC detection helper Jagan Teki
2020-07-04 9:15 ` Jagan Teki [this message]
2020-07-08 10:13 ` Kever Yang
2020-07-08 10:29 ` Jagan Teki
2020-07-18 3:18 ` Kever Yang
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=20200704091503.71121-2-jagan@amarulasolutions.com \
--to=jagan@amarulasolutions.com \
--cc=u-boot@lists.denx.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