From patchwork Mon Sep 9 12:50:02 2013
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Przemyslaw Marczak
X-Patchwork-Id: 273562
X-Patchwork-Delegate: promsoft@gmail.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 A69642C013F
for ;
Mon, 9 Sep 2013 22:51:17 +1000 (EST)
Received: from localhost (localhost [127.0.0.1])
by theia.denx.de (Postfix) with ESMTP id 235264A081;
Mon, 9 Sep 2013 14:51:14 +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 qNhKjHKG5zoV; Mon, 9 Sep 2013 14:51:13 +0200 (CEST)
Received: from theia.denx.de (localhost [127.0.0.1])
by theia.denx.de (Postfix) with ESMTP id 952D24A067;
Mon, 9 Sep 2013 14:51:06 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
by theia.denx.de (Postfix) with ESMTP id 4B73C4A067
for ; Mon, 9 Sep 2013 14:50:47 +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 OtVYiDy9wRD2 for ;
Mon, 9 Sep 2013 14:50:36 +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 mailout1.w1.samsung.com (mailout1.w1.samsung.com
[210.118.77.11]) by theia.denx.de (Postfix) with ESMTP id 6C6174A066
for ; Mon, 9 Sep 2013 14:50:27 +0200 (CEST)
Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245])
by mailout1.w1.samsung.com
(Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit
(built Nov
17 2011)) with ESMTP id <0MSU00GXDZNXMV70@mailout1.w1.samsung.com>
for u-boot@lists.denx.de; Mon, 09 Sep 2013 13:50:23 +0100 (BST)
X-AuditID: cbfec7f5-b7ef66d00000795a-77-522dc40fe500
Received: from eusync4.samsung.com ( [203.254.199.214])
by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 78.5D.31066.F04CD225;
Mon, 09 Sep 2013 13:50:23 +0100 (BST)
Received: from AMDC1186.digital.local ([106.116.147.185])
by eusync4.samsung.com
(Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit
(built Nov
17 2011)) with ESMTPA id <0MSU00I2WZNT9A20@eusync4.samsung.com>; Mon,
09 Sep 2013 13:50:23 +0100 (BST)
From: Przemyslaw Marczak
To: u-boot@lists.denx.de
Date: Mon, 09 Sep 2013 14:50:02 +0200
Message-id: <1378731002-12335-1-git-send-email-p.marczak@samsung.com>
X-Mailer: git-send-email 1.7.9.5
X-Brightmail-Tracker:
H4sIAAAAAAAAA+NgFjrHJMWRmVeSWpSXmKPExsVy+t/xa7r8R3SDDH72WVrc+NXGanG26Q27
RceRFkaLHZdvsFhMXjyf2eLt3k52BzaPs3d2MHr0bVnF6HH8xnamAOYoLpuU1JzMstQifbsE
roxNU5IKPvBV3FlyibGB8T93FyMnh4SAiUTzlT9sELaYxIV764FsLg4hgaWMEm1PWxghnD4m
ib7zUxlBqtgEDCT2XDrDDGKLCEhI/Oq/ClbELLCcUeL7om9gRcICHhLv954Es1kEVCV+90wA
GsvBwSvgKnFyGR+IKSGgIDFnks0ERu4FjAyrGEVTS5MLipPSc430ihNzi0vz0vWS83M3MULC
4OsOxqXHrA4xCnAwKvHwSvzXCRJiTSwrrsw9xCjBwawkwit6WDdIiDclsbIqtSg/vqg0J7X4
ECMTB6dUA2PtnG/LeN1Uz0dfqj/wwcsoJ3Ta9OKlLHeyagwMN/7/8Fz64IM7hXkrsqtX3fBb
mNVmX7tTm23R2kKn6aWdX45xh027azRNwLLVSpinT8CmMeZr4McnZZMWqKjPZ3safPLcxD0r
Tvy/Zu/HuOHGd8Y1lzVP/P/o5p/PF/1YbMEvvsx+rjc3miOVWIozEg21mIuKEwEy+Hdg4QEA AA==
Cc: trini@ti.com, jh80.chung@samsung.com,
Kyungmin Park ,
Przemyslaw Marczak
Subject: [U-Boot] [PATCH] arm:goni:mmc: Add sd card detection and
initialization.
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
This change allow to use sd card on Goni the same like mmc 0.
SD card is mmc dev 1, so it can be used like this: "fatls mmc 1:2".
SD card is inited even if eMMC initialization fails.
Signed-off-by: Przemyslaw Marczak
Signed-off-by: Kyungmin Park
CC: Minkyu Kang
---
board/samsung/goni/goni.c | 33 +++++++++++++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index 5b3d6ef..d63e902 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -72,7 +72,7 @@ int checkboard(void)
#ifdef CONFIG_GENERIC_MMC
int board_mmc_init(bd_t *bis)
{
- int i;
+ int i, ret, ret_sd = 0;
/* MASSMEMORY_EN: XMSMDATA7: GPJ2[7] output high */
s5p_gpio_direction_output(&s5pc110_gpio->j2, 7, 1);
@@ -95,7 +95,36 @@ int board_mmc_init(bd_t *bis)
s5p_gpio_set_drv(&s5pc110_gpio->g0, i, GPIO_DRV_4X);
}
- return s5p_mmc_init(0, 4);
+ ret = s5p_mmc_init(0, 4);
+ if (ret)
+ puts("MMC: Failed to init MMC:0.\n");
+
+ /*
+ * SD card (T_FLASH) detect and init
+ * T_FLASH_DETECT: EINT28: GPH3[4] input mode
+ */
+ s5p_gpio_cfg_pin(&s5pc110_gpio->h3, 4, GPIO_INPUT);
+ s5p_gpio_set_pull(&s5pc110_gpio->h3, 4, GPIO_PULL_UP);
+
+ if (!s5p_gpio_get_value(&s5pc110_gpio->h3, 4)) {
+ for (i = 0; i < 7; i++) {
+ if (i == 2)
+ continue;
+
+ /* GPG2[0:6] special function 2 */
+ s5p_gpio_cfg_pin(&s5pc110_gpio->g2, i, 0x2);
+ /* GPG2[0:6] pull disable */
+ s5p_gpio_set_pull(&s5pc110_gpio->g2, i, GPIO_PULL_NONE);
+ /* GPG2[0:6] drv 4x */
+ s5p_gpio_set_drv(&s5pc110_gpio->g2, i, GPIO_DRV_4X);
+ }
+
+ ret_sd = s5p_mmc_init(2, 4)
+ if (ret_sd)
+ puts("MMC: Failed to init SD card (MMC:2).\n");
+ }
+
+ return ret | ret_sd;
}
#endif