Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82798a17 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (34 commits)
  [MIPS] tb0219: Update copyright message.
  [MIPS] MT: Fix bug in multithreaded kernels.
  [MIPS] Alchemy: Remove CONFIG_TS_AU1X00_ADS7846 from defconfigs.
  Author: Ralf Baechle <ralf@linux-mips.org>
  [MIPS] sb1250: Enable GenBus IDE in defconfig.
  [MIPS] vmlinux.ld.S: correctly indent .data section
  [MIPS] c-r3k: Implement flush_cache_range()
  [MIPS] Store sign-extend register values for PTRACE_GETREGS
  [MIPS] Alchemy: Register platform devices
  [MIPS] Add len and addr validation for MAP_FIXED mappings.
  [MIPS] IRIX: Fix off-by-one error in signal compat code.
  [MIPS] time: Replace plat_timer_setup with modern APIs.
  [MIPS] time: Fix cut'n'paste bug in Sibyte clockevent driver.
  [MIPS] time: Make c0_compare_int_usable faster
  [MIPS] time: Fix cevt-r4k.c for 64-bit kernel
  [MIPS] Sibyte: Delete {sb1250,bcm1480}_steal_irq().
  [MIPS] txx9tmr clockevent/clocksource driver
  [MIPS] Add mips_hpt_frequency check to mips_clockevent_init().
  [MIPS] IP32: Fixes after interrupt renumbering.
  [MIPS] IP27: Fix slice logic to work for arbitrary number of slices.
  ...
parents db818536 1a3b7920
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -583,6 +583,7 @@ config SNI_RM

config TOSHIBA_JMR3927
	bool "Toshiba JMR-TX3927 board"
	select CEVT_TXX9
	select DMA_NONCOHERENT
	select HW_HAS_PCI
	select MIPS_TX3927
@@ -597,6 +598,7 @@ config TOSHIBA_JMR3927
config TOSHIBA_RBTX4927
	bool "Toshiba RBTX49[23]7 board"
	select CEVT_R4K
	select CEVT_TXX9
	select DMA_NONCOHERENT
	select HAS_TXX9_SERIAL
	select HW_HAS_PCI
@@ -618,6 +620,7 @@ config TOSHIBA_RBTX4927
config TOSHIBA_RBTX4938
	bool "Toshiba RBTX4938 board"
	select CEVT_R4K
	select CEVT_TXX9
	select DMA_NONCOHERENT
	select HAS_TXX9_SERIAL
	select HW_HAS_PCI
@@ -736,6 +739,9 @@ config CEVT_GT641XX
config CEVT_R4K
	bool

config CEVT_TXX9
	bool

config CFE
	bool

+0 −32
Original line number Diff line number Diff line
@@ -318,38 +318,6 @@ static struct irq_chip level_irq_type = {
	.end		= end_irq,
};

#ifdef CONFIG_PM
void startup_match20_interrupt(irq_handler_t handler)
{
	struct irq_desc *desc = &irq_desc[AU1000_TOY_MATCH2_INT];

	static struct irqaction action;
	memset(&action, 0, sizeof(struct irqaction));

	/*
	 * This is a big problem.... since we didn't use request_irq
	 * when kernel/irq.c calls probe_irq_xxx this interrupt will
	 * be probed for usage. This will end up disabling the device :(
	 * Give it a bogus "action" pointer -- this will keep it from
	 * getting auto-probed!
	 *
	 * By setting the status to match that of request_irq() we
	 * can avoid it.  --cgray
	*/
	action.dev_id = handler;
	action.flags = IRQF_DISABLED;
	cpus_clear(action.mask);
	action.name = "Au1xxx TOY";
	action.handler = handler;
	action.next = NULL;

	desc->action = &action;
	desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS);

	local_enable_irq(AU1000_TOY_MATCH2_INT);
}
#endif

