bcm63xx: add support for ADB P.DG A4101N A-000-1A1-AE
authorDaniele Castro <danielecastro@hotmail.it>
Wed, 9 Sep 2020 01:21:14 +0000 (03:21 +0200)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Sun, 6 Dec 2020 15:24:04 +0000 (16:24 +0100)
ADB P.DG A4101N A-000-1A1-AE has a similar PCB as the OpenWrt's ADB P.DG A4001N1
with LEDs connected to different GPIO PINs in active low configuration.

Hardware:
* Board ID: 96328avngv
* SoC: Broadcom BCM6328 (rev b0) @ 320MHz, CPU BMIPS4350
* RAM DDR2: 64 Mbyte - Winbond W9751G6KB-25
* Serial flash: 16 Mbyte - Winbond 25Q128BVFG
* Ethernet: 4x Ethernet 10/100 baseT
* Wifi 2.4GHz: Broadcom Corporation BCM43225 Wireless Network Adapter (rev 23)
* LEDs: 1x Power, 1x DSL, 1x Internet, 4x ETH, 1x USB, 1x WLAN, 1x WPS, 1x TEL
* Buttons: 1x Reset, 1x WPS, 1x unnamed
* UART: 1x TTL 115200n8, VCC RX TX GND, on J502 connector

Installation via CFE:
* Stock CFE has to be overwritten with a generic 6328 one that can upload
  .bin images with no signature check (cfe6328_configured.bin)
* Connect a serial port to the board
* Stop the cfe boot process after power on by pressing enter
* Set static IP 192.168.2.10 and subnet mask 255.255.255.0
* Navigate to http://192.168.2.50/
* Upload the OpenWrt image file

A4101N GPIO LAYOUT:

Power            always on
DSL              GPIO483(03)
Internet         GPIO491(11)
ETH1             GPIO505(25)
ETH2             GPIO506(26)
ETH3             GPIO507(27)
ETH4             GPIO508(28)
USB              GPIO490(10)
WLAN             controlled by BCM43225
WPS              GPIO489(09)
TEL              GPIO511(31)

Key RESET        GPIO503(23)
Key WPS          GPIO504(24)
Key unnamed      GPIO492(12)

Signed-off-by: Daniele Castro <danielecastro@hotmail.it>
[Amend commit description, DTS improvements, refresh patches]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
14 files changed:
target/linux/bcm63xx/base-files/etc/board.d/01_leds
target/linux/bcm63xx/base-files/etc/board.d/02_network
target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc
target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4101n-a-000-1a1-ae.dts [new file with mode: 0644]
target/linux/bcm63xx/image/bcm63xx.mk
target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch
target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch
target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch
target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch
target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch
target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch
target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch
target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch
target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch

index bdd6934023981c8da49f15bbd3dfb09dce439dbe..cee71aac4776f6f3245951bcc3ebc489a76c6a9c 100755 (executable)
@@ -14,6 +14,7 @@ actiontec,r1000h)
        ucidef_set_led_usbport "usb" "USB" "green:usb" "usb1-port1" "usb2-port1"
        ;;
 adb,a4001n|\
+adb,pdg-a4101n-a-000-1a1-ae|\
 comtrend,ar-5315u|\
 comtrend,vr-3032u|\
 d-link,dsl-2750u-c1|\
index 711b8f8c00247d896ad91a9b8b1f4af73d620a65..440a7059e20ce3be916bba373444c02c7230f9f7 100755 (executable)
@@ -21,6 +21,7 @@ t-com,speedport-w-500v)
 adb,a4001n1|\
 adb,a4001n|\
 adb,pdg-a4001n-a-000-1a1-ax|\
+adb,pdg-a4101n-a-000-1a1-ae|\
 adb,av4202n|\
 brcm,bcm963281tan|\
 brcm,bcm96328avng|\
index 6c61f7d38cf4dfa47501ac0c357f11504fe0bacf..89c917839e63c0e15d8d6dea692ba3e84d45f1ae 100644 (file)
@@ -13,6 +13,7 @@ case "$(board_name)" in
        adb,a4001n|\
        adb,a4001n1|\
        adb,pdg-a4001n-a-000-1a1-ax|\
