On Sun, 2012-07-22 at 12:59 +0200, Jonas Gorski wrote: > Hello Miguel, > Hello
> On 6 July 2012 14:19, Miguel GAIO <[email protected]> wrote: > > This is a second release for NB6 boards support. > > The first patch add support for 6362 CPU. It's based on 6328 works. > > It also includes RGMII clock enable. > > The second patch include support for NB6 boards. > > The NB6 has a RTL8367R switch connected to internal enetsw using rgmii > > bus. > > > > The third patch change rgmii setup on RTL8366R. > > I confirm that the realtek switch works with these patches. I did some > changes though. > > 1) I substituted your BCM6362 patches with my own (yours seem to be > based on an older broadcom SDK), since these are the ones I plan to > submit eventually to upstream. Greats > 2) I made the realtek patch a platform patch, because I do not know > the impact on other devices using this switch (which didn't need it). > 3) I added a network config for it > 4) I commented out the nb6 image build, since even with network > working you can't do much with it Hopefully, once your patches are submitted, I can help to get more working (namely wireless) > > I am more or less ready to commit this, but I am missing your > signed-off-by. Can you please either reply with it or resend the board > patch with it added? I created a branch on github with what I plan to > submit, so you can use that to check that I did not miss anything ( > https://github.com/KanjiMonster/openwrt/tree/neufbox6 ). > I have some additional questions though: > > How is one supposed to flash the NB6 without serial access? At least I > did not find anything in the web interface that allowed me to flash an > image, and the CFE does not provide a web interface either. > Without serial access, users have to use bootp method via SFR button. > What's the "tftpboot"? I noticed that if I have the "SFR" button > pressed when powering the device up, CFE prints "** tftpboot > requested", but then shortly after that CFE crashes. To use SFR button you have to: - setup DHCP server to provide board IP address - The DHCP answer needs tftp serveur and bootp image - Depending on nature of provided image, the cfe can boot vmlinux or burns new tagged image You can found a wiki at neufbox4.org (in french) which contains HOWTOs http://www.neufbox4.org/wiki/index.php?title=Flasher_une_NB6 > Lastly, you added an image build for "NB6-SER-r0", shouldn't you also > add one for "NB6-FXC-r0"? Or do they not care about the board id? > Board id is not care. Miguel > > Jonas > _______________________________________________ > openwrt-devel mailing list > [email protected] > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>From 9bf7925c23e4bc5982b0af74f980cf1ceb8be841 Mon Sep 17 00:00:00 2001 From: Miguel GAIO <[email protected]> Date: Fri, 6 Jul 2012 14:10:52 +0200 Subject: [PATCH 05/22] * [brcm63xx] Add nb6 support (BCM6362 SoC base boards) Signed-off-by: Miguel GAIO <[email protected]> --- target/linux/brcm63xx/config-3.3 | 2 + target/linux/brcm63xx/image/Makefile | 2 + .../linux/brcm63xx/patches-3.3/301-led_count.patch | 15 +- .../linux/brcm63xx/patches-3.3/554-board_nb6.patch | 146 ++++++++++++++++++++ .../801-ssb_export_fallback_sprom.patch | 4 +- 5 files changed, 163 insertions(+), 6 deletions(-) create mode 100644 target/linux/brcm63xx/patches-3.3/554-board_nb6.patch diff --git a/target/linux/brcm63xx/config-3.3 b/target/linux/brcm63xx/config-3.3 index fed43ff..f8cf486 100644 --- a/target/linux/brcm63xx/config-3.3 +++ b/target/linux/brcm63xx/config-3.3 @@ -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 diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile index 8066430..06c5d64 100644 --- a/target/linux/brcm63xx/image/Makefile +++ b/target/linux/brcm63xx/image/Makefile @@ -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 536, 5621 $(call Image/Build/CFEFIXUP,$(1),96348GW-11,CT536_CT5621,6348,CT536_CT5621) # Davolink DV201AMR diff --git a/target/linux/brcm63xx/patches-3.3/301-led_count.patch b/target/linux/brcm63xx/patches-3.3/301-led_count.patch index 84d57a0..b6c1196 100644 --- a/target/linux/brcm63xx/patches-3.3/301-led_count.patch +++ b/target/linux/brcm63xx/patches-3.3/301-led_count.patch @@ -8,19 +8,26 @@ if (board.has_uart0) bcm63xx_uart_register(0); -@@ -900,7 +901,11 @@ int __init board_register_devices(void) +@@ -900,10 +901,16 @@ int __init board_register_devices(void) bcm63xx_flash_register(); - bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds); +- bcm63xx_led_data.leds = board.leds; + /* count number of LEDs defined by this device */ + while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name) + led_count++; + -+ bcm63xx_led_data.num_leds = led_count; - bcm63xx_led_data.leds = board.leds; ++ if (led_count) { ++ bcm63xx_led_data.num_leds = led_count; ++ bcm63xx_led_data.leds = board.leds; - platform_device_register(&bcm63xx_gpio_leds); +- platform_device_register(&bcm63xx_gpio_leds); ++ platform_device_register(&bcm63xx_gpio_leds); ++ } + + /* count number of BUTTONs defined by this device */ + while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc) --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h @@ -57,7 +57,7 @@ struct board_info { diff --git a/target/linux/brcm63xx/patches-3.3/554-board_nb6.patch b/target/linux/brcm63xx/patches-3.3/554-board_nb6.patch new file mode 100644 index 0000000..dd4c27d --- /dev/null +++ b/target/linux/brcm63xx/patches-3.3/554-board_nb6.patch @@ -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 + + static struct board_info board; + +@@ -2428,6 +2431,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 + */ +@@ -2624,6 +2724,10 @@ static const struct board_info __initdat + &board_spw303v, + #endif + ++#ifdef CONFIG_BCM63XX_CPU_6362 ++ &board_nb6, ++#endif ++ + #ifdef CONFIG_BCM63XX_CPU_6368 + &board_96368mvwg, + &board_96368mvngr, +@@ -2698,6 +2802,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 */ diff --git a/target/linux/brcm63xx/patches-3.3/801-ssb_export_fallback_sprom.patch b/target/linux/brcm63xx/patches-3.3/801-ssb_export_fallback_sprom.patch index df3dc91..223a64c 100644 --- a/target/linux/brcm63xx/patches-3.3/801-ssb_export_fallback_sprom.patch +++ b/target/linux/brcm63xx/patches-3.3/801-ssb_export_fallback_sprom.patch @@ -8,7 +8,7 @@ #include <linux/spi/spi.h> #include <linux/spi/spi_gpio.h> #include <linux/spi/74x164.h> -@@ -2652,7 +2653,7 @@ static void __init nb4_nvram_fixup(void) +@@ -2756,7 +2757,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, -@@ -2672,6 +2673,7 @@ static struct ssb_sprom bcm63xx_sprom = +@@ -2776,6 +2777,7 @@ static struct ssb_sprom bcm63xx_sprom = .boardflags_lo = 0x2848, .boardflags_hi = 0x0000, }; -- 1.7.10.4
_______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
