Skip to content

Commit

Permalink
Add support for Netgear R9000 Nighthawk X10 and XR700
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Egorenkov <[email protected]>
  • Loading branch information
egorenar committed Oct 12, 2024
1 parent 3d7040b commit 7980e7b
Show file tree
Hide file tree
Showing 190 changed files with 76,266 additions and 0 deletions.
26 changes: 26 additions & 0 deletions package/boot/uboot-envtools/files/alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
#
# Copyright (C) 2016 LEDE
#

[ -e /etc/config/ubootenv ] && exit 0

touch /etc/config/ubootenv

. /lib/uboot-envtools.sh
. /lib/functions.sh

board=$(board_name)

case "$board" in
netgear,r9000|\
netgear,xr700)
ubootenv_add_uci_config "/dev/mtd1" "0x00000" "0x4000" "0x20000"
ubootenv_add_uci_config "/dev/mtd1" "0x20000" "0x4000" "0x20000"
;;
esac

config_load ubootenv
config_foreach ubootenv_add_app_config ubootenv

exit 0
16 changes: 16 additions & 0 deletions package/kernel/linux/modules/crypto.mk
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,22 @@ endef
$(eval $(call KernelPackage,crypto-hmac))


define KernelPackage/crypto-hw-alpine
TITLE:=Alpine hardware crypto module
DEPENDS:=+kmod-crypto-manager
KCONFIG:= \
CONFIG_CRYPTO_HW=y \
CONFIG_CRYPTO_DEV_AL_CRYPTO \
CONFIG_CRYPTO_DEV_AL_CRYPTO_STATS \
CONFIG_CRYPTO_DEV_AL_AHASH_CRC
FILES:=$(LINUX_DIR)/drivers/crypto/al/al_crypto.ko
AUTOLOAD:=$(call AutoLoad,09,al_crypto)
$(call AddDepends/crypto)
endef

$(eval $(call KernelPackage,crypto-hw-alpine))


define KernelPackage/crypto-hw-ccp
TITLE:=AMD Cryptographic Coprocessor
DEPENDS:= \
Expand Down
34 changes: 34 additions & 0 deletions package/kernel/linux/modules/netdevices.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1964,3 +1964,37 @@ define KernelPackage/amazon-ena/description
endef

$(eval $(call KernelPackage,amazon-ena))

define KernelPackage/mdio-al-gpio
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Alpine MDIO GPIO bus controller
DEPENDS:=@TARGET_alpine +kmod-mdio
KCONFIG:=CONFIG_MDIO_AL_GPIO
FILES:=$(LINUX_DIR)/drivers/net/mdio/mdio-al-gpio.ko
AUTOLOAD:=$(call AutoLoad,11,mdio-al-gpio,1)
endef

define KernelPackage/mdio-gpio/description
Supports Alpine MDIO GPIO bus controller
endef

$(eval $(call KernelPackage,mdio-al-gpio))

define KernelPackage/al-eth
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Annapurna Labs unified 1G/10G Ethernet driver
DEPENDS:=@PCI_SUPPORT @TARGET_alpine +kmod-mdio
KCONFIG:= \
CONFIG_NET_AL_ETH \
CONFIG_AL_ETH_ALLOC_FRAG=y \
CONFIG_AL_ETH_ALLOC_PAGE=n \
CONFIG_AL_ETH_ALLOC_SKB=n
FILES:=$(LINUX_DIR)/drivers/net/ethernet/al/al_eth_drv.ko
AUTOLOAD:=$(call AutoLoad,10,al-eth-drv,1)
endef

define KernelPackage/al-eth/description
Kernel modules for Annapurna Labs unified 1G/10G Ethernet driver
endef

$(eval $(call KernelPackage,al-eth))
29 changes: 29 additions & 0 deletions target/linux/alpine/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) 2013 The Linux Foundation. All rights reserved.
#
include $(TOPDIR)/rules.mk

ARCH:=arm
BOARD:=alpine
BOARDNAME:=Annapurna Labs Alpine
FEATURES:=squashfs nand fpu ramdisk usb pci pcie
CPU_TYPE:=cortex-a15
CPU_SUBTYPE:=neon-vfpv4
SUBTARGETS:=generic

KERNEL_PATCHVER:=6.6

KERNELNAME:=zImage Image dtbs

include $(INCLUDE_DIR)/target.mk

DEFAULT_PACKAGES += \
kmod-leds-gpio kmod-gpio-button-hotplug swconfig \
kmod-ata-ahci kmod-ata-ahci-platform \
kmod-usb-ohci kmod-usb-ohci-pci kmod-usb2 kmod-usb2-pci kmod-usb3 kmod-usb-ledtrig-usbport \
kmod-ath10k-ct ath10k-firmware-qca9984-ct kmod-wil6210 \
kmod-usb-storage kmod-scsi-core kmod-fs-ext4 kmod-fs-btrfs kmod-fs-vfat kmod-fs-msdos block-mount \
kmod-al-eth kmod-mdio-al-gpio \
cfdisk e2fsprogs badblocks partx-utils \
wpad-openssl uboot-envtools

$(eval $(call BuildTarget))
47 changes: 47 additions & 0 deletions target/linux/alpine/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
# Copyright (c) 2011-2015 OpenWrt.org
#

. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh

board_config_update

board=$(board_name)

#
# Switch configuration
#
# There are two switches: master (switch0) and slave (switch1).
#
# Ports P0 and P5 of the master switch are connected to the CPU ports
# ETH1 and ETH2, respectively. ETH1 shall be used for LAN and ETH2 for WAN.
#
# Port P3 of the master switch is the WAN port. VLAN2 is set up
# to isolate P3 and P5 of the master switch from LAN ports of
# both the master and the slave switch.
#
# All ports of the master switch except P3 and P5 are assigned to VLAN1.
#
# All ports of the slave switch are assigned to VLAN1. Port P6 of the slave
# switch is unused and idle.
#

case "$board" in
netgear,r9000|\
netgear,xr700)
ucidef_set_interfaces_lan_wan "eth1.1" "eth2.2"
ucidef_add_switch "switch0" \
"0t@eth1" "1:lan" "2:lan" "4:lan" "6:lan" "3:wan" "5t@eth2"
ucidef_add_switch "switch1" \
"6t@eth1" "0:lan" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
;;
*)
echo "Unsupported hardware. Network interfaces not intialized"
;;
esac

board_config_flush

exit 0
54 changes: 54 additions & 0 deletions target/linux/alpine/base-files/etc/uci-defaults/xx_customizations
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

wifi_key=$(uci -q get wireless.@wifi-iface[1].key)
if [ -z "$wifi_key" ]; then
uci set wireless.@wifi-iface[1].ssid='home_network'
uci set wireless.@wifi-iface[1].encryption=psk2
uci set wireless.@wifi-iface[1].key='secret'

uci set wireless.@wifi-device[1].country=US
uci set wireless.@wifi-device[1].channel=auto
uci set wireless.@wifi-device[1].disabled='0'

uci commit wireless
fi

exit 0

uci set system.@system[0].hostname='OpenWrt-dev'
uci commit system

#
# IP address
#

uci set network.lan.ipaddr=192.168.2.1
uci commit network

#
# SSH
#

if [ $(uci -q get dropbear.@dropbear[0].Port) = "22" ]; then
uci set dropbear.@dropbear[0].Port='2222'
uci commit dropbear
service dropbear restart

sed -i -e '/ListenAddress/d' /etc/ssh/sshd_config
sed -i -e '/PasswordAuthentication/d' /etc/ssh/sshd_config
sed -i -e '/PermitEmptyPasswords/d' /etc/ssh/sshd_config
sed -i -e '/PermitRootLogin/d' /etc/ssh/sshd_config
sed -i -e '/UsePAM/d' /etc/ssh/sshd_config

cat >>/etc/ssh/sshd_config <<EOF
ListenAddress 192.168.2.1
PasswordAuthentication yes
PermitEmptyPasswords yes
PermitRootLogin yes
UsePAM no
EOF

service sshd enable
service sshd restart

passwd -d root
fi
20 changes: 20 additions & 0 deletions target/linux/alpine/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
REQUIRE_IMAGE_METADATA=1

RAMFS_COPY_BIN='fw_printenv fw_setenv'
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'

platform_check_image() {
return 0;
}

platform_do_upgrade() {
case "$(board_name)" in
netgear,r9000|\
netgear,xr700)
nand_do_upgrade "$1"
;;
*)
default_do_upgrade "$1"
;;
esac
}
Loading

0 comments on commit 7980e7b

Please sign in to comment.