From patchwork Tue Jun 10 18:44:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 31696 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E103A20675 for ; Tue, 10 Jun 2014 18:45:34 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id rd18sf3105360iec.10 for ; Tue, 10 Jun 2014 11:45:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=C9MLODOXybb3Mnlnh2xgfc3istE6seRBFPdX9qnMHW8=; b=cIBXCuZPTcJRW83mNIe6GdEjp7q8PrtHS+KpfcJt96p6uskpCLx72PYks2yYi3CV8z uKLUp5L2Agq81+Wb9crPbodacD7rp8AeAosnUKFnD4OBU8BrvUnvX1/dgm1MONo6lcjI QfLtUc4Nlez9gtc4IQ377OtQ/oX8Fufc8N7WQttiEHAkX4y5qJoek9t17Ik6RmaeEHh6 TJ/a/RcH0whxDF4TOhO8RuCb+TFG+EwD7VbHnPxfvBVIpDuFFFoto5E1NKQDLh7xnSVv 3k/tlNFE/uRytkv6x3VF6Nt0Rf7I5qI8OT77j8DK7jGelC2dHqMLYSZy9rwbW+pMhGBT YyNQ== X-Gm-Message-State: ALoCoQmtO2HLTV/U/NbK7DeZ/TogJ65o+nD+jVgmbfIZ2Lvfh1sokpnS6VYfAkXb2s2ZSoRLmO6v X-Received: by 10.42.164.70 with SMTP id f6mr5274135icy.4.1402425934423; Tue, 10 Jun 2014 11:45:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.105.54 with SMTP id b51ls2262955qgf.48.gmail; Tue, 10 Jun 2014 11:45:34 -0700 (PDT) X-Received: by 10.58.132.70 with SMTP id os6mr5683891veb.36.1402425934273; Tue, 10 Jun 2014 11:45:34 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id ds9si13381235vec.93.2014.06.10.11.45.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 11:45:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hy10so2900112vcb.3 for ; Tue, 10 Jun 2014 11:45:34 -0700 (PDT) X-Received: by 10.220.159.4 with SMTP id h4mr33847992vcx.1.1402425934183; Tue, 10 Jun 2014 11:45:34 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp247062vcb; Tue, 10 Jun 2014 11:45:33 -0700 (PDT) X-Received: by 10.194.11.74 with SMTP id o10mr17203205wjb.82.1402425933108; Tue, 10 Jun 2014 11:45:33 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id fl5si18182896wib.71.2014.06.10.11.45.32 for ; Tue, 10 Jun 2014 11:45:33 -0700 (PDT) Received-SPF: none (google.com: u-boot-bounces@lists.denx.de does not designate permitted sender hosts) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1BCE44A057; Tue, 10 Jun 2014 20:45:20 +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 gurSAkVYnu8I; Tue, 10 Jun 2014 20:45:19 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1EF434A058; Tue, 10 Jun 2014 20:44:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5C1424A040 for ; Tue, 10 Jun 2014 20:44:48 +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 NvXvzVQ7FRmf for ; Tue, 10 Jun 2014 20:44:45 +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 devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by theia.denx.de (Postfix) with ESMTPS id 500214A036 for ; Tue, 10 Jun 2014 20:44:39 +0200 (CEST) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s5AIibAW007098 for ; Tue, 10 Jun 2014 13:44:38 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5AIib68009454 for ; Tue, 10 Jun 2014 13:44:37 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Tue, 10 Jun 2014 13:44:37 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5AIia35009608; Tue, 10 Jun 2014 13:44:37 -0500 From: Felipe Balbi To: Tom Rini Date: Tue, 10 Jun 2014 13:44:15 -0500 Message-ID: <1402425857-11891-4-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.0.0.rc1 In-Reply-To: <1402425857-11891-1-git-send-email-balbi@ti.com> References: <1402425857-11891-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Cc: Schuyler Patton , Felipe@theia.denx.de, u-boot@lists.denx.de, Steven Kipisz , "\\\"Franklin Cooper Jr.\\\"" Subject: [U-Boot] [PATCH 3/5] board: ti: am43xx: add support for AM43xx Starter Kit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 AM43xx Starter Kit is a new board based on AM437x line of SoCs. Being a low-cost EVM and small size EVM are intended to provide an entry level development platform on a full fledged Hardware System. Signed-off-by: Felipe Balbi --- board/ti/am43xx/board.c | 72 +++++++++++++++++++++++++++++++++++++++++++- board/ti/am43xx/board.h | 5 +++ include/configs/am43xx_evm.h | 2 ++ 3 files changed, 78 insertions(+), 1 deletion(-) diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index 6197076..b184c20 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -217,6 +217,28 @@ const struct emif_regs ddr3_emif_regs_400Mhz = { .emif_rd_wr_exec_thresh = 0x00000405 }; +static const struct emif_regs ddr3_sk_emif_regs_400Mhz = { + .sdram_config = 0x638413b2, + .sdram_config2 = 0x00000000, + .ref_ctrl = 0x00000c30, + .sdram_tim1 = 0xeaaad4db, + .sdram_tim2 = 0x266b7fda, + .sdram_tim3 = 0x107f8678, + .read_idle_ctrl = 0x00050000, + .zq_config = 0x50074be4, + .temp_alert_config = 0x0, + .emif_ddr_phy_ctlr_1 = 0x0e084007, + .emif_ddr_ext_phy_ctrl_1 = 0x08020080, + .emif_ddr_ext_phy_ctrl_2 = 0x00700070, + .emif_ddr_ext_phy_ctrl_3 = 0x00700070, + .emif_ddr_ext_phy_ctrl_4 = 0x00700070, + .emif_ddr_ext_phy_ctrl_5 = 0x00700070, + .emif_rd_wr_lvl_rmp_win = 0x0, + .emif_rd_wr_lvl_rmp_ctl = 0x0, + .emif_rd_wr_lvl_ctl = 0x0, + .emif_rd_wr_exec_thresh = 0x00000405 +}; + const u32 ext_phy_ctrl_const_base_ddr3[] = { 0x00400040, 0x00350035, @@ -240,6 +262,48 @@ const u32 ext_phy_ctrl_const_base_ddr3[] = { 0x08102040 }; +static const u32 ext_phy_ctrl_const_base_ddr3_sk[] = { + /* first 5 are taken care by emif_regs */ + 0x00700070, + + 0x00350035, + 0x00350035, + 0x00350035, + 0x00350035, + 0x00350035, + + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + + 0x00150015, + 0x00150015, + 0x00150015, + 0x00150015, + 0x00150015, + + 0x00800080, + 0x00800080, + + 0x40000000, + + 0x08102040, + + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, + 0x00000000, +}; + void emif_get_ext_phy_ctrl_const_regs(const u32 **regs, u32 *size) { if (board_is_eposevm()) { @@ -248,6 +312,9 @@ void emif_get_ext_phy_ctrl_const_regs(const u32 **regs, u32 *size) } else if (board_is_gpevm()) { *regs = ext_phy_ctrl_const_base_ddr3; *size = ARRAY_SIZE(ext_phy_ctrl_const_base_ddr3); + } else if (board_is_sk()) { + *regs = ext_phy_ctrl_const_base_ddr3_sk; + *size = ARRAY_SIZE(ext_phy_ctrl_const_base_ddr3_sk); } return; @@ -257,7 +324,7 @@ const struct dpll_params *get_dpll_ddr_params(void) { if (board_is_eposevm()) return &epos_evm_dpll_ddr; - else if (board_is_gpevm()) + else if (board_is_gpevm() || board_is_sk()) return &gp_evm_dpll_ddr; printf(" Board '%s' not supported\n", am43xx_board_name); @@ -410,6 +477,9 @@ void sdram_init(void) enable_vtt_regulator(); config_ddr(0, &ioregs_ddr3, NULL, NULL, &ddr3_emif_regs_400Mhz, 0); + } else if (board_is_sk()) { + config_ddr(400, &ioregs_ddr3, NULL, NULL, + &ddr3_sk_emif_regs_400Mhz, 0); } } #endif diff --git a/board/ti/am43xx/board.h b/board/ti/am43xx/board.h index 091162e..017047d 100644 --- a/board/ti/am43xx/board.h +++ b/board/ti/am43xx/board.h @@ -47,6 +47,11 @@ static inline int board_is_gpevm(void) return !strncmp(am43xx_board_name, "AM43__GP", HDR_NAME_LEN); } +static inline int board_is_sk(void) +{ + return !strncmp(am43xx_board_name, "AM43__SK", HDR_NAME_LEN); +} + void enable_uart0_pin_mux(void); void enable_board_pin_mux(void); void enable_i2c0_pin_mux(void); diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h index 823cba6..974ce98 100644 --- a/include/configs/am43xx_evm.h +++ b/include/configs/am43xx_evm.h @@ -226,6 +226,8 @@ "setenv fdtfile am43x-epos-evm.dtb; fi; " \ "if test $board_name = AM43__GP; then " \ "setenv fdtfile am437x-gp-evm.dtb; fi; " \ + "if test $board_name = AM43__SK; then " \ + "setenv fdtfile am437x-sk-evm.dtb; fi; " \ "if test $fdtfile = undefined; then " \ "echo WARNING: Could not determine device tree; fi; \0"