Skip to content

Commit

Permalink
brcm63xx: Neufbox 6: fix switch by probing through DT
Browse files Browse the repository at this point in the history
Probe the switch through DT instead of a platform device. This fixes
probe, as GPIO offsets are now properly accounted for.

Fixes the following issue:

[    0.802953] 8021q: 802.1Q VLAN Support v1.8
[    0.810518] rtl8366_smi: gpio_request failed for 18, err=-517

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
  • Loading branch information
KanjiMonster committed Feb 9, 2017
1 parent 8b741d5 commit 0127c48
Show file tree
Hide file tree
Showing 44 changed files with 136 additions and 208 deletions.
8 changes: 8 additions & 0 deletions target/linux/brcm63xx/dts/nb6-ser-r0.dts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,12 @@
linux,code = <KEY_WPS_BUTTON>;
};
};

switch {
compatible = "realtek,rtl8367";
gpio-sda = <&gpio0 18 0>;
gpio-sck = <&gpio0 20 0>;

realtek,extif0 = <1 5 1 1 1 1 1 1 2>;
};
};

This file was deleted.

14 changes: 7 additions & 7 deletions target/linux/brcm63xx/patches-4.4/303-spi-board-info.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <asm/addrspace.h>
#include <bcm63xx_board.h>
#include <bcm63xx_cpu.h>
@@ -210,6 +211,9 @@ int __init board_register_devices(void)
if (board.num_devs)
platform_add_devices(board.devs, board.num_devs);
@@ -207,6 +208,9 @@ int __init board_register_devices(void)

bcm63xx_hsspi_register();

+ if (board.num_spis)
+ spi_register_board_info(board.spis, board.num_spis);
Expand All @@ -20,10 +20,10 @@
bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds);
--- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
+++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
@@ -57,6 +57,10 @@ struct board_info {
/* Additional platform devices */
struct platform_device **devs;
unsigned int num_devs;
@@ -53,6 +53,10 @@ struct board_info {

/* External PHY reset GPIO flags from gpio.h */
unsigned long ephy_reset_gpio_flags;
+
+ /* Additional platform devices */
+ struct spi_board_info *spis;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
+ struct fallback_sprom_data fallback_sprom;
+
/* Additional platform devices */
struct platform_device **devs;
unsigned int num_devs;
struct spi_board_info *spis;
unsigned int num_spis;
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
if (strncmp(board_name, bcm963xx_boards[i]->name, 16))
--- a/arch/mips/bcm63xx/boards/board_common.c
+++ b/arch/mips/bcm63xx/boards/board_common.c
@@ -250,3 +250,21 @@ int __init board_register_devices(void)
@@ -247,3 +247,21 @@ int __init board_register_devices(void)

return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>

--- a/arch/mips/bcm63xx/boards/board_common.c
+++ b/arch/mips/bcm63xx/boards/board_common.c
@@ -258,9 +258,10 @@ int __init board_register_devices(void)
@@ -255,9 +255,10 @@ int __init board_register_devices(void)

platform_device_register(&bcm63xx_gpio_leds);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data

#if CONFIG_OF
if (of_have_populated_dt()) {
@@ -274,6 +276,10 @@ int __init board_register_devices(void)
@@ -271,6 +273,10 @@ int __init board_register_devices(void)
board.ephy_reset_gpio_flags);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Subject: [PATCH 69/80] MIPS: BCM63XX: pass caldata info to flash

--- a/arch/mips/bcm63xx/boards/board_common.c
+++ b/arch/mips/bcm63xx/boards/board_common.c
@@ -264,7 +264,7 @@ int __init board_register_devices(void)
@@ -261,7 +261,7 @@ int __init board_register_devices(void)
if (board.num_spis)
spi_register_board_info(board.spis, board.num_spis);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
return;
--- a/arch/mips/bcm63xx/boards/board_common.c
+++ b/arch/mips/bcm63xx/boards/board_common.c
@@ -278,7 +278,8 @@ int __init board_register_devices(void)
@@ -275,7 +275,8 @@ int __init board_register_devices(void)

/* register any fixups */
for (i = 0; i < board.has_caldata; i++)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/arch/mips/bcm63xx/boards/board_common.c
+++ b/arch/mips/bcm63xx/boards/board_common.c
@@ -279,7 +279,7 @@ int __init board_register_devices(void)
@@ -276,7 +276,7 @@ int __init board_register_devices(void)
/* register any fixups */
for (i = 0; i < board.has_caldata; i++)
pci_enable_ath9k_fixup(board.caldata[i].slot, board.caldata[i].caldata_offset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices

#include "board_common.h"

@@ -277,9 +278,19 @@ int __init board_register_devices(void)
@@ -274,9 +275,19 @@ int __init board_register_devices(void)
}

/* register any fixups */
Expand Down
60 changes: 3 additions & 57 deletions target/linux/brcm63xx/patches-4.4/528-board_nb6.patch
Original file line number Diff line number Diff line change
@@ -1,61 +1,10 @@
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -12,6 +12,8 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/string.h>
+#include <linux/platform_device.h>
+#include <linux/rtl8367.h>
#include <asm/addrspace.h>
#include <bcm63xx_board.h>
#include <bcm63xx_cpu.h>
@@ -27,6 +29,9 @@

#define HCS_OFFSET_128K 0x20000

+#define NB6_GPIO_RTL8367_SDA 18
+#define NB6_GPIO_RTL8367_SCK 20
+
/*
* known 3368 boards
*/
@@ -1315,6 +1320,69 @@ static struct board_info __initdata boar
@@ -1315,6 +1315,34 @@ static struct board_info __initdata boar
};
#endif /* CONFIG_BCM63XX_CPU_6358 */

+#ifdef CONFIG_BCM63XX_CPU_6362
+static struct rtl8367_extif_config nb6_rtl8367_extif0_cfg = {
+ .mode = RTL8367_EXTIF_MODE_RGMII,
+ .txdelay = 1,
+ .rxdelay = 5,
+ .ability = {
+ .force_mode = 1,
+ .txpause = 1,
+ .rxpause = 1,
+ .link = 1,
+ .duplex = 1,
+ .speed = RTL8367_PORT_SPEED_1000,
+ },
+};
+
+static struct rtl8367_platform_data nb6_rtl8367_data = {
+ .gpio_sda = NB6_GPIO_RTL8367_SDA,
+ .gpio_sck = NB6_GPIO_RTL8367_SCK,
+ .extif0_cfg = &nb6_rtl8367_extif0_cfg,
+};
+
+static struct platform_device nb6_rtl8367_device = {
+ .name = RTL8367_DRIVER_NAME,
+ .id = -1,
+ .dev = {
+ .platform_data = &nb6_rtl8367_data,
+ }
+};
+
+static struct platform_device * __initdata nb6_devices[] = {
+ &nb6_rtl8367_device,
+};
+
+static struct board_info __initdata board_nb6 = {
+ .name = "NB6",
+ .expected_cpu_id = 0x6362,
Expand All @@ -80,16 +29,13 @@
+ },
+ },
+ },
+
+ .devs = nb6_devices,
+ .num_devs = ARRAY_SIZE(nb6_devices),
+};
+#endif /* CONFIG_BCM63XX_CPU_6362 */
+
/*
* known 6368 boards
*/
@@ -1466,6 +1534,10 @@ static const struct board_info __initcon
@@ -1466,6 +1494,10 @@ static const struct board_info __initcon
&board_DVAG3810BN,
#endif

