Commit Graph

21 Commits

Author SHA1 Message Date
Michal Simek 6bd55f0bba microblaze: Fix coding style issues
Fix coding style issues reported by checkpatch.pl.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2013-02-12 11:24:45 +01:00
Michal Simek c0d997fb4c microblaze: Add static qualifiers
Adding static to internal variables and functions.

Sparse warnings:
arch/microblaze/kernel/prom.c:55:6: warning:
	symbol 'stdout' was not declared. Should it be static?
arch/microblaze/kernel/prom.c:57:12: warning:
	symbol 'early_init_dt_scan_chosen_serial' was not declared. Should it be static?
  CC      arch/microblaze/kernel/prom.o
arch/microblaze/kernel/intc.c:102:5: warning:
	symbol 'xintc_map' was not declared. Should it be static?
  CC      arch/microblaze/kernel/intc.o

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2012-12-13 18:15:34 +01:00
Michal Simek 7958a68919 microblaze: Fix intc_enable_or_unmask function
Intc_enable_or_unmask() is called at the last stage of handle_level_irq().

This function enables the irq first (Write INTC.SIE) and clear ISR next (Write INTC.IAR).
This would create problems that processor will get into a new interrupt as soon as SIE
is written because the previous level interrupt has been captured by INTC.

If the description bring some puzzles, here is the details of how interrupt is handled
for MicroBlaze after Interrupt signal is detected:
1. disable INTC (INTC.CIE = 1)
2. Acknowledge INTC (INTC.IAR = 1)
3. gets into interrupt source's handler, for example, timer's handler
4. Timer is interrupt handler acknowledge Timer Interrupt Status (Timer.TCSR0[23] = 1), and return
5. Enable INTC (INTC.SIE = 1)
6. Acknowledge INTC (INTC.IAR = 1)

INTC continue to capture source inputs even if INTC is disabled (INTC.IER == 1).
So between the gap of step 2 and step 3, the level interrupt from source makes INTC captures
a new interrupt and thus the INTC.ISR = 1 during step 3, 4, and 5.
When INTC is enabled in step 5, INTC's interrupt output will go high immediately.

In summary, the driver should issue step 6 before step 5.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2012-12-13 14:39:00 +01:00
Linus Torvalds 30eebb54b1 Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
Pull arch/microblaze fixes from Michal Simek

* 'next' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: Handle TLB skip size dynamically
  microblaze: Introduce TLB skip size
  microblaze: Improve TLB calculation for small systems
  microblaze: Extend space for compiled-in FDT to 32kB
  microblaze: Clear all MSR flags on the first kernel instruction
  microblaze: Use node name instead of compatible string
  microblaze: Fix mapin_ram function
  microblaze: Highmem support
  microblaze: Use active regions
  microblaze: Show more detailed information about memory
  microblaze: Introduce fixmap
  microblaze: mm: Fix lowmem max memory size limits
  microblaze: mm: Use ZONE_DMA instead of ZONE_NORMAL
  microblaze: trivial: Fix typo fault in timer.c
  microblaze: Use vsprintf extention %pf with builtin_return_address
  microblaze: Add PVR version string for MB 8.20.b and 8.30.a
  microblaze: Fix makefile to work with latest toolchain
  microblaze: Fix typo in early_printk.c
2012-03-27 18:20:56 -07: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
Grant Likely 2462bacd03 irq_domain/microblaze: Convert microblaze to use irq_domains
This patch converts Microblaze to use the irq_domain remapper and get
away from hard coding the offset between hwirq number and the linux irq
number space.  This also paves the way for multiple interrupt controllers.

v2: Don't enable SPARSE_IRQ and keep NR_IRQS set to 33

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Michal Simek <monstr@monstr.eu>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: John Williams <john.williams@petalogix.com>
Cc: John Linn <john.linn@xilinx.com>
2012-02-16 06:11:24 -07:00
Michal Simek 6c7a2676f5 microblaze: Change NO_IRQ to 0
As has been discussed many times[1], Using NO_IRQ set to anything other
than 0 is bug waiting to happen since many drivers follow the pattern
"if (!irq)" for testing whether or not an irq has been set.

This patch changes the Microblaze NO_IRQ setting from -1 to 0 to bring
it in line with most of the rest of the kernel.  It also prepares for
Microblaze eventually supporting multiple interrupt controllers by
breaking the assumption that hwirq# == Linux IRQ#.  The Linux IRQ
number is just a cookie with no guarantee of a direct relationship
with the hardware irq arrangement.

At this point, Microblaze interrupt handling only supports only one
instance of one kind of interrupt controller (xilinx_intc).  This change
shouldn't affect any architecture code outside of the interrupt
controller driver and the irq_of mapping.

Updated to 3.2 and to use irq_data.hwirq by Rob Herring.
Tested and fixed by Michal Simek.

[1] http://lkml.org/lkml/2005/11/21/221

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 08:29:13 +01:00
Michal Simek 2ecb899b4e microblaze: intc: Change variable name
intr_type is mask - change name.
s/intr_type/intr_mask/g

Signed-off-by: Michal Simek <monstr@monstr.eu>
2012-01-05 08:22:02 +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 363922946f microblaze: Do not show error message for 32 interrupt lines
When interrupt controller uses 32 interrupts lines the kernel
show error message about mismatch in kind-of-intr parameter
because it exceeds u32. Recast fixs this issue.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-07-27 11:02:00 +02:00
Michal Simek 56d448010f microblaze: Fix level/edge irq sensibility
Patches:
"microblaze: Convert to new irq function names"
sha (4adc192ec7)
and
"microblaze: Use generic show_interrupts()"
sha(9d61c18b25)

should also setup edge/level in irq_set_chip_and_handler_name
name parameter.

Error log:
~ # cat /proc/interrupts
           CPU0
  2:          2  Xilinx INTC-Xilinx INTC  eth0
  3:          2  Xilinx INTC-Xilinx INTC  eth0
  4:        241  Xilinx INTC-Xilinx INTC  timer
  6:        108  Xilinx INTC-Xilinx INTC  serial

Fixed:
~ # cat /proc/interrupts
           CPU0
  2:          2  Xilinx INTC-level     eth0
  3:          2  Xilinx INTC-level     eth0
  4:        238  Xilinx INTC-edge      timer
  6:        108  Xilinx INTC-level     serial

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>

---

v2: Fix exchanged edge and level
2011-04-01 09:25:04 +02:00
Thomas Gleixner 4adc192ec7 microblaze: Convert to new irq function names
Namespace conversion scripted with coccinelle.

Also retrieve the irq type from irq_data in intc_enable_or_unmask()

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-03-29 14:48:06 +02:00
Thomas Gleixner 6f205a4c69 microblaze: Convert irq_chip to new functions
Use proper irq_desc wrappers while at it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-03-09 08:09:59 +01:00
Thomas Gleixner 6c3564d3f6 microblaze: Remove stale irq_chip.end
irq_chip.end got obsolete with the removal of __do_IRQ().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Tested-by: Michal Simek <monstr@monstr.eu>
LKML-Reference: <20110203004210.240154507@linutronix.de>
2011-03-09 08:09:59 +01: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
steve@digidescorp.com 33d9ff5985 microblaze: Fix level interrupt ACKing
Level interrupts need to be ack'd in the unmask handler, as in powerpc.
Among other issues, this bug causes the system clock to appear to run at
double-speed.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2009-12-14 08:45:06 +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
Michal Simek 7b7210d7a9 microblaze: Fix kind-of-intr checking against number of interrupts
+ Fix typographic fault.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2009-05-18 14:47:42 +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