From patchwork Fri Feb 10 12:23:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 1740444 X-Patchwork-Delegate: jh80.chung@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=lcobpzmh; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PCtFf1XC7z23qt for ; Fri, 10 Feb 2023 23:24:06 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D530285FA0; Fri, 10 Feb 2023 13:24:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1676031843; bh=MqEhnTVmcPc4jCLuTjnMkb+P7uGNPOfe+mI5MJOhHTs=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=lcobpzmh1b/pbVKobdInYFFzCPyeQ80cy+o3rEA1LU25mX9BXXyo3yh11JbRkxVgM GZqhQMcbXdW3QMytjofmXzmzSNS7XuP7VzHEzB18LHNTjIFxt2TM8HLyGpN4xwV81U 7qO3IfVn/84r4B3JGoe988xJ7m2CPUI9qedvgMy6yv2aWALDKxUW4VrCLOPYYqyAhQ eMaQ3smwZssIqF3j5hKsjg3pehPgn40H/skdwHdvzlgEapf+vlCoE4PDvW0tKoptoO ud8ngHRbLqY8ZehJU7XK2Chl6wqgd1gsLhHqLCZKas4RZ0LuTeBmrYtOORapBydhGl RVoSikq56fYWQ== Received: by phobos.denx.de (Postfix, from userid 109) id D549B85FAB; Fri, 10 Feb 2023 13:23:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NEUTRAL autolearn=no autolearn_force=no version=3.4.2 Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:101:465::204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4710F857E4 for ; Fri, 10 Feb 2023 13:23:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4PCtFR0jrgz9sWn; Fri, 10 Feb 2023 13:23:55 +0100 (CET) From: Stefan Roese To: u-boot@lists.denx.de Cc: Tom Rini , Simon Glass , Peng Fan , Jaehoon Chung Subject: [PATCH 1/3] mmc: mv_sdhci: Simplify call to sdhci_mvebu_mbus_config() Date: Fri, 10 Feb 2023 13:23:50 +0100 Message-Id: <20230210122352.1214847-1-sr@denx.de> 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.6 at phobos.denx.de X-Virus-Status: Clean This driver already depends on CONFIG_ARCH_MVEBU, so there is no need to have some checks for this Kconfig symbol in the driver itself. Let's remove these superfluous checks. Signed-off-by: Stefan Roese Cc: Tom Rini Cc: Simon Glass Cc: Peng Fan Cc: Jaehoon Chung Reviewed-by: Jaehoon Chung --- drivers/mmc/mv_sdhci.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/mv_sdhci.c b/drivers/mmc/mv_sdhci.c index 336ebf141026..50d03b703ed7 100644 --- a/drivers/mmc/mv_sdhci.c +++ b/drivers/mmc/mv_sdhci.c @@ -64,10 +64,8 @@ int mv_sdh_init(unsigned long regbase, u32 max_clk, u32 min_clk, u32 quirks) host->ops = &mv_ops; #endif - if (CONFIG_IS_ENABLED(ARCH_MVEBU)) { - /* Configure SDHCI MBUS mbus bridge windows */ - sdhci_mvebu_mbus_config((void __iomem *)regbase); - } + /* Configure SDHCI MBUS mbus bridge windows */ + sdhci_mvebu_mbus_config((void __iomem *)regbase); return add_sdhci(host, 0, min_clk); } @@ -103,10 +101,8 @@ static int mv_sdhci_probe(struct udevice *dev) if (ret) return ret; - if (CONFIG_IS_ENABLED(ARCH_MVEBU)) { - /* Configure SDHCI MBUS mbus bridge windows */ - sdhci_mvebu_mbus_config(host->ioaddr); - } + /* Configure SDHCI MBUS mbus bridge windows */ + sdhci_mvebu_mbus_config(host->ioaddr); upriv->mmc = host->mmc; From patchwork Fri Feb 10 12:23:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 1740445 X-Patchwork-Delegate: jh80.chung@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=Pbm5A6E1; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PCtFs4bhBz23qt for ; Fri, 10 Feb 2023 23:24:17 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2DB4385FAD; Fri, 10 Feb 2023 13:24:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1676031854; bh=TawwSe4H+sm5INOiYz2BRTDFPm7IHJIj4rJH5wpJ66E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Pbm5A6E1uqRE5PmkHAfea+dNlUibYm9BLvKjBwSxY7AUo7MfF4y28/8WuRz46m9Ft tJRuca5Uw8Y2YOWbcQVo8jU6g+tIJqvxF/S14pUlvBdnUtbvQO5vxc+TbDKvfmoR5d h9U+x+8B6aARr3tuL1cCDGvkOXSyDyb5indlHPrTRbKeJ/PEqs2Ioy6rflRgt5+k0K qVAA7mYuPG3UECOfZv3Rz7kWNiXMmiG6Y+aJltpJ6PnpxWMFeeO/gJ4v9i3n+8BhGy DCMZibQr1hvla5eCskKNR2NouR2yy/OZxobhMMiWCnY/+/xB6vIMBC0pxoJGSrCfCK r+KkAnKg/EbMQ== Received: by phobos.denx.de (Postfix, from userid 109) id 21092857E4; Fri, 10 Feb 2023 13:24:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NEUTRAL autolearn=no autolearn_force=no version=3.4.2 Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:101:465::204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A5C4585FA0 for ; Fri, 10 Feb 2023 13:23:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4PCtFS32DZz9sWs; Fri, 10 Feb 2023 13:23:56 +0100 (CET) From: Stefan Roese To: u-boot@lists.denx.de Cc: Tom Rini , Simon Glass , Peng Fan , Jaehoon Chung Subject: [PATCH 2/3] mmc: mv_sdhci: Remove CONFIG_MMC_SDHCI_IO_ACCESSORS support Date: Fri, 10 Feb 2023 13:23:51 +0100 Message-Id: <20230210122352.1214847-2-sr@denx.de> In-Reply-To: <20230210122352.1214847-1-sr@denx.de> References: <20230210122352.1214847-1-sr@denx.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4PCtFS32DZz9sWs 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.6 at phobos.denx.de X-Virus-Status: Clean CONFIG_MMC_SDHCI_IO_ACCESSORS is not supported and/or used by this driver so let's remove these unused parts completely. Signed-off-by: Stefan Roese Cc: Tom Rini Cc: Simon Glass Cc: Peng Fan Cc: Jaehoon Chung Reviewed-by: Jaehoon Chung --- drivers/mmc/mv_sdhci.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/mmc/mv_sdhci.c b/drivers/mmc/mv_sdhci.c index 50d03b703ed7..42fa735f3160 100644 --- a/drivers/mmc/mv_sdhci.c +++ b/drivers/mmc/mv_sdhci.c @@ -42,10 +42,6 @@ static void sdhci_mvebu_mbus_config(void __iomem *base) #ifndef CONFIG_DM_MMC -#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS -static struct sdhci_ops mv_ops; -#endif /* CONFIG_MMC_SDHCI_IO_ACCESSORS */ - int mv_sdh_init(unsigned long regbase, u32 max_clk, u32 min_clk, u32 quirks) { struct sdhci_host *host = NULL; @@ -59,10 +55,6 @@ int mv_sdh_init(unsigned long regbase, u32 max_clk, u32 min_clk, u32 quirks) host->ioaddr = (void *)regbase; host->quirks = quirks; host->max_clk = max_clk; -#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS - memset(&mv_ops, 0, sizeof(struct sdhci_ops)); - host->ops = &mv_ops; -#endif /* Configure SDHCI MBUS mbus bridge windows */ sdhci_mvebu_mbus_config((void __iomem *)regbase); From patchwork Fri Feb 10 12:23:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 1740446 X-Patchwork-Delegate: jh80.chung@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=sy5W6azS; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PCtG43ZlGz23qt for ; Fri, 10 Feb 2023 23:24:28 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4E22D85FB9; Fri, 10 Feb 2023 13:24:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1676031859; bh=ZbaBzkWgairCFNOUKURfEBnP6cCErEblw+QToNM0WvM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sy5W6azSsm7+A77+WCCjdMMFml+JE6iq87a/IU0GTQtzd4VYThFqO+Ra5A7ei+O8V hrkmDD6ozyWbwxxfPX53Z2jMz1HOeO5GtgQmnl/1flDAN+QnoRXrY2hkPI2Q9NapG1 +ts/XV+u0NaNeU51zHNOrNYPAMRByXw5wRbbfPrwgaDf79q5KrSblQa/afhRjBcktc yexq3kHgxZeZT0ckrK8Zihyvn1YDtsr2DYvE+CYA4oaaHMP/GEYxe0rt3vRLHAnOBr 1eYQj4dwdv6ADx6QpNqD0A/CZ65NgVv/7/Kx52S4qPivPZxm6wQuC9Hp/trT7evPCs QKyiaFdXMxHjw== Received: by phobos.denx.de (Postfix, from userid 109) id A996A85FA1; Fri, 10 Feb 2023 13:24:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NEUTRAL autolearn=no autolearn_force=no version=3.4.2 Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [80.241.59.204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5DA6A85FA8 for ; Fri, 10 Feb 2023 13:23:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4PCtFT02RJz9sWx; Fri, 10 Feb 2023 13:23:57 +0100 (CET) From: Stefan Roese To: u-boot@lists.denx.de Cc: Tom Rini , Simon Glass , Peng Fan , Jaehoon Chung Subject: [PATCH 3/3] mmc: mv_sdhci: Depend on DM_MMC Date: Fri, 10 Feb 2023 13:23:52 +0100 Message-Id: <20230210122352.1214847-3-sr@denx.de> In-Reply-To: <20230210122352.1214847-1-sr@denx.de> References: <20230210122352.1214847-1-sr@denx.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4PCtFT02RJz9sWx 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.6 at phobos.denx.de X-Virus-Status: Clean All build targets using this driver already use DM_MMC. So let's depend this driver on this Kconfig symbol and remove the non-DM driver part. Signed-off-by: Stefan Roese Cc: Tom Rini Cc: Simon Glass Cc: Peng Fan Cc: Jaehoon Chung Reviewed-by: Simon Glass Reviewed-by: Jaehoon Chung --- drivers/mmc/Kconfig | 1 + drivers/mmc/mv_sdhci.c | 39 +++++++-------------------------------- 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index 878f867c627b..3f5f61503fb6 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -621,6 +621,7 @@ config MMC_SDHCI_MV bool "SDHCI support on Marvell platform" depends on ARCH_MVEBU depends on MMC_SDHCI + depends on DM_MMC help This selects the Secure Digital Host Controller Interface on Marvell platform. diff --git a/drivers/mmc/mv_sdhci.c b/drivers/mmc/mv_sdhci.c index 42fa735f3160..dbdd671c88bc 100644 --- a/drivers/mmc/mv_sdhci.c +++ b/drivers/mmc/mv_sdhci.c @@ -15,6 +15,13 @@ #define SDHCI_WINDOW_CTRL(win) (0x4080 + ((win) << 4)) #define SDHCI_WINDOW_BASE(win) (0x4084 + ((win) << 4)) +DECLARE_GLOBAL_DATA_PTR; + +struct mv_sdhci_plat { + struct mmc_config cfg; + struct mmc mmc; +}; + static void sdhci_mvebu_mbus_config(void __iomem *base) { const struct mbus_dram_target_info *dram; @@ -40,37 +47,6 @@ static void sdhci_mvebu_mbus_config(void __iomem *base) } } -#ifndef CONFIG_DM_MMC - -int mv_sdh_init(unsigned long regbase, u32 max_clk, u32 min_clk, u32 quirks) -{ - struct sdhci_host *host = NULL; - host = calloc(1, sizeof(*host)); - if (!host) { - printf("sdh_host malloc fail!\n"); - return -ENOMEM; - } - - host->name = MVSDH_NAME; - host->ioaddr = (void *)regbase; - host->quirks = quirks; - host->max_clk = max_clk; - - /* Configure SDHCI MBUS mbus bridge windows */ - sdhci_mvebu_mbus_config((void __iomem *)regbase); - - return add_sdhci(host, 0, min_clk); -} - -#else - -DECLARE_GLOBAL_DATA_PTR; - -struct mv_sdhci_plat { - struct mmc_config cfg; - struct mmc mmc; -}; - static int mv_sdhci_probe(struct udevice *dev) { struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); @@ -123,4 +99,3 @@ U_BOOT_DRIVER(mv_sdhci_drv) = { .priv_auto = sizeof(struct sdhci_host), .plat_auto = sizeof(struct mv_sdhci_plat), }; -#endif /* CONFIG_DM_MMC */