1
0
Fork 0
Commit Graph

40 Commits (1afbf61750364864adf6a17818c5bbbea4dea531)

Author SHA1 Message Date
Viresh Kumar 9797529d89 microblaze/timer: Migrate to new 'set-state' interface
Migrate microblaze driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

We weren't doing anything in ->set_mode(RESUME or ONESHOT) and so
tick_resume() set_state_oneshot() aren't implemented.

Cc: Michal Simek <monstr@monstr.eu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-08-10 11:41:00 +02:00
Richard Cochran 5ce07a5cef microblaze: include the new timecounter header.
The timecounter/cyclecounter code has moved, so users need the new include.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-02 16:47:36 -05:00
Michal Simek a1715bb7ff microblaze: Make timer driver endian aware
Detect endianess directly on the hardware and use
ioread/iowrite functions.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2014-04-07 11:58:33 +02:00
Guenter Roeck 79c157a3fb microblaze: Rename global function heartbeat()
microblaze:allmodconfig complains for some configurations that 'heartbeat'
is redefined as different kind of symbol. This is seen in test compiles
of watchdog drivers, which often use 'heartbeat' as ststic variable.

Since 'heartbeat' is an unfortunate name for a global function,
rename it to microblaze_heartbeat. Also rename the setup function
to microblaze_setup_heartbeat.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2014-03-12 10:10:06 +01:00
Michal Simek 03fe0d3c27 microblaze: timer: Do not initialized system timer twice
Only one system timer can be setup.
Do not initialize more system timers.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2014-01-27 11:26:31 +01:00
Michal Simek 839396ab88 microblaze: timer: Use generic sched_clock implementation
Remove sched_clock from the driver and use sched_clock_register
function.
Inspired-by:
"arch_timer: Move to generic sched_clock framework"
(sha1: 65cd4f6c99)

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2014-01-27 11:25:46 +01:00
Michal Simek c1120542b9 microblaze: Add support for CCF
Add support for CCF for Microblaze.

Old binding:
system_timer: system-timer@41c00000 {
	clock-frequency = <75000000>;
	...
}

New binding:
system_timer: system-timer@41c00000 {
	clocks = <&clk_bus>;
	...
}

Both should be supported for a while

Microblaze clock binding:
clocks {
	#address-cells = <1>;
	#size-cells = <0>;
	clk_bus: bus {
		#clock-cells = <0>;
		clock-frequency = <75000000>;
		clock-output-names = "bus";
		compatible = "fixed-clock";
		reg = <1>;
	} ;
	clk_cpu: cpu {
		#clock-cells = <0>;
		clock-frequency = <75000000>;
		clock-output-names = "cpu";
		compatible = "fixed-clock";
		reg = <0>;
	} ;
} ;

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2014-01-27 11:24:55 +01:00
Linus Torvalds 10d0c9705e DeviceTree updates for 3.13. This is a bit larger pull request than
usual for this cycle with lots of clean-up.
 
 - Cross arch clean-up and consolidation of early DT scanning code.
 - Clean-up and removal of arch prom.h headers. Makes arch specific
   prom.h optional on all but Sparc.
 - Addition of interrupts-extended property for devices connected to
   multiple interrupt controllers.
 - Refactoring of DT interrupt parsing code in preparation for deferred
   probe of interrupts.
 - ARM cpu and cpu topology bindings documentation.
 - Various DT vendor binding documentation updates.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQEcBAABAgAGBQJSgPQ4AAoJEMhvYp4jgsXif28H/1WkrXq5+lCFQZF8nbYdE2h0
 R8PsfiJJmAl6/wFgQTsRel+ScMk2hiP08uTyqf2RLnB1v87gCF7MKVaLOdONfUDi
 huXbcQGWCmZv0tbBIklxJe3+X3FIJch4gnyUvPudD1m8a0R0LxWXH/NhdTSFyB20
 PNjhN/IzoN40X1PSAhfB5ndWnoxXBoehV/IVHVDU42vkPVbVTyGAw5qJzHW8CLyN
 2oGTOalOO4ffQ7dIkBEQfj0mrgGcODToPdDvUQyyGZjYK2FY2sGrjyquir6SDcNa
 Q4gwatHTu0ygXpyphjtQf5tc3ZCejJ/F0s3olOAS1ahKGfe01fehtwPRROQnCK8=
 =GCbY
 -----END PGP SIGNATURE-----

Merge tag 'devicetree-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull devicetree updates from Rob Herring:
 "DeviceTree updates for 3.13.  This is a bit larger pull request than
  usual for this cycle with lots of clean-up.

   - Cross arch clean-up and consolidation of early DT scanning code.
   - Clean-up and removal of arch prom.h headers.  Makes arch specific
     prom.h optional on all but Sparc.
   - Addition of interrupts-extended property for devices connected to
     multiple interrupt controllers.
   - Refactoring of DT interrupt parsing code in preparation for
     deferred probe of interrupts.
   - ARM cpu and cpu topology bindings documentation.
   - Various DT vendor binding documentation updates"

