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 84326C54EE9 for ; Tue, 27 Sep 2022 11:34:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 976E584CE3; Tue, 27 Sep 2022 13:33:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kohlschutter.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=kohlschutter-com.20210112.gappssmtp.com header.i=@kohlschutter-com.20210112.gappssmtp.com header.b="03n16T0t"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0331C84E27; Mon, 26 Sep 2022 23:27:39 +0200 (CEST) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (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 E470D84DFC for ; Mon, 26 Sep 2022 23:27:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kohlschutter.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=christian@kohlschuetter.com Received: by mail-ed1-x52d.google.com with SMTP id c30so9621575edn.2 for ; Mon, 26 Sep 2022 14:27:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kohlschutter-com.20210112.gappssmtp.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date; bh=eN8NFSdjT4Z1e1MqnA3+3/5ZR634KhRyJVsCs10lMqM=; b=03n16T0t0gvU8OfLc4N6F2U2jhAyyAJafApGZaVAynxLVIl8YbrJZGhS5SBGKR4UL1 LESJl7SC6l4Np0CjSI2FBWIdUB983bmkvBv62Oau4uQz0/J9cAdmA3LUUoTK0IyNSLjH /S+bZUfMktabE5fvOCnF9PFtmsyea1ljZwCvnoZ7fvAEb1q7pYfqQKeYAS7+yyflYNEz Vt8+6ZwRXctdBM0e4cy9pQO24sHU7RDITayXjywDSnHUE0WFWjdFIPuOHf/LIIrDx8M8 nYTQDs+oBQGwURnRjhWvK6qB9AatqOyNcGrYBMWDQCxvHIrlUrQ9TnU4MMZQvME0ZwEL x8xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=eN8NFSdjT4Z1e1MqnA3+3/5ZR634KhRyJVsCs10lMqM=; b=jQt2lGDr/xo472R4nupQCk9r9uNG1a/8w5/lx9LxBqVGsyzyVDqVJndCXP/r5TJzXh sB4D04kdguqWy9cw41MGkS5PBtZJcspPdaEdc7DngJ2uEBjB7dQmrqrkgLW+IZHBW6B7 Oa72UQb1U2/L6l9Wsz0AgOBiTR4dbwbU/L1atTS0GzDx7uj/emT5/3TJOvqVQpH/CI0x 20pjC1YdYVNX91aT2JrpUB+E4/xrkIP76/Mi9E7AdaYLSag/uGZgFWs4iqC9DtCuj1wm mBo82fcUJQazqauV4yaUQZ0oXoo2AVswizIpUAg29/TrAX7/SyXhw/8dLSwUe7RcrH4C 4SLw== X-Gm-Message-State: ACrzQf3LxC4aZntTzaq2Ge+wEbnX1Jwerd5fTa3bK6zLFu6FUFZ8f7uj 8qaxePJIjI+cHnF3vzUAakoHyg== X-Google-Smtp-Source: AMsMyM6YvONVhDr8gknq65TOHuOLZUunUFBLuoP9vVPT9QIHcw3NY2bFvmZgKOQhBiODfHcqYj453g== X-Received: by 2002:a05:6402:2b8f:b0:453:2e59:364d with SMTP id fj15-20020a0564022b8f00b004532e59364dmr24475943edb.254.1664227656459; Mon, 26 Sep 2022 14:27:36 -0700 (PDT) Received: from smtpclient.apple (ip5b434222.dynamic.kabel-deutschland.de. [91.67.66.34]) by smtp.gmail.com with ESMTPSA id o6-20020a170906768600b007386a8b90c9sm8951708ejm.13.2022.09.26.14.27.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Sep 2022 14:27:36 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: [PATCH] rockchip: rk3399: add ethaddr and serial# init, enable for R4S From: =?utf-8?Q?Christian_Kohlsch=C3=BCtter?= In-Reply-To: Date: Mon, 26 Sep 2022 23:27:35 +0200 Cc: u-boot@lists.denx.de, Kever Yang , Simon Glass , Philipp Tomsich , Xiaobo Tian Content-Transfer-Encoding: quoted-printable Message-Id: <92F9AB00-8833-40EB-A0FB-F2959DFFAFDD@kohlschutter.com> References: <20220925170733.19787-1-christian@kohlschutter.com> To: wens@kernel.org X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Mailman-Approved-At: Tue, 27 Sep 2022 13:33:11 +0200 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.6 at phobos.denx.de X-Virus-Status: Clean > On 26. Sep 2022, at 13:59, Chen-Yu Tsai wrote: >=20 > On Mon, Sep 26, 2022 at 7:53 PM Christian Kohlschu=CC=88tter > wrote: >>=20 >> Some RK3399 boards, such as newer revisions of NanoPi R4S, do not >> provide an EEPROM chip containing a globally unique MAC address. >>=20 >> Currently, this means that a randomly generated temporary MAC address >> may be generated each time the device is rebooted, leading to ARP = cache >> issues and other confusing bugs. >>=20 >> Since RK3399 CPUs provide a built-in unique serial number, we can >> reliably derive a locally MAC address from it by reading the >> corresponding bits from the non-secure efuse block. >>=20 >> Port from uboot-rockchip 0c294d0, fix compilation issues and adjust >> coding style. >>=20 >> rockchip: board: puma_rk3399: derive ethaddr from cpuid >> rockchip: board: puma_rk3399: add support for serial# and cpuid# >> rockchip: efuse: add (misc) driver for RK3399 non-secure efuse block >> via efuses >>=20 >> Signed-off-by: Christian Kohlschu=CC=88tter = >> --- >> board/rockchip/evb_rk3399/evb-rk3399.c | 120 = +++++++++++++++++++++++++ >> configs/nanopi-r4s-rk3399_defconfig | 4 + >> drivers/misc/Makefile | 2 +- >=20 > There's already code in arch/arm/mach-rockchip/misc.c that does pretty = much > the same thing. >=20 > IIRC all you need to do is enable MISC_INIT_R and ROCKCHIP_EFUSE > or ROCKCHIP_OTP. >=20 > ChenYu Oh cool, thanks ChenYu! Is there a reason to not enable these options by default (at least for = the R4S)? Following up with "[PATCH] rockchip: rk3399: add ethaddr and serial# = init, enable for R4S", which enables these settings in = configs/nanopi-r4s-rk3399_defconfig. Cheers, Christian