All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton D. Kachalov <mouse@yandex-team.ru>
To: OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Platform setup via DTS
Date: Thu, 11 Aug 2016 14:27:55 +0300	[thread overview]
Message-ID: <279731470914875@webcorp01g.yandex-team.ru> (raw)

I would like to start a little discussion around board setup process in arch/arm/mach-aspeed/aspeed.c.
For most cases this process is "flat": just modifying regs one-by-one. Sometimes with applying mask.
I have an idea to add an array of "instructions" to the Device Tree in the following manner
(I hope dtc's preprocess via cpp resolve ORed macro in the correct way):

==========
#include <dt-bindings/soc/aspeed.h>

/ {
    model = "Our HW";
    compatible = "aspeed,ast2400";
    board-setup = <WR, AST_BASE_LPC | 0x9c, 0x02010023, 0>,
                           <WR, AST_BASE_SCU, SCU_PASSWORD, 0>,
                           <WR, AST_BASE_SCU | 0x80, 0xcb000000, 0>,
                           ...
                            /* write(read() | 0x1000) */
                           <OR, AST_BASE_SCU | 0x2c, 0x00001000, 0>,

                           /* write((read() &~ 0x2000) | 0x1000) */
                           <OR, AST_BASE_SCU | 0x2c, 0x00001000, 0x2000>;
==========

or in less talkative way:

==========
                            /* write((read() &~ 0) | 0xcb000000) */
                           <AST_BASE_SCU | 0x80, 0xcb000000, 0>,
                           ...
                            /* write((read() &~ 0x1000) | 0x1000) */
                           <AST_BASE_SCU | 0x2c, 0x00001000, 0x1000>,
==========

to completely eliminate board-specific init functions.


-- 
Anton D. Kachalov

             reply	other threads:[~2016-08-11 11:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11 11:27 Anton D. Kachalov [this message]
2016-08-11 11:39 ` Platform setup via DTS Anton D. Kachalov
2016-08-17  0:59 ` Joel Stanley

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=279731470914875@webcorp01g.yandex-team.ru \
    --to=mouse@yandex-team.ru \
    --cc=openbmc@lists.ozlabs.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.