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

Commit d5c67bac authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  [MIPS] BCM47XX: Use new SSB SPROM data structure
  [MIPS] WGT634U: Register MTD as platform device.
  [MIPS] BCM47xx: Add defconfig file.
  [MIPS] RM: fix EISA=n compilation
  [MIPS] PCI: Coding style fixes for pcibios_enable_resources.
  [MIPS] PCI: Port i386 PCI fixes.
  [MIPS] Qemu: finish platform removal
  [MIPS] Wire up the timerfd_*() o32 system calls
  [MIPS] IP28: Add defconfig file
  [MIPS] SB1: Fix CONFIG_SIBYTE_DMA_PAGEOPS build failure.
  [MIPS] BCM1480: Remove stray function call resulting in infinite recursion
  [MIPS] Fix buggy invocations of kmap_coherent()
  [MIPS] Fix broken rm7000/rm9000 interrupt handling
  [MIPS] Handle I-cache coherency in flush_cache_range()
  [MIPS] IP27: Add missing ~ in DMA code.
  [MIPS] Use find_task_by_vpid in system calls
parents 989b0b93 cc2d6f70
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -92,17 +92,17 @@ static int bcm47xx_get_invariants(struct ssb_bus *bus,
	iv->sprom.revision = 3;

	if (cfe_getenv("et0macaddr", buf, sizeof(buf)) >= 0)
		str2eaddr(buf, iv->sprom.r1.et0mac);
		str2eaddr(buf, iv->sprom.et0mac);
	if (cfe_getenv("et1macaddr", buf, sizeof(buf)) >= 0)
		str2eaddr(buf, iv->sprom.r1.et1mac);
		str2eaddr(buf, iv->sprom.et1mac);
	if (cfe_getenv("et0phyaddr", buf, sizeof(buf)) >= 0)
		iv->sprom.r1.et0phyaddr = simple_strtoul(buf, NULL, 10);
		iv->sprom.et0phyaddr = simple_strtoul(buf, NULL, 10);
	if (cfe_getenv("et1phyaddr", buf, sizeof(buf)) >= 0)
		iv->sprom.r1.et1phyaddr = simple_strtoul(buf, NULL, 10);
		iv->sprom.et1phyaddr = simple_strtoul(buf, NULL, 10);
	if (cfe_getenv("et0mdcport", buf, sizeof(buf)) >= 0)
		iv->sprom.r1.et0mdcport = simple_strtoul(buf, NULL, 10);
		iv->sprom.et0mdcport = simple_strtoul(buf, NULL, 10);
	if (cfe_getenv("et1mdcport", buf, sizeof(buf)) >= 0)
		iv->sprom.r1.et1mdcport = simple_strtoul(buf, NULL, 10);
		iv->sprom.et1mdcport = simple_strtoul(buf, NULL, 10);

	return 0;
}
+67 −4
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/leds.h>
#include <linux/mtd/physmap.h>
#include <linux/ssb/ssb.h>
#include <asm/mach-bcm47xx/bcm47xx.h>

@@ -43,6 +44,61 @@ static struct platform_device wgt634u_gpio_leds = {
	}
};


/* 8MiB flash. The struct mtd_partition matches original Netgear WGT634U
   firmware. */
static struct mtd_partition wgt634u_partitions[] = {
	{
		.name       = "cfe",
		.offset     = 0,
		.size       = 0x60000,		/* 384k */
		.mask_flags = MTD_WRITEABLE 	/* force read-only */
	},
	{
		.name   = "config",
		.offset = 0x60000,
		.size   = 0x20000		/* 128k */
	},
	{
		.name   = "linux",
		.offset = 0x80000,
		.size   = 0x140000 		/* 1280k */
	},
	{
		.name   = "jffs",
		.offset = 0x1c0000,
		.size   = 0x620000 		/* 6272k */
	},
	{
		.name   = "nvram",
		.offset = 0x7e0000,
		.size   = 0x20000		/* 128k */
	},
};

static struct physmap_flash_data wgt634u_flash_data = {
	.parts    = wgt634u_partitions,
	.nr_parts = ARRAY_SIZE(wgt634u_partitions)
};

static struct resource wgt634u_flash_resource = {
	.flags = IORESOURCE_MEM,
};

static struct platform_device wgt634u_flash = {
	.name          = "physmap-flash",
	.id            = 0,
	.dev           = { .platform_data = &wgt634u_flash_data, },
	.resource      = &wgt634u_flash_resource,
	.num_resources = 1,
};

/* Platform devices */
static struct platform_device *wgt634u_devices[] __initdata = {
	&wgt634u_flash,
	&wgt634u_gpio_leds,
};

static int __init wgt634u_init(void)
{
	/* There is no easy way to detect that we are running on a WGT634U
@@ -50,13 +106,20 @@ static int __init wgt634u_init(void)
	 * been allocated ranges 00:09:5b:xx:xx:xx and 00:0f:b5:xx:xx:xx.
	 */

	u8 *et0mac = ssb_bcm47xx.sprom.r1.et0mac;
	u8 *et0mac = ssb_bcm47xx.sprom.et0mac;

	if (et0mac[0] == 0x00 &&
	    ((et0mac[1] == 0x09 && et0mac[2] == 0x5b) ||
	     (et0mac[1] == 0x0f && et0mac[2] == 0xb5)))
		return platform_device_register(&wgt634u_gpio_leds);
	else
	     (et0mac[1] == 0x0f && et0mac[2] == 0xb5))) {
		struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore;
		wgt634u_flash_data.width = mcore->flash_buswidth;
		wgt634u_flash_resource.start = mcore->flash_window;
		wgt634u_flash_resource.end = mcore->flash_window
					   + mcore->flash_window_size
					   - 1;
		return platform_add_devices(wgt634u_devices,
					    ARRAY_SIZE(wgt634u_devices));
	} else
		return -ENODEV;
}

+1939 −0

File added.

Preview size limit exceeded, changes collapsed.

+891 −0

File changed and moved.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ static struct irq_chip rm7k_irq_controller = {
	.mask = mask_rm7k_irq,
	.mask_ack = mask_rm7k_irq,
	.unmask = unmask_rm7k_irq,
	.eoi	= unmask_rm7k_irq
};

void __init rm7k_cpu_irq_init(void)
Loading