From patchwork Tue Feb 21 08:15:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eddie Cai X-Patchwork-Id: 730362 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3vSCz96XWkz9s06 for ; Tue, 21 Feb 2017 19:17:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="a2cUy3bG"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DFCDB4B5B9; Tue, 21 Feb 2017 09:17:19 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vQVs7UzV8ISu; Tue, 21 Feb 2017 09:17:19 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8B71D4B55F; Tue, 21 Feb 2017 09:17:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 48B794B55F for ; Tue, 21 Feb 2017 09:15:30 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MPPbvAhIJJNZ for ; Tue, 21 Feb 2017 09:15:27 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by theia.denx.de (Postfix) with ESMTPS id C9F864B4E9 for ; Tue, 21 Feb 2017 09:15:20 +0100 (CET) Received: by mail-pg0-f65.google.com with SMTP id s67so6519862pgb.1 for ; Tue, 21 Feb 2017 00:15:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=7bUbIm1HotJ47hWX0vfsrqoy7Oou9fzBbvuhf3uR86s=; b=a2cUy3bGQy7j680adsaMet6pU1Lz9zQnnf7Jdl/OwmGllrj1AC08u/OlNWsn83CAq4 chdPnqX+l/3QcRHgZF6UCfL0THoueZm6QyOb77Np8txA4VVC84Dv+uHxUOct8h/8nep6 4nvE5DInGUVAVD5PgQWrLErJxE22KgazQ16uzEBEPv5OeD72QWPTZ4ei/dJ4nYm/Ksum MXhHZ9vjsFVPxCx91EvB0KYpAkx9xjQCa+sCacd+21CQjwjEG7QMTtFy1+++FuVaxNal zRR0K/kFgwUNRux9d4e/Gvqa9MH7r8nu5kZ9CDuBJOd0aGnA2/iEmDXJYGLRBdFLoa/n p/nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7bUbIm1HotJ47hWX0vfsrqoy7Oou9fzBbvuhf3uR86s=; b=U93Fgpw3WTKc4N0n6xd9EyDQiXrYsguMNLOxi5sBKDoIQ3kAM0ydboT0V0pHMMCX7H naQQ8w0lhhsLYIKxDa28UQz63DgoOfznXyhyzdnDh4Pjl+hvnzJa/vbxhGzlGpnW089Q JATqqoSYPM53QW1JcDXkgGjTgjSA9psq6fEBA2xRpRAMziUwSZOgG1tkjUf0LJyQKuVa ShD49sZCwO5Jr0cdnTHo2j41JGACBHMI7AJZrblO1Igq2708S+3h60QqNeVloRIlvKVd DJSza0t3ellufnf2HMcNIgT8VwGImxRxV3+aSDoIX9K4N3IQ9ba7ybQHdLqXUDGWzwCh BDsw== X-Gm-Message-State: AMke39kHTSLP2iOBaP/ZQLQPnNRsObzLZseG5Fq4is35fUGS1RPogannX6FvhfMNREZ7ow== X-Received: by 10.98.65.148 with SMTP id g20mr31914284pfd.44.1487664918890; Tue, 21 Feb 2017 00:15:18 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id 17sm18875885pfi.40.2017.02.21.00.15.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Feb 2017 00:15:18 -0800 (PST) From: Eddie Cai To: sjg@chromium.org Date: Tue, 21 Feb 2017 16:15:03 +0800 Message-Id: <1487664903-14905-1-git-send-email-eddie.cai.linux@gmail.com> X-Mailer: git-send-email 2.7.4 Cc: u-boot@lists.denx.de Subject: [U-Boot] rockchip: rk3288: init malloc_base, limit, ptr before spl_init X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Andrew F. Davis's below patch broke rk3288 based board. that is because we call spl_init in board_init_f which is at very early stage. What Andrew want to fix is calling spl_init very late. That patch will make malloc_base, limit, ptr not initualized in spl_init when we call spl_init in board_init_f. It seems impossible to meet two requirement in spl_init. So i simply init malloc_base, limit, ptr before spl_init. commit b3d2861eb20a795b99292b823c923935df26dfc6 Author: Andrew F. Davis Date: Fri Jan 27 10:39:19 2017 -0600 spl: Remove overwrite of relocated malloc limit Signed-off-by: Eddie Cai --- arch/arm/mach-rockchip/rk3288-board-spl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c index 930939a..1f3170d 100644 --- a/arch/arm/mach-rockchip/rk3288-board-spl.c +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c @@ -184,6 +184,16 @@ void board_init_f(ulong dummy) debug_uart_init(); #endif +#if defined(CONFIG_SYS_MALLOC_F_LEN) +#ifdef CONFIG_MALLOC_F_ADDR + gd->malloc_base = CONFIG_MALLOC_F_ADDR; +#endif +#ifdef CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN + gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN; +#endif + gd->malloc_ptr = 0; +#endif + ret = spl_init(); if (ret) { debug("spl_init() failed: %d\n", ret);