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

Commit 04ab5918 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  MIPS: Kill unused <asm/debug.h> inclusions
  MIPS: IP32: Add platform device for CMOS RTC; remove dead code
  RTC: M48T35: new RTC driver
  MIPS: IP27: Switch over to RTC class driver
  MIPS: DS1286: New RTC driver
  MIPS: IP22/28: Switch over to RTC class driver
  MIPS: PCI: Scan busses when they are registered
  MIPS: WGT634U: Add reset button support
  MIPS: BCM47xx: Use the new SSB GPIO API
  MIPS: BCM47xx: Remove references to BCM947XX
  MIPS: WGT634U: Add machine detection message
  MIPS: Align .data.cacheline_aligned based on CONFIG_MIPS_L1_CACHE_SHIFT
  MIPS: show_cpuinfo prints the type of the calling CPU
  MIPS: Fix wrong branch target in new spin_lock code.
  MIPS: Have a heart for a lonely, lost header file ...
parents 7c3b1dcf 08da6f1b
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -52,6 +52,7 @@ config BCM47XX
	select SSB
	select SSB
	select SSB_DRIVER_MIPS
	select SSB_DRIVER_MIPS
	select SSB_DRIVER_EXTIF
	select SSB_DRIVER_EXTIF
	select SSB_EMBEDDED
	select SSB_PCICORE_HOSTMODE if PCI
	select SSB_PCICORE_HOSTMODE if PCI
	select GENERIC_GPIO
	select GENERIC_GPIO
	select SYS_HAS_EARLY_PRINTK
	select SYS_HAS_EARLY_PRINTK
+34 −51
Original line number Original line Diff line number Diff line
@@ -12,68 +12,51 @@
#include <asm/mach-bcm47xx/bcm47xx.h>
#include <asm/mach-bcm47xx/bcm47xx.h>
#include <asm/mach-bcm47xx/gpio.h>
#include <asm/mach-bcm47xx/gpio.h>


int bcm47xx_gpio_to_irq(unsigned gpio)
#if (BCM47XX_CHIPCO_GPIO_LINES > BCM47XX_EXTIF_GPIO_LINES)
static DECLARE_BITMAP(gpio_in_use, BCM47XX_CHIPCO_GPIO_LINES);
#else
static DECLARE_BITMAP(gpio_in_use, BCM47XX_EXTIF_GPIO_LINES);
#endif

int gpio_request(unsigned gpio, const char *tag)
{
{
	if (ssb_bcm47xx.chipco.dev)
	if (ssb_chipco_available(&ssb_bcm47xx.chipco) &&
		return ssb_mips_irq(ssb_bcm47xx.chipco.dev) + 2;
	    ((unsigned)gpio >= BCM47XX_CHIPCO_GPIO_LINES))
	else if (ssb_bcm47xx.extif.dev)
		return ssb_mips_irq(ssb_bcm47xx.extif.dev) + 2;
	else
		return -EINVAL;
		return -EINVAL;
}
EXPORT_SYMBOL_GPL(bcm47xx_gpio_to_irq);


int bcm47xx_gpio_get_value(unsigned gpio)
	if (ssb_extif_available(&ssb_bcm47xx.extif) &&
{
	    ((unsigned)gpio >= BCM47XX_EXTIF_GPIO_LINES))
	if (ssb_bcm47xx.chipco.dev)
		return -EINVAL;
		return ssb_chipco_gpio_in(&ssb_bcm47xx.chipco, 1 << gpio);

	else if (ssb_bcm47xx.extif.dev)
	if (test_and_set_bit(gpio, gpio_in_use))
		return ssb_extif_gpio_in(&ssb_bcm47xx.extif, 1 << gpio);
		return -EBUSY;
	else

	return 0;
	return 0;
}
}
EXPORT_SYMBOL_GPL(bcm47xx_gpio_get_value);
EXPORT_SYMBOL(gpio_request);


