mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: Trent Piepho <tpiepho@kymetacorp.com>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH 00/17] RFC for additional 'nvmem' plumbing
Date: Tue, 16 Feb 2016 20:20:57 -0800	[thread overview]
Message-ID: <CAHQ1cqGov0qDctaUmrufTUHMdbK_g33cKpmK4GPX6TkkZDqyTA@mail.gmail.com> (raw)
In-Reply-To: <1455678623.18517.81.camel@rtred1test09.kymeta.local>

On Tue, Feb 16, 2016 at 7:09 PM, Trent Piepho <tpiepho@kymetacorp.com> wrote:
> On Tue, 2016-02-16 at 17:29 -0800, Andrey Smirnov wrote:
>> Hi everyone,
>>
>> The main purpose of this patchset is propose additional Nvmem plubing
>> needed for that subsytem's inclusion in BB and solicit feedback about
>> it (patches ## 15 to 17) . Included in this set are also a number of
>> bugfixes and RFC-for-bugfixes for problems that were discoverd during
>> development of this patch series.
>>
>> Proposed Nvmem additions are two new platform device drivers that
>> implement a nvmem interface on top of data embedded in DT as well as
>> nvmem interface that allows to combine existing nvmem-accesible bytes
>> into continuous blocks.
>>
>> Below is an example of DT code that uses both drivers in order to
>> create a MAC address as a combination of bytes from DT and OCOTP
>> module:
>
> So for a common case Sasha has pointed out, of the MAC in the opposite
> byte order, one would write:
>
>         scatter-gather-blob {
>                 compatible = "barebox,nvmem-sg";
>                 #address-cells = <1>;
>                 #size-cells = <1>;
>
>                 mac_address: combined-bits {
>                         reg = <0 6>;
>                         layout = <&fec_mac_address 5 1
>                                   &fec_mac_address 4 1
>                                   &fec_mac_address 3 1
>                                   &fec_mac_address 2 1
>                                   &fec_mac_address 1 1
>                                   &fec_mac_address 0 1>;
>                 };
>         };
>
>         &ocotp {
>                 #address-cells = <1>;
>                 #size-cells = <1>;
>
>                 fec_mac_address: mac_address@88 {
>                         reg = <0x88 0x8>;
>                 };
>         };
>
>         &fec {
>                 ?mac-address-location?? = <&mac_address>;
>         };
>

mac_address is still a nvmem cell, so the DT code for FEC would remain the same:

&fec {
    nvmem-cells = <&mac_address>;
    nvmem-cell-names = "mac-address";
}


> I suppose that's a very powerful system, but it does seem a bit
> cumbersome.

I agree, those bindings don't really make me glow with pride because
of their elegance, but unfortunately I wasn't able to come up with
anything better that would be as generic and not tied into a
particular use case of MAC address manipulation.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2016-02-17  4:21 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17  1:29 Andrey Smirnov
2016-02-17  1:29 ` [PATCH 01/18] common: Add EPROBE_DEFER to strerror Andrey Smirnov
2016-02-17  1:29 ` [PATCH 02/18] base: driver.c: Coalesce error checking code Andrey Smirnov
2016-02-17  1:29 ` [PATCH 03/18] [RFC] at91: Make IS_ERR work for I/O pointers Andrey Smirnov
2016-02-17  8:34   ` Sascha Hauer
2016-02-17 20:39     ` Andrey Smirnov
2016-02-18 10:26       ` Sascha Hauer
2016-02-17  1:29 ` [PATCH 04/18] [RFC] base/driver.c: Remove dev_request_mem_region_err_null Andrey Smirnov
2016-02-17  1:29 ` [PATCH 05/18] i2c-at91: Use IS_ERR instead of checking for NULL Andrey Smirnov
2016-02-17  1:29 ` [PATCH 06/18] clk-imx6: Call clk_enable on mmdc_ch0_axi_podf Andrey Smirnov
2016-02-17  1:29 ` [PATCH 07/18] fec_imx: Deallocate clocks when probe fails Andrey Smirnov
2016-02-17  1:29 ` [PATCH 08/18] [RFC] base: Introduce dev_request_mem_resource Andrey Smirnov
2016-02-17  1:29 ` [PATCH 09/18] fec_imx: Deallocate I/O resources if probe fails Andrey Smirnov
2016-02-17  1:29 ` [PATCH 10/18] fec_imx: Free phy_reset GPIO if when " Andrey Smirnov
2016-02-17  1:29 ` [PATCH 11/18] fec_imx: Use FEC_ECNTRL_RESET instead of a magic number Andrey Smirnov
2016-02-17  1:29 ` [PATCH 12/18] fec_imx: Impelemnt reset timeout Andrey Smirnov
2016-02-17  8:43   ` Sascha Hauer
2016-02-17  1:29 ` [PATCH 13/18] fec_imx: Deallocate DMA buffers when probe fails Andrey Smirnov
2016-02-17  1:29 ` [PATCH 14/18] fec_imx: Unregister MDIO " Andrey Smirnov
2016-02-17  1:29 ` [PATCH 15/18] [RFC] net: eth: Always use DEVICE_ID_DYNAMIC Andrey Smirnov
2016-02-17  2:40   ` Trent Piepho
2016-02-17  4:16     ` Andrey Smirnov
2016-02-18 19:30       ` Trent Piepho
2016-02-19 17:17         ` Andrey Smirnov
2016-02-17  1:29 ` [PATCH 16/18] [RFC] nvmem: Add of_nvmem_cell_from_cell_np Andrey Smirnov
2016-02-17  1:29 ` [PATCH 17/18] [RFC] nvmem: Add nvmem-ro-of-blob driver Andrey Smirnov
2016-02-17  8:52   ` Sascha Hauer
2016-02-17 20:40     ` Andrey Smirnov
2016-02-17  1:29 ` [PATCH 18/18] [RFC] nvmem: Add nvmem-sg driver Andrey Smirnov
2016-02-17  3:09 ` [PATCH 00/17] RFC for additional 'nvmem' plumbing Trent Piepho
2016-02-17  4:20   ` Andrey Smirnov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHQ1cqGov0qDctaUmrufTUHMdbK_g33cKpmK4GPX6TkkZDqyTA@mail.gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=tpiepho@kymetacorp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox