summaryrefslogtreecommitdiff
path: root/arch/arm/lib
AgeCommit message (Collapse)Author
2013-03-18Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini
Albert's rework of the linker scripts conflicted with Simon's making everyone use __bss_end. We also had a minor conflict over README.scrapyard being added to in mainline and enhanced in u-boot-arm/master with proper formatting. Conflicts: arch/arm/cpu/ixp/u-boot.lds arch/arm/cpu/u-boot.lds arch/arm/lib/Makefile board/actux1/u-boot.lds board/actux2/u-boot.lds board/actux3/u-boot.lds board/dvlhost/u-boot.lds board/freescale/mx31ads/u-boot.lds doc/README.scrapyard include/configs/tegra-common.h Build tested for all of ARM and run-time tested on am335x_evm. Signed-off-by: Tom Rini <trini@ti.com>
2013-03-15arm: Enable generic board supportSimon Glass
This enables generic board support so that ARM boards can define CONFIG_SYS_GENERIC_BOARD. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-15arm: Use sections header to obtain link symbolsSimon Glass
Include this header to get access to link symbols, which are otherwise removed. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-15Replace __bss_end__ with __bss_endSimon Glass
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>
2013-03-12arm: make __bss_start and __bss_end__ compiler-generatedAlbert ARIBAUD
Turn __bss_start and __bss_end__ from linker-generated to compiler-generated symbols, causing relocations for these symbols to change type, from R_ARM_ABS32 to R_ARM_RELATIVE. This should have no functional impact, as it affects references to __bss_start and __bss_end__ only before relocation, and no such references are done. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2013-02-07treewide: include libfdt_env.h before fdt.hKim Phillips
and, if including libfdt.h which includes libfdt_env.h in the correct order, don't include fdt.h before libfdt.h. this is needed to get the fdt type definitions set from the project environment before fdt.h uses them. Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Cc: Jerry Van Baren <gvb.uboot@gmail.com>
2013-02-01arm: Move tlb_addr and tlb_size to arch_global_dataSimon Glass
Move these fields into arch_global_data and tidy up. Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Address tlb_size in this patch as well] Signed-off-by: Tom Rini <trini@ti.com>
2013-01-30arm: fix CONFIG_DELAY_ENVIRONMENT to act like it claims in the READMELucas Stach
No one expects to end up in a delayed environment if CONFIG_DELAY_ENVIRONMENT isn't defined. Signed-off-by: Lucas Stach <dev@lynxeye.de> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Allen Martin <amartin@nvidia.com>
2013-01-10arm: Tabify code for MMC initializationTaylor Hutt
The two modified lines were indented with spaces. They are now indented with tabs. Signed-off-by: Taylor Hutt <thutt@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2013-01-10arm: Move bootstage record for board_init_f() to after arch_cpu_init()Simon Glass
The timer may be inited in arch_cpu_init() so it is not safe to make a bootstage mark before this is called. Arrange the code to fix this. Note: The question was raised as to why we don't keep all archs in sync. PowerPC doesn't have specific bootstage markers at present (although it does use boot progress). I hope that the generic board series will solve this problem in general, but in the meantime this is a real problem, and only in ARM. We now get a correct time for board_init_f: Timer summary in microseconds: Mark Elapsed Stage 0 0 reset 100,000 100,000 spl_start 848,530 748,530 board_init_f 907,301 58,771 board_init_r 910,478 3,177 board_init Signed-off-by: Simon Glass <sjg@chromium.org>
2013-01-10arm: Make interrupts.o and reset.o in libarm also appear in SPLTom Wai-Hong Tam
SPL u-boot may call do_reset() which depends on interrupts.o and reset.o. So make them also appear in SPL. Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2013-01-10arm: Add CONFIG_DISPLAY_BOARDINFO_LATE to display board info on LCDSimon Glass
This option displays board info after stdio is running, so that it will appear on the LCD. If it is displayed earlier, the board info will appear on the serial console but not on the LCD. Here follows a blow-by-blow description. 1a. Without CONFIG_DISPLAY_BOARDINFO_LATE, on serial: U-Boot 2011.12-02550-g037e1c5-dirty (Nov 15 2012 - 14:29:42) for SMDK5250 CPU: S5PC520 @ 1700MHz Board: Google Snow, rev 0 I2C: ready DRAM: 2 GiB Elpida DDR3 @ 800MHz MMC: S5P MSHC0: 0, S5P MSHC1: 1 SF: Detected W25Q32 with page size 4 KiB, total 4 MiB *** Warning - bad CRC, using default environment In: mkbp-keyb Out: lcd Err: lcd Net: No ethernet found. Hit any key to stop autoboot: 0 SMDK5250 # 1b. Without CONFIG_DISPLAY_BOARDINFO_LATE, on LCD (note machine info is missing): In: mkbp-keyb Out: lcd Err: lcd Net: No ethernet found. Hit any key to stop autoboot: 0 SMDK5250 # 2a. With CONFIG_DISPLAY_BOARDINFO_LATE, on serial: U-Boot 2011.12-02550-g037e1c5 (Nov 15 2012 - 14:27:40) for SMDK5250 CPU: S5PC520 @ 1700MHz I2C: ready DRAM: 2 GiB Elpida DDR3 @ 800MHz MMC: S5P MSHC0: 0, S5P MSHC1: 1 SF: Detected W25Q32 with page size 4 KiB, total 4 MiB *** Warning - bad CRC, using default environment Model: Google Snow In: mkbp-keyb Out: lcd Err: lcd Net: No ethernet found. Hit any key to stop autoboot: 0 SMDK5250 # 2b. With CONFIG_DISPLAY_BOARDINFO_LATE, on LCD (note machine info is present): Model: Google Snow In: mkbp-keyb Out: lcd Err: lcd Net: No ethernet found. Hit any key to stop autoboot: 0 SMDK5250 # Since the LCD is all that a typical user sees, it is useful to display the model there. We may be able to rearrange things some other way one day, but at present this seems like a convenient way of getting the required behaviour. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-01-10arm: Add CONFIG_DELAY_ENVIRONMENT to delay environment loadingSimon Glass
This option delays loading of the environment until later, so that only the default environment will be available to U-Boot. This can address the security risk of untrusted data being used during boot. Any time you load untrusted data you expose yourself to a bug in the code. The attacker gets to choose the data so can sometimes carefully craft it to exploit a bug. We try to avoid touching user-controlled data during a verified boot unless strictly necessary. Since the default environment is good enough in this case (or you would just change it), this gets around the problem by just not loading the environment. When CONFIG_DELAY_ENVIRONMENT is defined, it is convenient to have a run-time way of enabling loading of the environment. Add this to the fdt as /config/delay-environment. Note: This patch depends on http://patchwork.ozlabs.org/patch/194342/ Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Doug Anderson <dianders@chromium.org>
2013-01-10arm: Move fdt check earlier so that board_early_init_f() can use itSimon Glass
We want to use the fdt inside board_early_init_f(), so check for its presence earlier in the pre-reloc init sequence. So far ARM and microblaze are the only only ones that use CONFIG_OF_CONTROL. Microblaze does not have the same init loop, and in particular does not have the board_early_init_f() call. So a patch for microblaze would have no meaning. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-01-10arm: Keep track of the tlb size as well as its locationGabe Black
It may be necessary to know where the TLB area ends as well as where it starts. This allows board code to complete a secure memory erase without destroying the page tables. Signed-off-by: Gabe Black <gabeblack@google.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2013-01-10arm: move flush_dcache_all() to just before disable cacheArun Mankuzhi
In Cortex-A15 architecture, when we run cache invalidate the cache clean operation executes automatically. So if there are any dirty cache lines before disabling the L2 cache these will be synchronized with the main memory when invalidate_dcache_all() runs in the last part of U-boot The two functions after flush_dcache_all is using the stack. So this data will be on the cache. After disable when invalidate is called the data will be flushed from cache to memory. This corrupts the stack in invalida_dcache_all. So this change is required to avoid the u-boot hang. So flush has to be done just before clearing CR_C bit Signed-off-by: Arun Mankuzhi <arun.m@samsung.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2013-01-08arm: move C runtime setup code in crt0.SAlbert ARIBAUD
Move all the C runtime setup code from every start.S in arch/arm into arch/arm/lib/crt0.S. This covers the code sequence from setting up the initial stack to calling into board_init_r(). Also, rewrite the C runtime setup and make functions board_init_*() and relocate_code() behave according to normal C semantics (no jumping across the C stack any more, etc). Some SPL targets had to be touched because they use start.S explicitly or for some reason; the relevant maintainers and custodians are cc:ed. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2012-12-19Merge remote-tracking branch 'u-boot/master' into u-boot-arm-mergedAllen Martin
Conflicts: README arch/arm/cpu/armv7/exynos/clock.c board/samsung/universal_c210/universal.c drivers/misc/Makefile drivers/power/power_fsl.c include/configs/mx35pdk.h include/configs/mx53loco.h include/configs/seaboard.h
2012-12-13env: Use getenv_yesno() more generallyJoe Hershberger
Move the getenv_yesno() to env_common.c and change most checks for 'y' or 'n' to use this helper. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-11-19arm: Add control over cachability of memory regionsSimon Glass
Add support for adjusting the L1 cache behavior by updating the MMU configuration. The mmu_set_region_dcache_behaviour() function allows drivers to make these changes after the MMU is set up. It is implemented only for ARMv7 at present. This is needed for LCD support, where we want to make the LCD frame buffer write-through (or off) rather than write-back. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-11-14pmic: Introduce power_init_board() method at ./lib/board.c fileŁukasz Majewski
It is necessary to introduce a new system wide function- power_init_board() It turns out, that power initialization must be done as early as possible. In the case of PMIC framework redesign, which aims to support multiple instances of PMIC devices the initialization shall be performed just after malloc configuration. The power_init_board function is a weak function with default implementation. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-11-03Merge remote-tracking branch 'u-boot-ti/master'Albert ARIBAUD
2012-10-30arm bootm: Allow to pass board specified atagsPali Rohár
Board can implement function setup_board_tags which is used for adding atags Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
2012-10-22ARM : Remove unused CONFIG_DRIVER_SMC91111, CONFIG_DRIVER_LAN91C96Ashok
Remove unused CONFIG_DRIVER_SMC91111,CONFIG_DRIVER_LAN91C96, if required implement smc_set_mac_addr() in board init. Signed-off-by: Ashok Kumar Reddy <ashokkourla2000@gmail.com> Acked-by: Tom Rini <trini@ti.com>
2012-10-19arm: fdt: Relocate fdt along with other dataSimon Glass
Rather than leave the fdt down next to the code/data, we really should relocate it along with everything else. For CONFIG_OF_EMBED this happens automatically, but for CONFIG_OF_SEPARATE it does not. Add code to copy the fdt and point to the new copy after relocation. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com>
2012-10-15Merge branch 'agust@denx.de-next' of git://git.denx.de/u-boot-stagingTom Rini
2012-10-15serial: Remove CONFIG_SERIAL_MULTI from remaining sourcesMarek Vasut
Remove the parts depending either on disabled CONFIG_SERIAL_MULTI or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI is now enabled by default. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Tom Rini <trini@ti.com> Cc: Anatolij Gustschin <agust@denx.de> Cc: Stefan Roese <sr@denx.de>
2012-10-15ARM: prevent misaligned array initsAlbert ARIBAUD
Under option -munaligned-access, gcc can perform local char or 16-bit array initializations using misaligned native accesses which will throw a data abort exception. Fix files where these array initializations were unneeded, and for files known to contain such initializations, enforce gcc option -mno-unaligned-access. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> [trini: Switch to usign call cc-option for -mno-unaligned-access as Albert had done previously as that's really correct] Signed-off-by: Tom Rini <trini@ti.com>
2012-10-04arm: Add CONFIG_OF_BOARD_SETUP support to bootmJoe Hershberger
ARM boards need to change device tree settings as well Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-04ARM: increase lmb stack space reservation to 4KBRob Herring
The bootm initrd image copy to ram can collide with the stack in cases where the print buffer size is large (i.e. 1K). The result is intermittent initrd decompression errors depending on the initrd size MOD 4KB since the initrd start address is 4KB aligned. Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-10-02bootstage: Store boot timings in device treeSimon Glass
Add an option, CONFIG_BOOTSTAGE_FDT to pass boot timings to the kernel in the device tree, if available. To use this, you must have CONFIG_OF_LIBFDT defined. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-09-27SPL: Create arch/arm/lib/spl.c for board_init_f and jump_to_image_linuxTom Rini
In SPL (CONFIG_SPL_FRAMEWORK) board_init_f must setup the stack pointer, clear the BSS and call board_init_r. We mark this as weak as some platforms may need to perform additional initalization at this point. We provide a gd that we know will be in a usable location, once the BSS has been cleared to help with this as well. Finally, we no longer call relocate_code so remove that from the armv7 version. Next, both board_init_f and jump_to_image_linux are going to be inherently arch-specific, so move these versions to arch/arm/lib/spl.c Signed-off-by: Tom Rini <trini@ti.com>
2012-09-04arm: Adds board_postclk_init to the init_sequence.Markus Hubig
The board_postclk_init() function can be used to perform operations that requires a working timer early within the U-Boot init_sequence. Signed-off-by: Markus Hubig <mhubig@imko.de> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2012-09-01arm: enable libgcc build for SPLAllen Martin
Enable the building of private libgcc for SPL Signed-off-by: Allen Martin <amartin@nvidia.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Tested-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-07-20ARM: lib: Remove CONFIG_ARCH_CPU_INIT dependencyFabio Estevam
Create a weak-aliased arch_cpu_init, so that we can get rid of CONFIG_ARCH_CPU_INIT and always call arch_cpu_init. This way we do not need to define CONFIG_ARCH_CPU_INIT in every board file, since arch_cpu_init() is supposed to handle common CPU level code. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Stefano Babic <sbabic@denx.de>
2012-07-07ARM: cache: Move the cp15 CR register read before flushing the cache.SRICHARAN R
The following is the cleanup sequence in arch/arm/cpu/armv7/cpu.c int cleanup_before_linux(void) { ... ... dcache_disable(); v7_outer_cache_disable(); invalidate_dcache_all(); } 1) invalidate_dcache_all call expects that all the caches has been flushed, invalidated and there are no dirty entries prior to its execution. In the above sequence dcache_disable() flushes, invalidates the caches and turns off the mmu. But after it cleanups the cache and before the mmu is disabled there is a cp_delay() function which has STR instruction. On certain cores like the cortex-a15, cache hit and a write can happen to a cache line even when the dcache is disabled. So the above mentioned STR instruction creates a dirty entry after cleaning. The mmu gets disabled after this. 2) invalidate_dcache_all invalidates the cache lines. Again on cores like cortex-a15, invalidate instruction flushes the dirty line as well. So some times the dirty line from sequence 1 can corrupt the memory resulting in a crash. Fixing this by moving the get_cr() and cp_delay() calls before cleaning up the cache, thus avoiding the dirty entry. Signed-off-by: R Sricharan <r.sricharan@ti.com>
2012-07-07ARM: introduce arch_early_init_r()Fabio Estevam
Introduce arch_early_init_r() function, which can be useful for doing early initialization after relocation has happened. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2012-07-07arm: Don't use printf() in SPL buildsSimon Glass
raise() likes to call printf() if it is available, but in SPL builds it either is not available, or adds a large chunk to the resulting image size. So don't call it even if it is available. This change reduces SPL size from 10KB to 6.3KB on hawkboard, for example, using generic relocation. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Stefan Roese <sr@denx.de>
2012-05-15net: move bootfile init into eth_initializeMike Frysinger
All arches init this the same way, so move the logic into the core net code to avoid duplicating it everywhere else. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
2012-05-15net: punt bd->bi_ip_addrMike Frysinger
This field gets read in one place (by "bdinfo"), and we can replace that with getenv("ipaddr"). After all, the bi_ip_addr field is kept up-to-date implicitly with the value of the ipaddr env var. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
2012-04-23arm: restore fdt_fixup_ethernet call to do_bootm_linuxStephen Warren
Commit 0a672d4 "arm: Add Prep subcommand support to bootm" re-organized do_bootm_linux for ARM. During the re-organization, the call to fdt_fixup_ethernet() was removed. I assume this was useful, so add it back. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Tom Rini <trini@ti.com>
2012-04-23arm: fix bootm with device treeStephen Warren
Commit 0a672d4 "arm: Add Prep subcommand support to bootm" re-organized do_bootm_linux() for ARM. During the re-organization, the code to pass the device tree to the kernel was removed. Add it back. This restores the ability to boot a kernel using device tree. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Tom Rini <trini@ti.com> Acked-by: Allen Martin <amartin@nvidia.com> Tested-by: Allen Martin <amartin@nvidia.com>
2012-03-30BOOT: Add "bootz" command to boot Linux zImage on ARMMarek Vasut
This command boots Linux zImage from where the zImage is loaded to. Passing initrd and fdt is supported. Tested on i.MX28 based DENX M28EVK Tested on PXA270 based Voipac PXA270. NOTE: This currently only supports ARM, but other architectures can be easily added by defining bootz_setup(). Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Tom Warren <TWarren@nvidia.com> Cc: albert.u.boot@aribaud.net Cc: afleming@gmail.com, Cc: Simon Glass <sjg@chromium.org>, Cc: Stephen Warren <swarren@nvidia.com> Cc: Nicolas Pitre <nico@fluxnic.net> Cc: Wolfgang Denk <wd@denx.de> Cc: Detlev Zundel <dzu@denx.de>
2012-03-29arm: Check for valid FDT after console is upSimon Glass
When using CONFIG_OF_CONTROL, add a check that we have a valid FDT and panic() if not. This must be done after the console is ready. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-03-27arm: Add Prep subcommand support to bootmSimon Schwarz
Adds prep subcommand to bootm implementation of ARM. When bootm is called with the subcommand prep the function stops right after ATAGS creation and before announce_and_cleanup. This is used in command "cmd_spl export" Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com> Acked-by: Stefano Babic <sbabic@denx.de> Tested-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
2012-03-27Add cache functions to SPL for armv7Stefano Babic
Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Tom Rini <tom.rini@gmail.com> CC: Wolfgang Denk <wd@denx.de> CC: Simon Schwarz <simonschwarzcor@gmail.com>
2012-03-18bootstage: arm: Add bootstage calls in board and bootmSimon Glass
Add calls to bootstage before and after relocation, and just before jumping to the OS. The idea here is you can call bootstage_report() to get a report. Additionally, if you define CONFIG_BOOTSTAGE_REPORT then a report is printed automatically by U-Boot just before jumping to the kernel. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-18bootstage: Replace show_boot_progress/error() with bootstage_...()Simon Glass
These calls should not be made directly any more, since bootstage will call the show_boot_...() functions as needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-18bootstage: Make use of BOOTSTAGE_ID_RUN_OS in show_boot_progress()Simon Glass
This changes the number 15 as used in boot_stage_progress() to use the new name provided for it. This is a separate patch because it touches so many files. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-02-12davinci: add support for printing clock frequencyHadli, Manjunath
add support for printing various clock frequency info found in SOC such as ARM core frequency, DSP core frequency and DDR frequency as part of bdinfo command. Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com> Cc: Tom Rini <trini@ti.com>