public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm, davinci: make arch_cpu_init() in da850_lowlevel.c weak
Date: Wed, 09 Nov 2011 11:12:17 +0100	[thread overview]
Message-ID: <20111109101217.2EAC613BE0E2@gemini.denx.de> (raw)
In-Reply-To: <1320830586-19124-1-git-send-email-christian.riesch@omicron.at>

Dear Christian Riesch,

In message <1320830586-19124-1-git-send-email-christian.riesch@omicron.at> you wrote:
> This patch allows replacing arch_cpu_init() if a custom initialization
> is required.
> 
> Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
> Cc: Sandeep Paulraj <s-paulraj@ti.com>
> Cc: Heiko Schocher <hs@denx.de>
> ---
>  arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> index 327ff97..fe142dc 100644
> --- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> +++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> @@ -263,6 +263,7 @@ void nand_boot(void)
>  #if defined(CONFIG_NAND_SPL)
>  void board_init_f(ulong bootflag)
>  #else
> +__attribute__ ((weak))
>  int arch_cpu_init(void)
>  #endif

Stop please.

This whole code is crap and needs to be changed.


281         asm("mrc        p15, 0, r0, c1, c0, 0");
282         /* clear bits 13, 9:8 (--V- --RS) */
283         asm("bic        r0, r0, #0x00002300");
284         /* clear bits 7, 2:0 (B--- -CAM) */
285         asm("bic        r0, r0, #0x00000087");
286         /* set bit 2 (A) Align */
287         asm("orr        r0, r0, #0x00000002");
288         /* set bit 12 (I) I-Cache */
289         asm("orr        r0, r0, #0x00001000");
290         asm("mcr        p15, 0, r0, c1, c0, 0");

What is #0x00002300? #0x00000087? #0x00000002? #0x00001000?

293         writel(0x83e70b13, &davinci_syscfg_regs->kick0);
294         writel(0x95a4f1e0, &davinci_syscfg_regs->kick1);

What is 0x83e70b13? 0x95a4f1e0?

296         dv_maskbits(&davinci_syscfg_regs->suspsrc,
297                 ((1 << 27) | (1 << 22) | (1 << 20) | (1 << 5) | (1 << 16)));

What is ((1 << 27) | (1 << 22) | (1 << 20) | (1 << 5) | (1 << 16))) ?

336         /*
337          * Fix Power and Emulation Management Register
338          * see sprufw3a.pdf page 37 Table 24
339          */
340         writel(readl((CONFIG_SYS_NS16550_COM1 + 0x30)) | 0x00006001,
341                 (CONFIG_SYS_NS16550_COM1 + 0x30));

What is CONFIG_SYS_NS16550_COM1 + 0x30 ???? don't we have proper
NS16550 register definitions?  And what is 0x00006001 ??


All this needs a _thorough_ cleanup before I'm willing to accept this
for mainline.


Heiko, Christian: please negotiate who performs which part of the
cleanup. But I expect that with proper symbolic names instead of the
hardwired constants the need for a wek function will go away.

Albert, please make sure to block this current code. I do not want to
see this in mainline as is.


Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Another megabytes the dust.

  reply	other threads:[~2011-11-09 10:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09  9:23 [U-Boot] [PATCH] arm, davinci: make arch_cpu_init() in da850_lowlevel.c weak Christian Riesch
2011-11-09 10:12 ` Wolfgang Denk [this message]
2011-11-09 10:18   ` Christian Riesch
2011-11-09 10:44     ` Wolfgang Denk
2011-11-09 11:17       ` Christian Riesch
2011-11-09 12:18         ` Heiko Schocher
2011-11-10 12:24           ` Christian Riesch
2011-11-09 10:44   ` Heiko Schocher
2011-11-09 11:26     ` Christian Riesch
2011-11-09 12:27       ` Heiko Schocher
2011-11-10 10:42         ` Christian Riesch

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=20111109101217.2EAC613BE0E2@gemini.denx.de \
    --to=wd@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox