From patchwork Mon Jul 22 17:57:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 813764 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1986617wro; Mon, 22 Jul 2024 11:01:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWdzPBziv4zlkSXhMI59heoHMN6LWFYJszMJbwAXVzuVfKhkSQpdB7v9QsGpPBTG4SgLJYGZfPWHzxLnQ4VswIR X-Google-Smtp-Source: AGHT+IFEhNxxqN1F0sN+qv0k/zgvR/6KcUhirFB7rleBN0P94LP7tzJYNTu8Klwo9jxZy8MND9Fd X-Received: by 2002:a50:9b4a:0:b0:5a2:22f0:7f4e with SMTP id 4fb4d7f45d1cf-5a47a33a354mr4639805a12.16.1721671299582; Mon, 22 Jul 2024 11:01:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721671299; cv=none; d=google.com; s=arc-20160816; b=jmjGc8LUyoX6LGt0u+4UTcPgj3JwcTIIVl9Q3biaEWGbANeo4xIk2qtB9MSTmrO6uQ Qr5p6PiFFnAv5FDKoaAgmRZ+zgNAFuL/sXgKSUCCVmyx1Y9oZjsERJgzUiNz2LnOHlaB w6GK6uKlM2OwrsHKOGuBLYnfddrE/rXj98YtEwXCEGLju6LKlzcDr8/xuPrUj15sLRse Gcu8UKhDz8Fd3YAateAjYqtUSXjnOi4sKNfdUffuOGo5DPJlz5lskJWYFu/dY+FuIOEV uyl+wSYANP+oVgZp9xEzUEiUhgxpPh4xlc4q3N2xw+PPEBBuOTjCRB9onUDjKpMHqhep vQoQ== 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=/b5CybBjcPiiP7smg/py0/KgdE7Vq4Zga0bVxyrVDvQ=; fh=ZKUUNKhoKYqW2Coooby2CMMD1fexi4gP32qvfaL4lPg=; b=i0RXSYN2F87GgjbSVQ9greleYacaIlMMbvpc0cCyQqU8Fer9P0M7gokVXXLbpPRXud mBXTCX6YX7c6XCl4LIYYvAi6wwCgJQ8EsRNJo0jOUOddnDI4ITK3BOT/1B3gdSOcjEpj q+CGr+d9QqS/fXDplFMyonhQvSicJtikBJfunuAAwJ5UG6t29l+LkjzPPq3I1OlEj1gf HCJVk+rpCXRku5whb7oQ5yBLxBWxOTULqVv85eZL9GQEjv1XYYSDA0dmYbNTu7+gnmQh dJtGl0YPadXUqUJ26flcUv+vMqx2jyAARxZQ4yt3OACiq5s0/ZyNnkWEuL3lOlpGRlba 0JkA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K6c8z6aH; 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-5a30c2f4df9si4915345a12.442.2024.07.22.11.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:01:39 -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=K6c8z6aH; 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 B0029886F9; Mon, 22 Jul 2024 19:58:06 +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="K6c8z6aH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A7F588680; Mon, 22 Jul 2024 19:58:01 +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-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) (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 2816B885B6 for ; Mon, 22 Jul 2024 19:57: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-oo1-xc29.google.com with SMTP id 006d021491bc7-5d569bee00aso1210270eaf.1 for ; Mon, 22 Jul 2024 10:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721671078; x=1722275878; 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=/b5CybBjcPiiP7smg/py0/KgdE7Vq4Zga0bVxyrVDvQ=; b=K6c8z6aHp4wwr87E5DnKPoOoCPRE8H/zKtxbx3qqPN0jcS93i65ctBddzruyGlM1MR H8cOvdNCEkCCT4hGhghjDfJiqsbevtHrM6RXLSl5huMThLXQq+fjI7upE7EGRn9OTE+a JsmvQ4xcokbh13WGDXjNmN/0j0FlWxCF1aTEcmDlOREmLVd4kavPH5XXMC4B9ekZ1X4o aTRB7mH+0OOd9l4sFbuBOzTZEyuIbSg1T9hAo+KL2Tk9ANtJ7N3DSZPzs5MRifL0Aghr GdzNUJ3m3JYbIVLXgvETCjvOver3TY1phc3W5Ep5bGxhmUWoM3R2XWmzxrVmnOX3pztN OUsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721671078; x=1722275878; 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=/b5CybBjcPiiP7smg/py0/KgdE7Vq4Zga0bVxyrVDvQ=; b=vxbEOW1WFqfr/IHP/0PsmuWlMc/Cw4GXl0NYaKmVyYMg4y9F7uoRMxvYMpEH4DdLiB MoMVKJ2OvF359pBY4pZCCcd3ETJQYEbchLtiOP1Gcp58dmZnCrYnHEhlf0CijSttncWx gQFQNHB49rU1I4TG0JpMGjmkE/Kd5FdLbvmGKxdsH2FYwhey8cSQr/Y+jR814dVp5qZ/ Ivmew5iZyvlRWOC1nPqgyO5n89WrLt9EfHMvVq3at3iPfpN2faaDzD0N9s97XaQmsuWX IfcIMsIpoTv1BF5yJUMUMihHnfdCLxEqzdUoYEOAjY9CepcA2YyylA2heorF4ObJLg1A oWGA== X-Forwarded-Encrypted: i=1; AJvYcCUz1++e1rWTiBCjaYuAPVCV21S+CA4rCthKm6g7PbfKc4zz0gijkki2eyTfr39Fzs8l9Glc9ARIDNwCF0WYvBN52mpGig== X-Gm-Message-State: AOJu0Yx1s2DVaF8vSwkAZ8dmTbVQAkpYz2nIDF734i+sCNrxwYYt/IK2 SZWuXhsJ5aLztOn0JTsv1JVDMXyneCLXow59OmN9vSj85h+pgUdxg3v7fYNBfr4= X-Received: by 2002:a05:6820:88f:b0:5ca:581e:d604 with SMTP id 006d021491bc7-5d564eab6b3mr10090529eaf.2.1721671077841; Mon, 22 Jul 2024 10:57:57 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5d55a831d85sm1405389eaf.18.2024.07.22.10.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:57:57 -0700 (PDT) From: Sam Protsenko To: Minkyu Kang , Minkyu Kang Cc: Tom Rini , Peng Fan , Jaehoon Chung , 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 v3 22/38] mmc: exynos_dw_mmc: Convert to use livetree API Date: Mon, 22 Jul 2024 12:57:24 -0500 Message-Id: <20240722175740.6985-23-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240722175740.6985-1-semen.protsenko@linaro.org> References: <20240722175740.6985-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 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; }