[U-Boot] [PATCH 2/2 V3] Changes to move hawkboard to the new spl infrastructure.

Christian Riesch christian.riesch at omicron.at
Wed Jan 11 17:10:46 CET 2012


Hello Sughosh,
I did a quick test on the da850evm with the SPL for booting from SPI
and it worked. I have a few comments below.

On Wed, Jan 11, 2012 at 3:37 PM, Sughosh Ganu <urwithsughosh at gmail.com> wrote:
> This patch moves hawkboard to the new spl infrastructure from the
> older nand_spl one.
>
> Removed the hawkboard_nand_config build option -- The spl code now
> gets compiled with hawkboard_config, after building the main u-boot
> image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
> to reflect the same.
>
> Signed-off-by: Sughosh Ganu <urwithsughosh at gmail.com>
> Signed-off-by: Heiko Schocher <hs at denx.de>
> Cc: Heiko Schocher <hs at denx.de>
> Cc: Christian Riesch <christian.riesch at omicron.at>
> Cc: Sudhakar Rajashekhara <sudhakar.raj at ti.com>
> Cc: Tom Rini <trini at ti.com>
> ---
>
> Changes since V2
> * Made changes to fix build break on enbw_cmc board.
> * Replaced defines used for conditionally compiling code in
>  da850_lowlevel.c to the ones suggested by Heiko.
> * Removed unwanted defines from the config files which were added in
>  V1.
>
> Changes since V1
> * Use a common file instead of board specific files for spl,
> based on review comments from Christian and Heiko.
>
>  arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c    |   23 ++--
>  arch/arm/cpu/arm926ejs/davinci/spl.c               |    4 +-
>  arch/arm/include/asm/arch-davinci/da850_lowlevel.h |    9 +
>  board/davinci/da8xxevm/da850evm.c                  |    4 +-
>  board/davinci/da8xxevm/hawkboard.c                 |   23 +++
>  board/davinci/da8xxevm/hawkboard_nand_spl.c        |  115 ---------------
>  .../{u-boot-spl.lds => u-boot-spl-da850evm.lds}    |    0
>  .../davinci/da8xxevm/u-boot-spl-hawk.lds           |   22 ++-
>  board/enbw/enbw_cmc/enbw_cmc.c                     |   13 +--
>  boards.cfg                                         |    1 -
>  doc/README.hawkboard                               |   43 +++---
>  include/configs/da850evm.h                         |    5 +-
>  include/configs/enbw_cmc.h                         |    2 +
>  include/configs/hawkboard.h                        |   23 +++-
>  nand_spl/board/davinci/da8xxevm/Makefile           |  155 --------------------
>  15 files changed, 111 insertions(+), 331 deletions(-)
>  delete mode 100644 board/davinci/da8xxevm/hawkboard_nand_spl.c
>  rename board/davinci/da8xxevm/{u-boot-spl.lds => u-boot-spl-da850evm.lds} (100%)
>  rename nand_spl/board/davinci/da8xxevm/u-boot.lds => board/davinci/da8xxevm/u-boot-spl-hawk.lds (86%)
>  delete mode 100644 nand_spl/board/davinci/da8xxevm/Makefile
>
> diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> index a532f8a..a404916 100644
> --- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> +++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> @@ -32,6 +32,7 @@
>  #include <asm/arch/emif_defs.h>
>  #include <asm/arch/pll_defs.h>
>
> +#if defined(CONFIG_SYS_DA850_DDR_INIT)

When CONFIG_SYS_DA850_DDR_INIT is not defined, you also remove the PLL
initialization functions with this ifdef. I think this is not very
beautiful since there is a separate CONFIG_SYS_DA850_PLL_INIT. Please
put #if defined(CONFIG_SYS_DA850_DDR_INIT) only around DDR
initialization functions and #if defined(CONFIG_SYS_DA850_PLL_INIT)
around the PLL init functions instead.

>  void da850_waitloop(unsigned long loopcnt)
>  {
>        unsigned long   i;
> @@ -235,6 +236,7 @@ int da850_ddr_setup(void)
>
>        return 0;
>  }
> +#endif /* CONFIG_SYS_DA850_DDR_INIT */
>
>  __attribute__((weak))
>  void board_gpio_init(void)
> @@ -242,10 +244,6 @@ void board_gpio_init(void)
>        return;
>  }
>
> -/* pinmux_resource[] vector is defined in the board specific file */
> -extern const struct pinmux_resource pinmuxes[];
> -extern const int pinmuxes_size;
> -
>  int arch_cpu_init(void)
>  {
>        /* Unlock kick registers */
> @@ -259,13 +257,11 @@ int arch_cpu_init(void)
>        if (davinci_configure_pin_mux_items(pinmuxes, pinmuxes_size))
>                return 1;
>
> +#if defined(CONFIG_SYS_DA850_PLL_INIT)
>        /* PLL setup */
>        da850_pll_init(davinci_pllc0_regs, CONFIG_SYS_DA850_PLL0_PLLM);
>        da850_pll_init(davinci_pllc1_regs, CONFIG_SYS_DA850_PLL1_PLLM);
> -
> -       /* GPIO setup */
> -       board_gpio_init();
> -
> +#endif
>        /* setup CSn config */
>  #if defined(CONFIG_SYS_DA850_CS2CFG)
>        writel(CONFIG_SYS_DA850_CS2CFG, &davinci_emif_regs->ab1cr);
> @@ -274,7 +270,15 @@ int arch_cpu_init(void)
>        writel(CONFIG_SYS_DA850_CS3CFG, &davinci_emif_regs->ab2cr);
>  #endif
>
> -       lpsc_on(CONFIG_SYS_DA850_LPSC_UART);
> +       da8xx_configure_lpsc_items(lpsc, lpsc_size);
> +#if defined(CONFIG_SYS_DA850_DDR_INIT)
> +       da850_ddr_setup();
> +#endif
> +
> +       /* GPIO setup */
> +       board_gpio_init();
> +
> +
>        NS16550_init((NS16550_t)(CONFIG_SYS_NS16550_COM1),
>                        CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
>
> @@ -286,6 +290,5 @@ int arch_cpu_init(void)
>                DAVINCI_UART_PWREMU_MGMT_UTRST),
>               &davinci_uart2_ctrl_regs->pwremu_mgmt);
>
> -       da850_ddr_setup();

Why are you changing the order of these initializations? It worked on
the da850evm but I hope it doesn't break something else.

>        return 0;
>  }

[...]

> diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
> index fcbbace..68bdbbe 100644
> --- a/include/configs/da850evm.h
> +++ b/include/configs/da850evm.h
> @@ -44,6 +44,8 @@
>  #define CONFIG_SYS_HZ                  1000
>  #define CONFIG_SKIP_LOWLEVEL_INIT
>  #define CONFIG_SYS_TEXT_BASE           0xc1080000
> +#define CONFIG_SYS_DA850_PLL_INIT
> +#define CONFIG_SYS_DA850_DDR_INIT
>
>  /*
>  * Memory Info
> @@ -142,7 +144,6 @@
>  #define CONFIG_CONS_INDEX      1               /* use UART0 for console */
>  #define CONFIG_BAUDRATE                115200          /* Default baud rate */
>  #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
> -#define CONFIG_SYS_DA850_LPSC_UART DAVINCI_LPSC_UART2

Please do this (removing the line above) also for the enbw_cmc board.

Thank you!
Regards, Christian


More information about the U-Boot mailing list