All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tapani <tapani@technexion.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Add support for TechNexion edm1-cf-imx6 SoM
Date: Wed, 4 Sep 2013 19:21:18 +0800	[thread overview]
Message-ID: <20130904192118.71107dc1@triceratops> (raw)
In-Reply-To: <5220AF90.8080909@denx.de>


Stefano,

On Fri, 30 Aug 2013 16:43:28 +0200 Stefano Babic <sbabic@denx.de> wrote:

> Hi Tapani,
> > 
> > On some things we probably need some clarification, see inlined responses
> > to some of your questions.
> > 
> 
> I hope I can help you.
> 

Well, we start to get it. Correct us if we are wrong.

> 
> Ma main concern iy your patchset is that the tables must be maintained
> and duplicated in the source code. However, on the board if a pin is
> dedicated to a specific function, it will be dedicated for the same
> function even with the other variants of the processor.
> 

We agree fully. Again, no need to beat a dead horse. :-)

The reason our patch used duplicate tables was because of the way our original
idea was received on the u-boot mailing list. It had the definitions just once.

> Using C structure in u-boot is a strict rule - if you see, all code is
> done in this way. No new code is accepted with base + offset syntax.
> 

Are the strict rules written down somewhere, so people less involved in
u-boot development can read them before submitting?

We both know it is not valid C to use structs the way you want us to. 
It is a quirk of the compiler that it works at all. The coding standard 
for u-boot sounds to be very picky to adhere to the C standard.

Afair, Microsoft shot themselves in the foot badly assuming structs could be 
used this way in early versions of MS Office. (Wrote structs to files, but 
new versions could not load since the memory layout was different).

Sure, we might do it for the mmdc. But long term maintainable, it is not.

> > * It is a lot of effort to do struct accessors for huge tables. Both
> > of IOMUX and MMDC are large (offsets of 0x800+).
> 
> You forget that for iomuxc the job was already done - there is structure
> and functions to setup the pinmux.
> 

You would not accept code using the current iomux structure...

> > Having struct
> > accessors would take quite long to enter manually (two tables of 500+ entries 
> > each, and different between cpu types). This would be hours, if not a day of
> > braindead work without any tangible benefit.
> > 
> 
> Sorry, I see benefits in terms of readability and maintenability of the
> source code and it makes easier to add new boards. This is the reason
> why there are accessors for iomuxc(), as well as for most SOC's internal
> controller.
> 

If making the addition of new boards easier is a goal, there are other parts 
of the process that are currently a greater hurdle than writing the code. :-)

> > I could make those tables of { offset, value } and do the writels using
> > a for-loop, but that would just mariginally improve on the ugliness.
> 
> It is not what I meant - if we see the code, we can recognize the
> sequence how the DDR3 must be programmed. We can have a function
> realizing the logic (that is, wehich registers in which sequence) must
> be written, and taking as arguments the parameters (calibration, and so
> on) that for each chip are different. In other words, I would like that
> some kind of function will be moved into common code, and not here in
> board code.
>

To summarize, we are expected to:
(i) Create a more general DDR3 API for IMX6, to setup memory chips on any board?
(ii) Use the above API to redo our already working DDR setup for our board.
(iii) Rewrite the iomux struct(s) to more accurately reflect the iomux memory space. 
There is more than plain pinmuxing there. 
(iv) Rewrite any code that gets broken from changing the iomux struct(s)
(v) Use the new struct(s) in setting up memory for our board

Some of the above might need to be done differently for different cpu variants.

We are worried that we might not familiar enough with u-boot development to get 
such changes accepted in reasonable time.

Did we understand this correctly? 

regards,

Tapani

  reply	other threads:[~2013-09-04 11:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28 11:23 [U-Boot] [PATCH] Add support for TechNexion edm1-cf-imx6 SoM Tapani
2013-08-28 14:26 ` Eric Bénard
2013-08-30  5:16   ` Tapani Utriainen
2013-08-28 16:08 ` Stefano Babic
2013-08-30  5:07   ` Tapani Utriainen
2013-08-30 13:52     ` Eric Nelson
2013-08-30 14:43     ` Stefano Babic
2013-09-04 11:21       ` Tapani [this message]
2013-09-10 14:47         ` Stefano Babic
2013-11-04 17:28           ` Fabio Estevam
2013-11-04 17:37             ` Eric Nelson
2013-11-04 17:39               ` Otavio Salvador
2013-11-04 17:50               ` Stefano Babic
2013-11-05 15:12             ` Tapani

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=20130904192118.71107dc1@triceratops \
    --to=tapani@technexion.com \
    --cc=u-boot@lists.denx.de \
    /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.