From patchwork Mon Apr 28 20:17:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Harvey X-Patchwork-Id: 343574 X-Patchwork-Delegate: sbabic@denx.de 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 3224D14009A for ; Tue, 29 Apr 2014 06:19:21 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2008E4BAC2; Mon, 28 Apr 2014 22:19:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 1rLZAMh9mjB6; Mon, 28 Apr 2014 22:19:12 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AB0D84BA5C; Mon, 28 Apr 2014 22:18:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5765C4B830 for ; Mon, 28 Apr 2014 22:18:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 Qarwo8MOgnmq for ; Mon, 28 Apr 2014 22:18:12 +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-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by theia.denx.de (Postfix) with ESMTPS id 3C9964B826 for ; Mon, 28 Apr 2014 22:17:59 +0200 (CEST) Received: by mail-pa0-f52.google.com with SMTP id kx10so6253743pab.11 for ; Mon, 28 Apr 2014 13:17:57 -0700 (PDT) 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=k4S+zd/ZmNajBxsDcLSPP//pwANVYntFLqDBS+UW/lo=; b=h5+XkOjOvsDm//yR1hEgQzPIAoq8njX0LSSgQg8dDz3NlMJWpm4pZ//YO//qCdqUue jdlpUrx1OiluCqykYIb7KL5M+ZiOXYNnHGQjfKgeawV0ag/7VYOL4mS+D9HVJPcTKF96 d7ywD10OLKSMy07vXqBVpfCcn1JJc3zXuh4uGn+yIbWnk4m4MD8oSddnH9qLGuUJrJgU kmBzxdxxaXo0UvnFRdVo462QJTWyL7Rg18FVMGhOTHwcF95cr5phgrycCFyUw/HJQ+kg /PxzQB6dfL8rvjnGc8UvPKrc9zULcgVj/RsdrtDjK9v5/BMnE6Lvr5QxGtu5vqcKkykZ 83iQ== X-Gm-Message-State: ALoCoQnuxWndSRxqkznEH/BnIaBfo/TjwyJFbF5tk9IgZWFDGr1vBQnK/DOFcJxe/BFf78Mwdb74 X-Received: by 10.66.158.132 with SMTP id wu4mr27799356pab.66.1398716277718; Mon, 28 Apr 2014 13:17:57 -0700 (PDT) Received: from tharvey-gw.gw (68-189-91-139.static.snlo.ca.charter.com. [68.189.91.139]) by mx.google.com with ESMTPSA id zv3sm96756925pab.20.2014.04.28.13.17.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 13:17:56 -0700 (PDT) From: Tim Harvey To: Stefano Babic Date: Mon, 28 Apr 2014 13:17:32 -0700 Message-Id: <1398716258-8420-7-git-send-email-tharvey@gateworks.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1398716258-8420-1-git-send-email-tharvey@gateworks.com> References: <1398716258-8420-1-git-send-email-tharvey@gateworks.com> Cc: Otavio Salvador , u-boot@lists.denx.de, Tom Rini , Stefan Roese Subject: [U-Boot] [PATCH 06/12] IMX: add comments and remove unused struct fields X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Add comment block for the imx_ddr_size function and remove the extra unused fields from struct esd_mmdc_regs which are also not common between IMX53 and IMX6. There are no functional changes here. Signed-off-by: Tim Harvey Acked-by: Stefano Babic --- arch/arm/imx-common/cpu.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c index a77c4de..392b8d4 100644 --- a/arch/arm/imx-common/cpu.c +++ b/arch/arm/imx-common/cpu.c @@ -58,6 +58,7 @@ char *get_reset_cause(void) static const unsigned char col_lookup[] = {9, 10, 11, 8, 12, 9, 9, 9}; static const unsigned char bank_lookup[] = {3, 2}; +/* these MMDC registers are common to the IMX53 and IMX6 */ struct esd_mmdc_regs { uint32_t ctl; uint32_t pdc; @@ -66,15 +67,6 @@ struct esd_mmdc_regs { uint32_t cfg1; uint32_t cfg2; uint32_t misc; - uint32_t scr; - uint32_t ref; - uint32_t rsvd1; - uint32_t rsvd2; - uint32_t rwd; - uint32_t or; - uint32_t mrr; - uint32_t cfg3lp; - uint32_t mr4; }; #define ESD_MMDC_CTL_GET_ROW(mdctl) ((ctl >> 24) & 7) @@ -83,6 +75,12 @@ struct esd_mmdc_regs { #define ESD_MMDC_CTL_GET_CS1(mdctl) ((ctl >> 30) & 1) #define ESD_MMDC_MISC_GET_BANK(mdmisc) ((misc >> 5) & 1) +/** + * imx_ddr_size - return size in bytes of DRAM according MMDC config + * The MMDC MDCTL register holds the number of bits for row, col, and data + * width and the MMDC MDMISC register holds the number of banks. Combine + * all these bits to determine the meme size the MMDC has been configured for + */ unsigned imx_ddr_size(void) { struct esd_mmdc_regs *mem = (struct esd_mmdc_regs *)MEMCTL_BASE;