From patchwork Tue Mar 21 23:30:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 741782 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3vnpwb23Dhz9s7b for ; Wed, 22 Mar 2017 10:31:11 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id D9C72C21CCE; Tue, 21 Mar 2017 23:31:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 240B0C21C56; Tue, 21 Mar 2017 23:31:05 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1A11DC21C56; Tue, 21 Mar 2017 23:31:02 +0000 (UTC) Received: from gloria.sntech.de (gloria.sntech.de [95.129.55.99]) by lists.denx.de (Postfix) with ESMTPS id 936E0C21C3B for ; Tue, 21 Mar 2017 23:31:02 +0000 (UTC) Received: from ip9234b685.dynamic.kabel-deutschland.de ([146.52.182.133] helo=phil.fritz.box) by gloria.sntech.de with esmtpsa (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1cqTEv-0005Ho-3W; Wed, 22 Mar 2017 00:30:57 +0100 From: Heiko Stuebner To: sjg@chromium.org Date: Wed, 22 Mar 2017 00:30:46 +0100 Message-Id: <20170321233046.24478-1-heiko@sntech.de> X-Mailer: git-send-email 2.11.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] rockchip: rk3188: enable remap function X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- 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 #include #include +#include #include #include #include @@ -19,6 +20,28 @@ DECLARE_GLOBAL_DATA_PTR; +__weak int rk_board_late_init(void) +{ + 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