Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Netprotection Hardware #11

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions target/linux/ramips/base-files/etc/board.d/01_leds
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ case $board in
na930)
set_usb_led "na930:blue:status"
;;
netprotection)
ucidef_set_led_default "power" "power" "zbtlink:blue:power" "1"
set_wifi_led "zbtlink:blue:air"
set_usb_led "zbtlink:blue:usb"
;;
nw718)
set_usb_led "nw718:amber:usb"
;;
Expand Down
1 change: 1 addition & 0 deletions target/linux/ramips/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ ramips_setup_interfaces()
mt7628 | \
mzk-w300nh2 | \
mzk-750dhp | \
netprotection | \
whr-300hp2 | \
whr-600d | \
oy-0001 | \
Expand Down
3 changes: 3 additions & 0 deletions target/linux/ramips/base-files/lib/ramips.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ ramips_board_detect() {
*"Netgear WNCE2001")
name="wnce2001"
;;
*"Netprotection NP-A105003201")
name="netprotection"
;;
*"NexAira BC2")
name="bc2"
;;
Expand Down
1 change: 1 addition & 0 deletions target/linux/ramips/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ platform_check_image() {
ht-tm02 | \
hw550-3g | \
ip2202 | \
netprotection | \
m2m | \
m3 | \
m4 | \
Expand Down
116 changes: 116 additions & 0 deletions target/linux/ramips/dts/NETPROTECTION.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/dts-v1/;

/include/ "mt7620n.dtsi"

/ {
compatible = "np-A105003201,netprotection,NETPROTECTION", "ralink,mt7620n-soc";
model = "Netprotection NP-A105003201";

chosen {
bootargs = "console=ttyS0,115200";
};

palmbus@10000000 {
gpio1: gpio@638 {
status = "okay";
};

gpio2: gpio@660 {
status = "okay";
};

gpio3: gpio@688 {
status = "okay";
};

spi@b00 {
status = "okay";

en25q64@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "w25q64";
reg = <0 0>;
linux,modalias = "m25p80";
spi-max-frequency = <10000000>;

partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};

partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};

factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};

partition@50000 {
label = "firmware";
reg = <0x50000 0x760000>;
};
};
};
};

ehci@101c0000 {
status = "okay";
};

ohci@101c1000 {
status = "okay";
};

ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
ralink,port-map = "llllw";
};

wmac@10180000 {
ralink,mtd-eeprom = <&factory 0>;
};

pinctrl {
state_default: pinctrl0 {
default {
ralink,group = "i2c", "spi refclk", "wled";
ralink,function = "gpio";
};
};
};

gpio-leds {
compatible = "gpio-leds";
power {
label = "zbtlink:blue:power";
gpios = <&gpio1 14 1>;
};
usb {
label = "zbtlink:blue:usb";
gpios = <&gpio1 15 0>;
};
air {
label = "zbtlink:blue:air";
gpios = <&gpio3 0 1>;
};
};

gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
#size-cells = <0>;
poll-interval = <20>;
reset {
label = "reset";
gpios = <&gpio0 1 1>;
linux,code = <0x198>;
};
};
};
2 changes: 2 additions & 0 deletions target/linux/ramips/image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,7 @@ Image/Build/Profile/WT3020=$(call BuildFirmware/PorayDualSize/$(1),$(1),wt3020,W
Image/Build/Profile/XIAOMI-MIWIFI-MINI=$(call BuildFirmware/Default16M/$(1),$(1),xiaomi-miwifi-mini,XIAOMI-MIWIFI-MINI)
Image/Build/Profile/ZTE-Q7=$(call BuildFirmware/Default8M/$(1),$(1),zte-q7,ZTE-Q7)
Image/Build/Profile/ZBT-WA05=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wa05,ZBT-WA05)
Image/Build/Profile/NETPROTECTION=$(call BuildFirmware/Default8M/$(1),$(1),netprotection,NETPROTECTION)
Image/Build/Profile/ArcherC20i=$(call BuildFirmware/Tplink/$(1),$(1),ArcherC20i,ArcherC20i)
microwrt_mtd_size=16515072
Image/Build/Profile/MicroWRT=$(call BuildFirmware/CustomFlash/$(1),$(1),microwrt,MicroWRT,$(microwrt_mtd_size))
Expand Down Expand Up @@ -913,6 +914,7 @@ define Image/Build/Profile/Default
$(call Image/Build/Profile/XIAOMI-MIWIFI-MINI,$(1))
$(call Image/Build/Profile/ZTE-Q7,$(1))
$(call Image/Build/Profile/ZBT-WA05,$(1))
$(call Image/Build/Profile/NETPROTECTION,$(1))
$(call Image/Build/Profile/ArcherC20i,$(1))
$(call Image/Build/Profile/MicroWRT,$(1))
endef
Expand Down
16 changes: 16 additions & 0 deletions target/linux/ramips/mt7620/profiles/netprotection.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

define Profile/NETPROTECTION
NAME:=Netprotection np-A105003201
PACKAGES:=boost-thread busybox confuse dnsmasq dropbear fstools iptables-mod-nfqueue kmod-gpio-button-hotplug kmod-ipt-nathelper kmod-leds-gpio kmod-ledtrig-usbdev kmod-rt2800-soc kmod-tun kmod-usb-dwc2 kmod-usb-ohci kmod-usb-printer kmod-usb-serial-option kmod-usb-uhci kmod-usb2 libiw libnetfilter-conntrack libnetfilter-queue libprotobuf-c libstdcpp libubox luasocket luci luci-app-ddns luci-app-diag-devinfo luci-app-qos luci-i18n-portuguese-brazilian maccalc miniupnpc miniupnpd mtd odhcp6c odhcpd opkg ppp ppp-mod-pppoe protobuf squid swconfig uci usb-modeswitch usbutils wpad-mini
endef

define Profile/NETPROTECTION/Description
Default package set for Netprotection np-A105003201
endef
$(eval $(call Profile,NETPROTECTION))