From patchwork Wed Jul 24 14:39:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Gherzan X-Patchwork-Id: 1136369 X-Patchwork-Delegate: matthias.bgg@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=balena.io Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45tyk04V3zz9s3l for ; Thu, 25 Jul 2019 00:42:32 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 47E81C21DD3; Wed, 24 Jul 2019 14:41:08 +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_H2 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 A7B62C21C93; Wed, 24 Jul 2019 14:40:30 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 05EE7C21D65; Wed, 24 Jul 2019 14:39:43 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by lists.denx.de (Postfix) with ESMTPS id A0C53C21CB1 for ; Wed, 24 Jul 2019 14:39:40 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id p17so47250123wrf.11 for ; Wed, 24 Jul 2019 07:39:40 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=vke+aeJLlm+hH0ZbApV2tQXwcQSNthXhQrHw3uTUjCY=; b=fXeMysXcz5ZFzv+beEbqCcjHVfBZuIIVE7p40QdU2ckI7M3z1jdwMCXENGpwnVdMks H+k4EDysfUSZmD9YGLyX+rFUMPgHEZm7DcxpQGDoT28zXRKo1I/5BQhEm5VHZYudmzLM A9Juze34OYZ+qop/80ZSAARNy/grkz+9EL0hz+/cGoKbQM2vnYeK9IhqY1MT+Jnjaqeo Avmh6DcXZN5MtJOGGt7TsXETUzeCZViAJDpgT+lIy8aFAABW4ZHBF6eZtgzd/aNn0dk7 RJHyQlXxpKIeZGVzZz6kO+VFwHV++awYsZK1wzhqNDvAA0kGbkvgIWc1qOii+4j351tr FmfA== X-Gm-Message-State: APjAAAUddD7/P+xcAGZeEeanF39Kb1CjavSwOjql/I604nDwgzGThPdu QltkJmJtpo31uSwBMKkalJwi1Xg3 X-Google-Smtp-Source: APXvYqydROkNjRTwQxNzaMfPcjFShYCgunskcjaWkRPeJsf9HRFmaH/uThvtF9xRw5cFaHtr2ixI2w== X-Received: by 2002:a5d:668e:: with SMTP id l14mr31747640wru.156.1563979179920; Wed, 24 Jul 2019 07:39:39 -0700 (PDT) Received: from localhost.localdomain ([212.36.34.46]) by smtp.gmail.com with ESMTPSA id n14sm84860651wra.75.2019.07.24.07.39.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 07:39:39 -0700 (PDT) From: Andrei Gherzan To: u-boot@lists.denx.de Date: Wed, 24 Jul 2019 15:39:10 +0100 Message-Id: <20190724143911.29770-8-andrei@balena.io> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724143911.29770-1-andrei@balena.io> References: <20190716133803.1174-1-andrei@gherzan.ro> <20190724143911.29770-1-andrei@balena.io> MIME-Version: 1.0 Cc: mbrugger@suse.com, Andrei Gherzan Subject: [U-Boot] [PATCH v2 7/8] RPI: Add memory map for bcm2838 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Define the memory map for the BCM2838 based on the dt configuration available in the Raspberry Pi kernel fork. Signed-off-by: Andrei Gherzan --- board/raspberrypi/rpi/rpi.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 6d6f1ef39a..1c4fae9166 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -249,7 +249,8 @@ static uint32_t rev_type; static const struct rpi_model *model; #ifdef CONFIG_ARM64 -static struct mm_region bcm2837_mem_map[] = { +#ifndef CONFIG_BCM2838 +static struct mm_region bcm283x_mem_map[] = { { .virt = 0x00000000UL, .phys = 0x00000000UL, @@ -268,8 +269,28 @@ static struct mm_region bcm2837_mem_map[] = { 0, } }; - -struct mm_region *mem_map = bcm2837_mem_map; +#else +static struct mm_region bcm283x_mem_map[] = { + { + .virt = 0x00000000UL, + .phys = 0x00000000UL, + .size = 0xfe000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | + PTE_BLOCK_INNER_SHARE + }, { + .virt = 0xfe000000UL, + .phys = 0xfe000000UL, + .size = 0x01800000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | + PTE_BLOCK_NON_SHARE | + PTE_BLOCK_PXN | PTE_BLOCK_UXN + }, { + /* List terminator */ + 0, + } +}; +#endif +struct mm_region *mem_map = bcm283x_mem_map; #endif int dram_init(void)