From patchwork Fri Apr 12 14:08:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 13627809 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 82F3CC4345F for ; Fri, 12 Apr 2024 14:08:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To: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=D0Bv+jX2IE6Zl5Iupm38zE//qiqrL01/MLwk2vWAakI=; b=I3P53XKxuS6aId nSXr9ZZsAcjDXe2Epe03SDDxD1xNiTTuhqRehRaphXOtbz5wcVfGfAQkYH+APvRDNXvX0V+GSJRak C6KjARaK0MMIDdmvOu7oZkgpyYFVKkiVzXlu6yp54LpIaKz+bMF8DpTPyIoC4/PwUN58XkSxEWHJW DU7LiHHSFGGF1z/ehDXMxUuWC22nMeuQgQaY/qPFa8ddhB6IcZ2PO5OucBt3jr4dSQMqc39yC3nQ4 ik26ZDFv6A7jVtcxHxwIrOHjtNrMuBCXiZ0I0FONDZ/ywEw1qur1HabsjyIBmISs/EgJxyVsfbtlJ ko51ru4nNVtSXyuokx4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvHZm-0000000HUDx-2QM8; Fri, 12 Apr 2024 14:08:22 +0000 Received: from mail.thorsis.com ([217.92.40.78]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvHZj-0000000HUAl-0I4q for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2024 14:08:20 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 3BF3F148CE9A; Fri, 12 Apr 2024 16:08:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1712930889; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding; bh=WLfHwsGrJHJq3LO7YBJMataqBAqil/ftcquuEZ8C9D8=; b=lDvs6aoOH8P3GV5jx+e4L9FwX2dtdR8gGXN1QQxipIvmBzuYh+Up2LU79cLAMQ4z/gDD8a K760o+fWczxKS8P3X9J1wFC2FC+dVVKIvaJh+mM1iyzr7uUqJVrobJHePIvNaX1oHQ9im9 GWCxo6v0CcMXoBxsLovdzjx/kkfPuObnAdG2ruNJgwtEX05wggGQp13tj4UW/Gh/q08K67 Cxj+7wdBN+NKzMFXcfaPWHjlsRl2RCIeamjKOBnPD4hVs5V+ifQMop4E3augI8DnSMK4zQ K21whhg49adPfEZqTe73Hdz3nhnmLjnKcnvg7CluxzlhDOlzdoLxSTFSAKocNw== From: Alexander Dahl To: Claudiu Beznea Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 0/1] Timeout error with Microchip OTPC driver on SAM9X60 Date: Fri, 12 Apr 2024 16:08:01 +0200 Message-Id: <20240412140802.1571935-1-ada@thorsis.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240412_070819_370252_61B713A4 X-CRM114-Status: GOOD ( 13.76 ) 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 Hei hei, on a custom sam9x60 based board we want to access a unique ID of the SoC. Microchip sam-ba has a command 'readuniqueid' which returns the content of the OTPC Product UID x Register in that case. (On a different board with a SAMA5D2 we use the Serial Number x Register exposed through the atmel soc driver, which is not present in the SAM9X60 series.) There is a driver for the OTPC of the SAMA7G5 and after comparing register layouts it seems that one is almost identical to the one used by SAM9X60. So I thought just adapting the driver for SAM9X60 should be easy. (At least as a start, the driver has no support for that UID register, but I suppose it would be the right place to implement it.) However it does not work. I used the patch attached with additional debug messages on a SAM9X60-Curiosity board. (That patch is not meant for inclusion, just for showing what I've tried.) On probe the function mchp_otpc_init_packets_list() returns with ETIMEDOUT, which it can only do if mchp_otpc_prepare_read() returns with timeout and that can only happen if read_poll_timeout() times out on reading the Status Register. Poking that register with `devmem 0xeff0000c 32` gives 0x00000040 which means "A packet read is on-going". Kinda stuck here. Any ideas? Greets and have a nice weekend everyone Alex Alexander Dahl (1): nvmem: microchip-otpc: Add support for SAM9X60 .../dts/microchip/at91-sam9x60_curiosity.dts | 4 ++++ arch/arm/boot/dts/microchip/sam9x60.dtsi | 7 +++++++ drivers/nvmem/microchip-otpc.c | 16 +++++++++++++--- 3 files changed, 24 insertions(+), 3 deletions(-) base-commit: fec50db7033ea478773b159e0e2efb135270e3b7