bcm63xx: Add nb6 support (BCM6362 SoC base boards)
authorJonas Gorski <jogo@openwrt.org>
Tue, 31 Jul 2012 14:27:47 +0000 (14:27 +0000)
committerJonas Gorski <jogo@openwrt.org>
Tue, 31 Jul 2012 14:27:47 +0000 (14:27 +0000)
Signed-off-by: Miguel GAIO <miguel.gaio@efixo.com>
Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@gmail.com>
[jonas.gorski@gmail.com: add network config for nb6, make switch fix a
platform patch]

SVN-Revision: 32924

target/linux/brcm63xx/base-files/etc/uci-defaults/network
target/linux/brcm63xx/base-files/lib/brcm63xx.sh
target/linux/brcm63xx/config-3.3
target/linux/brcm63xx/image/Makefile
target/linux/brcm63xx/patches-3.3/528-board_nb6.patch [new file with mode: 0644]
target/linux/brcm63xx/patches-3.3/550-alice_gate2_leds.patch
target/linux/brcm63xx/patches-3.3/551-96348gw_a_leds.patch
target/linux/brcm63xx/patches-3.3/552-board_96348gw-10_reset_button.patch
target/linux/brcm63xx/patches-3.3/801-ssb_export_fallback_sprom.patch
target/linux/brcm63xx/patches-3.3/802-rtl8367r_fix_RGMII_support.patch [new file with mode: 0644]

index 10b6e5a1b6c28d17724e7b0e770a7895648ad696..53c29ac5a5c947db29be1bd6700ea4c24c21e9e9 100755 (executable)
@@ -23,6 +23,7 @@ AW4339U |\
 CPVA642 |\
 CT536_CT5621 |\
 D-4P-W |\
+NB6 |\
 SPW303V |\
 SPW500V |\
 V2110 |\
index 5fe0cdc06ebec00449fc923a6d180001eab557fd..11774770df4e3d152d80b312eabacea201034134 100755 (executable)
@@ -82,6 +82,10 @@ brcm63xx_detect() {
                brcm63xx_has_reset_button="true"
                ifname=eth0
                ;;
+       NB6)
+               brcm63xx_has_reset_button="true"
+               ifname=eth0
+               ;;
        *)
                ;;
        esac
index c8adb6870dd308a650e982ba047f5b2d0d1731f3..f8cf4869c21d7932161325b36c265670b7aec3ce 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_BCM63XX_CPU_6338=y
 CONFIG_BCM63XX_CPU_6345=y
 CONFIG_BCM63XX_CPU_6348=y
 CONFIG_BCM63XX_CPU_6358=y
-# CONFIG_BCM63XX_CPU_6362 is not set
+CONFIG_BCM63XX_CPU_6362=y
 CONFIG_BCM63XX_CPU_6368=y
 CONFIG_BCM63XX_ENET=y
 CONFIG_BCM63XX_PHY=y
@@ -120,6 +120,8 @@ CONFIG_PCIEPORTBUS=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PERF_USE_VMALLOC=y
 CONFIG_PHYLIB=y
+CONFIG_RTL8366_SMI=y
+CONFIG_RTL8367_PHY=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_POSIX_MQUEUE_SYSCTL=y
 # CONFIG_PREEMPT_RCU is not set
index 06d5a82f8f0611e89de901c424b3483e348cda9a..af5a68c82e730f9f6841c2f64e9587ef4ee21c61 100644 (file)
@@ -191,6 +191,8 @@ define Image/Build
        $(call Image/Build/CFEFIXUP,$(1),96348GW,GW6200,6348,GW6200,$(shell printf '\x99'))
        # Neufbox4
        $(call Image/Build/CFE,$(1),96358VW,6358,NEUFBOX4,OpenWRT-$(REVISION))
+       # Neufbox6
+       $(call Image/Build/CFE,$(1),NB6-SER-r0,6362,NEUFBOX6,OpenWRT-$(REVISION))
        # Comtrend 6373
        $(call Image/Build/CFE,$(1),CT6373-1,6358,CT6373)
        # Comtrend 536, 5621
diff --git a/target/linux/brcm63xx/patches-3.3/528-board_nb6.patch b/target/linux/brcm63xx/patches-3.3/528-board_nb6.patch
new file mode 100644 (file)
index 0000000..f178efd
--- /dev/null
@@ -0,0 +1,146 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -17,6 +17,7 @@
+ #include <linux/spi/spi.h>
+ #include <linux/spi/spi_gpio.h>
+ #include <linux/spi/74x164.h>
++#include <linux/rtl8367.h>
+ #include <asm/addrspace.h>
+ #include <bcm63xx_board.h>
+ #include <bcm63xx_cpu.h>
+@@ -50,6 +51,8 @@
+ #define NB4_SPI_GPIO_MOSI     7
+ #define NB4_SPI_GPIO_CLK      6
+ #define NB4_74HC64_GPIO(X)    (NB4_74X164_GPIO_BASE + (X))
++#define NB6_GPIO_RTL8367_SDA  18
++#define NB6_GPIO_RTL8367_SCK  20
+ #define CT6373_PID_OFFSET             0xff80
+ #define CT6373_74X164_GPIO_BASE       64
+@@ -2489,6 +2492,103 @@ static struct board_info __initdata boar
+ };
+ #endif
++#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,
++
++      .has_uart0                      = 1,
++
++      .has_ohci0                      = 1,
++      .has_ehci0                      = 1,
++
++      .has_enetsw                     = 1,
++
++      .enetsw = {
++              .used_ports = {
++                      [4] = {
++                              .used   = 1,
++                              .phy_id = 0xff,
++                              .bypass_link = 1,
++                              .force_speed = 1000,
++                              .force_duplex_full = 1,
++                              .name   = "RGMII",
++                      },
++              },
++      },
++
++      .buttons = {
++              {
++                      .desc           = "reset",
++                      .gpio           = 24,
++                      .type           = EV_KEY,
++                      .code           = KEY_RESTART,
++                      .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
++                      .active_low     = 1,
++              },
++              {
++                      .desc           = "wps",
++                      .gpio           = 25,
++                      .type           = EV_KEY,
++                      .code           = KEY_WPS_BUTTON,
++                      .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
++                      .active_low     = 1,
++              },
++              {
++                      .desc           = "wlan",
++                      .gpio           = 12,
++                      .type           = EV_KEY,
++                      .code           = KEY_WLAN,
++                      .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
++                      .active_low     = 1,
++              },
++              {
++                      .desc           = "service",
++                      .gpio           = 10,
++                      .type           = EV_KEY,
++                      .code           = BTN_0,
++                      .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
++                      .active_low     = 1,
++              },
++      },
++
++      .devs = nb6_devices,
++      .num_devs = ARRAY_SIZE(nb6_devices),
++};
++#endif
++
+ /*
+  * known 6368 boards
+  */
+@@ -2685,6 +2785,10 @@ static const struct board_info __initdat
+       &board_DVAG3810BN,
+ #endif
++#ifdef CONFIG_BCM63XX_CPU_6362
++      &board_nb6,
++#endif
++
+ #ifdef CONFIG_BCM63XX_CPU_6368
+       &board_96368mvwg,
+       &board_96368mvngr,
+@@ -2759,6 +2863,11 @@ static void __init boardid_fixup(u8 *boo
+       struct bcm_tag *tag = (struct bcm_tag *)(boot_addr + CFE_OFFSET_64K);
+       char *board_name = (char *)bcm63xx_nvram_get_name();
++      if (BCMCPU_IS_6362() && (!strncmp(board_name, "NB6-", sizeof("NB6-") - 1))) {
++              board_name[sizeof("NB6") - 1] = '\0';
++              return ;
++      }
++
+       /* check if bcm_tag is at 64k offset */
+       if (strncmp(board_name, tag->boardid, BOARDID_LEN) != 0) {
+               /* else try 128k */
index ebf6f65421e15b186bff019bade260a71bb29faf..c25aafd8d701131184ceadf09c5fc686b49d881b 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -1609,6 +1609,98 @@ static struct board_info __initdata boar
+@@ -1612,6 +1612,98 @@ static struct board_info __initdata boar
  
        .has_ohci0 = 1,
        .has_ehci0 = 1,
index 02938c3eef73dc1a7235332eea7fc3614c566970..816e8164c71fa7ba070ee3e923597513d5772c6b 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -1066,6 +1066,19 @@ static struct board_info __initdata boar
+@@ -1069,6 +1069,19 @@ static struct board_info __initdata boar
        },
  
        .has_ohci0 = 1,
index 0a464c8d5bb124f84a6385bd7eeeca7ad63e14ea..3c0fe8b9dc1adde87dd5312b4a39cb222d04ffbd 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -583,6 +583,17 @@ static struct board_info __initdata boar
+@@ -586,6 +586,17 @@ static struct board_info __initdata boar
                        .active_low     = 1,
                },
        },
