Skip to content
Snippets Groups Projects
  1. Apr 10, 2021
  2. Apr 09, 2021
  3. Apr 08, 2021
    • Rafał Miłecki's avatar
      bcm4908: enable Netgear R8000P bootloader image · d92a9c97
      Rafał Miłecki authored
      
      This enables building BCM4908 "raw" image that can be flashed using
      bootloader web UI. It requires serial console access & stopping booting
      by the "Press any key to stop auto run".
      
      It's easy to build vendor like CHK image but it can't be safely flashed
      using vendor UI at this point. Netgear implements method called "NAND
      incremental flashing" that doesn't seem to flash bootfs partition as
      provided.
      
      Above method seems to update vmlinux.lz without updating 94908.dtb. It
      prevents OpenWrt kernel from booting due to incomplete DTB file. Full
      Netgear R8000P support can be enabled after finding a way to make vendor
      firmware flash OpenWrt firmware including the 94908.dtb update.
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      d92a9c97
    • Rafał Miłecki's avatar
      bcm4908: enable target & Asus GT-AC5300 image · 5e78cb9b
      Rafał Miłecki authored
      
      OpenWrt was succesfully tested on the GT-AC5300 model. It's possible to:
      1. Install OpenWrt using vendor UI
      2. Perform UBI aware sysupgrade
      3. Install vendor firmware using OpenWrt sysupgrade
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      5e78cb9b
    • Rafał Miłecki's avatar
      firmware-utils: bcm4908img: convert into a package · 9b4fc4ca
      Rafał Miłecki authored
      
      bcm4908img is a tool managing BCM4908 platform images. It's used for
      creating them as well as checking, modifying and extracting data from.
      
      It's required by both: host (for building firmware images) and target
      (for sysupgrade purposes). Make it a host/target package.
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      9b4fc4ca
    • Rafał Miłecki's avatar
    • Szabolcs Hubai's avatar
      ramips: rt305x: use lzma-loader for ZyXEL Keenetic Lite rev.B · dd3c1ad8
      Szabolcs Hubai authored
      Fixes boot loader LZMA decompression issue,
      reported by GitHub user KOLANICH at [0].
      
      The reported LZMA ERROR has date of 2020-07-20, soon after
      the device support landed:
      
      Ralink UBoot Version: 3.5.2.4_ZyXEL
      
      ....
      
      3: System Boot system code via Flash.
         Image Name:   MIPS OpenWrt Linux-4.14.187
         Created:      2020-07-20   3:39:11 UTC
         Image Type:   MIPS Linux Kernel Image (lzma compressed)
         Data Size:    1472250 Bytes =  1.4 MB
         Load Address: 80000000
         Entry Point:  80000000
         Verifying Checksum ... OK
         Uncompressing Kernel Image ... LZMA ERROR 1 - must RESET board to recover
      
      [0] https://github.com/openwrt/openwrt/commit/fea232ae8feb6af780fd4fa78ebe9231778bf75a#commitcomment-45016560
      
      
      
      Fixes: 4dc9ad4a ("ramips: add support for ZyXEL Keenetic Lite Rev.B")
      Signed-off-by: default avatarSzabolcs Hubai <szab.hu@gmail.com>
      dd3c1ad8
    • Michael Pratt's avatar
      ath79: move pcie node to DTSI for qca955x Senao APs · 15c599c9
      Michael Pratt authored
      
      pcie0 is the same for this generation of Senao APs
      while eth0, eth1, and wmac can differ
      
      the qca,no-eeprom property has no effect
      for the ath10k drivers
      
      Signed-off-by: default avatarMichael Pratt <mcpratt@pm.me>
      15c599c9
    • Michael Pratt's avatar
      ath79: cleanup DTS for ALLNET ALL-WAP02860AC · e800da9d
      Michael Pratt authored
      
      use qca955x_senao_loader.dtsi
      because it is the same hardware / partitioning
      and some cleanup
      
      Effects:
      
      nodes to match similar boards
       - keys
       - eth0
       - pcie0
      
      bumps SPI frequency to 40 MHz
      
      removes &pll node:
      the property is defined in qca955x.dtsi
      
      removes qca,no-eeprom:
      has no effect with mtd-cal-data property
      (also spelling)
      
      Tested-by: default avatarTomasz Maciej Nowak <tmn505@gmail.com>
      Signed-off-by: default avatarMichael Pratt <mcpratt@pm.me>
      e800da9d
    • Michael Pratt's avatar
      ath79: add factory.bin for ALLNET ALL-WAP02860AC · 37ea5d9a
      Michael Pratt authored
      
      This device is a Senao-based product
      using hardware and software from Senao
      with the tar-gz platform for factory.bin
      and checksum verification at boot time
      using variables stored in uboot environment
      and a 'failsafe' image when it fails.
      
      Extremely similar hardware/software to Engenius EAP1200H
      and other Engenius APs with qca955x
      
      Tested-by: default avatarTomasz Maciej Nowak <tmn505@gmail.com>
      Signed-off-by: default avatarMichael Pratt <mcpratt@pm.me>
      37ea5d9a
    • Michael Pratt's avatar
      ath79: add Senao 'failsafe' sysupgrade procedure · d5035f0d
      Michael Pratt authored
      
      Use a similar upgrade method for sysupgrade.bin, like factory.bin,
      for Senao boards with the tar.gz OEM upgrade platform,
      and 'failsafe' image which is loaded on checksum failure.
      
      This is inspired by the OEM upgrade script /etc/fwupgrade.sh
      and the existing platforms for dual-boot Senao boards.
      
      Previously, if the real kernel was damaged or missing
      the only way to recover was with UART serial console,
      because the OKLI lzma-loader is programmed to halt.
      
      uboot did not detect cases where kernel or rootfs is damaged
      and boots OKLI instead of the failsafe image,
      because the checksums stored in uboot environment
      did not include the real kernel and rootfs space.
      
      Now, the stored checksums include the space for both
      the lzma-loader, kernel, and rootfs.
      Therefore, these boards are now practically unbrickable.
      
      Also, the factory.bin and sysupgrade.bin are now the same,
      except for image metadata.
      This allows for flashing OEM image directly from openwrt
      as well as flashing openwrt image directly from OEM.
      
      Make 'loader' partition writable so that it can be updated
      during a sysupgrade.
      
      tested with
      ENS202EXT v1
      EAP1200H
      EAP350 v1
      EAP600
      ECB350 v1
      ECB600
      ENH202 v1
      
      Signed-off-by: default avatarMichael Pratt <mcpratt@pm.me>
      d5035f0d
    • Michael Pratt's avatar
      ath79: adjust ath79/tiny Senao APs to 4k blocksize · a58cb22b
      Michael Pratt authored
      
      ath79/tiny kernel config has
      CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
      from commit
      05d35403
      
      Because of this, these changes are required for 2 reasons:
      
      1.
      
      Senao devices in ath79/tiny
      with a 'failsafe' partition and the tar.gz sysupgrade platform
      and a flash chip that supports 4k sectors
      will fail to reboot to openwrt after a sysupgrade.
      
      the stored checksum is made with the 64k blocksize length
      of the image to be flashed,
      and the actual checksum changes after flashing due to JFFS2 space
      being formatted within the length of the rootfs from the image
      
      example:
      0x440000 length of kernel + rootfs (from sysupgrade.bin)
      0x439000 offset of rootfs_data (from kernel log)
      
      2.
      
      for boards with flash chips that support 4k sectors:
      saving configuration over sysupgrade is not possible
      because sysupgrade.tgz is appended at a 64k boundary
      and the mtd parser starts JFFS2 at a 4k boundary.
      
      for boards with flash chips that do not support 4k sectors:
      partitioning with 4k boundaries causes a boot loop
      from the mtd parser not finding kernel and rootfs.
      
      Also:
      
      Some of the Senao boards that belong in ath79/tiny,
      for example ENH202,
      have a flash chip that does not support 4k sectors
      (no SECT_4K symbol in upstream source).
      
      Because of this, partitioning must be different for these devices
      depending on the flash chip model detected by the kernel.
      
      Therefore:
      
      this creates 2 DTSI files
      to replace the single one with 64k partitioning
      for 4k and 64k partitioning respectively.
      
      Signed-off-by: default avatarMichael Pratt <mcpratt@pm.me>
      a58cb22b
    • Michael Pratt's avatar
      ath79: remove 'fakeroot' for Senao devices · 4a0cc5d4
      Michael Pratt authored
      
      By using the same custom kernel header magic
      in both OKLI lzma-loader, DTS, and makefile
      this hack is not necessary anymore
      
      However, "rootfs" size and checksum
      must now be supplied by the factory.bin image
      through a script that is accepted by the OEM upgrade script.
      
      This is because Senao OEM scripts assume a squashfs header exists
      at the offset for the original "rootfs" partition
      which is actually the kernel + rootfs in this implementation,
      and takes size value from the header that would be there with hexdump,
      but this offset is now the uImage header instead.
      
      This frees up 1 eraseblock
      previously used by the "fakeroot" partition
      for bypassing the OEM image verification.
      
      Also, these Senao devices with a 'failsafe' partition
      and the tar-gz factory.bin platform would otherwise require
      flashing the new tar-gz sysupgrade.bin afterward.
      So this also prevents having to flash both images
      when starting from OEM or 'failsafe'
      
      the OEM upgrade script verifies the header magic numbers,
      but only the first two bytes.
      Example:
      
          [ "${magic_word_kernel}" = "2705" ] &&
          [ "${magic_word_rootfs}" = "7371" -o "${magic_word_rootfs}" = "6873" ] &&
          errcode="0"
      
      therefore picked the magic number
      0x73714f4b
      which is
      'sqOK'
      
      Signed-off-by: default avatarMichael Pratt <mcpratt@pm.me>
      4a0cc5d4
    • Michael Pratt's avatar
      ath79: lzma-loader: allow setting custom kernel magic · 1b8bd17c
      Michael Pratt authored
      
      ...and max flash offset
      
      The mtdsplit parser was recently refactored
      to allow the kernel to have custom image header magic.
      
      Let's also do this for the lzma-loader
      
      For example:
      When implemented together,
      this allows the kernel to "appear" to be a rootfs
      by OEM software in order to write an image
      that is actually kernel + rootfs.
      
      At the same time,
      it would boot to openwrt normally
      by setting the same magic in DTS.
      
      Both of the variables
      have a default value that is unchanged
      when not defined in the makefiles
      
      This has no effect on the size of the loader
      when lzma compressed.
      
      Signed-off-by: default avatarMichael Pratt <mcpratt@pm.me>
      1b8bd17c
    • Bjørn Mork's avatar
      realtek: allow writing to "u-boot-env2" · 11d24ffe
      Bjørn Mork authored
      
      U-Boot uses the "bootpartition" variable stored in
      "u-boot-env2" to select the active system partition. Allow
      updates to enable system switching from OpenWrt.
      
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      11d24ffe
    • Bjørn Mork's avatar
      uboot-envtools: add wrapper scripts for alternate config · b7154fab
      Bjørn Mork authored
      
      Now that we can create an alternate configuration file, add two
      wrapper scripts for simple access to it using the alternate
      alternate application names `fw_printsys' and `fw_setsys'.
      
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      b7154fab
    • Bjørn Mork's avatar
      uboot-envtools: add support for multiple config partitions · a3e9fd7e
      Bjørn Mork authored
      
      Most (all?) of the realtek devices have two u-boot config partitions
      with a different set of variables in each. The U-Boot shell provides
      two sets of apps to manipulate these:
      
       printenv- print environment variables
       printsys- printsys - print system information variables
       saveenv - save environment variables to persistent storage
       savesys - savesys - save system information variables to persistent storage
       setenv  - set environment variables
       setsys  - setsys  - set system information variables
      
      Add support for multiple ubootenv configuration types, allowing
      more than one configuration file.
      
      Section names are not suitable for naming the different
      configurations since each file can be the result of multiple sections
      in case of backup partitions.
      
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      a3e9fd7e
  4. Apr 07, 2021
  5. Apr 06, 2021
    • Rafał Miłecki's avatar
      firmware-utils: bcm4908img: fix extracting cferom · dcbde11a
      Rafał Miłecki authored
      
      Fix offset to extract proper data when image contains vendor header.
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      dcbde11a
    • Rafał Miłecki's avatar
      firmware-utils: bcm4908img: support extracting bootfs & rootfs · e33957c2
      Rafał Miłecki authored
      
      It's required for upgrading firmware using single partitions instead of
      just blindly writing whole image.
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      e33957c2
    • Rafał Miłecki's avatar
      firmware-utils: bcm4908img: replace size with offset · 5314cab7
      Rafał Miłecki authored
      
      It's much easier to operate on BCM4908 image data with absolute offset
      of each section stored. It doesn't require summing sizes over and over.
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      5314cab7
    • Koen Vandeputte's avatar
      ath79: ar934x-nand: fix broken nand on kernel 5.10 · f4f4259c
      Koen Vandeputte authored
      
      Booting current 5.10.x testing kernel shows this:
      
      [    0.335781] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xf1
      [    0.342280] nand: Samsung NAND 128MiB 3,3V 8-bit
      [    0.346982] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048,
      OOB size: 64
      [    0.354703] ar934x-nand 1b800200.nand: unknown ECC mode 2
      [    0.360193] ar934x-nand 1b800200.nand: nand_scan failed, err:-22
      [    0.366341] ar934x-nand: probe of 1b800200.nand failed with error -22
      
      ...
      
      [    1.089264] /dev/root: Can't open blockdev
      [    1.093482] VFS: Cannot open root device "(null)" or
      unknown-block(0,0): error -6
      [    1.101077] Please append a correct "root=" boot option; here are the
      available partitions:
      [    1.109555] 1f00              64 mtdblock0
      [    1.109559]  (driver?)
      [    1.116199] 1f01              48 mtdblock1
      [    1.116202]  (driver?)
      [    1.122841] 1f02               4 mtdblock2
      [    1.122844]  (driver?)
      [    1.129493] 1f03               4 mtdblock3
      [    1.129497]  (driver?)
      [    1.136138] 1f04               4 mtdblock4
      [    1.136142]  (driver?)
      [    1.142787] Kernel panic - not syncing: VFS: Unable to mount root fs
      on unknown-block(0,0)
      [    1.151168] Rebooting in 1 seconds..
      
      The issue is caused by a wrong check for ECC engine type
      on newer kernels.
      
      Fix this.
      
      Bootlog after:
      
      [    0.335689] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xf1
      [    0.342192] nand: Samsung NAND 128MiB 3,3V 8-bit
      [    0.346884] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048,
      OOB size: 64
      [    0.354611] Scanning device for bad blocks
      [    0.364924] random: fast init done
      [    0.496641] 3 fixed-partitions partitions found on MTD device
      ar934x-nand
      [    0.503545] Creating 3 MTD partitions on "ar934x-nand":
      [    0.508865] 0x000000000000-0x000000040000 : "booter"
      [    0.515133] 0x000000040000-0x000000400000 : "kernel"
      [    0.523265] 0x000000400000-0x000008000000 : "ubi"
      
      Fixes: fb64e2c3 ("ath79: ar934x-nand: add kernel 5.10 compatibility")
      Signed-off-by: default avatarKoen Vandeputte <koen.vandeputte@citymesh.com>
      f4f4259c
  6. Apr 05, 2021
Loading