[U-Boot] [PATCH 3/3] MIPS: add BMIPS Netgear DGND3700v2 board

Álvaro Fernández Rojas noltari at gmail.com
Fri Jan 26 20:30:59 UTC 2018


Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
 arch/mips/dts/Makefile                   |   1 +
 arch/mips/dts/netgear,dgnd3700v2.dts     | 121 +++++++++++++++++++++++++++++++
 arch/mips/mach-bmips/Kconfig             |  12 +++
 board/netgear/dgnd3700v2/Kconfig         |  12 +++
 board/netgear/dgnd3700v2/MAINTAINERS     |   6 ++
 board/netgear/dgnd3700v2/Makefile        |   5 ++
 board/netgear/dgnd3700v2/dgnd3700v2.c    |  30 ++++++++
 configs/netgear_dgnd3700v2_ram_defconfig |  46 ++++++++++++
 include/configs/netgear_dgnd3700v2.h     |  16 ++++
 9 files changed, 249 insertions(+)
 create mode 100644 arch/mips/dts/netgear,dgnd3700v2.dts
 create mode 100644 board/netgear/dgnd3700v2/Kconfig
 create mode 100644 board/netgear/dgnd3700v2/MAINTAINERS
 create mode 100644 board/netgear/dgnd3700v2/Makefile
 create mode 100644 board/netgear/dgnd3700v2/dgnd3700v2.c
 create mode 100644 configs/netgear_dgnd3700v2_ram_defconfig
 create mode 100644 include/configs/netgear_dgnd3700v2.h

diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile
index 840dbf170d..e80905cf3a 100644
--- a/arch/mips/dts/Makefile
+++ b/arch/mips/dts/Makefile
@@ -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 at 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
index 0000000000..2739f2035a
--- /dev/null
+++ b/arch/mips/dts/netgear,dgnd3700v2.dts
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2018 Álvaro Fernández Rojas <noltari at 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 at 8 {
+		reg = <8>;
+		label = "DGND3700v2:green:power";
+	};
+
+	led at 9 {
+		reg = <9>;
+		active-low;
+		label = "DGND3700v2:green:wps";
+	};
+
+	led at 10 {
+		reg = <10>;
+		active-low;
+		label = "DGND3700v2:green:usb1";
+	};
+
+	led at 11 {
+		reg = <11>;
+		active-low;
+		label = "DGND3700v2:green:usb2";
+	};
+
+	led at 12 {
+		reg = <12>;
+		active-low;
+		label = "DGND3700v2:amber:inet";
+	};
+
+	led at 13 {
+		reg = <13>;
+		active-low;
+		label = "DGND3700v2:green:ethernet";
+	};
+
+	led at 14 {
+		reg = <14>;
+		active-low;
+		label = "DGND3700v2:amber:dsl";
+	};
+
+	led at 16 {
+		reg = <16>;
+		active-low;
+		label = "DGND3700v2:amber:usb1";
+	};
+
+	led at 17 {
+		reg = <17>;
+		active-low;
+		label = "DGND3700v2:amber:usb2";
+	};
+
+	led at 18 {
+		reg = <18>;
+		active-low;
+		label = "DGND3700v2:amber:ethernet";
+	};
+};
+
+&uart0 {
+	u-boot,dm-pre-reloc;
+	status = "okay";
+};
diff --git a/arch/mips/mach-bmips/Kconfig b/arch/mips/mach-bmips/Kconfig
index 2cc6a6a8d9..10900bf604 100644
--- a/arch/mips/mach-bmips/Kconfig
+++ b/arch/mips/mach-bmips/Kconfig
@@ -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 at 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 at st1704/Kconfig"
 source "board/sfr/nb4_ser/Kconfig"
 
diff --git a/board/netgear/dgnd3700v2/Kconfig b/board/netgear/dgnd3700v2/Kconfig
new file mode 100644
index 0000000000..11af188785
--- /dev/null
+++ b/board/netgear/dgnd3700v2/Kconfig
@@ -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
index 0000000000..aaa51c177e
--- /dev/null
+++ b/board/netgear/dgnd3700v2/MAINTAINERS
@@ -0,0 +1,6 @@
+NETGEAR DGND3700V2 BOARD
+M:	Álvaro Fernández Rojas <noltari at 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
index 0000000000..89fd6c89eb
--- /dev/null
+++ b/board/netgear/dgnd3700v2/Makefile
@@ -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
index 0000000000..9e9f70c5b8
--- /dev/null
+++ b/board/netgear/dgnd3700v2/dgnd3700v2.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2018 Álvaro Fernández Rojas <noltari at 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);
+	u32 val;
+
+	/* Enable Serial LEDs */
+	val = readl_be(gpio_regs + GPIO_MODE_6362_REG);
+	val |= GPIO_MODE_6362_SERIAL_LED_DATA;
+	val |= GPIO_MODE_6362_SERIAL_LED_CLK;
+	writel_be(val, gpio_regs + GPIO_MODE_6362_REG);
+
+	return 0;
+}
+#endif
diff --git a/configs/netgear_dgnd3700v2_ram_defconfig b/configs/netgear_dgnd3700v2_ram_defconfig
new file mode 100644
index 0000000000..11ee28eab1
--- /dev/null
+++ b/configs/netgear_dgnd3700v2_ram_defconfig
@@ -0,0 +1,46 @@
+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_FPGA 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
index 0000000000..0b68b4d344
--- /dev/null
+++ b/include/configs/netgear_dgnd3700v2.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2018 Álvaro Fernández Rojas <noltari at 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)
+
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_SYS_LONGHELP
-- 
2.11.0



More information about the U-Boot mailing list