From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752857AbcCIJ7H (ORCPT ); Wed, 9 Mar 2016 04:59:07 -0500 Received: from down.free-electrons.com ([37.187.137.238]:38218 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753171AbcCIJ66 (ORCPT ); Wed, 9 Mar 2016 04:58:58 -0500 Date: Wed, 9 Mar 2016 10:58:56 +0100 From: Maxime Ripard To: Andrey Smirnov Cc: Srinivas Kandagatla , linux-kernel@vger.kernel.org, Sascha Hauer , Trent Piepho Subject: Re: [RESEND RFC 2/3] nvmem: Add 'nvmem-blob' driver Message-ID: <20160309095856.GM8418@lukather> References: <1456851552-15913-1-git-send-email-andrew.smirnov@gmail.com> <1456851552-15913-3-git-send-email-andrew.smirnov@gmail.com> <56D6F188.2090406@linaro.org> <20160307081842.GA8418@lukather> <20160308222821.GL8418@lukather> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vM+jrqt/DYO3gep+" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --vM+jrqt/DYO3gep+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 08, 2016 at 02:46:52PM -0800, Andrey Smirnov wrote: > >> > >> I don't think I understand what you mean, could you give me an example > >> of how I'd use local-mac-address property for that use case? AFAIK, > >> local-mac-address is just an array of bytes embedded into device tree, > > > > Well, yeah, but the nvmem-blob is also just an array of bytes embedded > > into the DT, right? >=20 > One is accessible via "nvmem" API and the other one isn't. But there's no point in accessing it with nvmem in the first place. You want to provide some information to the ethernet driver to give it his mac address, that's what you want to do. And we already have a property that does just that, and is supported by all the ethernet drivers. Why would you want to add a special case to something that is doing exactly the same thing? > >> how would it get populated with data from OTP memory of SoC? > > > > In the bootloader, or Linux, read the OTP, patch the DT to add that > > node, done. >=20 > No, it's not really "done", because if you read my previous messages, > "read the OTP, patch the DT" is exactly the problem I am trying to > solve. The overall goal is to be able to read a certain "nvmem" cell > and patch DT with that data as MAC address, But *why* do you need to store that using nvmem in the first place? You really have two solutions here: make your ethernet driver read the EEPROM using nvmem directly or do it in the bootloader and set local-mac-address (note that you can do both). > however in it's current incarnation "nvmem" doesn't have provisions > to make cells that are just combination of other cells (patch #3) This use case is valid. > and to embed certain data in DT and then access it as "nvmem" cell > (patch #2) And this one is redundant. Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com --vM+jrqt/DYO3gep+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW3/PgAAoJEBx+YmzsjxAg4MsQAIxfRBY+R5GKfgCnRUsCGW+t XCOpEwIgxskQNoTv3voH9VTXA1praRmIjJpPrH9mwXf8aQ8nO/L1BUzQwp5J8hSS aSiGkP2+FhP8wsjid7VAEdonF1qjiIjMFZasRezDRl3SQvS2rkxU4BlSFCUZ4TOF QgNjfu6kzgy3rwxmjoa9KrhhyEqeC7f8Z50Pp3aW8CXC6doi2V3pCYM0MNOH5ehF +gdLbyebRfg8nZTpKG3RwnpRszTwuNMIu8X7GLnKMdYOcbaibCe92cHpr+tEHKVR pqZGtTlL6UrxMeRI+ydWgT1uezi5rcBBqvw3wSEnYGSIVQB9moDgnqOrzgdX5J8m EzO1fQIhjtZ8teb9/fTX3Ts9+3qye3LYCUGBu0TVZCMJNZbT0zGRei7MXz3Rh+gX xq5gmbi03Y04xML6DwHAtt1YE6HHdd8DlsQqtGFEZ8fp+8M7NL+j22ytN/hVSMjL 1cAPirM8l04xm8IFz3eQnF2hbQ0tBRMV1IBHs5OmoxDYIL/jXNsBCBkL2y5M+JYW GcAK1beBfRqyS2f2qULzYifLdcMfaWJnF5KrVjx65TvVXwPt1jPTNg5W8x8ykJnS 09hM0wPKXG1z9sosZfMCD/HpW4TySu24Lp0UBi+ZQFM6GvZEsNVr+/OeYEjh6OXD IrHUsXZrbgNnNDvXRHl8 =mlVC -----END PGP SIGNATURE----- --vM+jrqt/DYO3gep+--