Expand All @@ -100,7 +46,7 @@
#ifdef CONFIG_BCM63XX_CPU_6368
&board_96368mvwg,
&board_96368mvngr,
@@ -1534,6 +1606,9 @@ static struct of_device_id const bcm963x
@@ -1534,6 +1566,9 @@ static struct of_device_id const bcm963x
{ .compatible = "t-com,spw303v", .data = &board_spw303v, },
{ .compatible = "telsey,cpva642", .data = &board_CPVA642, },
#endif
Expand Down
6 changes: 3 additions & 3 deletions target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -765,6 +765,23 @@ static struct board_info __initdata boar
@@ -760,6 +760,23 @@ static struct board_info __initdata boar
.has_ehci0 = 1,
};

Expand All @@ -24,15 +24,15 @@
static struct board_info __initdata board_rta1025w_16 = {
.name = "RTA1025W_16",
.expected_cpu_id = 0x6348,
@@ -1505,6 +1522,7 @@ static const struct board_info __initcon
@@ -1465,6 +1482,7 @@ static const struct board_info __initcon
&board_96348gw_10,
&board_96348gw_11,
&board_FAST2404,
+ &board_FAST2604,
&board_DV201AMR,
&board_96348gw_a,
&board_rta1025w_16,
@@ -1580,6 +1598,7 @@ static struct of_device_id const bcm963x
@@ -1540,6 +1558,7 @@ static struct of_device_id const bcm963x
{ .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, },
{ .compatible = "netgear,dg834g-v4", .data = &board_96348W3, },
{ .compatible = "sagem,f@st2404", .data = &board_FAST2404, },
Expand Down
6 changes: 3 additions & 3 deletions target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -174,6 +174,50 @@ static struct board_info __initdata boar
@@ -169,6 +169,50 @@ static struct board_info __initdata boar
},
};

Expand Down Expand Up @@ -51,15 +51,15 @@
static struct board_info __initdata board_dsl_274xb_f1 = {
.name = "AW4339U",
.expected_cpu_id = 0x6328,
@@ -1503,6 +1547,7 @@ static const struct board_info __initcon
@@ -1463,6 +1507,7 @@ static const struct board_info __initcon
#ifdef CONFIG_BCM63XX_CPU_6328
&board_96328avng,
&board_963281TAN,
+ &board_A4001N1,
&board_dsl_274xb_f1,
#endif
#ifdef CONFIG_BCM63XX_CPU_6338
@@ -1568,6 +1613,7 @@ static struct of_device_id const bcm963x
@@ -1528,6 +1573,7 @@ static struct of_device_id const bcm963x
{ .compatible = "netgear,cvg834g", .data = &board_cvg834g, },
#endif
#ifdef CONFIG_BCM63XX_CPU_6328
Expand Down
6 changes: 3 additions & 3 deletions target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -139,6 +139,79 @@ static struct board_info __initdata boar
@@ -134,6 +134,79 @@ static struct board_info __initdata boar
},
};

