Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp177157lql; Fri, 12 Apr 2024 07:16:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXcL8EpHS8T6fqPq7gKsvM/qeOWOFN5yooZ9LhBhQH2gyqGnvjmxZiqUEON3ZMjE6reJ04SWVrpKMHIgCUNnhgFhvJcA7ruq1/gWeuycg== X-Google-Smtp-Source: AGHT+IEYFQtcVeYXJ0APLBZvUQM3oCbgMFv+XvUX2AfxDfv5suz8OofdvFbA3XOpBVxFWdRGXU7u X-Received: by 2002:a05:6e02:1906:b0:36a:a78:f72f with SMTP id w6-20020a056e02190600b0036a0a78f72fmr3368878ilu.11.1712931365386; Fri, 12 Apr 2024 07:16:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712931365; cv=pass; d=google.com; s=arc-20160816; b=x52QKGdY1LtjkR+C0+vHRK9Tiu7ekaGzNn01MZw0OtmrWnMgerauYl97ypYVdznQSI QzlSCVe2hHD2hKt8rUI/2lWXrmKkO+NJzJh1lcIxvJA0NdYPj2VaRBQ1Z/AJenkS7QIi 2d5KhPYX2N5X7GXrI3T32nTi676an36gfUT1fjsd+FFmwpapdc2sMGoaAfpk0i1CS2ba DjVFw32jppHBaQJlq7oeL6Zgsg8ZoB0xcvMzcQj5RgpbNFRDpNCozYDnxn8bQPVw6cIm /WoPZnuVldbFuOqVYWco+rGkbs2HCs0iP38mxAj9KDxPi9R+pHDusT7l4b7DILqY6qZ4 0ajA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=WLfHwsGrJHJq3LO7YBJMataqBAqil/ftcquuEZ8C9D8=; fh=KBkdLo3XpNJAXqy7qE5+HnlAAFpk63xdUa34ZgyBlxg=; b=JYzYOYP7Paa27MvF2UUQkt84rBIPrpzlhEbn9fyQBeTtNrAp1u1Xs2AEOS7Z24/nLR spTVYn/h6sFDeg3Et6r1b0qmNjOpH8rrjWTSdO2g9/XmK19LH8htWkjN1NtufMDqEDcu g1k7fPp3qqPmJ5j2d42fnskJQjZhQGMrjBQwMYi+JrYkJ6CnKOgHcwusY8oEoeTnGTd4 iD6Ms5FwTMDl7V49++eXqRGLuhqeKeJp7M602d/SOnP5Bp0ig1h0rm93Mib+dG2ycQCq 33PstvmNy3GlKiNCKSfKTAxbyfDVgKPucm5o0Xv1rE12Ih5qPFxy22Ya4BcuQTlgJfgh fGnA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@thorsis.com header.s=dkim header.b=lDvs6aoO; arc=pass (i=1 spf=pass spfdomain=thorsis.com dkim=pass dkdomain=thorsis.com dmarc=pass fromdomain=thorsis.com); spf=pass (google.com: domain of linux-kernel+bounces-142799-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142799-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=thorsis.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h7-20020a63c007000000b005d8c5595ddbsi3219947pgg.271.2024.04.12.07.16.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 07:16:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142799-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@thorsis.com header.s=dkim header.b=lDvs6aoO; arc=pass (i=1 spf=pass spfdomain=thorsis.com dkim=pass dkdomain=thorsis.com dmarc=pass fromdomain=thorsis.com); spf=pass (google.com: domain of linux-kernel+bounces-142799-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142799-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=thorsis.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E17AD285D07 for ; Fri, 12 Apr 2024 14:16:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C59A86146; Fri, 12 Apr 2024 14:15:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=thorsis.com header.i=@thorsis.com header.b="lDvs6aoO" Received: from mail.thorsis.com (mail.thorsis.com [217.92.40.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC10583CDB for ; Fri, 12 Apr 2024 14:15:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.92.40.78 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712931358; cv=none; b=UyzYZkVuU5TzedSVrG+bJT4zMuM1DrEZEU5/QVIGMTgR7T/EgSaYwiKhFPadrAGUiaI1ML6aXtn3BgHtWLM6sVQVpytoLzLBs9s4ODciC49APGsN08DjPhT78mKpdhMzJn9h0LcYL2NCPt14LR4w/OJPR1vLyeC1p2QdmAFHqpM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712931358; c=relaxed/simple; bh=LxXBm44a9SVfKzjdCdWLoMucjG/P7bLziiYfipcg0bc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=f/Gm34gM2pM0EkmMOKHE+Qf+h1ZIeXTCB0t1x9Ti0PBpw5N7EIaUJ13PU57B5HnAaAbAFT8VRvQMDIgGNMw7W69BHJ9LPO4afWXXEPrsRBm3lrs0Db8DKNgQqmXwqvnri+PpejgJc2XcX5evKUsc6rJJtw2wfpcp/H1ZLzfRtYs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=thorsis.com; spf=pass smtp.mailfrom=thorsis.com; dkim=pass (2048-bit key) header.d=thorsis.com header.i=@thorsis.com header.b=lDvs6aoO; arc=none smtp.client-ip=217.92.40.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=thorsis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thorsis.com 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 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 -- 2.39.2