summaryrefslogtreecommitdiffstats
path: root/arch
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'u-boot/master' into 'u-boot-arm/master'Albert ARIBAUD2013-04-1215-1458/+174
|\ | | | | | | | | Conflicts: drivers/video/exynos_fb.c
| * Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2013-04-111-0/+5
| |\
| | * powerpc/usb: Fix usb device-tree fix-upramneek mehresh2013-04-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Fix USB device-tree fixup to properly handle device-tree fixup and print appropriate message when wrong/junk "dr_mode" or "phy_type" are mentioned in hwconfig string Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com>
| * | powerpc/lib: fix unsafe register handling in wait_ticksMats Kärrman2013-04-101-6/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If watchdog is enabled, the arch/powerpc/lib/ticks.S::wait_ticks() function calls the function specified by the WATCHDOG_RESET macro. The wait_ticks function depends on the registers r0, r6 and r7 being preserved however that is not guaranteed, e.g. if the reset function is a C function this will probably overwrite r0 and cause an endless loop. The following patch changes to using r14+r15 instead of r6+r7 (to resemble what would have been generated by a C compiler) and saves all necessary registers on the stack. The patch has been tested on a custom MPC5125 based machine using the 512x powerpc architecture. Signed-off-by: Mats Karrman <mats.karrman@tritech.se> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Joakim Tjernlund <joakim.tjernlund@transmode.se> Tested-by: Stefan Roese <sr@denx.de>
| * Consolidate bool typeYork Sun2013-04-019-177/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | 'bool' is defined in random places. This patch consolidates them into a single header file include/linux/types.h, using stdbool.h introduced in C99. All other #define, typedef and enum are removed. They are all consistent with true = 1, false = 0. Replace FALSE, False with false. Replace TRUE, True with true. Skip *.py, *.php, lib/* files. Signed-off-by: York Sun <yorksun@freescale.com>
| * Merge branch 'for-v2013.04'Anatolij Gustschin2013-03-294-1275/+0
| |\ | | | | | | | | | | | | | | | | | | Conflicts: drivers/video/Makefile Signed-off-by: Anatolij Gustschin <agust@denx.de>
| | * lcd, pxafb: move the pxafb to drivers/videoJeroen Hofstee2013-03-212-651/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the lcd code was compiled unconditionally for pxa also add CONFIG_PXA_LCD to the boards using this framebuffer. Since driver/video contains video and lcd drivers, add lcd to the name to make clear it belongs to common/lcd.c. cc: Anatolij Gustschin <agust@denx.de> cc: Cliff Brake <cliff.brake@gmail.com> cc: Marek Vasut <marek.vasut@gmail.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
| | * lcd, mpc8xx: move the mpc8xx driver to drivers/videoJeroen Hofstee2013-03-212-619/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since the lcd code was compiled unconditionally in arch also add CONFIG_MPC8XX_LCD to the boards using this driver. cc: Anatolij Gustschin <agust@denx.de> cc: Wolfgang Denk <wd@denx.de> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
| | * common/lcd.c: cleanup use of global variablesWolfgang Denk2013-03-212-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lcd_color_fg and lcd_color_bg had to be declared in board specific code, but were not actually used there; in addition, we have getter / setter functions for these, which were not used either. Get rid of the global variables, and use the getter function where needed (so far no setter calls are needed). Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Alessandro Rubini <rubini@unipv.it> Cc: Anatolij Gustschin <agust@denx.de> Cc: Bo Shen <voice.shen@atmel.com> Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Minkyu Kang <mk7.kang@samsung.com> Cc: Nikita Kiryanov <nikita@compulab.co.il> Cc: Simon Glass <sjg@chromium.org> Cc: Stelian Pop <stelian@popies.net> Cc: Tom Warren <twarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Jeroen Hofstee <jeroen@myspectrum.nl> [agust: also fixed cm_t35 board while rebasing] Signed-off-by: Anatolij Gustschin <agust@denx.de>
* | | Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'Albert ARIBAUD2013-04-124-21/+27
|\ \ \
| * | | omap5912-osk: Fix get_timer() and CONFIG_SYS_HZJon Hunter2013-04-101-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The function get_timer() should return time in ms and CONFIG_SYS_HZ should be set to 1000 by default. Fix both of these items. Signed-off-by: Jon Hunter <jon-hunter@ti.com>
| * | | OMAP4: Fix bug in omap4460_volts structLubomir Popov2013-04-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The omap4460_volts struct was incorrectly referencing tps62361 instead of twl6030 as PMIC for the core and mm voltages (the tps is used for mpu supply only). This shall lead to bad OPP settings while booting kernel. Fixing it. Fix some comments as well. Signed-off-by: Lubomir Popov <lpopov@mm-sol.com>
| * | | am335x: Update timings for the beaglebone againTom Rini2013-04-101-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After further testing we can run DDR at 400MHz so update the timings again. Tested-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Tom Rini <trini@ti.com>
| * | | am335x/ti814x: Correct MMC_BOOT_DEVICES_START/ENDTom Rini2013-04-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given that on TI814x we have MMC1/2 swapped, we also need to swap them in MMC_BOOT_DEVICES_START/END Reported-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Tom Rini <trini@ti.com>
* | | | arm: Make all linker scripts compatible with per-symbol sectionsBenoît Thébaudeau2013-04-126-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let all ARM linker scripts handle properly -ffunction-sections and -fdata-sections. This will be useful for future changes in order to create symbol-specific sections in common .S files. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | arm1176: Remove unused MMU setup from start.SBenoît Thébaudeau2013-04-121-90/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the removal of the smdk6400 board, the MMU setup code in arm1176/start.S becomes unused, so remove it. It will still be possible to restore it later from the Git history if necessary, in which case it should be moved out of the relocate_code() function. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | arm: Remove deprecated and now unused NAND SPLBenoît Thébaudeau2013-04-123-24/+6
| | | | | | | | | | | | | | | | Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | arm: Remove support for unused s3c64xxBenoît Thébaudeau2013-04-1210-1632/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the removal of the smdk6400 board, the s3c64xx SoC becomes unused, so remove associated code. It will still be possible to restore it later from the Git history if necessary. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | arm: Remove support for smdk6400Benoît Thébaudeau2013-04-121-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The migration of boards from Makefile to boards.cfg was due for v2012.03, but smdk6400 did not follow, and it does not build, so move it to scrapyard. It will still be possible to restore it from the Git history before fixing it. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | imx: Add u-boot-with-nand-spl.imx make targetBenoît Thébaudeau2013-04-121-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This image combines the SPL with the i.MX header, the FCB and U-Boot. For i.MX25/35/51, the FCB is ignored by the boot ROM, so this image is just useful because it can be programmed on a NAND Flash page boundary. For i.MX53, the FCB is required by the boot ROM. This does not support i.MX6 so far because its FCB is more complicated. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | imx: Add u-boot-with-spl.imx make targetBenoît Thébaudeau2013-04-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This image combines the SPL with the i.MX header and U-Boot. This is a convenient way of having a single image to program on some boot devices. The i.MX header has to be added to the SPL before appending U-Boot, so that the boot ROM loads only the SPL. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | arm: Remove unused relocate_code() parametersBenoît Thébaudeau2013-04-1214-57/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e05e5de7fae5bec79617e113916dac6631251156 made the 2 1st parameters of ARM's relocate_code() useless since it moved the code handling them to crt0.S. So, drop these parameters. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | arm926ejs: Remove deprecated and now unused NAND SPLBenoît Thébaudeau2013-04-121-10/+0
| | | | | | | | | | | | | | | | Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | nand: mxc: Switch NAND SPL to generic SPLBenoît Thébaudeau2013-04-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also fixes support for mx31pdk and tx25, which had been broken by commit e05e5de7fae5bec79617e113916dac6631251156. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Acked-by: Scott Wood <scottwood@freescale.com> Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
* | | | imx: Fix automatic make targets for imx imagesBenoît Thébaudeau2013-04-123-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automatically build the 'u-boot.imx' (i.e. imx header + u-boot.bin) and 'SPL' (i.e. imx header + u-boot-spl.bin) make targets for all imx processors supporting this header, so for arm926ejs, arm1136 and armv7. Some combinations were missing. At the same time, fix the build of SPL targets not supporting the imx header on arm1136. For arm1136, the 'SPL' make target was forced to build in all cases if CONFIG_SPL_BUILD was defined, even for non-imx platforms or imx setups without an imx header. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | arm: crt0.S: Remove bogus .globlBenoît Thébaudeau2013-04-121-24/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of .globl is to export symbols for ld, not to declare external symbols. By the way, use the ENTRY() and ENDPROC() macros to define functions rather than using .global directly. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | arm: relocate_code(): Use __image_copy_end for end of relocationBenoît Thébaudeau2013-04-1215-15/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use __image_copy_end instead of __bss_start for the end of the image to relocate. This is the same as commit 033ca72, but applied to all ARM start.S. This is a more appropriate symbol naming for an image copy & relocate feature, and this also saves a useless copy of data put between __image_copy_end and __bss_start in linker scripts (e.g. relocation information, or MMU initialization tables used only before jumping to the relocated image). Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | arm: relocate_code(): Remove useless relocation offset computationBenoît Thébaudeau2013-04-1213-66/+39
| | | | | | | | | | | | | | | | Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | arm1136: Remove redundant relocate_code() returnBenoît Thébaudeau2013-04-121-2/+0
| | | | | | | | | | | | | | | | Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | arm: relocate_code() is no longer noreturnBenoît Thébaudeau2013-04-1213-39/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e05e5de7fae5bec79617e113916dac6631251156 made ARM's relocate_code() return to its caller, but it did not update its declaration accordingly. Fixing this function declaration fixes dropped C code following calls to relocate_code(). Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* | | | arm: start.S: Fix _TEXT_BASE for SPLBenoît Thébaudeau2013-04-1214-4/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _TEXT_BASE must be set to CONFIG_SPL_TEXT_BASE for generic SPL, and to CONFIG_SYS_TEXT_BASE for non-SPL builds. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Reviewed-by: Tom Rini <trini@ti.com>
* | | | imx: mx5: lowlevel_init: Simplify codeBenoît Thébaudeau2013-04-121-6/+2
|/ / / | | | | | | | | | | | | | | | | | | Don't use several instructions to build constant values. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Acked-by: Stefano Babic <sbabic@denx.de>
* | | OMAP3/4/5/AM33xx: Correct logic for checking FAT or RAW MMCTom Rini2013-04-085-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case of booting from certain peripherals, such as UART, we must not see what the device descriptor says for RAW or FAT mode because in addition to being nonsensical, it leads to a hang. This is why we have a test currently for the boot mode being within range. The problem however is that on some platforms we get MMC2_2 as the boot mode and not the defined value for MMC2, and in others we get the value for MMC2_2. This is required to fix eMMC booting on omap5_uevm. Tested on am335x_evm (UART, NAND, SD), omap3_beagle (NAND, SD on classic, SD only on xM rev C5) and omap5_uevm (SD, eMMC). Signed-off-by: Tom Rini <trini@ti.com>
* | | arm: omap4: Fix SDRAM AUTO DETECTIONLokesh Vutla2013-04-086-18/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit "8602114 omap: emif: configure emif only when required" breaks SDRAM_AUTO_DETECTION. The issue is dmm_init() depends on emif_sizes[](SDRAM Auto detection) done in do_sdram_init(). The above commit moves dmm_init() above do_sdram_init() because of which dmm_init() uses uninitialized emif_sizes[]. So instead of using global emif_sizes[], get sdram details locally and calculate emif sizes. Reported-by: Michael Cashwell <mboards@prograde.net> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
* | | OMAP: Fix copy-paste bug that did not enable UART4 clockLubomir Popov2013-04-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | V2 fixes line wrap issue of the patch itself. UART3 was enabled twice instead of UART4. One more cosmetic change in a comment on EMIF clock. Signed-off-by: Lubomir Popov <lpopov@mm-sol.com> Reviewed-by: R Sricharan <r.sricharan@ti.com>
* | | omap2420-h4: Fix get_timer() and CONFIG_SYS_HZHunter, Jon2013-04-081-2/+6
| | | | | | | | | | | | | | | | | | | | | The function get_timer() should return time in ms and CONFIG_SYS_HZ should be set to 1000 by default. Fix both of these items. Signed-off-by: Jon Hunter <jon-hunter@ti.com>
* | | omap2420-h4: Fix booting from NOR flashHunter, Jon2013-04-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The omap2420-h4 board is using a RAM based address as the linker location for code. This is causing several problems when attempting to run the latest u-boot code base on this board from flash. Update the default linker location for code to be in NOR flash. Please note that OMAP maps the NOR flash to address 0x08000000 by default and so use this as the default address for the NOR flash. Also remove legacy code that attempts to calculate where in flash the sdata structure, that holds the memory interface configuration data, is located. By changing the default linker location for code to flash this is no longer necessary. Signed-off-by: Jon Hunter <jon-hunter@ti.com>
* | | omap_gpmc: change nandecc commandAndreas Bießmann2013-04-083-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With uppcoming BCH support on OMAP devices we need to decide between differnt algorithms when switching the ECC engine. Currently we support 1-bit hammign and 8-bit BCH on HW backend. In order to switch between differnet ECC algorithms we need to change the interface of omap_nand_switch_ecc() also. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Cc: Tom Rini <trini@ti.com> Cc: Thomas Weber <thomas.weber.linux@googlemail.com>
* | | omap3/omap_gpmc.h: add ooblayout for BCH8 as in kernelAndreas Bießmann2013-04-081-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds BCH8 ooblayout for NAND as provided by 0e618ef0a6a33cf7ef96c2c824402088dd8ef48c in linux kernel. This Layout is currently only provided for 64 byte OOB. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Cc: Tom Rini <trini@ti.com> Cc: Ilya Yanok <ilya.yanok@cogentembedded.com> Cc: Scott Wood <scottwood@freescale.com> Reviewed-by: Tom Rini <trini@ti.com>
* | | asm/omap_gpmc.h: consolidate common definesAndreas Bießmann2013-04-084-115/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arch/arm/include/asm/arch-am33xx/omap_gpmc.h and arch/arm/include/asm/arch-omap3/omap_gpmc.h are almost the same, consolidate the common parts into a new header. Introduce a new asm/omap_gpmc.h which defines the command part and pulls in the architecture specific one. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Cc: Tom Rini <trini@ti.com> Reviewed-by: Tom Rini <trini@ti.com>
* | | omap3/cpu.h: add BCH supportAndreas Bießmann2013-04-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the BCH result registers to register mapping for OMAP3 gpmc. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Cc: Tom Rini <trini@ti.com> Cc: Ilya Yanok <ilya.yanok@cogentembedded.com> Cc: Scott Wood <scottwood@freescale.com> Reviewed-by: Tom Rini <trini@ti.com>
* | | am335x: Enable MMC1 clockTom Rini2013-04-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | We must not assume ROM has enabled the clock for MMC1. Reported-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Tom Rini <trini@ti.com> Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
* | | Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'Albert ARIBAUD2013-04-049-110/+296
|\ \ \
| * | | exynos: change indentation of defines in cpu.hMinkyu Kang2013-04-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fix the indentation of some defines by tab. Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * | | Exynos: pwm: Remove dead code of function exynos5_get_pwm_clkAkshay Saraswat2013-04-011-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we shall now be using clock_get_periph_rate function. We find no reason for keeping code in function exynos5_get_pwm_clk. Hence, removing it. Signed-off-by: Akshay Saraswat <akshay.s@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * | | Exynos: pwm: Use generic api to get pwm clk freqPadmavathi Venna2013-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use generic api to get the pwm clock frequency Test with command "sf probe 1:0; time sf read 40008000 0 1000". Try with different numbers of bytes and see that sane values are obtained Build and boot U-boot with this patch, backlight works properly. Signed-off-by: Padmavathi Venna <padma.v@samsung.com> Signed-off-by: Akshay Saraswat <akshay.s@samsung.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * | | Exynos: clock: Add generic api to get the clk freqPadmavathi Venna2013-04-012-0/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add generic api to get the frequency of the required peripherial. This API gets the source clock frequency and returns the required frequency by dividing with first and second dividers based on the requirement. Test with command "sf probe 1:0; time sf read 40008000 0 1000". Try with different numbers of bytes and see that sane values are obtained Build and boot U-boot with this patch, backlight works properly. Signed-off-by: Padmavathi Venna <padma.v@samsung.com> Signed-off-by: Akshay Saraswat <akshay.s@samsung.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * | | Exynos: Add peripherial id for pwmPadmavathi Venna2013-04-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add peripherial id for pwm inorder to support generic api to get the clk frequency Test with command "sf probe 1:0; time sf read 40008000 0 1000". Try with different numbers of bytes and see that sane values are obtained Build and boot U-boot with this patch, backlight works properly. Signed-off-by: Padmavathi Venna <padma.v@samsung.com> Signed-off-by: Akshay Saraswat <akshay.s@samsung.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * | | Exynos: Tidy up the pwm_config function in the exynos pwm driverGabe Black2013-04-011-16/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some small fixes in the exynos pwm driver: 1. NS_IN_HZ is non-sensical since these are not compatible units. This constant actually describes the number of nanoseconds in a second. Renamed it to NS_IN_SEC. Also dropped the unnecessary parenthesis. 2. The variable "period" is not used to hold a period, it's used to hold a frequency. Renamed it to "frequency". 3. tcmp is an unsigned value, so (tcmp < 0) will never be true and the if which checks that condition will never execute. Also, there should be no problem if the pwm never switches, so there's no reason to subtract one from tcmp and therefore no reason to compare it against zero. Removed both ifs. If they weren't removed, tcmp should be a signed value. 4. Add a check for a 0 period. Test with command "sf probe 1:0; time sf read 40008000 0 1000". Try with different numbers of bytes and see that sane values are obtained Build and boot U-boot with this patch, backlight works properly. Signed-off-by: Gabe Black <gabeblack@google.com> Signed-off-by: Akshay Saraswat <akshay.s@samsung.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * | | Exynos: Avoid a divide by zero by specifying a non-zero period for pwm 4Gabe Black2013-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pwm_config function in the exynos pwm driver divides by its period period parameter. A function was calling pwm_config with a 0ns period and a 0ns duty cycle. That doesn't actually make any sense physically, and results in a divide by zero in the driver. This change changes the parameters to be a 100000ns period and duty cycle. Test with command "sf probe 1:0; time sf read 40008000 0 1000". Try with different numbers of bytes and see that sane values are obtained Build and boot U-boot with this patch, backlight works properly. Signed-off-by: Gabe Black <gabeblack@google.com> Signed-off-by: Akshay Saraswat <akshay.s@samsung.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
OpenPOWER on IntegriCloud