[U-Boot] [PATCH v5 0/23] Create generic board init for ARM, x86, PPC

This series creates a generic board init implementation which contains the essential functions of the major arch/xxx/lib/board.c files. It is split into two parts: board_f.c for pre-relocation and board_r.c for post-relocation.
What is the motivation for this change?
1. There is a lot of repeated code in the board.c files. Any change to things like setting up the baud rate requires a change in 10 separate places.
2. Since there are 14 separate files, adding a new feature which requires initialisation is painful since it must be independently added in 14 places.
3. As time goes by the architectures naturely diverge since there is limited pressure to compare features or even CONFIG options against simiilar things in other board.c files.
4. New architectures must implement all the features all over again, and sometimes in subtley different ways. This places an unfair burden on getting a new architecture fully functional and running with U-Boot.
5. While it is a bit of a tricky change, I believe it is worthwhile and achievable. There is no requirement that all code be common, only that the code that is common should be located in common/board.c rather than arch/xxx/lib/board.c.
All the functions of board_init_f() and board_init_r() are broken into separate function calls so that they can easily be included or excluded for a particular architecture. It also makes it easier to adopt Graeme's initcall proposal assuming this comes about.
http://lists.denx.de/pipermail/u-boot/2012-January/114499.html
This series is not dependent on generic relocation. So relocation happens as one big chunk and is still completely arch-specific. See the relocation series for a proposed solution to this for ARM:
http://lists.denx.de/pipermail/u-boot/2011-December/112928.html
or x86's implementation which is in mainline. Unifying relocation is probably the next step after this series.
Instead of moving over a whole architecture, this series takes the approach of simply enabling generic board support for an architecture. It is then up to each board to opt in by defining CONFIG_SYS_GENERIC_BOARD in the board config file. If this is not done, then the code will be generated as before. This allows both sets of code to co-exist until we are comfortable with the generic approach, and enough boards run.
ARM is a relatively large board.c file and one which I can test, therefore I think it is a good target for this series. On the other hand, x86 is relatively small and simple, but different enough that it introduces a few issues to be solved. So I have chosen both ARM and x86 for this series. After a suggestion from Wolfgang I have added PPC also. This is the largest and most feature-full board, so hopefully we have all bases covered in this series. Other archs are mostly a subset of these.
A generic global_data structure is now in mainline, and this is required for this series.
Similarly we need a generic bd_info structure, since generic code will be accessing it. I have done this with a simple generic file for now.
There was dicussion on the list about passing gd_t around as a parameter to pre-relocation init functions. I think this makes sense, but it can be done as a separate change, and this series does not require it.
While this series needs to stand on its own, the goal is the unification of the board init code. So I hope we can address issues with this in mind, rather than focusing too narrowly on particular ARM, x86 or PPC issues. I have added TODO markers in places where I think there are opportunities to relationalise the board init now it is all in one place, but these don't need to be addressed for the feature to work, and are best done as smaller patches than can be reviewed by individual arch maintainers, I think.
I have run-tested ARM on Tegra Seaboard and x86/coreboot only. To try it out, define CONFIG_SYS_GENERIC_BOARD in your board file and rebuild. Most likely on PPC at least it will hang, but if you are lucky it will print something first :-) I hope to test an SPL board (snow / exynos5250) when I can get that booting from mainline.
I have run this though buildman with CONFIG_SYS_GENERIC_BOARD on for all ARM, PPC and x86 boards. The only failure is highbank (an ARM board), which seems to use SCSI but scsi_init() is not available.
Code size increases by about 1KB on ARM and about 1.3KB on PPC with generic board enabled. This is mostly due to the move to using separate functions for each part of the init, which will make it easier to move to a pure initcall approach later if we want to.
Since this series was first sent there have been additions to the board code for ARM and PPC. I have added in these additions. This is a manual process, and I expect that people will find problems (and send patches) as they try out their boards.
Changes in v5: - Use unsigned int for baud_rate - Remove bi_ip_addr field from struct bd_info - Add new patch to replace __bss_end__ with __bss_end - Remove the __bss_end #define now that this is consistent across U-Boot - Remove avr32 changes from what should be an arm patch - Adjust u-boot-nds32.h link symbols to keep U-Boot building - Add debug() code to initcalls - Update copyright on initcalls - Avoid using static declaration for init_func_watchdog_reset() - Add fdtdec header file to board_f.c - Remove setup_global_data_ptr() - Tidy up stack init - Put global data on stack in board_init_f() - Add fdt relocation - Remove fdt relocation field from x86 arch_global_data - Deal with change of board_init_f() semantics on ARM - Save boot_flags in global_data in board_init_f() - Add print_cpuinfo() prototype to include/common.h - Add code from arch/arm/lib/board.c to control loading of environment - Put watchdog init function definitions in watchdog.h - Adjust ppc to work with watchdog.h additions - Add new patch to fix config in keymile boards - Add offsets support for access to fdt that uses CONFIG_OF_SEPARATE - Use watchdog.h for watchdog functions - Add define to work around __bss_end / __bss_end__ confusion - Add prototype for update_flash_size() to include/common.h - Updates in board_r.c to make ppc build correctly - Add prototype for board_start_ide() to include/ide.h - Bring in new ppc features since this patch was first created - Add new patch to adjust board_f.c for x86 - Add new patch to adjust board_r.c for x86 - Include asm/sections.h in x86 sdram code - Define _end instead of __end for x86 - Avoid setting up gd on x86 as it is already done
Changes in v4: - Add three more fields required for ARM - Add asm/sections.h for each architecture - Use asm/sections.h instead of asm-generic/sections.h - Use asm/sections.h instead of asm-generic/sections.h - Adjust u-boot-x86.h link symbols to keep U-Boot building - Use asm/sections.h instead of asm-generic/sections.h - Use asm/sections.h instead of asm-generic/sections.h - Updates to sit on top of earlier patches - Updates to sit on top of earlier patches - Use asm/sections.h instead of asm-generic/sections.h - Rebase to master - Drop sc520_timer.c patch (warning already fixed by previous patch)
Changes in v3: - Cast away the volatile on gd for memcpy() - Add header to new x86 relocate.c and init_helpers.c - Rebase to master - Rebase on top of x86/master (which has not yet been pulled to master)
Changes in v2: - Change generic board to an opt-in system on a per-board basic - Add CONFIG_SYS_GENERIC_BOARD to allow board to select generic board - Add PowerPC support - Rebase to master
Simon Glass (23): ppc: Add initial memory barrier macros Introduce generic u-boot.h file Replace __bss_end__ with __bss_end Introduce generic link section.h symbol files arm: Use sections header to obtain link symbols x86: nds32: Change stub example to use asm-generic/sections.h Introduce a basic initcall implementation Define CONFIG_SYS_LEGACY_BOARD everywhere Declare watchdog functions in watchdog.h Introduce generic pre-relocation board_f.c Introduce generic post-relocation board_r.c Add spl load feature arm: Remove use of board_early_init_r/last_stage_init() arm: Enable generic board support Add CONFIG_SYS_SYM_OFFSETS to support offset symbols Adjust board_f.c for ppc Adjust board_r.c for ppc ppc: Enable generic board support x86: Adjust board_f.c for x86 x86: Adjust board_r.c for x86 x86: Use sections header to obtain link symbols x86: Enable generic board support tegra: Enable generic board for Seaboard.
README | 17 + arch/arm/cpu/arm1136/start.S | 2 +- arch/arm/cpu/arm1136/u-boot-spl.lds | 2 +- arch/arm/cpu/arm1176/start.S | 2 +- arch/arm/cpu/arm720t/start.S | 2 +- arch/arm/cpu/arm920t/ep93xx/u-boot.lds | 2 +- arch/arm/cpu/arm920t/start.S | 2 +- arch/arm/cpu/arm925t/start.S | 2 +- arch/arm/cpu/arm926ejs/davinci/spl.c | 2 +- arch/arm/cpu/arm926ejs/mxs/start.S | 2 +- arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds | 2 +- arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds | 2 +- arch/arm/cpu/arm926ejs/start.S | 4 +- arch/arm/cpu/arm946es/start.S | 2 +- arch/arm/cpu/arm_intcm/start.S | 2 +- arch/arm/cpu/armv7/omap-common/u-boot-spl.lds | 2 +- arch/arm/cpu/armv7/socfpga/u-boot-spl.lds | 2 +- arch/arm/cpu/armv7/start.S | 2 +- arch/arm/cpu/ixp/start.S | 2 +- arch/arm/cpu/ixp/u-boot.lds | 2 +- arch/arm/cpu/pxa/start.S | 2 +- arch/arm/cpu/s3c44b0/start.S | 2 +- arch/arm/cpu/sa1100/start.S | 2 +- arch/arm/cpu/u-boot.lds | 4 +- arch/arm/include/asm/sections.h | 27 + arch/arm/include/asm/spl.h | 2 +- arch/arm/include/asm/u-boot-arm.h | 4 - arch/arm/include/asm/u-boot.h | 9 + arch/arm/lib/Makefile | 3 + arch/arm/lib/board.c | 1 + arch/arm/lib/crt0.S | 4 +- arch/arm/lib/spl.c | 2 +- arch/avr32/config.mk | 3 + arch/avr32/cpu/start.S | 2 +- arch/avr32/cpu/u-boot.lds | 2 +- arch/avr32/include/asm/sections.h | 6 +- arch/avr32/lib/board.c | 4 +- arch/blackfin/config.mk | 3 + arch/blackfin/include/asm/sections.h | 27 + arch/m68k/config.mk | 3 + arch/m68k/include/asm/sections.h | 27 + arch/m68k/lib/board.c | 4 +- arch/microblaze/config.mk | 3 + arch/microblaze/include/asm/sections.h | 27 + arch/mips/config.mk | 3 + arch/mips/include/asm/sections.h | 27 + arch/nds32/config.mk | 3 + arch/nds32/cpu/n1213/start.S | 2 +- arch/nds32/cpu/n1213/u-boot.lds | 2 +- arch/nds32/include/asm/sections.h | 27 + arch/nds32/include/asm/u-boot-nds32.h | 8 +- arch/nds32/lib/board.c | 2 +- arch/nios2/config.mk | 3 + arch/nios2/cpu/start.S | 6 +- arch/nios2/cpu/u-boot.lds | 2 +- arch/nios2/include/asm/sections.h | 27 + arch/openrisc/include/asm/sections.h | 27 + arch/powerpc/cpu/74xx_7xx/start.S | 4 +- arch/powerpc/cpu/74xx_7xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc512x/start.S | 4 +- arch/powerpc/cpu/mpc512x/u-boot.lds | 2 +- arch/powerpc/cpu/mpc5xx/start.S | 4 +- arch/powerpc/cpu/mpc5xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc5xxx/spl_boot.c | 2 +- arch/powerpc/cpu/mpc5xxx/start.S | 4 +- arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds | 2 +- arch/powerpc/cpu/mpc5xxx/u-boot-spl.lds | 2 +- arch/powerpc/cpu/mpc5xxx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc8220/start.S | 4 +- arch/powerpc/cpu/mpc8220/u-boot.lds | 2 +- arch/powerpc/cpu/mpc824x/start.S | 4 +- arch/powerpc/cpu/mpc824x/u-boot.lds | 2 +- arch/powerpc/cpu/mpc8260/start.S | 4 +- arch/powerpc/cpu/mpc8260/u-boot.lds | 2 +- arch/powerpc/cpu/mpc83xx/start.S | 4 +- arch/powerpc/cpu/mpc83xx/u-boot-spl.lds | 4 +- arch/powerpc/cpu/mpc83xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc85xx/start.S | 4 +- arch/powerpc/cpu/mpc85xx/u-boot-nand.lds | 2 +- arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds | 2 +- arch/powerpc/cpu/mpc85xx/u-boot-spl.lds | 2 +- arch/powerpc/cpu/mpc85xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc86xx/start.S | 4 +- arch/powerpc/cpu/mpc86xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc8xx/start.S | 4 +- arch/powerpc/cpu/ppc4xx/start.S | 4 +- arch/powerpc/cpu/ppc4xx/u-boot.lds | 2 +- arch/powerpc/include/asm/io.h | 8 + arch/powerpc/include/asm/sections.h | 27 + arch/powerpc/include/asm/spl.h | 2 +- arch/powerpc/include/asm/u-boot.h | 7 + arch/powerpc/lib/Makefile | 2 + arch/powerpc/lib/board.c | 18 +- arch/sandbox/config.mk | 3 + arch/sandbox/include/asm/sections.h | 2 + arch/sh/config.mk | 3 + arch/sh/cpu/sh2/u-boot.lds | 2 +- arch/sh/cpu/sh3/u-boot.lds | 2 +- arch/sh/cpu/sh4/u-boot.lds | 2 +- arch/sh/include/asm/sections.h | 27 + arch/sparc/config.mk | 3 + arch/sparc/include/asm/sections.h | 27 + arch/x86/cpu/coreboot/sdram.c | 1 + arch/x86/cpu/u-boot.lds | 4 +- arch/x86/include/asm/global_data.h | 1 - arch/x86/include/asm/sections.h | 27 + arch/x86/include/asm/u-boot-x86.h | 9 - arch/x86/include/asm/u-boot.h | 11 + arch/x86/lib/Makefile | 3 + arch/x86/lib/board.c | 3 +- arch/x86/lib/init_helpers.c | 3 +- arch/x86/lib/relocate.c | 9 +- board/BuS/eb_cpu5282/u-boot.lds | 2 +- board/LEOX/elpt860/u-boot.lds | 2 +- board/RPXClassic/u-boot.lds | 2 +- board/RPXlite/u-boot.lds | 2 +- board/RPXlite_dw/u-boot.lds | 2 +- board/RRvision/u-boot.lds | 2 +- board/actux1/u-boot.lds | 2 +- board/actux2/u-boot.lds | 2 +- board/actux3/u-boot.lds | 2 +- board/adder/u-boot.lds | 2 +- board/ait/cam_enc_4xx/u-boot-spl.lds | 2 +- board/altera/nios2-generic/u-boot.lds | 2 +- board/amcc/acadia/u-boot-nand.lds | 2 +- board/amcc/bamboo/u-boot-nand.lds | 2 +- board/amcc/canyonlands/u-boot-nand.lds | 2 +- board/amcc/kilauea/u-boot-nand.lds | 2 +- board/amcc/sequoia/u-boot-nand.lds | 2 +- board/amcc/sequoia/u-boot-ram.lds | 2 +- board/astro/mcf5373l/u-boot.lds | 2 +- board/cm4008/flash.c | 1 + board/cm41xx/flash.c | 1 + board/cobra5272/u-boot.lds | 2 +- board/cogent/u-boot.lds | 2 +- board/dave/PPChameleonEVB/u-boot.lds | 2 +- board/davinci/da8xxevm/u-boot-spl-da850evm.lds | 2 +- board/davinci/da8xxevm/u-boot-spl-hawk.lds | 2 +- board/dvlhost/u-boot.lds | 2 +- board/eltec/mhpc/u-boot.lds | 2 +- board/emk/top860/u-boot.lds | 2 +- board/ep88x/u-boot.lds | 2 +- board/esd/dasa_sim/u-boot.lds | 2 +- board/esd/pmc440/u-boot-nand.lds | 2 +- board/esd/tasreg/u-boot.lds | 2 +- board/esteem192e/u-boot.lds | 2 +- board/evb64260/u-boot.lds | 2 +- board/fads/u-boot.lds | 2 +- board/flagadm/u-boot.lds | 2 +- board/freescale/m5208evbe/u-boot.lds | 2 +- board/freescale/m52277evb/u-boot.lds | 2 +- board/freescale/m5235evb/u-boot.lds | 2 +- board/freescale/m5249evb/u-boot.lds | 2 +- board/freescale/m5253demo/u-boot.lds | 2 +- board/freescale/m5253evbe/u-boot.lds | 2 +- board/freescale/m5271evb/u-boot.lds | 2 +- board/freescale/m5272c3/u-boot.lds | 2 +- board/freescale/m5275evb/u-boot.lds | 2 +- board/freescale/m5282evb/u-boot.lds | 2 +- board/freescale/m53017evb/u-boot.lds | 2 +- board/freescale/m5329evb/u-boot.lds | 2 +- board/freescale/m5373evb/u-boot.lds | 2 +- board/freescale/m54418twr/u-boot.lds | 2 +- board/freescale/m54451evb/u-boot.lds | 2 +- board/freescale/m54455evb/u-boot.lds | 2 +- board/freescale/m547xevb/u-boot.lds | 2 +- board/freescale/m548xevb/u-boot.lds | 2 +- board/freescale/mx31ads/u-boot.lds | 2 +- board/gaisler/gr_cpci_ax2000/u-boot.lds | 2 +- board/gaisler/gr_ep2s60/u-boot.lds | 2 +- board/gaisler/gr_xc3s_1500/u-boot.lds | 2 +- board/gaisler/grsim/u-boot.lds | 2 +- board/gaisler/grsim_leon2/u-boot.lds | 2 +- board/gen860t/u-boot-flashenv.lds | 2 +- board/gen860t/u-boot.lds | 2 +- board/genietv/u-boot.lds | 2 +- board/hermes/u-boot.lds | 2 +- board/hymod/u-boot.lds | 2 +- board/icu862/u-boot.lds | 2 +- board/idmr/u-boot.lds | 2 +- board/ip860/u-boot.lds | 2 +- board/ivm/u-boot.lds | 2 +- board/korat/u-boot-F7FC.lds | 2 +- board/kup/kup4k/u-boot.lds | 2 +- board/kup/kup4x/u-boot.lds | 2 +- board/lwmon/u-boot.lds | 2 +- board/manroland/uc100/u-boot.lds | 2 +- board/matrix_vision/mvsmr/u-boot.lds | 2 +- board/mbx8xx/u-boot.lds | 2 +- board/mousse/u-boot.lds | 2 +- board/mvblue/u-boot.lds | 2 +- board/netphone/u-boot.lds | 2 +- board/netta/u-boot.lds | 2 +- board/netta2/u-boot.lds | 2 +- board/netvia/u-boot.lds | 2 +- board/nx823/u-boot.lds | 2 +- board/quantum/u-boot.lds | 2 +- board/r360mpi/u-boot.lds | 2 +- board/rbc823/u-boot.lds | 2 +- board/renesas/sh7752evb/u-boot.lds | 2 +- board/renesas/sh7757lcr/u-boot.lds | 2 +- board/rsdproto/u-boot.lds | 2 +- board/samsung/smdk5250/smdk5250-uboot-spl.lds | 2 +- board/samsung/smdk6400/u-boot-nand.lds | 2 +- board/sandpoint/u-boot.lds | 2 +- board/sixnet/u-boot.lds | 2 +- board/snmc/qs850/u-boot.lds | 2 +- board/snmc/qs860t/u-boot.lds | 2 +- board/spc1920/u-boot.lds | 2 +- board/spd8xx/u-boot.lds | 2 +- board/stx/stxxtc/u-boot.lds | 2 +- board/svm_sc8xx/u-boot.lds | 2 +- board/tqc/tqm8xx/u-boot.lds | 2 +- board/v37/u-boot.lds | 2 +- board/vpac270/u-boot-spl.lds | 2 +- board/woodburn/woodburn.c | 2 +- common/Makefile | 4 + common/board_f.c | 1021 ++++++++++++++++++++++ common/board_r.c | 916 +++++++++++++++++++ config.mk | 8 + examples/standalone/stubs.c | 7 +- include/asm-generic/global_data.h | 2 + include/asm-generic/sections.h | 119 +++ include/asm-generic/u-boot.h | 159 ++++ include/common.h | 2 + include/configs/km/keymile-common.h | 4 - include/configs/km/km-powerpc.h | 4 + include/configs/seaboard.h | 2 + include/ide.h | 7 + include/initcall.h | 25 + include/watchdog.h | 18 + lib/Makefile | 1 + lib/initcall.c | 39 + nand_spl/board/amcc/acadia/u-boot.lds | 2 +- nand_spl/board/amcc/bamboo/u-boot.lds | 2 +- nand_spl/board/amcc/canyonlands/u-boot.lds | 2 +- nand_spl/board/amcc/kilauea/u-boot.lds | 2 +- nand_spl/board/amcc/sequoia/u-boot.lds | 2 +- nand_spl/board/freescale/mpc8315erdb/u-boot.lds | 4 +- nand_spl/board/freescale/mx31pdk/u-boot.lds | 2 +- nand_spl/board/karo/tx25/u-boot.lds | 2 +- nand_spl/board/samsung/smdk6400/u-boot.lds | 2 +- nand_spl/board/sheldon/simpc8313/u-boot.lds | 4 +- 243 files changed, 2976 insertions(+), 253 deletions(-) create mode 100644 arch/arm/include/asm/sections.h create mode 100644 arch/blackfin/include/asm/sections.h create mode 100644 arch/m68k/include/asm/sections.h create mode 100644 arch/microblaze/include/asm/sections.h create mode 100644 arch/mips/include/asm/sections.h create mode 100644 arch/nds32/include/asm/sections.h create mode 100644 arch/nios2/include/asm/sections.h create mode 100644 arch/openrisc/include/asm/sections.h create mode 100644 arch/powerpc/include/asm/sections.h create mode 100644 arch/sh/include/asm/sections.h create mode 100644 arch/sparc/include/asm/sections.h create mode 100644 arch/x86/include/asm/sections.h create mode 100644 common/board_f.c create mode 100644 common/board_r.c create mode 100644 include/asm-generic/sections.h create mode 100644 include/asm-generic/u-boot.h create mode 100644 include/initcall.h create mode 100644 lib/initcall.c

These are available on other architectures, so add them on ppc.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
arch/powerpc/include/asm/io.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index 1f12c29..1bf12f5 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h @@ -317,4 +317,12 @@ static inline phys_addr_t virt_to_phys(void * vaddr) #endif }
+/* + * TODO: The kernel offers some more advanced versions of barriers, it might + * have some advantages to use them instead of the simple one here. + */ +#define dmb() __asm__ __volatile__ ("" : : : "memory") +#define __iormb() dmb() +#define __iowmb() dmb() + #endif

On 02/08/2013 09:11:57 AM, Simon Glass wrote:
These are available on other architectures, so add them on ppc.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
arch/powerpc/include/asm/io.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index 1f12c29..1bf12f5 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h @@ -317,4 +317,12 @@ static inline phys_addr_t virt_to_phys(void * vaddr) #endif }
+/*
- TODO: The kernel offers some more advanced versions of barriers,
it might
- have some advantages to use them instead of the simple one here.
- */
+#define dmb() __asm__ __volatile__ ("" : : : "memory") +#define __iormb() dmb() +#define __iowmb() dmb()
What is the definition of these? Given that we already have an architecture-independent barrier(), I assume this is meant to be an actual hardware barrier rather than a compiler barrier, so this is not a correct implementation.
-Scott

Hi Scott,
On Mon, Feb 11, 2013 at 11:52 AM, Scott Wood scottwood@freescale.com wrote:
On 02/08/2013 09:11:57 AM, Simon Glass wrote:
These are available on other architectures, so add them on ppc.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
arch/powerpc/include/asm/io.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index 1f12c29..1bf12f5 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h @@ -317,4 +317,12 @@ static inline phys_addr_t virt_to_phys(void * vaddr) #endif }
+/*
- TODO: The kernel offers some more advanced versions of barriers, it
might
- have some advantages to use them instead of the simple one here.
- */
+#define dmb() __asm__ __volatile__ ("" : : : "memory") +#define __iormb() dmb() +#define __iowmb() dmb()
What is the definition of these? Given that we already have an architecture-independent barrier(), I assume this is meant to be an actual hardware barrier rather than a compiler barrier, so this is not a correct implementation.
They were introduced in ARM in commit 3c0659b5, so I am really just following along with that. Yes the naming doesn't make a lot of sense, but on the other hand I don't think we necessarily want an actual hardware barrier in our writel()s. This at least makes sure that the compiler writes in the right order - perhaps the intent is that that rest is best left to the hardware?
Regards, Simon
-Scott

On 02/12/2013 12:44:16 PM, Simon Glass wrote:
Hi Scott,
On Mon, Feb 11, 2013 at 11:52 AM, Scott Wood scottwood@freescale.com wrote:
On 02/08/2013 09:11:57 AM, Simon Glass wrote:
These are available on other architectures, so add them on ppc.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
arch/powerpc/include/asm/io.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/include/asm/io.h
b/arch/powerpc/include/asm/io.h
index 1f12c29..1bf12f5 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h @@ -317,4 +317,12 @@ static inline phys_addr_t virt_to_phys(void *
vaddr)
#endif }
+/*
- TODO: The kernel offers some more advanced versions of
barriers, it
might
- have some advantages to use them instead of the simple one
here.
- */
+#define dmb() __asm__ __volatile__ ("" : : : "memory") +#define __iormb() dmb() +#define __iowmb() dmb()
What is the definition of these? Given that we already have an architecture-independent barrier(), I assume this is meant to be an
actual
hardware barrier rather than a compiler barrier, so this is not a
correct
implementation.
They were introduced in ARM in commit 3c0659b5, so I am really just following along with that. Yes the naming doesn't make a lot of sense, but on the other hand I don't think we necessarily want an actual hardware barrier in our writel()s.
We do have a hardware barrier in writel() on PPC (ignoring the broken never-used little-endian implementation, which should just be removed), and it should stay that way.
I do not think we should be introducing anything that looks like a hardware barrier but isn't, unless the semantics of a particular barrier are guaranteed by a particular platform without needing a barrier instruction. And in that case there had better be a document somewhere that explains what the semantics are.
This at least makes sure that the compiler writes in the right order - perhaps the intent is that that rest is best left to the hardware?
Regardless of what one might think is "best", it isn't left to hardware on many platforms, including PPC.
-Scott

Hi Scott,
On Tue, Feb 12, 2013 at 10:50 AM, Scott Wood scottwood@freescale.com wrote:
On 02/12/2013 12:44:16 PM, Simon Glass wrote:
Hi Scott,
On Mon, Feb 11, 2013 at 11:52 AM, Scott Wood scottwood@freescale.com wrote:
On 02/08/2013 09:11:57 AM, Simon Glass wrote:
These are available on other architectures, so add them on ppc.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
arch/powerpc/include/asm/io.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index 1f12c29..1bf12f5 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h @@ -317,4 +317,12 @@ static inline phys_addr_t virt_to_phys(void * vaddr) #endif }
+/*
- TODO: The kernel offers some more advanced versions of barriers, it
might
- have some advantages to use them instead of the simple one here.
- */
+#define dmb() __asm__ __volatile__ ("" : : : "memory") +#define __iormb() dmb() +#define __iowmb() dmb()
What is the definition of these? Given that we already have an architecture-independent barrier(), I assume this is meant to be an actual hardware barrier rather than a compiler barrier, so this is not a correct implementation.
They were introduced in ARM in commit 3c0659b5, so I am really just following along with that. Yes the naming doesn't make a lot of sense, but on the other hand I don't think we necessarily want an actual hardware barrier in our writel()s.
We do have a hardware barrier in writel() on PPC (ignoring the broken never-used little-endian implementation, which should just be removed), and it should stay that way.
I do not think we should be introducing anything that looks like a hardware barrier but isn't, unless the semantics of a particular barrier are guaranteed by a particular platform without needing a barrier instruction. And in that case there had better be a document somewhere that explains what the semantics are.
Yes, agreed.
This at least makes sure that the compiler writes in the right order - perhaps the intent is that that rest is best left to the hardware?
Regardless of what one might think is "best", it isn't left to hardware on many platforms, including PPC.
I really mean that my reading is that this is all that is needed in writel() and friends. In order words, we don't need to tell the hardware to strongly order, or whatever.
I think I can just drop this patch and things will still build.
Can you please take a look at this code too, from the patch which brings in post-relocation board init (board_r.c):
#ifdef CONFIG_PPC /* TODO: Can we not use dmb() macros for this? */ asm("sync ; isync"); #endif
Regards, Simon
-Scott

On 02/12/2013 12:55:39 PM, Simon Glass wrote:
Can you please take a look at this code too, from the patch which brings in post-relocation board init (board_r.c):
#ifdef CONFIG_PPC /* TODO: Can we not use dmb() macros for this? */ asm("sync ; isync"); #endif
I'm not sure why we need that at all. It's been there since "Initial revision", so git history isn't helpful in explaining it.
-Scott

Hi Scott,
On Tue, Feb 12, 2013 at 11:04 AM, Scott Wood scottwood@freescale.com wrote:
On 02/12/2013 12:55:39 PM, Simon Glass wrote:
Can you please take a look at this code too, from the patch which brings in post-relocation board init (board_r.c):
#ifdef CONFIG_PPC /* TODO: Can we not use dmb() macros for this? */ asm("sync ; isync"); #endif
I'm not sure why we need that at all. It's been there since "Initial revision", so git history isn't helpful in explaining it.
OK great, I will punt it for generic board.
-Scott
Regards, Simon

