From patchwork Wed Feb 13 14:44:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 220153 X-Patchwork-Delegate: trini@ti.com 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 595072C0292 for ; Thu, 14 Feb 2013 01:49:32 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DEB354A198; Wed, 13 Feb 2013 15:49:30 +0100 (CET) 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 3Gy+GiRV-r2W; Wed, 13 Feb 2013 15:49:30 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5EB284A1AE; Wed, 13 Feb 2013 15:49:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C91BF4A16F for ; Wed, 13 Feb 2013 15:49:26 +0100 (CET) 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 QEw-pg6h3r6h for ; Wed, 13 Feb 2013 15:49:26 +0100 (CET) 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-ia0-f171.google.com (mail-ia0-f171.google.com [209.85.210.171]) by theia.denx.de (Postfix) with ESMTPS id 6F8B54A1B9 for ; Wed, 13 Feb 2013 15:49:22 +0100 (CET) Received: by mail-ia0-f171.google.com with SMTP id z13so1267895iaz.16 for ; Wed, 13 Feb 2013 06:49:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=oeaKPmNhtuIX0vsQpRavq7i+zPWF8ZGee5Xkl/mFG5g=; b=aIOwEpjtAQnHvbjM79K/W0T3zvZPf1Swh3+imHch+DbwE+ZaQO92ZK2mg4EDPWD7aA IjD2e7YmDKI8v5cr1yroI5jNQnmMol7y2ve4wWTLDgwRrrDplzgkuwruJdAlG9/DUFVo EkjnvvVTvP8CMwzWUeA0vm481P4hG7oLiFlBODMldfvG9Zyc/9D8vL1byFJ/G5BIjMtv SpsorGYIOVSBGNJr3/SFPbqPXRuDafBRYBdHijRZj4yhhxRVeCC07V6+sNKWMuBVJ+1K FzxEu2lYDIVgC/StRLgVS8SOTzXbyaDBLLUG8IrBRm4ntZbPq+f3XUij5xGnPWfznLvF HB4g== X-Received: by 10.50.140.34 with SMTP id rd2mr11247698igb.93.1360766577991; Wed, 13 Feb 2013 06:42:57 -0800 (PST) Received: from beef.ohporter.com (cpe-24-166-64-7.neo.res.rr.com. [24.166.64.7]) by mx.google.com with ESMTPS id j11sm40254965igc.5.2013.02.13.06.42.57 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Feb 2013 06:42:57 -0800 (PST) From: Matt Porter To: U-Boot Mailing List Date: Wed, 13 Feb 2013 09:44:00 -0500 Message-Id: <1360766644-9901-7-git-send-email-mporter@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360766644-9901-1-git-send-email-mporter@ti.com> References: <1360766644-9901-1-git-send-email-mporter@ti.com> Cc: Tom Rini Subject: [U-Boot] [PATCH 06/10] am33xx: add dmm support to emif4 library 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 Adds a config_dmm() routine to support TI814X DMM configuration. Signed-off-by: Matt Porter Reviewed-by: Tom Rini --- arch/arm/cpu/armv7/am33xx/emif4.c | 17 +++++++++++++++++ arch/arm/include/asm/arch-am33xx/ddr_defs.h | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/arch/arm/cpu/armv7/am33xx/emif4.c b/arch/arm/cpu/armv7/am33xx/emif4.c index 0c617fa..27547be 100644 --- a/arch/arm/cpu/armv7/am33xx/emif4.c +++ b/arch/arm/cpu/armv7/am33xx/emif4.c @@ -44,11 +44,28 @@ void dram_init_banksize(void) #ifdef CONFIG_SPL_BUILD +static struct dmm_lisa_map_regs *hw_lisa_map_regs = + (struct dmm_lisa_map_regs *)DMM_BASE; static struct vtp_reg *vtpreg[2] = { (struct vtp_reg *)VTP0_CTRL_ADDR, (struct vtp_reg *)VTP1_CTRL_ADDR}; static struct ddr_ctrl *ddrctrl = (struct ddr_ctrl *)DDR_CTRL_ADDR; +void config_dmm(const struct dmm_lisa_map_regs *regs) +{ + enable_dmm_clocks(); + + writel(0, &hw_lisa_map_regs->dmm_lisa_map_3); + writel(0, &hw_lisa_map_regs->dmm_lisa_map_2); + writel(0, &hw_lisa_map_regs->dmm_lisa_map_1); + writel(0, &hw_lisa_map_regs->dmm_lisa_map_0); + + writel(regs->dmm_lisa_map_3, &hw_lisa_map_regs->dmm_lisa_map_3); + writel(regs->dmm_lisa_map_2, &hw_lisa_map_regs->dmm_lisa_map_2); + writel(regs->dmm_lisa_map_1, &hw_lisa_map_regs->dmm_lisa_map_1); + writel(regs->dmm_lisa_map_0, &hw_lisa_map_regs->dmm_lisa_map_0); +} + static void config_vtp(int nr) { writel(readl(&vtpreg[nr]->vtp0ctrlreg) | VTP_CTRL_ENABLE, diff --git a/arch/arm/include/asm/arch-am33xx/ddr_defs.h b/arch/arm/include/asm/arch-am33xx/ddr_defs.h index 8bf25a0..943b4ce 100644 --- a/arch/arm/include/asm/arch-am33xx/ddr_defs.h +++ b/arch/arm/include/asm/arch-am33xx/ddr_defs.h @@ -66,6 +66,11 @@ #define MT41J128MJT125_IOCTRL_VALUE 0x18B /** + * Configure DMM + */ +void config_dmm(const struct dmm_lisa_map_regs *regs); + +/** * Configure SDRAM */ void config_sdram(const struct emif_regs *regs, int nr);