void bcm47xx_gpio_set_value(unsigned gpio, int value)
void gpio_free(unsigned gpio)
{
{
	if (ssb_bcm47xx.chipco.dev)
	if (ssb_chipco_available(&ssb_bcm47xx.chipco) &&
		ssb_chipco_gpio_out(&ssb_bcm47xx.chipco,
	    ((unsigned)gpio >= BCM47XX_CHIPCO_GPIO_LINES))
				    1 << gpio,
		return;
				    value ? 1 << gpio : 0);
	else if (ssb_bcm47xx.extif.dev)
		ssb_extif_gpio_out(&ssb_bcm47xx.extif,
				   1 << gpio,
				   value ? 1 << gpio : 0);
}
EXPORT_SYMBOL_GPL(bcm47xx_gpio_set_value);


int bcm47xx_gpio_direction_input(unsigned gpio)
	if (ssb_extif_available(&ssb_bcm47xx.extif) &&
{
	    ((unsigned)gpio >= BCM47XX_EXTIF_GPIO_LINES))
	if (ssb_bcm47xx.chipco.dev && (gpio < BCM47XX_CHIPCO_GPIO_LINES))
		return;
		ssb_chipco_gpio_outen(&ssb_bcm47xx.chipco,

				      1 << gpio, 0);
	clear_bit(gpio, gpio_in_use);
	else if (ssb_bcm47xx.extif.dev && (gpio < BCM47XX_EXTIF_GPIO_LINES))
		ssb_extif_gpio_outen(&ssb_bcm47xx.extif,
				     1 << gpio, 0);
	else
		return -EINVAL;
	return 0;
}
}
EXPORT_SYMBOL_GPL(bcm47xx_gpio_direction_input);
EXPORT_SYMBOL(gpio_free);


int bcm47xx_gpio_direction_output(unsigned gpio, int value)
int gpio_to_irq(unsigned gpio)
{
{
	bcm47xx_gpio_set_value(gpio, value);
	if (ssb_chipco_available(&ssb_bcm47xx.chipco))

		return ssb_mips_irq(ssb_bcm47xx.chipco.dev) + 2;
	if (ssb_bcm47xx.chipco.dev && (gpio < BCM47XX_CHIPCO_GPIO_LINES))
	else if (ssb_extif_available(&ssb_bcm47xx.extif))
		ssb_chipco_gpio_outen(&ssb_bcm47xx.chipco,
		return ssb_mips_irq(ssb_bcm47xx.extif.dev) + 2;
				      1 << gpio, 1 << gpio);
	else if (ssb_bcm47xx.extif.dev && (gpio < BCM47XX_EXTIF_GPIO_LINES))
		ssb_extif_gpio_outen(&ssb_bcm47xx.extif,
				     1 << gpio, 1 << gpio);
	else
	else
		return -EINVAL;
		return -EINVAL;
	return 0;
}
}
EXPORT_SYMBOL_GPL(bcm47xx_gpio_direction_output);
EXPORT_SYMBOL_GPL(gpio_to_irq);
+3 −2
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@


#include <linux/types.h>
#include <linux/types.h>
#include <linux/ssb/ssb.h>
#include <linux/ssb/ssb.h>
#include <linux/ssb/ssb_embedded.h>
#include <asm/bootinfo.h>
#include <asm/bootinfo.h>
#include <asm/reboot.h>
#include <asm/reboot.h>
#include <asm/time.h>
#include <asm/time.h>
@@ -41,7 +42,7 @@ static void bcm47xx_machine_restart(char *command)
	printk(KERN_ALERT "Please stand by while rebooting the system...\n");
	printk(KERN_ALERT "Please stand by while rebooting the system...\n");
	local_irq_disable();
	local_irq_disable();
	/* Set the watchdog timer to reset immediately */
	/* Set the watchdog timer to reset immediately */
	ssb_chipco_watchdog_timer_set(&ssb_bcm47xx.chipco, 1);
	ssb_watchdog_timer_set(&ssb_bcm47xx, 1);
	while (1)
	while (1)
		cpu_relax();
		cpu_relax();
}
}
@@ -50,7 +51,7 @@ static void bcm47xx_machine_halt(void)
{
{
	/* Disable interrupts and watchdog and spin forever */
	/* Disable interrupts and watchdog and spin forever */
	local_irq_disable();
	local_irq_disable();
	ssb_chipco_watchdog_timer_set(&ssb_bcm47xx.chipco, 0);
	ssb_watchdog_timer_set(&ssb_bcm47xx, 0);
	while (1)
	while (1)
		cpu_relax();
		cpu_relax();
}
}
+40 −0
Original line number Original line Diff line number Diff line
@@ -11,6 +11,9 @@
#include <linux/leds.h>
#include <linux/leds.h>
#include <linux/mtd/physmap.h>
#include <linux/mtd/physmap.h>
#include <linux/ssb/ssb.h>
#include <linux/ssb/ssb.h>
#include <linux/interrupt.h>
#include <linux/reboot.h>
#include <linux/gpio.h>
#include <asm/mach-bcm47xx/bcm47xx.h>
#include <asm/mach-bcm47xx/bcm47xx.h>


