summaryrefslogtreecommitdiffstats
path: root/target/linux/apm821xx/base-files/lib/upgrade/platform.sh
Commit message (Collapse)AuthorAgeFilesLines
* treewide: remove empty default casesAdrian Schmutzler2020-09-171-3/+0
| | | | | | There is no apparent reason to have an empty default case. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: drop shebang from non-executable target filesAdrian Schmutzler2020-06-161-2/+0
| | | | | | | | | | | | | | This drops the shebang from all target files for /lib and /etc/uci-defaults folders, as these are sourced and the shebang is useless. While at it, fix the executable flag on a few of these files. This does not touch ar71xx, as this target is just used for backporting now and applying cosmetic changes would just complicate things. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: sysupgrade: don't use $ARGV in platform_do_upgrade()Rafał Miłecki2019-07-171-2/+2
| | | | | | | stage2 passes image path to platform_do_upgrade() as an argument so it can be simply accessed using $1 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* apm821xx: add support for the Netgear WNDAP620 and WNDAP660Christian Lamparter2018-11-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the Netgear WNDAP620 and WNDAP660, they are similar devices, but due to the LAN LED configuration, the switch setup and WIFI configuration each gets a different device target. Hardware Highlights WNDAP620: CPU: AMCC PowerPC APM82181 at 1000 MHz DRAM: 128 MB, 2 x 64 MiB DDR2 Hynix H5PS5162GF CPU: AMCC PowerPC APM82181 at 1000 MHz FLASH: 32 MiB, NAND SLC, Hynix HY27US08561A Ethernet: RealTek RTL8363SB 2x2-Port Switch PHY - Only 1 GBit Port (POE) Wifi: Atheros AR9380 minipcie - Dual-Band - 3x3:3 Serial: console port with RJ45 Interface (9600-N-8-1) LEDS: Power, LAN-Activity, dual color LAN-Linkspeed, 2.4GHz, 5GHz LEDs Button: Soft Reset Button Antennae: 3 internal dual-band antennae + 3 x RSMA for external antennaes Hardware Highlights WNDAP660: CPU: AMCC PowerPC APM82181 at 1000 MHz + 2 Heatsinks DRAM: 256 MB, 2 x 128 MiB DDR2 FLASH: 32 MiB, NAND SLC, Hynix HY27US08561A Ethernet: RealTek RTL8363SB 2x2-Port Switch PHY (POE) Wifi1: Atheros AR9380 minipcie - Dual-Band - 3x3:3 Wifi2: Atheros AR9380 minipcie - Dual-Band - 3x3:3 Serial: console port with RJ45 Interface (9600-N-8-1) LEDS: Power, LAN-Activity, 2x dual color LAN-Linkspeed, 2.4GHz, 5GHz LEDs Button: Soft Reset Button Antennae: 6 internal dual-band antennae + 3 x RSMA for external antennaes Flashing requirements: - needs a tftp server at 192.168.1.10/serverip. - special 8P8C(aka RJ45)<->D-SUB9 Console Cable ("Cisco Console Cable"). Note: Both WNDAP6x0 have a MAX3232 transceivers, hence no need for any separate CMOS/TTL level shifters. External Antenna: The antennae mux is controlled by GPIO 11 and GPIO14. Valid Configurations: = Config# = | = GPIO 11 = | = GPIO 14 = | ===== Description ===== 1. | 1 / High | 0 / Low | Use the internal antennae (default) 2. | 0 / Low | 1 / High | Use the external antennae The external antennaes are only meant for the 2.4 GHz band. One-way Flashing instructions via u-boot: 0. connect the serial cable to the RJ45 Console Port Note: This requires a poper RS232 and not a TTL/USB adaptor. 1. power up the AP and interrupt the u-boot process at 'Hit any key to stop autoboot' 2. setup serverip and ipaddr env settings Enter the following commands into the u-boot shell # setenv ipaddr 192.168.1.1 # setenv serverip 192.168.1.10 3. download the factory.img image to the AP Enter the following commands into the u-boot shell # tftp ${kernel_addr_r} openwrt-apm821xx-nand-netgear_wndap660-squashfs-factory.img 4. verfiy image integrity Enter the following commands into the u-boot shell # crc32 $fileaddr $filesize If the calculated crc32 checksum does not match, go back to step 3. 5. flash the image Enter the following commands into the u-boot shell # nand erase 0x110000 0x1bd0000 # nand write ${kernel_addr_r} 0x110000 ${filesize} 6. setup uboot environment Enter the following commands into the u-boot shell # setenv bootargs # setenv fileaddr # setenv filesize # setenv addroot 'setenv bootargs ${bootargs} root=/dev/ubiblock0_0' # setenv owrt_boot 'nboot ${kernel_addr_r} nand0 0x110000; run addroot; run addtty; bootm ${kernel_addr_r}' # setenv bootcmd 'run owrt_boot' # saveenv 7. boot # run bootcmd Booting initramfs instructions via u-boot: Follow steps 0 - 2 from above. 3. boot initramfs Enter the following commands into the u-boot shell # tftp ${kernel_addr_r} openwrt-apm821xx-nand-netgear_wndap660-initramfs-kernel.bin # run addtty # bootm ${kernel_addr_r} Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* apm821xx: remove wd, mybooklive-duo leftoversChristian Lamparter2018-09-291-4/+2
| | | | | | | | | The unification of the My Book Live Single and duo image in commit 9b47aa93c76b ("apm821xx: unify My Book Live Single + Duo images") made the wd,mybooklive-duo obsolete in most places and can be removed. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* treewide: move nand_do_upgrade call to platform_do_upgradeMathias Kresin2018-02-161-16/+5
| | | | | | | | | | Calling nand_do_upgrade() from platform_pre_upgrade() was deprecated with 30f61a34b4cf ("base-files: always use staged sysupgrade"). Update the platform upgrade code to use platform_do_upgrade() for NAND images as well. Signed-off-by: Mathias Kresin <dev@kresin.me>
* treewide: remove obsolete sysupgrade watchdog killMathias Kresin2018-02-161-10/+0
| | | | | | | | | The watchdog kill command was meant for busybox watchdog. Busybox watchdog was replaced by the procd watchdog mid 2013 with commit df7ce9301a25 ("busybox: disable the watchdog utility by default"), which makes the kill command obsolete since quite some time. Signed-off-by: Mathias Kresin <dev@kresin.me>
* apm821xx: convert to device-tree board detectionChristian Lamparter2017-12-211-6/+9
| | | | | | | | | | | | | This patch converts all apm821xx devices to the device-tree board-detection method. All instances of the legacy boardnames (mbl,mr24,...) are converted to "vendor,device" identifier. The custom board-detection code in apm821xx.sh is removed as it no longer serves any purpose. Signed-off-by: Mathias Kresin <dev@kresin.me> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* apm821xx: enable metadata for packagingChristian Lamparter2017-12-211-21/+3
| | | | | | | | | | This patch enables metadata-supported image verification for all apm821xx supported devices. Since this method comes with a built-in image verification tool (fwtool), the previous image checks can be removed. Signed-off-by: Mathias Kresin <dev@kresin.me> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* apm821xx: use x86's upgrade scripts for MyBook LiveChristian Lamparter2017-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Advantages: - preserves existing partition layout. On the hard-drive. Only the boot and rootfs partition will be overwritten. Disadvantages: - The upgrade process takes much longer to run. from 2-3 seconds to 15-25 seconds. Please note that sysupgrade will refuse to upgrade, if the existing installation has an incompatible partition layout. Future changes to the bootfs and/or rootfs partition size will likely cause breakage to the sysupgrade procedure. In these cases, the ext4-rootfs.img.gz has to be written manually onto the disk. Please don't forget to backup your configuration in this cases. Note2: This patch requires "base-files: upgrade: make get_partitions() endian agnostic" Note3: If your current installation does not host the two changes, sysupgrading will wipe the existing partition layout. Don't forget to backup your data! Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* treewide: use the generic board_name functionMathias Kresin2017-07-151-7/+4
| | | | | | Use the generic function instead ot the target specific ones. Signed-off-by: Mathias Kresin <dev@kresin.me>
* apm821xx: Add support for the Cisco Meraki MX60/MX60WChris Blake2016-11-211-2/+4
| | | | | | | | | | | | | | | | | | | This patch adds support for the Cisco Meraki MX60/MX60W Security Appliance. Flashing information can be found at https://github.com/riptidewave93/LEDE-MX60 Specs are as follows: AppliedMicro APM82181 SoC at 800MHz 1GiB NAND - Samsung K9K8G08U0D 512MB DDR RAM - 4x Nanya NT5TU128M8GE-AC Atheros AR8327-BL1A Gigabit Ethernet Switch 1x USB 2.0 Port More info can be found at https://wiki.openwrt.org/toh/meraki/mx60 Cc: Christian Lamparter <chunkeey@gmail.com> Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
* apm821xx: add support for the Netgear Centria N900 WNDR4700/WNDR4720Christian Lamparter2016-07-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Netgear Centria N900 WNDR4700/WNDR4720 hardware highlights: CPU: AMCC PowerPC APM82181 Rev. E at 1000 MHz (PLB=166, OPB=83, EBC=83 MHz) Security support, Boot ROM Location NAND wo/ECC 2k page (8 bits) 32 kB I-Cache 32 kB D-Cache, 256 kB L2-Cache, 32 kB OnChip Memory Board: AMCC APM82181 Evaluation Board, PCIE0/SATA1, 1*USB OTG DRAM: 256 MB (ECC not enabled, 500 Mb/s, 32-bit, CL3) NAND: 128 MiB (SLC, erase size: 128 KiB, page size: 2048, OOB size: 64) ETH: Atheros AR8327N Gigabit Switch (4 x LAN, 1 x WAN) USB: 2 x 3.0 (Renesas uPD720202K8-711-BAA-A, firmware not included) SATA: 1 x SATA-II 3.5" Hard Drive Bay for HDDs (DesignWare SATA). WLAN1: Atheros AR9380 5GHz 802.11an 3:3x3 WLAN2: Atheros AR9581 2.4GHz 802.11bgn 3:3x3 SDCARD: GL827L SD/MMC/MS Flash Card Reader (on internal dwc2 USB 2.0 host) I2C: GMT G781 (i2c-0 @ 0x4d - lm90 compatible temperature sensor) TC654 (i2c-0 @ 0x1b - Dual PWM fan Speed controller) WARNING: The serial port needs a TTL/RS-232 v3.3 level converter! INFO: Since this device only has a NAND chip. I opted for going with root.squashfs in a UBI volume. There's no squashfs/jffs2 image. This target produces three images. a. netgear factory image This image can be used to flash the Netgear WNDR4700 via the firmware recovery mechanism and the web admin site. The bootloader can be instructed to do a firmware recovery via the # fw_recovery command. It will start a tftp server and listen on 192.168.1.1 (the ipaddr variable in u-boot) for incoming, binary tftp clients. The firmware recovery mechanism is also started if any of the flash content which contains the kernel, device-tree definitions or the (fake)rootfs fails to verify or load. b. sysupgrade.tar image for sysupgrade An sysupgrade will replace the entire current LEDE installation with a newer version. This does include the kernel and the ubi rootfs partition. The configuration can be carried over automatically as well if desired. simply copy the sysupgrade.tar to a the WNDR4700 running LEDE and run: root@lede:~# sysupgrade sysupgrade.tar and let it reboot. Note: The devicetree flash area is NOT updated. Until the devicetree definition is stable, this can lead to all sorts of hardware detection problems! So make sure, if you experience issues: try the fw_recovery. If you are unsure whenever this affects you: test if you can reproduce your issue with the initramfs method. As it will always have up-to-date device-tree definitions. c. initramfs image for TFTP (for development and testing) To use the initramfs method, follow the following steps: 1) Move the "lede-apm821xx-netgear-WNDR4700-initramfs-kernel.bin" file to to the root directory of your TFTP server. 2) rename it to wndr4700.bin 3) On the WNDR4700 - Hit Enter during u-boot and insert: # tftp 400000 wndr4700.bin; run addtty; bootm 400000 - This will boot the LEDE image. Note: The default tftp server is 192.168.1.7, if you want to change it: # setenv serverip 192.168.8.7; Note2: The default address for the WNDR4700 is 192.168.1.1: # setenv ipaddr 192.168.8.8; Note: Connect you tftp server on the last LAN port (not the WAN) Note: The firmware for the USB 3.0 Host chip is not included anymore. Therefore the two USB 3.0 ports will not work without the uPD7070x-firmware package installed. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* apm821xx: add support for the Western Digital MyBook Live SeriesChristian Lamparter2016-07-221-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware Highlights: This patch adds support for Western Digital MyBook Live Series: CPU: AMCC PowerPC UNKNOWN (PVR=12c41c83) at 800 MHz (PLB=200, OPB=100, EBC=100 MHz) 32 kB I-Cache 32 kB D-Cache, 256 kB L2-Cache, 32 kB OnChip Memory Board: Apollo-3G - APM82181 Board, 1*SATA DRAM: 256 MB (2x NT5TU64M16GG-AC) FLASH: 512 kB (SST 39VF040) Ethernet: 1xRGMII - 1 Gbit - Broadcom PHY BCM54610 WARNING: The serial port needs a TTL/RS-232 v3.3 level converter! The MyBook Live Duo additionally features a 1x USB 2.0 host port and can support a second hard-drive. This target produces two images for a target. 1. ext4 image The extracted/raw image can be directly installed on the internal HDD via "dd if=img.ext4 of=/dev/sdX". This can either be done in place with the stock MyBook Live firmware via ssh. Or by removing the HDD and writing the image with a different PC. The the compressed images are useful for sysupgrade. 2. recovery.tar image for TFTP and Serial. extract the recovery.tar to a TFTP server directory. On the MyBook Live (Duo) serial port - Hit Enter during u-boot and insert: # setenv serverip 192.168.1.254; setenv ipaddr 192.168.1.1; run net_self Where 192.168.1.254 is your TFTP server. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* apm821xx: add support for the Cisco Meraki MR24Chris Blake2016-07-221-0/+9
| | | | | | | | | | | | | | | | | | | This patch adds support for the Cisco Meraki MR24 Access point to the apm821xx target. Board: MR24 - Meraki MR24 Cloud Managed Access Point CPU: APM82181 SoC 800 MHz (PLB=200 OPB=100 EBC=100) Flash size: 32MiB RAM Size: 128MiB Wireless: Atheros AR9380 5.0GHz + Atheros AR9380 2.4GHz Ethernet ports: 1x Gigabit Atheros AR8035 WARNING: The serial port needs a TTL/RS-232 v3.3 level converter! For flashing instructions, visit: <https://github.com/riptidewave93/Openwrt-MR24/blob/master/README.md#flashing> Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
* apm821xx: add support for the apm821xx device targetChris Blake2016-07-221-0/+58
This adds a new target for PowerPC APM82181 and APM82161 (464-based) boards, as well as adds support for the booke-wdt watchdog package. Signed-off-by: Chris Blake <chrisrblake93@gmail.com>