From patchwork Tue Nov 17 06:20:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lin Huang X-Patchwork-Id: 545393 X-Patchwork-Delegate: sjg@chromium.org 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 7EB41141448 for ; Tue, 17 Nov 2015 17:24:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 962644B807; Tue, 17 Nov 2015 07:22:54 +0100 (CET) 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 9vv1Cv44kgwu; Tue, 17 Nov 2015 07:22:54 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 15DE54B810; Tue, 17 Nov 2015 07:22:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 592564B73E for ; Tue, 17 Nov 2015 07:22:42 +0100 (CET) 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 XRC0IwXn1Bxz for ; Tue, 17 Nov 2015 07:22:42 +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-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by theia.denx.de (Postfix) with ESMTPS id 98BC64B801 for ; Tue, 17 Nov 2015 07:22:36 +0100 (CET) Received: by wmww144 with SMTP id w144so2209474wmw.1 for ; Mon, 16 Nov 2015 22:22:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7VKMCqgKeXqBinEJGkyWJJqWHOl/rhSjVlJHkAQkiUQ=; b=NL5e0wP0MzjeIGl+eBnr7lue3wVtulBKBAn3ZrprXG8gY5yAUB6RKv/sQlVd0JosDU 2Qfw1+ObBD6va6i1MfcmT6Fq5+fegVxYGG1jTSauMGyiEzR2xNtdaRxahhgm8qav5+MQ v2x7DtIid7P/crd2kH43wNPlrZS61nr1gdLwPQodYtaiRKCXTqlhFRksZVrWmR0gMvPy VLXEUmhIlwPfR83XGWidlKIYPkbIrDExaTuqwap+/Pmk1tvqJUXZ893D+QDI0RFLNKsr EMrMSD/rHkBfyxvgZwRug75N+rSV0XIzxC8gk/bMODhWLszIvw+7PahKc+6fOgOWB4VI ZErw== X-Received: by 10.28.9.138 with SMTP id 132mr440359wmj.19.1447741356382; Mon, 16 Nov 2015 22:22:36 -0800 (PST) Received: from localhost.localdomain ([78.129.156.247]) by smtp.gmail.com with ESMTPSA id v196sm11661435wmv.10.2015.11.16.22.22.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Nov 2015 22:22:35 -0800 (PST) From: Lin Huang To: sjg@chromium.org Date: Tue, 17 Nov 2015 14:20:23 +0800 Message-Id: <1447741231-27673-16-git-send-email-hl@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447741231-27673-1-git-send-email-hl@rock-chips.com> References: <1447741231-27673-1-git-send-email-hl@rock-chips.com> Cc: kmixter@chromium.org, panto@antoniou-consulting.com, u-boot@lists.denx.de, cwz@rock-chips.com, cf@rock-chips.com, cjf@rock-chips.com, zyf@rock-chips.com Subject: [U-Boot] [PATCH v6 15/23] rockchip: mmc: use non-removable property to disginguish emmc and sdcard register X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" emmc and sdcard have different register address, use non-removeable property to disginuish them. Signed-off-by: Lin Huang --- drivers/mmc/rockchip_dw_mmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c index f11c8e0..8502dfc 100644 --- a/drivers/mmc/rockchip_dw_mmc.c +++ b/drivers/mmc/rockchip_dw_mmc.c @@ -50,8 +50,10 @@ static int rockchip_dwmmc_ofdata_to_platdata(struct udevice *dev) host->get_mmc_clk = rockchip_dwmmc_get_mmc_clk; host->priv = dev; - /* TODO(sjg@chromium.org): Remove the need for this hack */ - host->dev_index = (ulong)host->ioaddr == 0xff0f0000 ? 0 : 1; + /* use non-removeable as sdcard and emmc as judgement */ + if (fdtdec_lookup_phandle(gd->fdt_blob, dev->of_offset, "non-removable") + == -FDT_ERR_NOTFOUND) + host->dev_index = 1; return 0; }