From patchwork Thu Jul 25 20:45:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814399 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567210wrn; Thu, 25 Jul 2024 13:49:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX170bCYe6LGdNWFG7hJXEnYowOiJbYkGhr/7ujE2M2wJ0isLCF+fDv9mt0Wj1EAjsNBc49r5neowed8X+dIyyw X-Google-Smtp-Source: AGHT+IGIVXxkzEmC/fwPaEuZiI01BR8Evy5fs2sh4RdTYwuQ7Eg1rjSyFG+y3La3c4JOqXqrUALw X-Received: by 2002:a2e:8ed4:0:b0:2ef:22ed:3818 with SMTP id 38308e7fff4ca-2f03dbe1887mr22052951fa.32.1721940559876; Thu, 25 Jul 2024 13:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940559; cv=none; d=google.com; s=arc-20160816; b=QK4D9STMM4WDAJzUdKnNW9hDOVLKUL82oWoTnq7WUkWMUi3qhkKKrH8cb7SxlC6mf0 V9eS3AbbjWOTbVU34AvdyYtTCie3QCacheIFDTFM6098ZlSxdGE7PXL6R/BrQryOA860 e/oUjHJ/MXp3NVp+KBvaxJHEoqB/5XGEe6xMXBIQKDHL/IPG6sMxnrmrGZw9lVBtxYPp E+eXLioJUMk/Iie2/dg9WZwCzwF1uispT17AK1ssqhNlo1FmWAZzPbc6KnPYXG1SLCda lFHd03KSb5qXT6NTuE14TvHSHxTI4infCopATNr3s5EWkq6UKd7QnyylZSxIq+o5QL0/ Gf4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vKX68i68F/KIbsQOD2K1dhvAle2Wr9F2LfPYr7ptEtY=; fh=X4lW+c7jYyx9d+RmLZUX+9QEQn0UCpyMDbNUusZzgBU=; b=VMpfeZL1UtbPWuC2Tq7m+QksKQKg5x1aLFH5diax1uihtz6EDWLVO823FOcl7e2cjH t0g5c+SRTKBhI9KAVDG5Djtw2DHqsyhf7Y8nnwoyFPnjV+KcgBLX8GidIXvreaNQwP4j j/NsZWp2UjJXoroMmrpnBKuCKLe908pfcBrpxUp3k1pybpINbzIA8U3im3VbnYWhb/nd 5h0cyUg9esQJUjXuU4yqNPcwqGW1BNyWVYerMqOEkeDQMgrxM73ub6ktlkdbqBhGhRau HPC7/ScEXmR+bpEKgX6FTbvrbo65j74AKLPs4UKvwKG4ocxgDmg2coY8MWCpAxAum4qq l1UQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K9aA87y0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 38308e7fff4ca-2f03d152339si5768011fa.354.2024.07.25.13.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:49:19 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K9aA87y0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8B44388744; Thu, 25 Jul 2024 22:45:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="K9aA87y0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B2BEC8859B; Thu, 25 Jul 2024 22:45:41 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) (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 D38F888580 for ; Thu, 25 Jul 2024 22:45:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=semen.protsenko@linaro.org Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-7037a208ff5so205003a34.0 for ; Thu, 25 Jul 2024 13:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940337; x=1722545137; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vKX68i68F/KIbsQOD2K1dhvAle2Wr9F2LfPYr7ptEtY=; b=K9aA87y02K0RMPATTulcjDPyHb0Hk80CzSgjbwf5Zs0YdGNYkMtXB9413U78eY5FCj y19tp8jc+VJTcc0BvWCYPuqYj9d3VUcdIq7JEtKybT6D8EYpZOxUjRfvoBTBbUasgDnq ji3vP9CoOBItboleBeXYfayNgw+hqVpkvLO2S4AyaaIIyXN+kAvSsps+X3ciRIvn20+C /lynSvbOJEylb3/9vvETtDSnvl75ZoV7J6BgUF7G43BinZDuIyJz4UtY5emta6z/3xN/ Ohod2JEpV/Aqyi9zZcgINbRQRoDY7/zudBeT2KtNiue0TQujoQLhbYox/mUn6O3rH5yZ 5idw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940337; x=1722545137; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vKX68i68F/KIbsQOD2K1dhvAle2Wr9F2LfPYr7ptEtY=; b=w7LRb67o1IhDIIzl75tF12VMUO+fblCAvlGHHEa85lcgWbz0mSzq3N3EbBJ6/puvJJ 9swwpx6bco/4FZefRWBjq0HjA+bNp2I3Yo5S4ycEcICEe3EGcLSvm7CoPF97cenBfdfu TcpNZlEGEFpQee6nr/7aRrLn1aOf26t0XRqbgne0GWVHmygqFCDE23iG5skSFBryVe/t afT39Nud9R8UI0Hae+K2lI4Kvsozmnp34UXvv6CXDyoyr3FgJCLa370g7xjOEkruYu1c fUo7lG84+z2IAgqJ03xS4XQaI6+/D0He+gfLHE6pgyYr12MFIBl8uxDUrSjUfYoY+Hse j0iw== X-Forwarded-Encrypted: i=1; AJvYcCXB2HDYGoH6LHW/d1OqEVB3Rjy3sXk8jhP2y2vpF7aT7wEli/n0uf5oDVyGNacjwMA9U3DOsmWzcv2uR6+nDB6FNBsu4w== X-Gm-Message-State: AOJu0YxjHAHrWSpM1PgWjmun98aEVe4odc84CztjKPjo8Z5wHSIhT7S0 84OIFdVsyN0Z+58UTeG7Kj8Q02iL76TXdkHSqeyv7VViZpXLyAtN0oKSKpPsEFI= X-Received: by 2002:a05:6830:3c0a:b0:703:6003:11f4 with SMTP id 46e09a7af769-7093222f9d4mr4003657a34.14.1721940337568; Thu, 25 Jul 2024 13:45:37 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930778280sm447440a34.64.2024.07.25.13.45.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:37 -0700 (PDT) From: Sam Protsenko To: Jaehoon Chung Cc: Minkyu Kang , Minkyu Kang , Tom Rini , Peng Fan , Simon Glass , Quentin Schulz , Philipp Tomsich , Kever Yang , Eugeniy Paltsev , Peter Robinson , Jonas Karlman , Yang Xiwen , Ferass El Hafidi , Sean Anderson , u-boot@lists.denx.de, uboot-snps-arc@synopsys.com Subject: [PATCH v4 22/38] mmc: exynos_dw_mmc: Convert to use livetree API Date: Thu, 25 Jul 2024 15:45:04 -0500 Message-Id: <20240725204520.18134-23-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240725204520.18134-1-semen.protsenko@linaro.org> References: <20240725204520.18134-1-semen.protsenko@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean Update the driver to use livetree API instead of FDT one. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Moved exynos_dwmmc_of_to_plat() under #ifdef CONFIG_DM_MMC stanza drivers/mmc/exynos_dw_mmc.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 09a59fdf0120..50d0208b29fd 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -6,9 +6,7 @@ #include #include -#include #include -#include #include #include #include @@ -226,18 +224,19 @@ static int do_dwmci_init(struct dwmci_host *host) #ifdef CONFIG_DM_MMC static int exynos_dwmmc_of_to_plat(struct udevice *dev) { - const void *blob = gd->fdt_blob; struct dwmci_exynos_priv_data *priv = dev_get_priv(dev); struct dwmci_host *host = &priv->host; - int node = dev_of_offset(dev); int err = 0; u32 timing[3]; #ifdef CONFIG_CPU_V7A + const void *blob = gd->fdt_blob; + int node = dev_of_offset(dev); + /* Extract device id for each mmc channel */ host->dev_id = pinmux_decode_periph_id(blob, node); - host->dev_index = fdtdec_get_int(blob, node, "index", host->dev_id); + host->dev_index = dev_read_u32_default(dev, "index", host->dev_id); if (host->dev_index == host->dev_id) host->dev_index = host->dev_id - PERIPH_ID_SDMMC0; @@ -253,7 +252,7 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) #endif /* Get the bus width from the device node (Default is 4bit buswidth) */ - host->buswidth = fdtdec_get_int(blob, node, "samsung,bus-width", 4); + host->buswidth = dev_read_u32_default(dev, "samsung,bus-width", 4); /* Set the base address from the device node */ host->ioaddr = dev_read_addr_ptr(dev); @@ -263,7 +262,7 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) } /* Extract the timing info from the node */ - err = fdtdec_get_int_array(blob, node, "samsung,timing", timing, 3); + err = dev_read_u32_array(dev, "samsung,timing", timing, 3); if (err) { printf("DWMMC%d: Can't get sdr-timings for devider\n", host->dev_index); @@ -283,8 +282,8 @@ static int exynos_dwmmc_of_to_plat(struct udevice *dev) } host->fifo_depth = dev_read_u32_default(dev, "fifo-depth", 0); - host->bus_hz = fdtdec_get_int(blob, node, "bus_hz", 0); - host->div = fdtdec_get_int(blob, node, "div", 0); + host->bus_hz = dev_read_u32_default(dev, "bus_hz", 0); + host->div = dev_read_u32_default(dev, "div", 0); return 0; }