Skip to content

Commit

Permalink
Merge tag 'microblaze-3.12-rc1' of git://git.monstr.eu/linux-2.6-micr…
Browse files Browse the repository at this point in the history
…oblaze

Pull Microblaze patches from Michal Simek:
 - PCI fixes
 - Selfmod code removing
 - Intc and timer fixes
 - Adding new MB versions
 - Minor fixes

* tag 'microblaze-3.12-rc1' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: Show message when reset gpio is not present
  microblaze: Add linux.bin.ub target
  microblaze: Add PVR version string for MB v9.0 and v9.1
  microblaze: timer: Replace microblaze_ prefix by xilinx_
  microblaze: timer: Update header
  microblaze: timer: Remove unused header
  microblaze: timer: Clear driver init function
  microblaze: timer: Use CLKSRC_OF initialization
  microblaze: intc: Remove unused header
  microblaze: intc: Clean driver init function
  microblaze: intc: Using irqchip
  microblaze: intc: Update header
  microblaze: intc: Remove unused headers
  microblaze: Remove selfmodified feature
  of/pci: Use of_pci_range_parser
  • Loading branch information
Linus Torvalds committed Sep 6, 2013
2 parents 39eda2a + 54ea21f commit 5872c84
Show file tree
Hide file tree
Showing 14 changed files with 178 additions and 367 deletions.
1 change: 1 addition & 0 deletions arch/microblaze/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ config MICROBLAZE
select GENERIC_IDLE_POLL_SETUP
select MODULES_USE_ELF_RELA
select CLONE_BACKWARDS3
select CLKSRC_OF

config SWAP
def_bool n
Expand Down
3 changes: 2 additions & 1 deletion arch/microblaze/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ all: linux.bin
archclean:
$(Q)$(MAKE) $(clean)=$(boot)

linux.bin linux.bin.gz: vmlinux
linux.bin linux.bin.gz linux.bin.ub: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

simpleImage.%: vmlinux
Expand All @@ -81,6 +81,7 @@ simpleImage.%: vmlinux
define archhelp
echo '* linux.bin - Create raw binary'
echo ' linux.bin.gz - Create compressed raw binary'
echo ' linux.bin.ub - Create U-Boot wrapped raw binary'
echo ' simpleImage.<dt> - ELF image with $(arch)/boot/dts/<dt>.dts linked in'
echo ' - stripped elf with fdt blob'
echo ' simpleImage.<dt>.unstrip - full ELF image with fdt blob'
Expand Down
7 changes: 4 additions & 3 deletions arch/microblaze/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
# arch/microblaze/boot/Makefile
#

targets := linux.bin linux.bin.gz simpleImage.%
targets := linux.bin linux.bin.gz linux.bin.ub simpleImage.%

OBJCOPYFLAGS := -R .note -R .comment -R .note.gnu.build-id -O binary

$(obj)/linux.bin: vmlinux FORCE
$(call if_changed,objcopy)
@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'

$(obj)/linux.bin.ub: $(obj)/linux.bin FORCE
$(call if_changed,uimage)
@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'

Expand All @@ -22,8 +25,6 @@ quiet_cmd_strip = STRIP $@
cmd_strip = $(STRIP) -K microblaze_start -K _end -K __log_buf \
-K _fdt_start vmlinux -o $@

UIMAGE_IN = $@
UIMAGE_OUT = $@.ub
UIMAGE_LOADADDR = $(CONFIG_KERNEL_BASE_ADDR)

$(obj)/simpleImage.%: vmlinux FORCE
Expand Down
24 changes: 0 additions & 24 deletions arch/microblaze/include/asm/selfmod.h

This file was deleted.

