All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Crispin <blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: RFC of_boardconfig
Date: Fri, 25 Nov 2011 14:52:40 +0100	[thread overview]
Message-ID: <4ECF9DA8.8000504@openwrt.org> (raw)

Hi All,

before starting to implement the following proposed wrappers, i wanted
to get some more views on the feasibility of these wrappers.

On most routers that OpenWRT supports, we will find a sector within a
MTD device that holds the board specific info like MAC, wifi calibration
data ...

These wrappers try to provide a generic representation of these board
configuration sectors.

Thank you,
John



Documentation/devicetree/bindings/boardconfig.txt -->

The boardconfig master node requires the following properties:
- compatible    - should be set to "boardconfig"
- partition     - the partition that the data is stored in
                        "<&partition offset size>"

boardconfig slave nodes require the following properties:
- label         - the name that the config element gets exported by
- data          - information describing the actual data
                        "<offset size validator>"

both node types allow to set the following optional properties
- magic         - check for magic sequence at correct offset
                        <offset byte1 byte2 ... byteN>
- no-export     - if this property is set the data will *not* be
		  exported via sysfs

It is possible to define N of these sections within the device tree.

Boardconfig example for a device with 2 macs and a wmac eeprom:
        eep: boardconfig {
                compatible = "boarconfig";
                partition = <&boardconfpart 0x0 0x100>;
                magic = <0x0 0x11 0x22>;
                lanmac {
                        label = "LAN";
                        data = <0x100 0x6>;
                };

                wanmac {
                        label = "WAN";
                        data = <0x106 0x6>;
                };

                ath9keeprom {
                        label = "eeprom";
                        partition = <0x200 0x200>;
                        magic = <0x0 0x55 0xaa 0xaa 0x55>;
                        no-export;
                };
        };

you can are then able to reference these properties from other nodes:
        ethernet {
                compatible = "ethernet";
                phy-mode = "mii";
                //mac-address = [ 00 11 22 33 44 55 ];
                mac-boardconf = <&eep lanmac>;
        };

             reply	other threads:[~2011-11-25 13:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-25 13:52 John Crispin [this message]
     [not found] ` <4ECF9DA8.8000504-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2011-11-29 14:42   ` RFC of_boardconfig Rob Herring
     [not found]     ` <4ED4EF4D.4080806-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-11-29 16:22       ` John Crispin

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=4ECF9DA8.8000504@openwrt.org \
    --to=blogic-p3rkhjxn3npafugrpc6u6w@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.