+       adb,pdg-a4101n-a-000-1a1-ae|\
        brcm,bcm96328avng|\
        brcm,bcm963281tan|\
        bt,voyager-2110|\
diff --git a/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4101n-a-000-1a1-ae.dts b/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4101n-a-000-1a1-ae.dts
new file mode 100644 (file)
index 0000000..7ffff4e
--- /dev/null
@@ -0,0 +1,141 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "bcm6328.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+       model = "ADB P.DG A4101N A-000-1A1-AE";
+       compatible = "adb,pdg-a4101n-a-000-1a1-ae", "brcm,bcm6328";
+
+       aliases {
+               led-boot = &led_dsl_green;
+               led-failsafe = &led_dsl_green;
+               led-upgrade = &led_dsl_green;
+       };
+
+       chosen {
+               bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200";
+               stdout-path = "serial0:115200n8";
+       };
+
+       keys {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+
+               wifi {
+                       label = "wifi";
+                       gpios = <&pinctrl 12 1>;
+                       linux,code = <KEY_WLAN>;
+                       debounce-interval = <60>;
+               };
+
+               reset {
+                       label = "reset";
+                       gpios = <&pinctrl 23 1>;
+                       linux,code = <KEY_RESTART>;
+                       debounce-interval = <60>;
+               };
+
+               wps {
+                       label = "wps";
+                       gpios = <&pinctrl 24 1>;
+                       linux,code = <KEY_WPS_BUTTON>;
+                       debounce-interval = <60>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led@31 {
+                       label = "green:tel";
+                       gpios = <&pinctrl 31 1>;
+               };
+       };
+};
+
+&leds {
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_leds>;
+
+       led_dsl_green: led@3 {
+               reg = <3>;
+               active-low;
+               label = "green:dsl";
+       };
+
+       led@9 {
+               reg = <9>;
+               active-low;
+               label = "green:wps";
+       };
+
+       led@10 {
+               reg = <10>;
+               active-low;
+               label = "green:usb";
+       };
+
+       led@11 {
+               reg = <11>;
+               active-low;
+               label = "green:internet";
+       };
+};
+
+&hsspi {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               spi-max-frequency = <16666667>;
+               spi-tx-bus-width = <2>;
+               spi-rx-bus-width = <2>;
+               reg = <0>;
+
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               reg = <0x000000 0x010000>;
+                               label = "cfe";
+                               read-only;
+                       };
+
+                       partition@10000 {
+                               reg = <0x010000 0xff0000>;
+                               label = "linux";
+                               compatible = "brcm,bcm963xx-imagetag";
+                       };
+               };
+       };
+};
+
+&pinctrl {
+       pinctrl_leds: leds {
+               function = "led";
+               pins = "gpio3", "gpio9", "gpio10",
+                      "gpio11";
+       };
+
+       green_internet_switch {
+               gpio-hog;
+               gpios = <2 1>;
+               output-low;
+               line-name = "green:internet-switch";
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
index d3356040d015c69eebc5233e122c49944651006e..c9aacd5ebd1ccef0ce9d3f4982fe4d977e0c4a9a 100644 (file)
@@ -237,6 +237,18 @@ define Device/adb_pdg-a4001n-a-000-1a1-ax
 endef
 TARGET_DEVICES += adb_pdg-a4001n-a-000-1a1-ax
 
+define Device/adb_pdg-a4101n-a-000-1a1-ae
+  $(Device/bcm63xx)
+  DEVICE_VENDOR := ADB
+  DEVICE_MODEL := P.DG A4101N A-000-1A1-AE
+  IMAGES += sysupgrade.bin
+  CFE_BOARD_ID := 96328avngv
+  CHIP_ID := 6328
+  FLASH_MB := 16
+  DEVICE_PACKAGES := $(USB2_PACKAGES) $(B43_PACKAGES)
+endef
+TARGET_DEVICES += adb_pdg-a4101n-a-000-1a1-ae
+
 define Device/adb_av4202n
   $(Device/bcm63xx)
   DEVICE_VENDOR := ADB
index 5a2dbdcf85b4b10fc9b648e09073cee8036202ea..a8c13dedd9e2829dc0d0c538440bc7e92af605c3 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -348,6 +348,482 @@ static struct board_info __initdata boar
+@@ -348,6 +348,525 @@ static struct board_info __initdata boar
                },
        },
  };
 +      },
 +};
 +
