From: Igor Grinberg <grinberg@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V3] Ethernut 5 board support
Date: Mon, 24 Oct 2011 15:15:38 +0200 [thread overview]
Message-ID: <4EA564FA.1020109@compulab.co.il> (raw)
In-Reply-To: <4EA53EEB.2040509@egnite.de>
On 10/24/2011 12:33 PM, Tim Schendekehl wrote:
> Add support for the Ethernut 5 open hardware design, based
> on Atmel's AT91SAM9XE512 SoC.
>
> V3
> - Fix issues with latest git.
>
> Signed-off-by: Tim Schendekehl <tim.schendekehl@egnite.de>
> ---
[...]
> diff --git a/board/egnite/ethernut5/Makefile b/board/egnite/ethernut5/Makefile
> new file mode 100644
> index 0000000..d8e485f
> --- /dev/null
> +++ b/board/egnite/ethernut5/Makefile
[...]
> +
> +clean:
> + rm -f $(SOBJS) $(OBJS)
> +
> +distclean: clean
> + rm -f $(LIB) core *.bak $(obj).depend
You shouldn't be adding this.
Please, see the commit 464c79207c89f247f97b344495924eabb0c9738e
(punt unused clean/distclean targets) by Mike.
[...]
> diff --git a/board/egnite/ethernut5/ethernut5.c b/board/egnite/ethernut5/ethernut5.c
> new file mode 100644
> index 0000000..50c4cb3
> --- /dev/null
> +++ b/board/egnite/ethernut5/ethernut5.c
[...]
> +#ifdef CONFIG_CMD_NAND
> +static void ethernut5_nand_hw_init(void)
> +{
> + struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
> + struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX;
> + unsigned long csa;
> +
> + /* Assign CS3 to NAND/SmartMedia Interface */
> + csa = readl(&matrix->ebicsa);
> + csa |= AT91_MATRIX_CS3A_SMC_SMARTMEDIA;
> + writel(csa, &matrix->ebicsa);
> +
> + /* Configure SMC CS3 for NAND/SmartMedia */
> + 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_EXNW_DISABLE |
> + AT91_SMC_MODE_DBW_8 |
> + AT91_SMC_MODE_TDF_CYCLE(2),
> + &smc->cs[3].mode);
> +
> +#ifdef CONFIG_SYS_NAND_READY_PIN
> + /* Ready pin is optional. */
> + at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
> +#endif
> + at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
> +
> +
Please, remove these 2 empty lines.
> +}
> +#endif
> +
> +/*
> + * This is called first during late initialization.
> + */
> +int board_init(void)
> +{
> + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
> +
> + /* Enable clocks for all PIOs */
> + writel((1 << ATMEL_ID_PIOA) | (1 << ATMEL_ID_PIOB) |
> + (1 << ATMEL_ID_PIOC),
> + &pmc->pcer);
> +
> + /* Enable ctrl+c. */
> + console_init_f();
This one has already been called in the init_sequence array.
Why do you need to call it the second time?
> + /* Set our official architecture number. */
> + gd->bd->bi_arch_number = 1971; /*MACH_TYPE_ETHERNUT5*/
This should be done in the board config file.
Please, read the README file (CONFIG_MACH_TYPE option).
> + /* Set adress of boot parameters. */
> + gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
> + /* Initialize UARTs and power management. */
> + at91_seriald_hw_init();
> + ethernut5_power_init();
> +
> + ethernut5_nand_hw_init();
> +
> +#ifdef CONFIG_HAS_DATAFLASH
> + at91_spi0_hw_init(1 << 0);
> +#endif
> + return 0;
> +}
[...]
> +#ifdef CONFIG_GENERIC_ATMEL_MCI
> +int board_mmc_init(bd_t *bd)
> +{
> + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
> +
> + /* Enable MCI clock. */
> + writel(1 << ATMEL_ID_MCI,
> + &pmc->pcer);
Why not leave this on the same line?
> +
> + /* Initialize MCI hardware. */
> + at91_mci_hw_init();
> + /* Register the device. */
> + return atmel_mci_init((void *)ATMEL_BASE_MCI);
> +}
[...]
Regards,
Igor.
prev parent reply other threads:[~2011-10-24 13:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-24 10:33 [U-Boot] [PATCH V3] Ethernut 5 board support Tim Schendekehl
2011-10-24 13:15 ` Igor Grinberg [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=4EA564FA.1020109@compulab.co.il \
--to=grinberg@compulab.co.il \
--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