From patchwork Mon Jul 29 07:41:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Schneider-Pargmann X-Patchwork-Id: 13744505 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6ABD6C3DA4A for ; Mon, 29 Jul 2024 07:43:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=+fG++Rp1WwVAjFqGrg10cLveRKjMmHByvEed2FpGCSg=; b=aA0bSEmFYQei5vnuHeis/3R1Z0 c65An1Qw7sP0JteSu987rrEeRG7mBS+yEgJIQsppNVRUrhQL5yXuv+hTN6BCXolq+KMXgdfauEB79 cG0e5nE18hg4E201WYCNty15lyGC/QhFM/4Kw1fnv7PPGngVAJ7KN+0/5iP5MJr5IdYUhskEQf8E9 P42piVXAArXHAl2yKCPopPSM6+Yx3QAcxX9ijx+IlTwkYwyuRIkHANbyFLYetPOOzb32843p9M1f9 d7lUenIEHgno5byo/bwXByohXd02fKD/MIBmP6FEFxei/jn161hgI+/OsQ8i63rjYZS1tTPNo6wSl HvbwYFZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYL1v-0000000AOQt-3q8W; Mon, 29 Jul 2024 07:42:51 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYL15-0000000AOB9-1kjt for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 07:42:02 +0000 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3683178b226so1016736f8f.1 for ; Mon, 29 Jul 2024 00:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1722238917; x=1722843717; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+fG++Rp1WwVAjFqGrg10cLveRKjMmHByvEed2FpGCSg=; b=V7YWSe6b83PNFXtxtm5IU0dxkE5V5Nt6PJnqG14GHzEb4dV05hMiCJ7IUD9HNpNaax e8ka75ruCzmRKKfr1KHeXmkTeb2JWDAF4IokP6tcfrY3ZRWqGAckkVXCxbJePvvhPsX4 2KdiLc1l+NgKE4hx0bnrcgmroMlUJrFq/rifM9c+JXZHKrxbQ/V+zhNOR9/DkakBXM+e 7ERHoNkDV5MlZTWXHhI6uK7Hc73k0xUFH9IXnWdhzLg6b5E+BXcmV5YH2brlkwP2XArw CnybHptPNm6RXG6MUduAHobDekksSY/IJOa6cPrqF8571gcUBORoGMsuhY6fyykMu4Ov DmIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722238917; x=1722843717; 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=+fG++Rp1WwVAjFqGrg10cLveRKjMmHByvEed2FpGCSg=; b=j50Vy/nVluUEIEd4X140gJ1z4UTRCwAszxd3wtUNLgMuBGcnEXNOM6faYcte1k74wi tqmZVLRHoiHWKOBEtTs5taA6ILWKZPjhZVRnofhs6d6mnR9A1Sn9u9u2lwTEGxtjXpnY Bzl0MzMLQO5dkwno2BOJN80p1szuz9Y1d2+iedU3AiENdLcgrRAcmljMvUS01wkFK7Is eTI2zmh2W1pCpPey9VqaPTCRPnW1sg5o+b3HQKi6nfzW09Hq1IZqZ5KkTJ746E5RJuW5 WXp3VcA/Yc67XUcQLKRdAwjP5yvXkMNADRZVfhl/MpzCTk4/Z+Ckug7ZmDTAqN6OZoX/ q5fQ== X-Forwarded-Encrypted: i=1; AJvYcCU2GsvEtPn0ZkRAZXvZDoa8+JgQtxxk11/GRCMhuHfVXuoi63hBLZShDmwNqInLKHFaKtn+8tw0Ty2NXGxkx+ETAPKcXd+4WzWlA10NM6552xbjR5I= X-Gm-Message-State: AOJu0YwjELW4Nk0hoRxoftaLiLe1RNSMJkw5Iy/Ncu3HsLIrOa/4sZHO i0/HCdPs+1HuJgCGBWVsmwSmBluco2K0ixHndg9oFjQUlr/546lmAeuLgW6WJM8= X-Google-Smtp-Source: AGHT+IFblJNxmGbt2ldL4Tt9ANm4+7yXmdnl1pp7GhCtq+KapS++Z5zXICBriDeelTZ8BAc59kEoNg== X-Received: by 2002:a5d:59a6:0:b0:368:71bc:2b08 with SMTP id ffacd0b85a97d-36b5cee3038mr4752651f8f.3.1722238917146; Mon, 29 Jul 2024 00:41:57 -0700 (PDT) Received: from blmsp.fritz.box ([2001:4091:a245:8609:c1c4:a4f8:94c8:31f2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b36863aa7sm11460879f8f.109.2024.07.29.00.41.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 00:41:56 -0700 (PDT) From: Markus Schneider-Pargmann To: Chandrasekar Ramakrishnan , Marc Kleine-Budde , Vincent Mailhol , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Markus Schneider-Pargmann , =?utf-8?q?Martin_Hundeb=C3=B8?= =?utf-8?q?ll?= , Christophe JAILLET , Michal Kubiak Cc: Vibhore Vardhan , Kevin Hilman , Dhruva Gole , Conor Dooley , linux-can@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 0/7] can: m_can: Add am62 wakeup support Date: Mon, 29 Jul 2024 09:41:28 +0200 Message-ID: <20240729074135.3850634-1-msp@baylibre.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240729_004159_576022_6F28FD53 X-CRM114-Status: GOOD ( 18.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, v2 --- In v2 I mostly fixed error handling in this series and rebased to v6.11-rc1. I also dropped the omap serial series for Partial-IO as it can't be tested with Partial-IO at the moment. The code was tested with other low power modes but they will be upstreamed later on. Series ------ am62, am62a and am62p support Partial-IO, a poweroff SoC state with a few pin groups being active for wakeup. To support mcu_mcan0 and mcu_mcan1 wakeup for the mentioned SoCs, the series introduces a notion of wake-on-lan for m_can. If the user decides to enable wake-on-lan for a m_can device, the device is set to wakeup enabled. A 'wakeup' pinctrl state is selected to enable wakeup flags for the relevant pins. If wake-on-lan is disabled the default pinctrl is selected. It is based on v6.11-rc1 with this series applied: https://lore.kernel.org/lkml/20240726195944.2414812-1-msp@baylibre.com/ Also available at https://gitlab.baylibre.com/msp8/linux/-/tree/topic/mcan-fixes/v6.11?ref_type=heads Partial-IO ---------- This series is part of a bigger topic to support Partial-IO on am62, am62a and am62p. Partial-IO is a poweroff state in which some pins are able to wakeup the SoC. In detail MCU m_can and two serial port pins can trigger the wakeup. A documentation can also be found in section 6.2.4 in the TRM: https://www.ti.com/lit/pdf/spruiv7 This other series is relevant for the support of Partial-IO: - firmware: ti_sci: Partial-IO support https://gitlab.baylibre.com/msp8/linux/-/tree/topic/am62-partialio/v6.11?ref_type=heads Testing ------- A test branch is available here that includes all patches required to test Partial-IO: https://gitlab.baylibre.com/msp8/linux/-/tree/integration/am62-lp-sk-partialio/v6.11?ref_type=heads After enabling Wake-on-LAN the system can be powered off and will enter the Partial-IO state in which it can be woken up by activity on the specific pins: ethtool -s can0 wol p ethtool -s can1 wol p poweroff I tested these patches on am62-lp-sk. Best, Markus Previous versions: v1: https://lore.kernel.org/lkml/20240523075347.1282395-1-msp@baylibre.com/ Changes in v2: - Rebase to v6.11-rc1 - Squash these two patches for the binding into one: dt-bindings: can: m_can: Add wakeup-source property dt-bindings: can: m_can: Add wakeup pinctrl state - Add error handling to multiple patches of the m_can driver - Add error handling in m_can_class_allocate_dev(). This also required to add a new patch to return error pointers from m_can_class_allocate_dev(). Markus Schneider-Pargmann (6): dt-bindings: can: m_can: Add wakeup properties can: m_can: Map WoL to device_set_wakeup_enable can: m_can: Return ERR_PTR on error in allocation can: m_can: Support pinctrl wakeup state arm64: dts: ti: k3-am62: Mark mcu_mcan0/1 as wakeup-source arm64: dts: ti: k3-am62a-mcu: Mark mcu_mcan0/1 as wakeup-source Vibhore Vardhan (1): arm64: dts: ti: k3-am62p-mcu: Mark mcu_mcan0/1 as wakeup-source .../bindings/net/can/bosch,m_can.yaml | 20 ++++ arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi | 2 + arch/arm64/boot/dts/ti/k3-am62a-mcu.dtsi | 2 + .../dts/ti/k3-am62p-j722s-common-mcu.dtsi | 2 + drivers/net/can/m_can/m_can.c | 100 +++++++++++++++++- drivers/net/can/m_can/m_can.h | 4 + drivers/net/can/m_can/m_can_pci.c | 4 +- drivers/net/can/m_can/m_can_platform.c | 4 +- drivers/net/can/m_can/tcan4x5x-core.c | 4 +- 9 files changed, 133 insertions(+), 9 deletions(-)