++static struct board_info __initdata board_PDG_A4101N_A_000_1A1_AE = {
++      .name = "96328avngv",
++      .expected_cpu_id = 0x6328,
++
++      .has_pci = 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",
++                      },
++              },
++      },
++
++      .use_fallback_sprom = 1,
++      .fallback_sprom = {
++              .type = SPROM_BCM43225,
++              .pci_bus = 1,
++              .pci_dev = 0,
++      },
++};
++
 +static struct board_info __initdata board_R5010UNV2 = {
 +      .name = "96328ang",
 +      .expected_cpu_id = 0x6328,
  #endif /* CONFIG_BCM63XX_CPU_6328 */
  
  /*
-@@ -703,6 +1179,16 @@ static const struct board_info __initcon
+@@ -703,6 +1222,17 @@ static const struct board_info __initcon
  #endif /* CONFIG_BCM63XX_CPU_6318 */
  #ifdef CONFIG_BCM63XX_CPU_6328
        &board_96328avng,
 +      &board_dsl_274xb_f1,
 +      &board_FAST2704V2,
 +      &board_PDG_A4001N_A_000_1A1_AX,
++      &board_PDG_A4101N_A_000_1A1_AE,
 +      &board_R5010UNV2,
  #endif /* CONFIG_BCM63XX_CPU_6328 */
  #ifdef CONFIG_BCM63XX_CPU_6338
        &board_96338gw,
-@@ -742,7 +1228,19 @@ static struct of_device_id const bcm963x
+@@ -742,7 +1272,20 @@ static struct of_device_id const bcm963x
        { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, },
  #endif /* CONFIG_BCM63XX_CPU_6318 */
  #ifdef CONFIG_BCM63XX_CPU_6328
 +      { .compatible = "adb,a4001n", .data = &board_A4001N, },
 +      { .compatible = "adb,a4001n1", .data = &board_A4001N1, },
 +      { .compatible = "adb,pdg-a4001n-a-000-1a1-ax", .data = &board_PDG_A4001N_A_000_1A1_AX, },
++      { .compatible = "adb,pdg-a4101n-a-000-1a1-ae", .data = &board_PDG_A4101N_A_000_1A1_AE, },
        { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, },
 +      { .compatible = "brcm,bcm963281tan", .data = &board_963281TAN, },
 +      { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, },
index 8ff2a69707b17dd482c8274008e6f2dd7137a845..d8336ee2021125df3ea7d398c80ba029ff64d5d7 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -857,6 +857,32 @@ static struct board_info __initdata boar
+@@ -900,6 +900,32 @@ static struct board_info __initdata boar
                .force_duplex_full      = 1,
        },
  };
@@ -33,7 +33,7 @@
  #endif /* CONFIG_BCM63XX_CPU_6338 */
  
  /*
-@@ -1193,6 +1219,8 @@ static const struct board_info __initcon
+@@ -1237,6 +1263,8 @@ static const struct board_info __initcon
  #ifdef CONFIG_BCM63XX_CPU_6338
        &board_96338gw,
        &board_96338w,
@@ -42,7 +42,7 @@
  #endif /* CONFIG_BCM63XX_CPU_6338 */
  #ifdef CONFIG_BCM63XX_CPU_6345
        &board_96345gw2,
-@@ -1245,6 +1273,8 @@ static struct of_device_id const bcm963x
+@@ -1290,6 +1318,8 @@ static struct of_device_id const bcm963x
  #ifdef CONFIG_BCM63XX_CPU_6338
        { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, },
        { .compatible = "brcm,bcm96338w", .data = &board_96338w, },
