MIPS: add BMIPS Netgear DGND3700v2 board
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Sat, 3 Feb 2018 09:30:28 +0000 (10:30 +0100)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Wed, 21 Mar 2018 22:23:13 +0000 (23:23 +0100)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
arch/mips/dts/Makefile
arch/mips/dts/netgear,dgnd3700v2.dts [new file with mode: 0644]
arch/mips/mach-bmips/Kconfig
board/netgear/dgnd3700v2/Kconfig [new file with mode: 0644]
board/netgear/dgnd3700v2/MAINTAINERS [new file with mode: 0644]
board/netgear/dgnd3700v2/Makefile [new file with mode: 0644]
board/netgear/dgnd3700v2/dgnd3700v2.c [new file with mode: 0644]
configs/netgear_dgnd3700v2_ram_defconfig [new file with mode: 0644]
include/configs/netgear_dgnd3700v2.h [new file with mode: 0644]

index 840dbf170dc4681fb410c74959e74309e19f171a..e80905cf3a512807a871eb9091f807c31c685238 100644 (file)
@@ -15,6 +15,7 @@ dtb-$(CONFIG_BOARD_COMTREND_VR3032U) += comtrend,vr-3032u.dtb
 dtb-$(CONFIG_BOARD_COMTREND_WAP5813N) += comtrend,wap-5813n.dtb
 dtb-$(CONFIG_BOARD_HUAWEI_HG556A) += huawei,hg556a.dtb
 dtb-$(CONFIG_BOARD_NETGEAR_CG3100D) += netgear,cg3100d.dtb
+dtb-$(CONFIG_BOARD_NETGEAR_DGND3700V2) += netgear,dgnd3700v2.dtb
 dtb-$(CONFIG_BOARD_SAGEM_FAST1704) += sagem,f@st1704.dtb
 dtb-$(CONFIG_BOARD_TPLINK_WDR4300) += tplink_wdr4300.dtb
 