This file holds the board info structure. We need this to be generic for the unified board series, so create a structure which contains the basic fields required by the main architectures.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Use unsigned int for baud_rate - Remove bi_ip_addr field from struct bd_info
Changes in v4: - Add three more fields required for ARM
Changes in v3: None Changes in v2: None
include/asm-generic/u-boot.h | 159 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 include/asm-generic/u-boot.h
diff --git a/include/asm-generic/u-boot.h b/include/asm-generic/u-boot.h new file mode 100644 index 0000000..1d396dd --- /dev/null +++ b/include/asm-generic/u-boot.h @@ -0,0 +1,159 @@ +/* + * (C) Copyright 2000 - 2002 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ******************************************************************** + * NOTE: This header file defines an interface to U-Boot. Including + * this (unmodified) header file in another file is considered normal + * use of U-Boot, and does *not* fall under the heading of "derived + * work". + ******************************************************************** + */ + +#ifndef __ASM_GENERIC_U_BOOT_H__ +#define __ASM_GENERIC_U_BOOT_H__ + +/* + * Board information passed to Linux kernel from U-Boot + * + * include/asm-ppc/u-boot.h + */ + +#ifndef __ASSEMBLY__ + +typedef struct bd_info { + unsigned long bi_memstart; /* start of DRAM memory */ + phys_size_t bi_memsize; /* size of DRAM memory in bytes */ + unsigned long bi_flashstart; /* start of FLASH memory */ + unsigned long bi_flashsize; /* size of FLASH memory */ + unsigned long bi_flashoffset; /* reserved area for startup monitor */ + unsigned long bi_sramstart; /* start of SRAM memory */ + unsigned long bi_sramsize; /* size of SRAM memory */ +#ifdef CONFIG_ARM + unsigned long bi_arm_freq; /* arm frequency */ + unsigned long bi_dsp_freq; /* dsp core frequency */ + unsigned long bi_ddr_freq; /* ddr frequency */ +#endif +#if defined(CONFIG_5xx) || defined(CONFIG_8xx) || defined(CONFIG_8260) \ + || defined(CONFIG_E500) || defined(CONFIG_MPC86xx) + unsigned long bi_immr_base; /* base of IMMR register */ +#endif +#if defined(CONFIG_MPC5xxx) + unsigned long bi_mbar_base; /* base of internal registers */ +#endif +#if defined(CONFIG_MPC83xx) + unsigned long bi_immrbar; +#endif +#if defined(CONFIG_MPC8220) + unsigned long bi_mbar_base; /* base of internal registers */ + unsigned long bi_inpfreq; /* Input Freq, In MHz */ + unsigned long bi_pcifreq; /* PCI Freq, in MHz */ + unsigned long bi_pevfreq; /* PEV Freq, in MHz */ + unsigned long bi_flbfreq; /* Flexbus Freq, in MHz */ + unsigned long bi_vcofreq; /* VCO Freq, in MHz */ +#endif + unsigned long bi_bootflags; /* boot / reboot flag (Unused) */ + unsigned char bi_enetaddr[6]; /* OLD: see README.enetaddr */ + unsigned short bi_ethspeed; /* Ethernet speed in Mbps */ + unsigned long bi_intfreq; /* Internal Freq, in MHz */ + unsigned long bi_busfreq; /* Bus Freq, in MHz */ +#if defined(CONFIG_CPM2) + unsigned long bi_cpmfreq; /* CPM_CLK Freq, in MHz */ + unsigned long bi_brgfreq; /* BRG_CLK Freq, in MHz */ + unsigned long bi_sccfreq; /* SCC_CLK Freq, in MHz */ + unsigned long bi_vco; /* VCO Out from PLL, in MHz */ +#endif +#if defined(CONFIG_MPC512X) + unsigned long bi_ipsfreq; /* IPS Bus Freq, in MHz */ +#endif /* CONFIG_MPC512X */ +#if defined(CONFIG_MPC5xxx) + unsigned long bi_ipbfreq; /* IPB Bus Freq, in MHz */ + unsigned long bi_pcifreq; /* PCI Bus Freq, in MHz */ +#endif + unsigned int bi_baudrate; /* Console Baudrate */ +#if defined(CONFIG_405) || \ + defined(CONFIG_405GP) || \ + defined(CONFIG_405CR) || \ + defined(CONFIG_405EP) || \ + defined(CONFIG_405EZ) || \ + defined(CONFIG_405EX) || \ + defined(CONFIG_440) + unsigned char bi_s_version[4]; /* Version of this structure */ + unsigned char bi_r_version[32]; /* Version of the ROM (AMCC) */ + unsigned int bi_procfreq; /* CPU (Internal) Freq, in Hz */ + unsigned int bi_plb_busfreq; /* PLB Bus speed, in Hz */ + unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */ + unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */ +#endif +#if defined(CONFIG_HYMOD) + hymod_conf_t bi_hymod_conf; /* hymod configuration information */ +#endif + +#ifdef CONFIG_HAS_ETH1 + unsigned char bi_enet1addr[6]; /* OLD: see README.enetaddr */ +#endif +#ifdef CONFIG_HAS_ETH2 + unsigned char bi_enet2addr[6]; /* OLD: see README.enetaddr */ +#endif +#ifdef CONFIG_HAS_ETH3 + unsigned char bi_enet3addr[6]; /* OLD: see README.enetaddr */ +#endif +#ifdef CONFIG_HAS_ETH4 + unsigned char bi_enet4addr[6]; /* OLD: see README.enetaddr */ +#endif +#ifdef CONFIG_HAS_ETH5 + unsigned char bi_enet5addr[6]; /* OLD: see README.enetaddr */ +#endif + +#if defined(CONFIG_405GP) || defined(CONFIG_405EP) || \ + defined(CONFIG_405EZ) || defined(CONFIG_440GX) || \ + defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ + defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \ + defined(CONFIG_460EX) || defined(CONFIG_460GT) + unsigned int bi_opbfreq; /* OPB clock in Hz */ + int bi_iic_fast[2]; /* Use fast i2c mode */ +#endif +#if defined(CONFIG_NX823) + unsigned char bi_sernum[8]; +#endif +#if defined(CONFIG_4xx) +#if defined(CONFIG_440GX) || \ + defined(CONFIG_460EX) || defined(CONFIG_460GT) + int bi_phynum[4]; /* Determines phy mapping */ + int bi_phymode[4]; /* Determines phy mode */ +#elif defined(CONFIG_405EP) || defined(CONFIG_405EX) || defined(CONFIG_440) + int bi_phynum[2]; /* Determines phy mapping */ + int bi_phymode[2]; /* Determines phy mode */ +#else + int bi_phynum[1]; /* Determines phy mapping */ + int bi_phymode[1]; /* Determines phy mode */ +#endif +#endif /* defined(CONFIG_4xx) */ + ulong bi_arch_number; /* unique id for this board */ + ulong bi_boot_params; /* where this board expects params */ +#ifdef CONFIG_NR_DRAM_BANKS + struct { /* RAM configuration */ + ulong start; + ulong size; + } bi_dram[CONFIG_NR_DRAM_BANKS]; +#endif /* CONFIG_NR_DRAM_BANKS */ +} bd_t; + +#endif /* __ASSEMBLY__ */ + +#endif /* __ASM_GENERIC_U_BOOT_H__ */

