From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ACECDC001B0 for ; Fri, 23 Jun 2023 14:25:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4A77C8638B; Fri, 23 Jun 2023 16:25:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YhsJCsZ/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 464E5861CA; Fri, 23 Jun 2023 16:25:38 +0200 (CEST) Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 37247863C1 for ; Fri, 23 Jun 2023 16:25:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=thierry.reding@gmail.com Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f9b4a71623so7893155e9.1 for ; Fri, 23 Jun 2023 07:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687530334; x=1690122334; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=LaKrUWVKGcKPRhp55DPEJfVnOoHhJHTKL7cxavsyyi8=; b=YhsJCsZ/p1FWOwYNjtTlYQBfWAABDiFX7Zn9ajJTX9euUf2ZjjISKmda+U1QC0uVrC WTNSnOBf857sVQ5XEANATwAPn3uv2mVPnJHIl6UiCHSEvhOxwtTw4ix2HSJzYsPlljvt vnJxUNsENMU3QtNCodeUl+A1b6/81pHBCHwHRk8CxXT8OEUrR1auaZADD9MYVkKjmatE elikq9Zv0YyhIQMQN4GNMYD30DMWq8EAteYRIAeg4a6DlUflWD6CnhXzuHPQOzopjCGc HL+Z0QSNxJleErWVpgUqYoeI4SKH4G3FioruvuOilowTSPy3qd5G3lnbsAGBBhic7gJt uEEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687530334; x=1690122334; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LaKrUWVKGcKPRhp55DPEJfVnOoHhJHTKL7cxavsyyi8=; b=XkLVcWo5QfuDHhsmmBbvG/wdL1mjnMXqTlzbBNGfqFd9aystL1cFhJueBPMnMtIIgu UpP/l9jvduyozcYuou+GZMwlLOWVY5EDiFB9WgWARZgALit+LsQS7uZNRWyetPtIO3j6 5qTtFtHGjaMWG4Bb0iZ3ppNOROG16g/aIkZqrrCDFufkRfyCW0gpjTFdiQ66Jx6VvGU1 6MB7EMSVgxc+wfm3VbqAoJkTJW9HkiBiQumQ57eVsXHixlIbtiTtU4dTnYqC/B21V2IR QcwvhKjGtXJQ/D/muRk+vSQrBG5jJ+wIGCB93HoU+kStvvxwX5KmXiSV3X2faWdB2O7S RabQ== X-Gm-Message-State: AC+VfDxsIdYE+k7H9ChEaquFA8GHkKVSgLEW+iZ4afO7woU8/qWqkOvH IIRPPV/P5k1+gkhz8j/0OzOSE5CCchQ= X-Google-Smtp-Source: ACHHUZ7EBcWP9oxHv/DbuY9uG0uhv7kNCXXEpYikwXNsfAy2Hpmoi6VuEQIXXcBpBBIVnTmEAbLS8g== X-Received: by 2002:a05:600c:246:b0:3f6:cfc7:8bc7 with SMTP id 6-20020a05600c024600b003f6cfc78bc7mr15818167wmj.17.1687530334497; Fri, 23 Jun 2023 07:25:34 -0700 (PDT) Received: from orome (p200300e41f305300f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f30:5300:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id u25-20020a05600c211900b003fa74bff02asm2515210wml.26.2023.06.23.07.25.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 07:25:34 -0700 (PDT) Date: Fri, 23 Jun 2023 16:25:32 +0200 From: Thierry Reding To: Svyatoslav Ryhel Cc: Thierry Reding , Tom Warren , Tom Rini , Simon Glass , Jonas =?utf-8?B?U2Nod8O2YmVs?= , u-boot@lists.denx.de Subject: Re: [PATCH v7 3/7] ARM: tegra: add SoC UID calculation function Message-ID: References: <20230623055600.246416-1-clamor95@gmail.com> <20230623055600.246416-4-clamor95@gmail.com> <9FFB6FC9-8375-4004-875E-BE1CCA17F61B@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WKjwN9Hg0Oaj/7Qb" Content-Disposition: inline In-Reply-To: <9FFB6FC9-8375-4004-875E-BE1CCA17F61B@gmail.com> User-Agent: Mutt/2.2.10 (2023-03-25) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean --WKjwN9Hg0Oaj/7Qb Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 23, 2023 at 02:46:54PM +0300, Svyatoslav Ryhel wrote: >=20 >=20 > 23 =D1=87=D0=B5=D1=80=D0=B2=D0=BD=D1=8F 2023 =D1=80. 14:24:37 GMT+03:00, = Thierry Reding =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0= =B0=D0=B2(-=D0=BB=D0=B0): > >On Fri, Jun 23, 2023 at 08:55:56AM +0300, Svyatoslav Ryhel wrote: > >> This is a small tool for calculation of SoC UID based on the same > >> Linux function. It can be further used for generation of device > >> unique data like mac address or exposing it as serial number. > > > >It's a very bad idea to use the SoC UID as a MAC address. There are > >better ways (such as MAC address randomization) to generate one if for > >some reason you don't have a real MAC address or are concerned about > >privacy. >=20 > SoC UID is not used directly as MAC but it is used as a device > specific base to generate device specific one. You can check LG board > to see what I mean. Is this something that originates from the original vendor code? My primary concern is that this might end up reusing MAC addresses which were assigned to other devices. >=20 > >The SoC UID is also not very well suited as a serial number because it > >identifies only the SoC, but doesn't say anything about any of the other > >components of a device. Many devices have serial numbers in some EEPROM > >chip, so those would be more appropriate. >=20 > That is not the case of devices in patches and IIRC SoC UID is used as > fastboot ID on transformers by vendor. That doesn't really make this a better idea, but I also understand that your options are limited given the information you have. > >I suppose not all devices have such a system-wide serial number, so > >perhaps there are cases where this would be better than nothing. >=20 > Vendors usually do not expose serial in any device hardware, or at > least do not bother to inform, where to find it. My experience differs. There's usually some serial number somewhere because vendors need some way of tracking these devices. But yeah, if you get an OEM device they typically don't tell you where to find it. One thing you might want to do is probe the various I2C busses to see if there's an EEPROM on any of them. They are often found at addresses 0x50-0x58 or so. Again, I'm not strongly objecting to this, but I'd prefer some better way to identify system than by chip UID, because it's not meant for this purpose. Thierry --WKjwN9Hg0Oaj/7Qb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmSVq1kACgkQ3SOs138+ s6EbkQ//TPp725mPQvAdtvMDJKp57X7d2RIR3b49Ia5GNGpFOQGGooDKfl/lagRH b0uxQ32tCuxKis0CnPl3ouz6IBTh8+5iTKA/k3KM1NN7kLnpYfisxRj4xuCQGRws hIoB3ztxWmAuKNGk/ca1jZIGECTzkBylzkee+jzwfkb9K4Ng7b0s+wLjtuNC9Qw6 9F5UJhOZuhtDffZ1EBVV7Hkdvx9oG4RlCdEHXYSSOJC5GaMUTqdWFeLDa+YAkhqa BzzkSMZsCRmlgoxIBG3KNlWjcCHTYV1RMoWcxmT/vJ/C+bN+3MUXL2hP6C7plXKN jD91+nOEC5quwfqbnOZ9o1SaZPb5L+2mY6OUPbkUyyLieLUEoh8Ha7zDssaTnYNH YuQNDVDBBCnpKb8rN2MlESz0XPzaZuRmIne04OdyVHbhTFu96VKuzPdgYB8AujeK b+sOU+5m3hPVgisWwhOmvOTzP+BY/2IVsK0Cd+e6rQP9CWBYOMuN1DGwEde8b0Pe lnTmaDdQOjZgsjsGNWM3dSCJvVi3IdFDCiswOtTNstI96Mkx65Z49K7uW3EKaz5w TBECu3OFvcfxd1YIq5PN/zf9HccgNP91tKVvxV3RrHdGX9cD2F5dFNzYesNyFYDp Lioheo5jF2HOcvGn2QfJVExDdYqwCSfhBQ2sztkixK8maoCvT6s= =RdBv -----END PGP SIGNATURE----- --WKjwN9Hg0Oaj/7Qb--