index ca200024c2d03d35aa2ce790fc87b68a53b17a71..e403689375015df14107a904b01ddbe4a2bcccac 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -893,6 +893,19 @@ static struct board_info __initdata boar
+@@ -936,6 +936,19 @@ static struct board_info __initdata boar
        .name                           = "96345GW2",
        .expected_cpu_id                = 0x6345,
  };
@@ -20,7 +20,7 @@
  #endif /* CONFIG_BCM63XX_CPU_6345 */
  
  /*
-@@ -1224,6 +1237,7 @@ static const struct board_info __initcon
+@@ -1268,6 +1281,7 @@ static const struct board_info __initcon
  #endif /* CONFIG_BCM63XX_CPU_6338 */
  #ifdef CONFIG_BCM63XX_CPU_6345
        &board_96345gw2,
@@ -28,7 +28,7 @@
  #endif /* CONFIG_BCM63XX_CPU_6345 */
  #ifdef CONFIG_BCM63XX_CPU_6348
        &board_96348r,
-@@ -1278,6 +1292,8 @@ static struct of_device_id const bcm963x
+@@ -1323,6 +1337,8 @@ static struct of_device_id const bcm963x
  #endif /* CONFIG_BCM63XX_CPU_6338 */
  #ifdef CONFIG_BCM63XX_CPU_6345
        { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, },
index eab83113f76da1dfe515988b2d5e7328f352164e..b2b1082b49dc3aac675b3fc7823b9ae7dc08597f 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -1092,6 +1092,275 @@ static struct board_info __initdata boar
+@@ -1135,6 +1135,275 @@ static struct board_info __initdata boar
  
        .has_ohci0 = 1,
  };
  #endif /* CONFIG_BCM63XX_CPU_6348 */
  
  /*
-@@ -1248,6 +1517,19 @@ static const struct board_info __initcon
+@@ -1292,6 +1561,19 @@ static const struct board_info __initcon
        &board_DV201AMR,
        &board_96348gw_a,
        &board_rta1025w_16,
  #endif /* CONFIG_BCM63XX_CPU_6348 */
  #ifdef CONFIG_BCM63XX_CPU_6358
        &board_96358vw,
-@@ -1296,15 +1578,29 @@ static struct of_device_id const bcm963x
+@@ -1341,15 +1623,29 @@ static struct of_device_id const bcm963x
        { .compatible = "dynalink,rta770w", .data = &board_rta770w, },
  #endif /* CONFIG_BCM63XX_CPU_6345 */
  #ifdef CONFIG_BCM63XX_CPU_6348
index 4279b0bb133eb7a4bb3cafe105082af5cb89f984..cb5717f3012dd1078feca8618c4cfe26e6e1f3bb 100644 (file)
@@ -8,7 +8,7 @@
  #include <asm/addrspace.h>
  #include <bcm63xx_board.h>
  #include <bcm63xx_cpu.h>
-@@ -1445,6 +1446,88 @@ static struct board_info __initdata boar
+@@ -1488,6 +1489,88 @@ static struct board_info __initdata boar
        .has_ehci0 = 1,
  };
  
@@ -97,7 +97,7 @@
  static struct board_info __initdata board_DWVS0 = {
        .name                           = "DWV-S0",
        .expected_cpu_id                = 0x6358,
-@@ -1469,6 +1552,238 @@ static struct board_info __initdata boar
+@@ -1512,6 +1595,238 @@ static struct board_info __initdata boar
        .has_ohci0                      = 1,
        .has_ehci0                      = 1,
  };
  #endif /* CONFIG_BCM63XX_CPU_6358 */
  
  /*
-@@ -1535,7 +1850,20 @@ static const struct board_info __initcon
+@@ -1579,7 +1894,20 @@ static const struct board_info __initcon
        &board_96358vw,
        &board_96358vw2,
        &board_AGPFS0,
  #endif /* CONFIG_BCM63XX_CPU_6358 */
  };
  
-@@ -1608,11 +1936,24 @@ static struct of_device_id const bcm963x
+@@ -1653,11 +1981,24 @@ static struct of_device_id const bcm963x
        { .compatible = "alcatel,rg100a", .data = &board_96358vw2, },
        { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, },
        { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, },