Note this is a tree-wide change affecting multiple architectures.
At present we use __bss_start, but mostly __bss_end__. This seems inconsistent and in a number of places __bss_end is used instead.
Change to use __bss_end for the BSS end symbol throughout U-Boot. This makes it possible to use the asm-generic/sections.h file on all archs.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Add new patch to replace __bss_end__ with __bss_end
Changes in v4: None Changes in v3: None Changes in v2: None
arch/arm/cpu/arm1136/start.S | 2 +- arch/arm/cpu/arm1136/u-boot-spl.lds | 2 +- arch/arm/cpu/arm1176/start.S | 2 +- arch/arm/cpu/arm720t/start.S | 2 +- arch/arm/cpu/arm920t/ep93xx/u-boot.lds | 2 +- arch/arm/cpu/arm920t/start.S | 2 +- arch/arm/cpu/arm925t/start.S | 2 +- arch/arm/cpu/arm926ejs/davinci/spl.c | 2 +- arch/arm/cpu/arm926ejs/mxs/start.S | 2 +- arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds | 2 +- arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds | 2 +- arch/arm/cpu/arm926ejs/start.S | 4 ++-- arch/arm/cpu/arm946es/start.S | 2 +- arch/arm/cpu/arm_intcm/start.S | 2 +- arch/arm/cpu/armv7/omap-common/u-boot-spl.lds | 2 +- arch/arm/cpu/armv7/socfpga/u-boot-spl.lds | 2 +- arch/arm/cpu/armv7/start.S | 2 +- arch/arm/cpu/ixp/start.S | 2 +- arch/arm/cpu/ixp/u-boot.lds | 2 +- arch/arm/cpu/pxa/start.S | 2 +- arch/arm/cpu/s3c44b0/start.S | 2 +- arch/arm/cpu/sa1100/start.S | 2 +- arch/arm/cpu/u-boot.lds | 4 ++-- arch/arm/include/asm/spl.h | 2 +- arch/arm/lib/crt0.S | 4 ++-- arch/arm/lib/spl.c | 2 +- arch/avr32/cpu/start.S | 2 +- arch/avr32/cpu/u-boot.lds | 2 +- arch/avr32/include/asm/sections.h | 2 +- arch/avr32/lib/board.c | 4 ++-- arch/m68k/lib/board.c | 4 ++-- arch/nds32/cpu/n1213/start.S | 2 +- arch/nds32/cpu/n1213/u-boot.lds | 2 +- arch/nds32/include/asm/u-boot-nds32.h | 2 +- arch/nds32/lib/board.c | 2 +- arch/nios2/cpu/start.S | 6 +++--- arch/nios2/cpu/u-boot.lds | 2 +- arch/powerpc/cpu/74xx_7xx/start.S | 4 ++-- arch/powerpc/cpu/74xx_7xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc512x/start.S | 4 ++-- arch/powerpc/cpu/mpc512x/u-boot.lds | 2 +- arch/powerpc/cpu/mpc5xx/start.S | 4 ++-- arch/powerpc/cpu/mpc5xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc5xxx/spl_boot.c | 2 +- arch/powerpc/cpu/mpc5xxx/start.S | 4 ++-- arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds | 2 +- arch/powerpc/cpu/mpc5xxx/u-boot-spl.lds | 2 +- arch/powerpc/cpu/mpc5xxx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc8220/start.S | 4 ++-- arch/powerpc/cpu/mpc8220/u-boot.lds | 2 +- arch/powerpc/cpu/mpc824x/start.S | 4 ++-- arch/powerpc/cpu/mpc824x/u-boot.lds | 2 +- arch/powerpc/cpu/mpc8260/start.S | 4 ++-- arch/powerpc/cpu/mpc8260/u-boot.lds | 2 +- arch/powerpc/cpu/mpc83xx/start.S | 4 ++-- arch/powerpc/cpu/mpc83xx/u-boot-spl.lds | 4 ++-- arch/powerpc/cpu/mpc83xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc85xx/start.S | 4 ++-- arch/powerpc/cpu/mpc85xx/u-boot-nand.lds | 2 +- arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds | 2 +- arch/powerpc/cpu/mpc85xx/u-boot-spl.lds | 2 +- arch/powerpc/cpu/mpc85xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc86xx/start.S | 4 ++-- arch/powerpc/cpu/mpc86xx/u-boot.lds | 2 +- arch/powerpc/cpu/mpc8xx/start.S | 4 ++-- arch/powerpc/cpu/ppc4xx/start.S | 4 ++-- arch/powerpc/cpu/ppc4xx/u-boot.lds | 2 +- arch/powerpc/include/asm/spl.h | 2 +- arch/powerpc/lib/board.c | 4 ++-- arch/sh/cpu/sh2/u-boot.lds | 2 +- arch/sh/cpu/sh3/u-boot.lds | 2 +- arch/sh/cpu/sh4/u-boot.lds | 2 +- board/BuS/eb_cpu5282/u-boot.lds | 2 +- board/LEOX/elpt860/u-boot.lds | 2 +- board/RPXClassic/u-boot.lds | 2 +- board/RPXlite/u-boot.lds | 2 +- board/RPXlite_dw/u-boot.lds | 2 +- board/RRvision/u-boot.lds | 2 +- board/actux1/u-boot.lds | 2 +- board/actux2/u-boot.lds | 2 +- board/actux3/u-boot.lds | 2 +- board/adder/u-boot.lds | 2 +- board/ait/cam_enc_4xx/u-boot-spl.lds | 2 +- board/altera/nios2-generic/u-boot.lds | 2 +- board/amcc/acadia/u-boot-nand.lds | 2 +- board/amcc/bamboo/u-boot-nand.lds | 2 +- board/amcc/canyonlands/u-boot-nand.lds | 2 +- board/amcc/kilauea/u-boot-nand.lds | 2 +- board/amcc/sequoia/u-boot-nand.lds | 2 +- board/amcc/sequoia/u-boot-ram.lds | 2 +- board/astro/mcf5373l/u-boot.lds | 2 +- board/cobra5272/u-boot.lds | 2 +- board/cogent/u-boot.lds | 2 +- board/dave/PPChameleonEVB/u-boot.lds | 2 +- board/davinci/da8xxevm/u-boot-spl-da850evm.lds | 2 +- board/davinci/da8xxevm/u-boot-spl-hawk.lds | 2 +- board/dvlhost/u-boot.lds | 2 +- board/eltec/mhpc/u-boot.lds | 2 +- board/emk/top860/u-boot.lds | 2 +- board/ep88x/u-boot.lds | 2 +- board/esd/dasa_sim/u-boot.lds | 2 +- board/esd/pmc440/u-boot-nand.lds | 2 +- board/esd/tasreg/u-boot.lds | 2 +- board/esteem192e/u-boot.lds | 2 +- board/evb64260/u-boot.lds | 2 +- board/fads/u-boot.lds | 2 +- board/flagadm/u-boot.lds | 2 +- board/freescale/m5208evbe/u-boot.lds | 2 +- board/freescale/m52277evb/u-boot.lds | 2 +- board/freescale/m5235evb/u-boot.lds | 2 +- board/freescale/m5249evb/u-boot.lds | 2 +- board/freescale/m5253demo/u-boot.lds | 2 +- board/freescale/m5253evbe/u-boot.lds | 2 +- board/freescale/m5271evb/u-boot.lds | 2 +- board/freescale/m5272c3/u-boot.lds | 2 +- board/freescale/m5275evb/u-boot.lds | 2 +- board/freescale/m5282evb/u-boot.lds | 2 +- board/freescale/m53017evb/u-boot.lds | 2 +- board/freescale/m5329evb/u-boot.lds | 2 +- board/freescale/m5373evb/u-boot.lds | 2 +- board/freescale/m54418twr/u-boot.lds | 2 +- board/freescale/m54451evb/u-boot.lds | 2 +- board/freescale/m54455evb/u-boot.lds | 2 +- board/freescale/m547xevb/u-boot.lds | 2 +- board/freescale/m548xevb/u-boot.lds | 2 +- board/freescale/mx31ads/u-boot.lds | 2 +- board/gaisler/gr_cpci_ax2000/u-boot.lds | 2 +- board/gaisler/gr_ep2s60/u-boot.lds | 2 +- board/gaisler/gr_xc3s_1500/u-boot.lds | 2 +- board/gaisler/grsim/u-boot.lds | 2 +- board/gaisler/grsim_leon2/u-boot.lds | 2 +- board/gen860t/u-boot-flashenv.lds | 2 +- board/gen860t/u-boot.lds | 2 +- board/genietv/u-boot.lds | 2 +- board/hermes/u-boot.lds | 2 +- board/hymod/u-boot.lds | 2 +- board/icu862/u-boot.lds | 2 +- board/idmr/u-boot.lds | 2 +- board/ip860/u-boot.lds | 2 +- board/ivm/u-boot.lds | 2 +- board/korat/u-boot-F7FC.lds | 2 +- board/kup/kup4k/u-boot.lds | 2 +- board/kup/kup4x/u-boot.lds | 2 +- board/lwmon/u-boot.lds | 2 +- board/manroland/uc100/u-boot.lds | 2 +- board/matrix_vision/mvsmr/u-boot.lds | 2 +- board/mbx8xx/u-boot.lds | 2 +- board/mousse/u-boot.lds | 2 +- board/mvblue/u-boot.lds | 2 +- board/netphone/u-boot.lds | 2 +- board/netta/u-boot.lds | 2 +- board/netta2/u-boot.lds | 2 +- board/netvia/u-boot.lds | 2 +- board/nx823/u-boot.lds | 2 +- board/quantum/u-boot.lds | 2 +- board/r360mpi/u-boot.lds | 2 +- board/rbc823/u-boot.lds | 2 +- board/renesas/sh7752evb/u-boot.lds | 2 +- board/renesas/sh7757lcr/u-boot.lds | 2 +- board/rsdproto/u-boot.lds | 2 +- board/samsung/smdk5250/smdk5250-uboot-spl.lds | 2 +- board/samsung/smdk6400/u-boot-nand.lds | 2 +- board/sandpoint/u-boot.lds | 2 +- board/sixnet/u-boot.lds | 2 +- board/snmc/qs850/u-boot.lds | 2 +- board/snmc/qs860t/u-boot.lds | 2 +- board/spc1920/u-boot.lds | 2 +- board/spd8xx/u-boot.lds | 2 +- board/stx/stxxtc/u-boot.lds | 2 +- board/svm_sc8xx/u-boot.lds | 2 +- board/tqc/tqm8xx/u-boot.lds | 2 +- board/v37/u-boot.lds | 2 +- board/vpac270/u-boot-spl.lds | 2 +- board/woodburn/woodburn.c | 2 +- nand_spl/board/amcc/acadia/u-boot.lds | 2 +- nand_spl/board/amcc/bamboo/u-boot.lds | 2 +- nand_spl/board/amcc/canyonlands/u-boot.lds | 2 +- nand_spl/board/amcc/kilauea/u-boot.lds | 2 +- nand_spl/board/amcc/sequoia/u-boot.lds | 2 +- nand_spl/board/freescale/mpc8315erdb/u-boot.lds | 4 ++-- nand_spl/board/freescale/mx31pdk/u-boot.lds | 2 +- nand_spl/board/karo/tx25/u-boot.lds | 2 +- nand_spl/board/samsung/smdk6400/u-boot.lds | 2 +- nand_spl/board/sheldon/simpc8313/u-boot.lds | 4 ++-- 184 files changed, 207 insertions(+), 207 deletions(-)
diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S index a067b8a..eba2324 100644 --- a/arch/arm/cpu/arm1136/start.S +++ b/arch/arm/cpu/arm1136/start.S @@ -106,7 +106,7 @@ _image_copy_end_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: diff --git a/arch/arm/cpu/arm1136/u-boot-spl.lds b/arch/arm/cpu/arm1136/u-boot-spl.lds index a0462ab..b09b4eb 100644 --- a/arch/arm/cpu/arm1136/u-boot-spl.lds +++ b/arch/arm/cpu/arm1136/u-boot-spl.lds @@ -57,6 +57,6 @@ SECTIONS __bss_start = .; *(.bss*) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; } >.sdram } diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S index 40df4b1..3c291fb 100644 --- a/arch/arm/cpu/arm1176/start.S +++ b/arch/arm/cpu/arm1176/start.S @@ -121,7 +121,7 @@ _bss_start_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S index 771d386..43bd6ed 100644 --- a/arch/arm/cpu/arm720t/start.S +++ b/arch/arm/cpu/arm720t/start.S @@ -103,7 +103,7 @@ _bss_start_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: diff --git a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds index 008ae89..25d2a32 100644 --- a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds +++ b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds @@ -57,7 +57,7 @@ SECTIONS . = ALIGN(4); __bss_start = .; .bss : { *(.bss) } - __bss_end__ = .; + __bss_end = .;
_end = .; } diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S index 511d21d..2864d12 100644 --- a/arch/arm/cpu/arm920t/start.S +++ b/arch/arm/cpu/arm920t/start.S @@ -87,7 +87,7 @@ _bss_start_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S index e8d6d71..827fee2 100644 --- a/arch/arm/cpu/arm925t/start.S +++ b/arch/arm/cpu/arm925t/start.S @@ -93,7 +93,7 @@ _bss_start_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/spl.c index 714fa92..ca8a412 100644 --- a/arch/arm/cpu/arm926ejs/davinci/spl.c +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c @@ -64,7 +64,7 @@ void board_init_f(ulong dummy) #endif
/* Third, we clear the BSS. */ - memset(__bss_start, 0, __bss_end__ - __bss_start); + memset(__bss_start, 0, __bss_end - __bss_start);
/* Finally, setup gd and move to the next step. */ gd = &gdata; diff --git a/arch/arm/cpu/arm926ejs/mxs/start.S b/arch/arm/cpu/arm926ejs/mxs/start.S index 7ccd337..373e6d8 100644 --- a/arch/arm/cpu/arm926ejs/mxs/start.S +++ b/arch/arm/cpu/arm926ejs/mxs/start.S @@ -133,7 +133,7 @@ _bss_start_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: diff --git a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds index 6dc681a..fc0418a 100644 --- a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds +++ b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds @@ -73,7 +73,7 @@ SECTIONS __bss_start = .; *(.bss*) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; }
_end = .; diff --git a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds index f3bd5e7..cff660a 100644 --- a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds +++ b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds @@ -73,7 +73,7 @@ SECTIONS __bss_start = .; *(.bss*) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; }
_end = .; diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S index 66a8b65..f5d1582 100644 --- a/arch/arm/cpu/arm926ejs/start.S +++ b/arch/arm/cpu/arm926ejs/start.S @@ -142,7 +142,7 @@ _bss_start_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: @@ -151,7 +151,7 @@ _end_ofs: #ifdef CONFIG_NAND_U_BOOT .globl _end _end: - .word __bss_end__ + .word __bss_end #endif
#ifdef CONFIG_USE_IRQ diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S index a7a98a4..9dec35b 100644 --- a/arch/arm/cpu/arm946es/start.S +++ b/arch/arm/cpu/arm946es/start.S @@ -103,7 +103,7 @@ _bss_start_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S index c189849..04d0845 100644 --- a/arch/arm/cpu/arm_intcm/start.S +++ b/arch/arm/cpu/arm_intcm/start.S @@ -99,7 +99,7 @@ _bss_start_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: diff --git a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds index 9979c30..40d64af 100644 --- a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds +++ b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds @@ -62,6 +62,6 @@ SECTIONS __bss_start = .; *(.bss*) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; } >.sdram } diff --git a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds index 7cd409c..79cc93c 100644 --- a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds +++ b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds @@ -46,7 +46,7 @@ SECTIONS __bss_start = .; *(.bss*) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; } >.sdram
. = ALIGN(8); diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S index dcc1f83..4da041e 100644 --- a/arch/arm/cpu/armv7/start.S +++ b/arch/arm/cpu/armv7/start.S @@ -96,7 +96,7 @@ _image_copy_end_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: diff --git a/arch/arm/cpu/ixp/start.S b/arch/arm/cpu/ixp/start.S index efb5a40..b725964 100644 --- a/arch/arm/cpu/ixp/start.S +++ b/arch/arm/cpu/ixp/start.S @@ -112,7 +112,7 @@ _bss_start_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: diff --git a/arch/arm/cpu/ixp/u-boot.lds b/arch/arm/cpu/ixp/u-boot.lds index 81d954f..2c823e1 100644 --- a/arch/arm/cpu/ixp/u-boot.lds +++ b/arch/arm/cpu/ixp/u-boot.lds @@ -71,7 +71,7 @@ SECTIONS __bss_start = .; *(.bss*) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; }
/DISCARD/ : { *(.dynstr*) } diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S index e71803e..456a783 100644 --- a/arch/arm/cpu/pxa/start.S +++ b/arch/arm/cpu/pxa/start.S @@ -120,7 +120,7 @@ _bss_start_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: diff --git a/arch/arm/cpu/s3c44b0/start.S b/arch/arm/cpu/s3c44b0/start.S index 4528c91..c096177 100644 --- a/arch/arm/cpu/s3c44b0/start.S +++ b/arch/arm/cpu/s3c44b0/start.S @@ -78,7 +78,7 @@ _bss_start_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S index 3144299..4bf6f5f 100644 --- a/arch/arm/cpu/sa1100/start.S +++ b/arch/arm/cpu/sa1100/start.S @@ -88,7 +88,7 @@ _bss_start_ofs:
.globl _bss_end_ofs _bss_end_ofs: - .word __bss_end__ - _start + .word __bss_end - _start
.globl _end_ofs _end_ofs: diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index e6b202b..b337e7b 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -85,7 +85,7 @@ SECTIONS __bss_start = .; *(.bss*) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; }
/DISCARD/ : { *(.dynstr*) } @@ -96,5 +96,5 @@ SECTIONS }
#if defined(CONFIG_SPL_TEXT_BASE) && defined(CONFIG_SPL_MAX_SIZE) -ASSERT(__bss_end__ < (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_MAX_SIZE), "SPL image too big"); +ASSERT(__bss_end < (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_MAX_SIZE), "SPL image too big"); #endif diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h index 62011aa..2b7218e 100644 --- a/arch/arm/include/asm/spl.h +++ b/arch/arm/include/asm/spl.h @@ -27,7 +27,7 @@ #include <asm/arch/spl.h>
/* Linker symbols. */ -extern char __bss_start[], __bss_end__[]; +extern char __bss_start[], __bss_end[];
extern gd_t gdata;
diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S index 4f60958..37d9927 100644 --- a/arch/arm/lib/crt0.S +++ b/arch/arm/lib/crt0.S @@ -85,7 +85,7 @@ */
.globl __bss_start -.globl __bss_end__ +.globl __bss_end
/* * entry point of crt0 sequence @@ -141,7 +141,7 @@ here: bl c_runtime_cpu_setup /* we still call old routine here */
ldr r0, =__bss_start /* this is auto-relocated! */ - ldr r1, =__bss_end__ /* this is auto-relocated! */ + ldr r1, =__bss_end /* this is auto-relocated! */
mov r2, #0x00000000 /* prepare zero to clear BSS */
diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c index f568f61..301f082 100644 --- a/arch/arm/lib/spl.c +++ b/arch/arm/lib/spl.c @@ -45,7 +45,7 @@ void __weak board_init_f(ulong dummy) asm volatile("mov sp, %0\n" : : "r"(CONFIG_SPL_STACK));
/* Clear the BSS. */ - memset(__bss_start, 0, __bss_end__ - __bss_start); + memset(__bss_start, 0, __bss_end - __bss_start);
/* Set global data pointer. */ gd = &gdata; diff --git a/arch/avr32/cpu/start.S b/arch/avr32/cpu/start.S index 71cbc52..c8decea 100644 --- a/arch/avr32/cpu/start.S +++ b/arch/avr32/cpu/start.S @@ -244,7 +244,7 @@ relocate_code: /* zero out .bss */ mov r0, 0 mov r1, 0 - lda.w r9, __bss_end__ + lda.w r9, __bss_end sub r9, r8 1: st.d r10++, r0 sub r9, 8 diff --git a/arch/avr32/cpu/u-boot.lds b/arch/avr32/cpu/u-boot.lds index 0b16d2a..d096424 100644 --- a/arch/avr32/cpu/u-boot.lds +++ b/arch/avr32/cpu/u-boot.lds @@ -68,5 +68,5 @@ SECTIONS *(.bss.*) } . = ALIGN(8); - __bss_end__ = .; + __bss_end = .; } diff --git a/arch/avr32/include/asm/sections.h b/arch/avr32/include/asm/sections.h index 3f15788..a78fd40 100644 --- a/arch/avr32/include/asm/sections.h +++ b/arch/avr32/include/asm/sections.h @@ -27,6 +27,6 @@ extern char _text[], _etext[]; extern char _data[], __data_lma[], _edata[], __edata_lma[]; extern char __got_start[], __got_lma[], __got_end[]; -extern char __bss_end__[]; +extern char __bss_end[];
#endif /* __ASM_AVR32_SECTIONS_H */ diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index d3c8cb7..77f8fa1 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -116,7 +116,7 @@ static int display_banner (void) printf ("\n\n%s\n\n", version_string); printf ("U-Boot code: %08lx -> %08lx data: %08lx -> %08lx\n", (unsigned long)_text, (unsigned long)_etext, - (unsigned long)_data, (unsigned long)__bss_end__); + (unsigned long)_data, (unsigned long)__bss_end); return 0; }
@@ -188,7 +188,7 @@ void board_init_f(ulong board_type) * - stack */ addr = CONFIG_SYS_SDRAM_BASE + sdram_size; - monitor_len = __bss_end__ - _text; + monitor_len = __bss_end - _text;
/* * Reserve memory for u-boot code, data and bss. diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c index c372ae2..b97f5bb 100644 --- a/arch/m68k/lib/board.c +++ b/arch/m68k/lib/board.c @@ -77,7 +77,7 @@ static char *failed = "*** failed ***\n"; #include <environment.h>
extern ulong __init_end; -extern ulong __bss_end__; +extern ulong __bss_end;
#if defined(CONFIG_WATCHDOG) # define INIT_FUNC_WATCHDOG_INIT watchdog_init, @@ -244,7 +244,7 @@ board_init_f (ulong bootflag) * - monitor code * - board info struct */ - len = (ulong)&__bss_end__ - CONFIG_SYS_MONITOR_BASE; + len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE;
addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size;
diff --git a/arch/nds32/cpu/n1213/start.S b/arch/nds32/cpu/n1213/start.S index 889bf8b..558fd0e 100644 --- a/arch/nds32/cpu/n1213/start.S +++ b/arch/nds32/cpu/n1213/start.S @@ -240,7 +240,7 @@ fix_got_loop: clear_bss: la $r0, __bss_start /* r0 <- rel __bss_start in FLASH */ add $r0, $r0, $r9 /* r0 <- rel __bss_start in FLASH */ - la $r1, __bss_end__ /* r1 <- rel __bss_end in RAM */ + la $r1, __bss_end /* r1 <- rel __bss_end in RAM */ add $r1, $r1, $r9 /* r0 <- rel __bss_end in RAM */ li $r2, 0x00000000 /* clear */
diff --git a/arch/nds32/cpu/n1213/u-boot.lds b/arch/nds32/cpu/n1213/u-boot.lds index cef19c5..c64d3b7 100644 --- a/arch/nds32/cpu/n1213/u-boot.lds +++ b/arch/nds32/cpu/n1213/u-boot.lds @@ -66,7 +66,7 @@ SECTIONS __bss_start = .; *(.bss) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; }
} diff --git a/arch/nds32/include/asm/u-boot-nds32.h b/arch/nds32/include/asm/u-boot-nds32.h index ae1918d..a6d7beb 100644 --- a/arch/nds32/include/asm/u-boot-nds32.h +++ b/arch/nds32/include/asm/u-boot-nds32.h @@ -31,7 +31,7 @@
/* for the following variables, see start.S */ extern ulong __bss_start; /* BSS start relative to _start */ -extern ulong __bss_end__; /* BSS end relative to _start */ +extern ulong __bss_end; /* BSS end relative to _start */ extern ulong _end; /* end of image relative to _start */ extern ulong _start; /* start of image relative to _start */ extern ulong _TEXT_BASE; /* code start */ diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c index 09feaf3..6e1db44 100644 --- a/arch/nds32/lib/board.c +++ b/arch/nds32/lib/board.c @@ -192,7 +192,7 @@ void board_init_f(ulong bootflag)
memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
- gd->mon_len = (unsigned int)(&__bss_end__) - (unsigned int)(&_start); + gd->mon_len = (unsigned int)(&__bss_end) - (unsigned int)(&_start);
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { if ((*init_fnc_ptr)() != 0) diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S index 0f4ab28..1787b65 100644 --- a/arch/nios2/cpu/start.S +++ b/arch/nios2/cpu/start.S @@ -99,12 +99,12 @@ _cur: movhi r5, %hi(_cur - _start) 3:
/* ZERO BSS/SBSS -- bss and sbss are assumed to be adjacent - * and between __bss_start and __bss_end__. + * and between __bss_start and __bss_end. */ movhi r5, %hi(__bss_start) ori r5, r5, %lo(__bss_start) - movhi r6, %hi(__bss_end__) - ori r6, r6, %lo(__bss_end__) + movhi r6, %hi(__bss_end) + ori r6, r6, %lo(__bss_end) beq r5, r6, 5f
4: stwio r0, 0(r5) diff --git a/arch/nios2/cpu/u-boot.lds b/arch/nios2/cpu/u-boot.lds index d0eb80d..90a7795 100644 --- a/arch/nios2/cpu/u-boot.lds +++ b/arch/nios2/cpu/u-boot.lds @@ -101,7 +101,7 @@ SECTIONS *(.scommon) } . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; PROVIDE (end = .);
/* DEBUG -- symbol table, string table, etc. etc. diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S index 75fb773..cd8dea8 100644 --- a/arch/powerpc/cpu/74xx_7xx/start.S +++ b/arch/powerpc/cpu/74xx_7xx/start.S @@ -72,7 +72,7 @@ GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end) - GOT_ENTRY(__bss_end__) + GOT_ENTRY(__bss_end) GOT_ENTRY(__bss_start) END_GOT
@@ -715,7 +715,7 @@ in_ram: * Now clear BSS segment */ lwz r3,GOT(__bss_start) - lwz r4,GOT(__bss_end__) + lwz r4,GOT(__bss_end)
cmplw 0, r3, r4 beq 6f diff --git a/arch/powerpc/cpu/74xx_7xx/u-boot.lds b/arch/powerpc/cpu/74xx_7xx/u-boot.lds index ecee439..ce03db0 100644 --- a/arch/powerpc/cpu/74xx_7xx/u-boot.lds +++ b/arch/powerpc/cpu/74xx_7xx/u-boot.lds @@ -89,6 +89,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/arch/powerpc/cpu/mpc512x/start.S b/arch/powerpc/cpu/mpc512x/start.S index ed362d8..6d1a99a 100644 --- a/arch/powerpc/cpu/mpc512x/start.S +++ b/arch/powerpc/cpu/mpc512x/start.S @@ -77,7 +77,7 @@ GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end) - GOT_ENTRY(__bss_end__) + GOT_ENTRY(__bss_end) GOT_ENTRY(__bss_start) END_GOT
@@ -622,7 +622,7 @@ clear_bss: * Now clear BSS segment */ lwz r3,GOT(__bss_start) - lwz r4,GOT(__bss_end__) + lwz r4,GOT(__bss_end)
cmplw 0, r3, r4 beq 6f diff --git a/arch/powerpc/cpu/mpc512x/u-boot.lds b/arch/powerpc/cpu/mpc512x/u-boot.lds index 7faefba..66ff02f 100644 --- a/arch/powerpc/cpu/mpc512x/u-boot.lds +++ b/arch/powerpc/cpu/mpc512x/u-boot.lds @@ -84,7 +84,7 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } ENTRY(_start) diff --git a/arch/powerpc/cpu/mpc5xx/start.S b/arch/powerpc/cpu/mpc5xx/start.S index cc4c33e..1b275c6 100644 --- a/arch/powerpc/cpu/mpc5xx/start.S +++ b/arch/powerpc/cpu/mpc5xx/start.S @@ -65,7 +65,7 @@ GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end) - GOT_ENTRY(__bss_end__) + GOT_ENTRY(__bss_end) GOT_ENTRY(__bss_start) END_GOT
@@ -459,7 +459,7 @@ clear_bss: * Now clear BSS segment */ lwz r3,GOT(__bss_start) - lwz r4,GOT(__bss_end__) + lwz r4,GOT(__bss_end) cmplw 0, r3, r4 beq 6f
diff --git a/arch/powerpc/cpu/mpc5xx/u-boot.lds b/arch/powerpc/cpu/mpc5xx/u-boot.lds index c91e146..0001e58 100644 --- a/arch/powerpc/cpu/mpc5xx/u-boot.lds +++ b/arch/powerpc/cpu/mpc5xx/u-boot.lds @@ -93,7 +93,7 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); . = env_start; .ppcenv : diff --git a/arch/powerpc/cpu/mpc5xxx/spl_boot.c b/arch/powerpc/cpu/mpc5xxx/spl_boot.c index 9f14127..66927e5 100644 --- a/arch/powerpc/cpu/mpc5xxx/spl_boot.c +++ b/arch/powerpc/cpu/mpc5xxx/spl_boot.c @@ -47,7 +47,7 @@ void board_init_f(ulong bootflag) initdram(0);
/* Clear bss */ - memset(__bss_start, '\0', __bss_end__ - __bss_start); + memset(__bss_start, '\0', __bss_end - __bss_start);
/* * Init global_data pointer. Has to be done before calling diff --git a/arch/powerpc/cpu/mpc5xxx/start.S b/arch/powerpc/cpu/mpc5xxx/start.S index ad5bc0a..2b6a800 100644 --- a/arch/powerpc/cpu/mpc5xxx/start.S +++ b/arch/powerpc/cpu/mpc5xxx/start.S @@ -66,7 +66,7 @@ GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end) - GOT_ENTRY(__bss_end__) + GOT_ENTRY(__bss_end) GOT_ENTRY(__bss_start) END_GOT #endif @@ -694,7 +694,7 @@ clear_bss: * Now clear BSS segment */ lwz r3,GOT(__bss_start) - lwz r4,GOT(__bss_end__) + lwz r4,GOT(__bss_end)
cmplw 0, r3, r4 beq 6f diff --git a/arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds b/arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds index ac7844d..bc59fad 100644 --- a/arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds +++ b/arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds @@ -91,6 +91,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/arch/powerpc/cpu/mpc5xxx/u-boot-spl.lds b/arch/powerpc/cpu/mpc5xxx/u-boot-spl.lds index cab9b92..0500739 100644 --- a/arch/powerpc/cpu/mpc5xxx/u-boot-spl.lds +++ b/arch/powerpc/cpu/mpc5xxx/u-boot-spl.lds @@ -52,6 +52,6 @@ SECTIONS __bss_start = .; *(.bss*) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; } > sdram } diff --git a/arch/powerpc/cpu/mpc5xxx/u-boot.lds b/arch/powerpc/cpu/mpc5xxx/u-boot.lds index 1f46ead..d179dbc 100644 --- a/arch/powerpc/cpu/mpc5xxx/u-boot.lds +++ b/arch/powerpc/cpu/mpc5xxx/u-boot.lds @@ -87,6 +87,6 @@ SECTIONS *(.sbss*) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/arch/powerpc/cpu/mpc8220/start.S b/arch/powerpc/cpu/mpc8220/start.S index a1a2dc5..6295631 100644 --- a/arch/powerpc/cpu/mpc8220/start.S +++ b/arch/powerpc/cpu/mpc8220/start.S @@ -64,7 +64,7 @@ GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end) - GOT_ENTRY(__bss_end__) + GOT_ENTRY(__bss_end) GOT_ENTRY(__bss_start) END_GOT
@@ -647,7 +647,7 @@ clear_bss: * Now clear BSS segment */ lwz r3,GOT(__bss_start) - lwz r4,GOT(__bss_end__) + lwz r4,GOT(__bss_end)
cmplw 0, r3, r4 beq 6f diff --git a/arch/powerpc/cpu/mpc8220/u-boot.lds b/arch/powerpc/cpu/mpc8220/u-boot.lds index c147954..ec98f0f 100644 --- a/arch/powerpc/cpu/mpc8220/u-boot.lds +++ b/arch/powerpc/cpu/mpc8220/u-boot.lds @@ -86,6 +86,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/arch/powerpc/cpu/mpc824x/start.S b/arch/powerpc/cpu/mpc824x/start.S index 076df70..0b9d898 100644 --- a/arch/powerpc/cpu/mpc824x/start.S +++ b/arch/powerpc/cpu/mpc824x/start.S @@ -72,7 +72,7 @@ GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end) - GOT_ENTRY(__bss_end__) + GOT_ENTRY(__bss_end) GOT_ENTRY(__bss_start) #if defined(CONFIG_FADS) GOT_ENTRY(environment) @@ -584,7 +584,7 @@ clear_bss: * Now clear BSS segment */ lwz r3,GOT(__bss_start) - lwz r4,GOT(__bss_end__) + lwz r4,GOT(__bss_end)
cmplw 0, r3, r4 beq 6f diff --git a/arch/powerpc/cpu/mpc824x/u-boot.lds b/arch/powerpc/cpu/mpc824x/u-boot.lds index a713012..74e2a23 100644 --- a/arch/powerpc/cpu/mpc824x/u-boot.lds +++ b/arch/powerpc/cpu/mpc824x/u-boot.lds @@ -87,6 +87,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/arch/powerpc/cpu/mpc8260/start.S b/arch/powerpc/cpu/mpc8260/start.S index 3299d72..bd8d7ac 100644 --- a/arch/powerpc/cpu/mpc8260/start.S +++ b/arch/powerpc/cpu/mpc8260/start.S @@ -65,7 +65,7 @@ GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end) - GOT_ENTRY(__bss_end__) + GOT_ENTRY(__bss_end) GOT_ENTRY(__bss_start) #if defined(CONFIG_HYMOD) GOT_ENTRY(environment) @@ -920,7 +920,7 @@ clear_bss: */ lwz r4,GOT(environment) #else - lwz r4,GOT(__bss_end__) + lwz r4,GOT(__bss_end) #endif
cmplw 0, r3, r4 diff --git a/arch/powerpc/cpu/mpc8260/u-boot.lds b/arch/powerpc/cpu/mpc8260/u-boot.lds index 42385fc..ce28dba 100644 --- a/arch/powerpc/cpu/mpc8260/u-boot.lds +++ b/arch/powerpc/cpu/mpc8260/u-boot.lds @@ -86,6 +86,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S index 44a64b7..1bfc971 100644 --- a/arch/powerpc/cpu/mpc83xx/start.S +++ b/arch/powerpc/cpu/mpc83xx/start.S @@ -76,7 +76,7 @@ START_GOT GOT_ENTRY(_GOT2_TABLE_) GOT_ENTRY(__bss_start) - GOT_ENTRY(__bss_end__) + GOT_ENTRY(__bss_end)
#ifndef MINIMAL_SPL GOT_ENTRY(_FIXUP_TABLE_) @@ -980,7 +980,7 @@ clear_bss: */ lwz r4,GOT(environment) #else - lwz r4,GOT(__bss_end__) + lwz r4,GOT(__bss_end) #endif
cmplw 0, r3, r4 diff --git a/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds index d140453..870b47d 100644 --- a/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds +++ b/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds @@ -49,7 +49,7 @@ SECTIONS .bss (NOLOAD) : { *(.*bss) } - __bss_end__ = .; + __bss_end = .; } ENTRY(_start) -ASSERT(__bss_end__ <= 0xfff01000, "NAND bootstrap too big"); +ASSERT(__bss_end <= 0xfff01000, "NAND bootstrap too big"); diff --git a/arch/powerpc/cpu/mpc83xx/u-boot.lds b/arch/powerpc/cpu/mpc83xx/u-boot.lds index d699def..22e92e9 100644 --- a/arch/powerpc/cpu/mpc83xx/u-boot.lds +++ b/arch/powerpc/cpu/mpc83xx/u-boot.lds @@ -85,7 +85,7 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } ENTRY(_start) diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S index fb67469..3f76ee6 100644 --- a/arch/powerpc/cpu/mpc85xx/start.S +++ b/arch/powerpc/cpu/mpc85xx/start.S @@ -70,7 +70,7 @@ #endif
GOT_ENTRY(__init_end) - GOT_ENTRY(__bss_end__) + GOT_ENTRY(__bss_end) GOT_ENTRY(__bss_start) END_GOT
@@ -1784,7 +1784,7 @@ clear_bss: * Now clear BSS segment */ lwz r3,GOT(__bss_start) - lwz r4,GOT(__bss_end__) + lwz r4,GOT(__bss_end)
cmplw 0,r3,r4 beq 6f diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds b/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds index f7c4a22..8a44a36 100644 --- a/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds +++ b/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds @@ -103,6 +103,6 @@ SECTIONS } :bss
. = ALIGN(4); - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds index 46dbaed..15c73c1 100644 --- a/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds +++ b/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds @@ -80,6 +80,6 @@ SECTIONS *(.sbss*) *(.bss*) } - __bss_end__ = .; + __bss_end = .; } ASSERT(__init_end <= (0xfff00000 + RESET_VECTOR_OFFSET), "NAND bootstrap too big"); diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds index 1c408e2..f2b7bff 100644 --- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds +++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds @@ -83,5 +83,5 @@ SECTIONS *(.sbss*) *(.bss*) } - __bss_end__ = .; + __bss_end = .; } diff --git a/arch/powerpc/cpu/mpc85xx/u-boot.lds b/arch/powerpc/cpu/mpc85xx/u-boot.lds index 4a40a1f..d2bf7b7 100644 --- a/arch/powerpc/cpu/mpc85xx/u-boot.lds +++ b/arch/powerpc/cpu/mpc85xx/u-boot.lds @@ -127,6 +127,6 @@ SECTIONS } :bss
. = ALIGN(4); - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S index ef80ecf..20dfb9e 100644 --- a/arch/powerpc/cpu/mpc86xx/start.S +++ b/arch/powerpc/cpu/mpc86xx/start.S @@ -61,7 +61,7 @@ GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end) - GOT_ENTRY(__bss_end__) + GOT_ENTRY(__bss_end) GOT_ENTRY(__bss_start) END_GOT
@@ -800,7 +800,7 @@ in_ram: * Now clear BSS segment */ lwz r3,GOT(__bss_start) - lwz r4,GOT(__bss_end__) + lwz r4,GOT(__bss_end)
cmplw 0, r3, r4 beq 6f diff --git a/arch/powerpc/cpu/mpc86xx/u-boot.lds b/arch/powerpc/cpu/mpc86xx/u-boot.lds index 8bfadf2..65386b8 100644 --- a/arch/powerpc/cpu/mpc86xx/u-boot.lds +++ b/arch/powerpc/cpu/mpc86xx/u-boot.lds @@ -90,6 +90,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S index ebca3ac..5aa50c5 100644 --- a/arch/powerpc/cpu/mpc8xx/start.S +++ b/arch/powerpc/cpu/mpc8xx/start.S @@ -72,7 +72,7 @@ GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end) - GOT_ENTRY(__bss_end__) + GOT_ENTRY(__bss_end) GOT_ENTRY(__bss_start) END_GOT
@@ -590,7 +590,7 @@ clear_bss: * Now clear BSS segment */ lwz r3,GOT(__bss_start) - lwz r4,GOT(__bss_end__) + lwz r4,GOT(__bss_end)
cmplw 0, r3, r4 beq 6f diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S index 7aef43b..52f2623 100644 --- a/arch/powerpc/cpu/ppc4xx/start.S +++ b/arch/powerpc/cpu/ppc4xx/start.S @@ -243,7 +243,7 @@ GOT_ENTRY(transfer_to_handler)
GOT_ENTRY(__init_end) - GOT_ENTRY(__bss_end__) + GOT_ENTRY(__bss_end) GOT_ENTRY(__bss_start) END_GOT #endif /* CONFIG_NAND_SPL */ @@ -1509,7 +1509,7 @@ clear_bss: * Now clear BSS segment */ lwz r3,GOT(__bss_start) - lwz r4,GOT(__bss_end__) + lwz r4,GOT(__bss_end)
cmplw 0, r3, r4 beq 7f diff --git a/arch/powerpc/cpu/ppc4xx/u-boot.lds b/arch/powerpc/cpu/ppc4xx/u-boot.lds index a96ddd5..8c6beb0 100644 --- a/arch/powerpc/cpu/ppc4xx/u-boot.lds +++ b/arch/powerpc/cpu/ppc4xx/u-boot.lds @@ -142,6 +142,6 @@ SECTIONS } :bss
. = ALIGN(4); - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/arch/powerpc/include/asm/spl.h b/arch/powerpc/include/asm/spl.h index f43bc23..7d5f9a0 100644 --- a/arch/powerpc/include/asm/spl.h +++ b/arch/powerpc/include/asm/spl.h @@ -26,6 +26,6 @@ #define BOOT_DEVICE_NOR 1
/* Linker symbols */ -extern char __bss_start[], __bss_end__[]; +extern char __bss_start[], __bss_end[];
#endif diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c index 12270a4..0b23d30 100644 --- a/arch/powerpc/lib/board.c +++ b/arch/powerpc/lib/board.c @@ -123,7 +123,7 @@ DECLARE_GLOBAL_DATA_PTR; #endif
extern ulong __init_end; -extern ulong __bss_end__; +extern ulong __bss_end; ulong monitor_flash_len;
#if defined(CONFIG_CMD_BEDBUG) @@ -419,7 +419,7 @@ void board_init_f(ulong bootflag) * - monitor code * - board info struct */ - len = (ulong)&__bss_end__ - CONFIG_SYS_MONITOR_BASE; + len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE;
/* * Subtract specified amount of memory to hide so that it won't diff --git a/arch/sh/cpu/sh2/u-boot.lds b/arch/sh/cpu/sh2/u-boot.lds index 17f8091..20cb459 100644 --- a/arch/sh/cpu/sh2/u-boot.lds +++ b/arch/sh/cpu/sh2/u-boot.lds @@ -88,5 +88,5 @@ SECTIONS } PROVIDE (bss_end = .);
- PROVIDE (__bss_end__ = .); + PROVIDE (__bss_end = .); } diff --git a/arch/sh/cpu/sh3/u-boot.lds b/arch/sh/cpu/sh3/u-boot.lds index c831961..b5f60f2 100644 --- a/arch/sh/cpu/sh3/u-boot.lds +++ b/arch/sh/cpu/sh3/u-boot.lds @@ -95,5 +95,5 @@ SECTIONS } PROVIDE (bss_end = .);
- PROVIDE (__bss_end__ = .); + PROVIDE (__bss_end = .); } diff --git a/arch/sh/cpu/sh4/u-boot.lds b/arch/sh/cpu/sh4/u-boot.lds index 0ecafcf..5721c18 100644 --- a/arch/sh/cpu/sh4/u-boot.lds +++ b/arch/sh/cpu/sh4/u-boot.lds @@ -92,5 +92,5 @@ SECTIONS } PROVIDE (bss_end = .);
- PROVIDE (__bss_end__ = .); + PROVIDE (__bss_end = .); } diff --git a/board/BuS/eb_cpu5282/u-boot.lds b/board/BuS/eb_cpu5282/u-boot.lds index 0c92d31..7c1695a 100644 --- a/board/BuS/eb_cpu5282/u-boot.lds +++ b/board/BuS/eb_cpu5282/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/LEOX/elpt860/u-boot.lds b/board/LEOX/elpt860/u-boot.lds index 2bb876d..ee2c705 100644 --- a/board/LEOX/elpt860/u-boot.lds +++ b/board/LEOX/elpt860/u-boot.lds @@ -112,6 +112,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/RPXClassic/u-boot.lds b/board/RPXClassic/u-boot.lds index 18f962c..a507d73 100644 --- a/board/RPXClassic/u-boot.lds +++ b/board/RPXClassic/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/RPXlite/u-boot.lds b/board/RPXlite/u-boot.lds index 18f962c..a507d73 100644 --- a/board/RPXlite/u-boot.lds +++ b/board/RPXlite/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/RPXlite_dw/u-boot.lds b/board/RPXlite_dw/u-boot.lds index 18f962c..a507d73 100644 --- a/board/RPXlite_dw/u-boot.lds +++ b/board/RPXlite_dw/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/RRvision/u-boot.lds b/board/RRvision/u-boot.lds index 748e511..646931a 100644 --- a/board/RRvision/u-boot.lds +++ b/board/RRvision/u-boot.lds @@ -98,6 +98,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/actux1/u-boot.lds b/board/actux1/u-boot.lds index c41eed0..a0d217b 100644 --- a/board/actux1/u-boot.lds +++ b/board/actux1/u-boot.lds @@ -78,7 +78,7 @@ SECTIONS . = ALIGN(4); _end = .; } - __bss_end__ =.; + __bss_end =.; /DISCARD/ : { *(.dynstr*) } /DISCARD/ : { *(.dynamic*) } /DISCARD/ : { *(.plt*) } diff --git a/board/actux2/u-boot.lds b/board/actux2/u-boot.lds index 8409984..da2b4e2 100644 --- a/board/actux2/u-boot.lds +++ b/board/actux2/u-boot.lds @@ -78,7 +78,7 @@ SECTIONS . = ALIGN(4); _end = .; } - __bss_end__ =.; + __bss_end =.; /DISCARD/ : { *(.dynstr*) } /DISCARD/ : { *(.dynamic*) } /DISCARD/ : { *(.plt*) } diff --git a/board/actux3/u-boot.lds b/board/actux3/u-boot.lds index a3bd02b..f922033 100644 --- a/board/actux3/u-boot.lds +++ b/board/actux3/u-boot.lds @@ -78,7 +78,7 @@ SECTIONS . = ALIGN(4); _end = .; } - __bss_end__ =.; + __bss_end =.; /DISCARD/ : { *(.dynstr*) } /DISCARD/ : { *(.dynamic*) } /DISCARD/ : { *(.plt*) } diff --git a/board/adder/u-boot.lds b/board/adder/u-boot.lds index 73e2f3f..2f10e7c 100644 --- a/board/adder/u-boot.lds +++ b/board/adder/u-boot.lds @@ -89,7 +89,7 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } ENTRY(_start) diff --git a/board/ait/cam_enc_4xx/u-boot-spl.lds b/board/ait/cam_enc_4xx/u-boot-spl.lds index 656b2fb..d6b66d4 100644 --- a/board/ait/cam_enc_4xx/u-boot-spl.lds +++ b/board/ait/cam_enc_4xx/u-boot-spl.lds @@ -69,7 +69,7 @@ SECTIONS __bss_start = .; *(.bss*) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; } >.sram
__image_copy_end = .; diff --git a/board/altera/nios2-generic/u-boot.lds b/board/altera/nios2-generic/u-boot.lds index 289386b..bf7600a 100644 --- a/board/altera/nios2-generic/u-boot.lds +++ b/board/altera/nios2-generic/u-boot.lds @@ -102,7 +102,7 @@ SECTIONS *(.scommon) } . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; PROVIDE (end = .);
/* DEBUG -- symbol table, string table, etc. etc. diff --git a/board/amcc/acadia/u-boot-nand.lds b/board/amcc/acadia/u-boot-nand.lds index beba978..3bdad34 100644 --- a/board/amcc/acadia/u-boot-nand.lds +++ b/board/amcc/acadia/u-boot-nand.lds @@ -98,6 +98,6 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/amcc/bamboo/u-boot-nand.lds b/board/amcc/bamboo/u-boot-nand.lds index 2dd00d7..1f9a4ae 100644 --- a/board/amcc/bamboo/u-boot-nand.lds +++ b/board/amcc/bamboo/u-boot-nand.lds @@ -99,6 +99,6 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/amcc/canyonlands/u-boot-nand.lds b/board/amcc/canyonlands/u-boot-nand.lds index 8ac5116..0396c9f 100644 --- a/board/amcc/canyonlands/u-boot-nand.lds +++ b/board/amcc/canyonlands/u-boot-nand.lds @@ -99,6 +99,6 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/amcc/kilauea/u-boot-nand.lds b/board/amcc/kilauea/u-boot-nand.lds index beba978..3bdad34 100644 --- a/board/amcc/kilauea/u-boot-nand.lds +++ b/board/amcc/kilauea/u-boot-nand.lds @@ -98,6 +98,6 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/amcc/sequoia/u-boot-nand.lds b/board/amcc/sequoia/u-boot-nand.lds index 18266ef..9a2a232 100644 --- a/board/amcc/sequoia/u-boot-nand.lds +++ b/board/amcc/sequoia/u-boot-nand.lds @@ -99,6 +99,6 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/amcc/sequoia/u-boot-ram.lds b/board/amcc/sequoia/u-boot-ram.lds index 6b02784..e853da8 100644 --- a/board/amcc/sequoia/u-boot-ram.lds +++ b/board/amcc/sequoia/u-boot-ram.lds @@ -90,6 +90,6 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/astro/mcf5373l/u-boot.lds b/board/astro/mcf5373l/u-boot.lds index bc40fd6..11aa092 100644 --- a/board/astro/mcf5373l/u-boot.lds +++ b/board/astro/mcf5373l/u-boot.lds @@ -97,6 +97,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/cobra5272/u-boot.lds b/board/cobra5272/u-boot.lds index d054f20..47378fd 100644 --- a/board/cobra5272/u-boot.lds +++ b/board/cobra5272/u-boot.lds @@ -96,6 +96,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/cogent/u-boot.lds b/board/cogent/u-boot.lds index 2a6027f..1cc482f 100644 --- a/board/cogent/u-boot.lds +++ b/board/cogent/u-boot.lds @@ -97,6 +97,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/dave/PPChameleonEVB/u-boot.lds b/board/dave/PPChameleonEVB/u-boot.lds index 8a306d6..512fe1a 100644 --- a/board/dave/PPChameleonEVB/u-boot.lds +++ b/board/dave/PPChameleonEVB/u-boot.lds @@ -126,6 +126,6 @@ SECTIONS } :bss
. = ALIGN(4); - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/davinci/da8xxevm/u-boot-spl-da850evm.lds b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds index c5fd93c..6d287f1 100644 --- a/board/davinci/da8xxevm/u-boot-spl-da850evm.lds +++ b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds @@ -71,7 +71,7 @@ SECTIONS __bss_start = .; *(.bss*) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; } >.sram
__image_copy_end = .; diff --git a/board/davinci/da8xxevm/u-boot-spl-hawk.lds b/board/davinci/da8xxevm/u-boot-spl-hawk.lds index 86dc172..e3a07cc 100644 --- a/board/davinci/da8xxevm/u-boot-spl-hawk.lds +++ b/board/davinci/da8xxevm/u-boot-spl-hawk.lds @@ -79,7 +79,7 @@ SECTIONS __bss_start = .; *(.bss*) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; }
_end = .; diff --git a/board/dvlhost/u-boot.lds b/board/dvlhost/u-boot.lds index 1bd1700..ed91003 100644 --- a/board/dvlhost/u-boot.lds +++ b/board/dvlhost/u-boot.lds @@ -78,7 +78,7 @@ SECTIONS . = ALIGN(4); _end = .; } - __bss_end__ =.; + __bss_end =.; /DISCARD/ : { *(.dynstr*) } /DISCARD/ : { *(.dynamic*) } /DISCARD/ : { *(.plt*) } diff --git a/board/eltec/mhpc/u-boot.lds b/board/eltec/mhpc/u-boot.lds index c8d3894..3c1c05a 100644 --- a/board/eltec/mhpc/u-boot.lds +++ b/board/eltec/mhpc/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/emk/top860/u-boot.lds b/board/emk/top860/u-boot.lds index 22626d3..155fa76 100644 --- a/board/emk/top860/u-boot.lds +++ b/board/emk/top860/u-boot.lds @@ -94,6 +94,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/ep88x/u-boot.lds b/board/ep88x/u-boot.lds index 1dcc22a..7baaad8 100644 --- a/board/ep88x/u-boot.lds +++ b/board/ep88x/u-boot.lds @@ -89,7 +89,7 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } ENTRY(_start) diff --git a/board/esd/dasa_sim/u-boot.lds b/board/esd/dasa_sim/u-boot.lds index 7eca183..cb94a51 100644 --- a/board/esd/dasa_sim/u-boot.lds +++ b/board/esd/dasa_sim/u-boot.lds @@ -100,6 +100,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/esd/pmc440/u-boot-nand.lds b/board/esd/pmc440/u-boot-nand.lds index ca7df45..101b893 100644 --- a/board/esd/pmc440/u-boot-nand.lds +++ b/board/esd/pmc440/u-boot-nand.lds @@ -129,6 +129,6 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/esd/tasreg/u-boot.lds b/board/esd/tasreg/u-boot.lds index 0d6a0f3..fd77fa9 100644 --- a/board/esd/tasreg/u-boot.lds +++ b/board/esd/tasreg/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/esteem192e/u-boot.lds b/board/esteem192e/u-boot.lds index fe5cf09..7ffdc17 100644 --- a/board/esteem192e/u-boot.lds +++ b/board/esteem192e/u-boot.lds @@ -101,6 +101,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/evb64260/u-boot.lds b/board/evb64260/u-boot.lds index eac9c07..4b956f8 100644 --- a/board/evb64260/u-boot.lds +++ b/board/evb64260/u-boot.lds @@ -97,6 +97,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/fads/u-boot.lds b/board/fads/u-boot.lds index 6022dbc..1cb191c 100644 --- a/board/fads/u-boot.lds +++ b/board/fads/u-boot.lds @@ -95,7 +95,7 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } ENTRY(_start) diff --git a/board/flagadm/u-boot.lds b/board/flagadm/u-boot.lds index c8d3894..3c1c05a 100644 --- a/board/flagadm/u-boot.lds +++ b/board/flagadm/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m5208evbe/u-boot.lds b/board/freescale/m5208evbe/u-boot.lds index 2c151f2..da4b4f2 100644 --- a/board/freescale/m5208evbe/u-boot.lds +++ b/board/freescale/m5208evbe/u-boot.lds @@ -97,6 +97,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m52277evb/u-boot.lds b/board/freescale/m52277evb/u-boot.lds index dbd6f6a..e3f8847 100644 --- a/board/freescale/m52277evb/u-boot.lds +++ b/board/freescale/m52277evb/u-boot.lds @@ -96,6 +96,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m5235evb/u-boot.lds b/board/freescale/m5235evb/u-boot.lds index 00932ae..c324b64 100644 --- a/board/freescale/m5235evb/u-boot.lds +++ b/board/freescale/m5235evb/u-boot.lds @@ -96,6 +96,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m5249evb/u-boot.lds b/board/freescale/m5249evb/u-boot.lds index d054f20..47378fd 100644 --- a/board/freescale/m5249evb/u-boot.lds +++ b/board/freescale/m5249evb/u-boot.lds @@ -96,6 +96,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m5253demo/u-boot.lds b/board/freescale/m5253demo/u-boot.lds index f8116f6..d14a2af 100644 --- a/board/freescale/m5253demo/u-boot.lds +++ b/board/freescale/m5253demo/u-boot.lds @@ -97,6 +97,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m5253evbe/u-boot.lds b/board/freescale/m5253evbe/u-boot.lds index d054f20..47378fd 100644 --- a/board/freescale/m5253evbe/u-boot.lds +++ b/board/freescale/m5253evbe/u-boot.lds @@ -96,6 +96,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m5271evb/u-boot.lds b/board/freescale/m5271evb/u-boot.lds index 133ec01..c7574c9 100644 --- a/board/freescale/m5271evb/u-boot.lds +++ b/board/freescale/m5271evb/u-boot.lds @@ -96,6 +96,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m5272c3/u-boot.lds b/board/freescale/m5272c3/u-boot.lds index d054f20..47378fd 100644 --- a/board/freescale/m5272c3/u-boot.lds +++ b/board/freescale/m5272c3/u-boot.lds @@ -96,6 +96,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m5275evb/u-boot.lds b/board/freescale/m5275evb/u-boot.lds index fc68de1..7f3b73d 100644 --- a/board/freescale/m5275evb/u-boot.lds +++ b/board/freescale/m5275evb/u-boot.lds @@ -96,6 +96,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m5282evb/u-boot.lds b/board/freescale/m5282evb/u-boot.lds index ad49874..35d669c 100644 --- a/board/freescale/m5282evb/u-boot.lds +++ b/board/freescale/m5282evb/u-boot.lds @@ -96,6 +96,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m53017evb/u-boot.lds b/board/freescale/m53017evb/u-boot.lds index d25a36f..1a6f0cd 100644 --- a/board/freescale/m53017evb/u-boot.lds +++ b/board/freescale/m53017evb/u-boot.lds @@ -99,6 +99,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m5329evb/u-boot.lds b/board/freescale/m5329evb/u-boot.lds index 6616594..f5cc586 100644 --- a/board/freescale/m5329evb/u-boot.lds +++ b/board/freescale/m5329evb/u-boot.lds @@ -97,6 +97,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m5373evb/u-boot.lds b/board/freescale/m5373evb/u-boot.lds index bc40fd6..11aa092 100644 --- a/board/freescale/m5373evb/u-boot.lds +++ b/board/freescale/m5373evb/u-boot.lds @@ -97,6 +97,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m54418twr/u-boot.lds b/board/freescale/m54418twr/u-boot.lds index 36a4c26..5ae7fce 100644 --- a/board/freescale/m54418twr/u-boot.lds +++ b/board/freescale/m54418twr/u-boot.lds @@ -94,6 +94,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m54451evb/u-boot.lds b/board/freescale/m54451evb/u-boot.lds index 91328a4..2bd4a73 100644 --- a/board/freescale/m54451evb/u-boot.lds +++ b/board/freescale/m54451evb/u-boot.lds @@ -94,6 +94,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m54455evb/u-boot.lds b/board/freescale/m54455evb/u-boot.lds index 36a4c26..5ae7fce 100644 --- a/board/freescale/m54455evb/u-boot.lds +++ b/board/freescale/m54455evb/u-boot.lds @@ -94,6 +94,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m547xevb/u-boot.lds b/board/freescale/m547xevb/u-boot.lds index de4d0eb..5e987bb 100644 --- a/board/freescale/m547xevb/u-boot.lds +++ b/board/freescale/m547xevb/u-boot.lds @@ -94,6 +94,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/m548xevb/u-boot.lds b/board/freescale/m548xevb/u-boot.lds index fbbe0c5..27340ee 100644 --- a/board/freescale/m548xevb/u-boot.lds +++ b/board/freescale/m548xevb/u-boot.lds @@ -94,6 +94,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/freescale/mx31ads/u-boot.lds b/board/freescale/mx31ads/u-boot.lds index 5267729..4d1858b 100644 --- a/board/freescale/mx31ads/u-boot.lds +++ b/board/freescale/mx31ads/u-boot.lds @@ -84,7 +84,7 @@ SECTIONS __bss_start = .; *(.bss) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; }
/DISCARD/ : { *(.bss*) } diff --git a/board/gaisler/gr_cpci_ax2000/u-boot.lds b/board/gaisler/gr_cpci_ax2000/u-boot.lds index 774c494..70ebf4d 100644 --- a/board/gaisler/gr_cpci_ax2000/u-boot.lds +++ b/board/gaisler/gr_cpci_ax2000/u-boot.lds @@ -134,7 +134,7 @@ SECTIONS . = ALIGN(16); /* to speed clearing of bss up */ } __bss_end = . ; - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .);
/* Relocated into main memory */ diff --git a/board/gaisler/gr_ep2s60/u-boot.lds b/board/gaisler/gr_ep2s60/u-boot.lds index f6d1301..429b579 100644 --- a/board/gaisler/gr_ep2s60/u-boot.lds +++ b/board/gaisler/gr_ep2s60/u-boot.lds @@ -134,7 +134,7 @@ SECTIONS . = ALIGN(16); /* to speed clearing of bss up */ } __bss_end = . ; - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .);
/* Relocated into main memory */ diff --git a/board/gaisler/gr_xc3s_1500/u-boot.lds b/board/gaisler/gr_xc3s_1500/u-boot.lds index 7df6e83..7052129 100644 --- a/board/gaisler/gr_xc3s_1500/u-boot.lds +++ b/board/gaisler/gr_xc3s_1500/u-boot.lds @@ -135,7 +135,7 @@ SECTIONS . = ALIGN(16); /* to speed clearing of bss up */ } __bss_end = . ; - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .);
/* Relocated into main memory */ diff --git a/board/gaisler/grsim/u-boot.lds b/board/gaisler/grsim/u-boot.lds index b241cbc..c608284 100644 --- a/board/gaisler/grsim/u-boot.lds +++ b/board/gaisler/grsim/u-boot.lds @@ -134,7 +134,7 @@ SECTIONS . = ALIGN(16); /* to speed clearing of bss up */ } __bss_end = . ; - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .);
/* Relocated into main memory */ diff --git a/board/gaisler/grsim_leon2/u-boot.lds b/board/gaisler/grsim_leon2/u-boot.lds index 63c15b9..eafb4f0 100644 --- a/board/gaisler/grsim_leon2/u-boot.lds +++ b/board/gaisler/grsim_leon2/u-boot.lds @@ -133,7 +133,7 @@ SECTIONS . = ALIGN(16); /* to speed clearing of bss up */ } __bss_end = . ; - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .);
/* Relocated into main memory */ diff --git a/board/gen860t/u-boot-flashenv.lds b/board/gen860t/u-boot-flashenv.lds index 1cbe7e3..f5c757e 100644 --- a/board/gen860t/u-boot-flashenv.lds +++ b/board/gen860t/u-boot-flashenv.lds @@ -97,7 +97,7 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .);
.ppcenv: diff --git a/board/gen860t/u-boot.lds b/board/gen860t/u-boot.lds index dd89c70..d2649a8 100644 --- a/board/gen860t/u-boot.lds +++ b/board/gen860t/u-boot.lds @@ -98,6 +98,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/genietv/u-boot.lds b/board/genietv/u-boot.lds index 124b183..15575e4 100644 --- a/board/genietv/u-boot.lds +++ b/board/genietv/u-boot.lds @@ -112,6 +112,6 @@ SECTIONS common/env_embedded.o (.ppcenv) } . = ALIGN(4); - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/hermes/u-boot.lds b/board/hermes/u-boot.lds index f02eb1c..d2a2f22 100644 --- a/board/hermes/u-boot.lds +++ b/board/hermes/u-boot.lds @@ -99,6 +99,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/hymod/u-boot.lds b/board/hymod/u-boot.lds index 7afae0a..c9f0f37 100644 --- a/board/hymod/u-boot.lds +++ b/board/hymod/u-boot.lds @@ -143,6 +143,6 @@ SECTIONS common/env_embedded.o (.ppcenv) } . = ALIGN(4); - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/icu862/u-boot.lds b/board/icu862/u-boot.lds index 6778eb1..9ff187c 100644 --- a/board/icu862/u-boot.lds +++ b/board/icu862/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/idmr/u-boot.lds b/board/idmr/u-boot.lds index 0d6a0f3..fd77fa9 100644 --- a/board/idmr/u-boot.lds +++ b/board/idmr/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS . = ALIGN(4); _ebss = .; } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/ip860/u-boot.lds b/board/ip860/u-boot.lds index 18f962c..a507d73 100644 --- a/board/ip860/u-boot.lds +++ b/board/ip860/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/ivm/u-boot.lds b/board/ivm/u-boot.lds index 4cca652..838c07b 100644 --- a/board/ivm/u-boot.lds +++ b/board/ivm/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/korat/u-boot-F7FC.lds b/board/korat/u-boot-F7FC.lds index 033cff4..90d2135 100644 --- a/board/korat/u-boot-F7FC.lds +++ b/board/korat/u-boot-F7FC.lds @@ -135,6 +135,6 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/kup/kup4k/u-boot.lds b/board/kup/kup4k/u-boot.lds index 18f962c..a507d73 100644 --- a/board/kup/kup4k/u-boot.lds +++ b/board/kup/kup4k/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/kup/kup4x/u-boot.lds b/board/kup/kup4x/u-boot.lds index 18f962c..a507d73 100644 --- a/board/kup/kup4x/u-boot.lds +++ b/board/kup/kup4x/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/lwmon/u-boot.lds b/board/lwmon/u-boot.lds index bc71b0d..279605b 100644 --- a/board/lwmon/u-boot.lds +++ b/board/lwmon/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/manroland/uc100/u-boot.lds b/board/manroland/uc100/u-boot.lds index e32ae37..ac6af1a 100644 --- a/board/manroland/uc100/u-boot.lds +++ b/board/manroland/uc100/u-boot.lds @@ -96,6 +96,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/matrix_vision/mvsmr/u-boot.lds b/board/matrix_vision/mvsmr/u-boot.lds index 5a3a9ea..4c464d1 100644 --- a/board/matrix_vision/mvsmr/u-boot.lds +++ b/board/matrix_vision/mvsmr/u-boot.lds @@ -100,6 +100,6 @@ SECTIONS *(.sbss*) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/mbx8xx/u-boot.lds b/board/mbx8xx/u-boot.lds index 18f962c..a507d73 100644 --- a/board/mbx8xx/u-boot.lds +++ b/board/mbx8xx/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/mousse/u-boot.lds b/board/mousse/u-boot.lds index 43f91f1..0bcf2ee 100644 --- a/board/mousse/u-boot.lds +++ b/board/mousse/u-boot.lds @@ -88,6 +88,6 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/mvblue/u-boot.lds b/board/mvblue/u-boot.lds index c378564..cb4a07c 100644 --- a/board/mvblue/u-boot.lds +++ b/board/mvblue/u-boot.lds @@ -97,6 +97,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/netphone/u-boot.lds b/board/netphone/u-boot.lds index cdc1fda..e63a8c9 100644 --- a/board/netphone/u-boot.lds +++ b/board/netphone/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/netta/u-boot.lds b/board/netta/u-boot.lds index cdc1fda..e63a8c9 100644 --- a/board/netta/u-boot.lds +++ b/board/netta/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/netta2/u-boot.lds b/board/netta2/u-boot.lds index cdc1fda..e63a8c9 100644 --- a/board/netta2/u-boot.lds +++ b/board/netta2/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/netvia/u-boot.lds b/board/netvia/u-boot.lds index cdc1fda..e63a8c9 100644 --- a/board/netvia/u-boot.lds +++ b/board/netvia/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/nx823/u-boot.lds b/board/nx823/u-boot.lds index c8d3894..3c1c05a 100644 --- a/board/nx823/u-boot.lds +++ b/board/nx823/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/quantum/u-boot.lds b/board/quantum/u-boot.lds index 18f962c..a507d73 100644 --- a/board/quantum/u-boot.lds +++ b/board/quantum/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/r360mpi/u-boot.lds b/board/r360mpi/u-boot.lds index 3ef0d9e..404eda0 100644 --- a/board/r360mpi/u-boot.lds +++ b/board/r360mpi/u-boot.lds @@ -95,7 +95,7 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); . = ALIGN(128 * 1024); .ppcenv : diff --git a/board/rbc823/u-boot.lds b/board/rbc823/u-boot.lds index a86b568..bb3b9de 100644 --- a/board/rbc823/u-boot.lds +++ b/board/rbc823/u-boot.lds @@ -103,6 +103,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/renesas/sh7752evb/u-boot.lds b/board/renesas/sh7752evb/u-boot.lds index 28449b6..d568312 100644 --- a/board/renesas/sh7752evb/u-boot.lds +++ b/board/renesas/sh7752evb/u-boot.lds @@ -93,5 +93,5 @@ SECTIONS } PROVIDE (bss_end = .);
- PROVIDE (__bss_end__ = .); + PROVIDE (__bss_end = .); } diff --git a/board/renesas/sh7757lcr/u-boot.lds b/board/renesas/sh7757lcr/u-boot.lds index cf406ce..49d6500 100644 --- a/board/renesas/sh7757lcr/u-boot.lds +++ b/board/renesas/sh7757lcr/u-boot.lds @@ -94,5 +94,5 @@ SECTIONS } PROVIDE (bss_end = .);
- PROVIDE (__bss_end__ = .); + PROVIDE (__bss_end = .); } diff --git a/board/rsdproto/u-boot.lds b/board/rsdproto/u-boot.lds index ff95029..ec8cddd 100644 --- a/board/rsdproto/u-boot.lds +++ b/board/rsdproto/u-boot.lds @@ -125,6 +125,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/samsung/smdk5250/smdk5250-uboot-spl.lds b/board/samsung/smdk5250/smdk5250-uboot-spl.lds index 951d8ce..48ad60c 100644 --- a/board/samsung/smdk5250/smdk5250-uboot-spl.lds +++ b/board/samsung/smdk5250/smdk5250-uboot-spl.lds @@ -66,6 +66,6 @@ SECTIONS __bss_start = .; *(.bss*) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; } >.sram } diff --git a/board/samsung/smdk6400/u-boot-nand.lds b/board/samsung/smdk6400/u-boot-nand.lds index fbb442a..3bf2ae1 100644 --- a/board/samsung/smdk6400/u-boot-nand.lds +++ b/board/samsung/smdk6400/u-boot-nand.lds @@ -75,7 +75,7 @@ SECTIONS __bss_start = .; *(.bss) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; }
/DISCARD/ : { *(.dynstr*) } diff --git a/board/sandpoint/u-boot.lds b/board/sandpoint/u-boot.lds index ae3afa1..65c1dbd 100644 --- a/board/sandpoint/u-boot.lds +++ b/board/sandpoint/u-boot.lds @@ -95,6 +95,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/sixnet/u-boot.lds b/board/sixnet/u-boot.lds index 6cf7a01..ce3026f 100644 --- a/board/sixnet/u-boot.lds +++ b/board/sixnet/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/snmc/qs850/u-boot.lds b/board/snmc/qs850/u-boot.lds index f57f8a0..749980f 100644 --- a/board/snmc/qs850/u-boot.lds +++ b/board/snmc/qs850/u-boot.lds @@ -96,6 +96,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/snmc/qs860t/u-boot.lds b/board/snmc/qs860t/u-boot.lds index 18f962c..a507d73 100644 --- a/board/snmc/qs860t/u-boot.lds +++ b/board/snmc/qs860t/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/spc1920/u-boot.lds b/board/spc1920/u-boot.lds index 18f962c..a507d73 100644 --- a/board/spc1920/u-boot.lds +++ b/board/spc1920/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/spd8xx/u-boot.lds b/board/spd8xx/u-boot.lds index f69e39d..905c91d 100644 --- a/board/spd8xx/u-boot.lds +++ b/board/spd8xx/u-boot.lds @@ -102,6 +102,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/stx/stxxtc/u-boot.lds b/board/stx/stxxtc/u-boot.lds index cdc1fda..e63a8c9 100644 --- a/board/stx/stxxtc/u-boot.lds +++ b/board/stx/stxxtc/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/svm_sc8xx/u-boot.lds b/board/svm_sc8xx/u-boot.lds index 1635875..5d3d8f2 100644 --- a/board/svm_sc8xx/u-boot.lds +++ b/board/svm_sc8xx/u-boot.lds @@ -110,6 +110,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/tqc/tqm8xx/u-boot.lds b/board/tqc/tqm8xx/u-boot.lds index e1e1ccd..bcc618c 100644 --- a/board/tqc/tqm8xx/u-boot.lds +++ b/board/tqc/tqm8xx/u-boot.lds @@ -106,6 +106,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/v37/u-boot.lds b/board/v37/u-boot.lds index fd2d72e..cdd73fa 100644 --- a/board/v37/u-boot.lds +++ b/board/v37/u-boot.lds @@ -93,6 +93,6 @@ SECTIONS *(COMMON) . = ALIGN(4); } - __bss_end__ = . ; + __bss_end = . ; PROVIDE (end = .); } diff --git a/board/vpac270/u-boot-spl.lds b/board/vpac270/u-boot-spl.lds index 20161a4..5d66c13 100644 --- a/board/vpac270/u-boot-spl.lds +++ b/board/vpac270/u-boot-spl.lds @@ -82,7 +82,7 @@ SECTIONS __bss_start = .; *(.bss) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; }
/DISCARD/ : { *(.bss*) } diff --git a/board/woodburn/woodburn.c b/board/woodburn/woodburn.c index d74f360..d5894e6 100644 --- a/board/woodburn/woodburn.c +++ b/board/woodburn/woodburn.c @@ -148,7 +148,7 @@ void board_init_f(ulong dummy) woodburn_init();
/* Clear the BSS. */ - memset(__bss_start, 0, __bss_end__ - __bss_start); + memset(__bss_start, 0, __bss_end - __bss_start);
/* Set global data pointer. */ gd = &gdata; diff --git a/nand_spl/board/amcc/acadia/u-boot.lds b/nand_spl/board/amcc/acadia/u-boot.lds index 44a6f81..5e14b0c 100644 --- a/nand_spl/board/amcc/acadia/u-boot.lds +++ b/nand_spl/board/amcc/acadia/u-boot.lds @@ -60,5 +60,5 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; } diff --git a/nand_spl/board/amcc/bamboo/u-boot.lds b/nand_spl/board/amcc/bamboo/u-boot.lds index d4ea67a..d8edffe 100644 --- a/nand_spl/board/amcc/bamboo/u-boot.lds +++ b/nand_spl/board/amcc/bamboo/u-boot.lds @@ -62,5 +62,5 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; } diff --git a/nand_spl/board/amcc/canyonlands/u-boot.lds b/nand_spl/board/amcc/canyonlands/u-boot.lds index 794f041..70001bf 100644 --- a/nand_spl/board/amcc/canyonlands/u-boot.lds +++ b/nand_spl/board/amcc/canyonlands/u-boot.lds @@ -62,5 +62,5 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; } diff --git a/nand_spl/board/amcc/kilauea/u-boot.lds b/nand_spl/board/amcc/kilauea/u-boot.lds index 4e860ad..0d7e6de 100644 --- a/nand_spl/board/amcc/kilauea/u-boot.lds +++ b/nand_spl/board/amcc/kilauea/u-boot.lds @@ -60,5 +60,5 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; } diff --git a/nand_spl/board/amcc/sequoia/u-boot.lds b/nand_spl/board/amcc/sequoia/u-boot.lds index 8ff6ac5..d28fe61 100644 --- a/nand_spl/board/amcc/sequoia/u-boot.lds +++ b/nand_spl/board/amcc/sequoia/u-boot.lds @@ -62,5 +62,5 @@ SECTIONS . = ALIGN(4); }
- __bss_end__ = . ; + __bss_end = . ; } diff --git a/nand_spl/board/freescale/mpc8315erdb/u-boot.lds b/nand_spl/board/freescale/mpc8315erdb/u-boot.lds index d140453..870b47d 100644 --- a/nand_spl/board/freescale/mpc8315erdb/u-boot.lds +++ b/nand_spl/board/freescale/mpc8315erdb/u-boot.lds @@ -49,7 +49,7 @@ SECTIONS .bss (NOLOAD) : { *(.*bss) } - __bss_end__ = .; + __bss_end = .; } ENTRY(_start) -ASSERT(__bss_end__ <= 0xfff01000, "NAND bootstrap too big"); +ASSERT(__bss_end <= 0xfff01000, "NAND bootstrap too big"); diff --git a/nand_spl/board/freescale/mx31pdk/u-boot.lds b/nand_spl/board/freescale/mx31pdk/u-boot.lds index a26110f..eaccd55 100644 --- a/nand_spl/board/freescale/mx31pdk/u-boot.lds +++ b/nand_spl/board/freescale/mx31pdk/u-boot.lds @@ -73,7 +73,7 @@ SECTIONS __bss_start = .; *(.bss) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; }
/DISCARD/ : { *(.bss*) } diff --git a/nand_spl/board/karo/tx25/u-boot.lds b/nand_spl/board/karo/tx25/u-boot.lds index ee36131..e047edb 100644 --- a/nand_spl/board/karo/tx25/u-boot.lds +++ b/nand_spl/board/karo/tx25/u-boot.lds @@ -71,7 +71,7 @@ SECTIONS __bss_start = .; *(.bss) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; }
/DISCARD/ : { *(.bss*) } diff --git a/nand_spl/board/samsung/smdk6400/u-boot.lds b/nand_spl/board/samsung/smdk6400/u-boot.lds index 2ed6466..ae2bc4b 100644 --- a/nand_spl/board/samsung/smdk6400/u-boot.lds +++ b/nand_spl/board/samsung/smdk6400/u-boot.lds @@ -75,6 +75,6 @@ SECTIONS __bss_start = .; *(.bss) . = ALIGN(4); - __bss_end__ = .; + __bss_end = .; } } diff --git a/nand_spl/board/sheldon/simpc8313/u-boot.lds b/nand_spl/board/sheldon/simpc8313/u-boot.lds index 534a0c8..7ab408b 100644 --- a/nand_spl/board/sheldon/simpc8313/u-boot.lds +++ b/nand_spl/board/sheldon/simpc8313/u-boot.lds @@ -48,7 +48,7 @@ SECTIONS . = ALIGN(8); __bss_start = .; .bss (NOLOAD) : { *(.*bss) } - __bss_end__ = .; + __bss_end = .; } ENTRY(_start) -ASSERT(__bss_end__ <= 0xfff01000, "NAND bootstrap too big"); +ASSERT(__bss_end <= 0xfff01000, "NAND bootstrap too big");

