All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 16/19] ARM: SPL: Convert davinci to CONFIG_SPL_FRAMEWORK
Date: Thu, 23 Aug 2012 07:07:04 -0700	[thread overview]
Message-ID: <50363908.1080205@ti.com> (raw)
In-Reply-To: <CABkLObrU-jp4kEC+MP5a6XNhQt=54CpQvhyR03nrJcbBR90w0Q@mail.gmail.com>

On 08/23/2012 06:14 AM, Christian Riesch wrote:
> Hi Tom,
> 
> On Thu, Aug 23, 2012 at 1:19 AM, Tom Rini <trini@ti.com> wrote:
>> - Convert the non-relocation part of board_init_f to spl_board_init,
>>   turn on CONFIG_SPL_BOARD_INIT in the configs.
>> - Remove duplicated code.
>> - Add spl_boot_device() that returns the statically chosen boot device.
>>
>> Signed-off-by: Tom Rini <trini@ti.com>
> [...]
>> diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/spl.c
>> index 74632e5..46c0bfd 100644
>> --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
>> +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
>> @@ -21,6 +21,7 @@
>>   * MA 02111-1307 USA
>>   */
>>  #include <common.h>
>> +#include <spl.h>
>>  #include <asm/u-boot.h>
>>  #include <asm/utils.h>
>>  #include <nand.h>
>> @@ -29,14 +30,7 @@
>>  #include <malloc.h>
>>  #include <spi_flash.h>
>>
>> -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>> -
>> -DECLARE_GLOBAL_DATA_PTR;
>> -/* Define global data structure pointer to it*/
>> -static gd_t gdata __attribute__ ((section(".data")));
>> -static bd_t bdata __attribute__ ((section(".data")));
>> -
>> -#else
>> +#ifndef CONFIG_SPL_LIBCOMMON_SUPPORT
>>
>>  void puts(const char *str)
>>  {
>> @@ -54,43 +48,37 @@ void putc(char c)
>>
>>  #endif /* CONFIG_SPL_LIBCOMMON_SUPPORT */
>>
>> -inline void hang(void)
>> -{
>> -       puts("### ERROR ### Please RESET the board ###\n");
>> -       for (;;)
>> -               ;
>> -}
>> -
>>  void board_init_f(ulong dummy)
>>  {
>> +       /* First, perform our low-level init. */
>>  #ifdef CONFIG_SOC_DM365
>>         dm36x_lowlevel_init(0);
>>  #endif
>>  #ifdef CONFIG_SOC_DA8XX
>>         arch_cpu_init();
>>  #endif
>> -       relocate_code(CONFIG_SPL_STACK, NULL, CONFIG_SPL_TEXT_BASE);
>> +
>> +       /*
>> +        * Next we call relocate_code() with relocation target same as the
>> +        * CONFIG_SYS_SPL_TEXT_BASE. This will result in relocation getting
>> +        * skipped. Instead, only .bss initialization will happen.
>> +        */
>> +       relocate_code(CONFIG_SPL_STACK, &gdata, CONFIG_SPL_TEXT_BASE);
>>  }
>>
>> -void board_init_r(gd_t *id, ulong dummy)
>> +void spl_board_init(void)
>>  {
>> -#ifdef CONFIG_SPL_NAND_LOAD
>> -       nand_init();
>> -       puts("Nand boot...\n");
>> -       nand_boot();
>> -#endif
>> -#ifdef CONFIG_SPL_SPI_LOAD
>> -       mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
>> -                       CONFIG_SYS_MALLOC_LEN);
>> -
>> -       gd = &gdata;
>> -       gd->bd = &bdata;
>> -       gd->flags |= GD_FLG_RELOC;
>> -       gd->baudrate = CONFIG_BAUDRATE;
>> -       serial_init();          /* serial communications setup */
>> -       gd->have_console = 1;
>> +       preloader_console_init();
>> +}
>>
>> -       puts("SPI boot...\n");
>> -       spi_boot();
>> +u32 spl_boot_device(void)
>> +{
>> +#ifdef CONFIG_SPL_NAND_LOAD
>> +       return BOOT_DEVICE_NAND;
>> +#elif defined(CONFIG_SPL_SPI_LOAD)
>> +       return BOOT_DEVICE_SPI;
>> +#else
> 
> This will not apply on u-boot-ti since it is missing the MMC-SPL
> patches that have already been merged, right?

Indeed, there will be a certain amount of merge-pain I will have to deal
with to get this to apply.  There's also conflicts with some of the
am33xx enhancements there or that I plan to push there shortly.

-- 
Tom

  reply	other threads:[~2012-08-23 14:07 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 23:19 [U-Boot] [PATCH v3 0/19] ARM: SPL: Make more generic, merge DaVinci and OMAP Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 01/19] Makefile: Move SPL files to clobber, remove from clean Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 02/19] spl_mmc: Make FAT checks / calls guarded with CONFIG_SPL_FAT_SUPPORT Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 03/19] omap-common: SPL: Add CONFIG_SPL_DISPLAY_PRINT / spl_display_print() Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 04/19] omap-common: Fix typo in save_boot_params() in lowlevel_init.S Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 05/19] ARM: SPL: Rename omap_boot_device to spl_boot_device Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 06/19] ARM: SPL: Rename omap_boot_mode to spl_boot_mode() Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 07/19] ARM: SPL: Remove NAND_MODE_HW_ECC from spl_nand.c Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 08/19] ARM: SPL: Only call mem_malloc_init if configured Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 09/19] ARM: SPL: Add <asm/spl.h> and <asm/arch/spl.h> Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 10/19] ARM: SPL: Make spl_mmc.c more generic Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 11/19] ARM: SPL: Clean up spl.c / spl_nand.c slightly Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 12/19] ARM: SPL: Start hooking in the current SPI SPL support Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 13/19] ARM: SPL: Move gpmc_init() to spl_board_init() Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 14/19] SPL: Move the omap SPL framework to common/spl Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 15/19] spl: Make CONFIG_SPL_FRAMEWORK board_init_f __weak Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 16/19] ARM: SPL: Convert davinci to CONFIG_SPL_FRAMEWORK Tom Rini
2012-08-23 13:14   ` Christian Riesch
2012-08-23 14:07     ` Tom Rini [this message]
2012-08-22 23:19 ` [U-Boot] [PATCH v3 17/19] da850: Add README.da850 Tom Rini
2012-08-23 12:52   ` Christian Riesch
2012-08-23 16:17     ` Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 18/19] SPL: Enhance drivers/mtd/nand/nand_spl_load.c Tom Rini
2012-08-22 23:19 ` [U-Boot] [PATCH v3 19/19] SPL: Enhance spi_spl_load to match the other load functions Tom Rini
2012-08-23  5:18 ` [U-Boot] [PATCH v3 0/19] ARM: SPL: Make more generic, merge DaVinci and OMAP Prabhakar Lad
2012-08-23 11:22 ` Stefan Roese
2012-08-23 12:22 ` Stefano Babic
2012-08-23 12:33 ` Christian Riesch

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=50363908.1080205@ti.com \
    --to=trini@ti.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.