Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp248968lqd; Wed, 24 Apr 2024 00:32:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWwccOvq7p/Q7fh/nZ6D2gDVqkvrB6og/IoblqaZQQWFzSDe/vzcWy8al7IxInI4ggfoWhdwKE4CYjWO2d3z6vTUiFXd0DdIMJkE6eHQg== X-Google-Smtp-Source: AGHT+IG8Z/igNDzP9yxql1O7bPC3lvqt0B5CWH8GIpO0FcUBHGb5P0yyeLWoJVL+jhGirVcV5DxI X-Received: by 2002:a17:907:2d28:b0:a58:9a74:57fc with SMTP id gs40-20020a1709072d2800b00a589a7457fcmr391447ejc.15.1713943941298; Wed, 24 Apr 2024 00:32:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713943941; cv=pass; d=google.com; s=arc-20160816; b=EL5eYC9xyLj0MWPjeelt7wKmBduJX5YJgE534sEs9e2maA5lA2t+nb9n9MwYrSfwMz Vj8eIF8yiOngiNKNp3ShKR7o8YkyM2n6EMi0Y7nDcp7w0zYOL36Y+iWc8gxz8SFXXfyd r1XuTWwIrd9J1d7QSjoiGyWp7ju9vGSKPjRFGwv+zt4VFYF2v/kCS7Zyw1mfI+o8+B15 jB1ktxxqoIk0Z0+/CL3Bilpa8+PVPuIYlmczO0QxJvppYlKFe/JFMllK/4NIN+RKcFOR 9N5iH/sxPnewuxP2ncV5HdSIG9dIHj2Ud73nytozTQjFwu9BPodtvg4q6sbhuXW0PTn/ /mkg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ydbMWnucjNW5W0ihcxuue8zS6Y542TI1AxUBXYzljqs=; fh=mrAY/mZu8SIkTwz7jSfD79Obnhfvf56cEPaJsnxtOGk=; b=tGfkjMBWGFeCKWieNMuAjVHAYxMMvNWGOfnuVw2etfPyErP+5H5OzX78baNIv0uczt ZJXlnaYBTzQRs59kEzxZo08NE6T9WVIW0SRUEh9QCifZyF5V1PhzUMhGMBGdiVacyUon NFQVmpH13Pcrf9XAeaWPU2ll1TyNkVDpOBFqnaxB2jOGBu8kXm6vpq9zgoFCu6SrbbzF TxjEnlnDyIYPtTU2Ou1UFOhsjW+B1OCkXNNNzOWpTWoLMLMQVbxzE8ppA3FYGuTn9XLq AhL084o0vy3Q5UMvHgNm1bT5htr7wPgSwLlr2DY708aD6BsJoJNBOkVpdvt2oOKHtVzr Ikbw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=KLrHFgia; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-156490-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156490-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c27-20020a170906171b00b00a55b708ba3esi3348020eje.867.2024.04.24.00.32.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 00:32:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156490-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=KLrHFgia; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-156490-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156490-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1B2631F23E7D for ; Wed, 24 Apr 2024 07:32:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0BA3B157E82; Wed, 24 Apr 2024 07:32:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="KLrHFgia" Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4023C43AB4 for ; Wed, 24 Apr 2024 07:32:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713943928; cv=none; b=MeIyUMrCiS6ENl674jtiLsp31Ul2FxGmADQpB2IGfy80+iiVZHlkKb9raZ1fN9V7OwUpnqTdCPouDxkei5Ewf3jtYov4Lt6jGQJN1cyJ8rF7HlfX6t5iTv+fHF1UZujrvV2ZILQQlYYm4+VpS942v0UwK01ZZpDt1+LBuG2ogxk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713943928; c=relaxed/simple; bh=j3gUoUGa5ys9Ijh+sP8F7wcjNrsOzLt0nu0CtCgbBOo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Few+uWCncLmId4RQGLa/8dnSHHpdiRga/G0fpDv9+1pXgjZfV/V5kF01ctfLMGzv0HY4BWeBQwU6neOdgw7DdSrYBWvPKDWdtx898reifUUDcPcvQDDqkH35xEkAEFZb2U7EVgbWAH5BYJ8fIhtgUlNm9r8itbg97Y0KzyYcYB0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=KLrHFgia; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-41af670176cso3825855e9.0 for ; Wed, 24 Apr 2024 00:32:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1713943924; x=1714548724; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ydbMWnucjNW5W0ihcxuue8zS6Y542TI1AxUBXYzljqs=; b=KLrHFgiakx7lWRWkbl/1U1VFANXyUN8XF1QUhmk1+9bR/6Mu76PT1omBOizjq+Sp5K DTbwZSxTRdNEU4pxrv84F6FPMp/ON2LG34VDFcMwWRiuHQ9m7kUaF58Ovl98Pqk7TTvR uv8Kx6vT/hqoziPOKVLHQN7syVCVPJwvkJFjsW9RF5YE8DB02YeWpgkPKUCdhtFnxIos gN2sp9VplrTZSvOiXIlh7L8tQrIQP2onKO68Cwm0je992mf4WSq9Ip0eyQhZHTboPw3w geJzHB9AHPsQPKIWDMe5RqomnE9xijUAa6M8cbg0swYP6pOyZ4QpzB7VQgOXZ0UcA09N 9mHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713943924; x=1714548724; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ydbMWnucjNW5W0ihcxuue8zS6Y542TI1AxUBXYzljqs=; b=uq8CztP10i97naUS8o2TIlv7Ipl7A56VnHGo1D5Rm8eCwpvkMAavAWZDgEtaDXTvKX rtXsSjsn9VVmwUStcZ6EDh0YxgGH01pUXiaZAincrL1uf4T6Dadm6Y7J0YROeDFszhbf 0GpVcMnVaiVLKVXlG195x+xDVh99KE1n9o78p3OVolG8ZT5hyIP9bS2QFAzOAvvke58Y sPD2T4F883OiMrNmZjcJ1hf7cGN6dGf7UhpiSmQJYKy4J59txdS42rV6iXP1ty0jkvA2 Ysru3ZZW3bhtK5YCnwGKh5rbiLXb4eDkMIo7t4BFRDaMO1w0I/TpXvc8DSZAr0jA/HXh GhTQ== X-Forwarded-Encrypted: i=1; AJvYcCWTk8y6lyMuXVK7YzomLMT9fq5oJsuVcNbmumhxDo7W3joumogYP5YVM3DNz92Bv3sGL3q9RPhQOe5psXFQxjhyPjuLk5vwpHhTzt9+ X-Gm-Message-State: AOJu0YwiVIXq62oPoOJuA0ua56qgeV9riAQLuQwyPFYCM2qe1TSVe05R Sx+RDZ/L9vWbxMDCy9VTd2Y6zsHrjsLNVFNNVx9yA4g26RPNpOhS1sr+nRB8MC8= X-Received: by 2002:a05:600c:cc8:b0:41a:4819:ebf4 with SMTP id fk8-20020a05600c0cc800b0041a4819ebf4mr1607591wmb.39.1713943924231; Wed, 24 Apr 2024 00:32:04 -0700 (PDT) Received: from [192.168.50.4] ([82.78.167.53]) by smtp.gmail.com with ESMTPSA id v11-20020a05600c444b00b00418d5b16f85sm22712851wmn.21.2024.04.24.00.32.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Apr 2024 00:32:03 -0700 (PDT) Message-ID: Date: Wed, 24 Apr 2024 10:32:02 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 0/1] Timeout error with Microchip OTPC driver on SAM9X60 Content-Language: en-US To: Alexander Dahl Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nicolas Ferre References: <20240412140802.1571935-1-ada@thorsis.com> From: claudiu beznea In-Reply-To: <20240412140802.1571935-1-ada@thorsis.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi, Alexander, On 12.04.2024 17:08, Alexander Dahl wrote: > 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". Would it be possible that the OTP memory is not properly initialized and the algorithm to initialized the packet list to confuse the hardware? I see in the datasheet the following: "The initial value of the OTP memory is ‘0’ but the memory may contain some “defective” bits already set to the value ‘1’." Otherwise, from the top of my mind I don't have any idea on what might happen. Thank you, Claudiu Beznea > > 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