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 2EB2CEB64D7 for ; Fri, 23 Jun 2023 15:02:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 996048660D; Fri, 23 Jun 2023 17:02:24 +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="grQJ7Ary"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6BBAA865F2; Fri, 23 Jun 2023 17:02:17 +0200 (CEST) Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (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 1047886680 for ; Fri, 23 Jun 2023 17:00:18 +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=clamor95@gmail.com Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f973035d60so841639e87.3 for ; Fri, 23 Jun 2023 08:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687532418; x=1690124418; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=kfsUd1EXe0nVEccMho74ESl/6LZSRVTMgKEAfuvvQyk=; b=grQJ7Ary6FcA1wgzPh1UdZz7ALqNaUc6rj/ssJaU0YUIAdhG6cy7zB6gcpDpdO+OtM OHN5IuF2o7wpXjR5DU33clTVK7uEkTwaNVUw2iNs1HU9p7ZDTZAFMeFPGZ9b6gAupyDH egl5y6XxXVm34iD91OXXmzha7ZScT5RQIcoM5MHKJaZCdesrIllWxzCLSOPIO7QQSZPc vUrX5MNZqpQCTBCh741RZIoq9YHENJvkB1mNemu1/w6N1ojUBvEaQK+cFs3ZwLRie3s0 t0Yq2urmB8C7lFw73i5X5LglwgUnQVz+6NOhnWMP7AmtCkK3RI5LHx6e6g8b1mW+shOv X+bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687532418; x=1690124418; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kfsUd1EXe0nVEccMho74ESl/6LZSRVTMgKEAfuvvQyk=; b=jHzdSQF4gMWoXeCYYvXaCVYcxZ546xBZjBCqwo2Db0Pw5Q8YAIv2nics7ObcEZu6E8 wyE3AvHYR96maV5yyyCJclpRMapDcWUSS7iHTQ/EloMkCyIsk1vYZ3FQpXokDhfAeDkx CtdwM+BlqXIzqUFv3ZVtF13PQBT08xkouKB9PVYP0CVsmsPJspn1kwYw013FEcNCBwd4 Fj3nyXIwbLmho134XcV9uxRrpQEsmYvyBHI7Ww4YghsjhA8D+BtM+ENzFmvZdlbU0cBd JvVYWvVgucJmK9uVeUkrq/SddouKHYE5x+jD4nG2JrgTD/9rWKZznek3OuFNJkJocIEY hhlg== X-Gm-Message-State: AC+VfDxlYteG3WLycZ33iqiDgKyvgY3ppu6eupBYAFIttTnJPH1/5sMr b2tnDtqCC0CZKgNASKRv2qODK98tZ7I= X-Google-Smtp-Source: ACHHUZ6Z0D/yzgoq9bqryF89OdMdanf1b4gt4PPJ7pHK4S/ZLgtfLBZevFVsgW2+FV3bEFAM5R9WOw== X-Received: by 2002:a05:600c:364c:b0:3f9:c82e:9d87 with SMTP id y12-20020a05600c364c00b003f9c82e9d87mr5976768wmq.13.1687531700942; Fri, 23 Jun 2023 07:48:20 -0700 (PDT) Received: from [127.0.0.1] ([91.204.85.69]) by smtp.gmail.com with ESMTPSA id z20-20020a05600c221400b003f8f8fc3c32sm2530817wml.31.2023.06.23.07.48.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Jun 2023 07:48:20 -0700 (PDT) Date: Fri, 23 Jun 2023 17:45:43 +0300 From: Svyatoslav Ryhel To: Thierry Reding CC: Thierry Reding , Tom Warren , Tom Rini , Simon Glass , =?ISO-8859-1?Q?Jonas_Schw=F6bel?= , u-boot@lists.denx.de Subject: Re: [PATCH v7 3/7] ARM: tegra: add SoC UID calculation function User-Agent: K-9 Mail for Android In-Reply-To: References: <20230623055600.246416-1-clamor95@gmail.com> <20230623055600.246416-4-clamor95@gmail.com> <9FFB6FC9-8375-4004-875E-BE1CCA17F61B@gmail.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 23 =D1=87=D0=B5=D1=80=D0=B2=D0=BD=D1=8F 2023 =D1=80=2E 17:25:32 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 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=2E 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=2E It can be further used for generation of device >> >> unique data like mac address or exposing it as serial number=2E >> > >> >It's a very bad idea to use the SoC UID as a MAC address=2E 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=2E >>=20 >> SoC UID is not used directly as MAC but it is used as a device >> specific base to generate device specific one=2E You can check LG board >> to see what I mean=2E > >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=2E No, but vendor code makes some magic inside the kernel, to avoid this in m= ainline linux, which is obviously not be accepted, I decided to generate ma= c in u-boot based on device specific data (soc id) and tweak linux dtb on l= oad=2E It is not the ideal decision but so far it is the best I could make = without messing stuff too much=2E If no bt mac is provided, bt will not wor= k=2E >>=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 oth= er >> >components of a device=2E Many devices have serial numbers in some EEP= ROM >> >chip, so those would be more appropriate=2E >>=20 >> That is not the case of devices in patches and IIRC SoC UID is used as >> fastboot ID on transformers by vendor=2E > >That doesn't really make this a better idea, but I also understand that >your options are limited given the information you have=2E Well, why not? SoC ID is not smth secret=2E Even linux kernel can expose i= t and vendor firmwares often display it=2E As far as I can tell, this is th= e only 100% valid thing which can determine device unlikely and has stable = way of calculation=2E >> >I suppose not all devices have such a system-wide serial number, so >> >perhaps there are cases where this would be better than nothing=2E >>=20 >> Vendors usually do not expose serial in any device hardware, or at >> least do not bother to inform, where to find it=2E > >My experience differs=2E There's usually some serial number somewhere >because vendors need some way of tracking these devices=2E But yeah, if >you get an OEM device they typically don't tell you where to find it=2E >One thing you might want to do is probe the various I2C busses to see >if there's an EEPROM on any of them=2E They are often found at addresses >0x50-0x58 or so=2E True, I have dug those extensively but nothing so far=2E >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=2E Well, maybe it is not meant for this purpose, but it is quite a nice fit= =2E Best regards, Svyatoslav R=2E >Thierry