openwrtv4/target/linux/ipq806x/base-files/lib/upgrade/platform.sh

60 lines
946 B
Bash
Raw Normal View History

. /lib/ipq806x.sh
PART_NAME=firmware
REQUIRE_IMAGE_METADATA=1
RAMFS_COPY_BIN='/usr/sbin/fw_printenv /usr/sbin/fw_setenv'
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
platform_check_image() {
return 0;
}
platform_do_upgrade() {
local board=$(ipq806x_board_name)
case "$board" in
ap148 |\
ap-dk04.1-c1 |\
d7800 |\
nbg6817 |\
r7500 |\
r7500v2 |\
r7800)
nand_do_upgrade "$ARGV"
;;
c2600)
PART_NAME="os-image:rootfs"
MTD_CONFIG_ARGS="-s 0x200000"
default_do_upgrade "$ARGV"
;;
ea8500)
platform_do_upgrade_linksys "$ARGV"
;;
vr2600v)
PART_NAME="kernel:rootfs"
MTD_CONFIG_ARGS="-s 0x200000"
default_do_upgrade "$ARGV"
;;
ipq806x: add ipq4019 fritz4040 support This patch adds support for AVM FRITZ!Box 4040. hardware highlights: SOC: IPQ4018 / QCA Dakota CPU: Quad-Core ARMv7 Processor rev 5 (v7l) Cortex-A7 DRAM: 256 MiB Nanya NT5CC128M16IP FLASH: 32 MiB MXIC MX25L25635FMI ETH: Qualcomm Atheros QCA8075 Gigabit Switch (4 x LAN, 1 x WAN) USB: 1 x 3.0 (via Synopsys DesignWare DWC3 controller in the SoC) 1 x 2.0 (via Synopsys DesignWare DWC3 controller in the SoC) WLAN1: Qualcomm Atheros QCA4018 2.4GHz 802.11bgn 2:2x2 WLAN2: Qualcomm Atheros QCA4018 5GHz 802.11a/n/ac 2:2x2 INPUT: one WLAN and one WPS button LEDS: Power, WAN/Internet, WIFI, INFO (red and amber) and LAN. Serial: WARNING: The serial port needs a TTL/RS-232 v3.3 level converter! The Serial setting is 115200-8-N-1. The SoC's serial port is right next to the MXIC FLASH chip. The board has a unpopulated 1x4 0.1" header for it. Use a multimeter to figure out the pinout! This board currently needs an additional u-boot image in order to boot properly. Booting with EVA isn't possible ATM. Install Procedure: 0. It's highly recommended to connect to the serial port. The serial settings are listed above. 1. install a u-boot image for AVM Fritz!Box 4040 (see <https://github.com/chunkeey/FritzBox-4040-UBOOT/releases> and <https://github.com/chunkeey/FritzBox-4040-UBOOT/blob/master/upload-to-f4040.sh>) 2. upload the initramfs.itb image via tftp (u-boot listens to 192.168.1.1 - use binary transfer mode!) 3. connect to the FB4040 and use sysupgrade sysupgrade.bin to install the image. Works: - Switch and Ethernet (99%) - Buttons (WLAN, WPS) - FLASH (1 x 32MiB NOR Chip) - WLAN2G and WLAN5G - CPUFREQ scaling - PRNG - serial - Crypto Accelerator - sysupgrade (Read the flash instructions to avoid bricking) - full LEDE Install (Read the flash instructions to avoid bricking) - LEDs (Power, WAN, Info (red and amber), LAN) The LEDs are connected to the QCA8075 LED ports. The AR40xx driver contains a gpio-controller to handle these special "GPIOs". - USB Both 3.0 and 2.0 ports - many packages from other ARMv7 boards (This does include the RaspberryPi Model 2!) - ... Not planned: - WAN<->LAN short-cut - Qualcomm Secure Execution Environment - ... Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John Crispin <john@phrozen.org>
2017-03-14 16:04:28 +00:00
*)
default_do_upgrade "$ARGV"
;;
esac
}
platform_nand_pre_upgrade() {
local board=$(ipq806x_board_name)
case "$board" in
nbg6817)
zyxel_do_upgrade "$1"
;;
esac
}
blink_led() {
. /etc/diag.sh; set_state upgrade
}
append sysupgrade_pre_upgrade blink_led