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 10:40:26 +0100 [thread overview]
Message-ID: <488EE58A.5030707@mimc.co.uk> (raw)
In-Reply-To: <20080729102613.43804a54@hskinnemo-gx745.norway.atmel.com>
Haavard Skinnemoen wrote:
> Mark Jackson <mpfj@mimc.co.uk> wrote:
>> The MIMC200 board is based on Atmel's NGW100 dev kit,
>> but with an extra 8MByte FLASH and 128KByte FRAM.
>
> Do you have a link with some more information about the board?
Not at this moment ... it's still under development, so to speak.
> I also think your mailer mangles whitespace. Thunderbird can apparently
> be fixed; please see the instructions here:
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/email-clients.txt
I'll fix this.
>> board/atmel/mimc200/Makefile | 40 +++++++++
>> board/atmel/mimc200/config.mk | 3 +
>> board/atmel/mimc200/mimc200.c | 158 ++++++++++++++++++++++++++++++++++++
>> board/atmel/mimc200/u-boot.lds | 73 +++++++++++++++++
>
> Is this really an Atmel board? Note that the directory under "board" is
> supposed to indicate the _board_ vendor, not the chip vendor.
Urm ... no, I'll create a new vendor directory.
>> --- a/cpu/at32ap/at32ap700x/clk.c
>> +++ b/cpu/at32ap/at32ap700x/clk.c
>> @@ -65,4 +65,12 @@ void clk_init(void)
>> /* Use PLL0 as main clock */
>> sm_writel(PM_MCCTRL, SM_BIT(PLLSEL));
>> #endif
>> +
>> +#ifdef CONFIG_MIMC200
>> + // enable gclk outputs
>> + //AVR32_PM.gcctrl[0] = 0x0004; /* LVDS at 10MHz */
>> + sm_writel(PM_GCCTRL, 0x00000004);
>> + //AVR32_PM.gcctrl[1] = 0x0216; /* Ethernet at 25MHz if PLL running */
>> + //sm_writel(PM_GCCTRL + 4, 0x00000216);
>> +#endif
>
> Please define a gclk_init() function in your board file and move this
> stuff there. That's what Hammerhead ended up doing.
>
> The gclk_init() hook isn't in mainline yet. I'll create a "next" branch
> that you can base your work on in the mean time.
I've just moved it to my main board setup code.
>> +#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
>
> I'd prefer a more generic define here...or possibly some sort of
> parameter that can be passed from the board code. Let's leave that for
> later though -- this is fine for now.
Again, I've moved this to my board setup code.
>> +#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
>
> Hmm, ok, I guess you currently don't have much choice but put to those
> here. Let's make a mental note that this should be improved later.
I've actually removed this, since the extra chips contain no boot-related info / code.
>> void serial_putc(char c)
>> {
>> +#if defined(CONFIG_MIMC200_DBGLINK)
>> + // only output serial data if DEBUG link connected
>> + // this is connected to PIOE_21
>> + if (gpio_get_value(GPIO_PIN_PE21) == 0)
>> + {
>> +#endif
>
> As others have noted, this is pretty ugly. There must be a better way
> to do this...but I don't know exactly how. Moving this test to a
> separate function and providing a dummy stub for the case when
> CONFIG_MIMC200_DBGLINK is not set might be a good first step. Something like
>
<snip>
>
> Alternatively, we could do some tricks involving weak functions here
> and move the actual test into the board code.
Is there any way I can tell u-boot (on-the-fly) to enable / disable any comms output ?
If so, I could just check the "debug" link in my boot code, and adjust the u-boot comms accordingly.
> Thanks for posting this, but please Cc me when posting new avr32 board
> patches. I think I missed you first submission.
No problems. Thanks for the comments.
Mark
prev parent reply other threads:[~2008-07-29 9:40 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
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 [this message]
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=488EE58A.5030707@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox