From patchwork Thu Jul 25 20:45:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 814405 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp567534wrn; Thu, 25 Jul 2024 13:50:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW0O2pH11SSyMncFF4ie/eeLM1U0g9w6d9m1cfByReq3lkDureJaKbqAG39+7UUU3MF0iHqNqMn3nhBIoZ8MIJ2 X-Google-Smtp-Source: AGHT+IFPppikhLkPcVvb9+aX+B5VJLAr5I5xXPwLzPS1P1yv7VE/v5BQ5JjCKsuiEZILtIUgy0Ma X-Received: by 2002:a2e:a0d1:0:b0:2f0:2068:f2a with SMTP id 38308e7fff4ca-2f039d5771bmr24180501fa.40.1721940626361; Thu, 25 Jul 2024 13:50:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721940626; cv=none; d=google.com; s=arc-20160816; b=hvEq8B9uF8Glm7BQhb21ksPNjdevT+zRhmmKwy9ynvHQPNiFir7Y7AsO0Lyq08Bcrm 9xue9jC63Fjt1CTFB6mqKFBsGopfDRfXB2mLYfJuZ4vBX51536k5ntrmxBrXVtlXnqWn N+3ogcX10rAWRXEQDDQmW+7gjpS9uDYSA1Sy/0h/WQQ7LDxaRVObvVTiLUowpIgL45m2 9/P+obkciKvUwSwunhHqC6Wd2lJ437R/qKTM4gWz3JBh3bFhFHNQNIiIPd96vZFtuhKL zWTK17XR4DeQn8PxV8+JnUg0WO/Hqoqzy3Cm6dnB9KGi9Bk7yZoVj8W9p/SCGAzBfpwC 3ryQ== 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=+iLLvBrcSO5LDuLUnqkfH2NnCX+IOR7efyeAaSsh4M0=; fh=38Zfqwyk8YwmoGMZx7ROtFX6d7qj4a4AqMqHtT+gHDQ=; b=zATm5KvJhcxtQnCthd97Bv7zPRanmyg9r19eOJl4Y+y6hMSEjMS1rV2WEosrTQKyEf KWFE9rSSYka3Rlfs/CzDSRBaldSWphPud6TFLBWvX0JS3Zvs79mwfYLq3ieiSeqfHfHP G3EFE+/rgj/wMUWY+kYwiYBy8/bQeDyw2ypfqTl2puudv/ESbf5t1KRD/rVYHDehGHV6 nZI33ZCurkzORNUg1ssZGjpOGSki0Qj62lBPNaLeyN4CwBPawfywvadry+a4cp/Y1StE ggSTgxY5jDR7b6z1Sg5Hft3WL2ILdN8bWDYUSFOcDg3dRgGAnW/HyP9PPbJ8M/vE8uEN 4jcg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D27TE+3e; 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-2f03d13b9c2si6235831fa.318.2024.07.25.13.50.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:50:26 -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=D27TE+3e; 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 638B28871A; Thu, 25 Jul 2024 22:45:55 +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="D27TE+3e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 817A788708; Thu, 25 Jul 2024 22:45: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.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-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) (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 5AC02885E4 for ; Thu, 25 Jul 2024 22:45:43 +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-x331.google.com with SMTP id 46e09a7af769-7092fb4317dso293278a34.0 for ; Thu, 25 Jul 2024 13:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940342; x=1722545142; 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=+iLLvBrcSO5LDuLUnqkfH2NnCX+IOR7efyeAaSsh4M0=; b=D27TE+3eQBSlU8alX97A2gha9LVVZfx/5oZuFViCB4kmgtZOBsjowA6W1N+WRXr7ug 7jtzssRuLcSLy7FR7lgmNBVcCFrWnNo5et2DHdGwbtgPRxcmYQTgTQ/rczv3lnFjGWx4 50VyfTW/ZU0xdrq/09FI5cszYJzs7XEqMlVo8uKSrg69sOgTVTaTKkPi52fGTzWIRkxq yRBAmItEtnu1zximFyZrQwX0gmop5ZI8UPFJcKeXijsDMAFQTiat5rvpZonjLaXwhsXT WWrih29L2iEm8pcQOoeKKR5YAzhARcvBp74+YVJyidPFoQ+BozLmOTHqjuCj5tWYDChA DDZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940342; x=1722545142; 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=+iLLvBrcSO5LDuLUnqkfH2NnCX+IOR7efyeAaSsh4M0=; b=rM4Ydd1juC9N5SlXGuhwHAfnoS1UyHuVcj+60F4ChGLHd7/Y2Tu9/QTNP81oiijv/U mT1FB8jtj1FrpSeVhDCWP2ZAZmKJwo+3N/9KKGtTrMvmug/SBV9WGdKDZ6EbLo9tOC5X 7C2Gv7ktn7Z8G/b94bdNTtRZbCtYsVSoIJzwqIgEqo/sTlbiXcUthaYKFWA/A61t7wsa aTqz/9uxaD3aeorkTv1nUrNykE8JnHYlvlsmgD7MFiZLxC9s95nACbfPcQIibOOqDvL1 zf81zU8IpKAvNIsvaIJhV2v6VB+wFoG8xR84hV2ZJBqhJGGaBEV26SxFIPh4RTyPYWgD 6y9A== X-Forwarded-Encrypted: i=1; AJvYcCWsxizjxnkoqjfDbAaiKYY5qv/A8AtKjHyKUFbRwlS1uGU1NGSLAT/u8E4XLG0bcHJAHlrlVV3jXzLUf4fxIcqFbbQ4ug== X-Gm-Message-State: AOJu0YzISJQzTTI+3teE1C5r4ccBLDfJQUTXbV3GE4rTI+h1kmeoM0cc Ydskj39k/NzsCYLjUVLtZfvKE7xuIsSX0BkXK1VzezK3NCGg2284dHcseQn0MrQ= X-Received: by 2002:a05:6830:6014:b0:703:5d37:7387 with SMTP id 46e09a7af769-709324ea60bmr4125338a34.30.1721940342073; Thu, 25 Jul 2024 13:45:42 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930778451sm452717a34.61.2024.07.25.13.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:41 -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 28/38] mmc: exynos_dw_mmc: Move quirks from struct dwmci_host to chip data Date: Thu, 25 Jul 2024 15:45:10 -0500 Message-Id: <20240725204520.18134-29-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 host->quirks field is only used internally in exynos_dw_mmc.c driver. To avoid cluttering the scope of struct dwmci_host, move quirks field into Exynos driver's chip data, where it can be statically defined. No functional change. Signed-off-by: Sam Protsenko --- Changes in v4: - (none) Changes in v3: - (none) Changes in v2: - Replaced CONFIG_IS_ENABLED() with #ifdef drivers/mmc/exynos_dw_mmc.c | 13 ++++++++----- include/dwmmc.h | 5 ----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index bed8bd8a0fcf..b9d655c0d5c8 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -25,6 +25,9 @@ #define EXYNOS4412_FIXED_CIU_CLK_DIV 4 +/* Quirks */ +#define DWMCI_QUIRK_DISABLE_SMU BIT(0) + #ifdef CONFIG_DM_MMC #include DECLARE_GLOBAL_DATA_PTR; @@ -39,6 +42,7 @@ struct exynos_mmc_plat { struct exynos_dwmmc_variant { u32 clksel; /* CLKSEL register offset */ u8 div; /* (optional) fixed clock divider value: 0..7 */ + u32 quirks; /* quirk flags - see DWMCI_QUIRK_... */ }; /* Exynos implmentation specific drver private data */ @@ -173,7 +177,7 @@ static void exynos_dwmci_board_init(struct dwmci_host *host) { struct dwmci_exynos_priv_data *priv = exynos_dwmmc_get_priv(host); - if (host->quirks & DWMCI_QUIRK_DISABLE_SMU) { + if (priv->chip->quirks & DWMCI_QUIRK_DISABLE_SMU) { dwmci_writel(host, EMMCP_MPSBEGIN0, 0); dwmci_writel(host, EMMCP_SEND0, 0); dwmci_writel(host, EMMCP_CTRL0, @@ -205,11 +209,7 @@ static int exynos_dwmci_core_init(struct dwmci_host *host) } host->name = "EXYNOS DWMMC"; -#ifdef CONFIG_EXYNOS5420 - host->quirks = DWMCI_QUIRK_DISABLE_SMU; -#endif host->board_init = exynos_dwmci_board_init; - host->caps = MMC_MODE_DDR_52MHz; host->clksel = exynos_dwmci_clksel; host->get_mmc_clk = exynos_dwmci_get_clk; @@ -352,6 +352,9 @@ static const struct exynos_dwmmc_variant exynos4_drv_data = { static const struct exynos_dwmmc_variant exynos5_drv_data = { .clksel = DWMCI_CLKSEL, +#ifdef CONFIG_EXYNOS5420 + .quirks = DWMCI_QUIRK_DISABLE_SMU, +#endif }; static const struct udevice_id exynos_dwmmc_ids[] = { diff --git a/include/dwmmc.h b/include/dwmmc.h index 8c2500da9efe..6edb9e1a59c5 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -149,9 +149,6 @@ #define DWMCI_IDINTEN_TI BIT(0) #define DWMCI_IDINTEN_MASK (DWMCI_IDINTEN_TI | DWMCI_IDINTEN_RI) -/* Quirks */ -#define DWMCI_QUIRK_DISABLE_SMU BIT(0) - /** * struct dwmci_idmac_regs - Offsets of IDMAC registers * @@ -180,7 +177,6 @@ struct dwmci_idmac_regs { * * @name: Device name * @ioaddr: Base I/O address of controller - * @quirks: Quick flags - see DWMCI_QUIRK_... * @caps: Capabilities - see MMC_MODE_... * @clock: Current clock frequency (after internal divider), Hz * @bus_hz: Bus speed in Hz, if @get_mmc_clk() is NULL @@ -200,7 +196,6 @@ struct dwmci_idmac_regs { struct dwmci_host { const char *name; void *ioaddr; - unsigned int quirks; unsigned int caps; unsigned int clock; unsigned int bus_hz;