summaryrefslogtreecommitdiffstats
path: root/include/common.h
Commit message (Collapse)AuthorAgeFilesLines
* x86: Rename i386 to x86Graeme Russ2011-04-131-3/+3
| | | | Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* Fix min/max macros in include/common.hAaron Williams2011-04-121-2/+4
| | | | | | | | | | There is a bug in the min and max macros in common.h which occurs if Y is a larger type than X. For example, if Y is a 64-bit value and X is a 32-bit value then Y will be truncated to 32-bits. This fix matches what is done in the Linux kernel but without the additional type checking present in the kernel version. Signed-off-by: Aaron Williams <aaron.williams@caviumnetworks.com>
* powerpc/8xxx: Replace fsl_ddr_get_mem_data_rate with get_ddr_freq()Kumar Gala2011-04-041-0/+4
| | | | | | | | | | Every 85xx board implements fsl_ddr_get_mem_data_rate via get_ddr_freq() and every 86xx board uses get_bus_freq(). If implement get_ddr_freq() as a static inline to call get_bus_freq() we can remove fsl_ddr_get_mem_data_rate altogether and just call get_ddr_freq() directly. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* strmhz: Make hz unsigned to support greater than 2146 MHz clockEd Swarthout2011-03-221-1/+1
| | | | | | | | | For example, an input of 0x80000000 should print: 2147.484 instead of -2147.-483. Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* env: re-add support for auto-completionMike Frysinger2011-01-091-0/+1
| | | | | | | Currently, only basic completion is supported (no globs), but this is what we had previously. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* stdio: constify "name" arg in public apiMike Frysinger2010-11-281-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Replace CONFIG_SYS_GBL_DATA_SIZE by auto-generated valueWolfgang Denk2010-10-261-0/+1
| | | | | | | | | | | | | | | | | | CONFIG_SYS_GBL_DATA_SIZE has always been just a bad workarond for not being able to use "sizeof(struct global_data)" in assembler files. Recent experience has shown that manual synchronization is not reliable enough. This patch renames CONFIG_SYS_GBL_DATA_SIZE into GENERATED_GBL_DATA_SIZE which gets automatically generated by the asm-offsets tool. In the result, all definitions of this value can be deleted from the board config files. We have to make sure that all files that reference such data include the new <asm-offsets.h> file. No other changes have been done yet, but it is obvious that similar changes / simplifications can be done for other, related macro definitions as well. Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Kumar Gala <galak@kernel.crashing.org>
* Merge branch 'next' of /home/wd/git/u-boot/nextWolfgang Denk2010-09-281-12/+15
|\ | | | | | | | | | | | | Conflicts: include/ppc4xx.h Signed-off-by: Wolfgang Denk <wd@denx.de>
| * Remove unused CONFIG_SERIAL_SOFTWARE_FIFO featureStefan Roese2010-09-231-8/+0
| | | | | | | | | | | | | | | | | | This patch removes the completely unused CONFIG_SERIAL_SOFTWARE_FIFO feature from U-Boot. It has only been implemented for PPC4xx and was not used at all. So let's remove it and make the code smaller and cleaner. Signed-off-by: Stefan Roese <sr@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
| * ppc4xx: Use common NS16550 driver for PPC4xx UARTStefan Roese2010-09-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the PPC4xx UART driver. Instead the common NS16550 driver is used, since all PPC4xx SoC's use this peripheral device. The file 4xx_uart.c now only implements the UART clock calculation function which also sets the SoC internal UART divisors. All PPC4xx board config headers are changed to use this common NS16550 driver now. Tested on these boards: acadia, canyonlands, katmai, kilauea, sequoia, zeus Signed-off-by: Stefan Roese <sr@denx.de>
| * ppc4xx: Move ppc4xx headers to powerpc include directoryStefan Roese2010-09-231-1/+1
| | | | | | | | | | | | | | | | | | This patch moves some ppc4xx related headers from the common include directory (include/) to the powerpc specific one (arch/powerpc/include/asm/). This way to common include directory is not so cluttered with files. Signed-off-by: Stefan Roese <sr@denx.de>
| * common: move TOTAL_MALLOC_LEN to include/common.hHeiko Schocher2010-09-191-0/+9
| | | | | | | | | | | | | | Portions of this work were supported by funding from the CE Linux Forum. Signed-off-by: Heiko Schocher <hs@denx.de>
| * Remove support for CONFIG_HAS_UID and "forceenv" commandWolfgang Denk2010-09-191-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | This (undocumented) concept was only in use for the MVSMR and davinci_schmoogie Sergey Kubushyn <ksi@koi8.net> boards. Drop it for now. If really needed, it should be reimplemented later in the context of the new environment command set. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Andre Schwarz <andre.schwarz@matrix-vision.de> Cc: Sergey Kubushyn <ksi@koi8.net> Acked-by: Sergey Kubushyn <ksi@koi8.net>
| * Add qsort - add support for sorting data arraysWolfgang Denk2010-09-191-0/+4
| | | | | | | | | | | | Code adapted from uClibc-0.9.30.3 Signed-off-by: Wolfgang Denk <wd@denx.de>
* | POST cleanup.Michael Zaidman2010-09-211-2/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | - Revives POST for blackfin arch; - Removes redundant code: arch/blackfin/lib/post.c arch/powerpc/cpu/ppc4xx/commproc.c arch/powerpc/cpu/mpc512x/common.c - fixes up the post_word_{load|store} usage. Signed-off-by: Michael Zaidman <michael.zaidman@gmail.com> Acked-by: Detlev Zundel <dzu@denx.de> Tested-by: Anatolij Gustschin <agust@denx.de> List of the maintainers of the affected by patch boards: Cc: Stephan Linz <linz@li-pro.net> Cc: Denis Peter <d.peter@mpl.ch> Cc: Matthias Fuchs <matthias.fuchs@esd-electronics.com> Cc: Peter Tyser <ptyser@xes-inc.com> Cc: Stefan Roese <sr@denx.de> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Niklaus Giger <niklaus.giger@netstal.com> Cc: Larry Johnson <lrj@acm.org> Cc: Feng Kan <fkan@amcc.com>
* Rename getenv_r() into getenv_f()Wolfgang Denk2010-08-041-1/+1
| | | | | | | | | | | | | | | | | | | While running from flash, i. e. before relocation, we have only a limited C runtime environment without writable data segment. In this phase, some configurations (for example with environment in EEPROM) must not use the normal getenv(), but a special function. This function had been called getenv_r(), with the idea that the "_r" suffix would mean the same as in the _r_eentrant versions of some of the C library functions (for example getdate vs. getdate_r, getgrent vs. getgrent_r, etc.). Unfortunately this was a misleading name, as in U-Boot the "_r" generally means "running from RAM", i. e. _after_ relocation. To avoid confusion, rename into getenv_f() [as "running from flash"] Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
* Make sure that argv[] argument pointers are not modified.Wolfgang Denk2010-07-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hush shell dynamically allocates (and re-allocates) memory for the argument strings in the "char *argv[]" argument vector passed to commands. Any code that modifies these pointers will cause serious corruption of the malloc data structures and crash U-Boot, so make sure the compiler can check that no such modifications are being done by changing the code into "char * const argv[]". This modification is the result of debugging a strange crash caused after adding a new command, which used the following argument processing code which has been working perfectly fine in all Unix systems since version 6 - but not so in U-Boot: int main (int argc, char **argv) { while (--argc > 0 && **++argv == '-') { /* ====> */ while (*++*argv) { switch (**argv) { case 'd': debug++; break; ... default: usage (); } } } ... } The line marked "====>" will corrupt the malloc data structures and usually cause U-Boot to crash when the next command gets executed by the shell. With the modification, the compiler will prevent this with an error: increment of read-only location '*argv' N.B.: The code above can be trivially rewritten like this: while (--argc > 0 && **++argv == '-') { char *arg = *argv; while (*++arg) { switch (*arg) { ... Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Make *printf() return "int" instead of "void"Wolfgang Denk2010-07-041-4/+4
| | | | | | | | | | Change the return type of the *printf() functions to the standard "int"; no changes are needed but returning the already available length count. This will save a few additional strlen() calls later... Signed-off-by: Wolfgang Denk <wd@denx.de>
* serial: punt unused serial_addr()Mike Frysinger2010-05-071-1/+0
| | | | | | | Only one file apparently defines this function, and it merely stubs it out. So if no one is defining/calling it, punt it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* allow print_size to print large numbers on 32-bit systemsTimur Tabi2010-05-051-1/+1
| | | | | | | | | | Modify print_size() so that it can accept numbers larger than 4GB on 32-bit systems. Add support for display terabyte, petabyte, and exabyte sizes. Change the output to use International Electrotechnical Commission binary prefix standard. Signed-off-by: Timur Tabi <timur@freescale.com>
* Rename lib_generic/ to lib/Peter Tyser2010-04-131-6/+6
| | | | | | | | Now that the other architecture-specific lib directories have been moved out of the top-level directory there's not much reason to have the '_generic' suffix on the common lib directory. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* Move lib_$ARCH directories to arch/$ARCH/libPeter Tyser2010-04-131-4/+4
| | | | | | | | | Also move lib_$ARCH/config.mk to arch/$ARCH/config.mk This change is intended to clean up the top-level directory structure and more closely mimic Linux's directory organization. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* ARM: Add support for EP93xx SoCsMatthias Kaehlcke2010-02-121-1/+2
| | | | | | | Add support for the Cirrus EP93xx platform Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net> Acked-by: Tom <Tom.Rix@windriver.com>
* Add EP93xx ethernet driverMatthias Kaehlcke2010-01-311-0/+5
| | | | | | | Added ethernet driver for EP93xx SoCs Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Add support to disable cpu's in multicore processorsKumar Gala2010-01-261-0/+1
| | | | | | | | | | | Add a disable sub-command to the cpu command that allows for disabling cores in multicore processors. This can be useful for systems that are using multicore chips but aren't utilizing all the cores as a way to reduce power and possibly improve performance. Also updated an added missing copyright. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* cmd_eeprom: I2C updatesHeiko Schocher2010-01-181-0/+2
| | | | | | | | | | | | | - CONFIG_ENV_EEPROM_IS_ON_I2C define this, if you have I2C and SPI activated, and your EEPROM, which holds the environment, is on the I2C bus. - CONFIG_I2C_ENV_EEPROM_BUS if you have an Environment on an EEPROM reached over I2C muxes, you can now define, how to reach this EEPROM. Signed-off-by: Heiko Schocher <hs@denx.de>
* Make getenv_IPaddr() globalDirk Behme2010-01-171-0/+7
| | | | | | | | | | | | | | | | | | | There are boards out there that do not have network support in U-Boot (CONFIG_CMD_NET not set), but they do so in Linux. This makes it desirable to be able to port network configuration (like the IP address) to the Linux kernel. We should not make the passing of the IP configuration to Linux dependent on U-Boot features / settings. For this, make getenv_IPaddr() global. This fixes build error u-boot/lib_xxx/board.c:360: undefined reference to `getenv_IPaddr' on various architectures. Signed-off-by: Dirk Behme <dirk.behme@googlemail.com> Acked-by: Ben Warren <biggerbadderben@gmail.com>
* move prototypes for gunzip() and zunzip() to common.hWolfgang Wegner2009-12-211-0/+5
| | | | | | | | 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>
* common: delete CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOULHeiko Schocher2009-12-081-2/+0
| | | | | | | | | 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>
* Generic udelay() with watchdog supportIngo van Lil2009-12-051-1/+4
| | | | | | | | | | | | | 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>
* TI DA8xx: Integrate DA830 EVM support into U-BootSekhar Nori2009-11-271-0/+3
| | | | | | | | | 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>
* Add a unified s3c24x0 header filekevin.morfitt@fearnside-systems.co.uk2009-11-271-2/+3
| | | | | | | | | | 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>
* Revert "env: only build env_embedded and envcrc when needed"Wolfgang Denk2009-10-271-5/+0
| | | | | | Breaks building on many boards, and no really clean fix available yet. This reverts commit 6dab6add2d8ee80905234b326abc3de11be1d178.
* env: only build env_embedded and envcrc when neededMike Frysinger2009-10-181-0/+5
| | | | | | | | | | | | | 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>
* tools: mkimage: Fixed build warningsPrafulla Wadaskar2009-09-101-3/+1
| | | | | | | | 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>
* 8xxx: Removed CONFIG_NUM_CPUS from 85xx/86xxPoonam Aggrwal2009-08-281-0/+2
| | | | | | | | | | | | | 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>
* Fix include/common.h for boards with CONFIG_STATUS_LEDWolfgang Denk2009-07-271-3/+3
| | | | | | | | | 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>
* Make include/common.h usable by assembler codeWolfgang Denk2009-07-271-17/+20
| | | | | | | | | | | | | | 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>
* AT91: factor out ROUND() macroWolfgang Denk2009-07-221-0/+1
| | | | | | | | 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>
* ppc4xx: Make is_pci_host() available for all 440 and 405 CPUsMatthias Fuchs2009-07-101-2/+2
| | | | | Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu> Signed-off-by: Stefan Roese <sr@denx.de>
* all platforms: make show_boot_progress() work againHeiko Schocher2009-07-081-1/+1
| | | | Signed-off-by: Heiko Schocher <hs@denx.de>
* S3C24x0: extract interrupts from timerJean-Christophe PLAGNIOL-VILLARD2009-07-061-2/+0
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* 83xx: Replace CONFIG_MPC83XX with CONFIG_MPC83xxPeter Tyser2009-06-121-4/+4
| | | | | | | | 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>
* MPC512x: remove include/mpc512x.hWolfgang Denk2009-06-121-2/+1
| | | | | | | | | | | | | | | | | | | | 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>
* Add support for Linux-like kallsysmsMike Frysinger2009-06-121-0/+3
| | | | | | | 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>
* at91rm9200: move serial shutdown code to serial driversJean-Christophe PLAGNIOL-VILLARD2009-04-041-0/+1
| | | | | | | 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>
* Add "source" command; prepare removal of "autoscr" commandWolfgang Denk2009-04-031-2/+2
| | | | | | | | | | | | | | | | | | | | | 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>
* boards: get mac address from env and move load_sernum_ethaddr() to board initMike Frysinger2009-03-201-2/+0
| | | | | | | | | | | | | | | | | | | 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>
* boards: move board_get_enetaddr() into board-specific initMike Frysinger2009-03-201-7/+0
| | | | | | | | | | | | 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>
* netloop: speed up NetLoopHeiko Schocher2009-02-221-0/+1
| | | | | | | | | | | | | | 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>
OpenPOWER on IntegriCloud