summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/lib
Commit message (Collapse)AuthorAgeFilesLines
...
| * powerpc/mpc8xxx: use topology registers to calculate number of coresYork Sun2012-08-231-0/+13
| | | | | | | | | | | | | | | | | | We have actual topology infomation to find out exactly which core is present. Calculate the number of cores if not specified. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: York Sun <yorksun@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
| * powerpc: Stack Pointer not properly alignedJoakim Tjernlund2012-08-221-3/+2
| | | | | | | | | | | | | | | | | | The code first aligns the SP to 16 then subtract 8, making it 8 bytes aligned. Furthermore the initial stack frame not quite correct either. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Signed-off-by: Andy Fleming <afleming@freescale.com>
* | ppc: Create a stack frame for wait_ticks()Joakim Tjernlund2012-09-021-2/+5
| | | | | | | | | | | | | | | | wait_ticks() calls get_ticks() without building a back chain which makes gdb unhappy when doing back trace. This can also cause improper memory accesses. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
* | Consolidate bootcount code into drivers/bootcountStefan Roese2012-09-012-98/+0
|/ | | | | | | | | | | | | | | | | | | This patch moves all bootcount implementations into a common directory: drivers/bootcount. The generic bootcount driver is now usable not only by powerpc platforms, but others as well. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Heiko Schocher <hs@denx.de> Cc: Valentin Longchamp <valentin.longchamp@keymile.com> Cc: Christian Riesch <christian.riesch@omicron.at> Cc: Manfred Rudigier <manfred.rudigier@omicron.at> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Reinhard Meyer <reinhard.meyer@emk-elektronik.de> Tested-by: Valentin Longchamp <valentin.longchamp@keymile.com> Tested-by: Christian Riesch <christian.riesch@omicron.at> Acked-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
* net: move bootfile init into eth_initializeMike Frysinger2012-05-151-8/+0
| | | | | | | | 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>
* net: punt bd->bi_ip_addrMike Frysinger2012-05-151-3/+0
| | | | | | | | | 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>
* bootstage: Replace show_boot_progress/error() with bootstage_...()Simon Glass2012-03-182-2/+2
| | | | | | | 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>
* bootstage: Convert progress numbers 20-41 to enumsSimon Glass2012-03-181-1/+1
| | | | Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstage: Use show_boot_error() for -ve progress numbersSimon Glass2012-03-181-1/+1
| | | | | | | | Rather than the caller negating our progress numbers to indicate an error has occurred, which seems hacky, add a function to indicate this. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* bootstage: Make use of BOOTSTAGE_ID_RUN_OS in show_boot_progress()Simon Glass2012-03-181-1/+1
| | | | | | | | | 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>
* ppc: Change memsz variable to signed charSimon Glass2012-03-031-4/+3
| | | | | | | | This seems to be unsigned char for no good reason. Tidy this up and remove the casts. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* powerpc/bootm: Flush ramdisk and device tree image when booting on MPKumar Gala2011-12-121-6/+16
| | | | | | | | | | | | | We already flush the kernel image after we've loaded it to ensure visiblity to the other cores. We need to do the same thing for the ramdisk and device tree images. In AMP boot scenarios we might not be HW cache coherent with the secondary core that we are loading and setting the ramdisk and device tree up for. Thus we need to ensure we've flushed the regions of memory utilized by ramdisk and device tree so the loadding and any modifications (from decompression or fdt updates) are made visible to the secondary cores. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* powerpc: Minimal private libgcc to build on DebianKyle Moffett2011-12-074-1/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Standard Debian powerpc and powerpcspe systems only include hard-float libgcc in their native compilers, which causes scary build warnings when building U-Boot. Debian and other PowerPC-supporting distributions used to provide libgcc and other libraries in a "nof" (soft-float) form in the "multilib" packages. As they were completely unused by the distribution and therefore tended to be very buggy it was decided to save some time on the part of the maintainers and build-servers by removing them. Admittedly, right now the linker warnings do not indicate any problems, as the included routines do not use any floating point at all. The concern is that if floating-point code were ever added it might cause hard-float code to be unexpectedly included in U-Boot without generating a hard error. This would cause unexplained crashes or indeterminate results at runtime. The easiest way to resolve this is to borrow the routines that U-Boot needs from the Linux kernel, which has the same issue. Specifically, the routines are: _ashldi3(), _ashrdi3(), and _lshrdi3(). They were borrowed from arch/powerpc/kernel/misc_32.S as of v2.6.38-rc5, commit 85e2efbb1db9a18d218006706d6e4fbeb0216213, and are GPLv2+. The Makefile framework was copied from the U-Boot ARM port. Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Kim Phillips <kim.phillips@freescale.com> Cc: Andy Fleming <afleming@gmail.com> Cc: Kumar Gala <kumar.gala@freescale.com> Cc: Stefan Roese <sr@denx.de>
* arch/powerpc/lib/bat_rw.c: Fix GCC 4.6 build warningWolfgang Denk2011-11-071-1/+2
| | | | | | | | | | | Fix: bat_rw.c: In function 'write_bat': bat_rw.c:38:6: warning: variable 'batn' set but not used [-Wunused-but-set-variable] Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: Andy Fleming <afleming@gmail.com>
* arch/powerpc/lib/board.c: fix build warningWolfgang Denk2011-11-071-3/+0
| | | | | | | | Fix: board.c: In function 'board_init_r': board.c:633:8: warning: unused variable 's' [-Wunused-variable] Signed-off-by: Wolfgang Denk <wd@denx.de>
* arch/powerpc/lib/board.c: make (mostly) checkpatch-cleanWolfgang Denk2011-11-071-221/+234
| | | | | | | | | | | | | | | | | | CodingStyle cleanup. Accepted (in this cleanup) checkpatch messages: - externs should be avoided (to be cleaned up later) - no spaces at the start of a line (accepted in multi-line #if's) - Macros with complex values (false reports) - do not use assignment in if condition (accepted in one place, where avoiding it would have required an additional level of nesting, resulting in less readable code) Signed-off-by: Wolfgang Denk <wd@denx.de>
* arch/powerpc/lib/board.c: fix build warningWolfgang Denk2011-11-031-1/+3
| | | | | | | | | | | | | | Commit 1272592 "powerpc: Use getenv_ulong() in place of getenv(), strtoul" instroduced a build warning for some PPC systems: board.c: In function 'board_init_r': board.c:626: warning: unused variable 's' Fix it. Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
* powerpc: Correct build warning introduced by getenv_ulong() patchSimon Glass2011-10-241-3/+7
| | | | | | | Commit 1272592 introduced a warning since the variable 's' is no longer always used, depending on the CONFIG options. Signed-off-by: Simon Glass <sjg@chromium.org>
* powerpc/lib/board.c: Call run_post(POST_ROM) before relocatingBernhard Kaindl2011-10-231-7/+7
| | | | | | | | | | | | | | | | | | | The call to run_post(POST_ROM) which can run the POST memory test is currently called too late when gd has already been copied to DRAM. This results in failure to boot Linux after a POST_ROM memory test tested all RAM while gd was already relocated to DRAM due to gd being overwritten by the POST_ROM memory test. Support this by moving the call to run_post(POST_ROM) to run earlier, before U-Boot has started to move data to DRAM (from late board_init_f to early board_init_f) where DRAM is initialized, but not used yet. This allows that an POST memory test can test the whole DRAM, including the area where the board info struct is located. Signed-off-by: Bernhard Kaindl <bernhard.kaindl@thalesgroup.com> Cc: Pieter Voorthuijsen <pieter.voorthuijsen@prodrive.nl>
* powerpc: Use getenv_ulong() in place of getenv(), strtoulSimon Glass2011-10-231-25/+8
| | | | | | | This changes the board code to use the new getenv_ulong() function. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Stefan Roese <sr@denx.de>
* net: drop !NET_MULTI codeMike Frysinger2011-10-051-2/+0
| | | | | | | | | | | This is long over due. All but two net drivers have been converted, but those have now been dropped. The only thing left to do is actually delete all references to NET_MULTI and code that is compiled when that is not defined. So here we scrub the core code. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Flush cache after the OS image is loaded into the memory.Diana CRACIUN2011-09-051-14/+6
| | | | | | | | | | | | | | | | Since we are loading an executable image into memory we need flush it out of the cache to possible maintain coherence on CPUs with split instruction and data caches. We do this for other executable image loading command. On PowerPC once we do this we no longer need to explicitly flush the dcache on multi-core systems in the BOOTM_STATE_OS_PREP phase. We now treat the BOOTM_STATE_OS_PREP as a no-op to maintain backwards compatibility with the bootm subcommand. Signed-off-by: James Yang <James.Yang@freescale.com> Signed-off-by: Diana CRACIUN <Diana.Craciun@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* hwmon: do not init sensors on startupHeiko Schocher2011-08-041-3/+0
| | | | | | | | | | | | | | | | | The U-Boot Design Principles[1] clearly say: Initialize devices only when they are needed within U-Boot, i.e. don't initialize the Ethernet interface(s) unless U-Boot performs a download over Ethernet; don't initialize any IDE or USB devices unless U-Boot actually tries to load files from these, etc. (and don't forget to shut down these devices after using them - otherwise nasty things may happen when you try to boot your OS). So, do not initialize and read the sensors on startup. Signed-off-by: Heiko Schocher <hs@denx.de> cc: Wolfgang Denk <wd@denx.de> cc: Holger Brunck <holger.brunck@keymile.com>
* powerpc/85xx: verify the device tree before booting LinuxTimur Tabi2011-07-291-0/+21
| | | | | | | | | | | | | | | Introduce ft_verify_fdt(), a function that is called after the device tree has been fixed up, that displays warning messages if there is a mismatch between the physical addresses of some devices that U-Boot has configured with what the device tree says the addresses are. This is a particular problem when booting a 36-bit device tree from a 32-bit U-Boot (or vice versa), because the physical address of CCSR is wrong in the device tree. When the operating system boots, no messages are displayed, so the user generally has no idea what's wrong. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* powerpc/85xx: Fix setting of EPAPR_MAGIC valueKumar Gala2011-07-291-1/+1
| | | | | | | | Had a typo in the ifdef for 85xx, should be CONFIG_MPC85xx for it to get triggered. Was pull in the non-BookE magic number. Reported-by: John Cortell Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* Timer: Remove reset_timer() for non-Nios2 archesGraeme Russ2011-07-261-5/+0
|
* Timer: Remove set_timer completelyGraeme Russ2011-07-262-7/+0
|
* powerpc: Fix device tree padding associated with ramdiskKumar Gala2011-07-261-1/+3
| | | | | | | | | | | | | | | | | When booting with a ramdisk we bump the amount of memory reserved for the device tree by FDT_RAMDISK_OVERHEAD. However we did not increase the actual size in the device tree blob to match. Its possible on boundary cases that we dont have enough memory according to the device tree blob and get errors like: WARNING: could not set linux,initrd-end FDT_ERR_NOSPACE We can easily fix this by setting the device tree size at the same time we bump the amount of memory reserved for the device tree. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Gerald Van Baren <vanbaren@cideas.com>
* mpc832x: add support for the mpc8321 based suvd3 boardHeiko Schocher2011-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | - serial console on UART1 - Ethernet RMII over UCC4 - PHY SMSC LAN8700 - 64MB Flash - 128 MB DDR2 RAM - I2C - bootcount This board is similiar to the kmeter1 (8360) board, so common config options are extracted into the include/configs/km83xx-common.h file. Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Kim Phillips <kim.phillips@freescale.com> cc: Kim Phillips <kim.phillips@freescale.com> cc: Holger Brunck <holger.brunck@keymile.com> cc: Valentin Longchamp <valentin.longchamp@keymile.com>
* Merge branch 'master' of git://git.denx.de/u-boot-armWolfgang Denk2011-04-271-0/+4
|\
| * Don't grab memory for LCD if FB address is definedMinkyu Kang2011-04-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | If FB address is defined specific address then don't grab memory for LCD Signed-off-by: Minkyu Kang <mk7.kang@samsung.com> Cc: Albert Aribaud <albert.aribaud@free.fr> Cc: Wolfgang Denk <wd@denx.de> Cc: Stefan Roese <sr@denx.de> Cc: Kim Phillips <kim.phillips@freescale.com> Cc: Andy Fleming <afleming@gmail.com> Cc: Kumar Gala <kumar.gala@freescale.com>
* | Respect memreserve regions specified in the device treeGrant Likely2011-04-251-0/+4
| | | | | | | | | | | | | | | | If a regions is reserved in the fdt, then it should not be used. Add the memreserve regions to the lmb so that u-boot doesn't use them to store the initrd. Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | Remove device tree booting dependency on CONFIG_SYS_BOOTMAPSZGrant Likely2011-04-251-2/+2
| | | | | | | | | | | | | | | | | | The previous patch makes u-boot use the full accessible size of ram as the default boot mapped size if CONFIG_SYS_BOOTMAPSZ is not defined, which means boot_relocate_fdt() can be changed to depend solely on CONFIG_OF_LIBFDT. Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | Default to bootm_size() when CONFIG_SYS_BOOTMAPSZ is not definedGrant Likely2011-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a function getenv_bootm_mapsize() for obtaining the size of the early mapped region accessible by the kernel during early boot. It defaults to CONFIG_SYS_BOOTMAPSZ, or if not defined, defaults to getenv_bootm_size(), which in turn defaults to the size of RAM. getenv_bootm_mapsize() can also be overridden with a "bootm_mapsize" environmental variable. Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | Stop passing around bootmem_base value.Grant Likely2011-04-251-6/+3
|/ | | | | | | | | | For the calls to boot_relocate_fdt(), boot_get_cmdline(), and boot_get_kbd(), the value of bootmem_base is always obtained by calling getenv_bootm_low(). Since the value always comes from the same source, the calling signature for those functions can be simplified by making them call getenv_bootm_low() directly. Signed-off-by: Grant Likely <grant.likely@linaro.org>
* powerpc: Add cpu_secondary_init_r to allow for initialization post env setupKumar Gala2011-04-041-0/+14
| | | | | | | | | | | | | We can simplify some cpu/SoC level initialization by moving it to be after the environment and non-volatile storage is setup as there might be dependancies on such things in various boot configurations. For example for FSL SoC's with QE if we boot from NAND we need it setup to extra the ucode image to initialize the QE. If we always do this after environment & non-volatile storage is working we can have the code be the same regardless of NOR, NAND, SPI, MMC boot. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* powerpc: Move cpu specific lmb reserve to arch_lmb_reserveKumar Gala2011-04-041-0/+5
| | | | | | | | We've been utilizing board_lmb_reserve to reserve the boot page for MP systems. We can just move this into arch_lmb_reserve for 85xx & 86xx systems rather than duplicating in each board port. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* rename _end to __bss_end__Po-Yu Chuang2011-03-271-2/+2
| | | | | | | Currently, _end is used for end of BSS section. We want _end to mean end of u-boot image, so we rename _end to __bss_end__ first. Signed-off-by: Po-Yu Chuang <ratbert@faraday-tech.com>
* Replace "FLASH" strings with "Flash" or "flash"Peter Tyser2011-01-191-1/+1
| | | | | | | | There's no compelling reason to have the output on bootup or the "flinfo" command print "flash" in uppercase, so use the proper case where appropriate. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* powerpc: fix register usage in some inline assembly codeTimur Tabi2010-12-172-11/+19
| | | | | | | In some usages of inline assembly, hard-coded registers were specified when a scratch register should have been used instead. Signed-off-by: Timur Tabi <timur@freescale.com>
* Merge branch 'master' of ../master into nextWolfgang Denk2010-12-161-0/+11
|\
| * powerpc/85xx: Introduce CONFIG_SYS_EXTRA_ENV_RELOCKumar Gala2010-11-301-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. We set this on the 85xx boards that have support for NAND, SPI, or SDHC/MMC boot support as they use a secondary cache in SRAM mode and need the env_addr pointer relocated since we change from SRAM to normal cache mode in cpu_init_r. Also removed CONFIG_SYS_SPL as its not used anywhere. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* | do_reset: unify duplicate prototypesMike Frysinger2010-11-281-1/+0
|/ | | | | | | The duplication of the do_reset prototype has gotten out of hand, and they're not all in sync. Unify them all in command.h. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* WINBOND_83C553: enable only on boards that actually use it.Wolfgang Denk2010-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | So far, only the BAB7xx board would call the initialise_w83c553f() function for the WINBOND 83C553 chip, even though some other boards (HIDDEN_DRAGON, Sandpoint8240, Sandpoint8245) enabled it in their board configuration. These boards were also missing other config settings needed for that, which resulted in build errors like this: drivers/pci/libpci.o:(.got2+0x84): undefined reference to `ide_bus_offset' Switch arch/powerpc/lib/board.c to call initialise_w83c553f() not on a per-board base, but when a WINBOND_83C553 in enabled in a configuration (like BAB7xx), and disable it in the boards that had this set so far. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Yusdi Santoso <yusdi_santoso@adaptec.com> Cc: Jim Thompson <jim@musenki.com> Acked-by: Stefan Roese <sr@denx.de>
* Switch from archive libraries to partial linkingSebastien Carlier2010-11-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, weak symbols were not overridden by non-weak symbols found in archive libraries when linking with recent versions of binutils. As stated in the System V ABI, "the link editor does not extract archive members to resolve undefined weak symbols". This commit changes all Makefiles to use partial linking (ld -r) instead of creating library archives, which forces all symbols to participate in linking, allowing non-weak symbols to override weak symbols as intended. This approach is also used by Linux, from which the gmake function cmd_link_o_target (defined in config.mk and used in all Makefiles) is inspired. The name of each former library archive is preserved except for extensions which change from ".a" to ".o". This commit updates references accordingly where needed, in particular in some linker scripts. This commit reveals board configurations that exclude some features but include source files that depend these disabled features in the build, resulting in undefined symbols. Known such cases include: - disabling CMD_NET but not CMD_NFS; - enabling CONFIG_OF_LIBFDT but not CONFIG_QE. Signed-off-by: Sebastien Carlier <sebastien.carlier@gmail.com>
* ppc: Don't initialize write protected NOR flashesJohn Schmoller2010-10-201-1/+15
| | | | | | | | | | | | If a NOR flash is write protected it can not be initialized/detected so add the ability for boards to skip NOR initialization on bootup. A board can skip NOR initialization by implementing the board_flash_wp_on() function. Signed-off-by: John Schmoller <jschmoller@xes-inc.com> Signed-off-by: Peter Tyser <ptyser@xes-inc.com> CC: sr@denx.de Acked-by: Stefan Roese <sr@denx.de>
* powerpc: Cleanup BOOTFLAG_* referencesPeter Tyser2010-10-181-2/+0
| | | | | | | | | | | | Now that warm booting is not supported, there isn't a need for the BOOTFLAG_COLD and BOOTFLAG_WARM defines, so remove them. Note that this change makes the board info bd_bootflags field useless. It will always be set to 0, but we leave it around so that we don't break the board info structure that some OSes are expecting to be passed from U-Boot. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* Rename TEXT_BASE into CONFIG_SYS_TEXT_BASEWolfgang Denk2010-10-181-1/+1
| | | | | | | | | | | | The change is currently needed to be able to remove the board configuration scripting from the top level Makefile and replace it by a simple, table driven script. Moving this configuration setting into the "CONFIG_*" name space is also desirable because it is needed if we ever should move forward to a Kconfig driven configuration system. Signed-off-by: Wolfgang Denk <wd@denx.de>
* ppc: Conditionally compile bat_rw.cPeter Tyser2010-10-131-1/+1
| | | | | | | Only a few PPC boards actually use the common BAT manipulation functions, so only compile it for them. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* powerpc: Zero out board info struct on bootupPeter Tyser2010-10-121-16/+1
| | | | | | | This puts the board info struct in a known state and allows the removal of other code which initialized board info fields to 0. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
OpenPOWER on IntegriCloud