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 BB2ABC6FA82 for ; Sat, 10 Sep 2022 20:04:26 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2903784904; Sat, 10 Sep 2022 22:04:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="YOCkPCwC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A16A184915; Sat, 10 Sep 2022 22:04:22 +0200 (CEST) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (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 F2C2384567 for ; Sat, 10 Sep 2022 22:04:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x72d.google.com with SMTP id q11so491496qkc.12 for ; Sat, 10 Sep 2022 13:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=wYe06zOQlwyvJqNYMIbGD0aI7+h8pxiiWvisQ9nfGrY=; b=YOCkPCwC3Fak0X0RMfJBCB0K3syGirbgkWRPr6poJ3OpgFb2Z9frGoVPrZTNCIAeJ5 zoDwu2J4fjkk+mUKXAabFbuuQCPZAwf4K2cJXVVxWqa4xDzDVJoXa4FMJhIBaYnCMNhH ELFlIJY082VcSf/pl1UpDZKEczNkr9IWwrB38= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=wYe06zOQlwyvJqNYMIbGD0aI7+h8pxiiWvisQ9nfGrY=; b=hs5me2slt3DoBlHK/6CmXXhdJO3XR0ZZ9t61hmIP7EjcsfCLTxQKwX/ywh+ngshhOu XNvoFRpwSQ7usc7gXsp2SndhfAqnLNzQ415NsU5nstxmTfchcZ/dYtFweLhv3R4We7+c RBrdpL/gueC+OcVzOFEOtGpfFXtbh0OYZU9TMYLaV+Af1EC5M+kMVlR0kSfqxG6QnOHo aiyT1Y4gYyeT5/kyIhN6fb6MFG5GtTZqGa5TEA77i+TCMoJrlw2t2Z6wbxViMP9eEbP6 oXVX6oC+CddGWBmaoZWxnHMCuuCyCnWWX3mBhQqk47I5K3lDGb+f/tP6r2HsJ+vb0EEx 9VGA== X-Gm-Message-State: ACgBeo1UvR8pZejnEVWbF45beVLLjumRaS7sgkmZXsEvcpUKbrqgtkve Y0z31PAB77cBCVporsCFWHASMA== X-Google-Smtp-Source: AA6agR5LjsaP7JoDCDdjMZLlCRXedK4Olz/iqx6VDzQiszvAysZ2NBoaDtbUa/2pONcH2Tsx4M7E2A== X-Received: by 2002:a05:620a:4691:b0:6bb:297e:279 with SMTP id bq17-20020a05620a469100b006bb297e0279mr14476196qkb.35.1662840258769; Sat, 10 Sep 2022 13:04:18 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-e91f-2d66-18d0-8f0c.res6.spectrum.com. [2603:6081:7b00:6400:e91f:2d66:18d0:8f0c]) by smtp.gmail.com with ESMTPSA id x10-20020a05620a448a00b006c08fddd081sm3830041qkp.75.2022.09.10.13.04.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Sep 2022 13:04:18 -0700 (PDT) Date: Sat, 10 Sep 2022 16:04:16 -0400 From: Tom Rini To: Sergei Antonov Cc: u-boot@lists.denx.de, Simon Glass , patrick.delaunay@foss.st.com, Marek Vasut Subject: Re: [PATCH] scripts: config_whitelist: CONFIG_SYS_FLASH_AUTOPROTECT_LIST Message-ID: <20220910200416.GJ1522024@bill-the-cat> References: <20220903161556.GS7942@bill-the-cat> <20220904152346.GU7942@bill-the-cat> <20220904153035.GV7942@bill-the-cat> <20220910141847.GI1522024@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SxgehGEc6vB0cZwN" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett 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 --SxgehGEc6vB0cZwN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 10, 2022 at 10:59:20PM +0300, Sergei Antonov wrote: > On Sat, 10 Sept 2022 at 17:18, Tom Rini wrote: > > > > On Sun, Sep 04, 2022 at 06:54:29PM +0300, Sergei Antonov wrote: > > > On Sun, 4 Sept 2022 at 18:30, Tom Rini wrote: > > > > > > > > On Sun, Sep 04, 2022 at 06:28:56PM +0300, Sergei Antonov wrote: > > > > > On Sun, 4 Sept 2022 at 18:23, Tom Rini wrote: > > > > > > > > > > What type must it be in Kconfig? Note, it is an array i= nitializer > > > > > > > > > > similar to CONFIG_SYS_BAUDRATE_TABLE. > > > > > > > > > > > > > > > > > > Ah, ugh. So, it's also currently unused code, what does i= t look like in > > > > > > > > > the platform you're making use of this on? > > > > > > > > > > > > > > > > In my _defconfig I use this line: > > > > > > > > CONFIG_SYS_FLASH_AUTOPROTECT_LIST=3D"{{0x80000000, 0x40000}= }" > > > > > > > > To protect the first 256 KB of flash memory. > > > > > > > > > > > > > > Please, disregard the previous message. I was too hasty to re= ply. > > > > > > > > > > > > > > I have include/configs/myplatform.h file which contains this = line: > > > > > > > #define CONFIG_SYS_FLASH_AUTOPROTECT_LIST {{0x80000000, 0x400= 00}} > > > > > > > > > > > > > > And I could not convert it to Kconfig string parameter. > > > > > > > > > > > > Can this information be obtained from an existing device tree b= inding on > > > > > > the platform? > > > > > > > > > > Device tree exists. No, DT does not currently contain this > > > > > information. But it can be added. > > > > > > > > OK. But, is there an existing binding, or would it be a new one? > > > > > > I am using an existing "cfi-flash" driver: > > > nor@80000000 { > > > #address-cells =3D <1>; > > > #size-cells =3D <1>; > > > compatible =3D "cfi-flash"; > > > reg =3D <0x80000000 0x0>; > > > ... > > > } > > > > Getting back to this, sorry, I meant if there was a property we could > > use or some other way to infer this from the device tree. I see the > > partition binding has a way to mark things as read-only, which we could > > use as a hint (and with a new Kconfig option) to say that partitions > > that are marked as read only are then also protected. >=20 > Can "read-only;" in .dts be such a hint? Here is what I have in .my .dts: > nor@80000000 { > #address-cells =3D <1>; > #size-cells =3D <1>; > compatible =3D "cfi-flash"; > reg =3D <0x80000000 0x0>; > partitions { > ... > mtd1 { > label =3D "bios"; > reg =3D <0x0 0x40000>; > read-only; > }; Yes, that's what I was trying to suggest. If you're interested in implementing it, that's great! --=20 Tom --SxgehGEc6vB0cZwN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmMc7bcACgkQFHw5/5Y0 tyx4zgv9G8lDpMyNNF9Yy8GdjZRkhPNsPcPLI16XrisedkqcB3asJwHfUAzC2WPJ 0GhRr88lexXmUQpAkQQToxKMEOMhhJ/X1VYiutC8Op/qRR6SrXkuVrC+ttnpoesu E16TSmUGMrXMAithcWJDPZwc7/ekQ5UtuHkiXMV6MK8Ia4EwuouySKOuShWI1yo1 coE3rzGT5QK+kGp1RWyPPKKOiy4ig1RLlLtC39D6dyPUNZsmvMU8MQas/d+wWHgD TcYECv6wSJAp/fYUjipodlnqS3eQ+M0RJUre74znhwUlGgEQ9Wnn+FzaNNIxSECu 12JGRQZrDoVQQTrDMVKcaO3oH96extfFYxS1qsOuaVetLZox9Xem0vPuDz5s9T71 tI1WZAH3/OmT3rVv+3XnN6pVEmJjq9JksXlFcWlzGazBTswyFp79XdOyRDIBrA3P UZDvkyFbJEpS9DAE27Bw6k4KigyemNG0E9iuVN6bKlll/NgerjloSl1LPauNuCIh vhpLf5md =looS -----END PGP SIGNATURE----- --SxgehGEc6vB0cZwN--