From patchwork Wed Jul 31 18:51: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: 13749057 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 302D6C3DA64 for ; Wed, 31 Jul 2024 18:54: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: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=VEfk5ncIt83x7m+YjdXKWTAuZRXipE5lQH8P1TgSxxk=; b=rWhuJezZ+2pdVT tTeeq+8o1zOecYCu+TSH2y+ZjA5zgRKQLI6ypiebLYteYwN8kKW0YPwjb1NKibzbI/uIdCDJjhfJ2 2sY6XM+eaVhssBHdn3D5vRCr+Pm86F/BhMb640huWSN+i7ZAsCISHTeVKn4lO+kV5+R4WS0+IoBGk j5PCjOO/0n3VYaaRNZ5/5UoChqRrYEkx4+f1SfTi9X37OxJ7hluKaHZiTbozHiU4GiiKLEess3nW7 HG7VcfgMcRF3HDRfho8nKkDTvnCbtq0oQZ+gswsybwkhqZceW7LxNazBELTOU+NGHOdPGXyk7a+Cf q7eNzi1GIKfGSffYMwgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZESF-00000002B2B-3HBv; Wed, 31 Jul 2024 18:53:43 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZERj-00000002Ase-1lNr for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 18:53:15 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1fd8faa28fdso2426485ad.0 for ; Wed, 31 Jul 2024 11:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1722451990; x=1723056790; 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=VEfk5ncIt83x7m+YjdXKWTAuZRXipE5lQH8P1TgSxxk=; b=BXs1kF+D7vGLBHDCMOtgHTlBac0xXr1b0wPk03wbqSlvONCix1dxsQ5xspYHq1fZAI rvUIqpjDIQ1lb76d6YhjCpi8d4w9Apn9cW3I5umsvbMd1wId3K6i1rz/hkvX4mqWJ/pd il6410SjzQABtX5ntX9BTLA+YX/HdXymsPpM1/E7tj35xYZ8nMjSvOp0Z7fHq3aMtb4l hMtYfxEp6+d8N2sFn4A5BTMpgELuZB1ZCji0EKks5i3SpurhNpWOpqe4NFP5i1xV5lRN 9WTRTb2RftGlgSE57/CxQ+EfSURlbyNNGTsNvx00bT3sKwiJGzfAxnODMbuHYS5Zn9ae 5mKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722451990; x=1723056790; 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=VEfk5ncIt83x7m+YjdXKWTAuZRXipE5lQH8P1TgSxxk=; b=LyBsFdHwIdzwK8ja3+UFW88fNhQYSH8RhWee7B/jXw4EAxaVXYhzst2I1d5IiXiQ7k 7NotDG75D+jWLuGEwGLFBNq7bOTttmE6IQJ5khaekhZGAGU9qEjv6iyGRshuaiJpyvX/ OHhcSefNT1hel2ZmTgcr7BkhFvJIizLPwBJN/6FB27fvqoBY+JTXDf9d1YLHJCy5D3lb 54+dwyS+S7WW8NdmQ2QPzdbI7AeRrokJ0rLtpR85HMo9JviaYB0LougKBAvL7z9UBPLj pbZouEnLCcF7ehaaoI2YUji1+6uqHYq2P0QKUS+j05/9BH+Ip3b+d3XLZy/0p6oDwURz SJdA== X-Forwarded-Encrypted: i=1; AJvYcCVSncSYsrCYqY2oIXesro5CV9iNrwyj/XLQXFgC2zXPVmQVWcJEzo4diJgmA1mMqpl437wg85JaMPK17Rq0+mmT@lists.infradead.org X-Gm-Message-State: AOJu0YzQSChPCabBvD3a0upfLbsjTzBrRCVDzcrReEelDWlJNXQq/9/y i8gbS8fKWW8hjbKqtXJcvXTA1c8d3nS3pmEjGdf84JB6Yn41AFUCH31e2UqZIQ== X-Google-Smtp-Source: AGHT+IEd+Xm0W4rzAj9Ge+Z6pqWDl86lXrzFgFPRiCGmSEioNJ82NKUarMvpuVJei24NUE3crSe5NA== X-Received: by 2002:a17:903:22c9:b0:1fc:4377:d946 with SMTP id d9443c01a7336-1ff4d2715e7mr1565605ad.7.1722451989787; Wed, 31 Jul 2024 11:53:09 -0700 (PDT) Received: from [172.16.118.4] ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fed7ff3d64sm123182825ad.299.2024.07.31.11.53.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 11:53:09 -0700 (PDT) From: Ayush Singh Subject: [PATCH v2 0/3] Add Firmware Upload support for beagleplay cc1352 Date: Thu, 01 Aug 2024 00:21:04 +0530 Message-Id: <20240801-beagleplay_fw_upgrade-v2-0-e36928b792db@beagleboard.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAJiHqmYC/x3M2wqEIBRG4VeJfZ3g2AnmVSLE9M82RInSiejdR +byu1jroYTISPQtHoo4OPG2ZqiyIDub1UOwyyYlVS27TyNGGL8gLObW06n34KNxEHWF1lqM0lW OchsiJr7+33543x+DqvWwZwAAAA== 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=2062; i=ayush@beagleboard.org; h=from:subject:message-id; bh=KMCuH83HN8KlHmBA/0LgLY6pB6mLwm5fk9j8iVVPqmY=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBmqogPi0vwzJBN8N67/Uo/+Auvt6abDVkOuhzE9 sWnqSJIZnaJAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZqqIDwAKCRAFzvXHieVa dFhYD/4n6dksvaVAzW8JNYa3TZa9J6e/KJlomwxI2vZ+cHEleryRg4eHJWbVwYmT3wUuOjen1rS dSUKVQNkNO4Y6rnuyzcgvDKibNcmt+92wfMbzv6d5Z8bEn57FFH8menncGCzQ6L38NrTkc6TSID jeO9z14XniNECUluww6/xP46PgLmX+L0+ofZSkgqTi+rSJXOQH2CS3tfm8IKD/OwEzwGkF6LKeI 1RGhIz/ouzeb+jR0+l6Vb5zDlwpc1mnjAKcE6sw85BgAGWa+4ZkuJGzdwiE0KzuYWE8Q6uOBO99 kGoeKkWzZe+ungbu/psrCgVMiuyUXjMRsS+WCI1otwbhIynu8qdomoijTKpUwxYCEQtmlI+wMTL Bh2mVBGFe5wqpHw8VFlPIKTr/JTIpB94ONzjx17ACLheHE9EVZgiHwwMejOn0nQM7bDJot29Rk8 MShJBN5VlbXNC9TUGvsWIZfCTR1mywoqdJTUG0talE7h06cHzKTml7y1fchuxWUllzkCNHB01ny EM/GWiiS0dsLm4yZE4CVA+Rg3LAXdNs9ohJtwgaP7a0iinKrffC3jFOvXV7TKN9FqQu464zXPaT HcLQBY3DZ+roJDxxpbFK7XuCrXNntH6uzdRn7pt54oie9uiak5fp8hZ2yk1EPR494ceGypvqa7W fqZBwz+jBHy4QGQ== 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-20240731_115311_757974_7EF5E922 X-CRM114-Status: GOOD ( 13.81 ) 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 it's 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 Tecnical Specification Link: https://lore.kernel.org/all/20240719-beagleplay_fw_upgrade-v1-0-8664d4513252@beagleboard.org/ Patch v1 Changes in v2: - Spelling fixes - Rename boot-gpios to bootloader-backdoor-gpios - Add doc comments - Add check to ensure firmware size is 704 KB 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,