summaryrefslogtreecommitdiff
path: root/include/common.h
AgeCommit message (Collapse)Author
2011-12-21Add CONFIG_DELAY_CONSOLE to delay console initSimon Glass
This option delays console initialization until after relocation. This can save time if this init is relatively expensive, since after relocation the CPU is often running much faster. This option should be used in conjunction with CONFIG_PRE_CONSOLE_BUFFER to ensure that all console output is buffered until the console is ready for it. This saves about 30ms boot time. BUG=chromium-os:22938 TEST=build and boot on Kaen Change-Id: I3a774b418d45e7be9338f9942df445c2c2baa528 Reviewed-on: https://gerrit.chromium.org/gerrit/13207 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Commit-Ready: Simon Glass <sjg@chromium.org>
2011-11-17UPSTREAM: tftpput: add save_addr and save_size global variablesSimon Glass
We need something akin to load_addr to handle saving data. Signed-off-by: Simon Glass <sjg@chromium.org> (cherry picked from commit 1aec244acf9daf0d4dad80fe86b2c2b7404251d6) Change-Id: I56c586abb3e075f0ab422c833637a3160d7e2a5f Reviewed-on: https://gerrit.chromium.org/gerrit/11800 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2011-11-16BACKPORT: Add setenv_ulong() and setenv_addr()Simon Glass
It seems we put numbers and addresses into environment variables a lot. We should have some functions to do this. (cherry picked from commit d67f10c) Change-Id: I922e72a7db872f26774459a6dc074a80016ef904 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/11792 Reviewed-by: Doug Anderson <dianders@chromium.org>
2011-11-16UPSTREAM: Move simple_itoa to vsprintfSimon Glass
This function is generally useful and shouldn't hide away in hush. It has been moved as is. Signed-off-by: Simon Glass <sjg@chromium.org> (cherry picked from commit 3cce8a5496452285e1828984ad3945417205cfc3) Change-Id: I014f58e901e6b035b5eeb694c62e6e881a7b75c2 Reviewed-on: https://gerrit.chromium.org/gerrit/11791 Reviewed-by: Doug Anderson <dianders@chromium.org> Commit-Ready: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2011-08-29Add board_panic_no_console to deal with early critical errorsSimon Glass
Change-Id: I1e1cc76214cdb45399cec090677d3164ca2d33eb Reviewed-on: http://gerrit.chromium.org/gerrit/6065 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Anton Staaf <robotboy@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2011-08-29assert: Rely on the compilers dead code removalAnton Staaf
By always emitting the assert code we ensure that constructs passed to assert will be checked by the compiler. This also ensures that functions that are only used in asserts aren't flagged as unused when DEBUG is not defined. BUG=chromium-os:17999 TEST=Build firmware and boot to ChromiumOS on Aebl, Kaen and Seaboard Change-Id: Id5f5742622d7041c2cfb7f867742701a087f3e59 Reviewed-on: http://gerrit.chromium.org/gerrit/4666 Reviewed-by: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org>
2011-08-29tegra: Small clean up of board display codeSimon Glass
This moves the board name/type code to the top of the board file and removes the unneeded function prototypes. BUG=chromium-os:11623 TEST=build and boot Change-Id: I0f76af84d638d8f45173ca820f00339ce45f0ff7 Reviewed-on: http://gerrit.chromium.org/gerrit/3503 Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2011-08-29Add 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. BUG=chromium-os:17055 TEST=build U-Boot with option enabled, see that environment is not available Change-Id: I99a25b468fb5d14310b00eb3fd4c3e6a0c5cbe2b Reviewed-on: http://gerrit.chromium.org/gerrit/3534 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2011-08-29Add assert() for debug assertionsSimon Glass
assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined. This is useful when a condition is an error but a board reset is unlikely to fix it, so it is better to soldier on in hope. Assertion failures should be caught during development/test. It turns out that assert() is defined separately in a few places in U-Boot with various meanings. Build errors exposed by this change (and defining DEBUG) are also fixed in this commit. BUG=chromium-os:11623 TEST=build U-Boot for seaboard Change-Id: I27500491d2328405694bfd65ab991d42d9641927 Reviewed-on: http://gerrit.chromium.org/gerrit/2777 Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anton Staaf <robotboy@chromium.org>
2011-08-29Derive board name and machine ID from the device tree.Vadim Bendebury
The board device ID needs to be passed to the kernel for proper initialization of the machine (until FDT is deployed for that). The device ID is picked based on the board name in the u-boot device tree. BUG=chromium-os:834 TEST=manual Tested combined with the rest of the patches in this set. Change-Id: Ifb9395196d13e96d6616ec61ae1e6fc6bd300ab6 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: http://gerrit.chromium.org/gerrit/2773 Reviewed-by: Simon Glass <sjg@chromium.org>
2011-08-29Add control over cachability of memory regionsSimon Glass
This is needed for LCD support, where we want to make the LCD frame buffer write-through (or off) rather than write-back. BUG=chromium-os:14082 TEST=build U-Boot Change-Id: I7e1bf9358b8c2fb7ae524cc74cdcfa5b0fb60fbe Reviewed-on: http://gerrit.chromium.org/gerrit/2239 Reviewed-by: Anton Staaf <robotboy@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2011-08-24Add microsecond boot time measurementSimon Glass
This defines the basics of a new boot time measurement feature. This allows logging of very accurate time measurements as the boot proceeds, by using an available microsecond counter. To enable the feature, define CONFIG_BOOTSTAGE in your board config file. Also available is CONFIG_BOOTSTAGE_REPORT which will cause a report to be printed just before handing off to the OS. BUG=chromium-os:13875 TEST=build and boot, check that progress is reported before running Linux: Timer summary in microseconds: Mark Elapsed Stage 0 0 awake 2,181,078 2,181,078 usb_start 11,861,817 9,680,739 bootp_start 11,884,610 22,793 bootp_stop 11,884,689 79 tftp start 15,271,536 3,386,847 tftp done 15,271,568 32 bootm_start 15,406,551 134,983 start_kernel Change-Id: I71b89c8402dc5dec75e68333bd24a6bab7500a1b Reviewed-on: http://gerrit.chromium.org/gerrit/197 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2011-08-24armv7: cache maintenance operations for armv7Aneesh V
- Add a framework for layered cache maintenance - separate out SOC specific outer cache maintenance from maintenance of caches known to CPU - Add generic ARMv7 cache maintenance operations that affect all caches known to ARMv7 CPUs. For instance in Cortex-A8 these opertions will affect both L1 and L2 caches. In Cortex-A9 these will affect only L1 cache - D-cache operations supported: - Invalidate entire D-cache - Invalidate D-cache range - Flush(clean & invalidate) entire D-cache - Flush D-cache range - I-cache operations supported: - Invalidate entire I-cache - Add maintenance functions for TLB, branch predictor array etc. - Enable -march=armv7-a so that armv7 assembly instructions can be used Signed-off-by: Aneesh V <aneesh@ti.com>
2011-06-22ARM: drop unsupported 'trab' boardWolfgang Denk
The 'trab' board configuration is broken, and there is nobody who is interested and willing to fix it. Drop it. This includes support for VFD displays which have always been used by this board only. Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-05-12lib, vsprintf: introduce strict_strtoulHeiko Schocher
as checkpatch proposes to use strict_strtoul instead of simple_strtoul, introduce it. Ported this function from Linux 2.6.38 commit ID: 521cb40b0c44418a4fd36dc633f575813d59a43d Signed-off-by: Heiko Schocher <hs@denx.de> cc: Wolfgang Denk <wd@denx.de> cc: Detlev Zundel <dzu@denx.de> cc: Valentin Longchamp <valentin.longchamp@keymile.com> cc: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
2011-04-30powerpc, mpc83xx: add missing functions to include/common.hHeiko Schocher
add following functions to common.h, to prevent extern declarations: void disable_addr_trans(void); void enable_addr_trans(void); void ddr_enable_ecc(unsigned int dram_size); 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: Wolfgang Denk <wd@denx.de> cc: Detlev Zundel <dzu@denx.de> cc: Valentin Longchamp <valentin.longchamp@keymile.com>
2011-04-13x86: Rename i386 to x86Graeme Russ
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
2011-04-12Fix min/max macros in include/common.hAaron Williams
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>
2011-04-04powerpc/8xxx: Replace fsl_ddr_get_mem_data_rate with get_ddr_freq()Kumar Gala
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>
2011-03-22strmhz: Make hz unsigned to support greater than 2146 MHz clockEd Swarthout
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>
2011-01-09env: re-add support for auto-completionMike Frysinger
Currently, only basic completion is supported (no globs), but this is what we had previously. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-11-28stdio: constify "name" arg in public apiMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-26Replace CONFIG_SYS_GBL_DATA_SIZE by auto-generated valueWolfgang Denk
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>
2010-09-28Merge branch 'next' of /home/wd/git/u-boot/nextWolfgang Denk
Conflicts: include/ppc4xx.h Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-09-23Remove unused CONFIG_SERIAL_SOFTWARE_FIFO featureStefan Roese
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>
2010-09-23ppc4xx: Use common NS16550 driver for PPC4xx UARTStefan Roese
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>
2010-09-23ppc4xx: Move ppc4xx headers to powerpc include directoryStefan Roese
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>
2010-09-21POST cleanup.Michael Zaidman
- 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>
2010-09-19common: move TOTAL_MALLOC_LEN to include/common.hHeiko Schocher
Portions of this work were supported by funding from the CE Linux Forum. Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-19Remove support for CONFIG_HAS_UID and "forceenv" commandWolfgang Denk
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>
2010-09-19Add qsort - add support for sorting data arraysWolfgang Denk
Code adapted from uClibc-0.9.30.3 Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-08-04Rename getenv_r() into getenv_f()Wolfgang Denk
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>
2010-07-04Make sure that argv[] argument pointers are not modified.Wolfgang Denk
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>
2010-07-04Make *printf() return "int" instead of "void"Wolfgang Denk
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>
2010-05-07serial: punt unused serial_addr()Mike Frysinger
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>
2010-05-05allow print_size to print large numbers on 32-bit systemsTimur Tabi
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>
2010-04-13Rename lib_generic/ to lib/Peter Tyser
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>
2010-04-13Move lib_$ARCH directories to arch/$ARCH/libPeter Tyser
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>
2010-02-12ARM: Add support for EP93xx SoCsMatthias Kaehlcke
Add support for the Cirrus EP93xx platform Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net> Acked-by: Tom <Tom.Rix@windriver.com>
2010-01-31Add EP93xx ethernet driverMatthias Kaehlcke
Added ethernet driver for EP93xx SoCs Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2010-01-26Add support to disable cpu's in multicore processorsKumar Gala
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>
2010-01-18cmd_eeprom: I2C updatesHeiko Schocher
- 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>
2010-01-17Make getenv_IPaddr() globalDirk Behme
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>
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>