aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-3.14/014-MIPS-BCM63XX-remove-RUNTIME_DETECT-from-spi-code.patch
blob: afde39bbaae7d35f02633f2fca7c1d45689d9797 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
From 94f819bc230bb61a9ff21da6c860a40ca68c2805 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jogo@openwrt.org>
Date: Tue, 3 Dec 2013 13:43:35 +0100
Subject: [PATCH 5/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from spi code

---
 arch/mips/bcm63xx/dev-spi.c                        |  4 ---
 .../include/asm/mach-bcm63xx/bcm63xx_dev_spi.h     | 31 ----------------------
 2 files changed, 35 deletions(-)

--- a/arch/mips/bcm63xx/dev-spi.c
+++ b/arch/mips/bcm63xx/dev-spi.c
@@ -18,7 +18,6 @@
 #include <bcm63xx_dev_spi.h>
 #include <bcm63xx_regs.h>
 
-#ifdef BCMCPU_RUNTIME_DETECT
 /*
  * register offsets
  */
@@ -41,9 +40,6 @@ static __init void bcm63xx_spi_regs_init
 		BCMCPU_IS_6362() || BCMCPU_IS_6368())
 		bcm63xx_regs_spi = bcm6358_regs_spi;
 }
-#else
-static __init void bcm63xx_spi_regs_init(void) { }
-#endif
 
 static struct resource spi_resources[] = {
 	{
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h
@@ -30,26 +30,6 @@ enum bcm63xx_regs_spi {
 	SPI_RX_DATA,
 };
 
-#define __GEN_SPI_RSET_BASE(__cpu, __rset)				\
-	case SPI_## __rset:						\
-		return SPI_## __cpu ##_## __rset;
-
-#define __GEN_SPI_RSET(__cpu)						\
-	switch (reg) {							\
-	__GEN_SPI_RSET_BASE(__cpu, CMD)					\
-	__GEN_SPI_RSET_BASE(__cpu, INT_STATUS)				\
-	__GEN_SPI_RSET_BASE(__cpu, INT_MASK_ST)				\
-	__GEN_SPI_RSET_BASE(__cpu, INT_MASK)				\
-	__GEN_SPI_RSET_BASE(__cpu, ST)					\
-	__GEN_SPI_RSET_BASE(__cpu, CLK_CFG)				\
-	__GEN_SPI_RSET_BASE(__cpu, FILL_BYTE)				\
-	__GEN_SPI_RSET_BASE(__cpu, MSG_TAIL)				\
-	__GEN_SPI_RSET_BASE(__cpu, RX_TAIL)				\
-	__GEN_SPI_RSET_BASE(__cpu, MSG_CTL)				\
-	__GEN_SPI_RSET_BASE(__cpu, MSG_DATA)				\
-	__GEN_SPI_RSET_BASE(__cpu, RX_DATA)				\
-	}
-
 #define __GEN_SPI_REGS_TABLE(__cpu)					\
 	[SPI_CMD]		= SPI_## __cpu ##_CMD,			\
 	[SPI_INT_STATUS]	= SPI_## __cpu ##_INT_STATUS,		\
@@ -66,20 +46,9 @@ enum bcm63xx_regs_spi {
 
 static inline unsigned long bcm63xx_spireg(enum bcm63xx_regs_spi reg)
 {
-#ifdef BCMCPU_RUNTIME_DETECT
 	extern const unsigned long *bcm63xx_regs_spi;
 
 	return bcm63xx_regs_spi[reg];
-#else
-#if defined(CONFIG_BCM63XX_CPU_6338) || defined(CONFIG_BCM63XX_CPU_6348)
-	__GEN_SPI_RSET(6348)
-#endif
-#if defined(CONFIG_BCM63XX_CPU_6358) || defined(CONFIG_BCM63XX_CPU_6362) || \
-	defined(CONFIG_BCM63XX_CPU_6368)
-	__GEN_SPI_RSET(6358)
-#endif
-#endif
-	return 0;
 }
 
 #endif /* BCM63XX_DEV_SPI_H */
[2] = { + .used = 1, + .phy_id = 3, + .name = "Port 3", + }, + [3] = { + .used = 1, + .phy_id = 4, + .name = "Port 4", + }, + }, + }, + + .leds = { + /* front LEDs */ + { + .name = "F@ST2704V2:green:power", + .gpio = 4, + .active_low = 1, + .default_trigger = "default-on", + }, + { + .name = "F@ST2704V2:red:power", + .gpio = 5, + .active_low = 1, + }, + { + .name = "F@ST2704V2:red:inet", + .gpio = 2, + .active_low = 1, + }, + { + .name = "F@ST2704V2:green:dsl", + .gpio = 3, + .active_low = 1, + }, + { + .name = "F@ST2704V2:green:inet", + .gpio = 11, + .active_low = 1, + }, + { + .name = "F@ST2704V2:green:usb", + .gpio = 1, + .active_low = 1, + }, + + /* side button LEDs */ + { + .name = "F@ST2704V2:green:wps", + .gpio = 10, + .active_low = 1, + }, + + /* FIXME: can't control gpio0 line in "out" state, needs further investigation */ + /* + { + .name = "F@ST2704V2:green:rfkill", + .gpio = 0, + .active_low = 1, + }, + */ + + }, + .buttons = { + { + .desc = "reset", + .gpio = 23, + .active_low = 1, + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL, + }, + { + .desc = "wps", + .gpio = 24, + .active_low = 1, + .type = EV_KEY, + .code = KEY_WPS_BUTTON, + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL, + }, + { + .desc = "rfkill", + .gpio = 15, + .active_low = 1, + .type = EV_KEY, + .code = KEY_WLAN, + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL, + }, + }, +}; #endif /* CONFIG_BCM63XX_CPU_6328 */ /* @@ -3502,6 +3618,7 @@ static const struct board_info __initcon &board_963281TAN, &board_A4001N1, &board_dsl_274xb_f1, + &board_FAST2704V2, #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, @@ -3577,6 +3694,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, { .compatible = "d-link,dsl-274xb-f", .data = &board_dsl_274xb_f1, }, + { .compatible = "sagem,f@st2704v2", .data = &board_FAST2704V2, }, #endif #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, },