On Fri, Feb 08, 2013 at 07:11:59AM -0800, Simon Glass wrote:
Note this is a tree-wide change affecting multiple architectures.
At present we use __bss_start, but mostly __bss_end__. This seems inconsistent and in a number of places __bss_end is used instead.
Change to use __bss_end for the BSS end symbol throughout U-Boot. This makes it possible to use the asm-generic/sections.h file on all archs.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: Tom Rini trini@ti.com

On Mon, Feb 18, 2013 at 5:13 PM, Tom Rini trini@ti.com wrote:
On Fri, Feb 08, 2013 at 07:11:59AM -0800, Simon Glass wrote:
Note this is a tree-wide change affecting multiple architectures.
At present we use __bss_start, but mostly __bss_end__. This seems inconsistent and in a number of places __bss_end is used instead.
Change to use __bss_end for the BSS end symbol throughout U-Boot. This makes it possible to use the asm-generic/sections.h file on all archs.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: Tom Rini trini@ti.com
The short commit log is wrong; it say's twice __bss_end.

Hi Otavio,
On Mon, Feb 18, 2013 at 1:40 PM, Otavio Salvador otavio@ossystems.com.br wrote:
On Mon, Feb 18, 2013 at 5:13 PM, Tom Rini trini@ti.com wrote:
On Fri, Feb 08, 2013 at 07:11:59AM -0800, Simon Glass wrote:
Note this is a tree-wide change affecting multiple architectures.
At present we use __bss_start, but mostly __bss_end__. This seems inconsistent and in a number of places __bss_end is used instead.
Change to use __bss_end for the BSS end symbol throughout U-Boot. This makes it possible to use the asm-generic/sections.h file on all archs.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: Tom Rini trini@ti.com
The short commit log is wrong; it say's twice __bss_end.
Can you please explain that one a bit more. I'm not sure I understand.
Regards, Simon
-- Otavio Salvador O.S. Systems E-mail: otavio@ossystems.com.br http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br

On Mon, Feb 18, 2013 at 9:23 PM, Simon Glass sjg@chromium.org wrote:
Hi Otavio,
On Mon, Feb 18, 2013 at 1:40 PM, Otavio Salvador otavio@ossystems.com.br wrote:
On Mon, Feb 18, 2013 at 5:13 PM, Tom Rini trini@ti.com wrote:
On Fri, Feb 08, 2013 at 07:11:59AM -0800, Simon Glass wrote:
Note this is a tree-wide change affecting multiple architectures.
At present we use __bss_start, but mostly __bss_end__. This seems inconsistent and in a number of places __bss_end is used instead.
Change to use __bss_end for the BSS end symbol throughout U-Boot. This makes it possible to use the asm-generic/sections.h file on all archs.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: Tom Rini trini@ti.com
The short commit log is wrong; it say's twice __bss_end.
Can you please explain that one a bit more. I'm not sure I understand.
Sorry; I read it wrong; it is right ... (I need to take more coffee :P)
Regards,

Hi Otavio,
On Mon, Feb 18, 2013 at 4:30 PM, Otavio Salvador otavio@ossystems.com.br wrote:
On Mon, Feb 18, 2013 at 9:23 PM, Simon Glass sjg@chromium.org wrote:
Hi Otavio,
On Mon, Feb 18, 2013 at 1:40 PM, Otavio Salvador otavio@ossystems.com.br wrote:
On Mon, Feb 18, 2013 at 5:13 PM, Tom Rini trini@ti.com wrote:
On Fri, Feb 08, 2013 at 07:11:59AM -0800, Simon Glass wrote:
Note this is a tree-wide change affecting multiple architectures.
At present we use __bss_start, but mostly __bss_end__. This seems inconsistent and in a number of places __bss_end is used instead.
Change to use __bss_end for the BSS end symbol throughout U-Boot. This makes it possible to use the asm-generic/sections.h file on all archs.
Signed-off-by: Simon Glass sjg@chromium.org
Reviewed-by: Tom Rini trini@ti.com
The short commit log is wrong; it say's twice __bss_end.
Can you please explain that one a bit more. I'm not sure I understand.
Sorry; I read it wrong; it is right ... (I need to take more coffee :P)
OK thank you. It will be less confusing when they are all the same.
Regards, Simon
Regards,
-- Otavio Salvador O.S. Systems E-mail: otavio@ossystems.com.br http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br

On Fri, Feb 8, 2013 at 9:11 AM, Simon Glass sjg@chromium.org wrote:
Note this is a tree-wide change affecting multiple architectures.
At present we use __bss_start, but mostly __bss_end__. This seems inconsistent and in a number of places __bss_end is used instead.
Change to use __bss_end for the BSS end symbol throughout U-Boot. This makes it possible to use the asm-generic/sections.h file on all archs.
Signed-off-by: Simon Glass sjg@chromium.org
Builds for all 85xx, so:
Acked-by: Andy Fleming afleming@freescale.com

We create a separate header file for link symbols defined by the link scripts. It is helpful to have these all in one place and try to make them common across architectures. Since Linux already has a similar file, we bring this in even though many of the symbols there are not relevant to us.
Each architecture has its own asm/sections.h where symbols specifc to that architecture can be added. For now everything except AVR32 just includes the generic header.
One change is needed in arch/avr32/lib/board.c to make this conversion work.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Remove the __bss_end #define now that this is consistent across U-Boot
Changes in v4: - Add asm/sections.h for each architecture
Changes in v3: None Changes in v2: None
arch/arm/include/asm/sections.h | 27 ++++++++ arch/avr32/include/asm/sections.h | 6 +- arch/avr32/lib/board.c | 2 +- arch/blackfin/include/asm/sections.h | 27 ++++++++ arch/m68k/include/asm/sections.h | 27 ++++++++ arch/microblaze/include/asm/sections.h | 27 ++++++++ arch/mips/include/asm/sections.h | 27 ++++++++ arch/nds32/include/asm/sections.h | 27 ++++++++ arch/nios2/include/asm/sections.h | 27 ++++++++ arch/openrisc/include/asm/sections.h | 27 ++++++++ arch/powerpc/include/asm/sections.h | 27 ++++++++ arch/sandbox/include/asm/sections.h | 2 + arch/sh/include/asm/sections.h | 27 ++++++++ arch/sparc/include/asm/sections.h | 27 ++++++++ arch/x86/include/asm/sections.h | 27 ++++++++ include/asm-generic/sections.h | 119 +++++++++++++++++++++++++++++++++ 16 files changed, 449 insertions(+), 4 deletions(-) create mode 100644 arch/arm/include/asm/sections.h create mode 100644 arch/blackfin/include/asm/sections.h create mode 100644 arch/m68k/include/asm/sections.h create mode 100644 arch/microblaze/include/asm/sections.h create mode 100644 arch/mips/include/asm/sections.h create mode 100644 arch/nds32/include/asm/sections.h create mode 100644 arch/nios2/include/asm/sections.h create mode 100644 arch/openrisc/include/asm/sections.h create mode 100644 arch/powerpc/include/asm/sections.h create mode 100644 arch/sh/include/asm/sections.h create mode 100644 arch/sparc/include/asm/sections.h create mode 100644 arch/x86/include/asm/sections.h create mode 100644 include/asm-generic/sections.h
diff --git a/arch/arm/include/asm/sections.h b/arch/arm/include/asm/sections.h new file mode 100644 index 0000000..c042cb6 --- /dev/null +++ b/arch/arm/include/asm/sections.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_ARM_SECTIONS_H +#define __ASM_ARM_SECTIONS_H + +#include <asm-generic/sections.h> + +#endif diff --git a/arch/avr32/include/asm/sections.h b/arch/avr32/include/asm/sections.h index a78fd40..056d7a0 100644 --- a/arch/avr32/include/asm/sections.h +++ b/arch/avr32/include/asm/sections.h @@ -22,11 +22,11 @@ #ifndef __ASM_AVR32_SECTIONS_H #define __ASM_AVR32_SECTIONS_H
+#include <asm-generic/sections.h> + /* References to section boundaries */
-extern char _text[], _etext[]; -extern char _data[], __data_lma[], _edata[], __edata_lma[]; +extern char __data_lma[], __edata_lma[]; extern char __got_start[], __got_lma[], __got_end[]; -extern char __bss_end[];
#endif /* __ASM_AVR32_SECTIONS_H */ diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index 77f8fa1..df85922 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -188,7 +188,7 @@ void board_init_f(ulong board_type) * - stack */ addr = CONFIG_SYS_SDRAM_BASE + sdram_size; - monitor_len = __bss_end - _text; + monitor_len = (char *)__bss_end - _text;
/* * Reserve memory for u-boot code, data and bss. diff --git a/arch/blackfin/include/asm/sections.h b/arch/blackfin/include/asm/sections.h new file mode 100644 index 0000000..85af42c --- /dev/null +++ b/arch/blackfin/include/asm/sections.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_BLACKFIN_SECTIONS_H +#define __ASM_BLACKFIN_SECTIONS_H + +#include <asm-generic/sections.h> + +#endif diff --git a/arch/m68k/include/asm/sections.h b/arch/m68k/include/asm/sections.h new file mode 100644 index 0000000..9228987 --- /dev/null +++ b/arch/m68k/include/asm/sections.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_M68K_SECTIONS_H +#define __ASM_M68K_SECTIONS_H + +#include <asm-generic/sections.h> + +#endif diff --git a/arch/microblaze/include/asm/sections.h b/arch/microblaze/include/asm/sections.h new file mode 100644 index 0000000..156c149 --- /dev/null +++ b/arch/microblaze/include/asm/sections.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_MICROBLAZE_SECTIONS_H +#define __ASM_MICROBLAZE_SECTIONS_H + +#include <asm-generic/sections.h> + +#endif diff --git a/arch/mips/include/asm/sections.h b/arch/mips/include/asm/sections.h new file mode 100644 index 0000000..54cd8b3 --- /dev/null +++ b/arch/mips/include/asm/sections.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_MIPS_SECTIONS_H +#define __ASM_MIPS_SECTIONS_H + +#include <asm-generic/sections.h> + +#endif diff --git a/arch/nds32/include/asm/sections.h b/arch/nds32/include/asm/sections.h new file mode 100644 index 0000000..a65735e --- /dev/null +++ b/arch/nds32/include/asm/sections.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_NDS32_SECTIONS_H +#define __ASM_NDS32_SECTIONS_H + +#include <asm-generic/sections.h> + +#endif diff --git a/arch/nios2/include/asm/sections.h b/arch/nios2/include/asm/sections.h new file mode 100644 index 0000000..d813563 --- /dev/null +++ b/arch/nios2/include/asm/sections.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_NIOS2_SECTIONS_H +#define __ASM_NIOS2_SECTIONS_H + +#include <asm-generic/sections.h> + +#endif diff --git a/arch/openrisc/include/asm/sections.h b/arch/openrisc/include/asm/sections.h new file mode 100644 index 0000000..6eb5a66 --- /dev/null +++ b/arch/openrisc/include/asm/sections.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_OPENRISC_SECTIONS_H +#define __ASM_OPENRISC_SECTIONS_H + +#include <asm-generic/sections.h> + +#endif diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h new file mode 100644 index 0000000..0a94102 --- /dev/null +++ b/arch/powerpc/include/asm/sections.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_POWERPC_SECTIONS_H +#define __ASM_POWERPC_SECTIONS_H + +#include <asm-generic/sections.h> + +#endif diff --git a/arch/sandbox/include/asm/sections.h b/arch/sandbox/include/asm/sections.h index eafce7d..4c37860 100644 --- a/arch/sandbox/include/asm/sections.h +++ b/arch/sandbox/include/asm/sections.h @@ -9,6 +9,8 @@ #ifndef __SANDBOX_SECTIONS_H #define __SANDBOX_SECTIONS_H
+#include <asm-generic/sections.h> + struct sb_cmdline_option;
extern struct sb_cmdline_option *__u_boot_sandbox_option_start[], diff --git a/arch/sh/include/asm/sections.h b/arch/sh/include/asm/sections.h new file mode 100644 index 0000000..8824560 --- /dev/null +++ b/arch/sh/include/asm/sections.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_SH_SECTIONS_H +#define __ASM_SH_SECTIONS_H + +#include <asm-generic/sections.h> + +#endif diff --git a/arch/sparc/include/asm/sections.h b/arch/sparc/include/asm/sections.h new file mode 100644 index 0000000..90f7fa7 --- /dev/null +++ b/arch/sparc/include/asm/sections.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_SPARC_SECTIONS_H +#define __ASM_SPARC_SECTIONS_H + +#include <asm-generic/sections.h> + +#endif diff --git a/arch/x86/include/asm/sections.h b/arch/x86/include/asm/sections.h new file mode 100644 index 0000000..602df86 --- /dev/null +++ b/arch/x86/include/asm/sections.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_X86_SECTIONS_H +#define __ASM_X86_SECTIONS_H + +#include <asm-generic/sections.h> + +#endif diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h new file mode 100644 index 0000000..09aaf83 --- /dev/null +++ b/include/asm-generic/sections.h @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +/* Taken from Linux kernel */ + +#ifndef _ASM_GENERIC_SECTIONS_H_ +#define _ASM_GENERIC_SECTIONS_H_ + +/* References to section boundaries */ + +extern char _text[], _stext[], _etext[]; +extern char _data[], _sdata[], _edata[]; +extern char __bss_start[], __bss_stop[]; +extern char __init_begin[], __init_end[]; +extern char _sinittext[], _einittext[]; +extern char _end[]; +extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[]; +extern char __kprobes_text_start[], __kprobes_text_end[]; +extern char __entry_text_start[], __entry_text_end[]; +extern char __initdata_begin[], __initdata_end[]; +extern char __start_rodata[], __end_rodata[]; + +/* Start and end of .ctors section - used for constructor calls. */ +extern char __ctors_start[], __ctors_end[]; + +/* function descriptor handling (if any). Override + * in asm/sections.h */ +#ifndef dereference_function_descriptor +#define dereference_function_descriptor(p) (p) +#endif + +/* random extra sections (if any). Override + * in asm/sections.h */ +#ifndef arch_is_kernel_text +static inline int arch_is_kernel_text(unsigned long addr) +{ + return 0; +} +#endif + +#ifndef arch_is_kernel_data +static inline int arch_is_kernel_data(unsigned long addr) +{ + return 0; +} +#endif + +/* U-Boot-specific things begin here */ + +/* Start of U-Boot text region */ +extern char __text_start[]; + +/* This marks the end of the text region which must be relocated */ +extern char __image_copy_end[]; + +/* + * This is the U-Boot entry point - prior to relocation it should be same + * as __text_start + */ +extern void _start(void); + +/* + * ARM needs to use offsets for symbols, since the values of some symbols + * are not resolved prior to relocation (and are just 0). Maybe this can be + * resolved, or maybe other architectures are similar, iwc this should be + * promoted to an architecture option. + */ +#ifdef CONFIG_ARM +#define CONFIG_SYS_SYM_OFFSETS +#endif + +#ifdef CONFIG_SYS_SYM_OFFSETS +/* Start/end of the relocation entries, as an offset from _start */ +extern ulong _rel_dyn_start_ofs; +extern ulong _rel_dyn_end_ofs; + +/* Start/end of the relocation symbol table, as an offset from _start */ +extern ulong _dynsym_start_ofs; + +/* End of the region to be relocated, as an offset form _start */ +extern ulong _image_copy_end_ofs; + +extern ulong _bss_start_ofs; /* BSS start relative to _start */ +extern ulong _bss_end_ofs; /* BSS end relative to _start */ +extern ulong _end_ofs; /* end of image relative to _start */ + +extern ulong _TEXT_BASE; /* code start */ + +#else /* don't use offsets: */ + +/* Exports from the Linker Script */ +extern ulong __data_end; +extern ulong __rel_dyn_start; +extern ulong __rel_dyn_end; +extern ulong __bss_end; + +extern ulong _TEXT_BASE; /* code start */ + +#endif + +#endif /* _ASM_GENERIC_SECTIONS_H_ */

