All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] rockchip: rk3188: enable remap function
Date: Fri, 31 Mar 2017 22:20:54 -0600	[thread overview]
Message-ID: <CAPnjgZ1m-LS1zWVs=qOZRYZ44aFBeD8dqwey_vdebL-x8Srw2Q@mail.gmail.com> (raw)
In-Reply-To: <20170321233046.24478-1-heiko@sntech.de>

Hi Heiko,

On 21 March 2017 at 17:30, Heiko Stuebner <heiko@sntech.de> wrote:
> Most Rockchip socs have the ability to either map the bootrom or a sram
> area to the starting address of the cpu by flipping a bit in the GRF.
>
> Newer socs leave this untouched and mapped to the bootrom but the legacy
> loaders on rk3188 and before enabled the remap functionality and the
> current smp implementation in the Linux kernel also requires it to be
> enabled, to bring up secondary cpus.
>
> So to keep smp working in the kernel, mimic the behaviour of the legacy
> bootloaders and enable the remap functionality.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>  arch/arm/mach-rockchip/rk3188-board.c | 23 +++++++++++++++++++++++
>  arch/arm/mach-rockchip/rk3188/Kconfig |  1 +
>  2 files changed, 24 insertions(+)
>
> diff --git a/arch/arm/mach-rockchip/rk3188-board.c b/arch/arm/mach-rockchip/rk3188-board.c
> index c370156e4c..0c0be443cb 100644
> --- a/arch/arm/mach-rockchip/rk3188-board.c
> +++ b/arch/arm/mach-rockchip/rk3188-board.c
> @@ -11,6 +11,7 @@
>  #include <syscon.h>
>  #include <asm/io.h>
>  #include <asm/arch/clock.h>
> +#include <asm/arch/grf_rk3188.h>
>  #include <asm/arch/periph.h>
>  #include <asm/arch/pmu_rk3288.h>
>  #include <asm/arch/boot_mode.h>
> @@ -19,6 +20,28 @@
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> +__weak int rk_board_late_init(void)

Can you instead enable the option just for rk3188 and avoid the weak
function? We already have rk_board_late_init()


> +{
> +       return 0;
> +}
> +
> +int board_late_init(void)
> +{
> +       struct rk3188_grf *grf;
> +
> +       grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
> +       if (IS_ERR(grf)) {
> +               error("grf syscon returned %ld\n", PTR_ERR(grf));
> +       } else {
> +               /* enable noc remap to mimic legacy loaders */
> +               rk_clrsetreg(&grf->soc_con0,
> +                       NOC_REMAP_MASK << NOC_REMAP_SHIFT,
> +                       NOC_REMAP_MASK << NOC_REMAP_SHIFT);
> +       }
> +
> +       return rk_board_late_init();
> +}
> +
>  int board_init(void)
>  {
>  #if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM)
> diff --git a/arch/arm/mach-rockchip/rk3188/Kconfig b/arch/arm/mach-rockchip/rk3188/Kconfig
> index d129fcda99..8ea4725f6c 100644
> --- a/arch/arm/mach-rockchip/rk3188/Kconfig
> +++ b/arch/arm/mach-rockchip/rk3188/Kconfig
> @@ -2,6 +2,7 @@ if ROCKCHIP_RK3188
>
>  config TARGET_ROCK
>         bool "Radxa Rock"
> +       select BOARD_LATE_INIT
>         help
>           Rock is a RK3188-based development board with 2 USB and 1 otg
>           ports, HDMI, TV-out, micro-SD card, audio, WiFi  and 100MBit
> --
> 2.11.0
>

Regards,
Simon

      reply	other threads:[~2017-04-01  4:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 23:30 [U-Boot] [PATCH] rockchip: rk3188: enable remap function Heiko Stuebner
2017-04-01  4:20 ` Simon Glass [this message]

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='CAPnjgZ1m-LS1zWVs=qOZRYZ44aFBeD8dqwey_vdebL-x8Srw2Q@mail.gmail.com' \
    --to=sjg@chromium.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.