* tag 'devicetree-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (82 commits)
  powerpc: add missing explicit OF includes for ppc
  dt/irq: add empty of_irq_count for !OF_IRQ
  dt: disable self-tests for !OF_IRQ
  of: irq: Fix interrupt-map entry matching
  MIPS: Netlogic: replace early_init_devtree() call
  of: Add Panasonic Corporation vendor prefix
  of: Add Chunghwa Picture Tubes Ltd. vendor prefix
  of: Add AU Optronics Corporation vendor prefix
  of/irq: Fix potential buffer overflow
  of/irq: Fix bug in interrupt parsing refactor.
  of: set dma_mask to point to coherent_dma_mask
  of: add vendor prefix for PHYTEC Messtechnik GmbH
  DT: sort vendor-prefixes.txt
  of: Add vendor prefix for Cadence
  of: Add empty for_each_available_child_of_node() macro definition
  arm/versatile: Fix versatile irq specifications.
  of/irq: create interrupts-extended property
  microblaze/pci: Drop PowerPC-ism from irq parsing
  of/irq: Create of_irq_parse_and_map_pci() to consolidate arch code.
  of/irq: Use irq_of_parse_and_map()
  ...
2013-11-12 16:52:17 +09:00
Michal Simek db2a7df034 microblaze: Remove deprecated IRQF_DISABLED
Removed IRQF_DISABLED as it's no-op and should be removed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2013-11-08 15:18:30 +01:00
Rob Herring 5c9f303e99 microblaze: clean-up prom.h implicit includes
While powerpc is a mess of implicit includes by prom.h, microblaze just
copied this and is easily fixed. Add the necessary explicit includes and
remove unnecessary includes and other parts from prom.h

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: microblaze-uclinux@itee.uq.edu.au
Cc: netdev@vger.kernel.org
2013-10-09 20:04:03 -05:00
Michal Simek 5955563ae2 microblaze: timer: Replace microblaze_ prefix by xilinx_
The main reason that this driver can be used by ARM
and PPC. The part of preparing of move to generic location.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2013-09-03 16:31:15 +02:00
Michal Simek 1e52980370 microblaze: timer: Update header
Update dates in header and add Xilinx to it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2013-09-03 16:31:15 +02:00
Michal Simek fc436742b4 microblaze: timer: Remove unused header
Remove unused headers.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2013-09-03 16:31:14 +02:00
Michal Simek cfd4eaefd0 microblaze: timer: Clear driver init function
- Use of_iomap
- Use of_property_read_u32
- Fix printk

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2013-09-03 11:27:30 +02:00
Michal Simek 4bcd943ec8 microblaze: timer: Use CLKSRC_OF initialization
Simplify timer initialization and prepare the driver
for moving to drivers/clocksource folder.
Also remove system-timer property from binding because
the name is too generic.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2013-09-03 11:26:52 +02:00
Michal Simek 9e77dab684 microblaze: Remove selfmodified feature
This was experimental feature which has never been
widely used because it expects GCC behaviour.
Also remove INTC_BASE and TIMER_BASE macros.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2013-09-03 11:13:46 +02:00
Michal Simek aaa5241ebb microblaze: Prefer to use pr_XXX instead of printk(KERN_XX)
Fix reset.c, timer.c, setup.c file.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-10-04 15:00:32 +02:00
Michal Simek 88d23b4462 microblaze: Added fdt chosen capability for timer
This lets a dts author flag a particular timer in the system as the system timer.
If the chosen node contains a "system-timer=<&foo>" entry than that handle will
be used to determine the system timer. In no such entry exists then the first
found timer will be used (current behaviour).

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-10-04 14:29:15 +02:00
Linus Torvalds 0195c00244 Disintegrate and delete asm/system.h
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIVAwUAT3NKzROxKuMESys7AQKElw/+JyDxJSlj+g+nymkx8IVVuU8CsEwNLgRk
 8KEnRfLhGtkXFLSJYWO6jzGo16F8Uqli1PdMFte/wagSv0285/HZaKlkkBVHdJ/m
 u40oSjgT013bBh6MQ0Oaf8pFezFUiQB5zPOA9QGaLVGDLXCmgqUgd7exaD5wRIwB
 ZmyItjZeAVnDfk1R+ZiNYytHAi8A5wSB+eFDCIQYgyulA1Igd1UnRtx+dRKbvc/m
 rWQ6KWbZHIdvP1ksd8wHHkrlUD2pEeJ8glJLsZUhMm/5oMf/8RmOCvmo8rvE/qwl
 eDQ1h4cGYlfjobxXZMHqAN9m7Jg2bI946HZjdb7/7oCeO6VW3FwPZ/Ic75p+wp45
 HXJTItufERYk6QxShiOKvA+QexnYwY0IT5oRP4DrhdVB/X9cl2MoaZHC+RbYLQy+
 /5VNZKi38iK4F9AbFamS7kd0i5QszA/ZzEzKZ6VMuOp3W/fagpn4ZJT1LIA3m4A9
 Q0cj24mqeyCfjysu0TMbPtaN+Yjeu1o1OFRvM8XffbZsp5bNzuTDEvviJ2NXw4vK
 4qUHulhYSEWcu9YgAZXvEWDEM78FXCkg2v/CrZXH5tyc95kUkMPcgG+QZBB5wElR
 FaOKpiC/BuNIGEf02IZQ4nfDxE90QwnDeoYeV+FvNj9UEOopJ5z5bMPoTHxm4cCD
 NypQthI85pc=
 =G9mT
 -----END PGP SIGNATURE-----