diff --git a/arch/mips/dts/netgear,dgnd3700v2.dts b/arch/mips/dts/netgear,dgnd3700v2.dts
new file mode 100644 (file)
index 0000000..9792e06
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2018 Ã\81lvaro Fernández Rojas <noltari@gmail.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/dts-v1/;
+
+#include "brcm,bcm6362.dtsi"
+
+/ {
+       model = "Netgear DGND3700v2";
+       compatible = "netgear,dgnd3700v2", "brcm,bcm6362";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               inet_green {
+                       label = "DGND3700v2:green:inet";
+                       gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+               };
+
+               dsl_green {
+                       label = "DGND3700v2:green:dsl";
+                       gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
+               };
+
+               power_amber {
+                       label = "DGND3700v2:red:power";
+                       gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&gpio0 {
+       status = "okay";
+};
+
+&gpio1 {
+       status = "okay";
+};
+
+&leds {
+       status = "okay";
+       brcm,serial-leds;
+       brcm,serial-dat-low;
+       brcm,serial-shift-inv;
+       brcm,serial-mux;
+
+       led@8 {
+               reg = <8>;
+               label = "DGND3700v2:green:power";
+       };
+
+       led@9 {
+               reg = <9>;
+               active-low;
+               label = "DGND3700v2:green:wps";
+       };
+
+       led@10 {
+               reg = <10>;
+               active-low;
+               label = "DGND3700v2:green:usb1";
+       };
+
+       led@11 {
+               reg = <11>;
+               active-low;
+               label = "DGND3700v2:green:usb2";
+       };
+
+       led@12 {
+               reg = <12>;
+               active-low;
+               label = "DGND3700v2:amber:inet";
+       };
+
+       led@13 {
+               reg = <13>;
+               active-low;
+               label = "DGND3700v2:green:ethernet";
+       };
+
+       led@14 {
+               reg = <14>;
+               active-low;
+               label = "DGND3700v2:amber:dsl";
+       };
+
+       led@16 {
+               reg = <16>;
+               active-low;
+               label = "DGND3700v2:amber:usb1";
+       };
+
+       led@17 {
+               reg = <17>;
+               active-low;
+               label = "DGND3700v2:amber:usb2";
+       };
+
+       led@18 {
+               reg = <18>;
+               active-low;
+               label = "DGND3700v2:amber:ethernet";
+       };
+};
+
+&uart0 {
+       u-boot,dm-pre-reloc;
+       status = "okay";
+};
index 2cc6a6a8d9d94b7882ad7839bd1cd8e237e09457..10900bf6045ae2c1bcb765422e120662c2ef0605 100644 (file)
@@ -200,6 +200,17 @@ config BOARD_NETGEAR_CG3100D
          ethernet ports, 1 UART, GPIO buttons and LEDs, and a BCM43225
          (miniPCIe).
 
+config BOARD_NETGEAR_DGND3700V2
+       bool "Netgear DGND3700v2"
+       depends on SOC_BMIPS_BCM6362
+       select BMIPS_SUPPORTS_BOOT_RAM
+       help
+         Netgear DGND3700v2 boards have a BCM6362 SoC with 64 MB of RAM and
+         32 MB of flash (NAND).
+         Between its different peripherals there's a BCM53125 switch with 5
+         ethernet ports, 2 USB ports, 1 UART, GPIO buttons and LEDs, and a
+         BCM43228 (miniPCIe).
+
 config BOARD_SAGEM_FAST1704
        bool "Sagem F@ST1704"
        depends on SOC_BMIPS_BCM6338
@@ -247,6 +258,7 @@ source "board/comtrend/vr3032u/Kconfig"
 source "board/comtrend/wap5813n/Kconfig"
 source "board/huawei/hg556a/Kconfig"
 source "board/netgear/cg3100d/Kconfig"
+source "board/netgear/dgnd3700v2/Kconfig"
 source "board/sagem/f@st1704/Kconfig"
 source "board/sfr/nb4_ser/Kconfig"
 
diff --git a/board/netgear/dgnd3700v2/Kconfig b/board/netgear/dgnd3700v2/Kconfig
new file mode 100644 (file)
index 0000000..11af188
--- /dev/null
@@ -0,0 +1,12 @@
+if BOARD_NETGEAR_DGND3700V2
+
+config SYS_BOARD
+       default "dgnd3700v2"
+
+config SYS_VENDOR
+       default "netgear"
+
+config SYS_CONFIG_NAME
+       default "netgear_dgnd3700v2"
+
+endif
diff --git a/board/netgear/dgnd3700v2/MAINTAINERS b/board/netgear/dgnd3700v2/MAINTAINERS
new file mode 100644 (file)
index 0000000..998077b
--- /dev/null
@@ -0,0 +1,6 @@
+NETGEAR DGND3700V2 BOARD
+M:     Ã\81lvaro Fernández Rojas <noltari@gmail.com>
+S:     Maintained
+F:     board/netgear/dgnd3700v2/
+F:     include/configs/netgear_dgnd3700v2.h
+F:     configs/netgear_dgnd3700v2_ram_defconfig
diff --git a/board/netgear/dgnd3700v2/Makefile b/board/netgear/dgnd3700v2/Makefile
new file mode 100644 (file)
index 0000000..89fd6c8
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y += dgnd3700v2.o
diff --git a/board/netgear/dgnd3700v2/dgnd3700v2.c b/board/netgear/dgnd3700v2/dgnd3700v2.c
new file mode 100644 (file)
index 0000000..3ae7f6a
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2018 Ã\81lvaro Fernández Rojas <noltari@gmail.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+
+#define GPIO_BASE_6362                 0x10000080
+
+#define GPIO_MODE_6362_REG             0x18
+#define GPIO_MODE_6362_SERIAL_LED_DATA BIT(2)
+#define GPIO_MODE_6362_SERIAL_LED_CLK  BIT(3)
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+       void __iomem *gpio_regs = map_physmem(GPIO_BASE_6362, 0, MAP_NOCACHE);
+
+       /* Enable Serial LEDs */
+       setbits_be32(gpio_regs + GPIO_MODE_6362_REG,
+                    GPIO_MODE_6362_SERIAL_LED_DATA |
+                    GPIO_MODE_6362_SERIAL_LED_CLK);
+
+       return 0;
+}
+#endif
diff --git a/configs/netgear_dgnd3700v2_ram_defconfig b/configs/netgear_dgnd3700v2_ram_defconfig
new file mode 100644 (file)
index 0000000..353e770
--- /dev/null
@@ -0,0 +1,45 @@
+CONFIG_MIPS=y
+CONFIG_SYS_TEXT_BASE=0x80010000
+CONFIG_ARCH_BMIPS=y
+CONFIG_SOC_BMIPS_BCM6362=y
+# CONFIG_MIPS_BOOT_CMDLINE_LEGACY is not set
+# CONFIG_MIPS_BOOT_ENV_LEGACY is not set
+CONFIG_MIPS_BOOT_FDT=y
+CONFIG_DEFAULT_DEVICE_TREE="netgear,dgnd3700v2"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_OF_STDOUT_VIA_ALIAS=y
+CONFIG_DISPLAY_CPUINFO=y
+CONFIG_BOARD_EARLY_INIT_F=y
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="DGND3700v2 # "
+CONFIG_CMD_CPU=y
+CONFIG_CMD_LICENSE=y
+# CONFIG_CMD_BOOTD is not set
+# CONFIG_CMD_ELF is not set
+# CONFIG_CMD_XIMG is not set
+# CONFIG_CMD_EXPORTENV is not set
+# CONFIG_CMD_IMPORTENV is not set
+# CONFIG_CMD_EDITENV is not set
+# CONFIG_CMD_SAVEENV is not set
+# CONFIG_CMD_ENV_EXISTS is not set
+# CONFIG_CMD_CRC32 is not set
+CONFIG_CMD_MEMINFO=y
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_LOADS is not set
+# CONFIG_CMD_NET is not set
+# CONFIG_CMD_NFS is not set
+# CONFIG_CMD_MISC is not set
+# CONFIG_DM_DEVICE_REMOVE is not set
+CONFIG_DM_GPIO=y
+CONFIG_BCM6345_GPIO=y
+CONFIG_LED=y
+CONFIG_LED_BCM6328=y
+CONFIG_LED_BLINK=y
+CONFIG_LED_GPIO=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_BCM6328_POWER_DOMAIN=y
+CONFIG_DM_RESET=y
+CONFIG_RESET_BCM6345=y
+# CONFIG_SPL_SERIAL_PRESENT is not set
+CONFIG_DM_SERIAL=y
+CONFIG_BCM6345_SERIAL=y
diff --git a/include/configs/netgear_dgnd3700v2.h b/include/configs/netgear_dgnd3700v2.h
new file mode 100644 (file)
index 0000000..0c3823b
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2018 Ã\81lvaro Fernández Rojas <noltari@gmail.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <configs/bmips_common.h>
+#include <configs/bmips_bcm6362.h>
+
+#define CONFIG_REMAKE_ELF
+
+#define CONFIG_ENV_SIZE                        (8 * 1024)
+