From patchwork Mon Dec 17 11:19:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amar X-Patchwork-Id: 13621 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 95F8F23E02 for ; Mon, 17 Dec 2012 10:57:57 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 28A5EA18A5E for ; Mon, 17 Dec 2012 10:57:57 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so8818558ieb.11 for ; Mon, 17 Dec 2012 02:57:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:received-spf :x-auditid:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:dlp-filter:x-mtr:x-brightmail-tracker :x-brightmail-tracker:x-cfilter-loop:x-gm-message-state; bh=S2tKRCFMMygRgyqp6WiEu/quZRw1psxPTtE+voe78ZE=; b=OigJbquNqYodcpHb3T8DtGP9dC2CsT4Srm8CH5e2da5wv0v1VPURVayFdu0OkhuwBr Bx/9r5ErllBWRjJ8MsyN+lwaRFgSMEHk2gsr22Xpd8UXz+QZC+wXkiIrczD7sVy6eNkv OFMy6oOYmPHGsx25pMsno0/UDb65td3eAdAOL83cu9KDRLXqM0IzbQXCFSY6enHsWu6l grsr5w4VL3r99xss9wmE5WhQeOk/q/7gne+T8aXI/asDm9GiboAKjz7Xg/V9ii4wo8LK FHO4Njwu60Bc891cWwB7KlGoroeqyRKw1px0zo8Zpaf5Z/ZUDqjyx5wpeb4jN/wx+09/ x7dA== X-Received: by 10.50.213.69 with SMTP id nq5mr8540594igc.70.1355741876576; Mon, 17 Dec 2012 02:57:56 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp66399igt; Mon, 17 Dec 2012 02:57:56 -0800 (PST) Received: by 10.66.75.162 with SMTP id d2mr41339636paw.27.1355741875691; Mon, 17 Dec 2012 02:57:55 -0800 (PST) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id d7si12979490paw.269.2012.12.17.02.57.55; Mon, 17 Dec 2012 02:57:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of amarendra.xt@samsung.com designates 203.254.224.24 as permitted sender) client-ip=203.254.224.24; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of amarendra.xt@samsung.com designates 203.254.224.24 as permitted sender) smtp.mail=amarendra.xt@samsung.com Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MF600ADA92QUC30@mailout1.samsung.com>; Mon, 17 Dec 2012 19:57:32 +0900 (KST) Received: from epcpdlpp23 ( [172.20.52.123]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 3D.AA.12699.C9AFEC05; Mon, 17 Dec 2012 19:57:32 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-08-50cefa9c161f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id EC.AA.12699.C9AFEC05; Mon, 17 Dec 2012 19:57:32 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MF600FNU92TR670@mmp2.samsung.com>; Mon, 17 Dec 2012 19:57:32 +0900 (KST) From: Amar To: u-boot@lists.denx.de Cc: patches@linaro.org, sjg@chromium.org, mk7.kang@samsung.com, chander.kashyap@linaro.org, afleming@gmail.com, jh80.chung@samsung.com Subject: [PATCH 6/9] SMDK5250: Enable DWMMC Date: Mon, 17 Dec 2012 16:49:33 +0530 Message-id: <1355743176-12305-7-git-send-email-amarendra.xt@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1355743176-12305-1-git-send-email-amarendra.xt@samsung.com> References: <1355743176-12305-1-git-send-email-amarendra.xt@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRmVeSWpSXmKPExsWyRsSkWnfOr3MBBgc+qls8XH+TxWLK4S8s Dkwed67tYQtgjOKySUnNySxLLdK3S+DKOLruNEtBv0jFqQvzWRoYzwp0MXJySAiYSEyatIYN whaTuHBvPZDNxSEkMItR4nzPJkaYop0/LzFCJKYzSmzrX88E4bQzSZz4fpK1i5GDg01AVeLX YnuQBhEBCYlf/VfBGpgFOhgldkzcDDZJWEBb4lzPXCYQmwWo/sL82WCreQU8JDp6O5khtilI tC47xA5icwp4Snze/ZAFxBYCqtmzazozRK+AxLfJh1hA9koIyEpsOsAMsktC4D6bxPxNc1kh 5khKHFxxg2UCo/ACRoZVjKKpBckFxUnpuUZ6xYm5xaV56XrJ+bmbGIEBefrfM+kdjKsaLA4x CnAwKvHwGqaeCxBiTSwrrsw9xCjBwawkwiv9BijEm5JYWZValB9fVJqTWnyI0QfokonMUqLJ +cBoySuJNzQ2MTc1NrU0MjIzNcUhrCTO2+yREiAkkJ5YkpqdmlqQWgQzjomDU6qB0UHsYeUK ZeeIE4ozXzyqWMV1YlWU+JMZzVrTlHtEr66fq3x9vcp6nlcLXbJ1VVfv3rht0TW585PvFHb/ fBz+877+7dZpj2QVAtRkv5e0d5ubvbnaYz9noonQ+r5HG2Jde3+aTpQ7JPnw1eJcie5nr6Zt lfNpC3i01vv65fBVD28EfZcq5JGemqzEUpyRaKjFXFScCAA9a4zYdQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRmVeSWpSXmKPExsVy+t9jQd05v84FGGxukbV4uP4mi8WUw19Y HJg87lzbwxbAGNXAaJORmpiSWqSQmpecn5KZl26r5B0c7xxvamZgqGtoaWGupJCXmJtqq+Ti E6DrlpkDNFtJoSwxpxQoFJBYXKykb4dpQmiIm64FTGOErm9IEFyPkQEaSFjDmHF03WmWgn6R ilMX5rM0MJ4V6GLk5JAQMJHY+fMSI4QtJnHh3nq2LkYuDiGB6YwS2/rXM0E47UwSJ76fZO1i 5OBgE1CV+LXYHqRBREBC4lf/VUaQGmaBDkaJHRM3g00SFtCWONczlwnEZgGqvzB/NhuIzSvg IdHR28kMsU1BonXZIXYQm1PAU+Lz7ocsILYQUM2eXdOZJzDyLmBkWMUomlqQXFCclJ5rpFec mFtcmpeul5yfu4kRHO7PpHcwrmqwOMQowMGoxMNrmHouQIg1say4MvcQowQHs5IIr/QboBBv SmJlVWpRfnxRaU5q8SFGH6CrJjJLiSbnA2MxryTe0NjE3NTY1NLEwsTMEoewkjhvs0dKgJBA emJJanZqakFqEcw4Jg5OqQbGFZ+vzDjTUXvkvdYFlsbFXVMOubHHmW1bdHjF+uXbBfkzaq1V TiZkO4m/enG3eqf7zj8rjn2aG3HS93Dlu4uqU+aHf9ff7fzxk5f71+4Js+xc1DdPMPq0SeDf jLglv7fadJrdZHj4Lzrx8RE927QlM8VYvsfsL/W/yjpbUTxMd1a/62l+eb7O1UosxRmJhlrM RcWJADjoq+OkAgAA X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQlzTsx4pw5mfYnsy9cUgPDrb5ybOOms8x/+QFsJrOjjXEQ+MRsmcqSHu8US+w53Dzx3wSEi This patch enables DWMMC for SMDK5250. Support both dt and non-dt versions. Signed-off-by: Amar --- board/samsung/smdk5250/smdk5250.c | 36 ++++++++++++++++++++++++++++++++---- include/configs/exynos5250-dt.h | 9 +++++++++ 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c index 4d24978..7a9c8f6 100644 --- a/board/samsung/smdk5250/smdk5250.c +++ b/board/samsung/smdk5250/smdk5250.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -192,16 +193,43 @@ int checkboard(void) #ifdef CONFIG_GENERIC_MMC int board_mmc_init(bd_t *bis) { - int err; + int err = 0, ret = 0; +#ifdef CONFIG_OF_CONTROL + /* dwmmc initializattion for available channels */ + err = exynos_dwmmc_init(gd->fdt_blob); + if (err) { + debug("dwmmc init failed\n"); + } + ret |= err; +#else err = exynos_pinmux_config(PERIPH_ID_SDMMC0, PINMUX_FLAG_8BIT_MODE); if (err) { debug("SDMMC0 not configured\n"); - return err; } + ret |= err; - err = s5p_mmc_init(0, 8); - return err; + /*eMMC: dwmmc Channel-0 with 8 bit bus width */ + err = exynos_dwmmc_init(0, 8); + if (err) { + debug("dwmmc Channel-0 init failed\n"); + } + ret |= err; + + err = exynos_pinmux_config(PERIPH_ID_SDMMC2, PINMUX_FLAG_NONE); + if (err) { + debug("SDMMC2 not configured\n"); + } + ret |= err; + + /*SD: dwmmc Channel-2 with 4 bit bus width */ + err = exynos_dwmmc_init(2, 4); + if (err) { + debug("dwmmc Channel-2 init failed\n"); + } + ret |= err; +#endif + return ret; } #endif diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h index 12f555c..3b89e20 100644 --- a/include/configs/exynos5250-dt.h +++ b/include/configs/exynos5250-dt.h @@ -84,6 +84,8 @@ #define CONFIG_MMC #define CONFIG_SDHCI #define CONFIG_S5P_SDHCI +#define CONFIG_DWMMC +#define CONFIG_EXYNOS_DWMMC #define CONFIG_BOARD_EARLY_INIT_F @@ -116,6 +118,13 @@ #define CONFIG_SPL #define COPY_BL2_FNPTR_ADDR 0x02020030 +/* eMMC4.4 SPL */ +#define EMMC44_COPY_BL2_FNPTR_ADDR 0x02020044 +#define EMMC44_END_BOOTOP_FNPTR_ADDR 0x02020048 + +#define FSYS1_MMC0_DIV_MASK 0xff0f + + /* specific .lds file */ #define CONFIG_SPL_LDSCRIPT "board/samsung/smdk5250/smdk5250-uboot-spl.lds" #define CONFIG_SPL_TEXT_BASE 0x02023400