[U-Boot] [PATCH 1/2] RFC: create u-boot-common.lds
Mike Frysinger
vapier at gentoo.org
Sun Feb 5 22:01:22 CET 2012
On Saturday 04 February 2012 22:02:45 Troy Kisky wrote:
> arch/blackfin/cpu/u-boot.lds
> is warranted.
yes, this change will break Blackfin boards for sure
> --- a/arch/blackfin/cpu/u-boot.lds
> +++ b/arch/blackfin/cpu/u-boot.lds
>
> MEMORY
> {
> #if CONFIG_MEM_SIZE
> - ram : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
> # define ram_code ram
> # define ram_data ram
> + ram (rwx) : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
> + l1_code : ORIGIN = L1_CODE_ORIGIN, LENGTH = L1_INST_SRAM_SIZE
> + l1_data : ORIGIN = L1_DATA_B_SRAM, LENGTH = L1_DATA_B_SRAM_SIZE
> #else
> # define ram_code l1_code
> # define ram_data l1_data
> + l1_code (rx) : ORIGIN = L1_CODE_ORIGIN, LENGTH = L1_INST_SRAM_SIZE
> + l1_data (!rx) : ORIGIN = L1_DATA_B_SRAM, LENGTH = L1_DATA_B_SRAM_SIZE
> #endif
> - l1_code : ORIGIN = L1_CODE_ORIGIN, LENGTH = L1_INST_SRAM_SIZE
> - l1_data : ORIGIN = L1_DATA_B_SRAM, LENGTH = L1_DATA_B_SRAM_SIZE
> }
i don't understand ... why is this change necessary ?
i'm not sure the attr's are correct ... the manual says "r" is "read-only"
while "w" is "read/write". so i'd expect:
ram (wx)
l1_code (x)
l1_data (w)
> + INCLUDE u-boot-common.lds
since we preprocess our linker scripts now, i'd suggest using #include rather
than INCLUDE
> --- /dev/null
> +++ b/u-boot-common.lds
>
> + . = ALIGN(4);
> + __u_boot_cmd_start = .;
> + .u_boot_cmd : {
> + KEEP(*(.u_boot_cmd))
> + }
> + __u_boot_cmd_end = .;
rather than storing this in the top level dir, i'd suggest going the linux
route and add a include/asm-generic/u-boot.lds.h header. then we can migrate
people over time and piece by piece without having to worry about breaking
everyone at once ...
that also allows us to cater to arches (like Blackfin) that have a symbol prefix
(underscore in the Blackfin case). add the VMLINUX_SYMBOL() macro, and then
this code will look like:
VMLINUX_SYMBOL(__u_boot_cmd_end) = .;
(i picked VMLINUX_SYMBOL() only because that's what Linux already has defined)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120205/24a77e89/attachment.pgp>
More information about the U-Boot
mailing list