Skip to content

Commit

Permalink
mvebu: add support for Check Point V-80
Browse files Browse the repository at this point in the history
Check Point V-80 (Quantum Spark 1550 Appliance) is an Appliance, based
on Armada 7040 (88F7040).

Specification:

- SoC             : Marvell Armada 7040 (88F7040)
- RAM             : DDR4 2 GiB (4x Nanya NT5AD512M8D3-HR)
- Flash           : eMMC 4 GiB (Toshiba THGBMNG5D1LBAIL)
- Ethernet        : 6x 10/100/1000 Mbps
  - LAN 1-5       : Marvell 88E6352
  - WAN           : Marvell 88E1512
- LEDs/Keys (GPIO): 6x/1x
- UART            : "CONSOLE" port (USB 1.1 Type-C)
  - chip          : Silicon Labs CP210x
  - port          : ttyS0
  - settings      : 115200bps 8n1
- HW Monitoring   : 2x nuvoTon NCT7802Y
- USB             : USB 3.0 Type-A
- Power           : 12 VDC, 3.3 A
  - plug          : DC Plug 2.5/5.5 mm (inner/outer)

Flash instruction (common):

1. Boot V-80 normally
2. Login to the vendor CLI (default: admin/admin) and login to the Linux
   CLI by `expert` command
3. Update U-Boot environment variables by the following commands

   fw_setenv bootcmd_ow_usb 'usb start; load usb 0:1 ${loadaddr} boot.scr && source ${loadaddr}'
   fw_setenv bootcmd_ow_emmc 'run set_mmc_internal; mmc read ${loadaddr} ${prim_header_mmc_blk} 4 && source ${loadaddr}'
   fw_setenv bootcmd 'set cp_quiet; run set_bootargs_vx; run bootcmd_ow_usb; run bootcmd_ow_emmc; run bootcmd_part${activePartition};'

   Attention: don't forget single quatations of values to prevent
              expansion of variables

4. Turn off the device

Flash instruction (USB-boot):

1. Burn (squashfs|ext4)-usb.img.gz to USB storage
2. Connect that storage to the USB 3.0 port on V-80
3. Turn on V-80 and it will be booted with OpenWrt in that USB storage

Flash instruction (eMMC-boot):

1. Copy initramfs image, dtb and bootsctipt to the USB storage with
   renaming

   initramfs.bin -------> Image
   dtb -----------------> armada-7040-v-80.dtb
   bootscript (.scr) ---> boot.scr

2. Connect that storage to the USB 3.0 port on V-80
3. Turn on V-80 and it will be booted with OpenWrt initramfs image in
   that USB storage
4. Upload (squashfs|ext4)-sysupgrade.gz to V-80
5. Perform sysupgrade with the uploaded image
6. Wait ~100 seconds to complete flashing

Reverting to stock firmware:

1. Turn on V-80 and interrupt booting by Ctrl + C
2. Select "4. Restore to Factory Defaults (local)"
3. Wait ~180 seconds to complete restoring and rebooting

Notes:

- V-80 has some HW versions. Internal MicroSD card slot and mPCIe slot
  is available on some HW versions, but not on the other HW versions.

  confirmed (MicroSD/mPCIe slots):

  - 1.0.1: unavailable
  - 1.0.3: available

- The partition table in the internal eMMC has single partition, but
  "blkdevparts=" parameter will be passed from the bootloader and that
  definition will be used instead.

MAC addresses:

LAN: 00:1C:7F:xx:xx:4B (mmcblk1boot0, ethaddr (text))
WAN: 00:1C:7F:xx:xx:4A (mmcblk1boot0, eth1addr (text))

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
  • Loading branch information
musashino205 committed Aug 31, 2024
1 parent 4d02ce4 commit c5d8cec
Show file tree
Hide file tree
Showing 5 changed files with 523 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ board_config_update
board=$(board_name)

case "$board" in
checkpoint,v-80)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" "eth1"
;;
globalscale,mochabin)
ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" "eth0 eth2"
;;
Expand Down
62 changes: 62 additions & 0 deletions target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,35 @@ REQUIRE_IMAGE_METADATA=1

platform_check_image() {
case "$(board_name)" in
checkpoint,v-80)
local root="$(cmdline_get_var root)"
case "$root" in
PARTUUID=????????-02) # USB or SD
legacy_sdcard_check_image "$1"
;;
""|\
/dev/mmcblk1p3) # initramfs or eMMC
# check sysupgrade tar image
local gz="$(identify_if_gzip "$1")"
tar t${gz}f "$1" | grep -q "sysupgrade-.*/CONTROL" || {
v "image is not a valid tar file for sysupgrade on eMMC!"
return 1
}
# check availability of partitions
local part_name part_dev
for part_name in "kernel-1" "dtb-1" "rootfs-1"; do
part_dev="$(find_mmc_part $part_name mmcblk1)"
[ -n "$part_dev" ] || {
v "eMMC partition \"$part_name\" not found!"
return 1
}
done
;;
*)
return 1
;;
esac
;;
globalscale,mochabin|\
iei,puzzle-m901|\
iei,puzzle-m902|\
Expand All @@ -26,6 +55,21 @@ platform_check_image() {

platform_do_upgrade() {
case "$(board_name)" in
checkpoint,v-80)
local root="$(cmdline_get_var root)"
case "$root" in
PARTUUID=????????-02) # USB or SD
legacy_sdcard_do_upgrade "$1"
;;
*) # initramfs or eMMC
CI_ROOTDEV="mmcblk1"
CI_KERNPART="kernel-1"
CI_ROOTPART="rootfs-1"
CI_DTBPART="dtb-1"
emmc_do_upgrade "$1"
;;
esac
;;
iei,puzzle-m901|\
iei,puzzle-m902)
platform_do_upgrade_emmc "$1"
Expand All @@ -47,6 +91,24 @@ platform_do_upgrade() {
}
platform_copy_config() {
case "$(board_name)" in
checkpoint,v-80)
local root="$(cmdline_get_var root)"
case "$root" in
PARTUUID=????????-02) # USB or SD
legacy_sdcard_copy_config
;;
*) # initramfs or eMMC
mkdir /tmp/new_root
if ! mount -t ext4 /dev/mmcblk1p3 /tmp/new_root 2>/dev/null; then
emmc_copy_config
else
v "new rootfs is ext4, saving configurations..."
cp "$UPGRADE_BACKUP" "/tmp/new_root/$BACKUP_FILE"
umount /tmp/new_root
fi
;;
esac
;;
globalscale,mochabin|\
iei,puzzle-m901|\
iei,puzzle-m902|\
Expand Down
Loading

0 comments on commit c5d8cec

Please sign in to comment.