From 2d8f163530f27681f7a763096dde46060c84aaf8 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 14 Jan 2016 10:03:55 +0100 Subject: [PATCH] ARM: zynq: Sync SPL support with mainline 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 --- arch/arm/mach-zynq/u-boot-spl.lds | 53 ++++++++----------------------- fs/fat/fat.c | 9 ------ include/configs/zynq-common.h | 1 - 3 files changed, 14 insertions(+), 49 deletions(-) diff --git a/arch/arm/mach-zynq/u-boot-spl.lds b/arch/arm/mach-zynq/u-boot-spl.lds index 4fb3b0b5cb0..ecdf6a031ec 100644 --- a/arch/arm/mach-zynq/u-boot-spl.lds +++ b/arch/arm/mach-zynq/u-boot-spl.lds @@ -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 diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 36d07b4eef8..ce9b0f95c81 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -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 diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index e8423f3a49e..07c80afae19 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -525,7 +525,6 @@ #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 */ -- 2.47.3