From patchwork Thu Apr 20 09:03:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 752725 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 3w7tGG6Drtz9s4s for ; Thu, 20 Apr 2017 19:04:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="vKdAlL4Q"; dkim-atps=neutral Received: by lists.denx.de (Postfix, from userid 105) id 88BDAC21DEA; Thu, 20 Apr 2017 09:03:58 +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=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID 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 5FF6AC21D1A; Thu, 20 Apr 2017 09:03:56 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A21FAC21D1A; Thu, 20 Apr 2017 09:03:55 +0000 (UTC) Received: from mail-oi0-f65.google.com (mail-oi0-f65.google.com [209.85.218.65]) by lists.denx.de (Postfix) with ESMTPS id D8B42C21CA2 for ; Thu, 20 Apr 2017 09:03:54 +0000 (UTC) Received: by mail-oi0-f65.google.com with SMTP id y11so5058253oie.1 for ; Thu, 20 Apr 2017 02:03:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=CngdIRkLmXI5XTXcb82FGPJuoOKmb+CWcNZZQdJ7Wwg=; b=vKdAlL4QT9/iRzJ0QjlbqOt4+cw3pGfh5/pyHiCKESPqbvvcUfcjcq3hK4DJJSr8F9 YhQosvsU6xri4Xhd7JNzzcUVW6hbGhd+C3V3yhBM3l60yPJ2djbriY/2WQpqmRkj0qTH irJSmlwtmUoDvJD0X4xu5VSTCxT34OjMPGjeLDKfmHONr/3Iuo1rMUlyOUK4MEj3XJl3 sj8KcDAAR9j9Cy/+GOjlFdWse/VrgJltBRbXiT1M2lvvUvxPTEsWTWSaVxtOZgeCw4bE tkg/hKRQoWCx1UpET1zioNyMivCYPJncv8iZlMIhUx+2Ptq8PaOBjfoboFwFyBjnDeVU IosQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=CngdIRkLmXI5XTXcb82FGPJuoOKmb+CWcNZZQdJ7Wwg=; b=DmoSgIXwjgQypFkZlgj6kMDwxTN//3q933wKRRrCr7Nwen1oLxV816pTuzAPC11Lmb 4guCCK7VYf1zdQtxvwZEc4UkfGRI0gXILFJfWdsffG2/16B2/AyowCTzqKey5AA1idKs YWDhoyDnNOhei+VutRRYPmuYbZHzOwWCKNOGoNxr/gnPMj6yUgWueh3EuwoE1LbPZ/Bj NYDIBHyPEyddbN9f+PPGekAxMb5nrhmZi7vkXsTxE82l5WSVCkQQyIhYCmsppNdRlsIn ukQYhGZAsj0SkdAc46Iu+z40kkChOY5XN+qvNOnnRJdjoDN/FkVFtPaumnW5rUyc1rFX i1OA== X-Gm-Message-State: AN3rC/7OfOJcBy0/2cCmFpQbAJlNzE+1igP+qS09+1Ek4V1lk52o69Gw gRavqFPyA76w0n6l X-Received: by 10.84.225.18 with SMTP id t18mr8996748plj.118.1492679033499; Thu, 20 Apr 2017 02:03:53 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id v86sm9072783pfa.86.2017.04.20.02.03.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Apr 2017 02:03:52 -0700 (PDT) From: Kever Yang To: sjg@chromium.org Date: Thu, 20 Apr 2017 17:03:46 +0800 Message-Id: <1492679026-22480-1-git-send-email-kever.yang@rock-chips.com> X-Mailer: git-send-email 1.9.1 Cc: Lin huang , u-boot@lists.denx.de, Philipp Tomsich , afaerber@suse.de Subject: [U-Boot] [PATCH v3] rockchip: reserve memory for rk3399 ATF data 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" There are 3 regions used by rk3399 ATF: - bl31 code, located at 0x10000; - cortex-m0 code and data, located at 0xff8c0000; - bl31 data, located at 0xff8c1000 ~ 0xff8c4000; SPL_TEXT_BASE starts from 0xff8c2000, we need to reserve memory for ATF data, or else there will be memory corrupt after SPL loads the ATF image. More detail about cortex-M0 code in ATF: https://github.com/ARM-software/arm-trusted-firmware/commit/ 8382e17c4c6bffd15119dfce1ee4372e3c1a7890 Signed-off-by: Kever Yang Acked-by: Simon Glass Acked-by: Simon Glass --- Changes in v3: - grammar fix by Andreas's comment Changes in v2: - use Kconfig for the reserved memory size arch/arm/include/asm/arch-rockchip/boot0.h | 4 ++++ arch/arm/mach-rockchip/Kconfig | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/arch/arm/include/asm/arch-rockchip/boot0.h b/arch/arm/include/asm/arch-rockchip/boot0.h index 8d7bc9a..7346876 100644 --- a/arch/arm/include/asm/arch-rockchip/boot0.h +++ b/arch/arm/include/asm/arch-rockchip/boot0.h @@ -16,3 +16,7 @@ .space 0x4 /* space for the 'RK33' */ #endif b reset + +#if defined(CONFIG_ROCKCHIP_RK3399) && defined(CONFIG_SPL_BUILD) + .space CONFIG_ROCKCHIP_SPL_RESERVE_IRAM /* space for the ATF data */ +#endif diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index af0796d..da280f6 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -72,6 +72,14 @@ config ROCKCHIP_SPL_BACK_TO_BROM SPL will return to the boot rom, which will then load the U-Boot binary to keep going on. +config ROCKCHIP_SPL_RESERVE_IRAM + hex "Size of IRAM reserved in SPL" + default 0x4000 + help + SPL may need reserve memory for firmware loaded by SPL, whose load + address is in IRAM and may overlay with SPL text area if not + reserved. + config ROCKCHIP_BROM_HELPER bool