From patchwork Thu Aug 8 03:14:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 817686 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp675500wrt; Wed, 7 Aug 2024 20:18:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU4nCv6HjszTczTGV/Ui3X+6KE9MloLqObgHQ1TTam61gNpekVMWQZPijO80gq6tZVcfwwNXu0NkdLP29lC0bnK X-Google-Smtp-Source: AGHT+IEJV5p2BzLaFxTDgA5gA8EucSHXutLMlGQ5jjsuuFU9x/sMidOl6k3zAdFudP/X10w2AJI9 X-Received: by 2002:a05:6402:208a:b0:5a1:6c50:a35 with SMTP id 4fb4d7f45d1cf-5bbb2411412mr392448a12.37.1723087135804; Wed, 07 Aug 2024 20:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723087135; cv=none; d=google.com; s=arc-20160816; b=ABISl5Rr44kG6rO3u5wAERVoIXuL/EYHhT20pSLZrQf1Q1Sebglr13DzSHZtRHKL/C IK8Y3Mn0IZtRme6IiqBNK/+vVKgTavCjPky2o46XjsEu0KFczm7oMZENb2aZehzk3oWp j8Hf/l7oWJCyMSiGHKdAgSEfNCRQNSRe9mEF7MsSZZnMslnlE+hgatuB/JQuPrXjGbZq cNOUBPfnDrEbcQBPR0gkqO+JBW+REqTjoxLaxx++FH3/92heTKWq635OiDEFz26bkeEw cE7clpRLQUj89Ii+paOUsCeQWGgb5K4OPhZNIkmLvcdNFPindGEF0yU1A0JWcmtswPdz 7GiQ== 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=jac/AK+/fRXX6frGsgkwuddOiwt75cCMUFZhhfIW9h8=; fh=lBtoWRjFntcnUbTK3mJKNUtiHNRKMTvShzSVX7EwD9Y=; b=PimohJEhamEX20cNs+KC2Y75nextJ11xSA9qNm5lYw/Nt3OBCGfVMtygGeE1fnoOlH h8gj2bLFVVnUU8EwFRSZtuj5d+iHNwuNCEwawHYp3TQv4EVGhCxK9DJegln1hG8TtWbV eTkbMMezQjXWjuPwSnAlUDdRjMGDJGFHK1tgqot4WnuBC16ld0WFhOf3/mYJKwCXWxiC MLRim4IkYcExseX1WmEzZ6FmojXUJOg287h32rJ4ytnMXL3EYJFotw2x/soKV823fdww EKmpQ6MlDgaJdJtU4MSy2+SOGEg8hfaJIB8I15l9+UYm+zF99LZlJVllz4i5BhG9AAYr OxDA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Yg3/BaaZ"; 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 4fb4d7f45d1cf-5bbb2bf9467si250767a12.17.2024.08.07.20.18.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 20:18:55 -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="Yg3/BaaZ"; 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 8468988BBB; Thu, 8 Aug 2024 05:15:13 +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="Yg3/BaaZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 65D8B88B32; Thu, 8 Aug 2024 05:15:06 +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-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) (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 681DF88AE1 for ; Thu, 8 Aug 2024 05:15:02 +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-oi1-x22c.google.com with SMTP id 5614622812f47-3dc16d00ba6so401534b6e.0 for ; Wed, 07 Aug 2024 20:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723086901; x=1723691701; 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=jac/AK+/fRXX6frGsgkwuddOiwt75cCMUFZhhfIW9h8=; b=Yg3/BaaZ2tyA2GnFzbrlRiGwqKiw/2m2vMLOWGTnI6LclsUVO2ooBMOFZhG7/toVWc LlOLjFuSTRlEJ1MXw2KhiXFeJFIDs8vCvXSiX4PQ/fxP6wI+RF6iZcCyv0ExkZzLlcMd XWndnX3UIOUldF4ORvYIH+EdI6SqjXelURHAxUNuKG9vrJoeoyQeFnkDQPF0oCkqI/vs K1abq84ix5RcLgDVJ6K4QPuzVeiK+wCRnJRz6HyLi3bjSE0Nxynau6mdV4ly5OXuMmnV FGWni4cRHfrieOMUS0A0yIQg+W1ufNmOSYyciyc8dRlCn5IulCBdYnC9xsHWKHfsVdsr hJRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723086901; x=1723691701; 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=jac/AK+/fRXX6frGsgkwuddOiwt75cCMUFZhhfIW9h8=; b=CQgR2obU/0oTtac3IwQS5OlCTcYuRD5zxu2xTXvCU5cGhQ3kV+yXkIprJpgl0PWNbp ZbwKjalI+zMRR9QcrWnQFzwGgJPZpGZgCJ6n1/Z+0QpR2a5LiOn/4/jbzO1BdN2Do0Ma ouG8enNQCk+9PRN7lTNxa85cq8aSaewVMxDXp9zJ5I5P4mtAsZfK3tTabWlUAZ2BL3TH GzV6D2IlY5h8l6RYF+ZkasqaD8pxcpR2cI3dFC2ug0D9EPoS3vXE9mvxEoJMiL/AhV1f FZv7E/JDenRjncxGQzHZr86NLANK/IhEifXR3+5FIhjr+nSY6fUUqYH20nvJah314uW5 IqEQ== X-Forwarded-Encrypted: i=1; AJvYcCVT08mKkbvLOewD3WimQc5hK66iHyQoxohu0ddl9hmurGDMiaAJfc1YuPWqxJN/LvLQJTxhB4SId0sGSSBV9QNbS0qWeA== X-Gm-Message-State: AOJu0YwXdy8TtJkLkGDSTVNxAprYOoz7ibxw6JjAQD0qaBqkkfCe8wzD pbbUVeEc/aF0eZBjSbORLhzZVIRgJYrg/zq/5QhG2hRDxClbNinWPAjWu13Xdbw= X-Received: by 2002:a05:6808:2185:b0:3d9:2ac4:5d69 with SMTP id 5614622812f47-3dc3b427b8bmr637587b6e.25.1723086901016; Wed, 07 Aug 2024 20:15:01 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3db563b705asm4640056b6e.35.2024.08.07.20.15.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 20:15:00 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang , Jaehoon Chung Cc: Tom Rini , Henrik Grimler , 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 v5 22/38] mmc: exynos_dw_mmc: Convert to use livetree API Date: Wed, 7 Aug 2024 22:14:28 -0500 Message-Id: <20240808031444.9619-23-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240808031444.9619-1-semen.protsenko@linaro.org> References: <20240808031444.9619-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 v5: - (none) 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; }