Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp250061img; Mon, 18 Mar 2019 02:12:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEt4hdvvTRcvX4nsd7FHiONjVT4w/xk1c2WjHZaNmULDJtv40Spa+J+OHNXUzrJN96GcV0 X-Received: by 2002:a63:e813:: with SMTP id s19mr16480515pgh.12.1552900359290; Mon, 18 Mar 2019 02:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552900359; cv=none; d=google.com; s=arc-20160816; b=Wnh6yNbN53EQE7gZoBs9McfBRGphnNKPsxa5aU/u4fjuSYdR06CS0HnxAeTjKkPPuO ai7g7uW/9XJIRzjBKEbJpIjNbgHcAiIWLQ7JjRytV8cUgArceKVwFyh0s3Ej3Hxsli3d fPWEQJNZEOfZn7sTaKaM/pgnaLiOMW0tTGr7QyAUg5aN6wCjSo78ACJdma/h1iGSHJ1k UCJOjawIuB6zBB0+6jsKVM+r5ra1mAmhQdRDLStf1vyjFoaNRZ6EendmTyMidcSBfqbI nDwzzc9kMJ7sbRJeWozmS/f/mKJhPxhW0m6/1MgzRTD1AVAVSUnB/DK4dM30ndMcG125 39jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ztu6KI9VW23jrEl5bm7d+m0A1csyhmYy2gl1eld6ggU=; b=czi7WNrCEe/fP5e2Tc+Qr+tcxc/mzdSq8xvZyekYc7edl9hDtXJNAouXnQ2+SiL0fT I/bfdpNsqWnOOu3UcnArVF9Yh7cJdExLT8SpeT5d+u5gViy3Vsz2aGjbWxqLBhF15R65 x8Pn0Ib5vMo1NNw3XEQ+ar4vYJTFXRoV7S5dc/gVBpZ8gp+fGvYvhL4A+spga7RyQS/c KMgcb+EmopGA++vxa8gDTQb5v8/PNCgnGA8rsXHRuldKaAni6pkQm9OcSAszG3WL1DDb 69n9n8Pt/UCg9Qz1jEcC5oI8OpIw/2w9dmfex/SV0e2EaJbHbv8EaOcjHowqjyV1HR0c Nc0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MWne1QOU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 23si8551063pgc.220.2019.03.18.02.12.23; Mon, 18 Mar 2019 02:12:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MWne1QOU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbfCRJJ7 (ORCPT + 99 others); Mon, 18 Mar 2019 05:09:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:54590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726835AbfCRJJ6 (ORCPT ); Mon, 18 Mar 2019 05:09:58 -0400 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B916B20854; Mon, 18 Mar 2019 09:09:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552900198; bh=ztu6KI9VW23jrEl5bm7d+m0A1csyhmYy2gl1eld6ggU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MWne1QOUuAXuQRdwEDLGxu9BOdiGw1UhRnqMYRETqkphkAqp2YVL3zhIuGxMJpkFi /j47adKJ+du1Tlt+Lk+J8zWOhHfFCfJpzDnEyKHeBiXuIJZiUI9jppdSLOYlHlkx2h MVJWVY6qyR1+d2N6TRO+kILqvEo6pzpokcgYHrgE= Received: by mail-wm1-f46.google.com with SMTP id v14so3337463wmf.2; Mon, 18 Mar 2019 02:09:57 -0700 (PDT) X-Gm-Message-State: APjAAAX5UQUX63EO2i1rZ4IW+AkRqds46GEXXq6A2gCGq1Yrcl1X8a6r e/PWG7k8N8Hla0kk+NljfZKceDT5vcaX4Sgpa1E= X-Received: by 2002:a1c:2543:: with SMTP id l64mr10658898wml.116.1552900196348; Mon, 18 Mar 2019 02:09:56 -0700 (PDT) MIME-Version: 1.0 References: <20190318073354.12151-1-wens@kernel.org> <20190318073354.12151-5-wens@kernel.org> <20190318084212.lv2lorskizl65uzg@flea> <20190318085751.kziqzxnadtho4kdb@flea> In-Reply-To: <20190318085751.kziqzxnadtho4kdb@flea> From: Chen-Yu Tsai Date: Mon, 18 Mar 2019 17:09:44 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/6] nvmem: sunxi_sid: Read out data in native format To: Maxime Ripard Cc: Chen-Yu Tsai , Srinivas Kandagatla , linux-sunxi , linux-arm-kernel , devicetree , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 18, 2019 at 4:57 PM Maxime Ripard wrote: > > On Mon, Mar 18, 2019 at 04:45:19PM +0800, Chen-Yu Tsai wrote: > > On Mon, Mar 18, 2019 at 4:42 PM Maxime Ripard wrote: > > > > > > Hi, > > > > > > On Mon, Mar 18, 2019 at 03:33:52PM +0800, Chen-Yu Tsai wrote: > > > > From: Chen-Yu Tsai > > > > > > > > Originally the SID e-fuses were thought to be in big-endian format. > > > > Later sources show that they are in fact native or little-endian. > > > > The most compelling evidence is the thermal sensor calibration data, > > > > which is a set of one to three 16-bit values. In native-endian they > > > > are in 16-bit cells with increasing offsets, whereas with big-endian > > > > they are in the wrong order, and a gap with no data will show if there > > > > are one or three cells. > > > > > > > > Switch to a native endian representation for the nvmem device. For the > > > > H3, the register read-out method was already returning data in native > > > > endian. This only affects the other SoCs. > > > > > > > > Signed-off-by: Chen-Yu Tsai > > > > > > I thought only the newer SoCs were impacted by this issue? > > > > It is noticable on the newer SoCs. The old ones only have the 128-bit SID, > > which could be read either way, as AFAIK it's just a serial number. > > > > If you think we should leave the old ones alone I can factor that in. > > IIRC, there was also the SoC ID in the SID on those SoCs as well, > which we might have to use in the future so we'll want to make sure it > is correct. We'll need to ask Allwinner about this then. FWIW, the fel command in sunxi-tools reads them out in little endian. I believe this and the SID page on the linux-sunxi wiki predate the sunxi_sid driver. ChenYu