From patchwork Fri Mar 15 20:07:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 228164 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 E45272C00AA for ; Sat, 16 Mar 2013 07:07:41 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5B95D4A154; Fri, 15 Mar 2013 21:07:31 +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 wBgltTVwA+1J; Fri, 15 Mar 2013 21:07:31 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D622A4A147; Fri, 15 Mar 2013 21:07:00 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0F0CB4A149 for ; Fri, 15 Mar 2013 21:06:57 +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 TEkXlw9oZ2Rb for ; Fri, 15 Mar 2013 21:06:56 +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-f175.google.com (mail-ia0-f175.google.com [209.85.210.175]) by theia.denx.de (Postfix) with ESMTPS id 192A74A157 for ; Fri, 15 Mar 2013 21:06:28 +0100 (CET) Received: by mail-ia0-f175.google.com with SMTP id y26so1278540iab.6 for ; Fri, 15 Mar 2013 13:06:27 -0700 (PDT) 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=lIA7zgOCYBhVqmn/vzRjaQUy1JH3N4ZMfVNL0Q1nZEw=; b=H+slrc9GgQ5Dy/0GP6pEV4LuRmcRj6zOFhrYk9vbnH6ePRoEXX57N2eb+HnSza3lET IckjGIpPBlQYOPnuoeNIUqGWisOnCdCMuPVEdCHhVDoY0UlAnUs1tpJH8jSKE04FGMOu PZ0pVqRAuDqkl6L++9iPEghIiBju4jxGyipeAkcUKReQj7FzHjNqyECcSl/vYWg4TfLy MPRg1qPJm3aG+FrpsOzXNw8DDTlXXW4ZO1LAPZ+4hGb0YzahrYb9pzCv1WKSwmGBr26h ygGaNkc04eo+okL4WqXh1cPrKQR03XhkwgtsYlE2C8xFg91khkZwLl7oTy+qL6F4/Myu KFrA== X-Received: by 10.50.195.134 with SMTP id ie6mr2170563igc.6.1363377987259; Fri, 15 Mar 2013 13:06:27 -0700 (PDT) Received: from beef.ohporter.com (cpe-98-27-254-98.neo.res.rr.com. [98.27.254.98]) by mx.google.com with ESMTPS id ew5sm3148751igc.2.2013.03.15.13.06.26 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Mar 2013 13:06:26 -0700 (PDT) From: Matt Porter To: U-Boot Mailing List Date: Fri, 15 Mar 2013 16:07:07 -0400 Message-Id: <1363378030-2054-7-git-send-email-mporter@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363378030-2054-1-git-send-email-mporter@ti.com> References: <1363378030-2054-1-git-send-email-mporter@ti.com> Cc: Tom Rini Subject: [U-Boot] [PATCH v4 6/9] 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 --- v4: no changes v3: no changes v2: no changes --- 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 76459d8..aa84e96 100644 --- a/arch/arm/cpu/armv7/am33xx/emif4.c +++ b/arch/arm/cpu/armv7/am33xx/emif4.c @@ -44,6 +44,8 @@ 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}; @@ -51,6 +53,21 @@ static struct vtp_reg *vtpreg[2] = { static struct ddr_ctrl *ddrctrl = (struct ddr_ctrl *)DDR_CTRL_ADDR; #endif +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 1cbadff..15ca4c1 100644 --- a/arch/arm/include/asm/arch-am33xx/ddr_defs.h +++ b/arch/arm/include/asm/arch-am33xx/ddr_defs.h @@ -100,6 +100,11 @@ #define MT41J512M8RH125_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);