From patchwork Thu Jul 25 20:45:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 1964883 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; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=HEVZXp4f; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WVNJx60PGz1yXx for ; Fri, 26 Jul 2024 06:48:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6829E88701; Thu, 25 Jul 2024 22:45:45 +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="HEVZXp4f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F0B65884A7; Thu, 25 Jul 2024 22:45:39 +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-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) (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 97C488859B for ; Thu, 25 Jul 2024 22:45:36 +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-x32f.google.com with SMTP id 46e09a7af769-7044bda722fso184479a34.2 for ; Thu, 25 Jul 2024 13:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721940335; x=1722545135; 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=ZV+9/tuIYxOCUWV8xGDM20QwAQGvcpEliEOoPAYw3+k=; b=HEVZXp4fWtYLn1Gtv5T/SHJl8wKxrh9UkgsT8Kp+K2+cupXxV5iSezq+CmLls3n+iv aMnyH8RnX0EgeS8tXxCRynCGEZvcvCA73gaG6XI3Zs19GiWeM9UqLTss9XzfCO0YR5iq 9mAGMep0lCc7934Qc2hls8Yxm462Mi1JKBEvlyC++Xy5JCOMkNbqwEXSQXP5ruptE5px cwz/o5AT59N3lUODuk+wnPV14HglUVd1twxujTwpPU6ESf+/uECHJvrTvCBr8BS2l2jq vzR4wgwqvKvUqizmsEd9eOBfpCsNY2hoABhkWehsn07L5UnXPH0pV1dfu22xoGjkuyQi vlvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721940335; x=1722545135; 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=ZV+9/tuIYxOCUWV8xGDM20QwAQGvcpEliEOoPAYw3+k=; b=WE6szn7ky7oHo4Mt/R4S/80SsxldHZg/kYNm1i8Wz0yXikN67tveMrjkmg95ML0YMW l651W0t3KaMVRdfX0T1jGfrNGYoBuhlKAM2FZCAhSZOloPGANIT0evNfkFmfhhJ8oHBm HXpvq2CFWJL2UsXdUAP34/XhReUDkyfDyjMDfHHlYvh7RxsiEcXmifPc/EK8YaKMSlfp ehrMmVglG/hU2Ytp4R/CclEXXUEVlW9e/MXQAyNbTLAT7ENsPyzpMKLEMiaOYvdDjz3g j5ClsF33OT81ay5R07oAgwtKHUdaQgAnGttmdBD1t3HhWZL5mfn8LAj0GSpJ+V2pH+Xq V+xA== X-Forwarded-Encrypted: i=1; AJvYcCWQPZOK2l/ua3i+qdisgDF4W8doH2vtiz+onq3KOonf9t8hjgJF5nKnq4zopOqAFqSX8GjXxF2v73yohzDM896Ao76QUw== X-Gm-Message-State: AOJu0YwclZVeGjTzABbQoozu/Fd3l15iFlK6UyLoHuyD0ReQp7+YzOYX JkWlw2/ErGOQNx5IXCBAYDbaDB+jH+tqO9ZCk6bb0WUK/pKACiWpaNnptTfqXuA= X-Google-Smtp-Source: AGHT+IHFlwrLin1ugKy9Vs4knqlc0Kiy/zz6rzqFNt8V1zgQz4FRDfSa6lHfayJXJl+QzEM1LK1Eyg== X-Received: by 2002:a05:6830:6286:b0:704:4d36:f450 with SMTP id 46e09a7af769-7092e6bcef8mr5031737a34.9.1721940335376; Thu, 25 Jul 2024 13:45:35 -0700 (PDT) Received: from localhost ([136.62.192.75]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7093050a657sm459573a34.13.2024.07.25.13.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:45:35 -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 19/38] mmc: exynos_dw_mmc: Don't call pinmux functions on ARM64 chips Date: Thu, 25 Jul 2024 15:45:01 -0500 Message-Id: <20240725204520.18134-20-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 Pinmux configuration on ARM64 platforms must be performed during startup in pinctrl driver using info from device tree. exynos_pinmux_config() and pinmux_decode_periph_id() are only available on ARM32 platforms, so don't call those functions on ARM64 platforms. Instead of the latter function, use "non-removable" property from device tree to derive the dev_index value. This fixes next linking errors on ARM64 platforms: ld: drivers/mmc/exynos_dw_mmc.o: in function `exynos_dwmci_get_config': undefined reference to `pinmux_decode_periph_id' ld: drivers/mmc/exynos_dw_mmc.o: in function `do_dwmci_init': undefined reference to `exynos_pinmux_config' Fixes: a082a2dde061 ("EXYNOS5: DWMMC: Added FDT support for DWMMC") 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index aa542c13fea8..ed2752391603 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -144,6 +144,7 @@ static int exynos_dwmci_core_init(struct dwmci_host *host) static int do_dwmci_init(struct dwmci_host *host) { +#ifdef CONFIG_CPU_V7A int flag, err; flag = host->buswidth == 8 ? PINMUX_FLAG_8BIT_MODE : PINMUX_FLAG_NONE; @@ -152,6 +153,7 @@ static int do_dwmci_init(struct dwmci_host *host) printf("DWMMC%d not configure\n", host->dev_index); return err; } +#endif return exynos_dwmci_core_init(host); } @@ -163,6 +165,7 @@ static int exynos_dwmci_get_config(struct udevice *dev, const void *blob, int err = 0; u32 timing[3]; +#ifdef CONFIG_CPU_V7A /* Extract device id for each mmc channel */ host->dev_id = pinmux_decode_periph_id(blob, node); @@ -174,6 +177,12 @@ static int exynos_dwmci_get_config(struct udevice *dev, const void *blob, printf("DWMMC%d: Can't get the dev index\n", host->dev_index); return -EINVAL; } +#else + if (dev_read_bool(dev, "non-removable")) + host->dev_index = 0; /* eMMC */ + else + host->dev_index = 2; /* SD card */ +#endif /* Get the bus width from the device node (Default is 4bit buswidth) */ host->buswidth = fdtdec_get_int(blob, node, "samsung,bus-width", 4);