All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Jackson <mpfj@mimc.co.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Add MIMC200 board - now uses board_eth_init()
Date: Tue, 29 Jul 2008 09:52:12 +0100	[thread overview]
Message-ID: <488EDA3C.1070101@mimc.co.uk> (raw)
In-Reply-To: <f8328f7c0807281256l5eaa9005u4428c36e145a78da@mail.gmail.com>

Ben Warren wrote:
> C++ style comments are not allowed.  Please fix them all.
>
> <snip>
>   
Okay.
>
> The prototype is:
>
> int board_eth_init(bd_t *);
>
> You'll need to return 0 if you can't get anything useful from
> macb_eth_initialize();
>
> <snip>
>   
Okay.
>
> It's frowned upon to conditionally compile board-specific code in CPU
> files.  Can this be done in your board code?
>   
I'll give it a go !!
>   
>> diff --git a/cpu/at32ap/at32ap700x/gpio.c b/cpu/at32ap/at32ap700x/gpio.c
>> index 56ba2f9..7c6679d 100644
>> --- a/cpu/at32ap/at32ap700x/gpio.c
>> +++ b/cpu/at32ap/at32ap700x/gpio.c
>> @@ -104,8 +104,10 @@ void gpio_enable_macb0(void)
>>    gpio_select_periph_A(GPIO_PIN_PC11, 0);    /* RXD2    */
>>    gpio_select_periph_A(GPIO_PIN_PC12, 0);    /* RXD3    */
>>    gpio_select_periph_A(GPIO_PIN_PC14, 0);    /* RXCK    */
>> +#ifndef CONFIG_MIMC200
>>    gpio_select_periph_A(GPIO_PIN_PC18, 0);    /* SPD    */
>> #endif
>> +#endif
>> }
>>
>> void gpio_enable_macb1(void)
>> @@ -129,8 +131,10 @@ void gpio_enable_macb1(void)
>>    gpio_select_periph_B(GPIO_PIN_PC29, 0);    /* RXD2    */
>>    gpio_select_periph_B(GPIO_PIN_PC30, 0);    /* RXD3    */
>>    gpio_select_periph_B(GPIO_PIN_PC24, 0);    /* RXCK    */
>> +#ifndef CONFIG_MIMC200
>>    gpio_select_periph_B(GPIO_PIN_PD15, 0);    /* SPD    */
>> #endif
>> +#endif
>> }
>> #endif
>>     
Should I just provide my own *complete* alternatives to these functions ?
>> diff --git a/cpu/at32ap/cpu.c b/cpu/at32ap/cpu.c
>> index 0ba8361..8985b68 100644
>> --- a/cpu/at32ap/cpu.c
>> +++ b/cpu/at32ap/cpu.c
>> @@ -56,6 +56,20 @@ int cpu_init(void)
>>    hsmc3_writel(PULSE0, 0x0b0a0906);
>>    hsmc3_writel(SETUP0, 0x00010002);
>>
>> +#ifdef CONFIG_MIMC200
>> +    // setup Data Flash chip select (NCS2)
>> +    hsmc3_writel(MODE2, 0x20121003);
>> +    hsmc3_writel(CYCLE2, 0x000a0009);
>> +    hsmc3_writel(PULSE2, 0x0a060806);
>> +    hsmc3_writel(SETUP2, 0x00030102);
>> +
>> +    // setup FRAM chip select (NCS3)
>> +    hsmc3_writel(MODE3, 0x10120001);
>> +    hsmc3_writel(CYCLE3, 0x001e001d);
>> +    hsmc3_writel(PULSE3, 0x08040704);
>> +    hsmc3_writel(SETUP3, 0x02050204);
>> +#endif
>> +
>>    clk_init();
>>     
Okay ... this can probably go in my board setup file.
>>    /* Update the CPU speed according to the PLL configuration */
>> diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c
>> index f35b997..9e131c0 100644
>> --- a/drivers/serial/atmel_usart.c
>> +++ b/drivers/serial/atmel_usart.c
>> @@ -21,6 +21,9 @@
>> #include <asm/io.h>
>> #include <asm/arch/clk.h>
>> #include <asm/arch/memory-map.h>
>> +#if defined(CONFIG_MIMC200_DBGLINK)
>> +#include <asm/arch/gpio.h>
>> +#endif
>>
>>     
> This is definitely uncool.  Don't pollute common code with your debug stuff.
>   
Right ... this one's got me stumped.  This *isn't* debug code.

In standard operation, the standard u-boot comms port will drive (e.g.) 
a printer, and we don't want any u-boot messages being printed out every 
time the unit reboots.

*But* we do want to be able to use this port for normal u-boot operation 
when units are returned for calibration / testing / repair / etc,

So we have an external link that is meant to disconnect all comms 
traffic from u-boot.

I didn't want to use u-boot's "slient boot" options, since they're 
hard-coded at compile time.  The only place I could think to this was to 
modify the atmel_usart.c file as above.

How else should I do it ?
> Looking forward to V3
>   
Me too !!

Mark

  reply	other threads:[~2008-07-29  8:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-28 19:32 [U-Boot-Users] [PATCH] Add MIMC200 board - now uses board_eth_init() Mark Jackson
2008-07-28 19:56 ` Ben Warren
2008-07-29  8:52   ` Mark Jackson [this message]
2008-07-29 20:06     ` Scott Wood
2008-07-30  9:03       ` Mark Jackson
2008-07-28 20:03 ` Jean-Christophe PLAGNIOL-VILLARD
2008-07-28 20:22   ` Scott Wood
2008-07-29 23:04     ` Wolfgang Denk
2008-07-29 23:16       ` Scott Wood
2008-07-29  8:26 ` Haavard Skinnemoen
2008-07-29  9:40   ` Mark Jackson

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=488EDA3C.1070101@mimc.co.uk \
    --to=mpfj@mimc.co.uk \
    --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.