Merge tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system

Pull "Disintegrate and delete asm/system.h" from David Howells:
 "Here are a bunch of patches to disintegrate asm/system.h into a set of
  separate bits to relieve the problem of circular inclusion
  dependencies.

  I've built all the working defconfigs from all the arches that I can
  and made sure that they don't break.

  The reason for these patches is that I recently encountered a circular
  dependency problem that came about when I produced some patches to
  optimise get_order() by rewriting it to use ilog2().

  This uses bitops - and on the SH arch asm/bitops.h drags in
  asm-generic/get_order.h by a circuituous route involving asm/system.h.

  The main difficulty seems to be asm/system.h.  It holds a number of
  low level bits with no/few dependencies that are commonly used (eg.
  memory barriers) and a number of bits with more dependencies that
  aren't used in many places (eg.  switch_to()).

  These patches break asm/system.h up into the following core pieces:

    (1) asm/barrier.h

        Move memory barriers here.  This already done for MIPS and Alpha.

    (2) asm/switch_to.h

        Move switch_to() and related stuff here.

    (3) asm/exec.h

        Move arch_align_stack() here.  Other process execution related bits
        could perhaps go here from asm/processor.h.

    (4) asm/cmpxchg.h

        Move xchg() and cmpxchg() here as they're full word atomic ops and
        frequently used by atomic_xchg() and atomic_cmpxchg().

    (5) asm/bug.h

        Move die() and related bits.

    (6) asm/auxvec.h

        Move AT_VECTOR_SIZE_ARCH here.

  Other arch headers are created as needed on a per-arch basis."

Fixed up some conflicts from other header file cleanups and moving code
around that has happened in the meantime, so David's testing is somewhat
weakened by that.  We'll find out anything that got broken and fix it..

* tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system: (38 commits)
  Delete all instances of asm/system.h
  Remove all #inclusions of asm/system.h
  Add #includes needed to permit the removal of asm/system.h
  Move all declarations of free_initmem() to linux/mm.h
  Disintegrate asm/system.h for OpenRISC
  Split arch_align_stack() out from asm-generic/system.h
  Split the switch_to() wrapper out of asm-generic/system.h
  Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h
  Create asm-generic/barrier.h
  Make asm-generic/cmpxchg.h #include asm-generic/cmpxchg-local.h
  Disintegrate asm/system.h for Xtensa
  Disintegrate asm/system.h for Unicore32 [based on ver #3, changed by gxt]
  Disintegrate asm/system.h for Tile
  Disintegrate asm/system.h for Sparc
  Disintegrate asm/system.h for SH
  Disintegrate asm/system.h for Score
  Disintegrate asm/system.h for S390
  Disintegrate asm/system.h for PowerPC
  Disintegrate asm/system.h for PA-RISC
  Disintegrate asm/system.h for MN10300
  ...
2012-03-28 15:58:21 -07:00
David Howells c40d04df15 Disintegrate asm/system.h for Microblaze
Disintegrate asm/system.h for Microblaze.  Not compiled.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: microblaze-uclinux@itee.uq.edu.au
2012-03-28 18:30:02 +01:00
Michal Simek cc5647a64e microblaze: Use node name instead of compatible string
Change report in bootlog:
Origin:
xlnx,xps-intc-1.00.a #0 at 0xc8000000, num_irq=6, edge=0x4
xlnx,xps-timer-1.00.a #0 at 0xc8004000, irq=2

New:
interrupt-controller #0 at 0xc8000000, num_irq=6, edge=0x4
system-timer #0 at 0xc8004000, irq=2

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-03-23 09:28:15 +01:00
Michal Simek f7f4786c75 microblaze: trivial: Fix typo fault in timer.c
Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-03-19 07:30:28 +01:00
Michal Simek b6d5b28e44 microblaze: Remove eprintk macro
eprintk macro was used for printing early_printk
messages. Early console registration was changed
that's why this is not needed.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 08:34:26 +01:00
Michal Simek 9d0ced0084 microblaze: Use irq_of_parse_and_map for timer
It is necessary to call generic function for irq finding.
The main reason is that this generic function calls irq_create_of_mapping
which can add some shift because of NO_IRQ.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 08:22:04 +01:00
Michal Simek 5a26cd69cc microblaze: Use of_find_compatible_node for timer and intc
Calling of_find_compatible_node instead of calling private code
which does the same.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 08:22:01 +01:00
Michal Simek 9c6f6f549f microblaze: Clear top bit from cnt32_to_63
Top bit is used as garbage and it must be clear
explicitly.
It is causing the problem with soft lookup code
because it checks delays which are long when
top bit is setup.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-14 12:24:20 +02:00
Thomas Gleixner a18f22a968 Merge branch 'consolidate-clksrc-i8253' of master.kernel.org:~rmk/linux-2.6-arm into timers/clocksource
Conflicts:
	arch/ia64/kernel/cyclone.c
	arch/mips/kernel/i8253.c
	arch/x86/kernel/i8253.c

Reason: Resolve conflicts so further cleanups do not conflict further

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-05-14 12:06:36 +02:00
Michal Simek 29e3dbb10f microblaze: Fix sparse warning - timer.c
Variables and init_microblaze_timecounter should be static.

Warning log:
CHECK   arch/microblaze/kernel/timer.c
arch/microblaze/kernel/timer.c:41:14: warning: symbol 'freq_div_hz' was not declared. Should it be static?
arch/microblaze/kernel/timer.c:42:14: warning: symbol 'timer_clock_freq' was not declared. Should it be static?
arch/microblaze/kernel/timer.c:205:12: warning: symbol 'init_microblaze_timecounter' was not declared. Should it be static?

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:57 +01:00
John Stultz b8f39f7dfe microblaze: convert to clocksource_register_hz/khz
This converts the microblaze clocksources to use clocksource_register_hz/khz

CC: Michal Simek <monstr@monstr.eu>
CC: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
2011-02-21 13:33:46 -08:00
Michal Simek ccea0e6e49 microblaze: Support timer on AXI lite
New microblaze systems uses two buses. One for memories
and flashes and the second for low-speed peripherals
which can run on different CLK. This is the reason
why the kernel is trying to read clock-frequency
directly from node. If there is then the kernel will
work with it. If not then cpu CLK is used.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:52:00 +10:00
Michal Simek 02b08045a0 microblaze: Add support for little-endian Microblaze
Microblaze little-endian toolchain exports __MICROBLAZEEL__
which is used in the kernel to identify little/big endian.

The most of the changes are in loading values from DTB which
is always big endian.

Little endian platforms are based on new AXI bus which has
impact to early uartlite initialization.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:59 +10:00
Michal Simek e65f1e2843 microblaze: Remove additional compatible properties
Device-tree BSP generates longer compatible properties
that's why we can remove extra/old one.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:47 +10:00
Joe Perches 92ee8bd468 microblaze: Use static const char * const where possible
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:45 +10:00
Michal Simek 69717607f0 microblaze: Report if only one timer is used
Kernel needs two timers because of clocksource and clockevent.
It is better to show warning message directly on early
console if available. If it isn't available kernel log buffer
contains it.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:30 +10:00
Michal Simek c8f77436d1 microblaze: Decrease time shifting values
Lower shifting values ensure that shifted 32bit counter
value doesn't exceed 64bit cycle variable too fast.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:22:39 +02:00
Michal Simek 6f34b08f58 microblaze: Improve ftrace time measuring
I had to comment sched_clock generic function because of broken toolchain.
It is fine grain timing.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:22:35 +02:00
Michal Simek 519e9f4173 microblaze: Register timecounter/cyclecounter
It is the same counter as we use as free running one.
I would like to use it for ftrace.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2009-12-14 08:40:09 +01:00
John Williams 892ee92b81 microblaze: Sane handling of missing timer/intc in device tree
This code path doesn't test any returned pointers for NULL, leading to a bad
kernel page fault if there's no timer/intc found.

Slightly better is to BUG(), but even better still would be a printk beforehand.

Signed-off-by: John Williams <john.williams@petalogix.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2009-08-18 10:33:30 +02:00
Coly Li f57f2fe2a3 microblaze: add parameter to microblaze_read()
This patch modifies parameter of microblaze_read() from 'void' to 'struct
clocksource *cs', which fixes compile warning for incompatible parameter type.

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2009-04-23 16:27:38 +02:00
Michal Simek eedbdab99f microblaze_v8: Interrupt handling and timer support
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Reviewed-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Acked-by: John Linn <john.linn@xilinx.com>
Acked-by: John Williams <john.williams@petalogix.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2009-03-27 14:25:49 +01:00