From patchwork Tue Sep 3 09:32:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayush Singh X-Patchwork-Id: 13788434 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 963ECCD3420 for ; Tue, 3 Sep 2024 09:46:36 +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=GX275WkLtFvp4P0H3VEJOqlKsL5ASXMh+yrpYY3jjm8=; b=K2KPFGAaqrxnb4 5YaFeVdyFCVO4uWdvJGITrJ577aej4W8kZQMmog4Mkfq11XDmY0ls2E1dl8oU4gFSd+tdjg4RbfBl xi/PssH1i4Vzm6UllO5KdEtAiuFuljXcePZ+gLxR4FxvDVkJjeLs3tX3jFoU7SWd9fEIArjRhDcL0 rSZs2ZvZTLTZ7KouZrl3ooaxHFEubdIKotTWA5JBrJU51IKx43PYm0oO8JxloccVF4/+7b3sYYKqb PJifvru4hjGPfXpQ+4BFsso6hJvgCfrA1OTAok3En7j3EY/ys8wLM1La5XPbq8Dhr5bEvmpeiE5Ma AvjWW4NoDAtRY2HZ/nFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slQ7G-0000000HEJj-0jZk; Tue, 03 Sep 2024 09:46:26 +0000 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slPuI-0000000HAiz-3Il0 for linux-arm-kernel@lists.infradead.org; Tue, 03 Sep 2024 09:33:04 +0000 Received: by mail-ot1-x344.google.com with SMTP id 46e09a7af769-7094641d4e6so1813225a34.3 for ; Tue, 03 Sep 2024 02:33:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1725355981; x=1725960781; 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=GX275WkLtFvp4P0H3VEJOqlKsL5ASXMh+yrpYY3jjm8=; b=f8ExezLfKovezXHXJx/Ltsb6OkNCCw+wpjtlGi9nxtBLrvO6W5AY6BzIYMC5S6LeTT RdL7CxnPrsKMDVd6nEs3r0faZikCgSOwX/4eVYpaOhtOm5K/J4xX3beDsO8215Gr/RBG Tlcmrc+JlalUvg7moPXSCqkN13LcgTxtJd00ZveWY3o/443UfbvmreycUZOBM9xFKxEE 1wFSLbrNzZSNGkjR4HeYYAyDuiV1p72W3IFlBsIUDX3EiIrdwIzHUaOHJkrvbJEXM1ro Ths8NPqsbfLuwlVjt9llQKlekNbY/O3iN/HawMp8STzVVSn+Cif1bxavRm4cSJ29bEWD Zktg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725355981; x=1725960781; 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=GX275WkLtFvp4P0H3VEJOqlKsL5ASXMh+yrpYY3jjm8=; b=j6JivUwPrtKLRSpK7fyy6VyiA5cFWWNLYPzsZ5AkeguFrRYb0Cv7jQTSrSAF1xkS+w r1UW9GbKzwMZqOf/DymI3VLKoqpaZseNPb39NRCp1MjceNnjnYYOTAfbF728FUiU4kHv XbuyB/5Je1rER6tpl49/9ndUIuZXZeOXzAT1GF0RMDOIaVoLc1RNffHNHO1HQzVnlM5r g562eqFFMI+CI6NreiOJhjBDUtt8GEJffWNRNut4BaC6+kRRFavBEgOX0/tDKwUJzGiK mvrivrdAe+mOWa02TU3FYvnpqui/Z8g8cRZzMAOsl1Jvi04bnRFG4Nd/b8T7XIwBsbO6 0L0g== X-Forwarded-Encrypted: i=1; AJvYcCU7bitnXC83vTr6R0jwIKcRY8cBjAajk6/MaA8Xa0+dt5fc7/XJhfExzOGXQdJKFTT+FP2lYEId0uYA3CErIf0W@lists.infradead.org X-Gm-Message-State: AOJu0YzBBi8afrtNOw6l5dB6YVKYbqFyAExK4m7VtRgpTAbvjqYxGl+7 PJWiiNqumQP/BOh7pHwOj8oMMmpxY8Azh/b8j+kuuOJFaOWvQSClMRTxfssbRQ== X-Google-Smtp-Source: AGHT+IHNAlXlP35WDQ/hjPG0ZhGzmWv5PTEpbHeyt1YwNX8aCYlzjyVLC0Eo1ipif9Q1+hnKTpuh+g== X-Received: by 2002:a05:6358:7e90:b0:1b5:c544:23a8 with SMTP id e5c5f4694b2df-1b7edb4ae07mr1390862855d.11.1725355980994; Tue, 03 Sep 2024 02:33:00 -0700 (PDT) Received: from [172.22.57.189] ([117.250.76.240]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-715e56d72d1sm8365868b3a.170.2024.09.03.02.32.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 02:33:00 -0700 (PDT) From: Ayush Singh Subject: [PATCH v4 0/3] Add Firmware Upload support for beagleplay cc1352 Date: Tue, 03 Sep 2024 15:02:17 +0530 Message-Id: <20240903-beagleplay_fw_upgrade-v4-0-526fc62204a7@beagleboard.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAKHX1mYC/3XOTQ6DIBAF4KsY1qVBoP501Xs0jQEZkMSIgZbWG O9e1E2TxuWbzPtmZhTAWwjoms3IQ7TBuiEFfspQ24nBALYqZUQJ5aTML1iCMD2MvZga/W5eo/F CAeYMirYFSRRTKHVHD9p+Nvf+SLmz4en8tJ2JdJ3uYkXyAzFSTDCwoqaVLGuq5G3fk054dXbeo NWN7MeiR99FlqxKc8pFraDWxb+1LMsXuxdpzwwBAAA= To: d-gole@ti.com, 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 , Conor Dooley X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2448; i=ayush@beagleboard.org; h=from:subject:message-id; bh=RkS5AVf/vdM06VdBh/pNZ142u7DJAZMa3GzPOEWQgE8=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBm1tfD/vBXyGsCpKZy+AgleCzE/caFt0oMppSdH xhZlfoywt6JAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZtbXwwAKCRAFzvXHieVa dFpJEACfw8pLANXVXWW4dt1Ioldn8TmvpqvIqaKqWvzfuNi+tKll5YvE1o1H/kSTEqsiZrjM0MT 3iuxrSqyBGTHWsP/8R5B/YMEJcT/Jhf01wr9fswejixbCA+Lyh+OlA4xdRGmWb3fUZ0UAgvp06o 5SNgvSyA5dUJpKQKuH3ZYImu2DEZhA4UGxZLUtn9H9MomDcENGl8C+lO5E3LL1RhVR79Y0m8Ibe u1h32l56kGTc0axW020mJ5Qc9R+8Daau61UOALhI+ntLf9n/8EfG8/T/3t2HcQTVamHSog3A/1P lWmU6L4QQjVRJx+eNxcmqUnR+AcBlrigd+/7NPmqyuOAsfKnroLxeed6ShLAWGG8FMZNXCKBMqr 0o9IuC+pzLXfk4LrEStfk43oIlqd1Trl9KQbuWPPNcArFDhU+aYoOHrsd35Oc5MYyJE6r/qGZRL 1o5f3QiRFFoqJSN+v7JaxD4zcK+iVkrqokP5C23F3n6qdXKeGpVdUieg7KzGn8K79QIC17Gwd9j R9vlKuUoz1pC2npEXsr0hDr2sKjiTkvP9kXAUEdFAg9GyKR/LuxkkOCrzWAYy3LcW7jiBZ7Or9a uybSiQ4Swgj3strtRmsoET3zm3oZyRfewEvgYoyZfTyA1a+AYq61lzNJtv7ZXiyXiSS7S0OAE0z snjvKIoWaGJ9DLg== 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-20240903_023303_030323_0988D519 X-CRM114-Status: GOOD ( 14.93 ) 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 v4: - Add acks properly - Fix Kconfig warning by adding select FW_LOADER - Link to v3: https://lore.kernel.org/r/20240825-beagleplay_fw_upgrade-v3-0-8f424a9de9f6@beagleboard.org 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 | 2 + drivers/greybus/gb-beagleplay.c | 658 ++++++++++++++++++++- 4 files changed, 656 insertions(+), 14 deletions(-) --- base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7 change-id: 20240715-beagleplay_fw_upgrade-43e6cceb0d3d Best regards,