From: Kever Yang <kever.yang@rock-chips.com>
To: u-boot@lists.denx.de
Subject: [PATCH] rockchip: rk3288: Add OF board setup
Date: Wed, 8 Jul 2020 18:04:34 +0800 [thread overview]
Message-ID: <d4688094-22bd-eae9-e121-4d8d63397e78@rock-chips.com> (raw)
In-Reply-To: <20200702084820.35942-1-jagan@amarulasolutions.com>
On 2020/7/2 ??4:48, Jagan Teki wrote:
> The new rk3288 revision rk3288w has some changes with respect
> to legacy rk3288 like hclk_vio and usb host0 ohci.
>
> In order to work these on the same in Linux kernel update the
> compatible the root compatible with rockchip,rk3288w before
> booting.
>
> So, this support during of board setup code of rk3288.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang<kever.yang@rock-chips.com>
Thanks,
- Kever
> ---
> arch/arm/mach-rockchip/Kconfig | 1 +
> arch/arm/mach-rockchip/rk3288/rk3288.c | 26 ++++++++++++++++++++++++++
> 2 files changed, 27 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..8a682675e6 100644
> --- a/arch/arm/mach-rockchip/rk3288/rk3288.c
> +++ b/arch/arm/mach-rockchip/rk3288/rk3288.c
> @@ -115,6 +115,32 @@ int rk_board_late_init(void)
> return rk3288_board_late_init();
> }
>
> +#ifdef CONFIG_OF_BOARD_SETUP
> +
> +#define RK3288_HDMI_PHYS 0xff980000
> +#define RK3288W_HDMI_REV 0x1A
> +#define HDMI_CONFIG0_ID 0x04
> +
> +int ft_board_setup(void *blob, bd_t *bd)
> +{
> + u8 config0;
> + int ret;
> +
> + config0 = readb(RK3288_HDMI_PHYS + HDMI_CONFIG0_ID);
> + if (config0 == RK3288W_HDMI_REV) {
> + ret = fdt_setprop_string(blob, 0,
> + "compatible", "rockchip,rk3288w");
> + if (ret < 0) {
> + printf("failed to set rk3288w compatible (ret=%d)\n",
> + ret);
> + return ret;
> + }
> + }
> +
> + return 0;
> +}
> +#endif
> +
> static int do_clock(struct cmd_tbl *cmdtp, int flag, int argc,
> char *const argv[])
> {
next prev parent reply other threads:[~2020-07-08 10:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 8:48 [PATCH] rockchip: rk3288: Add OF board setup Jagan Teki
2020-07-02 13:56 ` Robin Murphy
2020-07-03 10:10 ` Jagan Teki
2020-07-03 12:39 ` Robin Murphy
2020-07-03 14:04 ` Jagan Teki
2020-07-04 8:55 ` Jagan Teki
2020-07-08 10:04 ` Kever Yang [this message]
2020-07-08 10:10 ` Jagan Teki
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=d4688094-22bd-eae9-e121-4d8d63397e78@rock-chips.com \
--to=kever.yang@rock-chips.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