aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/base-files
diff options
context:
space:
mode:
authorJan Hoffmann <jan@3e8.eu>2022-07-23 22:53:19 +0200
committerDaniel Golle <daniel@makrotopia.org>2022-07-28 14:08:56 +0200
commitf2f09bc00280f5bd60b36d525a5e229550958b6d (patch)
treee3ce354690a33f4cec898d9063458371ba5d9fac /target/linux/realtek/base-files
parent5fcc6f0f19422c952db8bc4d72f324ead21232c6 (diff)
downloadupstream-f2f09bc00280f5bd60b36d525a5e229550958b6d.tar.gz
upstream-f2f09bc00280f5bd60b36d525a5e229550958b6d.tar.bz2
upstream-f2f09bc00280f5bd60b36d525a5e229550958b6d.zip
realtek: add support for HPE 1920 series
Hardware information: --------------------- - HPE 1920-8G: - RTL8380 SoC - 8 Gigabit RJ45 ports (built-in RTL8218B) - 2 SFP ports (built-in SerDes) - HPE 1920-16G / HPE 1920-24G (same board): - RTL8382 SoC - 16/24 Gigabit RJ45 ports (built-in RTL8218B, 1/2 external RTL8218D) - 4 SFP ports (external RTL8214FC) - Common: - RJ45 RS232 port on front panel - 32 MiB NOR Flash - 128 MiB DDR3 DRAM - PT7A7514 watchdog Booting initramfs image: ------------------------ - Prepare a FTP or TFTP server serving the OpenWrt initramfs image and connect the server to a switch port. - Connect to the console port of the device and enter the extended boot menu by typing Ctrl+B when prompted. - Choose the menu option "<3> Enter Ethernet SubMenu". - Set network parameters via the option "<5> Modify Ethernet Parameter". Enter the FTP/TFTP filename as "Load File Name" ("Target File Name" can be left blank, it is not required for booting from RAM). Note that the configuration is saved on flash, so it only needs to be done once. - Select "<1> Download Application Program To SDRAM And Run". Initial installation: --------------------- - Boot an initramfs image as described above, then use sysupgrade to install OpenWrt permanently. After initial installation, the bootloader needs to be configured to load the correct image file - Enter the extended boot menu again and choose "<4> File Control", then select "<2> Set Application File type". - Enter the number of the file "openwrt-kernel.bin" (should be 1), and use the option "<1> +Main" to select it as boot image. - Choose "<0> Exit To Main Menu" and then "<1> Boot System". NOTE: The bootloader on these devices can only boot from the VFS filesystem which normally spans most of the flash. With OpenWrt, only the first part of the firmware partition contains a valid filesystem, the rest is used for rootfs. As the bootloader does not know about this, you must not do any file operations in the bootloader, as this may corrupt the OpenWrt installation (selecting the boot image is an exception, as it only stores a flag in the bootloader data, but doesn't write to the filesystem). Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Diffstat (limited to 'target/linux/realtek/base-files')
-rw-r--r--target/linux/realtek/base-files/etc/board.d/02_network18
1 files changed, 15 insertions, 3 deletions
diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network
index af9db848dd..5356bcac65 100644
--- a/target/linux/realtek/base-files/etc/board.d/02_network
+++ b/target/linux/realtek/base-files/etc/board.d/02_network
@@ -22,9 +22,20 @@ ucidef_set_bridge_device switch
ucidef_set_interface_lan "$lan_list"
lan_mac=""
+lan_mac_start=""
lan_mac_end=""
label_mac=""
case $board in
+hpe,1920-8g|\
+hpe,1920-16g|\
+hpe,1920-24g)
+ label_mac=$(mtd_get_mac_binary factory 0x68)
+ lan_mac=$label_mac
+ mac_count1=$(hexdump -v -n 4 -s 0x110 -e '4 "%d"' $(find_mtd_part factory) 2>/dev/null)
+ mac_count2=$(hexdump -v -n 4 -s 0x114 -e '4 "%d"' $(find_mtd_part factory) 2>/dev/null)
+ lan_mac_start=$(macaddr_add $lan_mac 2)
+ lan_mac_end=$(macaddr_add $lan_mac $((mac_count2-mac_count1)))
+ ;;
*)
lan_mac=$(mtd_get_mac_ascii u-boot-env2 mac_start)
lan_mac_end=$(mtd_get_mac_ascii u-boot-env2 mac_end)
@@ -36,10 +47,11 @@ esac
ucidef_set_interface_macaddr "lan" $lan_mac
ucidef_set_bridge_mac "$lan_mac"
ucidef_set_network_device_mac eth0 $lan_mac
+[ -z "$lan_mac_start" ] && lan_mac_start=$lan_mac
for lan in $lan_list; do
- ucidef_set_network_device_mac $lan $lan_mac
- [ -z "$lan_mac_end" ] || [ "$lan_mac" == "$lan_mac_end" ] && lan_mac=$(macaddr_setbit_la $lan_mac)
- lan_mac=$(macaddr_add $lan_mac 1)
+ ucidef_set_network_device_mac $lan $lan_mac_start
+ [ -z "$lan_mac_end" ] || [ "$lan_mac_start" == "$lan_mac_end" ] && lan_mac_start=$(macaddr_setbit_la $lan_mac_start)
+ lan_mac_start=$(macaddr_add $lan_mac_start 1)
done
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac