From patchwork Wed May 22 23:31:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 798204 Delivered-To: patch@linaro.org Received: by 2002:ab3:6414:0:b0:267:d849:ee76 with SMTP id j20csp918775lte; Wed, 22 May 2024 16:36:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUG17Xjf714xoEvVTY4jV110E0Rfsq7IzVK68fXLgt8mJy60gn7pfa2u9+xybDrKs8LcT117oVjAHVmCwGnhdW7 X-Google-Smtp-Source: AGHT+IGhplvoMryDiEUNkeqBFtn4wf5ve1nzfJDVQfbfHgzG0luDAyl/JAy+PX098slgLneyIUlI X-Received: by 2002:a17:907:cc90:b0:a59:9eab:162b with SMTP id a640c23a62f3a-a62280b51f8mr164981766b.35.1716420986347; Wed, 22 May 2024 16:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716420986; cv=none; d=google.com; s=arc-20160816; b=C66M6zOS3m35JYlCg08HNkc9nYx5VVbr7ceCeG2L3p0NIbV/owTsOC+IZ03luzPaPb SCz6TikNZUc6lJXuWUFFdp64XCc4lvY/jTyYYeT2YBFp01Cr3WH1RYHCe0UPisjB53SZ 3Ag2WyOVjKW1xQIUt2Co4jUZirQNrSwhh6JmUa0+z/NTrKER7qRM241f6p0OAF8eL8on Z+OWHI4wGZIJbmBA9EEJ3mrXbg9J0ut0FjmU3SRTFhfuG+aXDO27iFtMWH/ZbfVtJz3x pF7rLsTq7o9trfqC5bzk4qBHrL/6iks9db6VgB8Jlm5PU5rpGxhW8pEown0tPkUbQ8TK Jweg== 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=sISNUoerHOAo3xxswhYPELGlcEVeYbVIN5eV2B3jZRM=; fh=Tq4B3RkZ7sziwmfvNpzveZxJw1UFgKXiOW6nCA/Llck=; b=Krml7rHVp3gsKMd8goTWAKV5ryvj6sm2D1ZaA0GPbIQ9+cKPbNASFpqXZPV642rhyS cKztko/ec6tT6CLF0WjG8eFz9/iViXuVIK8rMvuIPFCD/16miAdz8cDU9IlSAD/TAhqu Ua5SBYztmC+N/An6w6QfjLccdgA7HCkf3GD7EyPSELFkjagyZ64PhAgOZmVjBPubpQ1r aexFgaCK0Krfv0CSaYY1RLWO1ybF2liprLwqLLJIFFUYw/OiITTjtWQDqQPDUH/neFx1 X302E7Yo2kGXtk8msdWTXNSH9RZWDqjq1mGgbkxQjRBdQTgM+MsGCP5W4QDuodGnclHE MmUA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=npLkz7fB; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a8af05b77si931513866b.466.2024.05.22.16.36.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 16:36:26 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=npLkz7fB; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6328D8858E; Thu, 23 May 2024 01:32: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="npLkz7fB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 91762885A9; Thu, 23 May 2024 01:32:05 +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-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) (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 61F5187D57 for ; Thu, 23 May 2024 01:31:59 +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-oa1-x33.google.com with SMTP id 586e51a60fabf-244bdd730dcso2599391fac.0 for ; Wed, 22 May 2024 16:31:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716420718; x=1717025518; 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=sISNUoerHOAo3xxswhYPELGlcEVeYbVIN5eV2B3jZRM=; b=npLkz7fBenyvnAfOIN47FfckKDwpJxM50mTkWDM429/mP1BxNhWc+ZMyx9ZSo3DWyo c1b+53K6u80uHHS40Z3FtH+X1TeAeYgPwUGhk1uPj8yqdtYsz06Ulf5zW/956wFOsKAg U1CgMuYZuZOh27aqljmuukGnpE5L0PfBNr3WfIkxf+t6eYmS+Rd0K3h63n/CGILI0rZ7 +MgPAetETNnskmAwUAQw3T/5D5eRYita+UieyYOyECIpNFGWbpWnOfDu3Tbvvsjv3S04 ObcVSOcSxKVI0arT9ycdp5RGYeBmp77OOKpj49beXW8D2aNExpVQvKstTUjIuOC6FvhS cq1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716420718; x=1717025518; 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=sISNUoerHOAo3xxswhYPELGlcEVeYbVIN5eV2B3jZRM=; b=WeSu1DWNCkfoK4ze5deejYa26/WRd3S5Ai5Rgfe1Nl2Xv+hM106UwkkiBvZENf9UT2 aBKQSKmPXbAIIX19TKsrw9sJGB8x3fOvr0YO1/F8aDsyF6w2Wia0jldliv/LnJSzrrbw ba+RhI1wDpul5hBVUsvpmcww6lAUbIl2CjlKja2/S6sO0Xd1OAZZRbZObUAQVYFd74uJ SeMyDAoQa9IjvUn5Yd+ZdCZqKTXvuAyO73COww2qTCHeurOgBnMECUp88yPus6qlpQ0E HQxcoIUjaUnBvd32Z/TY+gMhQNZDB8Wgjz8wAPqrcCM+41w7tHFJyV/SJwJuxv5SEmDH i2nw== X-Forwarded-Encrypted: i=1; AJvYcCVW8/vg1EgSgTpUiOtaj0+KcW4010CGo14/k5i3LqexfZ3XLFeUaxCuSYU7O7I71bIV7NcalMCfx+3lg49riVkU4hic0g== X-Gm-Message-State: AOJu0YzoqU1Lo++zxnE1jvApY54LR97bC8Im5buk/9hzalZNYSykD7EZ EWF/aj2ooQZfBXGSpM9qQciai5vmQItOgxbUMYg8TTOcHqGI93pTT93Y5aAgM7s= X-Received: by 2002:a05:6870:3048:b0:24c:54ee:a77e with SMTP id 586e51a60fabf-24c68e06f07mr3163921fac.35.1716420717701; Wed, 22 May 2024 16:31:57 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-6f0ec2e566dsm4758323a34.15.2024.05.22.16.31.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 16:31:57 -0700 (PDT) From: Sam Protsenko To: Tom Rini , Minkyu Kang , Peng Fan , Jaehoon Chung , Simon Glass Cc: 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 24/42] mmc: exynos_dw_mmc: Convert to use livetree API Date: Wed, 22 May 2024 18:31:17 -0500 Message-Id: <20240522233135.26835-25-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240522233135.26835-1-semen.protsenko@linaro.org> References: <20240522233135.26835-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 --- 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 34485311c107..84382c606a1f 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -7,9 +7,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -226,18 +224,19 @@ static int do_dwmci_init(struct dwmci_host *host) 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]; #if CONFIG_IS_ENABLED(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; }