mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH 1/8] ARM: rockchip: Add basic RK3288 support
Date: Thu, 21 Jul 2016 08:54:50 +0200	[thread overview]
Message-ID: <20160721065450.GT20657@pengutronix.de> (raw)
In-Reply-To: <CAHQ1cqGDDaKNH3oSFJoL86i7EBAFOnBJMEpGsNW133o8QvS=og@mail.gmail.com>

On Wed, Jul 20, 2016 at 10:52:52AM -0700, Andrey Smirnov wrote:
> On Wed, Jul 20, 2016 at 7:17 AM, Wadim Egorov <w.egorov@phytec.de> wrote:

> > +
> > +struct rk3288_cru {
> > +       struct rk3288_pll {
> > +               u32 con0;
> > +               u32 con1;
> > +               u32 con2;
> > +               u32 con3;
> > +       } pll[5];
> > +       u32 cru_mode_con;
> > +       u32 reserved0[3];
> > +       u32 cru_clksel_con[43];
> > +       u32 reserved1[21];
> > +       u32 cru_clkgate_con[19];
> > +       u32 reserved2;
> > +       u32 cru_glb_srst_fst_value;
> > +       u32 cru_glb_srst_snd_value;
> > +       u32 cru_softrst_con[12];
> > +       u32 cru_misc_con;
> > +       u32 cru_glb_cnt_th;
> > +       u32 cru_glb_rst_con;
> > +       u32 reserved3;
> > +       u32 cru_glb_rst_st;
> > +       u32 reserved4;
> > +       u32 cru_sdmmc_con[2];
> > +       u32 cru_sdio0_con[2];
> > +       u32 cru_sdio1_con[2];
> > +       u32 cru_emmc_con[2];
> > +};
> 
> I, personally, am not a big fan of using structs to describe register
> file layout since it makes it hard to figure out individual register's
> offset just by reading the code, is compiler implementation/arch
> specific (that probably wouldn't be a problem though) and goes against
> the style in which majority of Linux kernel driver code(and by
> extension Barebox) is written in.

I do not like structs over registers also, for said reasons. Also they
become really messy when different register sizes and strides get
involved, these are typically solved with ifdeffery which limits the
resulting binary to a single board.

Anyway, for some reason structs over registers are policy in U-Boot
and when sharing code like done in this clock driver it just makes it
easier to a) share it in the first place and b) keep it in sync with
U-Boot. So, I am fine with structs over registers in code copied from
U-Boot, but I won't accept original code using it.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

  reply	other threads:[~2016-07-21  6:55 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 14:17 Wadim Egorov
2016-07-20 14:17 ` [PATCH 2/8] ARM: rockchip: Add timer driver Wadim Egorov
2016-07-20 17:35   ` Andrey Smirnov
2016-07-28 11:55     ` Wadim Egorov
2016-07-28 19:12       ` Andrey Smirnov
2016-08-03  5:47       ` Sascha Hauer
2016-08-03  6:59         ` Wadim Egorov
2016-07-20 14:17 ` [PATCH 3/8] ARM: rockchip: Add early debug support for RK3288 Wadim Egorov
2016-07-20 15:03   ` Andrey Smirnov
2016-07-28 11:52     ` Wadim Egorov
2016-07-28 18:55       ` Andrey Smirnov
2016-07-20 14:17 ` [PATCH 4/8] clk: Add RK3288 clock driver Wadim Egorov
2016-07-20 14:17 ` [PATCH 5/8] mci: dw_mmc: Add RK3288 compatible string Wadim Egorov
2016-07-20 14:17 ` [PATCH 6/8] ARM: Add phyCORE-RK3288 SOM support Wadim Egorov
2016-07-20 17:57   ` Andrey Smirnov
2016-07-20 14:17 ` [PATCH 7/8] configs: Add RK3288 defconfig Wadim Egorov
2016-07-20 14:17 ` [PATCH 8/8] doc: Add RK3288 Documentation Wadim Egorov
2016-07-21  7:00   ` Sascha Hauer
2016-07-21  7:09     ` Wadim Egorov
2016-07-20 17:52 ` [PATCH 1/8] ARM: rockchip: Add basic RK3288 support Andrey Smirnov
2016-07-21  6:54   ` Sascha Hauer [this message]
2016-07-28 11:59     ` Wadim Egorov

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=20160721065450.GT20657@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox