Advertisement
juanjosepablos

add-p870hnu-openwrt-trunk-001

May 5th, 2020
1,419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.33 KB | None | 0 0
  1. diff --git a/target/linux/bcm63xx/base-files/etc/board.d/02_network b/target/linux/bcm63xx/base-files/etc/board.d/02_network
  2. index 7fa1514..78ef0a2 100755
  3. --- a/target/linux/bcm63xx/base-files/etc/board.d/02_network
  4. +++ b/target/linux/bcm63xx/base-files/etc/board.d/02_network
  5. @@ -35,6 +35,7 @@ huawei,echolife-hg655b|\
  6.  nucom,r5010un-v2|\
  7.  sagem,fast-2504n|\
  8.  sagem,fast-2704-v2|\
  9. +zyxel,p870hnu-51b|\
  10.  zyxel,p870hw-51a-v2)
  11.     ucidef_add_switch "switch0" \
  12.         "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "8t@eth0"
  13. diff --git a/target/linux/bcm63xx/base-files/etc/diag.sh b/target/linux/bcm63xx/base-files/etc/diag.sh
  14. index 4b6d8d6..89c05ba 100644
  15. --- a/target/linux/bcm63xx/base-files/etc/diag.sh
  16. +++ b/target/linux/bcm63xx/base-files/etc/diag.sh
  17. @@ -141,6 +141,9 @@ set_state() {
  18.     telsey,cpva642)
  19.         status_led="CPVA642:green:power:"
  20.         ;;
  21. +   zyxel,p870hnu-51b)
  22. +       status_led="P870HNU-51b:green:power"
  23. +       ;;
  24.     zyxel,p870hw-51a-v2)
  25.         status_led="P870HW-51a:green:power"
  26.         ;;
  27. diff --git a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc
  28. index c33e56f..b310ad9 100644
  29. --- a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc
  30. +++ b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc
  31. @@ -37,6 +37,7 @@ case "$(board_name)" in
  32.     telsey,cpva502plus|\
  33.     telsey,cpva642|\
  34.     telsey,magic|\
  35. +   zyxel,p870hnu-51b|\
  36.     zyxel,p870hw-51a-v2)
  37.         do_fixcrc
  38.         ;;
  39. diff --git a/target/linux/bcm63xx/dts/bcm6368-zyxel-p870hnu-51b.dts b/target/linux/bcm63xx/dts/bcm6368-zyxel-p870hnu-51b.dts
  40. new file mode 100644
  41. index 0000000..de1e1c2
  42. --- /dev/null
  43. +++ b/target/linux/bcm63xx/dts/bcm6368-zyxel-p870hnu-51b.dts
  44. @@ -0,0 +1,99 @@
  45. +/dts-v1/;
  46. +
  47. +#include "bcm6368.dtsi"
  48. +
  49. +#include <dt-bindings/input/input.h>
  50. +
  51. +/ {
  52. +   model = "Zyxel P870HNU-51b";
  53. +   compatible = "zyxel,p870hnu-51b", "brcm,bcm6368";
  54. +
  55. +   chosen {
  56. +       bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200";
  57. +       stdout-path = "serial0:115200n8";
  58. +   };
  59. +
  60. +   keys {
  61. +       compatible = "gpio-keys-polled";
  62. +       #address-cells = <1>;
  63. +       #size-cells = <0>;
  64. +       poll-interval = <20>;
  65. +
  66. +       reset {
  67. +           label = "reset";
  68. +           gpios = <&pinctrl 34 1>;
  69. +           linux,code = <KEY_RESTART>;
  70. +           debounce-interval = <60>;
  71. +       };
  72. +
  73. +       wps {
  74. +           label = "wlan";
  75. +           gpios = <&pinctrl 35 1>;
  76. +           linux,code = <KEY_WLAN>;
  77. +           debounce-interval = <60>;
  78. +       };
  79. +   };
  80. +
  81. +   leds {
  82. +       compatible = "gpio-leds";
  83. +
  84. +       power_green {
  85. +           label = "P870HNU-51b:green:power";
  86. +           gpios = <&pinctrl 2 1>;
  87. +           default-state = "on";
  88. +       };
  89. +       dsl_green {
  90. +           label = "P870HNU-51b:green:dsl";
  91. +           gpios = <&pinctrl 23 1>;
  92. +       };
  93. +       inet_green {
  94. +           label = "P870HNU-51b:green:inet";
  95. +           gpios = <&pinctrl 5 1>;
  96. +       };
  97. +       wps_orange {
  98. +           label = "P870HNU-51b:orange:wps";
  99. +           gpios = <&pinctrl 24 1>;
  100. +       };
  101. +       inet_red {
  102. +           label = "P870HNU-51b:red:inet";
  103. +           gpios = <&pinctrl 33 0>;
  104. +       };
  105. +   };
  106. +};
  107. +
  108. +&pflash {
  109. +   status = "ok";
  110. +
  111. +   partitions {
  112. +       compatible = "fixed-partitions";
  113. +       #address-cells = <1>;
  114. +       #size-cells = <1>;
  115. +
  116. +       cfe@0 {
  117. +           label = "CFE";
  118. +           reg = <0x000000 0x020000>;
  119. +           read-only;
  120. +       };
  121. +
  122. +       linux@20000 {
  123. +           label = "linux";
  124. +           reg = <0x020000 0xfe0000>;
  125. +           compatible = "brcm,bcm963xx-imagetag";
  126. +       };
  127. +
  128. +       nvram@fe0000 {
  129. +           label = "nvram";
  130. +           reg = <0xfe0000 0x10000>;
  131. +       };
  132. +   };
  133. +};
  134. +
  135. +&pinctrl {
  136. +   pinctrl-names = "default";
  137. +   pinctrl-0 = <&pinctrl_pci &pinctrl_ephy0_led &pinctrl_ephy1_led
  138. +            &pinctrl_ephy2_led &pinctrl_ephy3_led>;
  139. +};
  140. +
  141. +&uart0 {
  142. +   status = "ok";
  143. +};
  144. diff --git a/target/linux/bcm63xx/image/bcm63xx.mk b/target/linux/bcm63xx/image/bcm63xx.mk
  145. index 64ddb63..d89bfe4 100644
  146. --- a/target/linux/bcm63xx/image/bcm63xx.mk
  147. +++ b/target/linux/bcm63xx/image/bcm63xx.mk
  148. @@ -1147,6 +1147,20 @@ endef
  149.  TARGET_DEVICES += usrobotics_usr9108
  150.  
  151.  ### ZyXEL ###
  152. +define Device/zyxel_p870hnu-51b
  153. +  $(Device/bcm63xx)
  154. +  DEVICE_VENDOR := ZyXEL
  155. +  DEVICE_MODEL := P870HNU-51B
  156. +  IMAGES := factory.bin
  157. +  IMAGE/factory.bin := cfe-bin | zyxel-bin
  158. +  CFE_BOARD_ID := 96368MVWG
  159. +  CFE_CHIP_ID := 6368
  160. +  CFE_EXTRAS += --rsa-signature "ZyXEL" --signature "ZyXEL_4004" --pad 8
  161. +  IMAGE_OFFSET := 0x20000
  162. +  DEVICE_PACKAGES := $(B43_PACKAGES)
  163. +endef
  164. +TARGET_DEVICES += zyxel_p870hnu-51b
  165. +
  166.  define Device/zyxel_p870hw-51a-v2
  167.    $(Device/bcm63xx)
  168.    DEVICE_VENDOR := ZyXEL
  169. diff --git a/target/linux/bcm63xx/patches-5.4/599-board_P870HNU.patch b/target/linux/bcm63xx/patches-5.4/599-board_P870HNU.patch
  170. new file mode 100644
  171. index 0000000..2221d59
  172. --- /dev/null
  173. +++ b/target/linux/bcm63xx/patches-5.4/599-board_P870HNU.patch
  174. @@ -0,0 +1,69 @@
  175. +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
  176. ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
  177. +@@ -2152,6 +2152,50 @@
  178. +   { .offset = 115, .value = 0xfad9 },
  179. + };
  180. +
  181. ++static struct board_info __initdata board_P870HNU51B = {
  182. ++  .name               = "P870HNU-51b",
  183. ++  .expected_cpu_id        = 0x6368,
  184. ++
  185. ++  .has_pci            = 1,
  186. ++  .use_fallback_sprom = 1,
  187. ++  .has_ohci0          = 1,
  188. ++  .has_ehci0          = 1,
  189. ++
  190. ++  .num_usbh_ports     = 1,
  191. ++
  192. ++  .has_enetsw         = 1,
  193. ++  .enetsw = {
  194. ++      .used_ports = {
  195. ++          [0] = {
  196. ++              .used   = 1,
  197. ++              .phy_id = 1,
  198. ++              .name   = "port1",
  199. ++          },
  200. ++          [1] = {
  201. ++              .used   = 1,
  202. ++              .phy_id = 2,
  203. ++              .name   = "port2",
  204. ++          },
  205. ++          [2] = {
  206. ++              .used   = 1,
  207. ++              .phy_id = 3,
  208. ++              .name   = "port3",
  209. ++          },
  210. ++          [3] = {
  211. ++              .used   = 1,
  212. ++              .phy_id = 4,
  213. ++              .name   = "port4",
  214. ++          },
  215. ++      },
  216. ++  },
  217. ++
  218. ++  .fallback_sprom = {
  219. ++      .type               = SPROM_BCM43222,
  220. ++      .pci_bus            = 0,
  221. ++      .pci_dev            = 1,
  222. ++  },
  223. ++};
  224. ++
  225. + static struct board_info __initdata board_P870HW51A_V2 = {
  226. +   .name               = "P870HW-51a_v2",
  227. +   .expected_cpu_id        = 0x6368,
  228. +@@ -2793,6 +2793,7 @@ static const struct board_info __initcon
  229. +   &board_EVG2000,
  230. +   &board_HG622,
  231. +   &board_HG655b,
  232. ++  &board_P870HNU51B,
  233. +   &board_P870HW51A_V2,
  234. +   &board_R1000H,
  235. +   &board_VH4032N,
  236. +@@ -2912,6 +2912,7 @@ static struct of_device_id const bcm963x
  237. +   { .compatible = "netgear,dgnd3700-v1", .data = &board_DGND3700v1_3800B, },
  238. +   { .compatible = "netgear,evg2000", .data = &board_EVG2000, },
  239. +   { .compatible = "observa,vh4032n", .data = &board_VH4032N, },
  240. ++  { .compatible = "zyxel,p870hnu-51b", .data = &board_P870HNU51B, },
  241. +   { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, },
  242. +#endif
  243. +#ifdef CONFIG_BCM63XX_CPU_63268
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement