diff --git a/target/linux/brcm63xx/dts/tg582n.dts b/target/linux/brcm63xx/dts/tg582n.dts new file mode 100644 index 0000000..4d40542 --- /dev/null +++ b/target/linux/brcm63xx/dts/tg582n.dts @@ -0,0 +1,87 @@ +/dts-v1/; + +/include/ "bcm6328.dtsi" + +/ { + model = "TG582N"; + compatible = "thomson,tg582n", "brcm,bcm6328"; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + debounce-interval = <60>; + + reset { + label = "reset"; + gpios = <&gpio0 23 1>; + linux,code = <0x198>; + }; + wps { + label = "wlan"; + gpios = <&gpio0 24 1>; + linux,code = <0xee>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + internet_green { + label = "TG582N:green:internet"; + gpios = <&gpio0 1 1>; + }; + broadband_green { + label = "TG582N:green:broadband"; + gpios = <&gpio0 11 1>; + }; + ethernet_green { + label = "TG582N:green:ethernet"; + gpios = <&gpio0 5 1>; + }; + power_green { + label = "TG582N:green:power"; + gpios = <&gpio0 4 1>; + default-state = "on"; + }; + wifi_green { + label = "TG582N:green:wifi"; + gpios = <&gpio0 3 1>; + }; + wps_green { + label = "TG582N:green:wps"; + gpios = <&gpio0 9 1>; + }; + power_red { + label = "TG582N:red:power"; + gpios = <&gpio0 8 1>; + }; + internet_red { + label = "TG582N:red:internet"; + gpios = <&gpio0 7 1>; + }; + wifi_red { + label = "TG582N:red:wifi"; + gpios = <&gpio0 2 1>; + }; + wps_red { + label = "TG582N:red:wps"; + gpios = <&gpio0 10 1>; + }; +/* + usb_green { + label = "TG582N:green:3g"; + gpios = <&gpio0 6 1>; + }; + eth_red { + label = "TG582N:red:eth"; + gpios = <&gpio0 20 1>; + }; + eth_green { + label = "TG582N:green:eth"; + gpios = <&gpio0 31 1>; + }; +*/ + }; +}; diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile index 14e53e1..0c2c70e 100644 --- a/target/linux/brcm63xx/image/Makefile +++ b/target/linux/brcm63xx/image/Makefile @@ -629,7 +629,7 @@ $(eval $(call bcm63xxCfeRamdisk,MAGIC,MAGIC,magic,MAGIC,6348)) # TP-Link TD-W8900GB $(eval $(call bcm63xxCfe,TDW8900GB,TD-W8900GB,td-w8900gb,96348GW-11,6348,--rsa-signature "$(shell printf 'PRID\x89\x10\x00\x02')" --image-offset 0x20000)) # Thomsom TG582n -$(eval $(call ImageDTB,CFEDTB,TG582N,TG582N,tg582n,963281T_TEF,6328,--pad 8)) +$(eval $(call bcm63xxCfe,TG582N,TG582N,tg582n,963281T_TEF,6328,--pad 8)) # USRobotics 9108 $(eval $(call bcm63xxCfe,USR9108,USR9108,usr9108,96348GW-A,6348)) # ZyXEL P870HW-51a v2 diff --git a/target/linux/brcm63xx/patches-3.18/571-board_TG582N.patch b/target/linux/brcm63xx/patches-3.18/571-board_TG582N.patch new file mode 100644 index 0000000..005f858 --- /dev/null +++ b/target/linux/brcm63xx/patches-3.18/571-board_TG582N.patch @@ -0,0 +1,70 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -606,6 +606,51 @@ static struct board_info __initdata board_FAST2704V2 = { + }, + }, + }; ++ ++static struct board_info __initdata board_TG582N = { ++ .name = "TG582N", ++ .expected_cpu_id = 0x6328, ++ ++ .has_uart0 = 1, ++ .has_pci = 1, ++ .use_fallback_sprom = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ .has_enetsw = 1, ++ ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .fallback_sprom = { ++ .type = SPROM_BCM43227, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, ++}; ++ + #endif /* CONFIG_BCM63XX_CPU_6328 */ + + /* +@@ -2362,6 +2407,7 @@ static const struct board_info __initconst *bcm963xx_boards[] = { + &board_A4001N1, + &board_dsl_274xb_f1, + &board_FAST2704V2, ++ &board_TG582N + #endif + #ifdef CONFIG_BCM63XX_CPU_6338 + &board_96338gw, +@@ -2458,6 +2504,7 @@ static struct of_device_id const bcm963xx_boards_dt[] = { + { .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 = "thomson,tg582n", .data = &board_TG582N, }, + { .compatible = "sagem,f@st2704v2", .data = &board_FAST2704V2, }, + #endif + #ifdef CONFIG_BCM63XX_CPU_6338 diff --git a/target/linux/brcm63xx/patches-4.1/999-support-tg582n.patch b/target/linux/brcm63xx/patches-4.1/999-support-tg582n.patch new file mode 100644 index 0000000..77d94ac --- /dev/null +++ b/target/linux/brcm63xx/patches-4.1/999-support-tg582n.patch @@ -0,0 +1,64 @@ +Index: linux-4.1.11/arch/mips/bcm63xx/boards/board_bcm963xx.c +=================================================================== +--- linux-4.1.11.orig/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ linux-4.1.11/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -559,6 +559,51 @@ static struct board_info __initdata boar + }, + }; + ++ ++static struct board_info __initdata board_TG582N = { ++ .name = "TG582N", ++ .expected_cpu_id = 0x6328, ++ ++ .has_uart0 = 1, ++ .has_pci = 1, ++ .use_fallback_sprom = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ .has_enetsw = 1, ++ ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .fallback_sprom = { ++ .type = SPROM_BCM43227, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, ++}; ++ + static struct board_info __initdata board_dsl_274xb_f1 = { + .name = "AW4339U", + .expected_cpu_id = 0x6328, +@@ -2450,6 +2495,7 @@ static const struct board_info __initcon + &board_963281TAN, + &board_A4001N, + &board_A4001N1, ++ &board_TG582N, + &board_dsl_274xb_f1, + &board_FAST2704V2, + #endif diff --git a/target/linux/brcm63xx/profiles/thomson.mk b/target/linux/brcm63xx/profiles/thomson.mk index 04eca76..0dbeb86 100644 --- a/target/linux/brcm63xx/profiles/thomson.mk +++ b/target/linux/brcm63xx/profiles/thomson.mk @@ -3,7 +3,7 @@ define Profile/TG582N PACKAGES:=kmod-b43 wpad-mini \ kmod-usb2 kmod-usb-ohci endef -define Profile/A4001N1/Description +define Profile/TG582N/Description Package set optimized for TG582N. endef $(eval $(call Profile,TG582N)) diff --git a/target/linux/generic/patches-4.1/999-mtd-spi-nor-add-support-for-the-EON-EN25Q128.patch b/target/linux/generic/patches-4.1/999-mtd-spi-nor-add-support-for-the-EON-EN25Q128.patch new file mode 100644 index 0000000..7bb550d --- /dev/null +++ b/target/linux/generic/patches-4.1/999-mtd-spi-nor-add-support-for-the-EON-EN25Q128.patch @@ -0,0 +1,12 @@ +diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c +index c51ee52..09a1a12 100644 +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -497,6 +497,7 @@ static const struct spi_device_id spi_nor_ids[] = { + { "en25q32b", INFO(0x1c3016, 0, 64 * 1024, 64, 0) }, + { "en25p64", INFO(0x1c2017, 0, 64 * 1024, 128, 0) }, + { "en25q64", INFO(0x1c3017, 0, 64 * 1024, 128, SECT_4K) }, ++ { "en25q128", INFO(0x1c3018, 0, 64 * 1024, 256, 0) }, + { "en25qh128", INFO(0x1c7018, 0, 64 * 1024, 256, 0) }, + { "en25qh256", INFO(0x1c7019, 0, 64 * 1024, 512, 0) }, +