index 3802cfce551c48a538766e6b482238b3204690ad..ca6e5aa28930ab7c9a8f8af83b747ec65a3b2ae5 100644 (file)
@@ -8,7 +8,7 @@
  #include <linux/spi/spi.h>
  #include <linux/spi/spi_gpio.h>
  #include <linux/spi/74x164.h>
-@@ -2829,7 +2830,7 @@ static void __init nb4_nvram_fixup(void)
+@@ -2933,7 +2934,7 @@ static void __init nb4_nvram_fixup(void)
   * bcm4318 WLAN work
   */
  #ifdef CONFIG_SSB_PCIHOST
@@ -17,7 +17,7 @@
        .revision               = 0x02,
        .board_rev              = 0x17,
        .country_code           = 0x0,
-@@ -2849,6 +2850,7 @@ static struct ssb_sprom bcm63xx_sprom =
+@@ -2953,6 +2954,7 @@ static struct ssb_sprom bcm63xx_sprom =
        .boardflags_lo          = 0x2848,
        .boardflags_hi          = 0x0000,
  };
diff --git a/target/linux/brcm63xx/patches-3.3/802-rtl8367r_fix_RGMII_support.patch b/target/linux/brcm63xx/patches-3.3/802-rtl8367r_fix_RGMII_support.patch
new file mode 100644 (file)
index 0000000..285f3f7
--- /dev/null
@@ -0,0 +1,30 @@
+From e3208e6087642b95a5bab3101fc9c6e34892c861 Mon Sep 17 00:00:00 2001
+From: Miguel GAIO <miguel.gaio@efixo.com>
+Date: Fri, 6 Jul 2012 14:12:33 +0200
+Subject: [PATCH 6/8] * [rtl8367r] Fix RGMII support
+
+---
+ drivers/net/phy/rtl8367.c  |    5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+--- a/drivers/net/phy/rtl8367.c
++++ b/drivers/net/phy/rtl8367.c
+@@ -144,6 +144,10 @@
+ #define   RTL8367_EXT_RGMXF_TXDELAY_MASK      1
+ #define   RTL8367_EXT_RGMXF_RXDELAY_MASK      0x7
++#define RTL8367_PHY_AD_REG                    0x130f
++#define    RTL8370_PHY_AD_DUMMY_1_OFFSET      5
++#define    RTL8370_PHY_AD_DUMMY_1_MASK                0xe0
++
+ #define RTL8367_DI_FORCE_REG(_x)              (0x1310 + (_x))
+ #define   RTL8367_DI_FORCE_MODE                       BIT(12)
+ #define   RTL8367_DI_FORCE_NWAY                       BIT(7)
+@@ -892,6 +896,7 @@ static int rtl8367_extif_set_mode(struct
+       case RTL8367_EXTIF_MODE_RGMII_33V:
+               REG_WR(smi, RTL8367_CHIP_DEBUG0_REG, 0x0367);
+               REG_WR(smi, RTL8367_CHIP_DEBUG1_REG, 0x7777);
++              REG_RMW(smi, RTL8367_PHY_AD_REG, BIT(5), 0);
+               break;
+       case RTL8367_EXTIF_MODE_TMII_MAC: