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

Commit 4505a493 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (36 commits)
  MIPS: Calculate proper ebase value for 64-bit kernels
  MIPS: Alchemy: DB1200: Remove custom wait implementation
  MIPS: Big Sur: Make defconfig more useful.
  MIPS: Fix __vmalloc() etc. on MIPS for non-GPL modules
  MIPS: Sibyte: Fix M3 TLB exception handler workaround.
  MIPS: BCM63xx: Fix build failure in board_bcm963xx.c
  MIPS: uasm: Add OR instruction.
  MIPS: Sibyte: Apply M3 workaround only on affected chip types and versions.
  MIPS: BCM63xx: Initialize gpio_out_low & out_high to current value at boot.
  MIPS: BCM63xx: Register SSB SPROM fallback in board's first stage callback
  MIPS: BCM63xx: Fix typo in cpu-feature-overrides file.
  MIPS: BCM63xx: Add support for second uart.
  MIPS: BCM63xx: Fix double gpio registration.
  MIPS: BCM63xx: Add DWVS0 board
  MIPS: BCM63xx: Add the RTA1025W-16 BCM6348-based board to suppported boards.
  MIPS: BCM63xx: Fix BCM6338 and BCM6345 gpio count
  MIPS: libgcc.h: Checkpatch cleanup
  MIPS: Loongson-2F: Flush the branch target history in BTB and RAS
  MIPS: Move signal trampolines off of the stack.
  MIPS: Preliminary VDSO
  ...
parents fedfb947 f6be75d0
Loading
Loading
Loading
Loading
+0 −40
Original line number Diff line number Diff line
@@ -60,43 +60,6 @@ void __init board_setup(void)
	wmb();
}

/* use the hexleds to count the number of times the cpu has entered
 * wait, the dots to indicate whether the CPU is currently idle or
 * active (dots off = sleeping, dots on = working) for cases where
 * the number doesn't change for a long(er) period of time.
 */
static void db1200_wait(void)
{
	__asm__("	.set	push			\n"
		"	.set	mips3			\n"
		"	.set	noreorder		\n"
		"	cache	0x14, 0(%0)		\n"
		"	cache	0x14, 32(%0)		\n"
		"	cache	0x14, 64(%0)		\n"
		/* dots off: we're about to call wait */
		"	lui	$26, 0xb980		\n"
		"	ori	$27, $0, 3		\n"
		"	sb	$27, 0x18($26)		\n"
		"	sync				\n"
		"	nop				\n"
		"	wait				\n"
		"	nop				\n"
		"	nop				\n"
		"	nop				\n"
		"	nop				\n"
		"	nop				\n"
		/* dots on: there's work to do, increment cntr */
		"	lui	$26, 0xb980		\n"
		"	sb	$0, 0x18($26)		\n"
		"	lui	$26, 0xb9c0		\n"
		"	lb	$27, 0($26)		\n"
		"	addiu	$27, $27, 1		\n"
		"	sb	$27, 0($26)		\n"
		"	sync				\n"
		"	.set	pop			\n"
		: : "r" (db1200_wait));
}

static int __init db1200_arch_init(void)
{
	/* GPIO7 is low-level triggered CPLD cascade */
@@ -110,9 +73,6 @@ static int __init db1200_arch_init(void)
	irq_to_desc(DB1200_SD0_INSERT_INT)->status |= IRQ_NOAUTOEN;
	irq_to_desc(DB1200_SD0_EJECT_INT)->status |= IRQ_NOAUTOEN;

	if (cpu_wait)
		cpu_wait = db1200_wait;

	return 0;
}
arch_initcall(db1200_arch_init);
+2 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ static struct plat_vlynq_data vlynq_high_data = {
		.on	= vlynq_on,
		.off	= vlynq_off,
	},
	.reset_bit	= 26,
	.reset_bit	= 16,
	.gpio_bit	= 19,
};

@@ -600,6 +600,7 @@ static int __init ar7_register_devices(void)
	}

	if (ar7_has_high_cpmac()) {
		res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status);
		if (!res) {
			cpmac_get_mac(1, cpmac_high_data.dev_addr);

+147 −84
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <asm/addrspace.h>
#include <bcm63xx_board.h>
#include <bcm63xx_cpu.h>
#include <bcm63xx_dev_uart.h>
#include <bcm63xx_regs.h>
#include <bcm63xx_io.h>
#include <bcm63xx_dev_pci.h>
@@ -40,6 +41,7 @@ static struct board_info __initdata board_96338gw = {
	.name				= "96338GW",
	.expected_cpu_id		= 0x6338,

	.has_uart0			= 1,
	.has_enet0			= 1,
	.enet0 = {
		.force_speed_100	= 1,
@@ -82,6 +84,7 @@ static struct board_info __initdata board_96338w = {
	.name				= "96338W",
	.expected_cpu_id		= 0x6338,

	.has_uart0			= 1,
	.has_enet0			= 1,
	.enet0 = {
		.force_speed_100	= 1,
@@ -126,6 +129,8 @@ static struct board_info __initdata board_96338w = {
static struct board_info __initdata board_96345gw2 = {
	.name				= "96345GW2",
	.expected_cpu_id		= 0x6345,

	.has_uart0			= 1,
};
#endif

@@ -137,6 +142,7 @@ static struct board_info __initdata board_96348r = {
	.name				= "96348R",
	.expected_cpu_id		= 0x6348,

	.has_uart0			= 1,
	.has_enet0			= 1,
	.has_pci			= 1,

@@ -180,6 +186,7 @@ static struct board_info __initdata board_96348gw_10 = {
	.name				= "96348GW-10",
	.expected_cpu_id		= 0x6348,

	.has_uart0			= 1,
	.has_enet0			= 1,
	.has_enet1			= 1,
	.has_pci			= 1,
@@ -239,6 +246,7 @@ static struct board_info __initdata board_96348gw_11 = {
	.name				= "96348GW-11",
	.expected_cpu_id		= 0x6348,

	.has_uart0			= 1,
	.has_enet0			= 1,
	.has_enet1			= 1,
	.has_pci			= 1,
@@ -292,6 +300,7 @@ static struct board_info __initdata board_96348gw = {
	.name				= "96348GW",
	.expected_cpu_id		= 0x6348,

	.has_uart0			= 1,
	.has_enet0			= 1,
	.has_enet1			= 1,
	.has_pci			= 1,
@@ -349,6 +358,7 @@ static struct board_info __initdata board_FAST2404 = {
	.name				= "F@ST2404",
	.expected_cpu_id		= 0x6348,

	.has_uart0			= 1,
        .has_enet0			= 1,
        .has_enet1			= 1,
        .has_pci			= 1,
@@ -368,10 +378,30 @@ static struct board_info __initdata board_FAST2404 = {
	.has_ehci0			= 1,
};

static struct board_info __initdata board_rta1025w_16 = {
	.name				= "RTA1025W_16",
	.expected_cpu_id		= 0x6348,

	.has_enet0			= 1,
	.has_enet1			= 1,
	.has_pci			= 1,

	.enet0 = {
		.has_phy		= 1,
		.use_internal_phy	= 1,
	},
	.enet1 = {
		.force_speed_100	= 1,
		.force_duplex_full	= 1,
	},
};


static struct board_info __initdata board_DV201AMR = {
	.name				= "DV201AMR",
	.expected_cpu_id		= 0x6348,

	.has_uart0			= 1,
	.has_pci			= 1,
	.has_ohci0			= 1,

@@ -391,6 +421,7 @@ static struct board_info __initdata board_96348gw_a = {
	.name				= "96348GW-A",
	.expected_cpu_id		= 0x6348,

	.has_uart0			= 1,
	.has_enet0			= 1,
	.has_enet1			= 1,
	.has_pci			= 1,
@@ -416,6 +447,7 @@ static struct board_info __initdata board_96358vw = {
	.name				= "96358VW",
	.expected_cpu_id		= 0x6358,

	.has_uart0			= 1,
	.has_enet0			= 1,
	.has_enet1			= 1,
	.has_pci			= 1,
@@ -467,6 +499,7 @@ static struct board_info __initdata board_96358vw2 = {
	.name				= "96358VW2",
	.expected_cpu_id		= 0x6358,

	.has_uart0			= 1,
	.has_enet0			= 1,
	.has_enet1			= 1,
	.has_pci			= 1,
@@ -514,6 +547,7 @@ static struct board_info __initdata board_AGPFS0 = {
	.name                           = "AGPF-S0",
	.expected_cpu_id                = 0x6358,

	.has_uart0			= 1,
	.has_enet0                      = 1,
	.has_enet1                      = 1,
	.has_pci                        = 1,
@@ -531,6 +565,27 @@ static struct board_info __initdata board_AGPFS0 = {
	.has_ohci0 = 1,
	.has_ehci0 = 1,
};

static struct board_info __initdata board_DWVS0 = {
	.name				= "DWV-S0",
	.expected_cpu_id		= 0x6358,

	.has_enet0			= 1,
	.has_enet1			= 1,
	.has_pci			= 1,

	.enet0 = {
		.has_phy		= 1,
		.use_internal_phy	= 1,
	},

	.enet1 = {
		.force_speed_100	= 1,
		.force_duplex_full	= 1,
	},

	.has_ohci0			= 1,
};
#endif

/*
@@ -552,15 +607,87 @@ static const struct board_info __initdata *bcm963xx_boards[] = {
	&board_FAST2404,
	&board_DV201AMR,
	&board_96348gw_a,
	&board_rta1025w_16,
#endif

#ifdef CONFIG_BCM63XX_CPU_6358
	&board_96358vw,
	&board_96358vw2,
	&board_AGPFS0,
	&board_DWVS0,
#endif
};

/*
 * Register a sane SPROMv2 to make the on-board
 * bcm4318 WLAN work
 */
#ifdef CONFIG_SSB_PCIHOST
static struct ssb_sprom bcm63xx_sprom = {
	.revision		= 0x02,
	.board_rev		= 0x17,
	.country_code		= 0x0,
	.ant_available_bg 	= 0x3,
	.pa0b0			= 0x15ae,
	.pa0b1			= 0xfa85,
	.pa0b2			= 0xfe8d,
	.pa1b0			= 0xffff,
	.pa1b1			= 0xffff,
	.pa1b2			= 0xffff,
	.gpio0			= 0xff,
	.gpio1			= 0xff,
	.gpio2			= 0xff,
	.gpio3			= 0xff,
	.maxpwr_bg		= 0x004c,
	.itssi_bg		= 0x00,
	.boardflags_lo		= 0x2848,
	.boardflags_hi		= 0x0000,
};
#endif

/*
 * return board name for /proc/cpuinfo
 */
const char *board_get_name(void)
{
	return board.name;
}

/*
 * register & return a new board mac address
 */
static int board_get_mac_address(u8 *mac)
{
	u8 *p;
	int count;

	if (mac_addr_used >= nvram.mac_addr_count) {
		printk(KERN_ERR PFX "not enough mac address\n");
		return -ENODEV;
	}

	memcpy(mac, nvram.mac_addr_base, ETH_ALEN);
	p = mac + ETH_ALEN - 1;
	count = mac_addr_used;

	while (count--) {
		do {
			(*p)++;
			if (*p != 0)
				break;
			p--;
		} while (p != mac);
	}

	if (p == mac) {
		printk(KERN_ERR PFX "unable to fetch mac address\n");
		return -ENODEV;
	}

	mac_addr_used++;
	return 0;
}

/*
 * early init callback, read nvram data from flash and checksum it
 */
@@ -659,6 +786,17 @@ void __init board_prom_init(void)
	}

	bcm_gpio_writel(val, GPIO_MODE_REG);

	/* Generate MAC address for WLAN and
	 * register our SPROM */
#ifdef CONFIG_SSB_PCIHOST
	if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
		memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
		memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
		if (ssb_arch_set_fallback_sprom(&bcm63xx_sprom) < 0)
			printk(KERN_ERR "failed to register fallback SPROM\n");
	}
#endif
}

/*
@@ -676,49 +814,6 @@ void __init board_setup(void)
		panic("unexpected CPU for bcm963xx board");
}

/*
 * return board name for /proc/cpuinfo
 */
const char *board_get_name(void)
{
	return board.name;
}

/*
 * register & return a new board mac address
 */
static int board_get_mac_address(u8 *mac)
{
	u8 *p;
	int count;

	if (mac_addr_used >= nvram.mac_addr_count) {
		printk(KERN_ERR PFX "not enough mac address\n");
		return -ENODEV;
	}

	memcpy(mac, nvram.mac_addr_base, ETH_ALEN);
	p = mac + ETH_ALEN - 1;
	count = mac_addr_used;

	while (count--) {
		do {
			(*p)++;
			if (*p != 0)
				break;
			p--;
		} while (p != mac);
	}

	if (p == mac) {
		printk(KERN_ERR PFX "unable to fetch mac address\n");
		return -ENODEV;
	}

	mac_addr_used++;
	return 0;
}

static struct mtd_partition mtd_partitions[] = {
	{
		.name		= "cfe",
@@ -750,33 +845,6 @@ static struct platform_device mtd_dev = {
	},
};

/*
 * Register a sane SPROMv2 to make the on-board
 * bcm4318 WLAN work
 */
#ifdef CONFIG_SSB_PCIHOST
static struct ssb_sprom bcm63xx_sprom = {
	.revision		= 0x02,
	.board_rev		= 0x17,
	.country_code		= 0x0,
	.ant_available_bg 	= 0x3,
	.pa0b0			= 0x15ae,
	.pa0b1			= 0xfa85,
	.pa0b2			= 0xfe8d,
	.pa1b0			= 0xffff,
	.pa1b1			= 0xffff,
	.pa1b2			= 0xffff,
	.gpio0			= 0xff,
	.gpio1			= 0xff,
	.gpio2			= 0xff,
	.gpio3			= 0xff,
	.maxpwr_bg		= 0x004c,
	.itssi_bg		= 0x00,
	.boardflags_lo		= 0x2848,
	.boardflags_hi		= 0x0000,
};
#endif

static struct gpio_led_platform_data bcm63xx_led_data;

static struct platform_device bcm63xx_gpio_leds = {
@@ -792,6 +860,12 @@ int __init board_register_devices(void)
{
	u32 val;

	if (board.has_uart0)
		bcm63xx_uart_register(0);

	if (board.has_uart1)
		bcm63xx_uart_register(1);

	if (board.has_pccard)
		bcm63xx_pcmcia_register();

@@ -806,17 +880,6 @@ int __init board_register_devices(void)
	if (board.has_dsp)
		bcm63xx_dsp_register(&board.dsp);

	/* Generate MAC address for WLAN and
	 * register our SPROM */
#ifdef CONFIG_SSB_PCIHOST
	if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
		memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
		memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
		if (ssb_arch_set_fallback_sprom(&bcm63xx_sprom) < 0)
			printk(KERN_ERR "failed to register fallback SPROM\n");
	}
#endif

	/* read base address of boot chip select (0) */
	if (BCMCPU_IS_6345())
		val = 0x1fc00000;
+5 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ static const unsigned long bcm96338_regs_base[] = {
	[RSET_TIMER]		= BCM_6338_TIMER_BASE,
	[RSET_WDT]		= BCM_6338_WDT_BASE,
	[RSET_UART0]		= BCM_6338_UART0_BASE,
	[RSET_UART1]		= BCM_6338_UART1_BASE,
	[RSET_GPIO]		= BCM_6338_GPIO_BASE,
	[RSET_SPI]		= BCM_6338_SPI_BASE,
	[RSET_OHCI0]		= BCM_6338_OHCI0_BASE,
@@ -72,6 +73,7 @@ static const unsigned long bcm96345_regs_base[] = {
	[RSET_TIMER]		= BCM_6345_TIMER_BASE,
	[RSET_WDT]		= BCM_6345_WDT_BASE,
	[RSET_UART0]		= BCM_6345_UART0_BASE,
	[RSET_UART1]		= BCM_6345_UART1_BASE,
	[RSET_GPIO]		= BCM_6345_GPIO_BASE,
	[RSET_SPI]		= BCM_6345_SPI_BASE,
	[RSET_UDC0]		= BCM_6345_UDC0_BASE,
@@ -109,6 +111,7 @@ static const unsigned long bcm96348_regs_base[] = {
	[RSET_TIMER]		= BCM_6348_TIMER_BASE,
	[RSET_WDT]		= BCM_6348_WDT_BASE,
	[RSET_UART0]		= BCM_6348_UART0_BASE,
	[RSET_UART1]		= BCM_6348_UART1_BASE,
	[RSET_GPIO]		= BCM_6348_GPIO_BASE,
	[RSET_SPI]		= BCM_6348_SPI_BASE,
	[RSET_OHCI0]		= BCM_6348_OHCI0_BASE,
@@ -150,6 +153,7 @@ static const unsigned long bcm96358_regs_base[] = {
	[RSET_TIMER]		= BCM_6358_TIMER_BASE,
	[RSET_WDT]		= BCM_6358_WDT_BASE,
	[RSET_UART0]		= BCM_6358_UART0_BASE,
	[RSET_UART1]		= BCM_6358_UART1_BASE,
	[RSET_GPIO]		= BCM_6358_GPIO_BASE,
	[RSET_SPI]		= BCM_6358_SPI_BASE,
	[RSET_OHCI0]		= BCM_6358_OHCI0_BASE,
@@ -170,6 +174,7 @@ static const unsigned long bcm96358_regs_base[] = {
static const int bcm96358_irqs[] = {
	[IRQ_TIMER]		= BCM_6358_TIMER_IRQ,
	[IRQ_UART0]		= BCM_6358_UART0_IRQ,
	[IRQ_UART1]		= BCM_6358_UART1_IRQ,
	[IRQ_DSL]		= BCM_6358_DSL_IRQ,
	[IRQ_ENET0]		= BCM_6358_ENET0_IRQ,
	[IRQ_ENET1]		= BCM_6358_ENET1_IRQ,
+50 −16
Original line number Diff line number Diff line
@@ -11,31 +11,65 @@
#include <linux/platform_device.h>
#include <bcm63xx_cpu.h>

static struct resource uart_resources[] = {
static struct resource uart0_resources[] = {
	{
		.start		= -1, /* filled at runtime */
		.end		= -1, /* filled at runtime */
		/* start & end filled at runtime */
		.flags		= IORESOURCE_MEM,
	},
	{
		.start		= -1, /* filled at runtime */
		/* start filled at runtime */
		.flags		= IORESOURCE_IRQ,
	},
};

static struct platform_device bcm63xx_uart_device = {
static struct resource uart1_resources[] = {
	{
		/* start & end filled at runtime */
		.flags		= IORESOURCE_MEM,
	},
	{
		/* start filled at runtime */
		.flags		= IORESOURCE_IRQ,
	},
};

static struct platform_device bcm63xx_uart_devices[] = {
	{
		.name		= "bcm63xx_uart",
		.id		= 0,
	.num_resources	= ARRAY_SIZE(uart_resources),
	.resource	= uart_resources,
		.num_resources	= ARRAY_SIZE(uart0_resources),
		.resource	= uart0_resources,
	},

	{
		.name		= "bcm63xx_uart",
		.id		= 1,
		.num_resources	= ARRAY_SIZE(uart1_resources),
		.resource	= uart1_resources,
	}
};

int __init bcm63xx_uart_register(void)
int __init bcm63xx_uart_register(unsigned int id)
{
	uart_resources[0].start = bcm63xx_regset_address(RSET_UART0);
	uart_resources[0].end = uart_resources[0].start;
	uart_resources[0].end += RSET_UART_SIZE - 1;
	uart_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0);
	return platform_device_register(&bcm63xx_uart_device);
	if (id >= ARRAY_SIZE(bcm63xx_uart_devices))
		return -ENODEV;

	if (id == 1 && !BCMCPU_IS_6358())
		return -ENODEV;

	if (id == 0) {
		uart0_resources[0].start = bcm63xx_regset_address(RSET_UART0);
		uart0_resources[0].end = uart0_resources[0].start +
			RSET_UART_SIZE - 1;
		uart0_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0);
	}

	if (id == 1) {
		uart1_resources[0].start = bcm63xx_regset_address(RSET_UART1);
		uart1_resources[0].end = uart1_resources[0].start +
			RSET_UART_SIZE - 1;
		uart1_resources[1].start = bcm63xx_get_irq_number(IRQ_UART1);
	}

	return platform_device_register(&bcm63xx_uart_devices[id]);
}
arch_initcall(bcm63xx_uart_register);
Loading