index ac9d76a52f5184a6271bf64bb8eeee688a47be58..be59ca14d046cc28e4b307b7f7fc4427fd2265d0 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -1786,6 +1786,117 @@ static struct board_info __initdata boar
+@@ -1829,6 +1829,117 @@ static struct board_info __initdata boar
  };
  #endif /* CONFIG_BCM63XX_CPU_6358 */
  
  /*
   * all boards
   */
-@@ -1865,6 +1976,12 @@ static const struct board_info __initcon
+@@ -1909,6 +2020,12 @@ static const struct board_info __initcon
        &board_nb4_fxc_r1,
        &board_spw303v,
  #endif /* CONFIG_BCM63XX_CPU_6358 */
  };
  
  static struct of_device_id const bcm963xx_boards_dt[] = {
-@@ -1956,6 +2073,10 @@ static struct of_device_id const bcm963x
+@@ -2001,6 +2118,10 @@ static struct of_device_id const bcm963x
        { .compatible = "telsey,cpva642", .data = &board_CPVA642, },
  #endif /* CONFIG_BCM63XX_CPU_6358 */
  #ifdef CONFIG_BCM63XX_CPU_6362
index 1ba6d5ecd8b42e8b1222c60933ab9405eac5730b..dedbf7197804c09ace5f9ed8291dd0b32eed9af0 100644 (file)
@@ -9,7 +9,7 @@
  #include <asm/addrspace.h>
  #include <bcm63xx_board.h>
  #include <bcm63xx_cpu.h>
-@@ -1898,6 +1900,648 @@ static struct board_info __initdata boar
+@@ -1941,6 +1943,648 @@ static struct board_info __initdata boar
  #endif /* CONFIG_BCM63XX_CPU_6362 */
  
  /*
   * all boards
   */
  static const struct board_info __initconst *bcm963xx_boards[] = {
-@@ -1982,6 +2626,22 @@ static const struct board_info __initcon
+@@ -2026,6 +2670,22 @@ static const struct board_info __initcon
        &board_hg253s_v2,
        &board_nb6,
  #endif /* CONFIG_BCM63XX_CPU_6362 */
  };
  
  static struct of_device_id const bcm963xx_boards_dt[] = {
-@@ -2079,6 +2739,20 @@ static struct of_device_id const bcm963x
+@@ -2124,6 +2784,20 @@ static struct of_device_id const bcm963x
        { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, },
  #endif /* CONFIG_BCM63XX_CPU_6362 */
  #ifdef CONFIG_BCM63XX_CPU_6368
index 139f6ad08536310150ccff3bc9e7c6bfa0b060c1..30410476b5a3f6feb5c637add8ee63505e052249 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -2542,6 +2542,273 @@ static struct board_info __initdata boar
+@@ -2585,6 +2585,273 @@ static struct board_info __initdata boar
  #endif /* CONFIG_BCM63XX_CPU_6368 */
  
  /*
   * all boards
   */
  static const struct board_info __initconst *bcm963xx_boards[] = {
-@@ -2642,6 +2909,15 @@ static const struct board_info __initcon
+@@ -2686,6 +2953,15 @@ static const struct board_info __initcon
        &board_VR3026e,
        &board_WAP5813n,
  #endif /* CONFIG_BCM63XX_CPU_6368 */
  };
  
  static struct of_device_id const bcm963xx_boards_dt[] = {
-@@ -2755,6 +3031,14 @@ static struct of_device_id const bcm963x
+@@ -2800,6 +3076,14 @@ static struct of_device_id const bcm963x
        { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, },
  #endif /* CONFIG_BCM63XX_CPU_6368 */
  #ifdef CONFIG_BCM63XX_CPU_63268
index 9264becf3e7ec6be05a391b5d84fa407373456a5..fba3766c74d3c6f837485cf4d73cb642208e877e 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -3067,6 +3067,22 @@ void __init board_bcm963xx_init(void)
+@@ -3112,6 +3112,22 @@ void __init board_bcm963xx_init(void)
                val &= MPI_CSBASE_BASE_MASK;
        }
        boot_addr = (u8 *)KSEG1ADDR(val);