From patchwork Wed Apr 20 16:14:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 66224 Delivered-To: patches@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2540690qge; Wed, 20 Apr 2016 09:14:19 -0700 (PDT) X-Received: by 10.194.47.9 with SMTP id z9mr9525643wjm.164.1461168859534; Wed, 20 Apr 2016 09:14:19 -0700 (PDT) Return-Path: Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com. [2a00:1450:400c:c09::22b]) by mx.google.com with ESMTPS id t65si10750062wmd.90.2016.04.20.09.14.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Apr 2016 09:14:19 -0700 (PDT) Received-SPF: pass (google.com: domain of peter.griffin@linaro.org designates 2a00:1450:400c:c09::22b as permitted sender) client-ip=2a00:1450:400c:c09::22b; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of peter.griffin@linaro.org designates 2a00:1450:400c:c09::22b as permitted sender) smtp.mailfrom=peter.griffin@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-wm0-x22b.google.com with SMTP id n3so90309803wmn.0 for ; Wed, 20 Apr 2016 09:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/X+vcEwJcJSwpuhDPuE4o7auq7KDT4/wIdaefASdcAU=; b=cZLKNhWdhBMxr8UGnoXpS3DWgFxqYizrRP1nhCaCDAusKk00uk9Gf+siRRUEI8lxlg IaN0OdKhn5exPNEb7ckbANRHI6BC08Pb/r20tF9yJqvzS+pI5ZYvPMG+QL8BsazdktnJ /k9BMGCFSwFeEpLnd9QW4IjocJ/nrjtuOVkOs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/X+vcEwJcJSwpuhDPuE4o7auq7KDT4/wIdaefASdcAU=; b=lMe+seXVyZP/2mGhINUOOIJOT1arfJ6DS41XYZ9ovKsyfN73wF8lqGnnRwd9IuLa14 QTbjAAuToNPPvE0qnF0F88ks51Y2eRNP8cvdnhJR96JllILed4FP+eRgGbuBus1de86H /1hXpiBhMZtG1ahSbiVjxCfY4nMCOegQNev0AeBi1flutpEGftlpm5Zmohv4v2P2I9RB oKSG3MypeivV5aDyRPIIzsUXUbG2sGeIkYZIQAb5cGH465aB+id3E51e2tnSdV1pndV8 9KwJnkwhkAOn52Fevki2a+yA+sDhtGqShoN38J5j98SP+WYhoOwmHW6arOlwgf2smIn5 hQVg== X-Gm-Message-State: AOPr4FW3ROOJaQwRjmwOQWc+xJJ8wTJKF0Mr0oo+1UmlurdQZ/ty99i8c9cCE/xUsWHZ6KjaYGg= X-Received: by 10.194.3.105 with SMTP id b9mr10186116wjb.140.1461168859276; Wed, 20 Apr 2016 09:14:19 -0700 (PDT) Return-Path: Received: from localhost.localdomain (cpc84787-aztw28-2-0-cust15.18-1.cable.virginm.net. [82.37.140.16]) by smtp.gmail.com with ESMTPSA id da5sm6353845wjb.25.2016.04.20.09.14.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Apr 2016 09:14:18 -0700 (PDT) From: Peter Griffin To: u-boot@lists.denx.de, albert.u.boot@aribaud.net, sjg@chromium.org, agraf@suse.de, trini@konsulko.com, liming.wang@canonical.com Cc: Peter Griffin Subject: [PATCH 6/7] ARM: hisilicon: hikey: Align memory node with upstream kernel Date: Wed, 20 Apr 2016 17:14:02 +0100 Message-Id: <1461168843-15610-7-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461168843-15610-1-git-send-email-peter.griffin@linaro.org> References: <1461168843-15610-1-git-send-email-peter.griffin@linaro.org> The memory node gets automatically generated by U-Boot in arch_fixup_fdt(), before passing control to the kernel using U-Boots representation of the dram banks. However the upstream kernel uses the memory node to carve-out regions of RAM for various purposes. To make this work without changing arch_fixup_fdt() which will effect many platforms we replicate the upstream memory node layout using the dram banks. Signed-off-by: Peter Griffin --- board/hisilicon/hikey/hikey.c | 30 +++++++++++++++++++++++++++++- include/configs/hikey.h | 2 +- 2 files changed, 30 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/board/hisilicon/hikey/hikey.c b/board/hisilicon/hikey/hikey.c index 752ee6f..7abc678 100644 --- a/board/hisilicon/hikey/hikey.c +++ b/board/hisilicon/hikey/hikey.c @@ -410,8 +410,36 @@ int dram_init(void) void dram_init_banksize(void) { + /* + * Reserve regions below from DT memory node (which gets generated + * by U-Boot from the dram banks in arch_fixup_fdt() before booting + * the kernel. This will then match the kernel hikey dts memory node. + * + * 0x05e0,0000 - 0x05ef,ffff: MCU firmware runtime using + * 0x05f0,1000 - 0x05f0,1fff: Reboot reason + * 0x06df,f000 - 0x06df,ffff: Mailbox message data + * 0x0740,f000 - 0x0740,ffff: MCU firmware section + * 0x21f0,0000 - 0x21ff,ffff: pstore/ramoops buffer + * 0x3e00,0000 - 0x3fff,ffff: OP-TEE + */ + gd->bd->bi_dram[0].start = PHYS_SDRAM_1; - gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; + gd->bd->bi_dram[0].size = 0x05e00000; + + gd->bd->bi_dram[1].start = 0x05f00000; + gd->bd->bi_dram[1].size = 0x00001000; + + gd->bd->bi_dram[2].start = 0x05f02000; + gd->bd->bi_dram[2].size = 0x00efd000; + + gd->bd->bi_dram[3].start = 0x06e00000; + gd->bd->bi_dram[3].size = 0x0060f000; + + gd->bd->bi_dram[4].start = 0x07410000; + gd->bd->bi_dram[4].size = 0x1aaf0000; + + gd->bd->bi_dram[5].start = 0x22000000; + gd->bd->bi_dram[5].size = 0x1c000000; } void reset_cpu(ulong addr) diff --git a/include/configs/hikey.h b/include/configs/hikey.h index 0851626..69ea7dc 100644 --- a/include/configs/hikey.h +++ b/include/configs/hikey.h @@ -33,7 +33,7 @@ /* CONFIG_SYS_TEXT_BASE needs to align with where ATF loads bl33.bin */ #define CONFIG_SYS_TEXT_BASE 0x35000000 -#define CONFIG_NR_DRAM_BANKS 1 +#define CONFIG_NR_DRAM_BANKS 6 #define PHYS_SDRAM_1 0x00000000 /* 1008 MB (the last 16Mb are secured for TrustZone by ATF*/