From 9d466f2fe11a88da9f31f260296be042ed378b9d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 3 Feb 2018 10:30:28 +0100 Subject: [PATCH] MIPS: add BMIPS Netgear DGND3700v2 board MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Fernández Rojas --- 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 | 28 ++++++ configs/netgear_dgnd3700v2_ram_defconfig | 45 +++++++++ include/configs/netgear_dgnd3700v2.h | 13 +++ 9 files changed, 243 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@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..9792e06ed3 --- /dev/null +++ b/arch/mips/dts/netgear,dgnd3700v2.dts @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2018 Álvaro Fernández Rojas + * + * 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"; +}; 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@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 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..998077b69b --- /dev/null +++ b/board/netgear/dgnd3700v2/MAINTAINERS @@ -0,0 +1,6 @@ +NETGEAR DGND3700V2 BOARD +M: Álvaro Fernández Rojas +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..3ae7f6afbd --- /dev/null +++ b/board/netgear/dgnd3700v2/dgnd3700v2.c @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2018 Álvaro Fernández Rojas + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include + +#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 index 0000000000..353e7707e7 --- /dev/null +++ b/configs/netgear_dgnd3700v2_ram_defconfig @@ -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 index 0000000000..0c3823b143 --- /dev/null +++ b/include/configs/netgear_dgnd3700v2.h @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2018 Álvaro Fernández Rojas + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include + +#define CONFIG_REMAKE_ELF + +#define CONFIG_ENV_SIZE (8 * 1024) + -- 2.39.5