From patchwork Sun Aug 25 16:47:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayush Singh X-Patchwork-Id: 13776835 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 D01EEC5320E for ; Sun, 25 Aug 2024 16:48:28 +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:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jwkJDd2+orcK4mtu4nJD6Uj2vRnYFfyrcCU5EsSQgTQ=; b=Xz3eTsR2dBTOJ/ MqFMi4ewFZEx2vvJMEfDtklizx3tNwLz1TEvGirhgcuD2e8bjj3jJrOvMFOZIQDSDv2zdSwzHeKJH DO8FImOUT/IlVaY6AsLCsAYZ3sytOPO5U8P0PZ79He8b0KE57/Cxcbwp+4hiMSN6Upy+1B4nnjs+z Khb+Mglo03WCyYN5v7Sneyc4XxDL+aGLaMYuURyM+GkPxpWlkxzZ4R+BP6A7EmPO2KGt2dBPYHH9c vw4faTJIhq0lEHO28AgqFzP2EDw5K8ZGZlKK8Of5kFRfEtKO8y0HIULFamaUW5eAlLCK9JHKrfYCi Sb2o7tuuIzLHf8AVAAJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siGPa-00000004fwh-17U8; Sun, 25 Aug 2024 16:48:18 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siGOg-00000004fhP-3dH8 for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 16:47:24 +0000 Received: by mail-pl1-x641.google.com with SMTP id d9443c01a7336-2025031eb60so30140495ad.3 for ; Sun, 25 Aug 2024 09:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1724604441; x=1725209241; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=jwkJDd2+orcK4mtu4nJD6Uj2vRnYFfyrcCU5EsSQgTQ=; b=etw2MpgsY4ZmlpU+nAa+1TvZ+DSZFuJO+6R+R3v3V1XyRwClXnPcvaeB+FJutnzb7q fxJqw6O+yYQoT7qUTO+bi6ogPRrxZ2Wnvq/uwWcfNAQUmIQMbHgUbmG7pbH04j0m8kdB ia6F02CCUqdDHg8LpEvYgmGKKAklowOI8abyRBpbkA4o7MdmOfVG1yTbfHPg93J5vEFT 7r8jKf/A6hiB8h6ZWZnadfzp7ld6J+fqWXE7XFY7gPQOHrlLFjdEH6FrtSXTNbmoywbM mqMDrDcshUGtP+FKbM9hZBDH2wvmLcYsBxJlgVwWl4TPn1AialpPhuu1KLyt/JtFcUI2 8cbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724604441; x=1725209241; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jwkJDd2+orcK4mtu4nJD6Uj2vRnYFfyrcCU5EsSQgTQ=; b=qi3aSOUTVJSDDoTMgU/iLHVWX/2qUAZpjdc/0QiX7P0i3E/MevbMfnF7WxIeI480sV kZqE0IPdxWmSuvQvvYfUdCoBHxTqhsr8AsLFvVkB/e332B0xfBa7sdNIYdwsvAoUTVyt hjDfW/VtYRSiMwb7CWkyxpksy0SW0p4rxGR3jBrZUS5E659VNNjbenZ8ftv3V7ct3ODB qBdjKD+2M9aVWT6PdaBekHqotQfkK3ECQs7F3XBnB/lpzDLQqrcLt+gNIUWLRg8claj5 UHEcMcsf2XQg3p17MPSLOVMM5coAR3UqPh4GfSbXtD6bK5xOLb314V+FoqzWXUiL8BiK Xhpw== X-Forwarded-Encrypted: i=1; AJvYcCWv7C/pacTPTGa53RT67nX0A8kzTyrvlhPCsiw6iXSsoOl3KNiGZnJ3hS22x6NGCa9+8wNHKC/x4u9Me7FnQU64@lists.infradead.org X-Gm-Message-State: AOJu0YxtlBZ4puJoURCVoGiTRbxQnDgufXkAGdQMn0iYOEXQXaA/dsa5 aIwWGEGpdjLgukwtOrmHgO/BVRIhdRl463YgIihudtumViyT4FRvMZ9WYGTjgg== X-Google-Smtp-Source: AGHT+IGUoNDaU5BtVxFVUeKLs3SX8LIv697nC5BrkumL6cO5K0BgHADqN4xtXahOQLjurs/znyMK4Q== X-Received: by 2002:a17:902:db09:b0:1fc:6a13:a39f with SMTP id d9443c01a7336-2039e48a2eemr111659305ad.25.1724604441343; Sun, 25 Aug 2024 09:47:21 -0700 (PDT) Received: from [192.168.41.46] ([2401:4900:5ae1:9eb1:890a:6b80:a16d:5ab4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20385609dddsm55411465ad.196.2024.08.25.09.47.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 09:47:21 -0700 (PDT) From: Ayush Singh Subject: [PATCH v3 0/3] Add Firmware Upload support for beagleplay cc1352 Date: Sun, 25 Aug 2024 22:17:04 +0530 Message-Id: <20240825-beagleplay_fw_upgrade-v3-0-8f424a9de9f6@beagleboard.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAAhgy2YC/3WNyw6CMBREf4XctTWlRV4r/8MQ0tJLaUIouVWUE P7dCmuXZzJzZoOA5DBAnWxAuLjg/BRBXhLoBjVZZM5EBsFFxov0xjQqO+I8qrXt3+1rtqQMskx i3nWouZEG4nYm7N3n8D6ayIMLT0/rcbOIX3oaS57+MS6CcYYyr0Spi0oYfT972isyV08Wmn3fv zfjrvLAAAAA To: lorforlinux@beagleboard.org, jkridner@beagleboard.org, robertcnelson@beagleboard.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Johan Hovold , Alex Elder , Greg Kroah-Hartman Cc: greybus-dev@lists.linaro.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ayush Singh X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2253; i=ayush@beagleboard.org; h=from:subject:message-id; bh=k0BeDYnqSBfodOslNY/mdXSjosr5XizIxqn3N69Vyj4=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBmy2AP/GQMSC238xGe6JdG69qWl4ZvxhBcxg6Os x8RIXGX2ZuJAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZstgDwAKCRAFzvXHieVa dLK7EADCfwwUW4dSX3kPDqJ4DkfS4rRcxs3EiuHQegFqfJKuG+S1c8ZBYlewQkECMKQwHztzs2S Mt+hHIinS5htx1+k0vhLrAixpkKEYKU3cv6auG2iCdz9/9oc36WQ+NWpTQ/tKQlUDwQ6B0dJmWk 7qLehY04zG2ni6rpXzilz97gYvrqmLwlOlZKc+K+4apZA/Rsbl8KIMzoE4oCZk1VbTp372q7MvS fHtQ1lOzvGtPgi+rHIZ9/sgAmOAHOcP+EHyBPWOqTdTgpwu3bH54yxlDnU2Xhzq5YjMSTjJvPE5 s9wR07rRo3gxmFo46EXjgU2NBsEuCkMq/+aWAg9v+DOWPLt3AeJlmdjB5ACD9nDpnUZfNoo5Kp5 Pp2q52F6J4kaB7END7Yci7GXCJVQL4phi5MuN09alQ59Cbhtb5jlsBWaXR+VG1cJlpATk12Baoy jQMG8qgOT6bjAmzPyE/SPvACY9j/OsYgN+VJ04bAHi+GINRaP7LnYOuMfKlUqb8F8WaNdMScShR K9B8i46wWsvG1Kz49la1NwYMx+/lXsTs/Xvj58cTXBEZJftdKvPUonRsF/ax0vnIqFFZKVyfLSW se2zs/50blyZW2966cOpRTbQue2BUYUfyahEaVBr+7UvqhtVPVosCN//XTFbsTjc5uNfmqTAXGn ew8ve264nE+ueGw== X-Developer-Key: i=ayush@beagleboard.org; a=openpgp; fpr=DFCC131EF24F2D656FA504D605CEF5C789E55A74 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_094723_196666_4F35D6E2 X-CRM114-Status: GOOD ( 14.11 ) 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 Adds support for beagleplay cc1352 co-processor firmware upgrade using kernel Firmware Upload API. Uses ROM based bootloader present in cc13x2x7 and cc26x2x7 platforms for flashing over UART. Communication with the bootloader can be moved out of gb-beagleplay driver if required, but I am keeping it here since there are no immediate plans to use the on-board cc1352p7 for anything other than greybus (BeagleConnect Technology). Additionally, there do not seem to any other devices using cc1352p7 or its cousins as a co-processor. Bootloader backdoor and reset GPIOs are used to enable cc1352p7 bootloader backdoor for flashing. Flashing is skipped in case we are trying to flash the same image as the one that is currently present. This is determined by CRC32 calculation of the supplied firmware and flash data. We also do a CRC32 check after flashing to ensure that the firmware was flashed properly. Link: https://www.ti.com/lit/ug/swcu192/swcu192.pdf Ti CC1352P7 Technical Specification Changes in v3: - Spelling fixes in cover letter - Add Ack by Rob Herring on Patch 1 - Link to v2: https://lore.kernel.org/r/20240801-beagleplay_fw_upgrade-v2-0-e36928b792db@beagleboard.org Changes in v2: - Spelling fixes - Rename boot-gpios to bootloader-backdoor-gpios - Add doc comments - Add check to ensure firmware size is 704 KB - Link to v1: https://lore.kernel.org/all/20240719-beagleplay_fw_upgrade-v1-0-8664d4513252@beagleboard.org Signed-off-by: Ayush Singh --- Ayush Singh (3): dt-bindings: net: ti,cc1352p7: Add bootloader-backdoor-gpios arm64: dts: ti: k3-am625-beagleplay: Add bootloader-backdoor-gpios to cc1352p7 greybus: gb-beagleplay: Add firmware upload API .../devicetree/bindings/net/ti,cc1352p7.yaml | 7 + arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts | 3 +- drivers/greybus/Kconfig | 1 + drivers/greybus/gb-beagleplay.c | 658 ++++++++++++++++++++- 4 files changed, 655 insertions(+), 14 deletions(-) --- base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7 change-id: 20240715-beagleplay_fw_upgrade-43e6cceb0d3d Best regards,