2017-09-11 13:27:53 +00:00
|
|
|
#!/bin/sh
|
2012-11-14 14:18:33 +00:00
|
|
|
#
|
2011-12-01 22:49:03 +00:00
|
|
|
# Copyright (C) 2011 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
usage() {
|
ipq40xx: add support for Plasma Cloud PA2200
Device specifications:
* QCA IPQ4019
* 256 MB of RAM
* 32 MB of SPI NOR flash (w25q256)
- 2x 15 MB available; but one of the 15 MB regions is the recovery image
* 2T2R 2.4 GHz
- QCA4019 hw1.0 (SoC)
- requires special BDF in QCA4019/hw1.0/board-2.bin with
bus=ahb,bmi-chip-id=0,bmi-board-id=20,variant=PlasmaCloud-PA2200
* 2T2R 5 GHz (channel 36-64)
- QCA9888 hw2.0 (PCI)
- requires special BDF in QCA9888/hw2.0/board-2.bin
bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=PlasmaCloud-PA2200
* 2T2R 5 GHz (channel 100-165)
- QCA4019 hw1.0 (SoC)
- requires special BDF in QCA4019/hw1.0/board-2.bin with
bus=ahb,bmi-chip-id=0,bmi-board-id=21,variant=PlasmaCloud-PA2200
* GPIO-LEDs for 2.4GHz, 5GHz-SoC and 5GHz-PCIE
* GPIO-LEDs for power (orange) and status (blue)
* 1x GPIO-button (reset)
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 2x gigabit ethernet
- phy@mdio3:
+ Label: Ethernet 1
+ gmac0 (ethaddr) in original firmware
+ used as LAN interface
- phy@mdio4:
+ Label: Ethernet 2
+ gmac1 (eth1addr) in original firmware
+ 802.3at POE+
+ used as WAN interface
* 12V 2A DC
Flashing instructions:
The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the factory image to the u-boot when the device boots up.
Signed-off-by: Marek Lindner <marek.lindner@kaiwoo.ai>
[sven@narfation.org: prepare commit message, rebase, use all LEDs, switch
to dualboot_datachk upgrade script, use eth1 as designated WAN interface]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-12-14 15:46:53 +00:00
|
|
|
echo "Usage: $0 <OM2P|OM5P|OM5PAC|MR600|MR900|MR1750|A60|A42|A62|PA300|PA1200|PA2200> <out file path> <kernel path> <rootfs path>"
|
2011-12-01 22:49:03 +00:00
|
|
|
rm -f $CFG_OUT
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2012-11-18 09:32:36 +00:00
|
|
|
[ "$#" -lt 4 ] && usage
|
|
|
|
|
|
|
|
CE_TYPE=$1
|
|
|
|
CFG_OUT=$2
|
|
|
|
KERNEL_PATH=$3
|
|
|
|
ROOTFS_PATH=$4
|
|
|
|
|
|
|
|
case $CE_TYPE in
|
2020-11-23 12:41:34 +00:00
|
|
|
PA300|\
|
2012-11-18 09:32:36 +00:00
|
|
|
OM2P)
|
|
|
|
MAX_PART_SIZE=7168
|
|
|
|
KERNEL_FLASH_ADDR=0x1c0000
|
2017-11-30 13:30:06 +00:00
|
|
|
SIZE_FACTOR=1
|
|
|
|
SIZE_FORMAT="%d"
|
2012-11-18 09:32:36 +00:00
|
|
|
;;
|
2016-08-09 14:08:01 +00:00
|
|
|
OM5P|OM5PAC|MR600|MR900|MR1750|A60)
|
2012-11-18 09:32:36 +00:00
|
|
|
MAX_PART_SIZE=7808
|
|
|
|
KERNEL_FLASH_ADDR=0xb0000
|
2017-11-30 13:30:06 +00:00
|
|
|
SIZE_FACTOR=1
|
|
|
|
SIZE_FORMAT="%d"
|
|
|
|
;;
|
ipq40xx: add support for Plasma Cloud PA1200
Device specifications:
* QCA IPQ4018
* 256 MB of RAM
* 32 MB of SPI NOR flash (w25q256)
- 2x 15 MB available; but one of the 15 MB regions is the recovery image
* 2T2R 2.4 GHz
- QCA4019 hw1.0 (SoC)
- requires special BDF in QCA4019/hw1.0/board-2.bin with
bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=PlasmaCloud-PA1200
* 2T2R 5 GHz
- QCA4019 hw1.0 (SoC)
- requires special BDF in QCA4019/hw1.0/board-2.bin with
bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=PlasmaCloud-PA1200
* 3x GPIO-LEDs for status (cyan, purple, yellow)
* 1x GPIO-button (reset)
* 1x USB (xHCI)
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 2x gigabit ethernet
- phy@mdio4:
+ Label: Ethernet 1
+ gmac0 (ethaddr) in original firmware
+ used as LAN interface
- phy@mdio3:
+ Label: Ethernet 2
+ gmac1 (eth1addr) in original firmware
+ 802.3af/at POE(+)
+ used as WAN interface
* 12V/24V 1A DC
Flashing instructions:
The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the factory image to the u-boot when the device boots up.
Signed-off-by: Marek Lindner <marek.lindner@kaiwoo.ai>
[sven@narfation.org: prepare commit message, rebase, use all LEDs, switch
to dualboot_datachk upgrade script, use eth1 as designated WAN interface]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-11-25 13:46:54 +00:00
|
|
|
A42|PA1200)
|
2017-11-30 13:30:06 +00:00
|
|
|
MAX_PART_SIZE=15616
|
|
|
|
KERNEL_FLASH_ADDR=0x180000
|
|
|
|
SIZE_FACTOR=1024
|
|
|
|
SIZE_FORMAT="0x%08x"
|
2012-11-18 09:32:36 +00:00
|
|
|
;;
|
ipq40xx: add support for Plasma Cloud PA2200
Device specifications:
* QCA IPQ4019
* 256 MB of RAM
* 32 MB of SPI NOR flash (w25q256)
- 2x 15 MB available; but one of the 15 MB regions is the recovery image
* 2T2R 2.4 GHz
- QCA4019 hw1.0 (SoC)
- requires special BDF in QCA4019/hw1.0/board-2.bin with
bus=ahb,bmi-chip-id=0,bmi-board-id=20,variant=PlasmaCloud-PA2200
* 2T2R 5 GHz (channel 36-64)
- QCA9888 hw2.0 (PCI)
- requires special BDF in QCA9888/hw2.0/board-2.bin
bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=PlasmaCloud-PA2200
* 2T2R 5 GHz (channel 100-165)
- QCA4019 hw1.0 (SoC)
- requires special BDF in QCA4019/hw1.0/board-2.bin with
bus=ahb,bmi-chip-id=0,bmi-board-id=21,variant=PlasmaCloud-PA2200
* GPIO-LEDs for 2.4GHz, 5GHz-SoC and 5GHz-PCIE
* GPIO-LEDs for power (orange) and status (blue)
* 1x GPIO-button (reset)
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 2x gigabit ethernet
- phy@mdio3:
+ Label: Ethernet 1
+ gmac0 (ethaddr) in original firmware
+ used as LAN interface
- phy@mdio4:
+ Label: Ethernet 2
+ gmac1 (eth1addr) in original firmware
+ 802.3at POE+
+ used as WAN interface
* 12V 2A DC
Flashing instructions:
The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the factory image to the u-boot when the device boots up.
Signed-off-by: Marek Lindner <marek.lindner@kaiwoo.ai>
[sven@narfation.org: prepare commit message, rebase, use all LEDs, switch
to dualboot_datachk upgrade script, use eth1 as designated WAN interface]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2018-12-14 15:46:53 +00:00
|
|
|
A62|PA2200)
|
ipq40xx: add support for OpenMesh A62
* QCA IPQ4019
* 256 MB of RAM
* 32 MB of SPI NOR flash (s25fl256s1)
- 2x 15 MB available; but one of the 15 MB regions is the recovery image
* 2T2R 2.4 GHz
- QCA4019 hw1.0 (SoC)
- requires special BDF in QCA4019/hw1.0/board-2.bin with
bus=ahb,bmi-chip-id=0,bmi-board-id=20,variant=OM-A62
* 2T2R 5 GHz (channel 36-64)
- QCA9888 hw2.0 (PCI)
- requires special BDF in QCA9888/hw2.0/board-2.bin
bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=OM-A62
* 2T2R 5 GHz (channel 100-165)
- QCA4019 hw1.0 (SoC)
- requires special BDF in QCA4019/hw1.0/board-2.bin with
bus=ahb,bmi-chip-id=0,bmi-board-id=21,variant=OM-A62
* multi-color LED (controlled via red/green/blue GPIOs)
* 1x button (reset; kmod-input-gpio-keys compatible)
* external watchdog
- triggered GPIO
* 1x USB (xHCI)
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 2x gigabit ethernet
- phy@mdio3:
+ Label: Ethernet 1
+ gmac0 (ethaddr) in original firmware
+ 802.3at POE+
- phy@mdio4:
+ Label: Ethernet 2
+ gmac1 (eth1addr) in original firmware
+ 18-24V passive POE (mode B)
* powered only via POE
The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the factory image to the u-boot when the device boots up.
The initramfs image can be started using
setenv bootargs 'loglevel=8 earlycon=msm_serial_dm,0x78af000 console=ttyMSM0,115200 mtdparts=spi0.0:256k(0:SBL1),128k(0:MIBIB),384k(0:QSEE),64k(0:CDT),64k(0:DDRPARAMS),64k(0:APPSBLENV),512k(0:APPSBL),64k(0:ART),64k(0:custom),64k(0:KEYS),15552k(inactive),15552k(inactive2)'
tftpboot 0x84000000 openwrt-ipq40xx-openmesh_a62-initramfs-fit-uImage.itb
set fdt_high 0x85000000
bootm 0x84000000
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
2017-08-09 11:52:07 +00:00
|
|
|
MAX_PART_SIZE=15552
|
|
|
|
KERNEL_FLASH_ADDR=0x1a0000
|
|
|
|
SIZE_FACTOR=1024
|
|
|
|
SIZE_FORMAT="0x%08x"
|
|
|
|
;;
|
2012-11-18 09:32:36 +00:00
|
|
|
*)
|
|
|
|
echo "Error - unsupported ce type: $CE_TYPE"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2011-12-01 22:49:03 +00:00
|
|
|
|
|
|
|
CHECK_BS=65536
|
|
|
|
|
|
|
|
KERNEL_SIZE=$(stat -c%s "$KERNEL_PATH")
|
2021-05-09 20:28:15 +00:00
|
|
|
KERNEL_MD5=$($MKHASH md5 $KERNEL_PATH)
|
|
|
|
KERNEL_SHA256=$($MKHASH sha256 $KERNEL_PATH)
|
2020-11-25 09:48:57 +00:00
|
|
|
KERNEL_PART_SIZE_KB=$((KERNEL_SIZE / 1024))
|
2017-11-30 13:30:06 +00:00
|
|
|
KERNEL_PART_SIZE=$(printf $SIZE_FORMAT $(($KERNEL_PART_SIZE_KB * $SIZE_FACTOR)))
|
2011-12-01 22:49:03 +00:00
|
|
|
|
2017-11-30 13:30:06 +00:00
|
|
|
ROOTFS_FLASH_ADDR=$(addr=$(($KERNEL_FLASH_ADDR + ($KERNEL_PART_SIZE_KB * 1024))); printf "0x%x" $addr)
|
2011-12-01 22:49:03 +00:00
|
|
|
ROOTFS_SIZE=$(stat -c%s "$ROOTFS_PATH")
|
2020-11-25 09:48:57 +00:00
|
|
|
ROOTFS_SQUASHFS_SIZE=$((ROOTFS_SIZE-4))
|
|
|
|
ROOTFS_CHECK_BLOCKS=$((ROOTFS_SQUASHFS_SIZE / CHECK_BS))
|
2021-05-09 20:28:15 +00:00
|
|
|
ROOTFS_MD5=$(dd if=$ROOTFS_PATH bs=$CHECK_BS count=$ROOTFS_CHECK_BLOCKS 2>&- | $MKHASH md5)
|
|
|
|
ROOTFS_MD5_FULL=$($MKHASH md5 $ROOTFS_PATH)
|
|
|
|
ROOTFS_SHA256_FULL=$($MKHASH sha256 $ROOTFS_PATH)
|
2020-11-25 09:48:57 +00:00
|
|
|
ROOTFS_CHECK_SIZE=$(printf '0x%x' $ROOTFS_SQUASHFS_SIZE)
|
2017-11-30 13:30:06 +00:00
|
|
|
ROOTFS_PART_SIZE_KB=$(($MAX_PART_SIZE - $KERNEL_PART_SIZE_KB))
|
|
|
|
ROOTFS_PART_SIZE=$(printf $SIZE_FORMAT $(($ROOTFS_PART_SIZE_KB * $SIZE_FACTOR)))
|
2011-12-01 22:49:03 +00:00
|
|
|
|
|
|
|
cat << EOF > $CFG_OUT
|
|
|
|
[vmlinux]
|
|
|
|
filename=kernel
|
|
|
|
md5sum=$KERNEL_MD5
|
2015-09-14 20:10:10 +00:00
|
|
|
filemd5sum=$KERNEL_MD5
|
2016-04-09 10:25:42 +00:00
|
|
|
filesha256sum=$KERNEL_SHA256
|
2011-12-01 22:49:03 +00:00
|
|
|
flashaddr=$KERNEL_FLASH_ADDR
|
|
|
|
checksize=0x0
|
|
|
|
cmd_success=setenv bootseq 1,2; setenv kernel_size_1 $KERNEL_PART_SIZE; saveenv
|
|
|
|
cmd_fail=reset
|
|
|
|
|
|
|
|
[rootfs]
|
|
|
|
filename=rootfs
|
|
|
|
md5sum=$ROOTFS_MD5
|
2015-09-14 20:10:10 +00:00
|
|
|
filemd5sum=$ROOTFS_MD5_FULL
|
2016-04-09 10:25:42 +00:00
|
|
|
filesha256sum=$ROOTFS_SHA256_FULL
|
2011-12-01 22:49:03 +00:00
|
|
|
flashaddr=$ROOTFS_FLASH_ADDR
|
|
|
|
checksize=$ROOTFS_CHECK_SIZE
|
|
|
|
cmd_success=setenv bootseq 1,2; setenv kernel_size_1 $KERNEL_PART_SIZE; setenv rootfs_size_1 $ROOTFS_PART_SIZE; saveenv
|
|
|
|
cmd_fail=reset
|
|
|
|
EOF
|