From patchwork Thu May 8 05:16:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Harvey X-Patchwork-Id: 346887 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 CA2861401B3 for ; Thu, 8 May 2014 15:17:47 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DB1554B639; Thu, 8 May 2014 07:17:38 +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 JLYqGMbyd38K; Thu, 8 May 2014 07:17:38 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 600C74B65F; Thu, 8 May 2014 07:17:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8D7244B632 for ; Thu, 8 May 2014 07:16:55 +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 1wSZ+raByzRA for ; Thu, 8 May 2014 07:16:51 +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-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by theia.denx.de (Postfix) with ESMTPS id 4F0994B600 for ; Thu, 8 May 2014 07:16:41 +0200 (CEST) Received: by mail-pd0-f171.google.com with SMTP id r10so1970693pdi.16 for ; Wed, 07 May 2014 22:16:40 -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=PTfah1XTyHAKBSyUzLpT8YdrS+Om2igDI/6MNwXVMTw=; b=XfbUc1+L3f5kz2I85niIRBpZA6E6OWBhqVAzk9Qikz0iYARoHLmFW/N81goVYQiJww o1L4Kc6ofxX0Wahptt84QKfO7Rs7GWnqY9Pv1Vm+MBJT7madHdbz1SAk4vPetmLBqBsz rSkUK5b3Jaqwdp7xJh0BHcBjAPeVmiEy5Dwb1k+ThmL79wx+yt3tqUlzRSL0ZNiIFWR0 KRgoIyDs/Ru5zMgNIxH2qNMt9RGxC4nysxoQAvSug9b9QEgsCPT0j/J5KhlwU2OaTnRX 9C3lOx6rjFvhkmbSm9EDryIHnCLVOWK8Nx9GVSzpFkUiO0GE8LSzzLTv/hXB/SgFlie8 bmLg== X-Gm-Message-State: ALoCoQlz4JxWek0TGVS/rp+1EhjwdQjHwfPVEpxTqsSLPf2KMQHqf6EmkJVsIn+tZnRhbo1EUGSK X-Received: by 10.67.22.105 with SMTP id hr9mr3159083pad.57.1399526200361; Wed, 07 May 2014 22:16:40 -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 pe3sm6299003pbc.23.2014.05.07.22.16.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 22:16:39 -0700 (PDT) From: Tim Harvey To: Stefano Babic Date: Wed, 7 May 2014 22:16:16 -0700 Message-Id: <1399526182-11966-6-git-send-email-tharvey@gateworks.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1399526182-11966-1-git-send-email-tharvey@gateworks.com> References: <1399526182-11966-1-git-send-email-tharvey@gateworks.com> Cc: Otavio Salvador , u-boot@lists.denx.de, Tom Rini , Stefan Roese Subject: [U-Boot] [PATCH v3 05/11] 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. Signed-off-by: Tim Harvey Acked-by: Stefano Babic Acked-by: Nikita Kiryanov --- v3: - fixed doxygen-style comment block - added Stefano's Ack v2: - new patch in series --- 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..5a09107 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;