All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH] arm, davinci: Remove board specific code from da850_lowlevel.c
Date: Wed, 09 Nov 2011 09:33:12 +0100	[thread overview]
Message-ID: <4EBA3AC8.6040600@denx.de> (raw)
In-Reply-To: <CABkLObpT4SQp=NvjKtobzRrxD0Rd6fv3GsO3hFQbcJSwY-khdQ@mail.gmail.com>

Hello Christian,

Christian Riesch wrote:
> Hello Heiko,
> Thank you for your reply!
> 
> On Wed, Nov 9, 2011 at 6:37 AM, Heiko Schocher <hs@denx.de> wrote:
>> Hello Christian,
>>
>> Christian Riesch wrote:
>>> Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
>>> ---
>>>
>>> Hello Heiko,
>>>
>>> On my board I cannot use your code in arch_cpu_init() in da850_lowlevel.c
>>> since I have different versions of my board with different input
>>> clock frequencies. Here u-boot should first determine the board
>>> revision number and then configure the SoC accordingly. Therefore I would
>>> like to move all board-specific parts (and PLL and memory configuration is
>>> board-specific since it depends on the memory chips and oscillators
>>> deployed on the board) to board_early_init_f which is called right after
>>> arch_cpu_init() and keep only a few initializiation steps in arch_cpu_init().
>> Ok, if you have other needs on your board we must change something.
>> But I want to prevent, that all the code you remove in your patch is
>> moved to board code, so all boards must (copy?) it. Instead you should
>> move it to a weak function, which you can replace for your specific
>> needs. (I thought the code was common enough ...)
>>
>> What do you think?
> 
> That's fine for me, I tried it now with
> 
> __attribute__((weak))  int arch_cpu_init(void)
> 
> and added my own arch_cpu_init() to my board specific file.
> 
> Of course I had to add all those CONFIG_SYS_DA850_PINMUXn with dummy
> values to my board config file to make it build... I don't like those
> defines because the values are difficult to read and we already have

Why? They are in sync with the doc ...

> code for pinmuxing in board/davinci/common/davinci_pinmux.c so it is
> duplicate code. Couldn't we move this davinci_pinmux.c to
> arch/arm/cpu/arm926ejs/davinci and use it instead? What do you think?

Hmm.. if you use the http://www-s.ti.com/sc/techlit/spraba2.zip
utility from ti, you exactly get the values for the defines ...
so I prefered to go this way, but have no real objections against
using the code from board/davinci/common/davinci_pinmux.c
(Of course, it should be moved to arch/arm/cpu/arm926ejs/davinci)

added Sandeep to cc. Sandeep, what do you think?

> I'll submit a patch for adding the weak attribute.

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2011-11-09  8:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-08  9:39 [U-Boot] [RFC PATCH] arm, davinci: Remove board specific code from da850_lowlevel.c Christian Riesch
2011-11-09  5:37 ` Heiko Schocher
2011-11-09  6:47   ` Wolfgang Denk
2011-11-09  8:18   ` Christian Riesch
2011-11-09  8:33     ` Heiko Schocher [this message]
2011-11-09 21:30       ` Paulraj, Sandeep

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=4EBA3AC8.6040600@denx.de \
    --to=hs@denx.de \
    --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.