summaryrefslogtreecommitdiff
path: root/include/common.h
Commit message (Collapse)AuthorAgeLines
* IOMUX: Add console multiplexing support.Gary Jennejohn2008-12-07-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Consolidate MAX/MIN definitionsAndy Fleming2008-11-02-0/+3
| | | | | | | There were several, now there is one (two if you count the lower-case versions). Signed-off-by: Andy Fleming <afleming@freescale.com>
* strmhz(): Round numbers when printing clock frequenciesWolfgang Denk2008-10-21-2/+3
| | | | | | | | | 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>
* rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD2008-10-18-9/+9
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* BMW, PCIPPC2, PCIPPC6, RBC82: fix compile warningsWolfgang Denk2008-09-08-0/+3
| | | | | | missing doc_probe() prototype. Signed-off-by: Wolfgang Denk <wd@denx.de>
* ARM: Add arm1176 core with S3C6400 SoCGuennadi Liakhovetski2008-08-31-1/+2
| | | | | | Based on the original S3C64XX port by Samsung for U-Boot 1.1.6. Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
* Consolidate strmhz() implementationHaavard Skinnemoen2008-08-21-1/+3
| | | | | | | | | | 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>
* Update MTD to that of Linux 2.6.22.1William Juul2008-08-12-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix printf errors.Andrew Klossner2008-07-09-5/+10
| | | | | | | | | | | | 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>
* Make setenv() return statusSteven A. Falco2008-07-01-2/+2
| | | | | | | 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>
* Add ALIGN() macroAndy Fleming2008-06-28-0/+3
| | | | | | | 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>
* Change initdram() return type to phys_size_tBecky Bruce2008-06-12-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* Change print_size to take phys_size_tBecky Bruce2008-06-12-1/+1
| | | | Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
* Move definition of container_of() to common.hHaavard Skinnemoen2008-06-03-0/+11
| | | | | | | | | | | 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>
* Revert "Change env_get_char from a global function ptr to a function."Wolfgang Denk2008-05-12-1/+0
| | | | | This reverts commit c0559be371b2a64b1a817088c3308688e2182f93 which is known to break booting from dataflash and NAND.
* MPC8323ERDB: fix implicit declaration of function 'mac_read_from_eeprom'Wolfgang Denk2008-04-28-2/+0
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Merge branch 'master' of /home/wd/git/u-boot/lwmon5Wolfgang Denk2008-04-25-0/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * POST: move CONFIG_POST to MakefilesYuri Tikhonov2008-04-22-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Add support for calculating hashes with watchdog triggeringBartlomiej Sieka2008-04-25-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix show_boot_progress prototypeJean-Christophe PLAGNIOL-VILLARD2008-04-24-1/+1
| | | | | | | | | | | | | | | | 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>
* | 85xx: Round up frequency calculations to get reasonable outputKumar Gala2008-04-24-0/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* | crc32: use uint32_t rather than unsigned longMike Frysinger2008-04-24-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Change env_get_char from a global function ptr to a function.Joakim Tjernlund2008-04-17-0/+1
| | | | | | | | | | | | This avoids an early global data reference. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
* | 85xx: Update multicore boot mechanism to ePAPR v0.81 specKumar Gala2008-03-26-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | 85xx: Added support for multicore boot mechanismKumar Gala2008-03-26-0/+7
| | | | | | | | | | | | | | | | | | Added the cpu command that provides a generic mechanism to get status, reset, and release secondary cores in multicore processors. Added support for using the ePAPR defined spin-table mechanism on 85xx. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* | Merge branch 'new-image' of git://www.denx.de/git/u-boot-testingBartlomiej Sieka2008-03-26-4/+1
|\ \ | |/ |/| | | | | | | | | | | | | Conflicts: common/cmd_bootm.c cpu/mpc8xx/cpu.c Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
| * [new uImage] Add new uImage format support to autoscript routineMarian Balakowicz2008-03-12-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | autoscript() routine is updated to accept second argument, which is only used for FIT images and provides a FIT subimage unit name. autoscript() routine callers must now pass two arguments. For non-interactive use (like in cmd_load.c, cmd_net.c), new environment variable 'autoscript_uname' is introduced and used as a FIT subimage unit name source. autoscript command accepts extended syntax of the addr argument: addr:<subimg_uname> Signed-off-by: Marian Balakowicz <m8@semihalf.com>
| * [new uImage] Rename and move print_image_hdr() routineMarian Balakowicz2008-02-21-3/+0
| | | | | | | | Signed-off-by: Marian Balakowicz <m8@semihalf.com>
* | ppc4xx: Add basic support for AMCC 460EX/460GT (4/5)Stefan Roese2008-03-15-1/+3
|/ | | | | | This patch adds basic support for the AMCC 460EX/460GT PPC's. Signed-off-by: Stefan Roese <sr@denx.de>
* Fix compile warning on lib_ppc/board.cAnatolij Gustschin2008-02-15-1/+1
| | | | Signed-off-by: Anatolij Gustschin <agust@denx.de>
* Merge branch 'master' of git://www.denx.de/git/u-boot-blackfinWolfgang Denk2008-02-15-0/+3
|\ | | | | | | | | | | | | | | | | Conflicts: Makefile doc/README.standalone Signed-off-by: Wolfgang Denk <wd@denx.de>
| * always pull in asm/blackfin.h for Blackfin portsMike Frysinger2008-02-04-0/+3
| | | | | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | Mark board_init_[fr] as noreturnMike Frysinger2008-02-14-2/+2
| | | | | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | Remove duplicate defines for ARRAY_SIZEKumar Gala2008-02-14-0/+2
| | | | | | | | Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* | ARM: arm920/s3c24xx: IRQ demulitplexer callbackHarald Welte2008-02-04-0/+2
|/ | | | | | | | | | | This patch adds a IRQ demultiplexer callback to the arm920 cpu core code, plus a stub implementation of it for the S3C2410. The purpose is to allow arm920t implementations such as the s3c24x0 to implement interrupt handlers in u-boot without having to touch core arm920t code. Signed-off-by: Harald Welte <laforge@openmoko.org>
* MPC512X: Fixed typo in macro name.Grzegorz Bernacki2008-01-12-1/+1
| | | | Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
* Merge branch 'master' of /home/wd/git/u-boot/custodiansWolfgang Denk2008-01-09-0/+4
|\
| * API for external applications.Rafal Jaworowski2008-01-09-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an API for external (standalone) applications running on top of U-Boot, and is meant to be more extensible and robust than the existing jumptable mechanism. It is similar to UNIX syscall approach. See api/README for more details. Included is the demo application using this new framework (api_examples). Please note this is still an experimental feature, and is turned off by default. Signed-off-by: Rafal Jaworowski <raj@semihalf.com>
| * Globalize envmatch()Rafal Jaworowski2008-01-09-0/+1
| | | | | | | | | | | | | | The newly introduced API (routines related to env vars) will need to call it. Signed-off-by: Rafal Zabdyr <armo@semihalf.com>
* | Expose parse_line() globally.James Yang2008-01-09-0/+2
|/ | | | | | | | | | | Add new function readline_into_buffer() that allows the output of readline to be put into a pointer to char buffer. This refactoring allows other functions besides the main command loop to also use the same input mechanism. Signed-off-by: James Yang <James.Yang@freescale.com> Acked-by: Jon Loeliger <jdl@freescale.com>
* Merge branch 'master' of /home/stefan/git/u-boot/u-boot into for-1.3.2-ver2Stefan Roese2007-12-27-4/+6
|\
| * Merge branch 'master' of /home/wd/git/u-boot/custodiansWolfgang Denk2007-12-27-4/+5
| |\
| | * TQM885D: adjust for doubled flash sector size + some minor fixesMartin Krause2007-12-27-4/+5
| | | | | | | | | | | | Signed-off-by: Martin Krause <martin.krause@tqs.de>
| * | Handle Asynchronous DDR clock on 85xxKumar Gala2007-12-11-0/+1
| |/ | | | | | | | | | | | | | | | | | | The MPC8572 introduces the concept of an asynchronous DDR clock with regards to the platform clock. Introduce get_ddr_freq() to report the DDR freq regardless of sync/async mode. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* | Merge commit 'u-boot/master' into for-1.3.1Stefan Roese2007-12-11-8/+0
|\ \ | |/ | | | | | | | | Conflicts: drivers/rtc/Makefile
| * Revert "Correct relocation fixup for mpc5xx"Grant Likely2007-11-15-1/+0
| | | | | | | | | | This reverts commit 3649cd99ba815b6601868735765602f00ef3692b. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
| * Revert "Correct fixup relocation for MPC5xxx"Grant Likely2007-11-15-1/+0
| | | | | | | | | | This reverts commit 6f7576b20ecf0d040c3ac3b032b5cbc860e38a90. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
| * Revert "Correct fixup relocation for mpc8220"Grant Likely2007-11-15-1/+0
| | | | | | | | | | This reverts commit a85dd254c0577fca13627c46e93fc2ad4c4f1f00. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
| * Revert "Correct fixup relocation for mpc824x"Grant Likely2007-11-15-2/+0
| | | | | | | | | | This reverts commit f3a52fe05923935db86985daf9438e2f70ac39aa. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
| * Revert "Correct fixup relocation for mpc8260"Grant Likely2007-11-15-1/+0
| | | | | | | | | | This reverts commit 5af61b2f4b838a05f79be274f3e5a66edd2d9c96. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>