2 changes: 0 additions & 2 deletions arch/microblaze/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ifdef CONFIG_FUNCTION_TRACER
CFLAGS_REMOVE_timer.o = -pg
CFLAGS_REMOVE_intc.o = -pg
CFLAGS_REMOVE_early_printk.o = -pg
CFLAGS_REMOVE_selfmod.o = -pg
CFLAGS_REMOVE_heartbeat.o = -pg
CFLAGS_REMOVE_ftrace.o = -pg
CFLAGS_REMOVE_process.o = -pg
Expand All @@ -23,7 +22,6 @@ obj-y += dma.o exceptions.o \
obj-y += cpu/

obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
obj-$(CONFIG_SELFMOD) += selfmod.o
obj-$(CONFIG_HEART_BEAT) += heartbeat.o
obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o
obj-$(CONFIG_MMU) += misc.o
Expand Down
2 changes: 2 additions & 0 deletions arch/microblaze/kernel/cpu/cpuinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const struct cpu_ver_key cpu_ver_lookup[] = {
{"8.30.a", 0x17},
{"8.40.a", 0x18},
{"8.40.b", 0x19},
{"9.0", 0x1b},
{"9.1", 0x1d},
{NULL, 0},
};

Expand Down
85 changes: 37 additions & 48 deletions arch/microblaze/kernel/intc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
* Copyright (C) 2007-2013 Michal Simek <monstr@monstr.eu>
* Copyright (C) 2012-2013 Xilinx, Inc.
* Copyright (C) 2007-2009 PetaLogix
* Copyright (C) 2006 Atmark Techno, Inc.
*
Expand All @@ -8,23 +9,15 @@
* for more details.
*/

#include <linux/init.h>
#include <linux/irqdomain.h>
#include <linux/irq.h>
#include <asm/page.h>
#include <linux/of_address.h>
#include <linux/io.h>
#include <linux/bug.h>

#include <asm/prom.h>
#include <asm/irq.h>
#include "../../drivers/irqchip/irqchip.h"

#ifdef CONFIG_SELFMOD_INTC
#include <asm/selfmod.h>
#define INTC_BASE BARRIER_BASE_ADDR
#else
static unsigned int intc_baseaddr;
#define INTC_BASE intc_baseaddr
#endif
static void __iomem *intc_baseaddr;

/* No one else should require these constants, so define them locally here. */
#define ISR 0x00 /* Interrupt Status Register */
Expand All @@ -50,30 +43,30 @@ static void intc_enable_or_unmask(struct irq_data *d)
* acks the irq before calling the interrupt handler
*/
if (irqd_is_level_type(d))
out_be32(INTC_BASE + IAR, mask);
out_be32(intc_baseaddr + IAR, mask);

out_be32(INTC_BASE + SIE, mask);
out_be32(intc_baseaddr + SIE, mask);
}

static void intc_disable_or_mask(struct irq_data *d)
{
pr_debug("disable: %ld\n", d->hwirq);
out_be32(INTC_BASE + CIE, 1 << d->hwirq);
out_be32(intc_baseaddr + CIE, 1 << d->hwirq);
}

static void intc_ack(struct irq_data *d)
{
pr_debug("ack: %ld\n", d->hwirq);
out_be32(INTC_BASE + IAR, 1 << d->hwirq);
out_be32(intc_baseaddr + IAR, 1 << d->hwirq);
}

static void intc_mask_ack(struct irq_data *d)
{
unsigned long mask = 1 << d->hwirq;

pr_debug("disable_and_ack: %ld\n", d->hwirq);
out_be32(INTC_BASE + CIE, mask);
out_be32(INTC_BASE + IAR, mask);
out_be32(intc_baseaddr + CIE, mask);
out_be32(intc_baseaddr + IAR, mask);
}

