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] [PATCH] add new board vl_ma2sc
Date: Mon, 16 Jan 2012 09:21:30 +0100	[thread overview]
Message-ID: <4F13DE0A.6020604@denx.de> (raw)
In-Reply-To: <1326699684-3035-1-git-send-email-esw@bus-elektronik.de>

Hello Jens,

Jens Scharsig wrote:
> * add support for board VL+MA2SC
> * adds vl_ma2sc_config for standard NOR boot configuration
> * adds vl_ma2sc_ram_config for RAM load configuration
> 
> Signed-off-by: Jens Scharsig <esw@bus-elektronik.de>
> ---
>  MAINTAINERS                   |    1 +
>  board/BuS/vl_ma2sc/Makefile   |   54 ++++
>  board/BuS/vl_ma2sc/vl_ma2sc.c |  596 +++++++++++++++++++++++++++++++++++++++++
>  boards.cfg                    |    2 +
>  include/configs/vl_ma2sc.h    |  466 ++++++++++++++++++++++++++++++++
>  5 files changed, 1119 insertions(+), 0 deletions(-)
>  create mode 100644 board/BuS/vl_ma2sc/Makefile
>  create mode 100644 board/BuS/vl_ma2sc/vl_ma2sc.c
>  create mode 100644 include/configs/vl_ma2sc.h

Please check your patch with tools/checkpatch, it shows a lot
of warnings:

[hs at pollux u-boot]$ ./tools/checkpatch.pl index.html
[...]
total: 17 errors, 13 warnings, 1131 lines checked

> diff --git a/board/BuS/vl_ma2sc/vl_ma2sc.c b/board/BuS/vl_ma2sc/vl_ma2sc.c
> new file mode 100644
> index 0000000..dfaf2cb
> --- /dev/null
> +++ b/board/BuS/vl_ma2sc/vl_ma2sc.c
> @@ -0,0 +1,596 @@
> +/*
> + * Miscelaneous platform dependent initialisations
> + */
> +

empty line not needed.

[...]
> +#ifdef CONFIG_CMD_NAND
> +static void vl_ma2sc_nand_hw_init(void)
> +{
> +	unsigned long csa;
> +	at91_smc_t	*smc	= (at91_smc_t *) ATMEL_BASE_SMC0;
> +	at91_matrix_t	*matrix = (at91_matrix_t *) ATMEL_BASE_MATRIX;
> +	at91_pmc_t	*pmc	= (at91_pmc_t *) ATMEL_BASE_PMC;
> +
> +	at91_set_pio_output(AT91_PIO_PORTA, 13, 1);	/* CAN_TX -> H */
> +	at91_set_pio_output(AT91_PIO_PORTA, 12, 1);	/* CAN_STB -> H */
> +	at91_set_pio_output(AT91_PIO_PORTA, 11, 1);	/* CAN_EN -> H */
> +
> +	/* Enable CS3 */
> +	csa = readl(&matrix->csa[0]) | AT91_MATRIX_CSA_EBI_CS3A;
> +	writel(csa, &matrix->csa[0]);
> +
> +	/* Configure SMC CS3 for NAND/SmartMedia */
> +#if 1
> +	writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
> +		AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
> +		&smc->cs[3].setup);
> +
> +	writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
> +		AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
> +		&smc->cs[3].pulse);
> +
> +	writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
> +		&smc->cs[3].cycle);
> +	writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
> +		AT91_SMC_MODE_DBW_8 |
> +		AT91_SMC_MODE_TDF_CYCLE(2),
> +		&smc->cs[3].mode);
> +#else

don't add dead code.

> +#ifdef CONFIG_MACB
> +static void vl_ma2sc_macb_hw_init(void)
> +{
> +	unsigned long	erstl;
> +	at91_pmc_t	*pmc	= (at91_pmc_t *) ATMEL_BASE_PMC;
> +	at91_pio_t	*pio	= (at91_pio_t *) ATMEL_BASE_PIO;
> +	at91_rstc_t	*rstc	= (at91_rstc_t *) ATMEL_BASE_RSTC;
> +	/* Enable clock */
> +	writel(1 << ATMEL_ID_EMAC, &pmc->pcer);
> +
> +	/*
> +	 * Disable pull-up on:
> +	 *	RXDV (PC25) => PHY normal mode (not Test mode)
> +	 *	ERX0 (PE25) => PHY ADDR0
> +	 *	ERX1 (PE26) => PHY ADDR1 => PHYADDR = 0x0
> +	 *
> +	 * PHY has internal pull-down
> +	 */
> +
> +	writel((1 << 25), &pio->pioc.pudr);
> +	writel((1 << 25) | (1 << 26), &pio->pioe.pudr);

please use defines here for 25 and 26

[...]
> +#ifdef CONFIG_MISC_INIT_R
> +
> +int misc_init_r(void)
> +{
> +	uchar	buffer[8];
> +	at91_pio_t	*pio = (at91_pio_t *) ATMEL_BASE_PIO;
> +	u32		pin;
> +
> +	buffer[0] = 0x04;
> +	buffer[1] = 0x00;
> +	if (i2c_write(0x68, 0x0E, 1, buffer, 2) != 0)
> +		puts("error reseting rtc clock\n\0");
> +
> +	/* HWversion lesen */

no german please ;-)

> +

no empty line here needed.

[...]
> diff --git a/include/configs/vl_ma2sc.h b/include/configs/vl_ma2sc.h
> new file mode 100644
> index 0000000..d9c2a2d
> --- /dev/null
> +++ b/include/configs/vl_ma2sc.h
> @@ -0,0 +1,466 @@
[...]
> +
> +#endif
> +
> +/* EOF */

This comment is not needed.

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

  reply	other threads:[~2012-01-16  8:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16  7:41 [U-Boot] [PATCH] add new board vl_ma2sc Jens Scharsig
2012-01-16  8:21 ` Heiko Schocher [this message]
2012-01-16  8:51   ` Jens Scharsig
2012-01-16  9:41     ` Heiko Schocher
2012-01-16  9:57 ` Mike Frysinger
2012-01-16 10:22 ` [U-Boot] [PATCH V2] " Jens Scharsig
2012-07-07 11:06   ` Albert ARIBAUD

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=4F13DE0A.6020604@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.