static void __init setup_local_irq(unsigned int irq_nr, int type, int int_req)
{
	unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE;
+12 −10
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ static DEFINE_SPINLOCK(time_lock);
unsigned long wtimer;

#ifdef CONFIG_PM
irqreturn_t counter0_irq(int irq, void *dev_id)
static irqreturn_t counter0_irq(int irq, void *dev_id)
{
	unsigned long pc0;
	int time_elapsed;
@@ -117,6 +117,13 @@ irqreturn_t counter0_irq(int irq, void *dev_id)
	return IRQ_HANDLED;
}

struct irqaction counter0_action = {
	.handler	= counter0_irq,
	.flags		= IRQF_DISABLED,
	.name		= "alchemy-toy",
	.dev_id		= NULL,
};

/* When we wakeup from sleep, we have to "catch up" on all of the
 * timer ticks we have missed.
 */
@@ -221,7 +228,7 @@ unsigned long cal_r4koff(void)
	return (cpu_speed / HZ);
}

void __init plat_timer_setup(struct irqaction *irq)
void __init plat_time_init(void)
{
	unsigned int est_freq;

@@ -255,15 +262,10 @@ void __init plat_timer_setup(struct irqaction *irq)
	 * we do this.
	 */
	if (no_au1xxx_32khz) {
		unsigned int c0_status;

		printk("WARNING: no 32KHz clock found.\n");

		/* Ensure we get CPO_COUNTER interrupts.
		*/
		c0_status = read_c0_status();
		c0_status |= IE_IRQ5;
		write_c0_status(c0_status);
		/* Ensure we get CPO_COUNTER interrupts.  */
		set_c0_status(IE_IRQ5);
	}
	else {
		while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S);
@@ -280,7 +282,7 @@ void __init plat_timer_setup(struct irqaction *irq)
		au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
		au_sync();
		while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
		startup_match20_interrupt(counter0_irq);
		setup_irq(AU1000_TOY_MATCH2_INT, &counter0_action);

		/* We can use the real 'wait' instruction.
		*/
+1 −0
Original line number Diff line number Diff line
@@ -8,3 +8,4 @@
#

lib-y := init.o board_setup.o irqmap.o
obj-y := platform.o
+86 −0
Original line number Diff line number Diff line
/*
 * MTX-1 platform devices registration
 *
 * Copyright (C) 2007, Florian Fainelli <florian@openwrt.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <linux/init.h>
#include <linux/types.h>
#include <linux/platform_device.h>
#include <linux/leds.h>

#include <asm/gpio.h>

static struct resource mtx1_wdt_res[] = {
	[0] = {
		.start	= 15,
		.end	= 15,
		.name	= "mtx1-wdt-gpio",
		.flags	= IORESOURCE_IRQ,
	}
};

static struct resource mtx1_sys_btn[] = {
	[0] = {
		.start	= 7,
		.end	= 7,
		.name	= "mtx1-sys-btn-gpio",
		.flags	= IORESOURCE_IRQ,
	}
};

static struct platform_device mtx1_wdt = {
	.name = "mtx1-wdt",
	.id = 0,
	.num_resources = ARRAY_SIZE(mtx1_wdt_res),
	.resource = mtx1_wdt_res,
};

static struct gpio_led default_leds[] = {
	{
		.name	= "mtx1:green",
		.gpio = 211,
	}, {
		.name = "mtx1:red",
		.gpio = 212,
	},
};

static struct gpio_led_platform_data mtx1_led_data = {
	.num_leds = ARRAY_SIZE(default_leds),
	.leds = default_leds,
};

static struct platform_device mtx1_gpio_leds = {
	.name = "leds-gpio",
	.id = -1,
	.dev = {
		.platform_data = &mtx1_led_data,
	}
};

static struct __initdata platform_device * mtx1_devs[] = {
	&mtx1_gpio_leds,
	&mtx1_wdt
};

static int __init mtx1_register_devices(void)
{
	return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs));
}

arch_initcall(mtx1_register_devices);
Loading