Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7047EEB64D7 for ; Tue, 20 Jun 2023 23:21:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AA7DF84723; Wed, 21 Jun 2023 01:21:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="Q0uV4hLi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EB8728468A; Wed, 21 Jun 2023 01:20:58 +0200 (CEST) Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) (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 45C1684723 for ; Wed, 21 Jun 2023 01:20:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mibodhi@gmail.com Received: by mail-yb1-xb32.google.com with SMTP id 3f1490d57ef6-bcc29cdcdc9so5283907276.0 for ; Tue, 20 Jun 2023 16:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687303255; x=1689895255; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=x+Y5SkEkxfb05KsFIDKlo30BGFWi7rOrHihISN4gf4U=; b=Q0uV4hLiR2VMrzgkkW1hHsiK0dUOAG4A9Xt232HEuL8O57p9bIb21+SRBsSugbQyDY kOMPf0/ivYyGsgT8M1iGb4f1a1agKeITa2bIbpYVuS6apONjYoKRVxPu6yWGAB7dMHO6 ekRXDRq+abRQTjxiyzId2Zp6HvHZjd/4orxSg/ZLIEEBuan/he2o6WNEx/84yVFjZTy0 0xErYP7xYXSs4tce/TLMF8V3dvW+zxXH4k4DgyMZllF/uR5DsZbhMML78C0a+y9jifnh j0tG6obqzpbunOsZAMwHkCzt80dv2V7vtBW7Oq3be66nOhTAxciL6lc1vccHOn3Nv3rG tfJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687303255; x=1689895255; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=x+Y5SkEkxfb05KsFIDKlo30BGFWi7rOrHihISN4gf4U=; b=NSld7oqNhyloanhZjQL3leay1b4GE80wsGtJdeQadRLX6/qaDgm59unkCwbyKENaq+ oQ3GATx4uKEiBhBU6fIhKxVcUjmauAEMH99JEGo2b2n+GYChn0eMdvtZsXLWJDKVlRpm jrLFnmd99sRrJoLiUcKZl9wu2uvZuecQTrarzBAyv/90dcMXZmOYxReYMtHayOFqVji/ MXFiaBVa3wkGpT9m+96pLR6y4YOe2uUfVfprNnELGxw18f0wMiAfAuggw+oJAPLScyXD 4HAPw9XzP/PoSnXH2MrAISkhPbqpWo5N7atemVvN4CUcRE4efcnaBPUPVtFsfez2r4yP FLog== X-Gm-Message-State: AC+VfDz8Mde72GHpug3CvevVDdQzKQhs44vd4aqniVJVjhFGBw+kF2aL WGAjaMlFsibg1r/wYkyZAZrfMDte2QE= X-Google-Smtp-Source: ACHHUZ48rRrmdYvz4VhsIDGDfdUM4XxNH8H5fV6nu2dPX7fkjGne9ScaMSahcmN6HXCxSu3mhBTFLw== X-Received: by 2002:a25:868b:0:b0:bf5:3c03:25f3 with SMTP id z11-20020a25868b000000b00bf53c0325f3mr4776812ybk.63.1687303254885; Tue, 20 Jun 2023 16:20:54 -0700 (PDT) Received: from localhost.localdomain (76-229-100-169.lightspeed.irvnca.sbcglobal.net. [76.229.100.169]) by smtp.gmail.com with ESMTPSA id t6-20020a25c306000000b00bc8ae5e206csm623513ybf.51.2023.06.20.16.20.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 16:20:54 -0700 (PDT) From: Tony Dinh To: U-Boot Mailing List , Stefan Roese Cc: Tom Rini , =?UTF-8?q?Pali=20Roh=E1r?= , Tony Dinh Subject: [PATCH] arm: mvebu: Enable gpio-fan for Thecus N2350 board Date: Tue, 20 Jun 2023 16:20:22 -0700 Message-Id: <20230620232023.27816-1-mibodhi@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Add gpio-fan in the DTS and enable the GPIO in board file to start the fan during boot. Note that this patch depends on https://patchwork.ozlabs.org/project/uboot/patch/20230606214539.4229-1-mibodhi@gmail.com/ Signed-off-by: Tony Dinh --- arch/arm/dts/armada-385-thecus-n2350.dts | 15 +++++++++++++++ board/thecus/n2350/n2350.c | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/arm/dts/armada-385-thecus-n2350.dts b/arch/arm/dts/armada-385-thecus-n2350.dts index 2ad5158c0c..253cf01130 100644 --- a/arch/arm/dts/armada-385-thecus-n2350.dts +++ b/arch/arm/dts/armada-385-thecus-n2350.dts @@ -140,6 +140,16 @@ }; }; + fan { + compatible = "gpio-fan"; + gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>; + gpio-fan,speed-map = < 0 0 + 600 1 + 3000 2 >; + pinctrl-0 = <&pmx_fan>; + pinctrl-names = "default"; + }; + usb3_0_power: v5-vbus0 { compatible = "regulator-fixed"; regulator-name = "USB3_0_Power"; @@ -378,6 +388,11 @@ marvell,pins = "mpp17"; marvell,function = "gpio"; }; + + pmx_fan: pmx-fan { + marvell,pins = "mpp48"; + marvell,function = "gpio"; + }; }; &sdhci { diff --git a/board/thecus/n2350/n2350.c b/board/thecus/n2350/n2350.c index fd8f95f944..05b125fd7f 100644 --- a/board/thecus/n2350/n2350.c +++ b/board/thecus/n2350/n2350.c @@ -25,7 +25,7 @@ DECLARE_GLOBAL_DATA_PTR; #define N2350_GPP_OUT_ENA_LOW (~(BIT(20) | BIT(21) | BIT(24))) #define N2350_GPP_OUT_ENA_MID (~(BIT(12) | BIT(13) | BIT(16) | BIT(19) | BIT(22))) #define N2350_GPP_OUT_VAL_LOW (BIT(21) | BIT(24)) -#define N2350_GPP_OUT_VAL_MID (BIT(0) | BIT(12) | BIT(13)) +#define N2350_GPP_OUT_VAL_MID (BIT(0) | BIT(12) | BIT(13) | BIT(16)) #define N2350_GPP_POL_LOW 0x0 #define N2350_GPP_POL_MID 0x0 -- 2.39.2