From patchwork Thu Sep 10 17:53:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andre Heider X-Patchwork-Id: 1361725 X-Patchwork-Delegate: van.freenix@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=PO0MqYQh; dkim-atps=neutral Received: from phobos.denx.de (unknown [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BnRNh2CK0z9sVs for ; Fri, 11 Sep 2020 03:54:31 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 34C51822EC; Thu, 10 Sep 2020 19:53:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PO0MqYQh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1A692822FC; Thu, 10 Sep 2020 19:53:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CBD34822D9 for ; Thu, 10 Sep 2020 19:53:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=a.heider@gmail.com Received: by mail-wr1-x442.google.com with SMTP id k15so7766928wrn.10 for ; Thu, 10 Sep 2020 10:53:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9iEXPH75Oa44FJ8Zp5NZn2tL4AiNni3+u/OcKuw59FE=; b=PO0MqYQhbJ1+R7OZqJQqojcvwJLv9QpbY9vCDDsa9bL0egclLXHyIoVa0GfVOew4cg edk116WNsSB1bmrsSPqWivRXqjO02F/TOWBiDRKNRu3VY5XWGl6X9Ph0ZjHrK6YlHW2P 43P9Xd6lg5kzW8tlkvOudLe3U+b/EG+1l022UL1+fAZBsda2bdeoPM2lAdrX+JepGY5x qJb5Zs0f6W1ExKT7LPfTC//g/X+x3GMEDCagUX0aAqZpOrkFnaryRy4WgFJ+DZzMo/C5 LB3CeeBCWWQ/br9S2EZfIllWhUkkuC8qdpUrjtJz52D1XQl/oGBEYk6PCpRWo6qDRxha ejfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9iEXPH75Oa44FJ8Zp5NZn2tL4AiNni3+u/OcKuw59FE=; b=INGzPoLvf/YrdBKHOAmayJGC2246mPxu5q8Yc9ffowMl6HQKlUKyP97LqfT1w+5Brh DcWt5iSr+xOrONADoiZ6e2VIsRp6DJ6svfJL0v7Hyxwth0k6AcyymRwBBPDfq6QZ8gI7 wQq0njkdgUFWMBfaPW/SftpMKkRxHb2L4KpmsX2PhiQj+MJy3bnZ47fu3+ieraWOxOYx 6OSUTMrlpnXPICccNu/4CsCSwVgMnXGV0xCOFsk4l3CEloF9lTa2TdlURaLt+9W/7MqG 5Wcs5BRgLqeF0KcLsaKPTtftZeJMpwk+SucizlXcgLG7JxVqJxEqIEWTOVxg6GuJQQ4g LOOg== X-Gm-Message-State: AOAM532Tgi1J8aBPV2ef73GJVmvK/mXasBR/lPnG/YtxRnOMZzeKXzEU XzJP5jC5pEf0Q/0yorDkuxc= X-Google-Smtp-Source: ABdhPJyU7ZVyDaA9merlH7238TfgKIapKLWZWKzT1QywXGwuWdxH3aaQGanRtXV2UCsNKJGjvpAhMQ== X-Received: by 2002:a5d:4fcc:: with SMTP id h12mr10208462wrw.199.1599760422279; Thu, 10 Sep 2020 10:53:42 -0700 (PDT) Received: from mamamia.internal (a89-183-47-47.net-htp.de. [89.183.47.47]) by smtp.gmail.com with ESMTPSA id m4sm10736597wro.18.2020.09.10.10.53.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 10:53:41 -0700 (PDT) From: Andre Heider To: Stefan Roese , Konstantin Porotchkin Cc: =?utf-8?q?Pali_Roh=C3=A1r?= , =?utf-8?q?G=C3=A9rald_Ker?= =?utf-8?q?ma?= , u-boot@lists.denx.de Subject: [PATCH] mmc: xenon_sdhci: Add missing common host capabilities Date: Thu, 10 Sep 2020 19:53:40 +0200 Message-Id: <20200910175340.515227-1-a.heider@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Use mmc_of_parse() to set the common host properties. That includes "bus-width", so parsing it can be removed from the driver. But more importantly, "non-removable" is now respected, which fixes the usage of eMMC. Signed-off-by: Andre Heider Reviewed-by: Konstantin Porotchkin Tested-by: Marek Behún --- Tested myself on v5 without emmc, `mmc info` is unchanged for my sd card Tested by Gérald on v7 emmc, which started working with this patch: => mmc info Device: sdhci@d8000 Manufacturer ID: 45 OEM: 100 Name: SEM04 Bus Speed: 52000000 Mode: MMC High Speed (52MHz) Rd Block Len: 512 MMC version 4.5 High Capacity: Yes Capacity: 3.7 GiB Bus Width: 8-bit Erase Group Size: 256 KiB HC WP Group Size: 8 MiB User Capacity: 3.7 GiB WRREL Boot Capacity: 2 MiB RPMB Capacity: 2 MiB Boot area 0 is not write protected Boot area 1 is not write protected drivers/mmc/xenon_sdhci.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c index 7f9a579c83..6ce9d00d0a 100644 --- a/drivers/mmc/xenon_sdhci.c +++ b/drivers/mmc/xenon_sdhci.c @@ -485,20 +485,10 @@ static int xenon_sdhci_probe(struct udevice *dev) armada_3700_soc_pad_voltage_set(host); host->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_DDR_52MHz; - switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "bus-width", - 1)) { - case 8: - host->host_caps |= MMC_MODE_8BIT; - break; - case 4: - host->host_caps |= MMC_MODE_4BIT; - break; - case 1: - break; - default: - printf("Invalid \"bus-width\" value\n"); - return -EINVAL; - } + + ret = mmc_of_parse(dev, &plat->cfg); + if (ret) + return ret; host->ops = &xenon_sdhci_ops;