summaryrefslogtreecommitdiff
path: root/arch/arm/mach-sa1100/clock.c
AgeCommit message (Collapse)Author
2017-07-27ARM: sa1100: normalize clk APIArnd Bergmann
sa1100 provides its own variant of the clk API rather than using the generic COMMON_CLK API. This generally works, but it causes some link errors with drivers using the clk_set_rate, clk_get_parent, clk_set_parent or clk_round_rate functions when a platform lacks those interfaces. This adds trivial stub implementations for each of them, based on the behavior of the COMMON_CLK implementation: - set_rate() and set_parent() report success without doing anything - round_rate() returns the clk rate - get_parent() returns NULL. This adds the minimal bloat and should do the right thing for the simple clock hardware in this SoC. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2016-08-23ARM: sa1100: register clocks earlyRussell King
Since we switched to use pxa_timer, we need to provide the OSTIMER0 clock. However, as the clock is initialised early, we need to provide the clock early as well, so that pxa_timer can find it. Adding the clock to the clkdev table at core_initcall() time is way too late. Move the initialisation earlier. Fixes: ee3a4020f7c9 ("ARM: 8250/1: sa1100: provide OSTIMER0 clock for pxa_timer") Acked-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-08-23ARM: sa1100: fix 3.6864MHz clockRussell King
pxa_timer wants to be able to call clk_enable() etc on this clock, but our clk_enable() implementation expects non-NULL enable/disable operations. Provide these dummy implementations. Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = c0204000 [00000000] *pgd=00000000 Internal error: Oops: 80000005 [#1] ARM Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 4.8.0-rc2+ #887 Hardware name: Intel-Assabet task: c0644590 task.stack: c0640000 PC is at 0x0 LR is at clk_enable+0x40/0x58 pc : [<00000000>] lr : [<c021b178>] psr: 600000d3 sp : c0641f60 ip : c0641f4c fp : c0641f74 r10: c1ffc7a0 r9 : 6901b118 r8 : 00000001 r7 : c0639a34 r6 : 0000001b r5 : a00000d3 r4 : c0645d70 r3 : c0645d78 r2 : 00000001 r1 : c0641ef0 r0 : c0645d70 Flags: nZCv IRQs off FIQs off Mode SVC_32 ISA ARM Segment none Control: c020717f Table: c020717f DAC: 00000053 Process swapper (pid: 0, stack limit = 0xc0640188) Stack: (0xc0641f60 to 0xc0642000) 1f60: 00384000 c08762e4 c0641f98 c0641f78 c063308c c021b144 00000000 00000000 1f80: 00000000 c0660b20 ffffffff c0641fa8 c0641f9c c06220ec c0633058 c0641fb8 1fa0: c0641fac c061f114 c06220dc c0641ff4 c0641fbc c061bb68 c061f0fc ffffffff 1fc0: ffffffff 00000000 c061b6cc c0639a34 c0660cd4 c0642038 c0639a30 c0645434 1fe0: c0204000 c06380f8 00000000 c0641ff8 c0208048 c061b954 00000000 00000000 Backtrace: [<c021b138>] (clk_enable) from [<c063308c>] (pxa_timer_nodt_init+0x40/0x120) r5:c08762e4 r4:00384000 [<c063304c>] (pxa_timer_nodt_init) from [<c06220ec>] (sa1100_timer_init+0x1c/0x20) r6:ffffffff r5:c0660b20 r4:00000000 [<c06220d0>] (sa1100_timer_init) from [<c061f114>] (time_init+0x24/0x2c) [<c061f0f0>] (time_init) from [<c061bb68>] (start_kernel+0x220/0x42c) [<c061b948>] (start_kernel) from [<c0208048>] (0xc0208048) r10:c06380f8 r8:c0204000 r7:c0645434 r6:c0639a30 r5:c0642038 r4:c0660cd4 Code: bad PC value ---[ end trace 0000000000000000 ]--- Kernel panic - not syncing: Attempted to kill the idle task! Fixes: ee3a4020f7c9 ("ARM: 8250/1: sa1100: provide OSTIMER0 clock for pxa_timer") Acked-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2015-01-14ARM: 8250/1: sa1100: provide OSTIMER0 clock for pxa_timerDmitry Eremin-Solenikov
Pxa_timer clocksource requires OSTIMER0 clock to be provided. Add dummy clock returning proper rate. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-12-05ARM: 8243/1: sa1100: add a clock alias for sa1111 pcmcia deviceDmitry Eremin-Solenikov
SA-1111 uses internal MMIO space offsets as a device name, so device name for sa1111 pcmcia is 1800 (PCMCIA is at offset 0x1800). Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-12-05ARM: 8242/1: sa1100: add cpu clockDmitry Eremin-Solenikov
Both SA1100 framebuffer and PCMCIA drivers require knowledge of cpu frequency to correctly program timings. Currently they receive timing information by calling cpufreq_get(0). However if cpu frequency driver is not enabled (e.g. due to unsupported DRAM chip/board on sa1110) cpufreq_get(0) returns 0, causing incorrect timings to be programmed. Add cpu clock returning cpu frequency, to be used by sa11x0 fb and pcmcia drivers. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-01-17ARM: SA1100: Create dummy clk_get_rate() to avoid build failuresViresh Kumar
There are some parts of common kernel which would be using routines like clk_get_rate() on some platforms. Currently, they wouldn't be called for SA1100 boards, but they are needed for successful kernel compilation. Create a dummy clk_get_rate() routine for SA1100 which can be called by the cpufreq core. More dummy routines might be added later if necessary. Cc: Russell King <linux@arm.linux.org.uk> Cc: Arnd Bergmann <arnd.bergmann@linaro.org> Reported-by: Olof Johansson <olof@lixom.net> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> [rjw: Changelog] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2012-02-28ARM: sa1100: clean up clock supportJett.Zhou
Add rtc clock support and clean clock support for gpio. Signed-off-by: Jett.Zhou <jtzhou@marvell.com> signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
2012-01-19Revert "ARM: sa1100: clean up of the clock support"Russell King
This reverts commit edf3ff5bac2582b57de4e7c6569fee5d7c1c0a42. This revert is necessary to revert the broken "RTC: sa1100: support sa1100, pxa and mmp soc families" change.
2011-12-28ARM: sa1100: clean up of the clock supportJett.Zhou
Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2008-11-27[ARM] sa1100: match clock by dev_name(dev)Russell King
Continuing the move away from implementations which give an excuse for other bad implementations, convert SA1100 to lookup its singular clock by dev_name(dev) rather than by id. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-07[ARM] Move include/asm-arm/arch-* to arch/arm/*/include/machRussell King
This just leaves include/asm-arm/plat-* to deal with. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-07[ARM] Remove asm/hardware.h, use asm/arch/hardware.h insteadRussell King
Remove includes of asm/hardware.h in addition to asm/arch/hardware.h. Then, since asm/hardware.h only exists to include asm/arch/hardware.h, update everything to directly include asm/arch/hardware.h and remove asm/hardware.h. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-07-10Clocklib: Fix SA1111 clock name mess.Ian Molton
This patch uses the ability of PXA's clocklib to alias clock to resolve the problem caused by sharing the SA1111 IO controller between PXA and SA1100 architectures, which have differing GPIO numbering. Signed-off-by: Ian Molton <spyro@f2s.com>
2007-04-22[ARM] sa1100: use mutexes rather than semaphoresRussell King
Use a mutex in the sa1100 clock support rather than a semaphore. Remove the unused "module" field. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-03-21[ARM] Convert SA1111 to use clock architectureRussell King
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>