summaryrefslogtreecommitdiff
path: root/drivers
Commit message (Collapse)AuthorAgeLines
* ddr: altera: Rework initialize_tracking()Marek Vasut2015-08-08-53/+35
| | | | | | | | | | Clean the function up by getting rid of all the insane XOR-leftshift combos when assembling register values. While at it, remove all the ad-hoc variables necessary for this XOR-leftshift voodoo. Finally, get rid of the iterative division implementation of two constants and replace it with a DIV_ROUND_UP() macro :-) Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Fix ad-hoc iterative division implementationMarek Vasut2015-08-08-9/+2
| | | | | | | | Contemporary CPUs can perform division just fine, use this functionality and zap another implementation of iterative division :-) Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Minor clean up of set_jump_as_return()Marek Vasut2015-08-08-4/+8
| | | | | | Add kerneldoc and do a minor comment cleanup. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Factor out common codeMarek Vasut2015-08-08-99/+76
| | | | | | | | Factor out almost common code from rw_mgr_mem_handoff() and rw_mgr_mem_initialize() into separate rw_mgr_mem_load_user(). No functional change. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Factor out instruction loading from rw_mgr_mem_initialize()Marek Vasut2015-08-08-37/+37
| | | | | | Pull the duplicate code out into a separate function. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Clean up scc_mgr_apply_group_all_out_delay_add_all_ranks()Marek Vasut2015-08-08-9/+13
| | | | | | | Zap unused group_bgn parameter, fix and constify data types. Document in kerneldoc. No functional change. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Internal scc_mgr_apply_group_all_out_delay_add() cleanup part 2Marek Vasut2015-08-08-26/+24
| | | | | | | | | Clean the DQS and OCT parts of the function, clean up the chopped formatting strings in debug_cond() and slightly improve the code. Zap group_bgn argument as it is used only in debug messages. Document the function using kerneldoc. No functional change. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Internal scc_mgr_apply_group_all_out_delay_add() cleanup part 1Marek Vasut2015-08-08-35/+9
| | | | | | | | | | | | | | Apparently, in case of the DQ and DM, the value if the new_delay variable is calculated, but the value is not used. Zap the entire code which does calculate the value. It is not clear to me whether or not the code is doing the right thing in the first place. Right now, it calls scc_mgr_load_dq() and scc_mgr_load_dm() respectively, but I suspect it might need to call scc_mgr_apply_group_dq_out1_delay() and scc_mgr_apply_group_dm_out1_delay() instead. This is something Altera must investigate. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Clean up scc_mgr_zero_group()Marek Vasut2015-08-08-18/+21
| | | | | | | | First, zap unused argument of the function. Next, clean up the data types, constify where applicable, clean up comments and add kerneldoc. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Clean up scc_mgr_zero_all()Marek Vasut2015-08-08-8/+9
| | | | | | Add kerneldoc, clean up datatypes and fix minor indentation issue. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Extract scc_mgr_set_hhp_extras()Marek Vasut2015-08-08-4/+4
| | | | | | | | 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>
* ddr: altera: Clean up scc_mgr_set_hhp_extras()Marek Vasut2015-08-08-15/+22
| | | | | | | | 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>
* ddr: altera: Clean up scc_mgr_*_delay() argsMarek Vasut2015-08-08-18/+14
| | | | | | | 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>
* ddr: altera: Clean up scc_mgr_apply_group_dq_out1_delay()Marek Vasut2015-08-08-9/+12
| | | | | | | Remove unused write_group and group_bgn argument from this function. Document the function using kerneldoc. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Clean up scc_mgr_set_oct_out1_delay()Marek Vasut2015-08-08-9/+14
| | | | | | Make this function more readable, no functional change. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Clean up scc_set_bypass_mode()Marek Vasut2015-08-08-11/+14
| | | | | | The mode argument of this function is not used at all, zap it. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Clean up scc_mgr_load_dqs_for_write_group()Marek Vasut2015-08-08-11/+15
| | | | | | | 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>
* ddr: altera: Implement universal scc_mgr_set_all_ranks()Marek Vasut2015-08-08-53/+42
| | | | | | | | 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>
* ddr: altera: Shuffle around scc_mgr_set_*all_ranks()Marek Vasut2015-08-08-11/+8
| | | | | | Shuffle the code around a bit, but without any functional change. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Clean up scc_mgr_initialize()Marek Vasut2015-08-08-4/+10
| | | | | | Clean up the comments and add kerneldoc. No functional change. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Implement universal scc manager config functionMarek Vasut2015-08-08-40/+29
| | | | | | | 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>
* ddr: altera: Reorder scc manager functionsMarek Vasut2015-08-08-100/+95
| | | | | | | 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>
* ddr: altera: Clean up scc manager function argsMarek Vasut2015-08-08-17/+13
| | | | | | | Clean up the unused args of the functions used to configure the SCC manager. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Clean up reg_file_set*()Marek Vasut2015-08-08-36/+7
| | | | | | | 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>
* ddr: altera: Clean up initialize_hps_phy()Marek Vasut2015-08-08-0/+5
| | | | | | Add brief kerneldoc. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Clean up initialize_reg_file()Marek Vasut2015-08-08-0/+5
| | | | | | Add brief kerneldoc. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Clean up hc_initialize_rom_data()Marek Vasut2015-08-08-10/+10
| | | | | | Clean the function up, fix data types, add kerneldoc. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Massage addr into I/O accessorsMarek Vasut2015-08-08-424/+248
| | | | | | | | Get rid of invocations of this sort: addr = (u32)&base->reg; writel(val, addr); Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Stop using SDR_CTRLGRP_ADDRESS directlyMarek Vasut2015-08-08-15/+9
| | | | | | | Use the proper structure which describes these registers, especially since this is already in place. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Wrap SOCFPGA_SDR_ADDRESS into SDR_PHYGRP.*ADDRESSMarek Vasut2015-08-08-235/+235
| | | | | | | Just trim down the constant SOCFPGA_SDR_ADDRESS + SDR_PHYGRP.*ADDRESS in the code. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Pluck out remaining sdr_get_addr() callsMarek Vasut2015-08-08-119/+75
| | | | | | | 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>
* ddr: altera: Dissolve invocation of sdr_get_addr(&sdr_mgr_.*->.*)Marek Vasut2015-08-08-26/+26
| | | | | | | Instead of this indirection, just adjust the register pointer and directly use the register base address. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Dissolve invocation of sdr_get_addr(&sdr_rw_load.*->.*)Marek Vasut2015-08-08-63/+63
| | | | | | | Instead of this indirection, just adjust the register pointer and directly use the register base address. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Dissolve invocation of sdr_get_addr(&sdr_scc_mgr->.*)Marek Vasut2015-08-08-45/+45
| | | | | | | Instead of this indirection, just adjust the register pointer and directly use the register base address. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Dissolve invocation of sdr_get_addr(&sdr_reg_file->.*)Marek Vasut2015-08-08-22/+24
| | | | | | | Instead of this indirection, just adjust the register pointer and directly use the register base address. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Zap invocation of sdr_get_addr((u32 *)BASE_RW_MGR)"Marek Vasut2015-08-08-3/+3
| | | | | | | Instead of this indirection, just adjust the register pointer and directly use the register base address. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Clean up ugly casts in sdram_calibration_full()Marek Vasut2015-08-08-29/+21
| | | | | | | Use the correct formating string in those debug_cond() invocations and zap those unnecessary ugly casts. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Minor indent fix in set_rank_and_odt_mask()Marek Vasut2015-08-08-1/+1
| | | | | | | Fix the position of the } else { statement to make it correctly indented. Signed-off-by: Marek Vasut <marex@denx.de>
* ddr: altera: Fix debug message format in sequencerMarek Vasut2015-08-08-7/+7
| | | | | | | | | | 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>
* ddr: altera: Fix typo in mp_threshold1 programmingMarek Vasut2015-08-08-1/+1
| | | | | | | | | | | 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>
* ddr: altera: Move struct sdram_prot_rule prototypeMarek Vasut2015-08-08-0/+13
| | | | | | | | | | | 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>
* arm: socfpga: Move sdram_config.h to board dirMarek Vasut2015-08-08-1/+6
| | | | | | | This file is absolutelly positively board specific, so move it into the correct place. Signed-off-by: Marek Vasut <marex@denx.de>
* driver/ddr/altera: Add the sdram calibration portionDinh Nguyen2015-08-08-0/+4985
| | | | | | This patch adds the DDR calibration portion of the Altera SDRAM driver. Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
* driver/ddr/altera: Add DDR driver for Altera's SDRAM controllerDinh Nguyen2015-08-08-0/+799
| | | | | | | | 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>
* net: designware: Rename the driver var name to eth_designwareMarek Vasut2015-08-08-1/+1
| | | | | | | | | 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>
* net: designware: Add SoCFPGA GMAC DT compatible stringMarek Vasut2015-08-08-0/+1
| | | | | | | | 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>
* arm: socfpga: Fix FPGA bitstream programming routineMarek Vasut2015-08-08-0/+3
| | | | | | | | | 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>
* Merge git://git.denx.de/u-boot-dmTom Rini2015-08-06-1314/+2714
|\
| * dm: core: Add a way to set a device nameSimon Glass2015-08-06-0/+10
| | | | | | | | | | | | | | | | | | | | 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>
| * devres: add debug command to dump device resourcesMasahiro Yamada2015-08-06-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>