static struct irq_chip intc_dev = {
Expand All @@ -90,7 +83,7 @@ unsigned int get_irq(void)
{
unsigned int hwirq, irq = -1;

hwirq = in_be32(INTC_BASE + IVR);
hwirq = in_be32(intc_baseaddr + IVR);
if (hwirq != -1U)
irq = irq_find_mapping(root_domain, hwirq);

Expand Down Expand Up @@ -120,40 +113,32 @@ static const struct irq_domain_ops xintc_irq_domain_ops = {
.map = xintc_map,
};

void __init init_IRQ(void)
static int __init xilinx_intc_of_init(struct device_node *intc,
struct device_node *parent)
{
u32 nr_irq, intr_mask;
struct device_node *intc = NULL;
#ifdef CONFIG_SELFMOD_INTC
unsigned int intc_baseaddr = 0;
static int arr_func[] = {
(int)&get_irq,
(int)&intc_enable_or_unmask,
(int)&intc_disable_or_mask,
(int)&intc_mask_ack,
(int)&intc_ack,
(int)&intc_end,
0
};
#endif
intc = of_find_compatible_node(NULL, NULL, "xlnx,xps-intc-1.00.a");
BUG_ON(!intc);

intc_baseaddr = be32_to_cpup(of_get_property(intc, "reg", NULL));
intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE);
nr_irq = be32_to_cpup(of_get_property(intc,
"xlnx,num-intr-inputs", NULL));

intr_mask =
be32_to_cpup(of_get_property(intc, "xlnx,kind-of-intr", NULL));
int ret;

intc_baseaddr = of_iomap(intc, 0);
BUG_ON(!intc_baseaddr);

ret = of_property_read_u32(intc, "xlnx,num-intr-inputs", &nr_irq);
if (ret < 0) {
pr_err("%s: unable to read xlnx,num-intr-inputs\n", __func__);
return -EINVAL;
}

ret = of_property_read_u32(intc, "xlnx,kind-of-intr", &intr_mask);
if (ret < 0) {
pr_err("%s: unable to read xlnx,kind-of-intr\n", __func__);
return -EINVAL;
}

if (intr_mask > (u32)((1ULL << nr_irq) - 1))
pr_info(" ERROR: Mismatch in kind-of-intr param\n");

#ifdef CONFIG_SELFMOD_INTC
selfmod_function((int *) arr_func, intc_baseaddr);
#endif
pr_info("%s #0 at 0x%08x, num_irq=%d, edge=0x%x\n",
intc->name, intc_baseaddr, nr_irq, intr_mask);
pr_info("%s: num_irq=%d, edge=0x%x\n",
intc->full_name, nr_irq, intr_mask);

/*
* Disable all external interrupts until they are
Expand All @@ -174,4 +159,8 @@ void __init init_IRQ(void)
(void *)intr_mask);

irq_set_default_host(root_domain);

return 0;
}

IRQCHIP_DECLARE(xilinx_intc, "xlnx,xps-intc-1.00.a", xilinx_intc_of_init);
10 changes: 7 additions & 3 deletions arch/microblaze/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
#include <linux/seq_file.h>
#include <linux/kernel_stat.h>
#include <linux/irq.h>
#include <linux/irqchip.h>
#include <linux/of_irq.h>
#include <linux/export.h>

#include <asm/prom.h>

static u32 concurrent_irq;

Expand All @@ -47,3 +45,9 @@ void __irq_entry do_IRQ(struct pt_regs *regs)
set_irq_regs(old_regs);
trace_hardirqs_on();
}

void __init init_IRQ(void)
{
/* process the entire interrupt tree in one go */
irqchip_init();
}
6 changes: 5 additions & 1 deletion arch/microblaze/kernel/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ static void gpio_system_reset(void)
pr_notice("Reset GPIO unavailable - halting!\n");
}
#else
#define gpio_system_reset() do {} while (0)
static void gpio_system_reset(void)
{
pr_notice("No reset GPIO present - halting!\n");
}

void of_platform_reset_gpio_probe(void)
{
return;
Expand Down
81 changes: 0 additions & 81 deletions arch/microblaze/kernel/selfmod.c

This file was deleted.

Loading

0 comments on commit 5872c84

Please sign in to comment.