On Fri, Feb 08, 2013 at 07:12:00AM -0800, Simon Glass wrote:
We create a separate header file for link symbols defined by the link scripts. It is helpful to have these all in one place and try to make them common across architectures. Since Linux already has a similar file, we bring this in even though many of the symbols there are not relevant to us.
Each architecture has its own asm/sections.h where symbols specifc to that architecture can be added. For now everything except AVR32 just includes the generic header.
One change is needed in arch/avr32/lib/board.c to make this conversion work.
Signed-off-by: Simon Glass sjg@chromium.org
Need to specify a tag/hash for where this came from in the kernel. Also, didn't you and Wolfgang agree to drop the CREDITS file bit from the boilerplate on new files?
Reviewed-by: Tom Rini trini@ti.com

Include this header to get access to link symbols, which are otherwise removed.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Remove avr32 changes from what should be an arm patch
Changes in v4: - Use asm/sections.h instead of asm-generic/sections.h
Changes in v3: None Changes in v2: None
arch/arm/include/asm/u-boot-arm.h | 4 ---- arch/arm/lib/board.c | 1 + board/cm4008/flash.c | 1 + board/cm41xx/flash.c | 1 + 4 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h index 9f3cae5..f16861a 100644 --- a/arch/arm/include/asm/u-boot-arm.h +++ b/arch/arm/include/asm/u-boot-arm.h @@ -30,12 +30,8 @@ #define _U_BOOT_ARM_H_ 1
/* for the following variables, see start.S */ -extern ulong _bss_start_ofs; /* BSS start relative to _start */ -extern ulong _bss_end_ofs; /* BSS end relative to _start */ -extern ulong _end_ofs; /* end of image relative to _start */ extern ulong IRQ_STACK_START; /* top of IRQ stack */ extern ulong FIQ_STACK_START; /* top of FIQ stack */ -extern ulong _TEXT_BASE; /* code start */ extern ulong _datarel_start_ofs; extern ulong _datarelrolocal_start_ofs; extern ulong _datarellocal_start_ofs; diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 162e2cc..0521178 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -53,6 +53,7 @@ #include <fdtdec.h> #include <post.h> #include <logbuff.h> +#include <asm/sections.h>
#ifdef CONFIG_BITBANGMII #include <miiphy.h> diff --git a/board/cm4008/flash.c b/board/cm4008/flash.c index 5522bf0..0faf197 100644 --- a/board/cm4008/flash.c +++ b/board/cm4008/flash.c @@ -29,6 +29,7 @@
#include <common.h> #include <linux/byteorder/swab.h> +#include <asm/sections.h>
flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */ diff --git a/board/cm41xx/flash.c b/board/cm41xx/flash.c index 5522bf0..0faf197 100644 --- a/board/cm41xx/flash.c +++ b/board/cm41xx/flash.c @@ -29,6 +29,7 @@
#include <common.h> #include <linux/byteorder/swab.h> +#include <asm/sections.h>
flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */

We can use the declarations of __bss_start and _end from this header instead of declaring them locally.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Adjust u-boot-nds32.h link symbols to keep U-Boot building
Changes in v4: - Use asm/sections.h instead of asm-generic/sections.h - Adjust u-boot-x86.h link symbols to keep U-Boot building
Changes in v3: None Changes in v2: None
arch/nds32/include/asm/u-boot-nds32.h | 8 ++++---- arch/x86/include/asm/u-boot-x86.h | 6 +++--- examples/standalone/stubs.c | 7 +++---- 3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/arch/nds32/include/asm/u-boot-nds32.h b/arch/nds32/include/asm/u-boot-nds32.h index a6d7beb..f3c7b27 100644 --- a/arch/nds32/include/asm/u-boot-nds32.h +++ b/arch/nds32/include/asm/u-boot-nds32.h @@ -30,10 +30,10 @@ #define _U_BOOT_NDS32_H_ 1
/* for the following variables, see start.S */ -extern ulong __bss_start; /* BSS start relative to _start */ -extern ulong __bss_end; /* BSS end relative to _start */ -extern ulong _end; /* end of image relative to _start */ -extern ulong _start; /* start of image relative to _start */ +extern char __bss_start[]; /* BSS start relative to _start */ +extern ulong __bss_end; /* BSS end relative to _start */ +extern char _end[]; /* end of image relative to _start */ +extern void _start(void); /* start of image relative to _start */ extern ulong _TEXT_BASE; /* code start */ extern ulong IRQ_STACK_START; /* top of IRQ stack */ extern ulong FIQ_STACK_START; /* top of FIQ stack */ diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h index 948615d..3e380fe 100644 --- a/arch/x86/include/asm/u-boot-x86.h +++ b/arch/x86/include/asm/u-boot-x86.h @@ -25,13 +25,13 @@ #define _U_BOOT_I386_H_ 1
/* Exports from the Linker Script */ -extern ulong __text_start; +extern char __text_start[]; extern ulong __data_end; extern ulong __rel_dyn_start; extern ulong __rel_dyn_end; -extern ulong __bss_start; +extern char __bss_start[]; extern ulong __bss_end; -extern ulong _end; +extern char _end[];
/* cpu/.../cpu.c */ int x86_cpu_init_r(void); diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index 15e9afc..8fb1765 100644 --- a/examples/standalone/stubs.c +++ b/examples/standalone/stubs.c @@ -217,16 +217,15 @@ void __attribute__((unused)) dummy(void) #include <_exports.h> }
-extern unsigned long __bss_start, _end; +#include <asm/sections.h>
void app_startup(char * const *argv) { - unsigned char * cp = (unsigned char *) &__bss_start; + char *cp = __bss_start;
/* Zero out BSS */ - while (cp < (unsigned char *)&_end) { + while (cp < _end) *cp++ = 0; - }
#if defined(CONFIG_X86) /* x86 does not have a dedicated register for passing global_data */

This library supports calling a list of functions one after the other.
It is intended that we move to a more powerful initcall implementation as proposed by Graeme Russ graeme.russ@gmail.com. For now, this allows us to do the basics.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Add debug() code to initcalls - Update copyright on initcalls
Changes in v4: None Changes in v3: None Changes in v2: None
include/initcall.h | 25 +++++++++++++++++++++++++ lib/Makefile | 1 + lib/initcall.c | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 include/initcall.h create mode 100644 lib/initcall.c
diff --git a/include/initcall.h b/include/initcall.h new file mode 100644 index 0000000..9e54fa5 --- /dev/null +++ b/include/initcall.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +typedef int (*init_fnc_t)(void); + +int initcall_run_list(init_fnc_t init_sequence[]); diff --git a/lib/Makefile b/lib/Makefile index 86ca1a6..1bfd3ee 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -44,6 +44,7 @@ COBJS-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o COBJS-$(CONFIG_GZIP) += gunzip.o COBJS-$(CONFIG_GZIP_COMPRESSED) += gzip.o COBJS-y += hashtable.o +COBJS-y += initcall.o COBJS-$(CONFIG_LMB) += lmb.o COBJS-y += ldiv.o COBJS-$(CONFIG_MD5) += md5.o diff --git a/lib/initcall.c b/lib/initcall.c new file mode 100644 index 0000000..fc91bf6 --- /dev/null +++ b/lib/initcall.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2013 The Chromium OS Authors. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> +#include <initcall.h> + +int initcall_run_list(init_fnc_t init_sequence[]) +{ + init_fnc_t *init_fnc_ptr; + + for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { + debug("initcall: %p\n", *init_fnc_ptr); + if ((*init_fnc_ptr)()) { + debug("initcall sequence %p failed at call %p\n", + init_sequence, *init_fnc_ptr); + return -1; + } + } + return 0; +}

We are introducing a new unified board setup and we want this to be the default. So we need to opt all architectures out first.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
README | 11 +++++++++++ arch/arm/config.mk | 3 +++ arch/avr32/config.mk | 3 +++ arch/blackfin/config.mk | 3 +++ arch/m68k/config.mk | 3 +++ arch/microblaze/config.mk | 3 +++ arch/mips/config.mk | 3 +++ arch/nds32/config.mk | 3 +++ arch/nios2/config.mk | 3 +++ arch/powerpc/config.mk | 3 +++ arch/sandbox/config.mk | 3 +++ arch/sh/config.mk | 3 +++ arch/sparc/config.mk | 3 +++ arch/x86/config.mk | 3 +++ config.mk | 8 ++++++++ 15 files changed, 58 insertions(+)
diff --git a/README b/README index 2352e38..88526cb 100644 --- a/README +++ b/README @@ -3209,6 +3209,17 @@ Configuration Settings: If defined, don't allow the -f switch to env set override variable access flags.
+- CONFIG_SYS_GENERIC_BOARD + This selects the architecture-generic board system instead of the + architecture-specific board files. It is intended to move boards + to this new framework over time. Defining this will disable the + arch/foo/lib/board.c file and use common/board_f.c and + common/board_r.c instead. To use this option your architecture + must support it (i.e. must NOT define CONFIG_SYS_LEGACY_BOARD in + its config.mk file). If you find problems enabling this option on + your board please report the problem and send patches! + + The following definitions that deal with the placement and management of environment data (variable area); in general, we support the following configurations: diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 24b9d7c..c159675 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -49,6 +49,9 @@ ifneq ($(CONFIG_SPL_BUILD),y) ALL-$(CONFIG_SYS_THUMB_BUILD) += checkthumb endif
+# Move to unified board system later +CONFIG_SYS_LEGACY_BOARD := y + # Try if EABI is supported, else fall back to old API, # i. e. for example: # - with ELDK 4.2 (EABI supported), use: diff --git a/arch/avr32/config.mk b/arch/avr32/config.mk index a751a3d..bd5703e 100644 --- a/arch/avr32/config.mk +++ b/arch/avr32/config.mk @@ -29,3 +29,6 @@ PLATFORM_RELFLAGS += -ffixed-r5 -fPIC -mno-init-got -mrelax PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
LDFLAGS_u-boot = --gc-sections --relax + +# Move to unified board system later +CONFIG_SYS_LEGACY_BOARD := y diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk index 3595aa2..972afb1 100644 --- a/arch/blackfin/config.mk +++ b/arch/blackfin/config.mk @@ -37,6 +37,9 @@ CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE))) PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN
+# Move to unified board system later +CONFIG_SYS_LEGACY_BOARD := y + LDFLAGS_FINAL += --gc-sections LDFLAGS += -m elf32bfin PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections diff --git a/arch/m68k/config.mk b/arch/m68k/config.mk index 11ba334..11ad9a5 100644 --- a/arch/m68k/config.mk +++ b/arch/m68k/config.mk @@ -29,3 +29,6 @@ PLATFORM_CPPFLAGS += -DCONFIG_M68K -D__M68K__ PLATFORM_LDFLAGS += -n PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections LDFLAGS_FINAL += --gc-sections + +# Move to unified board system later +CONFIG_SYS_LEGACY_BOARD := y diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk index b4935f0..300e3c5 100644 --- a/arch/microblaze/config.mk +++ b/arch/microblaze/config.mk @@ -33,3 +33,6 @@ PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__ LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds
CONFIG_ARCH_DEVICE_TREE := microblaze + +# Move to unified board system later +CONFIG_SYS_LEGACY_BOARD := y diff --git a/arch/mips/config.mk b/arch/mips/config.mk index de9140b..fedfc16 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -41,6 +41,9 @@ ENDIANNESS ?= -EB
PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
+# Move to unified board system later +CONFIG_SYS_LEGACY_BOARD := y + # # From Linux arch/mips/Makefile # diff --git a/arch/nds32/config.mk b/arch/nds32/config.mk index c589829..f989053 100644 --- a/arch/nds32/config.mk +++ b/arch/nds32/config.mk @@ -33,3 +33,6 @@ PLATFORM_RELFLAGS += -gdwarf-2 PLATFORM_CPPFLAGS += -DCONFIG_NDS32 -D__nds32__ -G0 -ffixed-10 -fpie
LDFLAGS_u-boot = --gc-sections --relax + +# Move to unified board system later +CONFIG_SYS_LEGACY_BOARD := y diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk index 7b03ed8..0172f70 100644 --- a/arch/nios2/config.mk +++ b/arch/nios2/config.mk @@ -31,3 +31,6 @@ PLATFORM_CPPFLAGS += -G0
LDFLAGS_FINAL += --gc-sections PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections + +# Move to unified board system later +CONFIG_SYS_LEGACY_BOARD := y diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index b706281..bf77090 100644 --- a/arch/powerpc/config.mk +++ b/arch/powerpc/config.mk @@ -29,6 +29,9 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ PLATFORM_LDFLAGS += -n
+# Move to unified board system later +CONFIG_SYS_LEGACY_BOARD := y + # # When cross-compiling on NetBSD, we have to define __PPC__ or else we # will pick up a va_list declaration that is incompatible with the diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk index 02ce4a4..53a972f 100644 --- a/arch/sandbox/config.mk +++ b/arch/sandbox/config.mk @@ -19,3 +19,6 @@
PLATFORM_CPPFLAGS += -DCONFIG_SANDBOX -D__SANDBOX__ -U_FORTIFY_SOURCE PLATFORM_LIBS += -lrt + +# Move to unified board system later +CONFIG_SYS_LEGACY_BOARD := y diff --git a/arch/sh/config.mk b/arch/sh/config.mk index 07ff8b9..0c21ef5 100644 --- a/arch/sh/config.mk +++ b/arch/sh/config.mk @@ -31,3 +31,6 @@ endif PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__ PLATFORM_LDFLAGS += -e $(CONFIG_SYS_TEXT_BASE) --defsym reloc_dst=$(CONFIG_SYS_TEXT_BASE) LDFLAGS_FINAL = --gc-sections + +# Move to unified board system later +CONFIG_SYS_LEGACY_BOARD := y diff --git a/arch/sparc/config.mk b/arch/sparc/config.mk index cae7478..b98a173 100644 --- a/arch/sparc/config.mk +++ b/arch/sparc/config.mk @@ -26,3 +26,6 @@ CROSS_COMPILE ?= sparc-elf- CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000 -L $(gcclibdir) -T sparc.lds
PLATFORM_CPPFLAGS += -DCONFIG_SPARC -D__sparc__ + +# Move to unified board system later +CONFIG_SYS_LEGACY_BOARD := y diff --git a/arch/x86/config.mk b/arch/x86/config.mk index 23cacff..7be3036 100644 --- a/arch/x86/config.mk +++ b/arch/x86/config.mk @@ -48,3 +48,6 @@ NORMAL_LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) PREFIXED_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/$(shell basename $(NORMAL_LIBGCC))
export USE_PRIVATE_LIBGCC=$(shell dirname $(PREFIXED_LIBGCC)) + +# Move to unified board system later +CONFIG_SYS_LEGACY_BOARD := y diff --git a/config.mk b/config.mk index b7cd481..9d3b185 100644 --- a/config.mk +++ b/config.mk @@ -221,6 +221,14 @@ ifeq ($(CONFIG_SPL_BUILD),y) CPPFLAGS += -DCONFIG_SPL_BUILD endif
+# Does this architecture support generic board init? +ifneq ($(CONFIG_SYS_LEGACY_BOARD),) +ifneq ($(CONFIG_SYS_GENERIC_BOARD),) +$(error Your architecture does not support generic board. Please undefined \ +CONFIG_SYS_GENERIC_BOARD in your board config file) +endif +endif + ifneq ($(RESET_VECTOR_ADDRESS),) CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS) endif

These functions are only available for powerpc and are not declared in a header file. We want to use the rest function in two places (board_f and board_r), so declare the functions in watchdog.h.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Avoid using static declaration for init_func_watchdog_reset()
Changes in v4: None Changes in v3: None Changes in v2: None
arch/powerpc/lib/board.c | 11 ++--------- include/watchdog.h | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c index 0b23d30..acb6fdb 100644 --- a/arch/powerpc/lib/board.c +++ b/arch/powerpc/lib/board.c @@ -237,25 +237,18 @@ static int init_func_spi(void) /***********************************************************************/
#if defined(CONFIG_WATCHDOG) -static int init_func_watchdog_init(void) +int init_func_watchdog_init(void) { puts(" Watchdog enabled\n"); WATCHDOG_RESET(); return 0; }
-#define INIT_FUNC_WATCHDOG_INIT init_func_watchdog_init, - -static int init_func_watchdog_reset(void) +int init_func_watchdog_reset(void) { WATCHDOG_RESET(); return 0; } - -#define INIT_FUNC_WATCHDOG_RESET init_func_watchdog_reset, -#else -#define INIT_FUNC_WATCHDOG_INIT /* undef */ -#define INIT_FUNC_WATCHDOG_RESET /* undef */ #endif /* CONFIG_WATCHDOG */
/* diff --git a/include/watchdog.h b/include/watchdog.h index 8c92a0b..97ec186 100644 --- a/include/watchdog.h +++ b/include/watchdog.h @@ -27,6 +27,24 @@ #ifndef _WATCHDOG_H_ #define _WATCHDOG_H_
+#if !defined(__ASSEMBLY__) +/* + * Reset the watchdog timer, always returns 0 + * + * This function is here since it is shared between board_f() and board_r(), + * and the legacy arch/<arch>/board.c code. + */ +int init_func_watchdog_reset(void); +#endif + +#ifdef CONFIG_WATCHDOG +#define INIT_FUNC_WATCHDOG_INIT init_func_watchdog_init, +#define INIT_FUNC_WATCHDOG_RESET init_func_watchdog_reset, +#else +#define INIT_FUNC_WATCHDOG_INIT +#define INIT_FUNC_WATCHDOG_RESET +#endif + #if defined(CONFIG_HW_WATCHDOG) && defined(CONFIG_WATCHDOG) # error "Configuration error: CONFIG_HW_WATCHDOG and CONFIG_WATCHDOG can't be used together." #endif

This file handles common pre-relocation init for boards which use the generic framework.
It starts up the console, DRAM, performs relocation and then jumps to post-relocation init.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Add fdtdec header file to board_f.c - Remove setup_global_data_ptr() - Tidy up stack init - Put global data on stack in board_init_f() - Add fdt relocation - Remove fdt relocation field from x86 arch_global_data - Deal with change of board_init_f() semantics on ARM - Save boot_flags in global_data in board_init_f() - Add print_cpuinfo() prototype to include/common.h
Changes in v4: - Use asm/sections.h instead of asm-generic/sections.h
Changes in v3: - Cast away the volatile on gd for memcpy()
Changes in v2: None
arch/x86/include/asm/global_data.h | 1 - arch/x86/lib/board.c | 2 +- arch/x86/lib/init_helpers.c | 2 +- arch/x86/lib/relocate.c | 8 +- common/Makefile | 3 + common/board_f.c | 564 +++++++++++++++++++++++++++++++++++++ include/asm-generic/global_data.h | 2 + include/common.h | 1 + 8 files changed, 576 insertions(+), 7 deletions(-) create mode 100644 common/board_f.c
diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index 5cc4202..8a96fc9 100644 --- a/arch/x86/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h @@ -29,7 +29,6 @@ /* Architecture-specific global data */ struct arch_global_data { struct global_data *gd_addr; /* Location of Global Data */ - void *new_fdt; /* Relocated FDT */ };
#endif diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c index 2441a66..555301a 100644 --- a/arch/x86/lib/board.c +++ b/arch/x86/lib/board.c @@ -219,7 +219,7 @@ static void do_init_loop(init_fnc_t **init_fnc_ptr)
void board_init_f(ulong boot_flags) { - gd->fdt_blob = gd->arch.new_fdt = NULL; + gd->fdt_blob = gd->new_fdt = NULL; gd->flags = boot_flags;
do_init_loop(init_sequence_f); diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c index 414fdcc..7df9536 100644 --- a/arch/x86/lib/init_helpers.c +++ b/arch/x86/lib/init_helpers.c @@ -111,7 +111,7 @@ int calculate_relocation_address(void) */ if (gd->fdt_blob) { dest_addr -= fdt_size; - gd->arch.new_fdt = (void *)dest_addr; + gd->new_fdt = (void *)dest_addr; dest_addr &= ~15; } #endif diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c index 3e370f2..e893c2b 100644 --- a/arch/x86/lib/relocate.c +++ b/arch/x86/lib/relocate.c @@ -49,15 +49,15 @@ int copy_uboot_to_ram(void)
int copy_fdt_to_ram(void) { - if (gd->arch.new_fdt) { + if (gd->new_fdt) { ulong fdt_size;
fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32);
- memcpy(gd->arch.new_fdt, gd->fdt_blob, fdt_size); + memcpy(gd->new_fdt, gd->fdt_blob, fdt_size); debug("Relocated fdt from %p to %p, size %lx\n", - gd->fdt_blob, gd->arch.new_fdt, fdt_size); - gd->fdt_blob = gd->arch.new_fdt; + gd->fdt_blob, gd->new_fdt, fdt_size); + gd->fdt_blob = gd->new_fdt; }
return 0; diff --git a/common/Makefile b/common/Makefile index 54fcc81..17ae3ff 100644 --- a/common/Makefile +++ b/common/Makefile @@ -36,6 +36,9 @@ COBJS-y += s_record.o COBJS-y += xyzModem.o COBJS-y += cmd_disk.o
+# boards +COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_f.o + # core command COBJS-y += cmd_boot.o COBJS-$(CONFIG_CMD_BOOTM) += cmd_bootm.o diff --git a/common/board_f.c b/common/board_f.c new file mode 100644 index 0000000..aa10f4b --- /dev/null +++ b/common/board_f.c @@ -0,0 +1,564 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * (C) Copyright 2002-2006 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * (C) Copyright 2002 + * Sysgo Real-Time Solutions, GmbH <www.elinos.com> + * Marius Groeger mgroeger@sysgo.de + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> +#include <linux/compiler.h> +#include <version.h> +#include <environment.h> +#include <fdtdec.h> +#include <initcall.h> +#include <logbuff.h> +#include <post.h> +#include <asm/io.h> +#include <asm/sections.h> +#include <linux/compiler.h> + +/* + * Pointer to initial global data area + * + * Here we initialize it if needed. + */ +#ifdef XTRN_DECLARE_GLOBAL_DATA_PTR +#undef XTRN_DECLARE_GLOBAL_DATA_PTR +#define XTRN_DECLARE_GLOBAL_DATA_PTR /* empty = allocate here */ +DECLARE_GLOBAL_DATA_PTR = (gd_t *) (CONFIG_SYS_INIT_GD_ADDR); +#else +DECLARE_GLOBAL_DATA_PTR; +#endif + +/* + * sjg: IMO this code should be + * refactored to a single function, something like: + * + * void led_set_state(enum led_colour_t colour, int on); + */ +/************************************************************************ + * Coloured LED functionality + ************************************************************************ + * May be supplied by boards if desired + */ +inline void __coloured_LED_init(void) {} +void coloured_LED_init(void) + __attribute__((weak, alias("__coloured_LED_init"))); +inline void __red_led_on(void) {} +void red_led_on(void) __attribute__((weak, alias("__red_led_on"))); +inline void __red_led_off(void) {} +void red_led_off(void) __attribute__((weak, alias("__red_led_off"))); +inline void __green_led_on(void) {} +void green_led_on(void) __attribute__((weak, alias("__green_led_on"))); +inline void __green_led_off(void) {} +void green_led_off(void) __attribute__((weak, alias("__green_led_off"))); +inline void __yellow_led_on(void) {} +void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on"))); +inline void __yellow_led_off(void) {} +void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off"))); +inline void __blue_led_on(void) {} +void blue_led_on(void) __attribute__((weak, alias("__blue_led_on"))); +inline void __blue_led_off(void) {} +void blue_led_off(void) __attribute__((weak, alias("__blue_led_off"))); + +/* + * Why is gd allocated a register? Prior to reloc it might be better to + * just pass it around to each function in this file? + * + * After reloc one could argue that it is hardly used and doesn't need + * to be in a register. Or if it is it should perhaps hold pointers to all + * global data for all modules, so that post-reloc we can avoid the massive + * literal pool we get on ARM. Or perhaps just encourage each module to use + * a structure... + */ + +/* + * Could the CONFIG_SPL_BUILD infection become a flag in gd? + */ + +static int init_baud_rate(void) +{ + gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE); + return 0; +} + +static int display_text_info(void) +{ + ulong bss_start, bss_end; + + bss_start = _bss_start_ofs + _TEXT_BASE; + bss_end = _bss_end_ofs + _TEXT_BASE; + debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n", + CONFIG_SYS_TEXT_BASE, bss_start, bss_end); + +#ifdef CONFIG_MODEM_SUPPORT + debug("Modem Support enabled\n"); +#endif +#ifdef CONFIG_USE_IRQ + debug("IRQ Stack: %08lx\n", IRQ_STACK_START); + debug("FIQ Stack: %08lx\n", FIQ_STACK_START); +#endif + + return 0; +} + +static int announce_dram_init(void) +{ + puts("DRAM: "); + return 0; +} + +static int show_dram_config(void) +{ + ulong size; + +#ifdef CONFIG_NR_DRAM_BANKS + int i; + + debug("\nRAM Configuration:\n"); + for (i = size = 0; i < CONFIG_NR_DRAM_BANKS; i++) { + size += gd->bd->bi_dram[i].size; + debug("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start); +#ifdef DEBUG + print_size(gd->bd->bi_dram[i].size, "\n"); +#endif + } + debug("\nDRAM: "); +#else + size = gd->ram_size; +#endif + + print_size(size, "\n"); + + return 0; +} + +void __dram_init_banksize(void) +{ +#if defined(CONFIG_NR_DRAM_BANKS) && defined(CONFIG_SYS_SDRAM_BASE) + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; + gd->bd->bi_dram[0].size = get_effective_memsize(); +#endif +} + +void dram_init_banksize(void) + __attribute__((weak, alias("__dram_init_banksize"))); + +static int zero_global_data(void) +{ + memset((void *)gd, '\0', sizeof(gd_t)); + + return 0; +} + +static int setup_mon_len(void) +{ + gd->mon_len = _bss_end_ofs; + return 0; +} + +__weak int arch_cpu_init(void) +{ + return 0; +} + +static int setup_fdt(void) +{ +#ifdef CONFIG_OF_EMBED + /* Get a pointer to the FDT */ + gd->fdt_blob = _binary_dt_dtb_start; +#elif defined CONFIG_OF_SEPARATE + /* FDT is at end of image */ + gd->fdt_blob = (void *)(_end_ofs + CONFIG_SYS_TEXT_BASE); +#endif + /* Allow the early environment to override the fdt address */ + gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16, + (uintptr_t)gd->fdt_blob); + return 0; +} + +/* Get the top of usable RAM */ +__weak ulong board_get_usable_ram_top(ulong total_size) +{ + return gd->ram_top; +} + +static int setup_dest_addr(void) +{ + debug("Monitor len: %08lX\n", gd->mon_len); + /* + * Ram is setup, size stored in gd !! + */ + debug("Ram size: %08lX\n", (ulong)gd->ram_size); +#if defined(CONFIG_SYS_MEM_TOP_HIDE) + /* + * Subtract specified amount of memory to hide so that it won't + * get "touched" at all by U-Boot. By fixing up gd->ram_size + * the Linux kernel should now get passed the now "corrected" + * memory size and won't touch it either. This should work + * for arch/ppc and arch/powerpc. Only Linux board ports in + * arch/powerpc with bootwrapper support, that recalculate the + * memory size from the SDRAM controller setup will have to + * get fixed. + */ + gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE; +#endif + gd->ram_top = gd->bd->bi_dram[0].start + gd->bd->bi_dram[0].size; + gd->ram_top = board_get_usable_ram_top(gd->mon_len); + gd->dest_addr = gd->ram_top; + gd->dest_addr_sp = gd->dest_addr; + return 0; +} + +#if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) +static int reserve_logbuffer(void) +{ + /* reserve kernel log buffer */ + gd->dest_addr -= LOGBUFF_RESERVE; + debug("Reserving %dk for kernel logbuffer at %08lx\n", LOGBUFF_LEN, + gd->dest_addr); + return 0; +} +#endif + +#ifdef CONFIG_PRAM +/* reserve protected RAM */ +static int reserve_pram(void) +{ + ulong reg; + + reg = getenv_ulong("pram", 10, CONFIG_PRAM); + gd->dest_addr -= (reg << 10); /* size is in kB */ + debug("Reserving %ldk for protected RAM at %08lx\n", reg, + gd->dest_addr); + return 0; +} +#endif /* CONFIG_PRAM */ + +/* Round memory pointer down to next 4 kB limit */ +static int reserve_round_4k(void) +{ + gd->dest_addr &= ~(4096 - 1); + return 0; +} + +#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) && \ + defined(CONFIG_ARM) +static int reserve_mmu(void) +{ + /* reserve TLB table */ + gd->arch.tlb_size = 4096 * 4; + gd->dest_addr -= gd->arch.tlb_size; + + /* round down to next 64 kB limit */ + gd->dest_addr &= ~(0x10000 - 1); + + gd->arch.tlb_addr = gd->dest_addr; + debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr, + gd->arch.tlb_addr + gd->arch.tlb_size); + return 0; +} +#endif + +#ifdef CONFIG_LCD +static int reserve_lcd(void) +{ +#ifdef CONFIG_FB_ADDR + gd->fb_base = CONFIG_FB_ADDR; +#else + /* reserve memory for LCD display (always full pages) */ + gd->dest_addr = lcd_setmem(gd->dest_addr); + gd->fb_base = gd->dest_addr; +#endif /* CONFIG_FB_ADDR */ + return 0; +} +#endif /* CONFIG_LCD */ + +static int reserve_uboot(void) +{ + /* + * reserve memory for U-Boot code, data & bss + * round down to next 4 kB limit + */ + gd->dest_addr -= gd->mon_len; + gd->dest_addr &= ~(4096 - 1); + + debug("Reserving %ldk for U-Boot at: %08lx\n", gd->mon_len >> 10, + gd->dest_addr); + return 0; +} + +/* reserve memory for malloc() area */ +static int reserve_malloc(void) +{ + gd->dest_addr_sp = gd->dest_addr - TOTAL_MALLOC_LEN; + debug("Reserving %dk for malloc() at: %08lx\n", + TOTAL_MALLOC_LEN >> 10, gd->dest_addr_sp); + return 0; +} + +/* (permanently) allocate a Board Info struct */ +static int reserve_board(void) +{ + gd->dest_addr_sp -= sizeof(bd_t); + gd->bd = (bd_t *)gd->dest_addr_sp; + memset(gd->bd, '\0', sizeof(bd_t)); + debug("Reserving %zu Bytes for Board Info at: %08lx\n", + sizeof(bd_t), gd->dest_addr_sp); + return 0; +} + +static int setup_machine(void) +{ +#ifdef CONFIG_MACH_TYPE + gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */ +#endif + return 0; +} + +static int reserve_global_data(void) +{ + gd->dest_addr_sp -= sizeof(gd_t); + gd->new_gd = (gd_t *)gd->dest_addr_sp; + debug("Reserving %zu Bytes for Global Data at: %08lx\n", + sizeof(gd_t), gd->dest_addr_sp); + return 0; +} + +static int reserve_fdt(void) +{ + /* + * If the device tree is sitting immediate above our image then we + * must relocate it. If it is embedded in the data section, then it + * will be relocated with other data. + */ + if (gd->fdt_blob) { + gd->fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32); + + gd->dest_addr_sp -= gd->fdt_size; + gd->new_fdt = (void *)gd->dest_addr_sp; + debug("Reserving %lu Bytes for FDT at: %p\n", + gd->fdt_size, gd->new_fdt); + } + + return 0; +} + +static int reserve_stacks(void) +{ + /* setup stack pointer for exceptions */ + gd->dest_addr_sp -= 16; + gd->dest_addr_sp &= ~0xf; + gd->irq_sp = gd->dest_addr_sp; +#ifdef CONFIG_USE_IRQ + gd->dest_addr_sp -= (CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ); + debug("Reserving %zu Bytes for IRQ stack at: %08lx\n", + CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ, gd->dest_addr_sp); + + /* 8-byte alignment for ARM ABI compliance */ + gd->dest_addr_sp &= ~0x07; +#endif + /* leave 3 words for abort-stack, plus 1 for alignment */ + gd->dest_addr_sp -= 16; + + return 0; +} + +static int display_new_sp(void) +{ + debug("New Stack Pointer is: %08lx\n", gd->dest_addr_sp); + + return 0; +} + +#ifdef CONFIG_POST +static int init_post(void) +{ + post_bootmode_init(); + post_run(NULL, POST_ROM | post_bootmode_get(0)); + + return 0; +} +#endif + +static int setup_baud_rate(void) +{ + /* Ick, can we get rid of this line? */ + gd->bd->bi_baudrate = gd->baudrate; + + return 0; +} + +static int setup_dram_config(void) +{ + /* Ram is board specific, so move it to board code ... */ + dram_init_banksize(); + + return 0; +} + +static int reloc_fdt(void) +{ + if (gd->new_fdt) { + memcpy(gd->new_fdt, gd->fdt_blob, gd->fdt_size); + gd->fdt_blob = gd->new_fdt; + } + + return 0; +} + +static int setup_reloc(void) +{ + gd->relocaddr = gd->dest_addr; + gd->start_addr_sp = gd->dest_addr_sp; + gd->reloc_off = gd->dest_addr - CONFIG_SYS_TEXT_BASE; + memcpy(gd->new_gd, (char *)gd, sizeof(gd_t)); + + debug("Relocation Offset is: %08lx\n", gd->reloc_off); + debug("Relocating to %08lx, new gd at %p, sp at %08lx\n", + gd->dest_addr, gd->new_gd, gd->dest_addr_sp); + + return 0; +} + +/* ARM calls relocate_code from its crt0.S */ +#if !defined(CONFIG_ARM) + +static int jump_to_copy(void) +{ + relocate_code(gd->dest_addr_sp, gd->new_gd, gd->dest_addr); + + return 0; +} +#endif + +/* Record the board_init_f() bootstage (after arch_cpu_init()) */ +static int mark_bootstage(void) +{ + bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_F, "board_init_f"); + + return 0; +} + +static init_fnc_t init_sequence_f[] = { + setup_fdt, + setup_mon_len, + arch_cpu_init, /* basic arch cpu dependent setup */ + mark_bootstage, +#ifdef CONFIG_OF_CONTROL + fdtdec_check_fdt, +#endif +#if defined(CONFIG_BOARD_EARLY_INIT_F) + board_early_init_f, +#endif + timer_init, /* initialize timer */ +#ifdef CONFIG_BOARD_POSTCLK_INIT + board_postclk_init, +#endif +#ifdef CONFIG_FSL_ESDHC + get_clocks, +#endif + env_init, /* initialize environment */ + init_baud_rate, /* initialze baudrate settings */ + serial_init, /* serial communications setup */ + console_init_f, /* stage 1 init of console */ + display_options, /* say that we are here */ + display_text_info, /* show debugging info if required */ +#if defined(CONFIG_DISPLAY_CPUINFO) + print_cpuinfo, /* display cpu info (and speed) */ +#endif +#if defined(CONFIG_DISPLAY_BOARDINFO) + checkboard, /* display board info */ +#endif + announce_dram_init, + show_dram_config, +#ifdef CONFIG_POST + init_post, +#endif + /* + * Now that we have DRAM mapped and working, we can + * relocate the code and continue running from DRAM. + * + * Reserve memory at end of RAM for (top down in that order): + * - area that won't get touched by U-Boot and Linux (optional) + * - kernel log buffer + * - protected RAM + * - LCD framebuffer + * - monitor code + * - board info struct + */ + setup_dest_addr, +#if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) + reserve_logbuffer, +#endif +#ifdef CONFIG_PRAM + reserve_pram, +#endif + reserve_round_4k, +#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) && \ + defined(CONFIG_ARM) + reserve_mmu, +#endif +#ifdef CONFIG_LCD + reserve_lcd, +#endif + reserve_uboot, + reserve_malloc, + reserve_board, + setup_machine, + reserve_global_data, + reserve_fdt, + reserve_stacks, + setup_baud_rate, + display_new_sp, + reloc_fdt, + setup_reloc, +#ifndef CONFIG_ARM + jump_to_copy, +#endif + NULL, +}; + +void board_init_f(ulong boot_flags) +{ + gd_t data; + + gd = &data; + + gd->flags = boot_flags; + + if (initcall_run_list(init_sequence_f)) + hang(); + +#ifndef CONFIG_ARM + /* NOTREACHED - jump_to_copy() does not return */ + hang(); +#endif +} + +void hang(void) +{ + puts("### ERROR ### Please RESET the board ###\n"); + for (;;); +} diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index b8ac024..ebfe2a3 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -81,6 +81,8 @@ typedef struct global_data { unsigned long reloc_off; struct global_data *new_gd; /* relocated global data */ const void *fdt_blob; /* Our device tree, NULL if none */ + void *new_fdt; /* Relocated FDT */ + unsigned long fdt_size; /* Space reserved for relocated FDT */ void **jt; /* jump table */ char env_buf[32]; /* buffer for getenv() before reloc. */ struct arch_global_data arch; /* architecture-specific data */ diff --git a/include/common.h b/include/common.h index 4ad17ea..64e340a 100644 --- a/include/common.h +++ b/include/common.h @@ -310,6 +310,7 @@ extern ulong monitor_flash_len; int mac_read_from_eeprom(void); extern u8 _binary_dt_dtb_start[]; /* embedded device tree blob */ int set_cpu_clk_info(void); +int print_cpuinfo(void);
/** * Show the DRAM size in a board-specific way

This file handles common post-relocation init for boards which use the generic framework.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Add code from arch/arm/lib/board.c to control loading of environment - Put watchdog init function definitions in watchdog.h - Adjust ppc to work with watchdog.h additions
Changes in v4: - Use asm/sections.h instead of asm-generic/sections.h
Changes in v3: None Changes in v2: None
arch/powerpc/lib/board.c | 3 +- common/Makefile | 1 + common/board_r.c | 424 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 427 insertions(+), 1 deletion(-) create mode 100644 common/board_r.c
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c index acb6fdb..422b4a3 100644 --- a/arch/powerpc/lib/board.c +++ b/arch/powerpc/lib/board.c @@ -319,7 +319,8 @@ static init_fnc_t *init_sequence[] = { #ifdef CONFIG_POST post_init_f, #endif - INIT_FUNC_WATCHDOG_RESET init_func_ram, + INIT_FUNC_WATCHDOG_RESET + init_func_ram, #if defined(CONFIG_SYS_DRAM_TEST) testdram, #endif /* CONFIG_SYS_DRAM_TEST */ diff --git a/common/Makefile b/common/Makefile index 17ae3ff..275ad90 100644 --- a/common/Makefile +++ b/common/Makefile @@ -38,6 +38,7 @@ COBJS-y += cmd_disk.o
# boards COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_f.o +COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_r.o
# core command COBJS-y += cmd_boot.o diff --git a/common/board_r.c b/common/board_r.c new file mode 100644 index 0000000..2511471 --- /dev/null +++ b/common/board_r.c @@ -0,0 +1,424 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * (C) Copyright 2002-2006 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * (C) Copyright 2002 + * Sysgo Real-Time Solutions, GmbH <www.elinos.com> + * Marius Groeger mgroeger@sysgo.de + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> +#ifdef CONFIG_HAS_DATAFLASH +#include <dataflash.h> +#endif +#include <environment.h> +#include <fdtdec.h> +#include <initcall.h> +#include <logbuff.h> +#include <malloc.h> +#include <mmc.h> +#include <nand.h> +#include <onenand_uboot.h> +#include <serial.h> +#include <stdio_dev.h> +#include <asm/sections.h> + +DECLARE_GLOBAL_DATA_PTR; + +ulong monitor_flash_len; + + +static int initr_reloc(void) +{ + gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */ + bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r"); + + return 0; +} + +#ifdef CONFIG_ARM +/* + * Some of these functions are needed purely because the functions they + * call return void. If we change them to return 0, these stubs can go away. + */ +static int initr_caches(void) +{ + /* Enable caches */ + enable_caches(); + return 0; +} +#endif + +static int initr_reloc_global_data(void) +{ +#ifdef CONFIG_SYS_SYM_OFFSETS + monitor_flash_len = _end_ofs; +#else + monitor_flash_len = (ulong)&__init_end - gd->dest_addr; +#endif +} + +static int initr_serial(void) +{ + serial_initialize(); + return 0; +} + +#ifdef CONFIG_LOGBUFFER +unsigned long logbuffer_base(void) +{ + return gd->ram_top - LOGBUFF_LEN; +} + +static int initr_logbuffer(void) +{ + logbuff_init_ptrs(); + return 0; +} +#endif + +#ifdef CONFIG_POST +static int initr_post_backlog(void) +{ + post_output_backlog(); + return 0; +} +#endif + +static int initr_malloc(void) +{ + ulong malloc_start; + + /* The malloc area is immediately below the monitor copy in DRAM */ + malloc_start = gd->dest_addr - TOTAL_MALLOC_LEN; + mem_malloc_init(malloc_start, TOTAL_MALLOC_LEN); + return 0; +} + +__weak int power_init_board(void) +{ + return 0; +} + +static int initr_announce(void) +{ + debug("Now running in RAM - U-Boot at: %08lx\n", gd->dest_addr); + return 0; +} + +#if !defined(CONFIG_SYS_NO_FLASH) +static int initr_flash(void) +{ + ulong flash_size; + + puts("Flash: "); + + flash_size = flash_init(); + if (flash_size <= 0) { + puts("*** failed ***\n"); + return -1; + } + print_size(flash_size, ""); +#ifdef CONFIG_SYS_FLASH_CHECKSUM + /* + * Compute and print flash CRC if flashchecksum is set to 'y' + * + * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX + */ + if (getenv_yesno("flashchecksum") == 1) { + printf(" CRC: %08X", crc32(0, + (const unsigned char *) CONFIG_SYS_FLASH_BASE, + flash_size)); + } + putc('\n'); +#else /* !CONFIG_SYS_FLASH_CHECKSUM */ + print_size(flash_size, "\n"); +#endif /* CONFIG_SYS_FLASH_CHECKSUM */ + + return 0; +} +#endif + +#ifdef CONFIG_CMD_NAND +/* go init the NAND */ +int initr_nand(void) +{ + puts("NAND: "); + nand_init(); + return 0; +} +#endif + +#if defined(CONFIG_CMD_ONENAND) +/* go init the NAND */ +int initr_onenand(void) +{ + puts("NAND: "); + onenand_init(); + return 0; +} +#endif + +#ifdef CONFIG_GENERIC_MMC +int initr_mmc(void) +{ + puts("MMC: "); + mmc_initialize(gd->bd); + return 0; +} +#endif + +#ifdef CONFIG_HAS_DATAFLASH +int initr_dataflash(void) +{ + AT91F_DataflashInit(); + dataflash_print_info(); + return 0; +} +#endif + +/* + * Tell if it's OK to load the environment early in boot. + * + * If CONFIG_OF_CONFIG is defined, we'll check with the FDT to see + * if this is OK (defaulting to saying it's OK). + * + * NOTE: Loading the environment early can be a bad idea if security is + * important, since no verification is done on the environment. + * + * @return 0 if environment should not be loaded, !=0 if it is ok to load + */ +static int should_load_env(void) +{ +#ifdef CONFIG_OF_CONTROL + return fdtdec_get_config_int(gd->fdt_blob, "load-environment", 1); +#elif defined CONFIG_DELAY_ENVIRONMENT + return 0; +#else + return 1; +#endif +} + +static int initr_env(void) +{ + /* initialize environment */ + if (should_load_env()) + env_relocate(); + else + set_default_env(NULL); + + /* Initialize from environment */ + load_addr = getenv_ulong("loadaddr", 16, load_addr); + return 0; +} + +static int initr_jumptable(void) +{ + jumptable_init(); + return 0; +} + +#if defined(CONFIG_API) +static int initr_api(void) +{ + /* Initialize API */ + api_init(); + return 0; +} +#endif + +#ifdef CONFIG_DISPLAY_BOARDINFO_LATE +static int show_model_r(void) +{ + /* Put this here so it appears on the LCD, now it is ready */ +# ifdef CONFIG_OF_CONTROL + const char *model; + + model = (char *)fdt_getprop(gd->fdt_blob, 0, "model", NULL); + printf("Model: %s\n", model ? model : "<unknown>"); +# else + checkboard(); +# endif +} +#endif + +/* enable exceptions */ +static int initr_enable_interrupts(void) +{ + enable_interrupts(); + return 0; +} + +#ifdef CONFIG_CMD_NET +static int initr_ethaddr(void) +{ + + return 0; +} +#endif /* CONFIG_CMD_NET */ + +#ifdef CONFIG_BITBANGMII +static int initr_bbmii(void) +{ + bb_miiphy_init(); + return 0; +} +#endif + +#ifdef CONFIG_CMD_NET +static int initr_net(void) +{ + puts("Net: "); + eth_initialize(gd->bd); +#if defined(CONFIG_RESET_PHY_R) + debug("Reset Ethernet PHY\n"); + reset_phy(); +#endif + return 0; +} +#endif + +#ifdef CONFIG_POST +static int initr_post(void) +{ + post_run(NULL, POST_RAM | post_bootmode_get(0)); + return 0; +} +#endif + +#if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER) +/* + * Export available size of memory for Linux, taking into account the + * protected RAM at top of memory + */ +int initr_mem(void) +{ + ulong pram = 0; + char memsz[32]; + +# ifdef CONFIG_PRAM + pram = getenv_ulong("pram", 10, CONFIG_PRAM); +# endif +# if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) + /* Also take the logbuffer into account (pram is in kB) */ + pram += (LOGBUFF_LEN + LOGBUFF_OVERHEAD) / 1024; +# endif + sprintf(memsz, "%ldk", (gd->ram_size / 1024) - pram); + setenv("mem", memsz); +} +#endif + +static int run_main_loop(void) +{ + /* main_loop() can return to retry autoboot, if so just run it again */ + for (;;) + main_loop(); + return 0; +} + +/* + * Over time we hope to remove these functions with code fragments and + * stub funtcions, and instead call the relevant function directly. + * + * We also hope to remove most of the driver-related init and do it if/when + * the driver is later used. + */ +init_fnc_t init_sequence_r[] = { + initr_reloc, +#ifdef CONFIG_ARM + initr_caches, + board_init, /* Setup chipselects */ +#endif + initr_reloc_global_data, + initr_serial, + initr_announce, +#ifdef CONFIG_LOGBUFFER + initr_logbuffer, +#endif +#ifdef CONFIG_POST + initr_post_backlog, +#endif + initr_malloc, +#ifdef CONFIG_ARCH_EARLY_INIT_R + arch_early_init_r, +#endif + power_init_board, +#ifndef CONFIG_SYS_NO_FLASH + initr_flash, +#endif +#ifdef CONFIG_CMD_NAND + initr_nand, +#endif +#ifdef CONFIG_CMD_ONENAND + initr_onenand, +#endif +#ifdef CONFIG_GENERIC_MMC + initr_mmc, +#endif +#ifdef CONFIG_HAS_DATAFLASH + initr_dataflash, +#endif + initr_env, + stdio_init, + initr_jumptable, +#ifdef CONFIG_API + initr_api, +#endif + console_init_r, /* fully init console as a device */ +#ifdef CONFIG_DISPLAY_BOARDINFO_LATE + show_model_r, +#endif +#ifdef CONFIG_ARCH_MISC_INIT + arch_misc_init, /* miscellaneous arch-dependent init */ +#endif +#ifdef CONFIG_MISC_INIT_R + misc_init_r, /* miscellaneous platform-dependent init */ +#endif + interrupt_init, + initr_enable_interrupts, +#ifdef CONFIG_CMD_NET + initr_ethaddr, +#endif +#ifdef CONFIG_BOARD_LATE_INIT + board_late_init, +#endif +#ifdef CONFIG_BITBANGMII + initr_bbmii, +#endif +#ifdef CONFIG_CMD_NET + initr_net, +#endif +#ifdef CONFIG_POST + initr_post, +#endif + run_main_loop, +}; + +void board_init_r(gd_t *new_gd, ulong dest_addr) +{ + gd = new_gd; + if (initcall_run_list(init_sequence_r)) + hang(); + + /* NOTREACHED - run_main_loop() does not return */ + hang(); +}

This adds secondary program loader support to the generic board.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
common/board_f.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/common/board_f.c b/common/board_f.c index aa10f4b..3a8036f 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -309,6 +309,7 @@ static int reserve_uboot(void) return 0; }
+#ifndef CONFIG_SPL_BUILD /* reserve memory for malloc() area */ static int reserve_malloc(void) { @@ -328,6 +329,7 @@ static int reserve_board(void) sizeof(bd_t), gd->dest_addr_sp); return 0; } +#endif
static int setup_machine(void) { @@ -365,6 +367,7 @@ static int reserve_fdt(void) return 0; }
+#ifndef CONFIG_SPL_BUILD static int reserve_stacks(void) { /* setup stack pointer for exceptions */ @@ -384,6 +387,17 @@ static int reserve_stacks(void)
return 0; } +#endif + +#ifdef CONFIG_SPL_BUILD +static int reserve_stacks_spl(void) +{ + /* Why not -= ? */ + gd->dest_addr_sp += 128; /* leave 32 words for abort-stack */ + gd->irq_sp = gd->dest_addr_sp; + return 0; +} +#endif
static int display_new_sp(void) { @@ -524,12 +538,18 @@ static init_fnc_t init_sequence_f[] = { reserve_lcd, #endif reserve_uboot, +#ifndef CONFIG_SPL_BUILD reserve_malloc, reserve_board, +#endif setup_machine, reserve_global_data, reserve_fdt, +#ifdef CONFIG_SPL_BUILD + reserve_stacks_spl, +#else reserve_stacks, +#endif setup_baud_rate, display_new_sp, reloc_fdt,

On 02/08/2013 09:12:08 AM, Simon Glass wrote:
This adds secondary program loader support to the generic board.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
common/board_f.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/common/board_f.c b/common/board_f.c index aa10f4b..3a8036f 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -309,6 +309,7 @@ static int reserve_uboot(void) return 0; }
+#ifndef CONFIG_SPL_BUILD /* reserve memory for malloc() area */ static int reserve_malloc(void) { @@ -328,6 +329,7 @@ static int reserve_board(void) sizeof(bd_t), gd->dest_addr_sp); return 0; } +#endif
static int setup_machine(void) { @@ -365,6 +367,7 @@ static int reserve_fdt(void) return 0; }
+#ifndef CONFIG_SPL_BUILD static int reserve_stacks(void) { /* setup stack pointer for exceptions */ @@ -384,6 +387,17 @@ static int reserve_stacks(void)
return 0; } +#endif
+#ifdef CONFIG_SPL_BUILD +static int reserve_stacks_spl(void) +{
- /* Why not -= ? */
- gd->dest_addr_sp += 128; /* leave 32 words for
abort-stack */
- gd->irq_sp = gd->dest_addr_sp;
- return 0;
+} +#endif
"abort-stack" doesn't sound very generic, and that "why not" question should probably be answered.
static int display_new_sp(void) { @@ -524,12 +538,18 @@ static init_fnc_t init_sequence_f[] = { reserve_lcd, #endif reserve_uboot, +#ifndef CONFIG_SPL_BUILD reserve_malloc, reserve_board, +#endif setup_machine, reserve_global_data, reserve_fdt, +#ifdef CONFIG_SPL_BUILD
- reserve_stacks_spl,
+#else reserve_stacks, +#endif
Why not just put the ifdef inside reserve_stacks()? Or at least give them the same name?
-Scott

+Albert
Hi Scott,
On Tue, Feb 12, 2013 at 12:29 PM, Scott Wood scottwood@freescale.com wrote:
On 02/08/2013 09:12:08 AM, Simon Glass wrote:
This adds secondary program loader support to the generic board.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
common/board_f.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/common/board_f.c b/common/board_f.c index aa10f4b..3a8036f 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -309,6 +309,7 @@ static int reserve_uboot(void) return 0; }
+#ifndef CONFIG_SPL_BUILD /* reserve memory for malloc() area */ static int reserve_malloc(void) { @@ -328,6 +329,7 @@ static int reserve_board(void) sizeof(bd_t), gd->dest_addr_sp); return 0; } +#endif
static int setup_machine(void) { @@ -365,6 +367,7 @@ static int reserve_fdt(void) return 0; }
+#ifndef CONFIG_SPL_BUILD static int reserve_stacks(void) { /* setup stack pointer for exceptions */ @@ -384,6 +387,17 @@ static int reserve_stacks(void)
return 0;
} +#endif
+#ifdef CONFIG_SPL_BUILD +static int reserve_stacks_spl(void) +{
/* Why not -= ? */
gd->dest_addr_sp += 128; /* leave 32 words for abort-stack
*/
gd->irq_sp = gd->dest_addr_sp;
return 0;
+} +#endif
"abort-stack" doesn't sound very generic, and that "why not" question should probably be answered.
I'm not sure what you mean by the first comment. For the second, I agree. It looks wrong to me. I copied Albert who might know.
static int display_new_sp(void) { @@ -524,12 +538,18 @@ static init_fnc_t init_sequence_f[] = { reserve_lcd, #endif reserve_uboot, +#ifndef CONFIG_SPL_BUILD reserve_malloc, reserve_board, +#endif setup_machine, reserve_global_data, reserve_fdt, +#ifdef CONFIG_SPL_BUILD
reserve_stacks_spl,
+#else reserve_stacks, +#endif
Why not just put the ifdef inside reserve_stacks()? Or at least give them the same name?
OK I will do that.
-Scott
Regards, Simon

On 02/12/2013 04:23:21 PM, Simon Glass wrote:
+Albert
Hi Scott,
On Tue, Feb 12, 2013 at 12:29 PM, Scott Wood scottwood@freescale.com wrote:
On 02/08/2013 09:12:08 AM, Simon Glass wrote:
This adds secondary program loader support to the generic board.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
common/board_f.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/common/board_f.c b/common/board_f.c index aa10f4b..3a8036f 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -309,6 +309,7 @@ static int reserve_uboot(void) return 0; }
+#ifndef CONFIG_SPL_BUILD /* reserve memory for malloc() area */ static int reserve_malloc(void) { @@ -328,6 +329,7 @@ static int reserve_board(void) sizeof(bd_t), gd->dest_addr_sp); return 0; } +#endif
static int setup_machine(void) { @@ -365,6 +367,7 @@ static int reserve_fdt(void) return 0; }
+#ifndef CONFIG_SPL_BUILD static int reserve_stacks(void) { /* setup stack pointer for exceptions */ @@ -384,6 +387,17 @@ static int reserve_stacks(void)
return 0;
} +#endif
+#ifdef CONFIG_SPL_BUILD +static int reserve_stacks_spl(void) +{
/* Why not -= ? */
gd->dest_addr_sp += 128; /* leave 32 words for
abort-stack
*/
gd->irq_sp = gd->dest_addr_sp;
return 0;
+} +#endif
"abort-stack" doesn't sound very generic, and that "why not"
question should
probably be answered.
I'm not sure what you mean by the first comment.
It's ARM-specific terminology ("exception" is more typical than "abort" elsewhere). Why 32 words, BTW? Why is it larger in SPL versus non-SPL?
-Scott

