summaryrefslogtreecommitdiff
path: root/include/asm-generic
Commit message (Collapse)AuthorAgeLines
* m68k: Add generic board support for MCF547X/8X and MCF5445XAlison Wang2015-03-05-1/+6
| | | | | | | | This patch adds generic board support for MCF547X/8X and MCF5445X. It is based on the patch about common generic board support for M68K architecture sent by Angelo. Signed-off-by: Alison Wang <alison.wang@freescale.com>
* m68k: add generic-board supportangelo@sysam.it2015-03-05-1/+1
| | | | | | Add generic-board support for the m68k architecture. Signed-off-by: Angelo Dureghello <angelo@sysam.it>
* avr32: add generic board supportAndreas Bießmann2015-02-17-0/+4
| | | | Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
* Merge branch 'master' of git://git.denx.de/u-boot-ubiTom Rini2015-02-04-0/+260
|\
| * ubifs: Import atomic_long operations from LinuxAnton Habegger2015-01-28-0/+260
| | | | | | | | | | | | | | | | | | | | This commit is a preperation for a subsequent UBIFS commit which needs atomic_long operations. Therefor "include/asm-generic/atomic-long.h" is imported from 1860e37 Linux 3.15 Signed-off-by: Anton Habegger <anton.habegger@gmail.com>
* | Export redesignMartin Dorwig2015-01-29-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is an atempt to make the export of functions typesafe. I replaced the jumptable void ** by a struct (jt_funcs) with function pointers. The EXPORT_FUNC macro now has 3 fixed parameters and one variadic parameter The first is the name of the exported function, the rest of the parameters are used to format a functionpointer in the jumptable, the EXPORT_FUNC macros are expanded three times, 1. to declare the members of the struct 2. to initialize the structmember pointers 3. to call the functions in stubs.c Signed-off-by: Martin Dorwig <dorwig@tetronik.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> (resending to the list since my tweaks are not quite trivial)
* | dm: gpio: Mark the old GPIO API deprecatedSimon Glass2015-01-29-0/+21
| | | | | | | | | | | | | | Add a deprecation notice to each function so that it is more obvious that we are moving GPIOs to driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: gpio: Add better functions to request GPIOsSimon Glass2015-01-29-0/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present U-Boot sort-of supports the standard way of reading GPIOs from device tree nodes, but the support is incomplete, a bit clunky and only works for GPIO bindings where #gpio-cells is 2. Add new functions to request GPIOs, taking full account of the device tree binding. These permit requesting a GPIO with a simple call like: gpio_request_by_name(dev, "cd-gpios", 0, &desc, GPIOD_IS_IN); This will request the GPIO, looking at the device's node which might be this, for example: cd-gpios = <&gpio TEGRA_GPIO(B, 3) GPIO_ACTIVE_LOW>; The GPIO will be set to input mode in this case and polarity will be honoured by the GPIO calls. It is also possible to request and free a list of GPIOs. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: gpio: Add a driver GPIO translation methodSimon Glass2015-01-29-0/+29
| | | | | | | | | | | | | | | | | | Only the GPIO driver knows about the full GPIO device tree binding used by a device. Add a method to allow the driver to provide this information to the uclass, including the GPIO offset within the device and flags such as the polarity. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: gpio: Add a native driver model APISimon Glass2015-01-29-0/+16
|/ | | | | | | | | | | | | | | | | | | | | | | So far driver model's GPIO uclass just implements the existing GPIO API. This has some limitations: - it requires manual device tree munging to support GPIOs in device tree (fdtdec_get_gpio() and friends) - it does not understand polarity - it is somewhat slower since we must scan for the GPIO device each time - Global GPIO numbering can change if other GPIO drivers are probed - it requires extra steps to set the GPIO direction and value The new functions have a dm_ prefix where necessary to avoid name conflicts but we can remove that when it is no-longer needed. The new struct gpio_desc holds all required information about the GPIO. For now this is intended to be stored by the client requesting the GPIO, but in future it might be brought into the uclass in some way. With these changes the old GPIO API still works, and uses the driver model API underneath. Signed-off-by: Simon Glass <sjg@chromium.org>
* pci: Make pci apis usable before relocationBin Meng2015-01-12-0/+6
| | | | | | | | | | | | | | Introduce a gd->hose to save the pci hose in the early phase so that apis in drivers/pci/pci.c can be used before relocation. Architecture codes need assign a valid gd->hose in the early phase. Some variables are declared as static so change them to be either stack variable or global data member so that they can be used before relocation, except the 'indent' used by CONFIG_PCI_SCAN_SHOW which just affects some print format. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-dmTom Rini2014-11-24-0/+1
|\ | | | | | | | | | | | | Conflicts: drivers/serial/serial-uclass.c Signed-off-by: Tom Rini <trini@ti.com>
| * dm: Split the simple malloc() implementation into its own fileSimon Glass2014-11-21-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The simple malloc() implementation is used when memory is tight. It provides a simple buffer with an incrementing pointer. At present the implementation is inside dlmalloc. Move it into its own file so that it is easier to find. Rather than using relocation as a signal that the full malloc() is available, add a special GD_FLG_FULL_MALLOC_INIT flag. This signals that the simple malloc() should no longer be used. In some cases, such as SPL, even the code space used by the full malloc() is wasteful. Add a CONFIG_SYS_MALLOC_SIMPLE option to provide only the simple malloc. In this case the full malloc is not available at all. It saves about 1KB of code space and about 0.5KB of data on Thumb 2. Acked-by: Tom Rini <trini@ti.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: gpio: Add a function to read an ID from a list of GPIOsSimon Glass2014-11-21-1/+10
| | | | | | | | | | | | | | | | | | | | | | For board IDs a common approach is to set aside several GPIOs for use in determining the board ID. This can provide information about board features and the revision. Add a function that turns a list of GPIOs into an integer by assigning each GPIO to a single bit. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: serial: Move current serial port pointer to global_dataSimon Glass2014-11-21-0/+1
|/ | | | | | | | | | | In general we can't store things in the data section until we have inited SDRAM. Some platforms allow this (e.g. those with SPL) but some don't. Move the pointer to global_data so that it will work on all platforms. Without this fix the serial port will not work prior to relocation with driver model on some platforms. Signed-off-by: Simon Glass <sjg@chromium.org>
* ppc: Zap Hymod boardMarek Vasut2014-10-27-3/+0
| | | | | | | | | | | | | | | Remove this board as this is the only one last user of eeprom_probe(), which is pretty non-standard stuff. This patch also removes all the PHP, SQL and CSS stuff from U-Boot, which probably makes U-Boot a bit less IoT ;-) Signed-off-by: Marek Vasut <marex@denx.de> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Tom Rini <trini@ti.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Heiko Schocher <hs@denx.de>
* Merge git://git.denx.de/u-boot-dmTom Rini2014-10-26-3/+67
|\ | | | | | | | | | | | | | | | | Fix a trivial conflict over adding <dm.h> Conflicts: arch/arm/cpu/armv7/omap3/board.c Signed-off-by: Tom Rini <trini@ti.com>
| * dm: gpio: Remove unused get_state() uclass methodSimon Glass2014-10-23-2/+0
| | | | | | | | | | | | This is no longer used so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: gpio: Add gpio_requestf() helper for printf() stringsSimon Glass2014-10-23-0/+10
| | | | | | | | | | | | | | Add a helper which permits a printf()-style format string for the requester string. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: Move the function for getting GPIO status into the uclassSimon Glass2014-10-23-0/+18
| | | | | | | | | | | | This function can be more easily tested if it is in the uclass. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: gpio: Add gpio_get_function() and friendsSimon Glass2014-10-23-1/+33
| | | | | | | | | | | | Add helpers to the uclass to allow finding out the pin function. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: gpio: Implement GPIO reservation in the uclassSimon Glass2014-10-23-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | We have several GPIO drivers now and all are doing similar things to record which GPIOs are reserved. Move this logic into the uclass to make the drivers similar. We retain the request()/free() methods since currently one driver does use these for setting up the pin. Signed-off-by: Simon Glass <sjg@chromium.org>
* | gpio: add protype for name_to_gpioJeroen Hofstee2014-10-25-0/+2
|/ | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* gpio: header file comment spelling fixesMarcel Ziswiler2014-10-22-5/+5
| | | | | | Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
* dm: gpio: Enhance gpio command to show only active GPIOsSimon Glass2014-08-31-2/+13
| | | | | | | | | | | | The GPIO list is very long in many cases and most of them are not used. By default, show only the GPIOs that are in use, and provide a flag to show all of them. This makes the 'gpio status' command much more pleasant. In order to do this, driver model now exposes a method for obtaining the 'function' of a GPIO, which describes whether it is an input or output, for example. Implementation of this method is optional. Signed-off-by: Simon Glass <sjg@chromium.org>
* Add a flag indicating when the serial console is readySimon Glass2014-07-23-0/+1
| | | | | | | | | | For sandbox we have a fallback console which is used very early in U-Boot, before serial drivers are available. Rather than try to guess when to switch to the real console, add a flag so we can be sure. This makes sure that sandbox can always output a panic() message, for example, and avoids silent failure (which is very annoying in sandbox). Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Support driver model prior to relocationSimon Glass2014-07-23-1/+2
| | | | | | | Initialise devices marked 'pre-reloc' and make them available prior to relocation. Note that this requires pre-reloc malloc() to be available. Signed-off-by: Simon Glass <sjg@chromium.org>
* Add a simple malloc() implementation for pre-relocationSimon Glass2014-07-23-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we are to have driver model before relocation we need to support some way of calling memory allocation routines. The standard malloc() is pretty complicated: 1. It uses some BSS memory for its state, and BSS is not available before relocation 2. It supports algorithms for reducing memory fragmentation and improving performace of free(). Before relocation we could happily just not support free(). 3. It includes about 4KB of code (Thumb 2) and 1KB of data. However since this has been loaded anyway this is not really a problem. The simplest way to support pre-relocation malloc() is to reserve an area of memory and allocate it in increasing blocks as needed. This implementation does this. To enable it, you need to define the size of the malloc() pool as described in the README. It will be located above the pre-relocation stack on supported architectures. Note that this implementation is only useful on machines which have some memory available before dram_init() is called - this includes those that do no DRAM init (like tegra) and those that do it in SPL (quite a few boards). Enabling driver model preior to relocation for the rest of the boards is left for a later exercise. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: rename device struct to udeviceHeiko Schocher2014-05-27-12/+12
| | | | | | | | | | | | using UBI and DM together leads in compiler error, as both define a "struct device", so rename "struct device" in include/dm/device.h to "struct udevice", as we use linux code (MTD/UBI/UBIFS some USB code,...) and cannot change the linux "struct device" Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Marek Vasut <marex@denx.de>
* bd_info: remove bi_barudrate member from struct bd_infoMasahiro Yamada2014-05-12-1/+0
| | | | | | | | | | | | | | | | | gd->bd->bi_baudrate is a copy of gd->baudrate. Since baudrate is a common feature for all architectures, keep gd->baudrate only. It is true that bi_baudrate was passed to the kernel in that structure but it was a long time ago. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Tom Rini <trini@ti.com> Cc: Simon Glass <sjg@chromium.org> Cc: Wolfgang Denk <wd@denx.de> Cc: Heiko Schocher <hs@denx.de> Acked-by: Michal Simek <monstr@monstr.eu> (For microblaze)
* driver/mxc_i2c: Move static data structure to global_dataYork Sun2014-04-29-0/+3
| | | | | | | | | This driver needs a data structure in SRAM before SDRAM is available. This is not alway the case using .data section. Moving this data structure to global_data guarantees it is writable. Signed-off-by: York Sun <yorksun@freescale.com> CC: Troy Kisky <troy.kisky@boundarydevices.com>
* powerpc: remove NX823 board supportMasahiro Yamada2014-04-18-3/+0
| | | | | | | | | | | Enough time has passed since this board was moved to Orphan. Remove. - Remove board/nx823/* - Remove include/configs/NX823.h - Clean-up ifdef(CONFIG_NX823) - Move the entry from boards.cfg to doc/README.scrapyard Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* powerpc: mpc8260: consolidate CONFIG_MPC8260 and CONFIG_8260Masahiro Yamada2014-03-07-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Before this commit, CONFIG_MPC8260 and CONFIG_8260 were used mixed-up. All boards with mpc8260 cpu defined both of them: - CONFIG_MPC8260 was defined in board config headers and include/common.h - CONFIG_8260 was defined arch/powerpc/cpu/mpc8260/config.mk We do not need to have both of them. This commit keeps only CONFIG_MPC8260. This commit does: - Delete CONFIG_8260 and CONFIG_MPC8260 definition in config headers and include/common.h - Rename CONFIG_8260 to CONFIG_MPC8260 in arch/powerpc/cpu/mpc8260/config.mk. - Rename #ifdef CONFIG_8260 to #ifdef CONFIG_MPC8260 Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Wolfgang Denk <wd@denx.de>
* dm: Add GPIO support and testsSimon Glass2014-03-04-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | Add driver model support for GPIOs. Since existing GPIO drivers do not use driver model, this feature must be enabled by CONFIG_DM_GPIO. After all GPO drivers are converted over we can perhaps remove this config. Tests are provided for the sandbox implementation, and are a sufficient sanity check for basic operation. The GPIO uclass understands the concept of named banks of GPIOs, with each GPIO device providing a single bank. Within each bank the GPIOs are numbered using an offset from 0 to n-1. For example a bank named 'b' with 20 offsets will provide GPIOs named b0 to b19. Anonymous GPIO banks are also supported, and are just numbered without any prefix. Each time a GPIO driver is added to the uclass, the GPIOs are renumbered accordinging, so there is always a global GPIO numbering order. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com> Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com> Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
* dm: Add base driver model supportSimon Glass2014-03-04-0/+8
| | | | | | | | | | | | | | | | Add driver model functionality for generic board. This includes data structures and base code for registering devices and uclasses (groups of devices with the same purpose, e.g. all I2C ports will be in the same uclass). The feature is enabled with CONFIG_DM. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com> Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com> Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
* arm: remove unneeded symbol offsets and _TEXT_BASEAlbert ARIBAUD2014-02-26-19/+7
| | | | | | | | Remove the last uses of symbol offsets in ARM U-Boot. Remove some needless uses of _TEXT_BASE. Remove all _TEXT_BASE definitions. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
* include: delete unused header filesMasahiro Yamada2014-01-24-28/+0
| | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* Introduce common timer functionsRob Herring2013-11-04-0/+2
| | | | | | | | | | | | | | | Many platforms duplicate pretty much the same timer code yet they all have a 32-bit freerunning counter register. Create a common implementation that minimally requires 2 or 3 defines to add timer support: CONFIG_SYS_TIMER_RATE - Clock rate of the timer counter CONFIG_SYS_TIMER_COUNTER - Address of 32-bit counter CONFIG_SYS_TIMER_COUNTS_DOWN - Define if counter counts down All functions are weak or ifdef'ed so they can still be overriden by any platform. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* ppc4xx: Remove support for PPC405CR CPUsMatthias Fuchs2013-08-20-1/+0
| | | | | | | This patch removes support for the APM 405CR CPU. This CPU is EOL and no board uses this chip. Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
* Merge branch 'master' of git://git.denx.de/u-boot-i2cTom Rini2013-07-24-0/+3
|\ | | | | | | | | | | | | | | | | | | | | The sandburst-specific i2c drivers have been deleted, conflict was just over the SPDX conversion. Conflicts: board/sandburst/common/ppc440gx_i2c.c board/sandburst/common/ppc440gx_i2c.h Signed-off-by: Tom Rini <trini@ti.com>
| * i2c: add i2c_core and prepare for new multibus supportHeiko Schocher2013-07-23-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This Patch introduce the new i2c_core file, which holds the I2C core functions, for the rework of the multibus/ multiadapter support. Also adds changes in i2c.h for the new I2C multibus/multiadapter support. This new support can be activated with the CONFIG_SYS_I2C define. Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Stephen Warren <swarren@wwwdotorg.org>
* | Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-24-80/+5
|/ | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* Add trace support to generic boardSimon Glass2013-06-26-0/+3
| | | | | | | | | | | Add hooks for tracing to generic board, including: - allow early tracing to start early as possible in U-Boot - reserve memory for trace buffer - copy early trace buffer to main trace buffer after relocation - setup full tracing support after relocation Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2013-06-22-3/+0
|\
| * remove all references to .dynsymAlbert ARIBAUD2013-06-21-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Discard all .dynsym sections from linker scripts Remove all __dynsym_start definitions from linker scripts Remove all __dynsym_start references from the codebase Note: this touches include/asm-generic/sections.h, which is not ARM-specific, but actual uses of __dynsym_start are only in ARM, so this patch can safely go through the ARM repository. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Tested-by: Lubomir Popov <lpopov@mm-sol.com> Tested-by: Jeroen Hofstee <jeroen@myspectrum.nl> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | generic_board: reduce the redundancy of gd_t struct membersMasahiro Yamada2013-06-07-3/+0
|/ | | | | | | | | | | | | | | | | | | | | | This commit refactors common/board_f.c and common/board_r.c in order to delete the dest_addr and dest_addr_sp from gd_t struct. As mentioned as follows in include/asm-generic/global_data.h, /* TODO: is this the same as relocaddr, or something else? */ unsigned long dest_addr; /* Post-relocation address of U-Boot */ dest_addr is the same as relocaddr. Likewise, dest_addr_sp is the same as start_addr_sp. It seemed dest_addr/dest_addr_sp was used only as a scratch variable to calculate relocaddr/start_addr_sp, respectively. With a little refactoring, we can delete dest_addr and dest_addr_sp. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org>
* Power: remove support for Freescale MPC8220Wolfgang Denk2013-05-15-8/+0
| | | | | | | | | | The Freescale MPC8220 Power Architecture processors have long reached EOL; Freescale does not even list these any more on their web site. Remove the code to avoid wasting maitaining efforts on dead stuff. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Andy Fleming <afleming@gmail.com>
* sandbox: Switch over to generic boardSimon Glass2013-05-01-1/+1
| | | | | | | | | Add generic board support for sandbox. and remove the old board init code. Select CONFIG_SYS_GENERIC_BOARD for sandbox now that this is supported. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* Use 'unsigned int' for global_data's baudrateSimon Glass2013-03-15-1/+1
| | | | | | | | We decided to used unsigned int here, rather than unsigned long. But for the generic global_data it is still unsigned long. So change it over. Signed-off-by: Simon Glass <sjg@chromium.org>
* Introduce generic pre-relocation board_f.cSimon Glass2013-03-15-0/+2
| | | | | | | | | | | | This file handles common pre-relocation init for boards which use the generic framework. It starts up the console, DRAM, performs relocation and then jumps to post-relocation init. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Wolfgang Denk <wd@denx.de> Acked-by: Wolfgang Denk <wd@denx.de>