From patchwork Sat Oct 17 17:50:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 531838 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 860F41402B0 for ; Sun, 18 Oct 2015 04:51:10 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=OmrQ6+yL; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D65ED4B6CB; Sat, 17 Oct 2015 19:51:00 +0200 (CEST) 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 z6kDqglbxfFe; Sat, 17 Oct 2015 19:51:00 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 480434B62A; Sat, 17 Oct 2015 19:50:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CE7DC4B622 for ; Sat, 17 Oct 2015 19:50:31 +0200 (CEST) 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 FgTVrSUd_ZjW for ; Sat, 17 Oct 2015 19:50:31 +0200 (CEST) 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-io0-f177.google.com (mail-io0-f177.google.com [209.85.223.177]) by theia.denx.de (Postfix) with ESMTPS id 68D864A039 for ; Sat, 17 Oct 2015 19:50:27 +0200 (CEST) Received: by iow1 with SMTP id 1so154150530iow.1 for ; Sat, 17 Oct 2015 10:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=WGc1GG/m+TsqVRHxC0QIJiWfWxOr1LDRb0wEPlx3j5g=; b=OmrQ6+yLDdK/ei1Tdfdr12Lux6Maqy3xYuJC4T42ICWIpZqkb/UC6m4/qxgRdS/jLO 6sxB0l2l77QGQYd5h0NBFQx66b/uQ8OlJbhD9pNW2ZoT7kJFtYS/0T2QisSBIY0nYTzk HqN9OPDpmL2siyJCmxDcUISpMZxP2r5X51X+wTB2rwFOE6JoGp53mvFhsW8J0AUw0jzT 06TlVXd3c1U1TAoPnIEq/78QHxJw55b2MPwt6kXNd0MDhejvBuj7OWsour5iIejl23hB YwnsoznyGDrauhKg8TcoH15z0NtKxW2r429g5qnEE3oL7fOaFy91I2qm03rcfW1oTxen Y0hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=WGc1GG/m+TsqVRHxC0QIJiWfWxOr1LDRb0wEPlx3j5g=; b=Yxn9sYMNRVAY5k7R+LEHAPIQoTd7SZek6XYySyWY5xogSf8eMD5epWt+oqmYDpqFMK l+LUizuXD1GA0ehNcxyGGzV7OxoWy8UPV31zCWLpINfzGMERduRiX4zfCLpCbr3I5/UK z0SplXoeVISkYFgUiJycGhSJfBB/IOwtDIIDwil/1PC/YZ6lSYDvpqwdrSE0MOt9mqd7 TbOjMNB9nRfBwIcoQjuqyUf/4zJ6XPA0MvlNN14uwWiMu4Jo0zrFskNnOBk96j704zt7 r20wM7FRDXeLC7SgBzNuS6u761buYxnWzVXU8fEAlERnfPasHg1uPXbxDa2r9J1189Ao FG2g== X-Gm-Message-State: ALoCoQnociysfZeKOYemGzQB86S6G5VR6Yj54IN/JjT0yrBg528sBI0/Wl1hOHDi7q8C0JQoWe8r X-Received: by 10.107.163.129 with SMTP id m123mr22752094ioe.166.1445104226539; Sat, 17 Oct 2015 10:50:26 -0700 (PDT) Received: from kaki.bld.corp.google.com ([2620:0:1005:1100:dcfe:355a:a49c:d29c]) by smtp.gmail.com with ESMTPSA id s7sm388402igh.3.2015.10.17.10.50.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Oct 2015 10:50:25 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id C9AE9220B3B; Sat, 17 Oct 2015 11:50:22 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 17 Oct 2015 11:50:00 -0600 Message-Id: <1445104205-4079-4-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1445104205-4079-1-git-send-email-sjg@chromium.org> References: <1445104205-4079-1-git-send-email-sjg@chromium.org> Cc: Tom Rini , Stephen Warren , Tom Warren Subject: [U-Boot] [PATCH 3/8] RFC: dm: pci: Set up the SDRAM mapping correctly 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" SDRAM doesn't always start at 0. Adjust the region mapping so that it works on platforms where SDRAM is somewhere else. This needs testing on other platforms. Signed-off-by: Simon Glass --- drivers/pci/pci-uclass.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index 0756bbe..6dda056 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -674,8 +674,8 @@ static int decode_regions(struct pci_controller *hose, const void *blob, int parent_node, int node) { int pci_addr_cells, addr_cells, size_cells; + phys_addr_t base = 0, addr; int cells_per_record; - phys_addr_t addr; const u32 *prop; int len; int i; @@ -729,8 +729,11 @@ static int decode_regions(struct pci_controller *hose, const void *blob, addr = gd->ram_size; if (gd->pci_ram_top && gd->pci_ram_top < addr) addr = gd->pci_ram_top; - pci_set_region(hose->regions + hose->region_count++, 0, 0, addr, - PCI_REGION_MEM | PCI_REGION_SYS_MEMORY); +#ifdef CONFIG_SYS_SDRAM_BASE + base = CONFIG_SYS_SDRAM_BASE; +#endif + pci_set_region(hose->regions + hose->region_count++, base, base, + addr, PCI_REGION_MEM | PCI_REGION_SYS_MEMORY); return 0; }