From patchwork Sat Nov 21 22:33:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1404377 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=eBdPxeAj; 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cdp9J745Mz9s1l for ; Sun, 22 Nov 2020 09:33:40 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 236B9825BB; Sat, 21 Nov 2020 23:33:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="eBdPxeAj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0F010825C2; Sat, 21 Nov 2020 23:33:34 +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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2EB4782573 for ; Sat, 21 Nov 2020 23:33:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from pali.im (pali.im [31.31.79.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5B01F2100A; Sat, 21 Nov 2020 22:33:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605998007; bh=H4kRCCVVH6mlToNCaczjVIJ0O2BB/kjyhoQ0kwMfY8g=; h=From:To:Cc:Subject:Date:From; b=eBdPxeAjtHydaHI71h1PuWazZ45+W/ZStTHm7UrqJ9b6OcmTx37yTu3gaWd72vjSM D45S23cphwXKahwhCwoAEEVkf3hEHdewOLm6s7asJCOboph89KdE4L886QsXQoQe6f VmUd1LeU9C2CZR6BGi7/I3MEmHZ3juk9JYER2+lg= Received: by pali.im (Postfix) id 06B1D890; Sat, 21 Nov 2020 23:33:24 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Lokesh Vutla , Peng Fan , Tom Rini Cc: u-boot@lists.denx.de, maemo-leste@lists.dyne.org Subject: [PATCH] Nokia RX-51: Convert to CONFIG_DM_MMC Date: Sat, 21 Nov 2020 23:33:17 +0100 Message-Id: <20201121223317.14347-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Move twl4030_power_mmc_init() from board_mmc_power_init() to misc_init_r() and disable CONFIG_SYS_MALLOC_F. Otherwise U-Boot cannot initialize MMC. Also disable CONFIG_CMD_SLEEP and CONFIG_DM_DEVICE_REMOVE to free some space. Signed-off-by: Pali Rohár --- board/nokia/rx51/rx51.c | 32 ++++++++++++++++---------------- configs/nokia_rx51_defconfig | 4 ++++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index 2dd41604c9..7390e5be65 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -415,6 +415,8 @@ int misc_init_r(void) /* initialize twl4030 power managment */ twl4030_power_init(); + twl4030_power_mmc_init(0); + twl4030_power_mmc_init(1); /* set VSIM to 1.8V */ twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VSIM_DEDICATED, @@ -686,22 +688,18 @@ int rx51_kp_getc(struct stdio_dev *sdev) return keybuf[keybuf_head++]; } -/* - * Routine: board_mmc_init - * Description: Initialize mmc devices. - */ -int board_mmc_init(struct bd_info *bis) -{ - omap_mmc_init(0, 0, 0, -1, -1); - omap_mmc_init(1, 0, 0, -1, -1); - return 0; -} +static const struct mmc_config rx51_mmc_cfg = { + .host_caps = MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS, + .f_min = 400000, + .f_max = 52000000, + .b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT, + .voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195, +}; -void board_mmc_power_init(void) -{ - twl4030_power_mmc_init(0); - twl4030_power_mmc_init(1); -} +static const struct omap_hsmmc_plat rx51_mmc[] = { + { rx51_mmc_cfg, (struct hsmmc *)OMAP_HSMMC1_BASE }, + { rx51_mmc_cfg, (struct hsmmc *)OMAP_HSMMC2_BASE }, +}; static const struct omap_i2c_platdata rx51_i2c[] = { { I2C_BASE1, 100000, OMAP_I2C_REV_V1 }, @@ -709,7 +707,9 @@ static const struct omap_i2c_platdata rx51_i2c[] = { { I2C_BASE3, 100000, OMAP_I2C_REV_V1 }, }; -U_BOOT_DEVICES(rx51_i2c) = { +U_BOOT_DEVICES(rx51) = { + { "omap_hsmmc", &rx51_mmc[0] }, + { "omap_hsmmc", &rx51_mmc[1] }, { "i2c_omap", &rx51_i2c[0] }, { "i2c_omap", &rx51_i2c[1] }, { "i2c_omap", &rx51_i2c[2] }, diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig index 6310a12aaa..0f05fe6fc3 100644 --- a/configs/nokia_rx51_defconfig +++ b/configs/nokia_rx51_defconfig @@ -29,6 +29,7 @@ CONFIG_CMD_BOOTMENU=y # CONFIG_CMD_SAVEENV is not set # CONFIG_CMD_ENV_EXISTS is not set # CONFIG_CMD_FLASH is not set +# CONFIG_CMD_SLEEP is not set CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y @@ -62,3 +63,6 @@ CONFIG_SPLASH_SCREEN=y # CONFIG_GZIP is not set CONFIG_DM=y CONFIG_DM_I2C=y +CONFIG_DM_MMC=y +# CONFIG_DM_DEVICE_REMOVE is not set +# CONFIG_SYS_MALLOC_F is not set