]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
ARM: zynq: Sync SPL support with mainline
authorMichal Simek <michal.simek@xilinx.com>
Thu, 14 Jan 2016 09:03:55 +0000 (10:03 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 27 Jan 2016 10:50:38 +0000 (11:50 +0100)
BSS section is placed in DDR which is already up and running that's why
FAT buffers can stay there and don't need to be place to ddr section
because it is already there.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/mach-zynq/u-boot-spl.lds
fs/fat/fat.c
include/configs/zynq-common.h

index 4fb3b0b5cb0fda066eeab8c59f8756fef352437a..ecdf6a031ec31b197bc8fb799cbf1275020703cb 100644 (file)
@@ -8,13 +8,16 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
+MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
+               LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
+               LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
+
 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
 ENTRY(_start)
 SECTIONS
 {
-       . = CONFIG_SPL_TEXT_BASE;
-
        . = ALIGN(4);
        .text :
        {
@@ -22,22 +25,24 @@ SECTIONS
                *(.vectors)
                CPUDIR/start.o (.text*)
                *(.text*)
-       }
+       } > .sram
 
        . = ALIGN(4);
-       .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
+       .rodata : {
+               *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
+       } > .sram
 
        . = ALIGN(4);
        .data : {
                *(.data*)
-       }
+       } > .sram
 
        . = ALIGN(4);
 #ifdef CONFIG_SPL_DM
        .u_boot_list : {
                KEEP(*(SORT(.u_boot_list_*_driver_*)));
                KEEP(*(SORT(.u_boot_list_*_uclass_*)));
-       }
+       } > .sram
 
        . = ALIGN(4);
 #endif
@@ -46,20 +51,15 @@ SECTIONS
 
        _image_binary_end = .;
 
-       .rel.dyn : {
-               __rel_dyn_start = .;
-               *(.rel*)
-               __rel_dyn_end = .;
-       }
-
        _end = .;
 
-       .bss __rel_dyn_start (OVERLAY) : {
+       /* Move BSS section to RAM because of FAT */
+       .bss (NOLOAD) : {
                __bss_start = .;
                *(.bss*)
                 . = ALIGN(4);
                __bss_end = .;
-       }
+       } > .sdram
 
        /DISCARD/ : { *(.dynsym) }
        /DISCARD/ : { *(.dynstr*) }
@@ -67,29 +67,4 @@ SECTIONS
        /DISCARD/ : { *(.plt*) }
        /DISCARD/ : { *(.interp*) }
        /DISCARD/ : { *(.gnu*) }
-
-       /* Just random address above 1MB */
-       /* There is something wrong in fat implementation */
-       . = 0x100000;
-       .ddr (NOLOAD) :  {
-               __ddr_start = .;
-               *(.ddr*)
-                . = ALIGN(4);
-               __ddr_end = .;
-       }
 }
-
-#if defined(CONFIG_SPL_MAX_SIZE)
-ASSERT(__image_copy_end - __image_copy_start < (CONFIG_SPL_MAX_SIZE), \
-       "SPL image too big");
-#endif
-
-#if defined(CONFIG_SPL_BSS_MAX_SIZE)
-ASSERT(__bss_end - __bss_start < (CONFIG_SPL_BSS_MAX_SIZE), \
-       "SPL image BSS too big");
-#endif
-
-#if defined(CONFIG_SPL_MAX_FOOTPRINT)
-ASSERT(__bss_end - _start < (CONFIG_SPL_MAX_FOOTPRINT), \
-       "SPL image plus BSS too big");
-#endif
index 36d07b4eef8468dcbe3b7170da540b5c2ab5cf95..ce9b0f95c812ff77f9c9626e410470d484ea5809 100644 (file)
@@ -328,9 +328,6 @@ get_cluster(fsdata *mydata, __u32 clustnum, __u8 *buffer, unsigned long size)
  * Update the number of bytes read in *gotsize or return -1 on fatal errors.
  */
 #ifndef CONFIG_ZYNQ_OCM
-#if defined(CONFIG_ARCH_ZYNQ) && defined(CONFIG_SPL_BUILD)
-__section(.ddr)
-#endif
 __u8 get_contents_vfatname_block[MAX_CLUSTSIZE]
        __aligned(ARCH_DMA_MINALIGN);
 #else
@@ -587,9 +584,6 @@ static __u8 mkcksum(const char name[8], const char ext[3])
  * starting at 'startsect'
  */
 #ifndef CONFIG_ZYNQ_OCM
-#if defined(CONFIG_ARCH_ZYNQ) && defined(CONFIG_SPL_BUILD)
-__section(.ddr)
-#endif
 __u8 get_dentfromdir_block[MAX_CLUSTSIZE]
        __aligned(ARCH_DMA_MINALIGN);
 #endif
@@ -828,9 +822,6 @@ exit:
 }
 
 #ifndef CONFIG_ZYNQ_OCM
-#if defined(CONFIG_ARCH_ZYNQ) && defined(CONFIG_SPL_BUILD)
-__section(.ddr)
-#endif
 __u8 do_fat_read_at_block[MAX_CLUSTSIZE]
        __aligned(ARCH_DMA_MINALIGN);
 #endif
index e8423f3a49eb6466625c2c1eaed3d47387260a89..07c80afae19ce5dcc7929306d8d3192f0d3fe7dc 100644 (file)
 #define CONFIG_SPL_TEXT_BASE   0x0
 
 /* 3 * 64kB blocks of OCM - one is on the top because of bootrom */
-#define CONFIG_SPL_MAX_FOOTPRINT       0x30000
 #define CONFIG_SPL_MAX_SIZE    0x30000
 
 /* The highest 64k OCM address */