From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Subject: Re: [PATCH 4/6] nvmem: sunxi_sid: Read out data in native format Date: Mon, 18 Mar 2019 10:25:19 +0100 Message-ID: <20190318092519.g2rvdjiunti2ev7p@flea> References: <20190318073354.12151-1-wens@kernel.org> <20190318073354.12151-5-wens@kernel.org> <20190318084212.lv2lorskizl65uzg@flea> <20190318085751.kziqzxnadtho4kdb@flea> Reply-To: maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fgqxvk5pq25ezuac" Return-path: Sender: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Content-Disposition: inline In-Reply-To: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: Chen-Yu Tsai Cc: Srinivas Kandagatla , linux-sunxi , linux-arm-kernel , devicetree , linux-kernel List-Id: devicetree@vger.kernel.org --fgqxvk5pq25ezuac Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline On Mon, Mar 18, 2019 at 05:09:44PM +0800, Chen-Yu Tsai wrote: > 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. Yeah, and the driver has a readl as well: https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/arch/arm/plat-sunxi/soc-detect.c#L92 For the whole series, Acked-by: Maxime Ripard Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --fgqxvk5pq25ezuac--