Hi Scott,
On Tue, Feb 12, 2013 at 2:34 PM, Scott Wood scottwood@freescale.com wrote:
On 02/12/2013 04:23:21 PM, Simon Glass wrote:
+Albert
Hi Scott,
On Tue, Feb 12, 2013 at 12:29 PM, Scott Wood scottwood@freescale.com wrote:
On 02/08/2013 09:12:08 AM, Simon Glass wrote:
This adds secondary program loader support to the generic board.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
common/board_f.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/common/board_f.c b/common/board_f.c index aa10f4b..3a8036f 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -309,6 +309,7 @@ static int reserve_uboot(void) return 0; }
+#ifndef CONFIG_SPL_BUILD /* reserve memory for malloc() area */ static int reserve_malloc(void) { @@ -328,6 +329,7 @@ static int reserve_board(void) sizeof(bd_t), gd->dest_addr_sp); return 0; } +#endif
static int setup_machine(void) { @@ -365,6 +367,7 @@ static int reserve_fdt(void) return 0; }
+#ifndef CONFIG_SPL_BUILD static int reserve_stacks(void) { /* setup stack pointer for exceptions */ @@ -384,6 +387,17 @@ static int reserve_stacks(void)
return 0;
} +#endif
+#ifdef CONFIG_SPL_BUILD +static int reserve_stacks_spl(void) +{
/* Why not -= ? */
gd->dest_addr_sp += 128; /* leave 32 words for
abort-stack */
gd->irq_sp = gd->dest_addr_sp;
return 0;
+} +#endif
"abort-stack" doesn't sound very generic, and that "why not" question should probably be answered.
I'm not sure what you mean by the first comment.
It's ARM-specific terminology ("exception" is more typical than "abort" elsewhere). Why 32 words, BTW? Why is it larger in SPL versus non-SPL?
These are good questions but I don't know the answers. I guess the abort stack may need enough space to panic()?
I am copying code from the various arch/xxx/board.c files in order to merge them.
Regards, Simon
-Scott

These boards define CONFIG_LAST_STAGE_INIT and CONFIG_BOARD_EARLY_INIT_R but these options are not available on ARM. Move them into the powerpc common file instead.
This change affects: km_kirkwood_pci, mgcoge3un, kmnusa, kmcoge5un, km_kirkwood and portl2.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Add new patch to fix config in keymile boards
Changes in v4: None Changes in v3: None Changes in v2: None
include/configs/km/keymile-common.h | 4 ---- include/configs/km/km-powerpc.h | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h index f64748e..a142c52 100644 --- a/include/configs/km/keymile-common.h +++ b/include/configs/km/keymile-common.h @@ -24,10 +24,6 @@ #ifndef __CONFIG_KEYMILE_H #define __CONFIG_KEYMILE_H
-/* Do boardspecific init for all boards */ -#define CONFIG_BOARD_EARLY_INIT_R -#define CONFIG_LAST_STAGE_INIT - #define CONFIG_BOOTCOUNT_LIMIT
/* diff --git a/include/configs/km/km-powerpc.h b/include/configs/km/km-powerpc.h index bd5bdbc..b84f12d 100644 --- a/include/configs/km/km-powerpc.h +++ b/include/configs/km/km-powerpc.h @@ -24,6 +24,10 @@ #ifndef __CONFIG_KEYMILE_POWERPC_H #define __CONFIG_KEYMILE_POWERPC_H
+/* Do boardspecific init for all boards */ +#define CONFIG_BOARD_EARLY_INIT_R +#define CONFIG_LAST_STAGE_INIT + #define CONFIG_BOOTCOUNT_LIMIT
#define CONFIG_CMD_DTT

This enables generic board support so that ARM boards can define CONFIG_SYS_GENERIC_BOARD.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
arch/arm/config.mk | 3 --- arch/arm/include/asm/u-boot.h | 9 +++++++++ arch/arm/lib/Makefile | 3 +++ 3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/arch/arm/config.mk b/arch/arm/config.mk index c159675..24b9d7c 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -49,9 +49,6 @@ ifneq ($(CONFIG_SPL_BUILD),y) ALL-$(CONFIG_SYS_THUMB_BUILD) += checkthumb endif
-# Move to unified board system later -CONFIG_SYS_LEGACY_BOARD := y - # Try if EABI is supported, else fall back to old API, # i. e. for example: # - with ELDK 4.2 (EABI supported), use: diff --git a/arch/arm/include/asm/u-boot.h b/arch/arm/include/asm/u-boot.h index 2ba98bc..8e7e27b 100644 --- a/arch/arm/include/asm/u-boot.h +++ b/arch/arm/include/asm/u-boot.h @@ -36,6 +36,12 @@ #ifndef _U_BOOT_H_ #define _U_BOOT_H_ 1
+#ifdef CONFIG_SYS_GENERIC_BOARD +/* Use the generic board which requires a unified bd_info */ +#include <asm-generic/u-boot.h> +#else + +#ifndef __ASSEMBLY__ typedef struct bd_info { unsigned int bi_baudrate; /* serial console baudrate */ ulong bi_arch_number; /* unique id for this board */ @@ -49,6 +55,9 @@ typedef struct bd_info { ulong size; } bi_dram[CONFIG_NR_DRAM_BANKS]; } bd_t; +#endif + +#endif /* nCONFIG_SYS_GENERIC_BOARD */
/* For image.h:image_check_target_arch() */ #define IH_ARCH_DEFAULT IH_ARCH_ARM diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 57111af..24c7e7a 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -39,7 +39,10 @@ GLCOBJS += div0.o SOBJS-y += crt0.o
ifndef CONFIG_SPL_BUILD +ifndef CONFIG_SYS_GENERIC_BOARD COBJS-y += board.o +endif + COBJS-y += bootm.o COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o

