summaryrefslogtreecommitdiff
path: root/include/common.h
AgeCommit message (Collapse)Author
2010-11-17Add qsort - add support for sorting data arraysMichael Brandt
Code adapted from uClibc-0.9.30.3 Originated from U-Boot mainline git://git.denx.de/u-boot.git commit 54c6977e9ca41fb38b45f1746d90f2806be3b5cb Original committer Wolfgang Denk <wd@denx.de> Change-Id: I85a11005af9eaed50d94674fdac74a32f7bc4f35 Signed-off-by: Michael Brandt <michael.brandt@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/8439 Reviewed-by: Mikael LARSSON1 <mikael.xt.larsson@stericsson.com> Tested-by: Mikael LARSSON1 <mikael.xt.larsson@stericsson.com>
2010-07-23Boottime changes. Moved generic boottime code from lib_arm to common. ↵Jonas Aaberg
Boottime now internally uses us instead of ticks. Reviewed-by: Michael Brandt <michael.brandt@stericsson.com> Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Change-Id: If30d2eb384d6e82daa86c3cab7a6fd2a22baefb5 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/3053 Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com>
2009-12-21move prototypes for gunzip() and zunzip() to common.hWolfgang Wegner
Prototype for gunzip/zunzip was only in lib_generic/gunzip.c and thus repeated in every file using it. This patch moves the prototypes to common.h and removes all prototypes distributed anywhere else. Signed-off-by: Wolfgang Wegner <w.wegner@astro-kom.de>
2009-12-08common: delete CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOULHeiko Schocher
There is more and more usage of printing 64bit values, so enable this feature generally, and delete the CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOUL defines. Signed-off-by: Heiko Schocher <hs@denx.de>
2009-12-05Generic udelay() with watchdog supportIngo van Lil
According to the PPC reference implementation the udelay() function is responsible for resetting the watchdog timer as frequently as needed. Most other architectures do not meet that requirement, so long-running operations might result in a watchdog reset. This patch adds a generic udelay() function which takes care of resetting the watchdog before calling an architecture-specific __udelay(). Signed-off-by: Ingo van Lil <inguin@gmx.de>
2009-11-27TI DA8xx: Integrate DA830 EVM support into U-BootSekhar Nori
Integrate DA830 EVM support into U-Boot. Provides initial support for TI OMAP-L137/DA830 SoC devices on a Spectrum Digital EVM board. See http://www.spectrumdigital.com/ Signed-off-by: Nick Thompson <nick.thompson@gefanuc.com>
2009-11-27Add a unified s3c24x0 header filekevin.morfitt@fearnside-systems.co.uk
This patch adds a unified s3c24x0 cpu header file that selects the header file for the specific s3c24x0 cpu from the SOC and CPU configs defined in board config file. This removes the current chain of s3c24-type #ifdef's from the s3c24x0 code. Signed-off-by: Kevin Morfitt <kevin.morfitt@fearnside-systems.co.uk> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2009-10-27Revert "env: only build env_embedded and envcrc when needed"Wolfgang Denk
Breaks building on many boards, and no really clean fix available yet. This reverts commit 6dab6add2d8ee80905234b326abc3de11be1d178.
2009-10-18env: only build env_embedded and envcrc when neededMike Frysinger
The env code is protected by the ENV_IS_EMBEDDED define, so attempting to compile the code when this isn't defined is pointless. Now that the env headers have unified around CONFIG_ENV_IS_EMBEDDED, convert the build system to only build the env objects when this is enabled. And now that the env code is conditionally compiled, we can drop the source code checks. For people who want to extract the environment manually, add a new option CONFIG_BUILD_ENVCRC that only enables the envcrc utility. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-10tools: mkimage: Fixed build warningsPrafulla Wadaskar
uninitialized retval variable warning fixed crc32 APIs moved to crc.h (newly added) and build warnings fixed Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com> Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-08-288xxx: Removed CONFIG_NUM_CPUS from 85xx/86xxPoonam Aggrwal
The number of CPUs are getting detected dynamically by checking the processor SVR value. Also removed CONFIG_NUM_CPUS references from all the platforms with 85xx/86xx processors. This can help to use the same u-boot image across the platforms. Also revamped and corrected few Freescale Copyright messages. Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-07-27Fix include/common.h for boards with CONFIG_STATUS_LEDWolfgang Denk
The reordering of include/common.h by commit fcd3c87e495f3c48 broke boards with status LED support, resulting in error: #error Status LED configuration missing errors. Undo this reordering to avoid this issue. Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-07-27Make include/common.h usable by assembler codeWolfgang Denk
Commit 70ebf316 factored out the ROUND() macro into include/common.h, not realizing that the primary use of this macro on AT91 systems was in start.S where common.h was not included, and could not be included because it contains a lot of C code which the assembler doesn't understand. This patch wraps such code in common.h in a "#ifndef __ASSEMBLY__" construct, and then adds an include to cpu/arm926ejs/start.S thus solving the problem. Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-07-22AT91: factor out ROUND() macroWolfgang Denk
A large number of boards (all AT91 based) duplicated the ROUND() macro in their board specific config files. Add the definition to include/common.h and clean up the board config files. Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-07-10ppc4xx: Make is_pci_host() available for all 440 and 405 CPUsMatthias Fuchs
Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu> Signed-off-by: Stefan Roese <sr@denx.de>
2009-07-08all platforms: make show_boot_progress() work againHeiko Schocher
Signed-off-by: Heiko Schocher <hs@denx.de>
2009-07-06S3C24x0: extract interrupts from timerJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-06-1283xx: Replace CONFIG_MPC83XX with CONFIG_MPC83xxPeter Tyser
Use the standard lowercase "xx" capitalization that other Freescale architectures use for CPU defines to prevent confusion and errors Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2009-06-12MPC512x: remove include/mpc512x.hWolfgang Denk
Move needed definitions (register descriptions etc.) from include/mpc512x.h into include/asm-ppc/immap_512x.h. Instead of using a #define'd register offset, use a function that provides the PATA controller's base address. All the rest of include/mpc512x.h are register offset definitions which can be eliminated by proper use of C structures. There are only a few register offsets remaining that are needed in cpu/mpc512x/start.S; for these we provide cpu/mpc512x/asm-offsets.h which is intended as a temporary workaround only. In a later patch this file will be removed, too, and then auto-generated from the respective C structs. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: John Rigby <jcrigby@gmail.com>
2009-06-12Add support for Linux-like kallsysmsMike Frysinger
The kernel stores address<->symbol names in it so things can be decoded at runtime. Do it in U-Boot, and we get nice symbol decoding when crashing. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-04-04at91rm9200: move serial shutdown code to serial driversJean-Christophe PLAGNIOL-VILLARD
introduce serial_exit for this purpose. Use it only when the rm9200 serial driver is active Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-04-03Add "source" command; prepare removal of "autoscr" commandWolfgang Denk
According to the doc/feature-removal-schedule.txt, the "autoscr" command will be replaced by the "source" command in approximately 6 months from now. This patch prepares this change and starts a 6 month transition period as follows: - The new "source" command has been added, which implements exactly the same functionlaity as the old "autoscr" command before - The old "autoscr" command name is kept as an alias for compatibility - Command sequences, script files atc. have been adapted to use the new "source" command - Related environment variables ("autoscript", "autoscript_uname") have *not* been adapted yet; these will be renamed resp. removed in a separate patch when the support for the "autoscr" command get's finally dropped. Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-03-20boards: get mac address from env and move load_sernum_ethaddr() to board initMike Frysinger
The environment is the canonical storage location of the mac address, so we're killing off the global data location and moving everything to querying the env directly. Rather than have common ppc code call a board-specific function like load_sernum_ethaddr(), have each board call it in its own board-specific misc_init_r() function. The boards that get converted here are: - kup4k/kup4x - pcs440ep - tqm8xx Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Ben Warren <biggerbadderben@gmail.com> CC: Stefan Roese <sr@denx.de>
2009-03-20boards: move board_get_enetaddr() into board-specific initMike Frysinger
The environment is the canonical storage location of the mac address, so we're killing off the global data location and moving everything to querying the env directly. Rather than have the common ppc code have board-specific hooks, move the board_get_enetaddr() function into the board-specific init functions. Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Ben Warren <biggerbadderben@gmail.com>
2009-02-22netloop: speed up NetLoopHeiko Schocher
NetLoop polls every cycle with getenv some environment variables. This is horribly slow, especially when the environment is big. This patch reads only the environment variables in NetLoop, when they were changed. Also moved the init part of the NetLoop function in a seperate function. Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-01-27MIPS: Add flush_dcache_range() and invalidate_dcache_range()Stefan Roese
This patch adds flush_/invalidate_dcache_range() to the MIPS architecture. Those functions are needed for the upcoming dcache support for the USB EHCI driver. I chose this API because those cache handling functions are already present in the PPC architecture. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
2008-12-07IOMUX: Add console multiplexing support.Gary Jennejohn
Modifications to support console multiplexing. This is controlled using CONFIG_SYS_CONSOLE_MUX in the board configuration file. This allows a user to specify multiple console devices in the environment with a command like this: setenv stdin serial,nc. As a result, the user can enter text on both the serial and netconsole interfaces. All devices - stdin, stdout and stderr - can be set in this manner. 1) common/iomux.c and include/iomux.h contain the environment setting implementation. 2) doc/README.iomux contains a somewhat more detailed description. 3) The implementation in (1) is called from common/cmd_nvedit.c to handle setenv and from common/console.c to handle initialization of input/output devices at boot time. 4) common/console.c also contains the code needed to poll multiple console devices for input and send output to all devices registered for output. 5) include/common.h includes iomux.h and common/Makefile generates iomux.o when CONFIG_SYS_CONSOLE_MUX is set. Signed-off-by: Gary Jennejohn <garyj@denx.de>
2008-11-02Consolidate MAX/MIN definitionsAndy Fleming
There were several, now there is one (two if you count the lower-case versions). Signed-off-by: Andy Fleming <afleming@freescale.com>
2008-10-21strmhz(): Round numbers when printing clock frequenciesWolfgang Denk
Round clock frequencies for printing. Many boards printed off clock frequencies like 399 MHz instead of the exact 400 MHz because numberes were not rounded. This is fixed now. Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-10-18rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-09-08BMW, PCIPPC2, PCIPPC6, RBC82: fix compile warningsWolfgang Denk
missing doc_probe() prototype. Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-08-31ARM: Add arm1176 core with S3C6400 SoCGuennadi Liakhovetski
Based on the original S3C64XX port by Samsung for U-Boot 1.1.6. Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
2008-08-21Consolidate strmhz() implementationHaavard Skinnemoen
ARM, i386, m68k and ppc all have identical implementations of strmhz(). Other architectures don't provide this function at all. This patch moves strmhz() into lib_generic, reducing code duplication and providing a more unified API across architectures. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-08-12Update MTD to that of Linux 2.6.22.1William Juul
A lot changed in the Linux MTD code, since it was last ported from Linux to U-Boot. This patch takes U-Boot NAND support to the level of Linux 2.6.22.1 and will enable support for very large NAND devices (4KB pages) and ease the compatibility between U-Boot and Linux filesystems. This patch is tested on two custom boards with PPC and ARM processors running YAFFS in U-Boot and Linux using gcc-4.1.2 cross compilers. MAKEALL ppc/arm has some issues: * DOC/OneNand/nand_spl is not building (I have not tried porting these parts, and since I do not have any HW and I am not familiar with this code/HW I think its best left to someone else.) Except for the issues mentioned above, I have ported all drivers necessary to run MAKEALL ppc/arm without errors and warnings. Many drivers were trivial to port, but some were not so trivial. The following drivers must be examined carefully and maybe rewritten to some degree: cpu/ppc4xx/ndfc.c cpu/arm926ejs/davinci/nand.c board/delta/nand.c board/zylonite/nand.c Signed-off-by: William Juul <william.juul@tandberg.com> Signed-off-by: Stig Olsen <stig.olsen@tandberg.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
2008-07-09Fix printf errors.Andrew Klossner
The compiler will help find mismatches between printf formats and arguments if you let it. This patch adds the necessary attributes to declarations in include/common.h, then begins to correct the resulting compiler warnings. Some of these were bugs, e.g., "$d" instead of "%d" and incorrect arguments. Others were just annoying, like int-long mismatches on a system where both are 32 bits. It's worth fixing the annoying errors to catch the real ones. Signed-off-by: Andrew Klossner <andrew@cesa.opbu.xerox.com>
2008-07-01Make setenv() return statusSteven A. Falco
Currently, the setenv function does not return an error code. This patch allows to test for errors. Signed-off-by: Steve Falco <sfalco@harris.com>
2008-06-28Add ALIGN() macroAndy Fleming
ALIGN() returns the smallest aligned value greater than the passed in address or size. Taken from Linux. Signed-off-by: Andy Fleming <afleming@freescale.com>
2008-06-12Change initdram() return type to phys_size_tBecky Bruce
This patch changes the return type of initdram() from long int to phys_size_t. This is required for a couple of reasons: long int limits the amount of dram to 2GB, and u-boot in general is moving over to phys_size_t to represent the size of physical memory. phys_size_t is defined as an unsigned long on almost all current platforms. This patch *only* changes the return type of the initdram function (in include/common.h, as well as in each board's implementation of initdram). It does not actually modify the code inside the function on any of the platforms; platforms which wish to support more than 2GB of DRAM will need to modify their initdram() function code. Build tested with MAKEALL for ppc, arm, mips, mips-el. Booted on powerpc MPC8641HPCN. Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
2008-06-12Change print_size to take phys_size_tBecky Bruce
Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
2008-06-03Move definition of container_of() to common.hHaavard Skinnemoen
AVR32 and AT91SAM9 both have their own identical definitions of container_of() taken from the Linux kernel. Move it to common.h so that all architectures can use it. container_of() is already used by some drivers, and will be used extensively by the new and improved SPI API. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-05-12Revert "Change env_get_char from a global function ptr to a function."Wolfgang Denk
This reverts commit c0559be371b2a64b1a817088c3308688e2182f93 which is known to break booting from dataflash and NAND.
2008-04-28MPC8323ERDB: fix implicit declaration of function 'mac_read_from_eeprom'Wolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-04-25Merge branch 'master' of /home/wd/git/u-boot/lwmon5Wolfgang Denk
Conflicts: common/cmd_bootm.c common/cmd_log.c include/common.h post/board/lwmon5/Makefile post/board/lwmon5/dsp.c post/board/lwmon5/dspic.c post/board/lwmon5/fpga.c post/board/lwmon5/gdc.c post/board/lwmon5/sysmon.c post/board/lwmon5/watchdog.c Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-04-25Add support for calculating hashes with watchdog triggeringBartlomiej Sieka
Implement watchodg-aware variants of hash calculation functions: - crc32_wd() - md5_wd() - sha1_csum_wd() The above functions calculate the hash of the input buffer in chunks, triggering the watchdog after processing each chunk. The chunk size is given as a function call parameter. Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
2008-04-24Fix show_boot_progress prototypeJean-Christophe PLAGNIOL-VILLARD
in commit fad634071 "make show_boot_progress () weak." show_boot_progress is supposed to be declared as weak but declared as inline instead. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-04-2485xx: Round up frequency calculations to get reasonable outputKumar Gala
eg. because of rounding error we can get 799Mhz instead of 800Mhz. Introduced DIV_ROUND_UP and roundup taken from linux kernel. Signed-off-by: Dejan Minic <minic@freescale.com> Signed-off-by: Srikanth Srinivasan <srikanth.srinivasan@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Andy Fleming <afleming@freescale.com>
2008-04-24crc32: use uint32_t rather than unsigned longMike Frysinger
The envcrc.c does sizeof(unsigned long) when calculating the crc, but this is done with the build toolchain instead of the target tool chain, so if the build is a 64bit system but the target is 32bits, the size will obviously be wrong. This converts all unsigned long stuff related to crc32 to uint32_t types. Compile tested only: output of ./tools/envcrc when run on a 32bit build system matches that of a 64bit build system. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-04-22POST: move CONFIG_POST to MakefilesYuri Tikhonov
Introduce the new logical option CONFIG_HAS_POST which is set when the platform has CONFIG_POST set. Use CONFIG_HAS_POST in the post/ Makefiles to determine should the POST libs be compiled for the selected target platform, or not. To avoid breaking u-boot linking process, the empty post/libpost.a file is created for platforms which do not have POSTs. Signed-off-by: Yuri Tikhonov <yur@emcraft.com> Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-04-17Change env_get_char from a global function ptr to a function.Joakim Tjernlund
This avoids an early global data reference. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
2008-03-2685xx: Update multicore boot mechanism to ePAPR v0.81 specKumar Gala
The following changes are needed to be inline with ePAPR v0.81: * r4, r5 and now always set to 0 on boot release * r7 is used to pass the size of the initial map area (IMA) * EPAPR_MAGIC value changed for book-e processors * changes in the spin table layout * spin table supports a 64-bit physical release address Signed-off-by: Kumar Gala <galak@kernel.crashing.org>