Expand Down Expand Up @@ -80,15 +80,15 @@
static struct board_info __initdata board_963281TAN = {
.name = "963281TAN",
.expected_cpu_id = 0x6328,
@@ -1546,6 +1619,7 @@ static const struct board_info __initcon
@@ -1506,6 +1579,7 @@ static const struct board_info __initcon
#endif
#ifdef CONFIG_BCM63XX_CPU_6328
&board_96328avng,
+ &board_AR5387un,
&board_963281TAN,
&board_A4001N1,
&board_dsl_274xb_f1,
@@ -1616,6 +1690,7 @@ static struct of_device_id const bcm963x
@@ -1576,6 +1650,7 @@ static struct of_device_id const bcm963x
{ .compatible = "adb,a4001n1", .data = &board_A4001N1, },
{ .compatible = "brcm,bcm963281TAN", .data = &board_963281TAN, },
{ .compatible = "brcm,bcm96328avng", .data = &board_96328avng, },
Expand Down
6 changes: 3 additions & 3 deletions target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -139,6 +139,61 @@ static struct board_info __initdata boar
@@ -134,6 +134,61 @@ static struct board_info __initdata boar
},
};

Expand Down Expand Up @@ -62,15 +62,15 @@
static struct sprom_fixup __initdata ar5387un_fixups[] = {
{ .offset = 2, .value = 0x05bb },
{ .offset = 65, .value = 0x1204 },
@@ -1619,6 +1674,7 @@ static const struct board_info __initcon
@@ -1579,6 +1634,7 @@ static const struct board_info __initcon
#endif
#ifdef CONFIG_BCM63XX_CPU_6328
&board_96328avng,
+ &board_AR5381u,
&board_AR5387un,
&board_963281TAN,
&board_A4001N1,
@@ -1690,6 +1746,7 @@ static struct of_device_id const bcm963x
@@ -1650,6 +1706,7 @@ static struct of_device_id const bcm963x
{ .compatible = "adb,a4001n1", .data = &board_A4001N1, },
{ .compatible = "brcm,bcm963281TAN", .data = &board_963281TAN, },
{ .compatible = "brcm,bcm96328avng", .data = &board_96328avng, },
Expand Down
6 changes: 3 additions & 3 deletions target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -525,6 +525,22 @@ static struct board_info __initdata boar
@@ -520,6 +520,22 @@ static struct board_info __initdata boar

.has_uart0 = 1,
};
Expand All @@ -23,15 +23,15 @@
#endif /* CONFIG_BCM63XX_CPU_6345 */

/*
@@ -1688,6 +1704,7 @@ static const struct board_info __initcon
@@ -1648,6 +1664,7 @@ static const struct board_info __initcon
#endif
#ifdef CONFIG_BCM63XX_CPU_6345
&board_96345gw2,
+ &board_rta770bw,
#endif
#ifdef CONFIG_BCM63XX_CPU_6348
&board_96348r,
@@ -1758,6 +1775,7 @@ static struct of_device_id const bcm963x
@@ -1718,6 +1735,7 @@ static struct of_device_id const bcm963x
#endif
#ifdef CONFIG_BCM63XX_CPU_6345
{ .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, },
Expand Down
10 changes: 5 additions & 5 deletions target/linux/brcm63xx/patches-4.4/534-board_hw556.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#include <linux/kernel.h>
#include <linux/string.h>
+#include <linux/pci_ids.h>
#include <linux/platform_device.h>
#include <linux/rtl8367.h>
#include <asm/addrspace.h>
@@ -1479,6 +1480,95 @@ static struct board_info __initdata boar
#include <bcm63xx_board.h>
#include <bcm63xx_cpu.h>
@@ -1474,6 +1475,95 @@ static struct board_info __initdata boar
},
};

Expand Down Expand Up @@ -104,7 +104,7 @@
/* T-Home Speedport W 303V Typ B */
static struct board_info __initdata board_spw303v = {
.name = "96358-502V",
@@ -1740,6 +1830,9 @@ static const struct board_info __initcon
@@ -1700,6 +1790,9 @@ static const struct board_info __initcon
&board_nb4_fxc_r1,
&board_ct6373_1,
&board_HW553,
Expand All @@ -114,7 +114,7 @@
&board_spw303v,
&board_DVAG3810BN,
#endif
@@ -1812,6 +1905,9 @@ static struct of_device_id const bcm963x
@@ -1772,6 +1865,9 @@ static struct of_device_id const bcm963x
{ .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, },
{ .compatible = "d-link,dva-g3810bn/tl", .data = &board_DVAG3810BN, },
{ .compatible = "huawei,hg553", .data = &board_HW553, },
Expand Down
Loading

0 comments on commit 0127c48

Please sign in to comment.