OpenWrt Source Repository
Go to file
Matthew Hagan 7ad9988287 bcm53xx: add support for Cisco Meraki MX64/MX65
This commit adds support for the Cisco Meraki MX64 and MX65 devices which
use the Broadcom NSP SoC, which is compatible with the bcm53xx platform.

MX64 Hardware info:
  - CPU: Broadcom BCM58625 Cortex A9 @ 1200Mhz
  - RAM: 2 GB (4 x 4Gb SK Hynix H5TC4G83CFR)
  - Storage: 1 GB (Micron MT29F8G08ABACA)
  - Networking: BCM58625 internal switch (5x 1GbE ports)
  - USB: 1x USB2.0
  - Serial: Internal header

MX65 Hardware info:
  - CPU: Broadcom BCM58625 Cortex A9 @ 1200Mhz
  - RAM: 2 GB (4 x 4Gb SK Hynix H5TC4G83CFR)
  - Storage: 1 GB (Micron MT29F8G08ABACA)
  - Networking: BCM58625 switch (2x 1GbE ports, used for WAN ports 1 & 2)
    2x Qualcomm QCA8337 switches (10x 1GbE ports, used for LAN ports 3-12)
  - PSE: Broadcom BCM59111KMLG connected to LAN ports 11 & 12
  - USB: 1x USB2.0
  - Serial: Internal header

Notes:
  - The Meraki provided GPL source are available at [2].
  - Wireless capability on the MX64W and MX65W exists in the form of 2x
    Broadcom BCM43520KMLG, which is not supported. These devices will work
    otherwise as standard MX64 or MX65 devices.
  - Early MX64 units use an A0 variant of the BCM958625 SoC which lacks
    cache coherency and uses a different "secondary-boot-reg". As a
    consequence a different device tree is needed.
  - Installation of OpenWrt requires changing u-boot to a custom version.
    This is due to the stock u-boot "nand read" command being limited to
    load only 2MB, in spite of the bootkernel1 and bootkernel2 partitions
    both being 3MB in the stock layout. It is also required to allow
    booting via USB, enabling cache coherency and setting up the QCA
    switches and Serdes link on the MX65. The modified sources for U-boot
    are available for the MX64[3] and MX65[4].
  - Initial work on this device used a small bootloader within the OEM
    partition scheme. To allow booting of larger kernels, UBI and bootm
    support has been added, along with ability to store env variables to
    the NAND. The Shmoo and newly created env partitions have been moved
    to the extra space available after the nvram data.
  - Users who installed the previous non-UBI supporting bootloader will
    need to convert to the new one before flashing a compatible image.
    These steps are detailed below.

References:

[1] https://www.broadcom.com/products/embedded-and-networking-processors/c
ommunications/bcm5862x
[2] https://dl.meraki.net/wired-14-39-mx64-20190426.tar.bz2
[3] https://github.com/clayface/U-boot-MX64-20190430_MX64
[4] https://github.com/clayface/U-boot-MX64-20190430_MX65

Installation guide:

Initial installation steps:
  1. Compile or obtain OpenWrt files for the MX64 or MX65, including
     u-boot[3][4], initramfs and sysupgrade images.
  2. A USB disk with DOS partition scheme and primary FAT partition is
     required.
  3. If installing onto an MX64, set up a local web server.
  4. On the device, boot into diagnostic mode by holding reset when
     powering on the device. Continue to hold reset until the orange LED
     begins to flash white. On used units the white flash may be difficult
     to see.
  5. Plug an Ethernet cable into the first LAN port, set the host to
     192.168.1.2 and confirm telnet connectivity to 192.168.1.1.

U-boot installation - MX64 Only:
  1. Newer fw versions require extra steps to support OpenWrt. To check,
     please connect via telnet and run:
        `cat /sys/block/mtdblock0/ro`
     If the result is 1, your mtd0 is locked will need to perform extra
     steps 4 and 5 in this section. If the result is 0 then skip these.

  2. Check which SoC is in use by running the following command:
        `devmem 0x18000000`
     If devmem is not found then try:
        `devmem2 0x18000000`
     If the output begins with anything between "0x3F00-0x3F03" you will
     need to use the A0 release. For any other output, eg "0x3F04" or
     higher, use the regular MX64 image.

  3  Confirm the size of the device's boot(mtd0) partition. In most
     cases it should be 0x100000 or larger. If this is the case, please
     proceed to use the uboot_mx64 image. If the reported size is
     0x80000, please use the uboot_mx64_small image, then follow the
     later guide to change to the larger image.
        `cat /proc/mtd`
     Example output:
        `# cat /proc/mtd
        cat /proc/mtd
        dev:    size   erasesize  name
        mtd0: 00100000 00040000 "boot"
        mtd1: 00080000 00040000 "shmoo"
        mtd2: 00300000 00040000 "bootkernel1"
        mtd3: 00100000 00040000 "nvram"
        mtd4: 00300000 00040000 "bootkernel2"
        mtd5: 3f700000 00040000 "ubi"
        mtd6: 40000000 00040000 "all"`

  4. Set up a webserver to serve the appropriate uboot_mx64 from the
     following location and verify the SHA512:
     https://github.com/clayface/U-boot-MX64-20190430_MX64

  5. (Only if mtd0 is locked) You will also need the mtd-rw.ko kernel
     module to unlock the partition from the same repo. An mtd executable
     is also needed to write the mtd block. Place these on the web server
     as well.

  6. (Only if mtd0 is locked) Use wget to retrieve the files on the MX64:
        `wget http://192.168.1.2/mtd-rw.ko`
        `insmod mtd-rw.ko i_want_a_brick=1`
     and confirm the unlock is set with dmesg
        `mtd-rw: mtd0: setting writeable flag`

  7. Download the appropriate u-boot image according to step 3. If you
     did not need to unlock the mtd0 partition then use dd to write the
     file, with caution:
        `wget http://192.168.1.2/uboot_mx64`
        `dd if=uboot_mx64 of=/dev/mtdblock0`
     If you needed to unlock the mtd0 partition using the mtd-rw module,
     run these commands instead to install u-boot instead:
        `wget http://192.168.1.2/mtd`
        `chmod +x mtd`
        `wget http://192.168.1.2/uboot_mx64`
        `./mtd write uboot_mx64 /dev/mtd0`

  8. Once this has successfully completed, power off the device. If you
     did not need to install the small u-boot image, proceed to
     "OpenWrt Installation". Otherwise proceed to "UBI supporting
     bootloader installation".

U-boot installation - MX65 Only:
  1. Obtain telnet access to the MX65.

  2. Confirm the size of the device's boot(mtd0) partition. In most
     cases it should be 0x100000 or larger. If this is the case, please
     proceed to use the uboot_mx65 image. If the reported size is
     0x80000, please use the uboot_mx65_small image, then follow the
     later guide to change to the larger image.
	`cat /proc/mtd`

  3. Prepare a USB drive formatted to FAT. Download the appropriate
     uboot_mx65 to the USB drive from the following location and verify
     the SHA512:
        https://github.com/clayface/U-boot-MX64-20190430_MX65

  3. Once you have telnet access to the MX65, plug in the USB disk and
     run the following commands, with caution. The USB disk should
     automount but if it does not, you will need to power off and on
     again with reset held. Depending on step 2, use the uboot_mx65 or
     uboot_mx65_small image accordingly:
        `cd /tmp/media/sda1`
        `dd if=uboot_mx65 of=/dev/mtdblock0`

  4. Once this has successfully completed, power off the device. If you
     did not need to install the small u-boot image, proceed to
     "OpenWrt Installation". Otherwise proceed to "UBI supporting
     bootloader installation".

UBI supporting bootloader installation:
  These steps need to be followed if the older u-boot image was
  installed, either because the Meraki diagnostic partition scheme used
  0x80000 as the mtd0 size, or because you installed the u-boot provided
  while OpenWrt support was still under development. If using OpenWrt,
  please make a backup before proceeding.

  1. Obtain the relevant image from the MX64(A0) or MX65 u-boot repo:
        `openwrt-bcm5862x-generic-meraki_XXXX-initramfs-kernel.bin`

  2. With the USB drive already inserted, power on the device while
     holding the reset button. A white/orange flashing pattern will
     occur shortly after power on. Let go of the reset button. The
     device is now booting into OpenWrt initramfs stored on the USB
     disk.

  3. Connect by SSH to 192.168.1.1 and flash the embedded u-boot image,
     changing X as appropriate:
        `mtd write /root/uboot_mx6X /dev/mtd0`
     You do not need to reboot as this image can handle "Kernel-in-UBI"
     OpenWrt installation.

  4. You can proceed to obtain and flash the appropriate OpenWrt image
     at "OpenWrt Installation" Step 3.

  5. Reboot will take significantly longer due to Shmoo calibration. In
     case the device does not come online after several minute, power-
     cycle the device and see if it boots. If you see an orange/white
     flashing pattern, this indicates UBI booting was not successful and
     you will need to copy a new bcm53xx image to a USB disk before
     booting it and attempting to install OpenWrt again - refer to
     "OpenWrt Installation" step 1. Do not attempt to reflash u-boot in
     this scenario.

OpenWrt Installation:
  1. Having obtained an OpenWrt image, please copy the file
        `openwrt-bcm53xx-generic-meraki_XXXX-initramfs.bin`
     to the base directory of a FAT formatted USB drive using DOS
     partition scheme ,where XXXX is mx64, mx64_a0 or mx65 depending on
     which device you have.

  2. With the USB drive already inserted, power on the device. Boot time
     will be longer than usual while Shmoo calibration takes place. A
     different white/orange flashing pattern will eventually occur to
     indicate device is now booting into OpenWrt initramfs stored on the
     USB disk.

  3. Ensuring Ethernet is plugged into a LAN port with IP set in the
     192.168.1.0/24 subnet excluding 192.168.1.1, use SCP to copy the
     sysupgrade file to 192.168.1.1:/tmp, eg:
        `scp openwrt-bcm53xx-generic-meraki_XXXX-squashfs.sysupgrade.bin\
        192.168.1.1:/tmp`

  4. Connect by SSH to 192.168.1.1 and run sysupgrade:
        `sysupgrade \
        /tmp/openwrt-bcm53xx-generic-meraki_XXXX-squashfs.sysupgrade.bin`

  5. OpenWrt should now be installed on the device.

Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>

[ Rebase kernel configuration for 6.6,
  fix failsafe by making kmod-eeprom-at24 and kmod-dsa-qca8k built-in,
  resolve conflicts,
  add LED aliases,
  fix eth0 MAC address at probe ]

TODO:
- fix multiple LED colors not applied despite aliases - due to custom
  /etc/diag.sh
- fix race condition between preinit and probing of the DSA tree,
  causing no network interface available in failsafe mode (in general
  case - to allow moving drivers back to modules)

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16634
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-22 00:39:32 +02:00
.devcontainer/ci-env
.github CI: labeler: Add new targets 2024-09-28 18:36:21 +02:00
.vscode meta: VS Code: add "Git: Always Sign Off" setting 2024-10-03 17:18:51 +02:00
LICENSES
config config: build: make STRIP_KERNEL_EXPORTS depend on BROKEN 2024-09-21 16:06:12 +02:00
include base-files: add SOURCE_DATE_EPOCH as OPENWRT_BUILD_DATE to os-release 2024-10-20 23:30:27 +02:00
package kernel: r8168: update to v8.054.00 2024-10-21 01:35:19 +02:00
scripts scripts/download.pl: use perl builtins instead of system() 2024-10-12 21:59:15 +02:00
target bcm53xx: add support for Cisco Meraki MX64/MX65 2024-10-22 00:39:32 +02:00
toolchain toolchain/binutils: remove old versions 2024-10-12 22:12:39 +02:00
tools tools: firmware-utils: update to Git HEAD (2024-10-20) 2024-10-20 23:59:51 +02:00
.gitattributes
.gitignore
BSDmakefile
COPYING
Config.in
Makefile build: include tests/Makefile if available 2024-06-17 17:51:31 +02:00
README.md
feeds.conf.default
rules.mk build: let HOST_CXXFLAGS default to HOST_CFLAGS 2024-07-08 08:49:43 +02:00

README.md

OpenWrt logo

OpenWrt Project is a Linux operating system targeting embedded devices. Instead of trying to create a single, static firmware, OpenWrt provides a fully writable filesystem with package management. This frees you from the application selection and configuration provided by the vendor and allows you to customize the device through the use of packages to suit any application. For developers, OpenWrt is the framework to build an application without having to build a complete firmware around it; for users this means the ability for full customization, to use the device in ways never envisioned.

Sunshine!

Download

Built firmware images are available for many architectures and come with a package selection to be used as WiFi home router. To quickly find a factory image usable to migrate from a vendor stock firmware to OpenWrt, try the Firmware Selector.

If your device is supported, please follow the Info link to see install instructions or consult the support resources listed below.

An advanced user may require additional or specific package. (Toolchain, SDK, ...) For everything else than simple firmware download, try the wiki download page:

Development

To build your own firmware you need a GNU/Linux, BSD or macOS system (case sensitive filesystem required). Cygwin is unsupported because of the lack of a case sensitive file system.

Requirements

You need the following tools to compile OpenWrt, the package names vary between distributions. A complete list with distribution specific packages is found in the Build System Setup documentation.

binutils bzip2 diff find flex gawk gcc-6+ getopt grep install libc-dev libz-dev
make4.1+ perl python3.7+ rsync subversion unzip which

Quickstart

  1. Run ./scripts/feeds update -a to obtain all the latest package definitions defined in feeds.conf / feeds.conf.default

  2. Run ./scripts/feeds install -a to install symlinks for all obtained packages into package/feeds/

  3. Run make menuconfig to select your preferred configuration for the toolchain, target system & firmware packages.

  4. Run make to build your firmware. This will download all sources, build the cross-compile toolchain and then cross-compile the GNU/Linux kernel & all chosen applications for your target system.

The main repository uses multiple sub-repositories to manage packages of different categories. All packages are installed via the OpenWrt package manager called opkg. If you're looking to develop the web interface or port packages to OpenWrt, please find the fitting repository below.

  • LuCI Web Interface: Modern and modular interface to control the device via a web browser.

  • OpenWrt Packages: Community repository of ported packages.

  • OpenWrt Routing: Packages specifically focused on (mesh) routing.

  • OpenWrt Video: Packages specifically focused on display servers and clients (Xorg and Wayland).

Support Information

For a list of supported devices see the OpenWrt Hardware Database

Documentation

Support Community

  • Forum: For usage, projects, discussions and hardware advise.
  • Support Chat: Channel #openwrt on oftc.net.

Developer Community

License

OpenWrt is licensed under GPL-2.0