summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2015-08-08ddr: altera: Extract scc_mgr_set_hhp_extras()Marek Vasut
Move scc_mgr_set_hhp_extras() out of scc_set_bypass_mode() as it has nothing to do in there. Instead, invoke it from mem_calibrate() just before invoking scc_set_bypass_mode(). Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Clean up scc_mgr_set_hhp_extras()Marek Vasut
Minor coding style cleanup for this function. Furthermore, move ad-hoc debug_cond() calls from the only location from where this function is invoked into this actual function. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Clean up scc_mgr_*_delay() argsMarek Vasut
Zap args which are not used by these functions, in particular the write_group is often passed, but unused. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Clean up scc_mgr_apply_group_dq_out1_delay()Marek Vasut
Remove unused write_group and group_bgn argument from this function. Document the function using kerneldoc. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Clean up scc_mgr_set_oct_out1_delay()Marek Vasut
Make this function more readable, no functional change. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Clean up scc_set_bypass_mode()Marek Vasut
The mode argument of this function is not used at all, zap it. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Clean up scc_mgr_load_dqs_for_write_group()Marek Vasut
Make this function more readable, no functional change. Also, zap the forward declaration, which is no longer needed. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Implement universal scc_mgr_set_all_ranks()Marek Vasut
Implement universal scc_mgr_set_all_ranks() function and convert various ad-hoc implementations of similar functionality to use this single function. Document the function in kerneldoc. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Shuffle around scc_mgr_set_*all_ranks()Marek Vasut
Shuffle the code around a bit, but without any functional change. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Clean up scc_mgr_initialize()Marek Vasut
Clean up the comments and add kerneldoc. No functional change. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Implement universal scc manager config functionMarek Vasut
Implement unified scc_mgr_set() function and convert all those 9 scc_mgr_set_*() ad-hoc functions to call this one function. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Reorder scc manager functionsMarek Vasut
This patch just puts functions which look similar next to each other, so they can be sorted out. No functional change. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Clean up scc manager function argsMarek Vasut
Clean up the unused args of the functions used to configure the SCC manager. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Clean up reg_file_set*()Marek Vasut
Turn the insides of these functions into trivial clrsetbits_le32() and fix the data type of their argument to reflect it's actual size. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Clean up initialize_hps_phy()Marek Vasut
Add brief kerneldoc. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Clean up initialize_reg_file()Marek Vasut
Add brief kerneldoc. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Clean up hc_initialize_rom_data()Marek Vasut
Clean the function up, fix data types, add kerneldoc. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Massage addr into I/O accessorsMarek Vasut
Get rid of invocations of this sort: addr = (u32)&base->reg; writel(val, addr); Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Stop using SDR_CTRLGRP_ADDRESS directlyMarek Vasut
Use the proper structure which describes these registers, especially since this is already in place. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Wrap SOCFPGA_SDR_ADDRESS into SDR_PHYGRP.*ADDRESSMarek Vasut
Just trim down the constant SOCFPGA_SDR_ADDRESS + SDR_PHYGRP.*ADDRESS in the code. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Pluck out remaining sdr_get_addr() callsMarek Vasut
Remove the remaining invocations of sdr_get_addr() and the function itself. This makes the code a bit less cryptic. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Dissolve invocation of sdr_get_addr(&sdr_mgr_.*->.*)Marek Vasut
Instead of this indirection, just adjust the register pointer and directly use the register base address. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Dissolve invocation of sdr_get_addr(&sdr_rw_load.*->.*)Marek Vasut
Instead of this indirection, just adjust the register pointer and directly use the register base address. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Dissolve invocation of sdr_get_addr(&sdr_scc_mgr->.*)Marek Vasut
Instead of this indirection, just adjust the register pointer and directly use the register base address. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Dissolve invocation of sdr_get_addr(&sdr_reg_file->.*)Marek Vasut
Instead of this indirection, just adjust the register pointer and directly use the register base address. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Zap invocation of sdr_get_addr((u32 *)BASE_RW_MGR)"Marek Vasut
Instead of this indirection, just adjust the register pointer and directly use the register base address. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Clean up ugly casts in sdram_calibration_full()Marek Vasut
Use the correct formating string in those debug_cond() invocations and zap those unnecessary ugly casts. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Minor indent fix in set_rank_and_odt_mask()Marek Vasut
Fix the position of the } else { statement to make it correctly indented. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08ddr: altera: Fix debug message format in sequencerMarek Vasut
The debug messages missed proper newlines and/or spaces in them. Fix the formatting. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@altera.com> Cc: Dinh Nguyen <dinguyen@altera.com> Cc: Tom Rini <trini@konsulko.com>
2015-08-08ddr: altera: Fix typo in mp_threshold1 programmingMarek Vasut
It is the configuration data that should go into the register, not the register mask, just like the surrounding code does it. Fix this typo. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@altera.com> Cc: Dinh Nguyen <dinguyen@altera.com> Cc: Tom Rini <trini@konsulko.com>
2015-08-08ddr: altera: Move struct sdram_prot_rule prototypeMarek Vasut
Move the structure prototype from sdram.h header file into sdram.c source file, since it is used only there and for local purpose only. There is no point in having it global. While at this move, fix the data types in the structure from uintNN_t to uNN and fix the coding style a bit. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08arm: socfpga: Move sdram_config.h to board dirMarek Vasut
This file is absolutelly positively board specific, so move it into the correct place. Signed-off-by: Marek Vasut <marex@denx.de>
2015-08-08driver/ddr/altera: Add the sdram calibration portionDinh Nguyen
This patch adds the DDR calibration portion of the Altera SDRAM driver. Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
2015-08-08driver/ddr/altera: Add DDR driver for Altera's SDRAM controllerDinh Nguyen
This patch enables the SDRAM controller that is used on Altera's SoCFPGA family. This patch configures the SDRAM controller based on a configuration file that is generated from the Quartus tool, sdram_config.h. Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
2015-08-08net: designware: Rename the driver var name to eth_designwareMarek Vasut
The driver variable name is eth_sandbox, which is probably a copy-paste mistake. Fix it. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Dinh Nguyen <dinguyen@opensource.altera.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2015-08-08net: designware: Add SoCFPGA GMAC DT compatible stringMarek Vasut
Add the OF compatible property to match the SoCFPGA GMAC. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Dinh Nguyen <dinguyen@opensource.altera.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2015-08-08arm: socfpga: Fix FPGA bitstream programming routineMarek Vasut
In case the FPGA bitstream is aligned to 4 bytes, skip the part of the assembler which handles unaligned bitstream. Otherwise, that part will loop indefinitelly. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
2015-08-06Merge git://git.denx.de/u-boot-dmTom Rini
2015-08-06dm: core: Add a way to set a device nameSimon Glass
Some devices are bound entirely by probing and do not have the benefit of a device tree to give them a name. This is very common with PCI and USB. In most cases this is fine, but we should add an official way to set a device name. This should be called in the device's bind() method. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2015-08-06devres: add debug command to dump device resourcesMasahiro Yamada
This new command can dump all device resources associated to each device. The fields in every line shows: - The address of the resource - The size of the resource - The name of the release function - The stage in which the resource has been acquired (BIND/PROBE) Currently, there is no driver using devres, but if such drivers are implemented, the output of this command should look like this: => dm devres - root_driver - soc - extbus - serial@54006800 bfb541e8 (8 byte) devm_kmalloc_release BIND bfb54440 (4 byte) devm_kmalloc_release PROBE bfb54460 (4 byte) devm_kmalloc_release PROBE - serial@54006900 bfb54270 (8 byte) devm_kmalloc_release BIND - gpio@55000000 - i2c@58780000 bfb5bce8 (12 byte) devm_kmalloc_release PROBE bfb5bd10 (4 byte) devm_kmalloc_release PROBE - eeprom bfb54418 (12 byte) devm_kmalloc_release BIND Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-08-06devres: make Devres optional with CONFIG_DEVRESMasahiro Yamada
Currently, Devres requires additional 16 byte for each allocation, which is not so insignificant in some cases. Add CONFIG_DEVRES to make this framework optional. If the option is disabled, devres functions fall back to non-managed variants. For example, devres_alloc() to kzalloc(), devm_kmalloc() to kmalloc(), etc. Because devres_head is also surrounded by an ifdef conditional, there is no memory overhead when CONFIG_DEVRES is disabled. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Suggested-by: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
2015-08-06devres: add devm_kmalloc() and friends (managed memory allocators)Masahiro Yamada
devm_kmalloc() is identical to kmalloc() except that the memory allocated with it is managed and will be automatically released when the device is removed/unbound. Likewise for the other variants. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-08-06devres: introduce Devres (Managed Device Resource) frameworkMasahiro Yamada
In U-Boot's driver model, memory is basically allocated and freed in the core framework. So, low level drivers generally only have to specify the size of needed memory with .priv_auto_alloc_size, .platdata_auto_alloc_size, etc. Nevertheless, some drivers still need to allocate/free memory on their own in case they cannot statically know the necessary memory size. So, I believe it is reasonable enough to port Devres into U-boot. Devres, which originates in Linux, manages device resources for each device and automatically releases them on driver detach. With devres, device resources are guaranteed to be freed whether initialization fails half-way or the device gets detached. The basic idea is totally the same to that of Linux, but I tweaked it a bit so that it fits in U-Boot's driver model. In U-Boot, drivers are activated in two steps: binding and probing. Binding puts a driver and a device together. It is just data manipulation on the system memory, so nothing has happened on the hardware device at this moment. When the device is really used, it is probed. Probing initializes the real hardware device to make it really ready for use. So, the resources acquired during the probing process must be freed when the device is removed. Likewise, what has been allocated in binding should be released when the device is unbound. The struct devres has a member "probe" to remember when the resource was allocated. CONFIG_DEBUG_DEVRES is also supported for easier debugging. If enabled, debug messages are printed each time a resource is allocated/freed. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-08-06dm: add DM_FLAG_BOUND flagMasahiro Yamada
Currently, we only have DM_FLAG_ACTIVATED to indicate the device status, but we still cannot know in which stage is in progress, binding or probing. This commit introduces a new flag, DM_FLAG_BOUND, which is set when the device is really bound, and cleared when it is unbound. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-08-06dm: Support address translation for simple-busSimon Glass
The 'ranges' property can be used to specify a translation from the system address to the bus address. Add support for this using the dev_get_addr() function, which devices should use to find their address. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-06net: smsc95xx: Add driver-model supportSimon Glass
Add support for driver model, so that CONFIG_DM_ETH can be defined and used with this driver. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-06net: smsc95xx: Prepare for conversion to driver modelSimon Glass
At present struct eth_device is passed around all over the place. This does not exist with driver model. Add explicit arguments instead, so that with driver model we can pass the correct things. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-06net: smsc95xx: Correct the error numbersSimon Glass
Instead of returning -1 on error, we should use a proper error number. Fix the code to conform to this. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-06net: smsc95xx: Rename AX_RX_URB_SIZE to RX_URB_SIZESimon Glass
The AX_ prefix comes from the Asix driver. Since this is not that, we should avoid this confusing prefix. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-08-06net: smsc95xx: Sort the include filesSimon Glass
Tidy up the include file order before adding more. Signed-off-by: Simon Glass <sjg@chromium.org>