Link symbols as created by the link script can either be absolute or relative to the text start. This option switches between the two options so that we can support both.
As we convert architectures over to generic board, we can see if this option is actually needed, or whether it is possible to unify this feature also.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Add offsets support for access to fdt that uses CONFIG_OF_SEPARATE
Changes in v4: None Changes in v3: None Changes in v2: None
README | 6 ++++++ common/board_f.c | 15 +++++++++++++++ 2 files changed, 21 insertions(+)
diff --git a/README b/README index 88526cb..f897c4d 100644 --- a/README +++ b/README @@ -3219,6 +3219,12 @@ Configuration Settings: its config.mk file). If you find problems enabling this option on your board please report the problem and send patches!
+- CONFIG_SYS_SYM_OFFSETS + This is set by architectures that use offsets for link symbols + instead of absolute values. So bss_start is obtained using an + offset _bss_start_ofs from CONFIG_SYS_TEXT_BASE, rather than + directly. You should not need to touch this setting. +
The following definitions that deal with the placement and management of environment data (variable area); in general, we support the diff --git a/common/board_f.c b/common/board_f.c index 3a8036f..db3ef0a 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -107,8 +107,13 @@ static int display_text_info(void) { ulong bss_start, bss_end;
+#ifdef CONFIG_SYS_SYM_OFFSETS bss_start = _bss_start_ofs + _TEXT_BASE; bss_end = _bss_end_ofs + _TEXT_BASE; +#else + bss_start = (ulong)&__bss_start; + bss_end = (ulong)&__bss_end; +#endif debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n", CONFIG_SYS_TEXT_BASE, bss_start, bss_end);
@@ -174,7 +179,11 @@ static int zero_global_data(void)
static int setup_mon_len(void) { +#ifdef CONFIG_SYS_SYM_OFFSETS gd->mon_len = _bss_end_ofs; +#else + gd->mon_len = (ulong)&__bss_end - (ulong)&__text_start; +#endif return 0; }
@@ -190,7 +199,11 @@ static int setup_fdt(void) gd->fdt_blob = _binary_dt_dtb_start; #elif defined CONFIG_OF_SEPARATE /* FDT is at end of image */ +# ifdef CONFIG_SYS_SYM_OFFSETS gd->fdt_blob = (void *)(_end_ofs + CONFIG_SYS_TEXT_BASE); +# else + gd->fdt_blob = (ulong *)&_end; +# endif #endif /* Allow the early environment to override the fdt address */ gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16, @@ -476,6 +489,7 @@ static int mark_bootstage(void) }
static init_fnc_t init_sequence_f[] = { + zero_global_data, setup_fdt, setup_mon_len, arch_cpu_init, /* basic arch cpu dependent setup */ @@ -510,6 +524,7 @@ static init_fnc_t init_sequence_f[] = { #ifdef CONFIG_POST init_post, #endif + setup_dram_config, /* * Now that we have DRAM mapped and working, we can * relocate the code and continue running from DRAM.

This adds ppc features to the generic pre-relocation board init.
This is a separate commit so that these features are clearly shown.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Use watchdog.h for watchdog functions - Add define to work around __bss_end / __bss_end__ confusion
Changes in v4: - Updates to sit on top of earlier patches
Changes in v3: None Changes in v2: None
common/board_f.c | 347 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 345 insertions(+), 2 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c index db3ef0a..4dfac6e 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -31,10 +31,31 @@ #include <version.h> #include <environment.h> #include <fdtdec.h> +#if defined(CONFIG_CMD_IDE) +#include <ide.h> +#endif +#include <i2c.h> #include <initcall.h> #include <logbuff.h> + +/* TODO: Can we move these into arch/ headers? */ +#ifdef CONFIG_8xx +#include <mpc8xx.h> +#endif +#ifdef CONFIG_5xx +#include <mpc5xx.h> +#endif +#ifdef CONFIG_MPC5xxx +#include <mpc5xxx.h> +#endif + #include <post.h> +#include <spi.h> +#include <watchdog.h> #include <asm/io.h> +#ifdef CONFIG_MP +#include <asm/mp.h> +#endif #include <asm/sections.h> #include <linux/compiler.h>
@@ -97,6 +118,31 @@ void blue_led_off(void) __attribute__((weak, alias("__blue_led_off"))); * Could the CONFIG_SPL_BUILD infection become a flag in gd? */
+#if defined(CONFIG_WATCHDOG) +static int init_func_watchdog_init(void) +{ + puts(" Watchdog enabled\n"); + WATCHDOG_RESET(); + + return 0; +} + +int init_func_watchdog_reset(void) +{ + WATCHDOG_RESET(); + + return 0; +} +#endif /* CONFIG_WATCHDOG */ + +void __board_add_ram_info(int use_default) +{ + /* please define platform specific board_add_ram_info() */ +} + +void board_add_ram_info(int) + __attribute__ ((weak, alias("__board_add_ram_info"))); + static int init_baud_rate(void) { gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE); @@ -134,6 +180,25 @@ static int announce_dram_init(void) return 0; }
+#ifdef CONFIG_PPC +static int init_func_ram(void) +{ +#ifdef CONFIG_BOARD_TYPES + int board_type = gd->board_type; +#else + int board_type = 0; /* use dummy arg */ +#endif + + gd->ram_size = initdram(board_type); + + if (gd->ram_size > 0) + return 0; + + puts("*** failed ***\n"); + return 1; +} +#endif + static int show_dram_config(void) { ulong size; @@ -154,11 +219,24 @@ static int show_dram_config(void) size = gd->ram_size; #endif
- print_size(size, "\n"); + print_size(size, ""); + board_add_ram_info(0); + putc('\n');
return 0; }
+ulong get_effective_memsize(void) +{ +#ifndef CONFIG_VERY_BIG_RAM + return gd->ram_size; +#else + /* limit stack to what we can reasonable map */ + return ((gd->ram_size > CONFIG_MAX_MEM_MAPPED) ? + CONFIG_MAX_MEM_MAPPED : gd->ram_size); +#endif +} + void __dram_init_banksize(void) { #if defined(CONFIG_NR_DRAM_BANKS) && defined(CONFIG_SYS_SDRAM_BASE) @@ -170,6 +248,27 @@ void __dram_init_banksize(void) void dram_init_banksize(void) __attribute__((weak, alias("__dram_init_banksize")));
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) +static int init_func_i2c(void) +{ + puts("I2C: "); + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); + puts("ready\n"); + return 0; +} +#endif + +#if defined(CONFIG_HARD_SPI) +static int init_func_spi(void) +{ + puts("SPI: "); + spi_init(); + puts("ready\n"); + return 0; +} +#endif + +__maybe_unused static int zero_global_data(void) { memset((void *)gd, '\0', sizeof(gd_t)); @@ -182,7 +281,8 @@ static int setup_mon_len(void) #ifdef CONFIG_SYS_SYM_OFFSETS gd->mon_len = _bss_end_ofs; #else - gd->mon_len = (ulong)&__bss_end - (ulong)&__text_start; + /* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */ + gd->mon_len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE; #endif return 0; } @@ -237,9 +337,23 @@ static int setup_dest_addr(void) */ gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE; #endif +#ifdef CONFIG_NR_DRAM_BANKS gd->ram_top = gd->bd->bi_dram[0].start + gd->bd->bi_dram[0].size; +#else + gd->ram_top = CONFIG_SYS_SDRAM_BASE + get_effective_memsize(); +#endif gd->ram_top = board_get_usable_ram_top(gd->mon_len); gd->dest_addr = gd->ram_top; +#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500)) + /* + * We need to make sure the location we intend to put secondary core + * boot code is reserved and not used by any part of u-boot + */ + if (gd->dest_addr > determine_mp_bootpg(NULL)) { + gd->dest_addr = determine_mp_bootpg(NULL); + debug("Reserving MP boot page to %08lx\n", gd->dest_addr); + } +#endif gd->dest_addr_sp = gd->dest_addr; return 0; } @@ -308,6 +422,18 @@ static int reserve_lcd(void) } #endif /* CONFIG_LCD */
+#if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) \ + && !defined(CONFIG_ARM) +static int reserve_video(void) +{ + /* reserve memory for video display (always full pages) */ + gd->dest_addr = video_setmem(gd->dest_addr); + gd->fb_base = gd->dest_addr; + + return 0; +} +#endif + static int reserve_uboot(void) { /* @@ -316,6 +442,10 @@ static int reserve_uboot(void) */ gd->dest_addr -= gd->mon_len; gd->dest_addr &= ~(4096 - 1); +#ifdef CONFIG_E500 + /* round down to next 64 kB limit so that IVPR stays aligned */ + gd->dest_addr &= ~(65536 - 1); +#endif
debug("Reserving %ldk for U-Boot at: %08lx\n", gd->mon_len >> 10, gd->dest_addr); @@ -383,6 +513,10 @@ static int reserve_fdt(void) #ifndef CONFIG_SPL_BUILD static int reserve_stacks(void) { +#ifdef CONFIG_PPC + ulong *s; +#endif + /* setup stack pointer for exceptions */ gd->dest_addr_sp -= 16; gd->dest_addr_sp &= ~0xf; @@ -398,6 +532,14 @@ static int reserve_stacks(void) /* leave 3 words for abort-stack, plus 1 for alignment */ gd->dest_addr_sp -= 16;
+#ifdef CONFIG_PPC + /* Clear initial stack frame */ + s = (ulong *) gd->dest_addr_sp; + *s = 0; /* Terminate back chain */ + *++s = 0; /* NULL return address */ + gd->dest_addr_sp = (ulong) s; +#endif + return 0; } #endif @@ -419,6 +561,106 @@ static int display_new_sp(void) return 0; }
+#ifdef CONFIG_PPC +static int setup_board_part1(void) +{ + bd_t *bd = gd->bd; + + /* + * Save local variables to board info struct + */ + + bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; /* start of memory */ + bd->bi_memsize = gd->ram_size; /* size in bytes */ + +#ifdef CONFIG_SYS_SRAM_BASE + bd->bi_sramstart = CONFIG_SYS_SRAM_BASE; /* start of SRAM */ + bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE; /* size of SRAM */ +#endif + +#if defined(CONFIG_8xx) || defined(CONFIG_8260) || defined(CONFIG_5xx) || \ + defined(CONFIG_E500) || defined(CONFIG_MPC86xx) + bd->bi_immr_base = CONFIG_SYS_IMMR; /* base of IMMR register */ +#endif +#if defined(CONFIG_MPC5xxx) + bd->bi_mbar_base = CONFIG_SYS_MBAR; /* base of internal registers */ +#endif +#if defined(CONFIG_MPC83xx) + bd->bi_immrbar = CONFIG_SYS_IMMR; +#endif +#if defined(CONFIG_MPC8220) + bd->bi_mbar_base = CONFIG_SYS_MBAR; /* base of internal registers */ + bd->bi_inpfreq = gd->arch.inp_clk; + bd->bi_pcifreq = gd->pci_clk; + bd->bi_vcofreq = gd->arch.vco_clk; + bd->bi_pevfreq = gd->arch.pev_clk; + bd->bi_flbfreq = gd->arch.flb_clk; + + /* store bootparam to sram (backward compatible), here? */ + { + u32 *sram = (u32 *) CONFIG_SYS_SRAM_BASE; + + *sram++ = gd->ram_size; + *sram++ = gd->bus_clk; + *sram++ = gd->arch.inp_clk; + *sram++ = gd->cpu_clk; + *sram++ = gd->arch.vco_clk; + *sram++ = gd->arch.flb_clk; + *sram++ = 0xb8c3ba11; /* boot signature */ + } +#endif + + return 0; +} + +static int setup_board_part2(void) +{ + bd_t *bd = gd->bd; + + bd->bi_intfreq = gd->cpu_clk; /* Internal Freq, in Hz */ + bd->bi_busfreq = gd->bus_clk; /* Bus Freq, in Hz */ +#if defined(CONFIG_CPM2) + bd->bi_cpmfreq = gd->arch.cpm_clk; + bd->bi_brgfreq = gd->arch.brg_clk; + bd->bi_sccfreq = gd->arch.scc_clk; + bd->bi_vco = gd->arch.vco_out; +#endif /* CONFIG_CPM2 */ +#if defined(CONFIG_MPC512X) + bd->bi_ipsfreq = gd->arch.ips_clk; +#endif /* CONFIG_MPC512X */ +#if defined(CONFIG_MPC5xxx) + bd->bi_ipbfreq = gd->arch.ipb_clk; + bd->bi_pcifreq = gd->pci_clk; +#endif /* CONFIG_MPC5xxx */ + + return 0; +} +#endif + +#ifdef CONFIG_SYS_EXTBDINFO +static int setup_board_extra(void) +{ + bd_t *bd = gd->bd; + + strncpy((char *) bd->bi_s_version, "1.2", sizeof(bd->bi_s_version)); + strncpy((char *) bd->bi_r_version, U_BOOT_VERSION, + sizeof(bd->bi_r_version)); + + bd->bi_procfreq = gd->cpu_clk; /* Processor Speed, In Hz */ + bd->bi_plb_busfreq = gd->bus_clk; +#if defined(CONFIG_405GP) || defined(CONFIG_405EP) || \ + defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ + defined(CONFIG_440EPX) || defined(CONFIG_440GRX) + bd->bi_pci_busfreq = get_PCI_freq(); + bd->bi_opbfreq = get_OPB_freq(); +#elif defined(CONFIG_XILINX_405) + bd->bi_pci_busfreq = get_PCI_freq(); +#endif + + return 0; +} +#endif + #ifdef CONFIG_POST static int init_post(void) { @@ -489,9 +731,17 @@ static int mark_bootstage(void) }
static init_fnc_t init_sequence_f[] = { +#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC512X) && \ + !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \ + !defined(CONFIG_MPC86xx) zero_global_data, +#endif setup_fdt, setup_mon_len, +#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) + /* TODO: can this go into arch_cpu_init()? */ + probecpu, +#endif arch_cpu_init, /* basic arch cpu dependent setup */ mark_bootstage, #ifdef CONFIG_OF_CONTROL @@ -500,31 +750,110 @@ static init_fnc_t init_sequence_f[] = { #if defined(CONFIG_BOARD_EARLY_INIT_F) board_early_init_f, #endif + /* TODO: can any of this go into arch_cpu_init()? */ +#if defined(CONFIG_PPC) && !defined(CONFIG_8xx_CPUCLK_DEFAULT) + get_clocks, /* get CPU and bus clocks (etc.) */ +#if defined(CONFIG_TQM8xxL) && !defined(CONFIG_TQM866M) \ + && !defined(CONFIG_TQM885D) + adjust_sdram_tbs_8xx, +#endif + /* TODO: can we rename this to timer_init()? */ + init_timebase, +#endif +#if defined(CONFIG_BOARD_EARLY_INIT_F) + board_early_init_f, +#endif +#ifdef CONFIG_ARM timer_init, /* initialize timer */ +#endif #ifdef CONFIG_BOARD_POSTCLK_INIT board_postclk_init, #endif #ifdef CONFIG_FSL_ESDHC get_clocks, #endif +#ifdef CONFIG_SYS_ALLOC_DPRAM +#if !defined(CONFIG_CPM2) + dpram_init, +#endif +#endif +#if defined(CONFIG_BOARD_POSTCLK_INIT) + board_postclk_init, +#endif env_init, /* initialize environment */ +#if defined(CONFIG_8xx_CPUCLK_DEFAULT) + /* get CPU and bus clocks according to the environment variable */ + get_clocks_866, + /* adjust sdram refresh rate according to the new clock */ + sdram_adjust_866, + init_timebase, +#endif init_baud_rate, /* initialze baudrate settings */ serial_init, /* serial communications setup */ console_init_f, /* stage 1 init of console */ display_options, /* say that we are here */ display_text_info, /* show debugging info if required */ +#if defined(CONFIG_8260) + prt_8260_rsr, + prt_8260_clks, +#endif /* CONFIG_8260 */ +#if defined(CONFIG_MPC83xx) + prt_83xx_rsr, +#endif +#ifdef CONFIG_PPC + checkcpu, +#endif #if defined(CONFIG_DISPLAY_CPUINFO) print_cpuinfo, /* display cpu info (and speed) */ #endif +#if defined(CONFIG_MPC5xxx) + prt_mpc5xxx_clks, +#endif /* CONFIG_MPC5xxx */ +#if defined(CONFIG_MPC8220) + prt_mpc8220_clks, +#endif #if defined(CONFIG_DISPLAY_BOARDINFO) checkboard, /* display board info */ #endif + INIT_FUNC_WATCHDOG_INIT +#if defined(CONFIG_MISC_INIT_F) + misc_init_f, +#endif + INIT_FUNC_WATCHDOG_RESET +#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) + init_func_i2c, +#endif +#if defined(CONFIG_HARD_SPI) + init_func_spi, +#endif +#ifdef CONFIG_X86 + dram_init_f, /* configure available RAM banks */ +#endif announce_dram_init, + /* TODO: unify all these dram functions? */ +#ifdef CONFIG_ARM + dram_init, /* configure available RAM banks */ + setup_dram_config, +#endif +#ifdef CONFIG_PPC + init_func_ram, +#endif show_dram_config, #ifdef CONFIG_POST + post_init_f, +#endif + INIT_FUNC_WATCHDOG_RESET +#if defined(CONFIG_SYS_DRAM_TEST) + testdram, +#endif /* CONFIG_SYS_DRAM_TEST */ + INIT_FUNC_WATCHDOG_RESET + +#ifdef CONFIG_POST init_post, #endif + INIT_FUNC_WATCHDOG_RESET setup_dram_config, + /* * Now that we have DRAM mapped and working, we can * relocate the code and continue running from DRAM. @@ -552,6 +881,11 @@ static init_fnc_t init_sequence_f[] = { #ifdef CONFIG_LCD reserve_lcd, #endif + /* TODO: Why the dependency on CONFIG_8xx? */ +#if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) \ + && !defined(CONFIG_ARM) + reserve_video, +#endif reserve_uboot, #ifndef CONFIG_SPL_BUILD reserve_malloc, @@ -565,8 +899,17 @@ static init_fnc_t init_sequence_f[] = { #else reserve_stacks, #endif +#ifdef CONFIG_PPC + setup_board_part1, + INIT_FUNC_WATCHDOG_RESET + setup_board_part2, +#endif setup_baud_rate, display_new_sp, +#ifdef CONFIG_SYS_EXTBDINFO + setup_board_extra, +#endif + INIT_FUNC_WATCHDOG_RESET reloc_fdt, setup_reloc, #ifndef CONFIG_ARM

On 02/08/2013 09:12:12 AM, Simon Glass wrote:
#ifndef CONFIG_SPL_BUILD static int reserve_stacks(void) { +#ifdef CONFIG_PPC
- ulong *s;
+#endif
- /* setup stack pointer for exceptions */ gd->dest_addr_sp -= 16; gd->dest_addr_sp &= ~0xf;
@@ -398,6 +532,14 @@ static int reserve_stacks(void) /* leave 3 words for abort-stack, plus 1 for alignment */ gd->dest_addr_sp -= 16;
+#ifdef CONFIG_PPC
- /* Clear initial stack frame */
- s = (ulong *) gd->dest_addr_sp;
- *s = 0; /* Terminate back chain */
- *++s = 0; /* NULL return address */
- gd->dest_addr_sp = (ulong) s;
+#endif
PPC ABI requires 16-byte stack alignment, which would be broken by the CONFIG_USE_IRQ section (which even still has an "ARM ABI" comment).
I think this entire function should be kept in arch code. Stack layout is inherently architecture/ABI specific. Some architectures even have a stack that grows upward (not sure if any such are supported by U-Boot).
-Scott

Hi Scott,
On Tue, Feb 12, 2013 at 2:32 PM, Scott Wood scottwood@freescale.com wrote:
On 02/08/2013 09:12:12 AM, Simon Glass wrote:
#ifndef CONFIG_SPL_BUILD static int reserve_stacks(void) { +#ifdef CONFIG_PPC
ulong *s;
+#endif
/* setup stack pointer for exceptions */ gd->dest_addr_sp -= 16; gd->dest_addr_sp &= ~0xf;
@@ -398,6 +532,14 @@ static int reserve_stacks(void) /* leave 3 words for abort-stack, plus 1 for alignment */ gd->dest_addr_sp -= 16;
+#ifdef CONFIG_PPC
/* Clear initial stack frame */
s = (ulong *) gd->dest_addr_sp;
*s = 0; /* Terminate back chain */
*++s = 0; /* NULL return address */
gd->dest_addr_sp = (ulong) s;
+#endif
PPC ABI requires 16-byte stack alignment, which would be broken by the CONFIG_USE_IRQ section (which even still has an "ARM ABI" comment).
I think this entire function should be kept in arch code. Stack layout is inherently architecture/ABI specific. Some architectures even have a stack that grows upward (not sure if any such are supported by U-Boot).
Thanks for reviewing all this.
While I am working to avoid it, one option is to create a weak function which archs can override. The reason I am keen to avoid it, at least for a first implementation, is that it obscures the similarities. In this case we could just just force 16-byte alignment, and make the PPC code unconditional. It shouldn't hurt anything.
Regards, Simon
-Scott

On 02/12/2013 04:41:15 PM, Simon Glass wrote:
Hi Scott,
On Tue, Feb 12, 2013 at 2:32 PM, Scott Wood scottwood@freescale.com wrote:
On 02/08/2013 09:12:12 AM, Simon Glass wrote:
#ifndef CONFIG_SPL_BUILD static int reserve_stacks(void) { +#ifdef CONFIG_PPC
ulong *s;
+#endif
/* setup stack pointer for exceptions */ gd->dest_addr_sp -= 16; gd->dest_addr_sp &= ~0xf;
@@ -398,6 +532,14 @@ static int reserve_stacks(void) /* leave 3 words for abort-stack, plus 1 for alignment */ gd->dest_addr_sp -= 16;
+#ifdef CONFIG_PPC
/* Clear initial stack frame */
s = (ulong *) gd->dest_addr_sp;
*s = 0; /* Terminate back chain */
*++s = 0; /* NULL return address */
gd->dest_addr_sp = (ulong) s;
+#endif
PPC ABI requires 16-byte stack alignment, which would be broken by
the
CONFIG_USE_IRQ section (which even still has an "ARM ABI" comment).
I think this entire function should be kept in arch code. Stack
layout is
inherently architecture/ABI specific. Some architectures even have
a stack
that grows upward (not sure if any such are supported by U-Boot).
Thanks for reviewing all this.
While I am working to avoid it, one option is to create a weak function which archs can override. The reason I am keen to avoid it, at least for a first implementation, is that it obscures the similarities.
That's fine for most of the file, but I think there's not much that's truly generic when it comes to setting up the stack. It's not as if this is a huge function (at least before it grows a bunch of ifdefs).
In this case we could just just force 16-byte alignment, and make the PPC code unconditional. It shouldn't hurt anything.
The CONFIG_USE_IRQ section also has references to FIQs... if it's meant to be an ARM-specific CONFIG, perhaps it should be renamed (and definitely it should be documented).
-Scott

This adds ppc features to the generic post-relocation board init.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Add prototype for update_flash_size() to include/common.h - Updates in board_r.c to make ppc build correctly - Add prototype for board_start_ide() to include/ide.h - Bring in new ppc features since this patch was first created
Changes in v4: - Updates to sit on top of earlier patches
Changes in v3: None Changes in v2: None
common/board_r.c | 477 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- include/common.h | 1 + include/ide.h | 7 + 3 files changed, 482 insertions(+), 3 deletions(-)
diff --git a/common/board_r.c b/common/board_r.c index 2511471..24d8a17 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -27,25 +27,81 @@ */
#include <common.h> +/* TODO: can we just include all these headers whether needed or not? */ +#if defined(CONFIG_CMD_BEDBUG) +#include <bedbug/type.h> +#endif #ifdef CONFIG_HAS_DATAFLASH #include <dataflash.h> #endif #include <environment.h> #include <fdtdec.h> +#if defined(CONFIG_CMD_IDE) +#include <ide.h> +#endif #include <initcall.h> +#ifdef CONFIG_PS2KBD +#include <keyboard.h> +#endif +#if defined(CONFIG_CMD_KGDB) +#include <kgdb.h> +#endif #include <logbuff.h> #include <malloc.h> +#ifdef CONFIG_BITBANGMII +#include <miiphy.h> +#endif #include <mmc.h> #include <nand.h> #include <onenand_uboot.h> +#include <scsi.h> #include <serial.h> +#include <spi.h> #include <stdio_dev.h> +#include <watchdog.h> +#ifdef CONFIG_ADDR_MAP +#include <asm/mmu.h> +#endif #include <asm/sections.h> +#include <linux/compiler.h>
DECLARE_GLOBAL_DATA_PTR;
ulong monitor_flash_len;
+int __board_flash_wp_on(void) +{ + /* + * Most flashes can't be detected when write protection is enabled, + * so provide a way to let U-Boot gracefully ignore write protected + * devices. + */ + return 0; +} + +int board_flash_wp_on(void) + __attribute__ ((weak, alias("__board_flash_wp_on"))); + +void __cpu_secondary_init_r(void) +{ +} + +void cpu_secondary_init_r(void) + __attribute__ ((weak, alias("__cpu_secondary_init_r"))); + +static int initr_secondary_cpu(void) +{ + /* + * after non-volatile devices & environment is setup and cpu code have + * another round to deal with any initialization that might require + * full access to the environment or loading of some image (firmware) + * from a non-volatile device + */ + /* TODO: maybe define this for all archs? */ + cpu_secondary_init_r(); + + return 0; +}
static int initr_reloc(void) { @@ -68,6 +124,11 @@ static int initr_caches(void) } #endif
+__weak int fixup_cpu(void) +{ + return 0; +} + static int initr_reloc_global_data(void) { #ifdef CONFIG_SYS_SYM_OFFSETS @@ -75,6 +136,31 @@ static int initr_reloc_global_data(void) #else monitor_flash_len = (ulong)&__init_end - gd->dest_addr; #endif +#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) + /* + * The gd->cpu pointer is set to an address in flash before relocation. + * We need to update it to point to the same CPU entry in RAM. + * TODO: why not just add gd->reloc_ofs? + */ + gd->arch.cpu += gd->dest_addr - CONFIG_SYS_MONITOR_BASE; + + /* + * If we didn't know the cpu mask & # cores, we can save them of + * now rather than 'computing' them constantly + */ + fixup_cpu(); +#endif +#ifdef CONFIG_SYS_EXTRA_ENV_RELOC + /* + * Some systems need to relocate the env_addr pointer early because the + * location it points to will get invalidated before env_relocate is + * called. One example is on systems that might use a L2 or L3 cache + * in SRAM mode and initialize that cache from SRAM mode back to being + * a cache in cpu_init_r. + */ + gd->env_addr += gd->dest_addr - CONFIG_SYS_MONITOR_BASE; +#endif + return 0; }
static int initr_serial(void) @@ -83,6 +169,27 @@ static int initr_serial(void) return 0; }
+#ifdef CONFIG_PPC +static int initr_trap(void) +{ + /* + * Setup trap handlers + */ + trap_init(gd->dest_addr); + + return 0; +} +#endif + +#ifdef CONFIG_ADDR_MAP +static int initr_addr_map(void) +{ + init_addr_map(); + + return 0; +} +#endif + #ifdef CONFIG_LOGBUFFER unsigned long logbuffer_base(void) { @@ -104,6 +211,50 @@ static int initr_post_backlog(void) } #endif
+#ifdef CONFIG_SYS_DELAYED_ICACHE +static int initr_icache_enable(void) +{ + return 0; +} +#endif + +#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500) +static int initr_unlock_ram_in_cache(void) +{ + unlock_ram_in_cache(); /* it's time to unlock D-cache in e500 */ + return 0; +} +#endif + +#ifdef CONFIG_PCI +static int initr_pci(void) +{ + pci_init(); + + return 0; +} +#endif + +#ifdef CONFIG_WINBOND_83C553 +static int initr_w83c553f(void) +{ + /* + * Initialise the ISA bridge + */ + initialise_w83c553f(); + return 0; +} +#endif + +static int initr_barrier(void) +{ +#ifdef CONFIG_PPC + /* TODO: Can we not use dmb() macros for this? */ + asm("sync ; isync"); +#endif + return 0; +} + static int initr_malloc(void) { ulong malloc_start; @@ -128,13 +279,26 @@ static int initr_announce(void) #if !defined(CONFIG_SYS_NO_FLASH) static int initr_flash(void) { - ulong flash_size; + ulong flash_size = 0; + bd_t *bd = gd->bd; + int ok;
puts("Flash: ");
- flash_size = flash_init(); - if (flash_size <= 0) { + if (board_flash_wp_on()) { + printf("Uninitialized - Write Protect On\n"); + /* Since WP is on, we can't find real size. Set to 0 */ + ok = 1; + } else { + flash_size = flash_init(); + ok = flash_size > 0; + } + if (!ok) { puts("*** failed ***\n"); +#ifdef CONFIG_PPC + /* Why does PPC do this? */ + hang(); +#endif return -1; } print_size(flash_size, ""); @@ -154,6 +318,39 @@ static int initr_flash(void) print_size(flash_size, "\n"); #endif /* CONFIG_SYS_FLASH_CHECKSUM */
+ /* update start of FLASH memory */ +#ifdef CONFIG_SYS_FLASH_BASE + bd->bi_flashstart = CONFIG_SYS_FLASH_BASE; +#endif + /* size of FLASH memory (final value) */ + bd->bi_flashsize = flash_size; + +#if defined(CONFIG_SYS_UPDATE_FLASH_SIZE) + /* Make a update of the Memctrl. */ + update_flash_size(flash_size); +#endif + + +#if defined(CONFIG_OXC) || defined(CONFIG_RMU) + /* flash mapped at end of memory map */ + bd->bi_flashoffset = CONFIG_SYS_TEXT_BASE + flash_size; +#elif CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE + bd->bi_flashoffset = monitor_flash_len; /* reserved area for monitor */ +#endif + return 0; +} +#endif + +#ifdef CONFIG_PPC +static int initr_spi(void) +{ + /* PPC does this here */ +#ifdef CONFIG_SPI +#if !defined(CONFIG_ENV_IS_IN_EEPROM) + spi_init_f(); +#endif + spi_init_r(); +#endif return 0; } #endif @@ -228,9 +425,56 @@ static int initr_env(void)
/* Initialize from environment */ load_addr = getenv_ulong("loadaddr", 16, load_addr); +#if defined(CONFIG_SYS_EXTBDINFO) +#if defined(CONFIG_405GP) || defined(CONFIG_405EP) +#if defined(CONFIG_I2CFAST) + /* + * set bi_iic_fast for linux taking environment variable + * "i2cfast" into account + */ + { + char *s = getenv("i2cfast"); + + if (s && ((*s == 'y') || (*s == 'Y'))) { + gd->bd->bi_iic_fast[0] = 1; + gd->bd->bi_iic_fast[1] = 1; + } + } +#endif /* CONFIG_I2CFAST */ +#endif /* CONFIG_405GP, CONFIG_405EP */ +#endif /* CONFIG_SYS_EXTBDINFO */ + return 0; +} + +#ifdef CONFIG_HERMES +static int initr_hermes(void) +{ + if ((gd->board_type >> 16) == 2) + gd->bd->bi_ethspeed = gd->board_type & 0xFFFF; + else + gd->bd->bi_ethspeed = 0xFFFF; return 0; }
+static int initr_hermes_start(void) +{ + if (gd->bd->bi_ethspeed != 0xFFFF) + hermes_start_lxt980((int) gd->bd->bi_ethspeed); + return 0; +} +#endif + +#ifdef CONFIG_SC3 +/* TODO: with new initcalls, move this into the driver */ +extern void sc3_read_eeprom(void); + +static int initr_sc3_read_eeprom(void) +{ + sc3_read_eeprom(); + return 0; +} +#endif + static int initr_jumptable(void) { jumptable_init(); @@ -271,11 +515,65 @@ static int initr_enable_interrupts(void) #ifdef CONFIG_CMD_NET static int initr_ethaddr(void) { + bd_t *bd = gd->bd; + + /* kept around for legacy kernels only ... ignore the next section */ + eth_getenv_enetaddr("ethaddr", bd->bi_enetaddr); +#ifdef CONFIG_HAS_ETH1 + eth_getenv_enetaddr("eth1addr", bd->bi_enet1addr); +#endif +#ifdef CONFIG_HAS_ETH2 + eth_getenv_enetaddr("eth2addr", bd->bi_enet2addr); +#endif +#ifdef CONFIG_HAS_ETH3 + eth_getenv_enetaddr("eth3addr", bd->bi_enet3addr); +#endif +#ifdef CONFIG_HAS_ETH4 + eth_getenv_enetaddr("eth4addr", bd->bi_enet4addr); +#endif +#ifdef CONFIG_HAS_ETH5 + eth_getenv_enetaddr("eth5addr", bd->bi_enet5addr); +#endif + return 0; +} +#endif /* CONFIG_CMD_NET */ + +#ifdef CONFIG_CMD_KGDB +static int initr_kgdb(void) +{ + puts("KGDB: "); + kgdb_init(); + return 0; +} +#endif + +#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT) +static int initr_status_led(void) +{ + status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING); + + return 0; +} +#endif + +#if defined(CONFIG_CMD_SCSI) +static int initr_scsi(void) +{ + puts("SCSI: "); + scsi_init();
return 0; } #endif /* CONFIG_CMD_NET */
+#if defined(CONFIG_CMD_DOC) +static int initr_doc(void) +{ + puts("DOC: "); + doc_init(); +} +#endif + #ifdef CONFIG_BITBANGMII static int initr_bbmii(void) { @@ -305,6 +603,33 @@ static int initr_post(void) } #endif
+#if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_CMD_IDE) +static int initr_pcmcia(void) +{ + puts("PCMCIA:"); + pcmcia_init(); + return 0; +} +#endif + +#if defined(CONFIG_CMD_IDE) +static int initr_ide(void) +{ +#ifdef CONFIG_IDE_8xx_PCCARD + puts("PCMCIA:"); +#else + puts("IDE: "); +#endif +#if defined(CONFIG_START_IDE) + if (board_start_ide()) + ide_init(); +#else + ide_init(); +#endif + return 0; +} +#endif + #if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER) /* * Export available size of memory for Linux, taking into account the @@ -324,6 +649,37 @@ int initr_mem(void) # endif sprintf(memsz, "%ldk", (gd->ram_size / 1024) - pram); setenv("mem", memsz); + + return 0; +} +#endif + +#ifdef CONFIG_CMD_BEDBUG +static int initr_bedbug(void) +{ + bedbug_init(); + + return 0; +} +#endif + +#ifdef CONFIG_PS2KBD +static int initr_kbd(void) +{ + puts("PS/2: "); + kbd_init(); + return 0; +} +#endif + +#ifdef CONFIG_MODEM_SUPPORT +static int initr_modem(void) +{ + /* TODO: with new initcalls, move this into the driver */ + extern int do_mdm_init; + + do_mdm_init = gd->do_mdm_init; + return 0; } #endif
@@ -341,22 +697,63 @@ static int run_main_loop(void) * * We also hope to remove most of the driver-related init and do it if/when * the driver is later used. + * + * TODO: perhaps reset the watchdog in the initcall function after each call? */ init_fnc_t init_sequence_r[] = { initr_reloc, + /* TODO: could x86/PPC have this also perhaps? */ #ifdef CONFIG_ARM initr_caches, board_init, /* Setup chipselects */ #endif + /* + * TODO: printing of the clock inforamtion of the board is now + * implemented as part of bdinfo command. Currently only support for + * davinci SOC's is added. Remove this check once all the board + * implement this. + */ +#ifdef CONFIG_CLOCKS + set_cpu_clk_info, /* Setup clock information */ +#endif initr_reloc_global_data, initr_serial, initr_announce, + INIT_FUNC_WATCHDOG_RESET +#ifdef CONFIG_PPC + initr_trap, +#endif +#ifdef CONFIG_ADDR_MAP + initr_addr_map, +#endif +#if defined(CONFIG_BOARD_EARLY_INIT_R) + board_early_init_r, +#endif + INIT_FUNC_WATCHDOG_RESET #ifdef CONFIG_LOGBUFFER initr_logbuffer, #endif #ifdef CONFIG_POST initr_post_backlog, #endif + INIT_FUNC_WATCHDOG_RESET +#ifdef CONFIG_SYS_DELAYED_ICACHE + initr_icache_enable, +#endif +#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500) + initr_unlock_ram_in_cache, +#endif +#if defined(CONFIG_PCI) && defined(CONFIG_SYS_EARLY_PCI_INIT) + /* + * Do early PCI configuration _before_ the flash gets initialised, + * because PCU ressources are crucial for flash access on some boards. + */ + initr_pci, +#endif +#ifdef CONFIG_WINBOND_83C553 + initr_w83c553f, +#endif + initr_barrier, initr_malloc, #ifdef CONFIG_ARCH_EARLY_INIT_R arch_early_init_r, @@ -365,6 +762,12 @@ init_fnc_t init_sequence_r[] = { #ifndef CONFIG_SYS_NO_FLASH initr_flash, #endif + INIT_FUNC_WATCHDOG_RESET +#ifdef CONFIG_PPC + /* initialize higher level parts of CPU like time base and timers */ + cpu_init_r, + initr_spi, +#endif #ifdef CONFIG_CMD_NAND initr_nand, #endif @@ -378,6 +781,24 @@ init_fnc_t init_sequence_r[] = { initr_dataflash, #endif initr_env, + INIT_FUNC_WATCHDOG_RESET + initr_secondary_cpu, +#ifdef CONFIG_SC3 + initr_sc3_read_eeprom, +#endif +#ifdef CONFIG_HERMES + initr_hermes, +#endif +#if defined(CONFIG_ID_EEPROM) || defined(CONFIG_SYS_I2C_MAC_OFFSET) + mac_read_from_eeprom, +#endif + INIT_FUNC_WATCHDOG_RESET +#if defined(CONFIG_PCI) && !defined(CONFIG_SYS_EARLY_PCI_INIT) + /* + * Do pci configuration + */ + initr_pci, +#endif stdio_init, initr_jumptable, #ifdef CONFIG_API @@ -393,23 +814,73 @@ init_fnc_t init_sequence_r[] = { #ifdef CONFIG_MISC_INIT_R misc_init_r, /* miscellaneous platform-dependent init */ #endif +#ifdef CONFIG_HERMES + initr_hermes_start, +#endif + INIT_FUNC_WATCHDOG_RESET +#ifdef CONFIG_CMD_KGDB + initr_kgdb, +#endif interrupt_init, +#ifdef CONFIG_ARM initr_enable_interrupts, +#endif +#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT) + initr_status_led, +#endif + /* PPC has a udelay(20) here dating from 2002. Why? */ #ifdef CONFIG_CMD_NET initr_ethaddr, #endif #ifdef CONFIG_BOARD_LATE_INIT board_late_init, #endif +#ifdef CONFIG_CMD_SCSI + INIT_FUNC_WATCHDOG_RESET + initr_scsi, +#endif +#ifdef CONFIG_CMD_DOC + INIT_FUNC_WATCHDOG_RESET + initr_doc, +#endif #ifdef CONFIG_BITBANGMII initr_bbmii, #endif #ifdef CONFIG_CMD_NET + INIT_FUNC_WATCHDOG_RESET initr_net, #endif #ifdef CONFIG_POST initr_post, #endif +#if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_CMD_IDE) + initr_pcmcia, +#endif +#if defined(CONFIG_CMD_IDE) + initr_ide, +#endif +#ifdef CONFIG_LAST_STAGE_INIT + INIT_FUNC_WATCHDOG_RESET + /* + * Some parts can be only initialized if all others (like + * Interrupts) are up and running (i.e. the PC-style ISA + * keyboard). + */ + last_stage_init, +#endif +#ifdef CONFIG_CMD_BEDBUG + INIT_FUNC_WATCHDOG_RESET + initr_bedbug, +#endif +#if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER) + initr_mem, +#endif +#ifdef CONFIG_PS2KBD + initr_kbd, +#endif +#ifdef CONFIG_MODEM_SUPPORT + initr_modem, +#endif run_main_loop, };
diff --git a/include/common.h b/include/common.h index 64e340a..c81814b 100644 --- a/include/common.h +++ b/include/common.h @@ -311,6 +311,7 @@ int mac_read_from_eeprom(void); extern u8 _binary_dt_dtb_start[]; /* embedded device tree blob */ int set_cpu_clk_info(void); int print_cpuinfo(void); +int update_flash_size(int flash_size);
/** * Show the DRAM size in a board-specific way diff --git a/include/ide.h b/include/ide.h index 158e1be..afea85c 100644 --- a/include/ide.h +++ b/include/ide.h @@ -85,4 +85,11 @@ void ide_output_data(int dev, const ulong *sect_buf, int words); void ide_input_data_shorts(int dev, ushort *sect_buf, int shorts); void ide_output_data_shorts(int dev, ushort *sect_buf, int shorts);
+/** + * board_start_ide() - Start up the board IDE interfac + * + * @return 0 if ok + */ +int board_start_ide(void); + #endif /* _IDE_H */

This enables generic board support so that ppc boards can define CONFIG_SYS_GENERIC_BOARD.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
arch/powerpc/config.mk | 3 --- arch/powerpc/include/asm/u-boot.h | 7 +++++++ arch/powerpc/lib/Makefile | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index bf77090..b706281 100644 --- a/arch/powerpc/config.mk +++ b/arch/powerpc/config.mk @@ -29,9 +29,6 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ PLATFORM_LDFLAGS += -n
-# Move to unified board system later -CONFIG_SYS_LEGACY_BOARD := y - # # When cross-compiling on NetBSD, we have to define __PPC__ or else we # will pick up a va_list declaration that is incompatible with the diff --git a/arch/powerpc/include/asm/u-boot.h b/arch/powerpc/include/asm/u-boot.h index 7229a98..951dd6a 100644 --- a/arch/powerpc/include/asm/u-boot.h +++ b/arch/powerpc/include/asm/u-boot.h @@ -34,6 +34,11 @@ * include/asm-ppc/u-boot.h */
+#ifdef CONFIG_SYS_GENERIC_BOARD +/* Use the generic board which requires a unified bd_info */ +#include <asm-generic/u-boot.h> +#else + #ifndef __ASSEMBLY__
typedef struct bd_info { @@ -144,6 +149,8 @@ typedef struct bd_info {
#endif /* __ASSEMBLY__ */
+#endif /* nCONFIG_SYS_GENERIC_BOARD */ + /* For image.h:image_check_target_arch() */ #define IH_ARCH_DEFAULT IH_ARCH_PPC
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index 86cf02a..59c723b 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile @@ -59,8 +59,10 @@ SOBJS-y += reloc.o
COBJS-$(CONFIG_BAT_RW) += bat_rw.o ifndef CONFIG_SPL_BUILD +ifndef CONFIG_SYS_GENERIC_BOARD COBJS-y += board.o endif +endif COBJS-y += bootm.o COBJS-y += cache.o COBJS-y += extable.o

On 02/08/2013 09:12:14 AM, Simon Glass wrote:
This enables generic board support so that ppc boards can define CONFIG_SYS_GENERIC_BOARD.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
arch/powerpc/config.mk | 3 --- arch/powerpc/include/asm/u-boot.h | 7 +++++++ arch/powerpc/lib/Makefile | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index bf77090..b706281 100644 --- a/arch/powerpc/config.mk +++ b/arch/powerpc/config.mk @@ -29,9 +29,6 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ PLATFORM_LDFLAGS += -n
-# Move to unified board system later -CONFIG_SYS_LEGACY_BOARD := y
# # When cross-compiling on NetBSD, we have to define __PPC__ or else we # will pick up a va_list declaration that is incompatible with the diff --git a/arch/powerpc/include/asm/u-boot.h b/arch/powerpc/include/asm/u-boot.h index 7229a98..951dd6a 100644 --- a/arch/powerpc/include/asm/u-boot.h +++ b/arch/powerpc/include/asm/u-boot.h @@ -34,6 +34,11 @@
- include/asm-ppc/u-boot.h
*/
+#ifdef CONFIG_SYS_GENERIC_BOARD +/* Use the generic board which requires a unified bd_info */ +#include <asm-generic/u-boot.h> +#else
Note that a unified bd_info means you're breaking compatibility with old, pre-device-tree kernels (including possibly some non-Linux OSes that still don't use the device tree) -- in which case why keep it around at all?
If you meant for the unified bd_info to be backwards compatible, it's missing bi_ip_addr.
-Scott

Hi Scott,
On Tue, Feb 12, 2013 at 12:38 PM, Scott Wood scottwood@freescale.com wrote:
On 02/08/2013 09:12:14 AM, Simon Glass wrote:
This enables generic board support so that ppc boards can define CONFIG_SYS_GENERIC_BOARD.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
arch/powerpc/config.mk | 3 --- arch/powerpc/include/asm/u-boot.h | 7 +++++++ arch/powerpc/lib/Makefile | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index bf77090..b706281 100644 --- a/arch/powerpc/config.mk +++ b/arch/powerpc/config.mk @@ -29,9 +29,6 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ PLATFORM_LDFLAGS += -n
-# Move to unified board system later -CONFIG_SYS_LEGACY_BOARD := y
# # When cross-compiling on NetBSD, we have to define __PPC__ or else we # will pick up a va_list declaration that is incompatible with the diff --git a/arch/powerpc/include/asm/u-boot.h b/arch/powerpc/include/asm/u-boot.h index 7229a98..951dd6a 100644 --- a/arch/powerpc/include/asm/u-boot.h +++ b/arch/powerpc/include/asm/u-boot.h @@ -34,6 +34,11 @@
- include/asm-ppc/u-boot.h
*/
+#ifdef CONFIG_SYS_GENERIC_BOARD +/* Use the generic board which requires a unified bd_info */ +#include <asm-generic/u-boot.h> +#else
Note that a unified bd_info means you're breaking compatibility with old, pre-device-tree kernels (including possibly some non-Linux OSes that still don't use the device tree) -- in which case why keep it around at all?
It's not intended to break things - are you saying that every arch is defined to use a different variant of bd_t in these OSes, or are you just referring to PPC?
If you meant for the unified bd_info to be backwards compatible, it's missing bi_ip_addr.
OK, I see. I saw a commit that punted it, so I punted it. I didn't notice the re-add later. I will put it back.
Regards, Simon
-Scott

On 02/12/2013 04:29:56 PM, Simon Glass wrote:
Hi Scott,
On Tue, Feb 12, 2013 at 12:38 PM, Scott Wood scottwood@freescale.com wrote:
On 02/08/2013 09:12:14 AM, Simon Glass wrote:
This enables generic board support so that ppc boards can define CONFIG_SYS_GENERIC_BOARD.
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None
arch/powerpc/config.mk | 3 --- arch/powerpc/include/asm/u-boot.h | 7 +++++++ arch/powerpc/lib/Makefile | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index bf77090..b706281 100644 --- a/arch/powerpc/config.mk +++ b/arch/powerpc/config.mk @@ -29,9 +29,6 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ PLATFORM_LDFLAGS += -n
-# Move to unified board system later -CONFIG_SYS_LEGACY_BOARD := y
# # When cross-compiling on NetBSD, we have to define __PPC__ or
else we
# will pick up a va_list declaration that is incompatible with the diff --git a/arch/powerpc/include/asm/u-boot.h b/arch/powerpc/include/asm/u-boot.h index 7229a98..951dd6a 100644 --- a/arch/powerpc/include/asm/u-boot.h +++ b/arch/powerpc/include/asm/u-boot.h @@ -34,6 +34,11 @@
- include/asm-ppc/u-boot.h
*/
+#ifdef CONFIG_SYS_GENERIC_BOARD +/* Use the generic board which requires a unified bd_info */ +#include <asm-generic/u-boot.h> +#else
Note that a unified bd_info means you're breaking compatibility
with old,
pre-device-tree kernels (including possibly some non-Linux OSes
that still
don't use the device tree) -- in which case why keep it around at
all?
It's not intended to break things - are you saying that every arch is defined to use a different variant of bd_t in these OSes, or are you just referring to PPC?
Any OS that uses bd_info is going to rely on things not changing (other than additions to the end) from whatever was used for that particular platform at the time the OS copied the struct definition.
-Scott

For x86, things have adjusted somewhat since this series was originally written. It has its own way of running through initcalls which is actually nicer than others archs.
Unfortunately this does introduce exceptions. We will soon require use of generic board on x86, but until then we need to fit in with what is there, and treat x86 as a special case.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Add new patch to adjust board_f.c for x86
Changes in v4: None Changes in v3: None Changes in v2: None
common/board_f.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 81 insertions(+), 2 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c index 4dfac6e..ab24c57 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -57,6 +57,10 @@ #include <asm/mp.h> #endif #include <asm/sections.h> +#ifdef CONFIG_X86 +#include <asm/init_helpers.h> +#include <asm/relocate.h> +#endif #include <linux/compiler.h>
/* @@ -423,7 +427,7 @@ static int reserve_lcd(void) #endif /* CONFIG_LCD */
#if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) \ - && !defined(CONFIG_ARM) + && !defined(CONFIG_ARM) && !defined(CONFIG_X86) static int reserve_video(void) { /* reserve memory for video display (always full pages) */ @@ -716,7 +720,25 @@ static int setup_reloc(void)
static int jump_to_copy(void) { + /* + * x86 is special, but in a nice way. It uses a trampoline which + * enables the dcache if possible. + * + * For now, other archs use relocate_code(), which is implemented + * similarly for all archs. When we do generic relocation, hopefully + * we can make all archs enable the dcache prior to relocation. + */ +#ifdef CONFIG_X86 + /* + * SDRAM and console are now initialised. The final stack can now + * be setup in SDRAM. Code execution will continue in Flash, but + * with the stack in SDRAM and Global Data in temporary memory + * (CPU cache) + */ + board_init_f_r_trampoline(gd->start_addr_sp); +#else relocate_code(gd->dest_addr_sp, gd->new_gd, gd->dest_addr); +#endif
return 0; } @@ -743,6 +765,12 @@ static init_fnc_t init_sequence_f[] = { probecpu, #endif arch_cpu_init, /* basic arch cpu dependent setup */ +#ifdef CONFIG_X86 + cpu_init_f, /* TODO(sjg@chromium.org): remove */ +# ifdef CONFIG_OF_CONTROL + find_fdt, /* TODO(sjg@chromium.org): remove */ +# endif +#endif mark_bootstage, #ifdef CONFIG_OF_CONTROL fdtdec_check_fdt, @@ -791,6 +819,9 @@ static init_fnc_t init_sequence_f[] = { init_baud_rate, /* initialze baudrate settings */ serial_init, /* serial communications setup */ console_init_f, /* stage 1 init of console */ +#if defined(CONFIG_X86) && defined(CONFIG_OF_CONTROL) + prepare_fdt, /* TODO(sjg@chromium.org): remove */ +#endif display_options, /* say that we are here */ display_text_info, /* show debugging info if required */ #if defined(CONFIG_8260) @@ -828,6 +859,8 @@ static init_fnc_t init_sequence_f[] = { #endif #ifdef CONFIG_X86 dram_init_f, /* configure available RAM banks */ + /* x86 would prefer that this happens after relocation */ + dram_init, #endif announce_dram_init, /* TODO: unify all these dram functions? */ @@ -883,7 +916,7 @@ static init_fnc_t init_sequence_f[] = { #endif /* TODO: Why the dependency on CONFIG_8xx? */ #if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) \ - && !defined(CONFIG_ARM) + && !defined(CONFIG_ARM) && !defined(CONFIG_X86) reserve_video, #endif reserve_uboot, @@ -920,9 +953,11 @@ static init_fnc_t init_sequence_f[] = {
void board_init_f(ulong boot_flags) { +#ifndef CONFIG_X86 gd_t data;
gd = &data; +#endif
gd->flags = boot_flags;
@@ -935,6 +970,50 @@ void board_init_f(ulong boot_flags) #endif }
+#ifdef CONFIG_X86 +/* + * For now this code is only used on x86. + * + * init_sequence_f_r is the list of init functions which are run when + * U-Boot is executing from Flash with a semi-limited 'C' environment. + * The following limitations must be considered when implementing an + * '_f_r' function: + * - 'static' variables are read-only + * - Global Data (gd->xxx) is read/write + * + * The '_f_r' sequence must, as a minimum, copy U-Boot to RAM (if + * supported). It _should_, if possible, copy global data to RAM and + * initialise the CPU caches (to speed up the relocation process) + * + * NOTE: At present only x86 uses this route, but it is intended that + * all archs will move to this when generic relocation is implemented. + */ +static init_fnc_t init_sequence_f_r[] = { + init_cache_f_r, + copy_uboot_to_ram, + clear_bss, + do_elf_reloc_fixups, + + NULL, +}; + +void board_init_f_r(void) +{ + if (initcall_run_list(init_sequence_f_r)) + hang(); + + /* + * U-Boot has been copied into SDRAM, the BSS has been cleared etc. + * Transfer execution from Flash to RAM by calculating the address + * of the in-RAM copy of board_init_r() and calling it + */ + (board_init_r + gd->reloc_off)(gd, gd->relocaddr); + + /* NOTREACHED - board_init_r() does not return */ + hang(); +} +#endif /* CONFIG_X86 */ + void hang(void) { puts("### ERROR ### Please RESET the board ###\n");

For x86 the global_data is managed entirely by the start.S code so we do not need to touch it. However, we do have some more initcalls to add.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Add new patch to adjust board_r.c for x86
Changes in v4: None Changes in v3: None Changes in v2: None
common/board_r.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/common/board_r.c b/common/board_r.c index 24d8a17..1a26a04 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -63,6 +63,9 @@ #include <asm/mmu.h> #endif #include <asm/sections.h> +#ifdef CONFIG_X86 +#include <asm/init_helpers.h> +#endif #include <linux/compiler.h>
DECLARE_GLOBAL_DATA_PTR; @@ -716,6 +719,9 @@ init_fnc_t init_sequence_r[] = { #ifdef CONFIG_CLOCKS set_cpu_clk_info, /* Setup clock information */ #endif +#ifdef CONFIG_X86 + init_bd_struct_r, +#endif initr_reloc_global_data, initr_serial, initr_announce, @@ -763,11 +769,16 @@ init_fnc_t init_sequence_r[] = { initr_flash, #endif INIT_FUNC_WATCHDOG_RESET -#ifdef CONFIG_PPC +#if defined(CONFIG_PPC) || defined(CONFIG_X86) /* initialize higher level parts of CPU like time base and timers */ cpu_init_r, +#endif +#ifdef CONFIG_PPC initr_spi, #endif +#if defined(CONFIG_X86) && defined(CONFIG_SPI) + init_func_spi, +#endif #ifdef CONFIG_CMD_NAND initr_nand, #endif @@ -821,10 +832,16 @@ init_fnc_t init_sequence_r[] = { #ifdef CONFIG_CMD_KGDB initr_kgdb, #endif +#ifdef CONFIG_X86 + board_early_init_r, +#endif interrupt_init, -#ifdef CONFIG_ARM +#if defined(CONFIG_ARM) || defined(CONFIG_x86) initr_enable_interrupts, #endif +#ifdef CONFIG_X86 + timer_init, /* initialize timer */ +#endif #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT) initr_status_led, #endif @@ -886,7 +903,9 @@ init_fnc_t init_sequence_r[] = {
void board_init_r(gd_t *new_gd, ulong dest_addr) { +#ifndef CONFIG_X86 gd = new_gd; +#endif if (initcall_run_list(init_sequence_r)) hang();

These are defined in asm-generic/sections.h, so remove them from architecture-specific files.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Include asm/sections.h in x86 sdram code - Define _end instead of __end for x86
Changes in v4: - Use asm/sections.h instead of asm-generic/sections.h
Changes in v3: - Add header to new x86 relocate.c and init_helpers.c
Changes in v2: None
arch/x86/cpu/coreboot/sdram.c | 1 + arch/x86/cpu/u-boot.lds | 4 +--- arch/x86/include/asm/u-boot-x86.h | 9 --------- arch/x86/lib/board.c | 1 + arch/x86/lib/init_helpers.c | 1 + arch/x86/lib/relocate.c | 1 + 6 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/arch/x86/cpu/coreboot/sdram.c b/arch/x86/cpu/coreboot/sdram.c index a8136a0..786009c 100644 --- a/arch/x86/cpu/coreboot/sdram.c +++ b/arch/x86/cpu/coreboot/sdram.c @@ -28,6 +28,7 @@ #include <asm/u-boot-x86.h> #include <asm/global_data.h> #include <asm/processor.h> +#include <asm/sections.h> #include <asm/arch/sysinfo.h> #include <asm/arch/tables.h>
diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds index 449ebfe..44b49ef 100644 --- a/arch/x86/cpu/u-boot.lds +++ b/arch/x86/cpu/u-boot.lds @@ -53,6 +53,7 @@ SECTIONS
. = ALIGN(4); __data_end = .; + __init_end = .;
. = ALIGN(4); .dynsym : { *(.dynsym*) } @@ -64,9 +65,6 @@ SECTIONS . = ALIGN(4); _end = .;
- . = ALIGN(4); - - __end = .; .bss __rel_dyn_start (OVERLAY) : { __bss_start = .; *(.bss) diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h index 3e380fe..ae0c388 100644 --- a/arch/x86/include/asm/u-boot-x86.h +++ b/arch/x86/include/asm/u-boot-x86.h @@ -24,15 +24,6 @@ #ifndef _U_BOOT_I386_H_ #define _U_BOOT_I386_H_ 1
-/* Exports from the Linker Script */ -extern char __text_start[]; -extern ulong __data_end; -extern ulong __rel_dyn_start; -extern ulong __rel_dyn_end; -extern char __bss_start[]; -extern ulong __bss_end; -extern char _end[]; - /* cpu/.../cpu.c */ int x86_cpu_init_r(void); int cpu_init_r(void); diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c index 555301a..452e5d8 100644 --- a/arch/x86/lib/board.c +++ b/arch/x86/lib/board.c @@ -38,6 +38,7 @@ #include <asm/u-boot-x86.h> #include <asm/relocate.h> #include <asm/processor.h> +#include <asm/sections.h>
#include <asm/init_helpers.h> #include <asm/init_wrappers.h> diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c index 7df9536..af9dbc1 100644 --- a/arch/x86/lib/init_helpers.c +++ b/arch/x86/lib/init_helpers.c @@ -32,6 +32,7 @@ #include <spi.h> #include <status_led.h> #include <asm/processor.h> +#include <asm/sections.h> #include <asm/u-boot-x86.h> #include <linux/compiler.h>
diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c index e893c2b..f178db9 100644 --- a/arch/x86/lib/relocate.c +++ b/arch/x86/lib/relocate.c @@ -36,6 +36,7 @@ #include <malloc.h> #include <asm/u-boot-x86.h> #include <asm/relocate.h> +#include <asm/sections.h> #include <elf.h>
int copy_uboot_to_ram(void)

This enables generic board support so that x86 boards can define CONFIG_SYS_GENERIC_BOARD.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: - Avoid setting up gd on x86 as it is already done
Changes in v4: None Changes in v3: None Changes in v2: None
arch/x86/config.mk | 3 --- arch/x86/include/asm/u-boot.h | 11 +++++++++++ arch/x86/lib/Makefile | 3 +++ common/board_r.c | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/arch/x86/config.mk b/arch/x86/config.mk index 7be3036..23cacff 100644 --- a/arch/x86/config.mk +++ b/arch/x86/config.mk @@ -48,6 +48,3 @@ NORMAL_LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) PREFIXED_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/$(shell basename $(NORMAL_LIBGCC))
export USE_PRIVATE_LIBGCC=$(shell dirname $(PREFIXED_LIBGCC)) - -# Move to unified board system later -CONFIG_SYS_LEGACY_BOARD := y diff --git a/arch/x86/include/asm/u-boot.h b/arch/x86/include/asm/u-boot.h index 2f45c7b..19c038a 100644 --- a/arch/x86/include/asm/u-boot.h +++ b/arch/x86/include/asm/u-boot.h @@ -39,6 +39,13 @@ #include <config.h> #include <compiler.h>
+#ifdef CONFIG_SYS_GENERIC_BOARD +/* Use the generic board which requires a unified bd_info */ +#include <asm-generic/u-boot.h> +#else + +#ifndef __ASSEMBLY__ + typedef struct bd_info { unsigned long bi_memstart; /* start of DRAM memory */ phys_size_t bi_memsize; /* size of DRAM memory in bytes */ @@ -60,6 +67,10 @@ typedef struct bd_info { }bi_dram[CONFIG_NR_DRAM_BANKS]; } bd_t;
+#endif /* __ASSEMBLY__ */ + +#endif /* nCONFIG_SYS_GENERIC_BOARD */ + /* For image.h:image_check_target_arch() */ #define IH_ARCH_DEFAULT IH_ARCH_I386
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index 0a52cc8..3d069c6 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile @@ -35,7 +35,10 @@ COBJS-$(CONFIG_SYS_PC_BIOS) += bios_setup.o COBJS-$(CONFIG_VIDEO_VGA) += video_bios.o endif
+ifeq ($(CONFIG_SYS_GENERIC_BOARD),) COBJS-y += board.o +endif + COBJS-y += bootm.o COBJS-y += cmd_boot.o COBJS-y += gcc.o diff --git a/common/board_r.c b/common/board_r.c index 1a26a04..b2decae 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -509,11 +509,13 @@ static int show_model_r(void) #endif
/* enable exceptions */ +#ifdef CONFIG_ARM static int initr_enable_interrupts(void) { enable_interrupts(); return 0; } +#endif
#ifdef CONFIG_CMD_NET static int initr_ethaddr(void)

Enable CONFIG_SYS_GENERIC_BOARD for Tegra 2 Seaboard.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v5: None Changes in v4: - Rebase to master - Drop sc520_timer.c patch (warning already fixed by previous patch)
Changes in v3: - Rebase to master - Rebase on top of x86/master (which has not yet been pulled to master)
Changes in v2: - Change generic board to an opt-in system on a per-board basic - Add CONFIG_SYS_GENERIC_BOARD to allow board to select generic board - Add PowerPC support - Rebase to master
include/configs/seaboard.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h index de0c777..0d2a318 100644 --- a/include/configs/seaboard.h +++ b/include/configs/seaboard.h @@ -40,6 +40,8 @@ #define CONFIG_OF_CONTROL #define CONFIG_OF_SEPARATE
+#define CONFIG_SYS_GENERIC_BOARD + /* High-level configuration options */ #define V_PROMPT "Tegra20 (SeaBoard) # " #define CONFIG_TEGRA_BOARD_STRING "NVIDIA Seaboard"

On 02/08/2013 08:12 AM, Simon Glass wrote:
Enable CONFIG_SYS_GENERIC_BOARD for Tegra 2 Seaboard.
Shouldn't this be enabled for Tegra generically, rather than for just one Tegra board? I haven't looked at the rest of the series yet, but it sure seems better if all Tegra boards always work the same way.

Hi Stephen
On Fri, Feb 8, 2013 at 9:23 AM, Stephen Warren swarren@wwwdotorg.org wrote:
On 02/08/2013 08:12 AM, Simon Glass wrote:
Enable CONFIG_SYS_GENERIC_BOARD for Tegra 2 Seaboard.
Shouldn't this be enabled for Tegra generically, rather than for just one Tegra board? I haven't looked at the rest of the series yet, but it sure seems better if all Tegra boards always work the same way.
Yes but I can only test on that board. I suspect it should be OK with others but I've taken a fairly conservative approach as I don't want to break things.
If you have a board about, please try putting it in tegra-common.h or similar and see what happens.
BTW it would be nice to have a tegra20-dt.h config. Then I would just test that one board and know that other changes can only be FDT-related. But I think due to pinmux that isn't possible right now, as previously discussed.
Regards, Simon

On 02/08/2013 11:10 AM, Simon Glass wrote:
Hi Stephen
On Fri, Feb 8, 2013 at 9:23 AM, Stephen Warren swarren@wwwdotorg.org wrote:
On 02/08/2013 08:12 AM, Simon Glass wrote:
Enable CONFIG_SYS_GENERIC_BOARD for Tegra 2 Seaboard.
Shouldn't this be enabled for Tegra generically, rather than for just one Tegra board? I haven't looked at the rest of the series yet, but it sure seems better if all Tegra boards always work the same way.
Yes but I can only test on that board. I suspect it should be OK with others but I've taken a fairly conservative approach as I don't want to break things.
If you have a board about, please try putting it in tegra-common.h or similar and see what happens.
This is something Tom should drive.
BTW it would be nice to have a tegra20-dt.h config. Then I would just test that one board and know that other changes can only be FDT-related. But I think due to pinmux that isn't possible right now, as previously discussed.
Well, there are quite a few peripherals which are only initialized/instantiated from board files too, so a generic DT config wouldn't be very useful yet, although Tom and Allen are in the process of converting things as they add Tegra114 support.
participants (6)
-
Andy Fleming
-
Otavio Salvador
-
Scott Wood
-
Simon Glass
-
Stephen Warren
-
Tom Rini