summaryrefslogtreecommitdiffstats
path: root/drivers/clocksource
Commit message (Collapse)AuthorAgeFilesLines
* ARM: at91: replace __raw_{readl, writel} of peripherals with readl, writelAhmad Fatoum2019-05-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Use the potentially endianness-changing readl, writel and siblings directly. They looks prettier and are the correct thing to do, as even if the CPU is in big-endian mode, the peripherals are little-endian. Unlike Linux, barebox readl,writel are the same Linux' {readl,writel}_relaxed (they don't imply memory barriers) and thus there shouldn't be any functional change. Patch was generated by a mass search and replace. I looked it over, adjust some whitespace and further verified by reviewing the output of git diff HEAD~1 --word-diff | \ perl -pe 's/\[-(.*?)__raw_/{+$1/; s/-\]\{\+/+}{+/;' \ -e 's/(\{\+.*?\+\})\1/__ALL_IS_WELL__/' | grep '+}{+' which filters out the common case of lines where a single __raw_{readT,writeT} had its __raw_ prefix stripped without any further changes. Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/warnings'Sascha Hauer2019-04-091-1/+1
|\
| * treewide: Make locally used functions staticSascha Hauer2019-03-181-1/+1
| | | | | | | | | | | | | | Many functions are only used locally but still are globally visible. Make these function static. Avoids warnings generated with -Wmissing-prototypes Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clocksource: Enable architected timer support for CPU_V7Sascha Hauer2019-03-112-1/+2
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/efi'Sascha Hauer2019-03-071-2/+2
|\
| * efi: cleanupsOleksij Rempel2019-02-181-2/+2
| | | | | | | | | | | | | | make local functions static and remove unused code Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clocksource: Do not mix depends and select for ATMEL_PITSam Ravnborg2019-02-251-1/+0
|/ | | | | | | | | | CLOCKSOURCE_ATMEL_PIT was both set to yes using depends on and using select. Use only select to set this non-visible symbol to 'y' Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/missing-prototypes'Sascha Hauer2019-01-151-1/+1
|\
| * ARM: AT91: pit: Make locally used function staticSascha Hauer2018-12-141-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/clps711x'Sascha Hauer2019-01-151-14/+9
|\ \
| * | clocksource: clps711x: Use coredevice_platform_driver() macroAlexander Shiyan2018-12-201-6/+1
| | | | | | | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clocksource: clps711x: Switch to SPDX identifierAlexander Shiyan2018-12-201-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clocksource: clps711x: Add devicetree supportAlexander Shiyan2018-12-201-0/+6
| |/ | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: omap: 32ktimer: Turn into a driverSascha Hauer2018-12-203-1/+111
| | | | | | | | | | | | Turn OMAP 32KHz timer into a driver and move to drivers/clocksource. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: omap: dmtimer: Turn into a driverSascha Hauer2018-12-203-0/+123
|/ | | | | | Turn OMAP dmtimer into a driver and move to drivers/clocksource. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: Add dw_apb_timer driverJules Maselbas2018-11-303-0/+154
| | | | | | | Adapt linux kernel dw_apb_timer driver to barebox. Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Kconfig: Add clocksource menuJules Maselbas2018-11-291-0/+4
| | | | | Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net-switch-mv88e6xxx'Sascha Hauer2018-11-094-0/+317
|\
| * clocksource: Introduce ARCH_HAS_IMX_GPTAndrey Smirnov2018-10-181-1/+4
| | | | | | | | | | | | | | | | Not all SoCs use i.MX GPT block as a clocksource, so introduce ARCH_HAS_IMX_GPT to mark the ones that do. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * i.MX: Move GPT driver to drivers/clocksourceAndrey Smirnov2018-10-183-0/+196
| | | | | | | | | | | | | | | | | | Move GPT driver to drivers/clocksource and rename it to timer-imx-gpt.c to match Linux kernel as well as to keep all clocksource drivers in a common location. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clocksource: Add ARM global timer supportAndrey Smirnov2018-10-183-0/+118
| | | | | | | | | | | | | | | | | | Port corresponding Linux kernel driver. Currently VFxxx SoC is the intended consumer because it doesn't include common i.MX GPT block used as clocksource by other i.MX SoCs. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: at91: remove mach/io.hSascha Hauer2018-11-061-1/+0
|/ | | | | | | Remove at91_sys_read() and at91_sys_write() since these are no longer used. This makes mach/io.h empty so remove that aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: armv8-timer: Make use of postcore_platform_driver()Andrey Smirnov2018-06-111-5/+1
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: armv8-timer: Make armv8_clocksource_read() staticAndrey Smirnov2018-06-111-1/+1
| | | | | | | | There are no users of that function outside of the driver itself, so re-declare it as static. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: armv8-timer: Convert explicit assembly into helpersAndrey Smirnov2018-06-111-11/+2
| | | | | | | | | | Move inline assembly related to querying and counter value as well as getting and setting counter frequency register into asm/system.h as well as converting it inot helper functions. This is done to make the code availible to other parts of the system. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: Add armv8 generic timer supportSascha Hauer2018-03-213-0/+71
| | | | | | armv8 has a generic time used in many SoCs. Add support for it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: sp804: silently ignore secondary instacesLucas Stach2017-10-171-2/+2
| | | | | | | | | When probing from an upstream DT, we don't always have influence on how many timer instances are enabled. Just use the first one and silently skip the other instances. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2017-04-071-1/+1
|\
| * clocksource: mvebu: don't request the used iomem resourceUwe Kleine-König2017-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | The register ranges of the device nodes timer@20300 and watchdog@20300 overlap, so it is impossible that both devices properly use request_iomem_region (e.g. by using dev_request_mem_resource). In Linux only the watchdog driver is registered in /proc/iomem, do the same for barebox. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clocksource: at91: Add DT compatibility tableAndrey Smirnov2017-03-301-0/+9
|/ | | | | | Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: clocksoure: make sure the meassured frequency is validMichael Olbrich2017-03-151-0/+4
| | | | | | | | | Some EFI implementations have a even slower tick rate and the meassured frequency may be zero. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/rpi'Sascha Hauer2017-03-131-13/+22
|\
| * clocksource: bcm2835: use clock-frequency property when availableEnrico Joerns2017-03-021-13/+22
| | | | | | | | | | | | | | | | | | If the clock frequency is given by a DT property, use this and don't try to use the clock handle. Signed-off-by: Enrico Joerns <ejo@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/efi'Sascha Hauer2017-03-134-0/+199
|\ \
| * | efi: clocksoure: add EFI event timerJean-Christophe PLAGNIOL-VILLARD2017-03-093-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with this we can be hw generic If the EFI implement timestamp protocol we could use instead of event but even EDK2 Never Ever compile it for any target. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: move x86 clocksource to device/driverJean-Christophe PLAGNIOL-VILLARD2017-03-093-12/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | so we can dynamicly register the device As we may need to use HW IP for clocksource. As on EFI we could use Timestamp GUID if present (Not often the case as it's not even enabled by default on any Target on EDK II not even OVMF) Or if we choose we could use a Simulated Timestamp driver that work on Event (Add Later) Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: move x86 clocksource init at core initcall levelJean-Christophe PLAGNIOL-VILLARD2017-03-091-1/+4
| | | | | | | | | | | | | | | | | | | | | so we can use device/driver model Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: move x86 efi boot support to x86 archJean-Christophe PLAGNIOL-VILLARD2017-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | prepare to drop the efi arch as efi boot up is not arch sepecific Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: move bus driver to driver/efiJean-Christophe PLAGNIOL-VILLARD2017-02-241-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: move clocksource out of archJean-Christophe PLAGNIOL-VILLARD2017-02-243-0/+63
| |/ | | | | | | | | | | | | as efi is not an arch but a boot mode from where barebox is started Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / clocksource: at91: Move to 'drivers/clocksource'Andrey Smirnov2017-03-093-0/+119
|/ | | | | | | | | Move PIT driver code to 'drivers/clocsource' and accomodate it by adjusting Kconfig variables. Rename the file to 'timer-atmel-pit.c' to re-align the driver with code in Linux kernel. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: Add rk3288 timer driverWadim Egorov2016-08-263-0/+78
| | | | | | | This driver comes from the u-boot (v2016.01). Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-078-24/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bcm2835: introduce mach-bcm283xAlexander Aring2016-01-042-3/+3
| | | | | | | | | | | | This patch changes the most part of mach-bcm2835 to mach-bcm283x. This prepares to add RPi2 support which is a bcm2836. This patch changes the Kconfig entry namens to BCM283X for drivers only. These drivers should working the same in bcm2836. While updating defconfig I added LED support/trigger option. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clock: incorporate dummy clocksource into core clock codeAntony Pavlov2014-12-173-73/+10
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Reuse init_clock() return value for clocksource driversAlexander Shiyan2014-11-108-21/+8
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-168-6/+19
| | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: add driver for Canon DIGIC timerAntony Pavlov2014-07-293-0/+98
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: mvebu: split initialization for Armada 370/XPSebastian Hesselbarth2014-06-241-25/+40
| | | | | | | | | | | Timers found on Marvell Armada 370 and XP require different setup. While timer clock on Armada 370 can be derived from a divided reference clocks, Armada XP always uses a 25MHz reference. This also updates compatibles to destinguish timers for both SoCs and fixes some whitespace issues on defines. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
* clocksource: add uemd clocksourceAntony Pavlov2014-05-263-0/+135
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>