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 2/2] arm, i.mx27: add support for magnesium board from LogicPD
Date: Thu, 04 Mar 2010 13:40:53 +0100	[thread overview]
Message-ID: <20100304124053.9F14A28BBC@gemini.denx.de> (raw)
In-Reply-To: <4B8F5D65.4070405@denx.de>

Dear Heiko Schocher,

In message <4B8F5D65.4070405@denx.de> you wrote:
> This patch adds support for the magnesium board from LogicPD.
> This board uses i.MX27 SoC and has 8MB NOR flash, 128MB NAND
> flash, FEC ethernet controller integrated into i.MX27.

The magnesium board is NOT developed by nor manufactured by LogicPD.

> 
> +magnesium_config:	unconfig
> +	@$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27

Do we need a separate make target? Can we not add this to the
imx27lite target, as you share the code anyway?

> diff --git a/board/logicpd/imx27lite/imx27lite.c b/board/logicpd/imx27lite/imx27lite.c
> index 63375d5..0c7041a 100644
> --- a/board/logicpd/imx27lite/imx27lite.c
> +++ b/board/logicpd/imx27lite/imx27lite.c
> @@ -29,6 +29,10 @@ DECLARE_GLOBAL_DATA_PTR;
>  int board_init (void)
>  {
>  	struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
> +#if defined(CONFIG_MAGNESIUM)
> +	struct system_control_regs *sc_regs =
> +		(struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
> +#endif

See below.

>  	gd->bd->bi_arch_number = MACH_TYPE_IMX27LITE;
>  	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
> @@ -43,9 +47,20 @@ int board_init (void)
>  				&regs->port[PORTC].dr);
>  #endif
>  #ifdef CONFIG_MXC_MMC
> +#if defined(CONFIG_MAGNESIUM)
> +	mx27_sd1_init_pins();
> +#else
>  	mx27_sd2_init_pins();
>  #endif
> +#endif

This is actually note a feature that depends on the board name, right?
See below.

> +#if defined(CONFIG_MAGNESIUM)
> +	/*
> +	 * set in FMCR NF_FMS Bit(5) to 1
> +	 * (NAND Flash with 2 Kbyte page size)
> +	 */
> +	writel(readl(&sc_regs->fmcr) | (1 << 5), &sc_regs->fmcr);
> +#endif

Same here. Other boards that might reuse this code might or might not
wan this,too. To avoid long listes of "#if defined(BOARD_THIS) ||
defined(BOARD_THAT) || defined(BOARD_OTHER) || .." we should introduce
a feature specific #define here - if it's really needed.

In this specific case, CONFIG_SYS_NAND_LARGEPAGE might do the job?


> @@ -68,6 +83,10 @@ int dram_init (void)
> 
>  int checkboard(void)
>  {
> +#if defined(CONFIG_MAGNESIUM)
> +	printf("LogicPD magnesium\n");
> +#else
>  	printf("LogicPD imx27lite\n");
> +#endif
>  	return 0;

As Stefano already mentioned: don't add sich an #ifdef here. Define
the board name in the board config file instead (and switch to using a
puts()).

> diff --git a/include/configs/magnesium.h b/include/configs/magnesium.h
> new file mode 100644
> index 0000000..555278a
> --- /dev/null
> +++ b/include/configs/magnesium.h
> @@ -0,0 +1,260 @@
> +/*
> + * Copyright (C) 2010 Heiko Schocher <hs@denx.de>
> + *
> + * based from:

"based on" or "derived from".


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 at denx.de
The only person who always got his work done by Friday
                                                 was Robinson Crusoe.

  parent reply	other threads:[~2010-03-04 12:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04  7:12 [U-Boot] [PATCH 2/2] arm, i.mx27: add support for magnesium board from LogicPD Heiko Schocher
2010-03-04 11:24 ` Stefano Babic
2010-03-04 12:40 ` Wolfgang Denk [this message]
2010-03-05  6:36 ` [U-Boot] [PATCH 2/2 v2] arm, i.mx27: add support for magnesium board from projectiondesign Heiko Schocher
2010-03-05 13:54   ` Stefano Babic

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=20100304124053.9F14A28BBC@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