/* GPIO definitions for the WGT634U */
/* GPIO definitions for the WGT634U */
@@ -99,6 +102,30 @@ static struct platform_device *wgt634u_devices[] __initdata = {
	&wgt634u_gpio_leds,
	&wgt634u_gpio_leds,
};
};


static irqreturn_t gpio_interrupt(int irq, void *ignored)
{
	int state;

	/* Interrupts are shared, check if the current one is
	   a GPIO interrupt. */
	if (!ssb_chipco_irq_status(&ssb_bcm47xx.chipco,
				   SSB_CHIPCO_IRQ_GPIO))
		return IRQ_NONE;

	state = gpio_get_value(WGT634U_GPIO_RESET);

	/* Interrupt are level triggered, revert the interrupt polarity
	   to clear the interrupt. */
	gpio_polarity(WGT634U_GPIO_RESET, state);

	if (!state) {
		printk(KERN_INFO "Reset button pressed");
		ctrl_alt_del();
	}

	return IRQ_HANDLED;
}

static int __init wgt634u_init(void)
static int __init wgt634u_init(void)
{
{
	/* There is no easy way to detect that we are running on a WGT634U
	/* There is no easy way to detect that we are running on a WGT634U
@@ -112,6 +139,19 @@ static int __init wgt634u_init(void)
	    ((et0mac[1] == 0x09 && et0mac[2] == 0x5b) ||
	    ((et0mac[1] == 0x09 && et0mac[2] == 0x5b) ||
	     (et0mac[1] == 0x0f && et0mac[2] == 0xb5))) {
	     (et0mac[1] == 0x0f && et0mac[2] == 0xb5))) {
		struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore;
		struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore;

		printk(KERN_INFO "WGT634U machine detected.\n");

		if (!request_irq(gpio_to_irq(WGT634U_GPIO_RESET),
				 gpio_interrupt, IRQF_SHARED,
				 "WGT634U GPIO", &ssb_bcm47xx.chipco)) {
			gpio_direction_input(WGT634U_GPIO_RESET);
			gpio_intmask(WGT634U_GPIO_RESET, 1);
			ssb_chipco_irq_mask(&ssb_bcm47xx.chipco,
					    SSB_CHIPCO_IRQ_GPIO,
					    SSB_CHIPCO_IRQ_GPIO);
		}

		wgt634u_flash_data.width = mcore->flash_buswidth;
		wgt634u_flash_data.width = mcore->flash_buswidth;
		wgt634u_flash_resource.start = mcore->flash_window;
		wgt634u_flash_resource.start = mcore->flash_window;
		wgt634u_flash_resource.end = mcore->flash_window
		wgt634u_flash_resource.end = mcore->flash_window
+0 −1
Original line number Original line Diff line number Diff line
@@ -29,7 +29,6 @@


#include <asm/system.h>
#include <asm/system.h>
#include <asm/mipsregs.h>
#include <asm/mipsregs.h>
#include <asm/debug.h>
#include <asm/addrspace.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <asm/bootinfo.h>


Loading