mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 07:22:33 +00:00
01e2184c49
Add support for the TP-Link SG2210P switch. This is an RTL8380 based switch with eight RJ-45 ports with 802.3af PoE, and two SFP ports. This device shares the same board with the SG2008P and SG2008. To model this, declare all the capabilities in the sg2xxx dtsi, and disable unpopulated on the lower end models. Specifications: --------------- - SoC: Realtek RTL8380M - Flash: 32 MiB SPI flash (Vendor varies) - RAM: 256 MiB (Vendor varies) - Ethernet: 8x 10/100/1000 Mbps with PoE (all ports) 2x SFP ports - Buttons: 1x "Reset" button on front panel - Power: 53.5V DC barrel jack - UART: 1x serial header, unpopulated - PoE: 2x TI TPS23861 I2C PoE controller Works: ------ - (8) RJ-45 ethernet ports - (2) SFP ports (with caveats) - Switch functions - System LED Not yet enabled: ---------------- - Power-over-Ethernet (driver works, but doesn't enable "auto" mode) - PoE LEDs Enabling SFP ports: ------------------- The SFP port control lines are hardwired, except for tx-disable. These lines are controller by the RTL8231 in shift register mode. There is no driver support for this yet. However, to enable the lasers on SFP1 and SFP2 respectively: echo 0x0510ff00 > /sys/kernel/debug/rtl838x/led/led_p_en_ctrl echo 0x140 > /sys/kernel/debug/rtl838x/led/led_sw_p_ctrl.26 echo 0x140 > /sys/kernel/debug/rtl838x/led/led_sw_p_ctrl.24 Install via serial console/tftp: -------------------------------- The footprints R27 (0201) and R28 (0402) are not populated. To enable serial console, 50 ohm resistors should be soldered -- any value from 0 ohm to 50 ohm will work. R27 can be replaced by a solder bridge. The u-boot firmware drops to a TP-Link specific "BOOTUTIL" shell at 38400 baud. There is no known way to exit out of this shell, and no way to do anything useful. Ideally, one would trick the bootloader into flashing the sysupgrade image first. However, if the image exceeds 6MiB in size, it will not work. The sysupgrade image can also be flashed. To install OpenWrt: Prepare a tftp server with: 1. server address: 192.168.0.146 2. the image as: "uImage.img" Power on device, and stop boot by pressing any key. Once the shell is active: 1. Ground out the CLK (pin 16) of the ROM (U7) 2. Select option "3. Start" 3. Bootloader notes that "The kernel has been damaged!" 4. Release CLK as sson as bootloader thinks image is corrupted. 5. Bootloader enters automatic recovery -- details printed on console 6. Watch as the bootloader flashes and boots OpenWrt. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> [OpenWrt capitalisation in commit message] Signed-off-by: Sander Vanheule <sander@svanheule.net>
61 lines
1.5 KiB
Plaintext
61 lines
1.5 KiB
Plaintext
[ -e /etc/config/ubootenv ] && exit 0
|
|
|
|
touch /etc/config/ubootenv
|
|
|
|
. /lib/uboot-envtools.sh
|
|
. /lib/functions.sh
|
|
|
|
board=$(board_name)
|
|
|
|
case "$board" in
|
|
d-link,dgs-1210-10mp|\
|
|
d-link,dgs-1210-10p|\
|
|
d-link,dgs-1210-16|\
|
|
d-link,dgs-1210-20|\
|
|
d-link,dgs-1210-28|\
|
|
zyxel,gs1900-8|\
|
|
zyxel,gs1900-8hp-v1|\
|
|
zyxel,gs1900-8hp-v2|\
|
|
zyxel,gs1900-10hp|\
|
|
zyxel,gs1900-16|\
|
|
zyxel,gs1900-24-v1|\
|
|
zyxel,gs1900-24e|\
|
|
zyxel,gs1900-24hp-v1|\
|
|
zyxel,gs1900-24hp-v2)
|
|
idx="$(find_mtd_index u-boot-env)"
|
|
[ -n "$idx" ] && \
|
|
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x400" "0x10000"
|
|
idx2="$(find_mtd_index u-boot-env2)"
|
|
[ -n "$idx2" ] && \
|
|
ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x1000" "0x10000"
|
|
;;
|
|
tplink,sg2008p-v1|\
|
|
tplink,sg2210p-v3|\
|
|
tplink,sg2452p-v4)
|
|
idx="$(find_mtd_index u-boot-env)"
|
|
[ -n "$idx" ] && \
|
|
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x20000" "0x10000"
|
|
;;
|
|
iodata,bsh-g24mb)
|
|
idx="$(find_mtd_index u-boot-env)"
|
|
[ -n "$idx" ] && \
|
|
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
|
|
idx2="$(find_mtd_index u-boot-env2)"
|
|
[ -n "$idx2" ] && \
|
|
ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x3800" "0x10000"
|
|
;;
|
|
*)
|
|
idx="$(find_mtd_index u-boot-env)"
|
|
[ -n "$idx" ] && \
|
|
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
|
|
idx2="$(find_mtd_index u-boot-env2)"
|
|
[ -n "$idx2" ] && \
|
|
ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x1000" "0x10000"
|
|
;;
|
|
esac
|
|
|
|
config_load ubootenv
|
|
config_foreach ubootenv_add_app_config
|
|
|
|
exit 0
|