From: Tom <Tom.Rix@windriver.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] Add support for EDB93xx boards
Date: Sun, 31 Jan 2010 13:00:53 -0600 [thread overview]
Message-ID: <4B65D365.90000@windriver.com> (raw)
In-Reply-To: <20100124165641.GW18402@darwin>
Matthias Kaehlcke wrote:
> Added support for the following EDB93xx boards:
>
> EDB9301
> EDB9302
> EDB9302A
> EDB9307
> EDB9307A
> EDB93012
> EDB9315
> EDB9315A
>
> Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
> ---
> MAINTAINERS | 10 ++
> MAKEALL | 8 ++
> Makefile | 10 ++
> board/edb93xx/Makefile | 50 ++++++++
> board/edb93xx/config.mk | 33 +++++
> board/edb93xx/early_udelay.h | 34 +++++
> board/edb93xx/edb93xx.c | 109 +++++++++++++++++
> board/edb93xx/flash_cfg.c | 38 ++++++
> board/edb93xx/pll_cfg.c | 58 +++++++++
> board/edb93xx/pll_cfg.h | 72 +++++++++++
> board/edb93xx/sdram_cfg.c | 117 ++++++++++++++++++
> board/edb93xx/sdram_cfg.h | 144 ++++++++++++++++++++++
> include/configs/edb93xx.h | 273 ++++++++++++++++++++++++++++++++++++++++++
> 13 files changed, 956 insertions(+), 0 deletions(-)
> create mode 100644 board/edb93xx/Makefile
> create mode 100644 board/edb93xx/config.mk
> create mode 100644 board/edb93xx/early_udelay.h
> create mode 100644 board/edb93xx/edb93xx.c
> create mode 100644 board/edb93xx/flash_cfg.c
> create mode 100644 board/edb93xx/pll_cfg.c
> create mode 100644 board/edb93xx/pll_cfg.h
> create mode 100644 board/edb93xx/sdram_cfg.c
> create mode 100644 board/edb93xx/sdram_cfg.h
> create mode 100644 include/configs/edb93xx.h
>
<snip>
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -554,6 +554,14 @@ LIST_ARM9=" \
> cp946es \
> cp966 \
> da830evm \
> + edb9301 \
> + edb9302 \
> + edb9302a \
> + edb9307 \
> + edb9307a \
ws trailing space
> + edb9312 \
> + edb9315 \
> + edb9315a \
<snip>
> +
> +int dram_init(void)
> +{
> + unsigned int *src, *dst;
> + int i;
> +
> + for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
> + const ulong bank_size = get_ram_size((long *)bank_addr[i],
> + MAX_BANK_SIZE);
> + if (bank_size) {
> + gd->bd->bi_dram[i].start = bank_addr[i];
> + gd->bd->bi_dram[i].size = bank_size;
> + }
> + }
> +
> + /* copy exception vectors */
> + src = (unsigned int *)_armboot_start;
> +
> +#ifdef CONFIG_EDB93XX_SDCS3
> + dst = (unsigned int *)0x00000000;
> +#else
> + dst = (unsigned int *)0xc0000000;
> +#endif
This could be reduced to
dst = (unsigned int *)PHYS_SDRAM_1;
> + memcpy(dst, src, 16 * sizeof(unsigned int));
> +
> + return 0;
> +}
<snip>
> --- /dev/null
> +++ b/board/edb93xx/pll_cfg.h
> @@ -0,0 +1,72 @@
> +/*
> + * PLL register values for Cirrus edb93xx boards
> + *
> + * Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include <config.h>
> +#include <asm/arch/ep93xx.h>
> +
> +#if defined(CONFIG_EDB9301) || defined(CONFIG_EDB9302) || \
> + defined(CONFIG_EDB9302A)
> +/*
> + * fclk_div: 2, nbyp1: 1, hclk_div: 5, pclk_div: 2
> + * pll1_x1: 294912000.000000, pll1_x2ip: 36864000.000000,
> + * pll1_x2: 331776000.000000, pll1_out: 331776000.000000
> + */
> +#define CLKSET1_VAL (7 << SYSCON_CLKSET_PLL_X2IPD_SHIFT | \
> + 8 << SYSCON_CLKSET_PLL_X2FBD2_SHIFT | \
> + 19 << SYSCON_CLKSET_PLL_X1FBD1_SHIFT | \
> + 1 << SYSCON_CLKSET1_PCLK_DIV_SHIFT | \
> + 3 << SYSCON_CLKSET1_HCLK_DIV_SHIFT | \
> + SYSCON_CLKSET1_NBYP1 | \
> + 1 << SYSCON_CLKSET1_FCLK_DIV_SHIFT)
ws trailing spaces
Other macros have similar issues
> +#elif defined(CONFIG_EDB9307) || defined(CONFIG_EDB9307A) ||\
> + defined CONFIG_EDB9312 || defined(CONFIG_EDB9315) ||\
> + defined(CONFIG_EDB9315A)
> +/*
> + * fclk_div: 2, nbyp1: 1, hclk_div: 4, pclk_div: 2
> + * pll1_x1: 3096576000.000000, pll1_x2ip: 129024000.000000,
> + * pll1_x2: 3999744000.000000, pll1_out: 1999872000.000000
> + */
<snip>
> +static void setup_refresh_timer(void)
> +{
> + struct sdram_regs *sdram = (struct sdram_regs *)SDRAM_BASE;
> +
> + /* Load refresh timer with 10 to issue refresh every 10 cycles */
> + writel(0x0a, &sdram->refrshtimr);
> +
> + /*
> + * Wait at least 80 clock cycles to provide 8 refresh cycles
> + * to all SDRAMs
> + */
> + early_udelay(1);
> +
> + /*
> + * Program refresh timer with normal value
> + * We need 8192 refresh cycles every 64ms
> + * at 15ns (HCLK >= 66MHz) per cycle:
> + * 64ms / 8192 = 7.8125us
> + * 7.8125us / 15ns = 520 (0x208)
> + */
Good comment!
> + /*
> + * TODO: redboot uses 0x1e0 for the slowest possible device
> + * but i don't understand how this value is calculated
> + */
> + writel(0x208, &sdram->refrshtimr);
> +}
> +
> +static void program_mode_registers(void)
> +{
> + PROGRAM_MODE_REG(0);
> +
It looks like all this macros is doing is reading memory.
Is this correct ?
If so, please add a comment
> +#if (CONFIG_NR_DRAM_BANKS >= 2)
> + PROGRAM_MODE_REG(1);
> +#endif
> +
> +#if (CONFIG_NR_DRAM_BANKS >= 3)
> + PROGRAM_MODE_REG(2);
> +#endif
> +
> +#if (CONFIG_NR_DRAM_BANKS == 4)
> + PROGRAM_MODE_REG(3);
> +#endif
> +}
<snip>
> +#define CONFIG_SYS_MEMTEST_START 0xc0100000
> +#define CONFIG_SYS_MEMTEST_END 0xc1e00000
> +#endif
> +
> +#if defined(CONFIG_EDB93XX_SDCS3)
> +#define CONFIG_SYS_LOAD_ADDR 0x01000000 /* Default load address */
> +#elif defined(CONFIG_EDB93XX_SDCS0)
> +#define CONFIG_SYS_LOAD_ADDR 0xc1000000 /* Default load address */
> +#endif
This could be reduced to
+#define CONFIG_SYS_LOAD_ADDR (PHYS_SDRAM_1 + 0x01000000) /* Default load address */
Tom
next prev parent reply other threads:[~2010-01-31 19:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1264351928.git.matthias@kaehlcke.net>
2010-01-24 16:56 ` [U-Boot] [PATCH 1/3] ARM: Add support for EP93xx SoCs Matthias Kaehlcke
2010-01-31 18:53 ` Tom
2010-02-01 7:24 ` Matthias Kaehlcke
2010-01-24 16:56 ` [U-Boot] [PATCH 2/3] Add EP93xx ethernet driver Matthias Kaehlcke
2010-01-25 4:09 ` Ben Warren
2010-01-24 16:56 ` [U-Boot] [PATCH 3/3] Add support for EDB93xx boards Matthias Kaehlcke
2010-01-31 19:00 ` Tom [this message]
[not found] <cover.1265053904.git.matthias@kaehlcke.net>
2010-02-01 20:29 ` Matthias Kaehlcke
[not found] <cover.1264955406.git.matthias@kaehlcke.net>
2010-01-31 16:39 ` Matthias Kaehlcke
[not found] <cover.1263903884.git.matthias@kaehlcke.net>
2010-01-19 19:16 ` Matthias Kaehlcke
2010-01-19 21:58 ` Wolfgang Denk
2009-12-23 19:26 [U-Boot] [PATCH 3/3] Add support for EDB93XX boards Matthias Kaehlcke
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=4B65D365.90000@windriver.com \
--to=tom.rix@windriver.com \
--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.