aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/image
Commit message (Collapse)AuthorAgeFilesLines
* mediatek: bpi-r64: add eMMC bootloader artifactsDaniel Golle2021-05-011-1/+3
| | | | | | | | In order to allow easily updating the bootloader on eMMC also provide artifacts for that. Support for updating bootloader via TFTP will be added to the loader CLI menu in a follow-up commit. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: bpi-r64: fix sdcard.img.gz in ImageBuilderDaniel Golle2021-04-231-1/+1
| | | | | | | | Generating the sdcard.img.gz file requires the initramfs/recovery image to be present. Use the newly introduced 'append-image-stage' build command to fix the ImageBuilder for the BPi-R64. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: add spi-nand support for bananapi bpi-r64Oskari Lemmela2021-04-111-1/+5
| | | | | | | | | | Some of bpi-r64 boards have serial NAND attached to SPI bus. Add SD card image support for installing openwrt to it. Default to nand upgrade if root device is not mmc block device. Separate preloader and uboot images for snand are generated. Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
* mediatek: bpi-r64: use separate partition for emmc bootloaderOskari Lemmela2021-04-111-6/+7
| | | | | | | eMMC booloader is stored to separate partition. FIP size is increased to 2MB. Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
* mediatek: add alternative bootchain variant for UniFi 6 LRDaniel Golle2021-04-091-0/+18
| | | | | | | | Builds images for the Ubiquiti Network UniFi 6 LR device running the U-Boot build added by the previous commits. Everything but MTD partitions is moved to dtsi. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: generate complete sdcard image for BPi-R64Daniel Golle2021-03-241-4/+9
| | | | | | | Populate the recovery and production partitions of the generated sdcard image for the Bananapi BPi-R64. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: fix broken UniFi 6 LR imageDavid Bauer2021-03-181-0/+1
| | | | | | | | Ubiquiti's own bootloader expects the configuration mode to be present with a "@" instead of a "-" for the sperator character. Otherwise booting of the image fails. Signed-off-by: David Bauer <mail@david-bauer.net>
* mediatek: bpi-r64: use dt-overlay to select SATA or PCIE1Daniel Golle2021-03-171-0/+1
| | | | | | | | | | The Bananapi BPi-R64 got a SATA interface which cannot be used at the same time as the second mPCIe slot. The decission is made by hogging GPIO 90. Embed two addtional DT overlay blobs into the image to allow bootloader selection of either SATA or PCIE1 feature. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: drop duplicate DEVICE_PACKAGESDaniel Golle2021-03-151-1/+1
| | | | | | | | kmod-mt7615e kmod-mt7615-firmware and uboot-envtools are already part of the target's default package set. No need to add them again for buffalo_wsr-2533dhp2. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add support for Buffalo WSR-2533DHP2INAGAKI Hiroshi2021-03-151-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the Buffalo WSR-2533DHP2. The device uses the Broadcom TRX image format with a special magic. To be able to boot the images or load them they have to be wrapped with different headers depending how it is loaded. There are multiple ways to install OpenWrt on this device. Boot ramdisk from U-Boot ---------------------------- This will load the image and not write it into the flash. 1. Stop boot menu with "space" key 2. Select "System Load Linux to SDRAM via TFTP." 3. Load this image: openwrt-mediatek-mt7622-buffalo_wsr-2533dhp2-initramfs-kernel.bin 4. The system boots the image Write to flash from U-Boot ----------------------------- This will load the image over tftp and directly write it into the flash. 1. Stop boot menu with "space" key 2. Select "System Load Linux Kernel then write to Flash via TFTP." 3. Load this image: openwrt-mediatek-mt7622-buffalo_wsr-2533dhp2-squashfs-factory-uboot.bin 4. The system writes this image into the flash and boots into it. Write to flash from Web UI ----------------------------- This will load the image over over the Web UI and write it into the flash 1. Open the Web UI 2. Go to "管理" -> "ファームウェア更新" 3. Select "ローカルファイル指定" and click "更新実行" 4. Load this image: openwrt-mediatek-mt7622-buffalo_wsr-2533dhp2-squashfs-factory.bin 5. The system writes this image into the flash and boots into it. Specifications ------------------- * SoC: MT7622 (4x4 2.4 GHz Wifi) * Wifi: MT7615 (4x4 5 GHz Wifi) * Flash: Winbond W29N01HZ 128MB SLC NAND * RAM 256MB * Ethernet: Realtek RTL8367S (5 x 1GBit/s, SoC via 2.5GBit/s) Co-Developed-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* mediatek: mt7622: clean up image buildDaniel Golle2021-03-141-22/+13
| | | | | | | | | | | | | * clean up whitespace to make GPT partitioning more readable * don't select packages already part of the target default selection * don't select U-Boot variants (breaks ImageBuilder) * don't select AHCI on boards without SATA * don't select kmod-usb2 and kmod-ohci, USB 1.x and USB 2.0 devices work fine with the in-SoC XHCI host having just kmod-usb3 installed. * select kmod-btmtkuart for devices with Bluetooth support * sort DEVICE_PACKAGES Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: image: don't use 'M' unit as dd may not support thatDaniel Golle2021-03-131-2/+2
| | | | | | | | | dd on Mac OS X apparently fails when using 'M' unit for bs. dd: bs: illegal numeric value Use 'k' unit instead for 'pad-to' to fix that. Reported-by: Georgi Valkov <gvalkov@abv.bg> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: check firmware metadataDaniel Golle2021-03-041-1/+1
| | | | | | | | | | All mt7622 devices except for the UBI-variant of the mt7622-rfb1 carry metadata appended to the sysupgrade image. Add it for the mt7622-rfb1-ubi as well and check it on sysupgrade to avoid accidentally flashing firmware for the wrong device (or variant or future DEVICE_COMPAT_VERSION). Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: change image generationOskari Lemmela2021-03-031-7/+6
| | | | | | | - set only one EFI system partition - use shorter path for DEVICE_DTS file Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
* mediatek: mt7622: use ptgen generated MBR headerOskari Lemmela2021-03-031-2/+2
| | | | | | | mt7622 uses MBR partition for booting from SD card. Add hybrid MBR entry with boot flag after PMBR entry. Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
* mediatek: mt7622: make sure image generation can run in parallelDaniel Golle2021-03-021-8/+7
| | | | | | | | The previous approach of referencing artifacts in follow-up artifacts can't work with parallel builds in the current way image.mk is built. Refactor things so this is not needed. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: bpi-r64: simplify eMMC install procedureDaniel Golle2021-03-011-5/+4
| | | | | | | | Write everything needed for eMMC install into the gaps between partitions on SD card. In that way, installation to eMMC only needs the SD card, no additional files need to be loaded via TFTP any more. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: rename mt7622-ubi to mt7622-rfb1-ubiDaniel Golle2021-03-011-3/+3
| | | | | | | This profile is meant to be used on MT7622 rfb1 AP, indicate that in the name to make things less confusing. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: rework support for BananaPi BPi-R64Daniel Golle2021-02-282-39/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **What's new** * Bring support for the Bananapi BPi-R64 to the level desirable for a nice hackable routerboard. * Use ARM Trusted Firmware A from source. (goodbye binary preloader) * Use Das U-Boot from source. (see previous commit) * Assemble SD-card image using OpenWrt image-commands. (no gen_sd_cruz_foo.sh added, this is not Raspbian) * Updated kernel options to support root filesystem. * Updated DTS to match OpenWrt LAN ports, known LEDs, buttons, ... * Detect root device, handle sysupgrade, config restore, ... * Wire up (known) LEDs and buttons in OpenWrt-fashion. * Build one set of images from SD-card and eMMC. * Hopefully provide a good example of how things can be done right from scratch. **Installation and images** * Have an empty SD-card at hand * Write stuff to the card, as root (card device is /dev/mmcblkX) - write header, gpt, bl2, atf, u-boot and recovery kernel: `cat *bpi-r64-boot-sdcard.img *bpi-r64-initramfs-recovery.fit > /dev/mmcblkX` - rescan partitions: `blockdev --rereadpt /dev/mmcblkX` - write main system to production partition: `cat *bpi-r64-squashfs-sysupgrade.fit > /dev/mmcblkXp5` * Installation to eMMC works using SD-card bootloader via TFTP When running OpenWrt of SD-card, issue this to trigger installation to eMMC: `fw_setenv bootcmd run emmc_init` Be prepared to serve the content of bin/targets/mediatek/mt7622 on TFTP server address 192.168.1.254. **What's missing** * The red LED is always on, probably a hardware bug. * AHCI (probably needs DTS changes) * Ship SD-card image ready with every needed for eMMC install. * The eMMC has a second, currently unused boot partition. This would be ideal to store the WiFi EEPROM and Ethernet MAC address(es). @sinovoip ideas? Thanks to Thomas Hühn @thuehn for providing the hardware! Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add alternative UBI NAND layout for Linksys E8450Daniel Golle2021-02-281-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vendor flash layout of the Linksys E8450 is problematic as it uses the SPI-NAND chip without any wear-leveling while at the same time wasting a lot of space for padding. Use an all-UBI layout instead, storing the kernel+dtb+squashfs in uImage.FIT standard format in UBI volume 'fit', the read-write overlay in UBI volume 'rootfs_data' as well as reduntant U-Boot environments 'ubootenv' and 'ubootenv2', and a 'recovery' kernel+dtb+initramfs uImage.FIT for dual-boot. ** WARNING ** THIS PROCEDURE CAN EASILY BRICK YOUR DEVICE PERMANENTLY IF NOT CARRIED OUT VERY CAREFULLY AND EXACTLY AS DESCRIBED! Step 0 * Configure your PC to have the static IPv4 address 192.168.1.254/24 * Provide bin/targets/mediatek/mt7622 via TFTP Now continue EITHER with step 1A or 1B, depending on your preference (and on having serial console wired up or not). Step 1A (Using the vendor web interface (or non-UBI OpenWrt install)) In order to update to the new bootloader and UBI-based firmware, use the web browser of your choice to open the routers web-interface accessible on http://192.168.1.1 * Navigate to 'Configuration' -> 'Administration' -> 'Firmware Upgrade' * Upload the file openwrt-mediatek-mt7622-linksys_e8450-ubi-initramfs-recovery.itb and proceed with the upgrade. * Once OpenWrt comes up, use SCP to upload the new bootloader files to /tmp on the router: *-mt7622-linksys_e8450-ubi-preloader.bin *-mt7622-linksys_e8450-ubi-bl31-uboot.fip * Connect via SSH as you will now need to replace the bootloader in the Flash. ssh root@192.168.1.1 (the usual warnings) * First of all, backup all the flash now: for mtd in /dev/mtdblock*; do dd if=$mtd of=/tmp/$(basename $mtd); done * Then use SCP to copy /tmp/mtdblock* from the router and keep them safe. You will need them should you ever want to return to the factory firmware! * Now flow the uploaded files: mtd -e /dev/mtd0 write /tmp/*linksys_e8450-ubi-preloader.bin /dev/mtd0 mtd -e /dev/mtd1 write /tmp/*linksys_e8450-ubi-bl31-uboot.fip /dev/mtd1 If and only if both writes look like the completed successfully reboot the router. Now continue with step 2. Step 1B (Using the vendor bootloader serial console) * Use the serial to backup all /dev/mtd* devices before using the stock firmware (you got root shell when connected to serial). * Then reboot and select 'U-Boot Console' in the boot menu. * Copy the following lines, one by one: tftpboot 0x40080000 openwrt-mediatek-mt7622-linksys_e8450-ubi-preloader.bin tftpboot 0x40100000 openwrt-mediatek-mt7622-linksys_e8450-ubi-bl31-uboot.fip nand erase 0x0 0x180000 nand write 0x40080000 0x0 0x180000 reset Now continue with step 2 Step 2 Once the new bootchain comes up, the loader will initialize UBI and the ubootenv volumes. It will then of course fail to find any bootable volume and hence resort to load kernel via TFTP from server 192.168.1.254 while giving itself the address 192.168.1.1 The requested file is called openwrt-mediatek-mt7622-linksys_e8450-ubi-initramfs-recovery.itb and your TFTP server should provide exactly that :) It will be written to UBI as recovery image and booted. You can then continue and flash the production OS image, either by using sysupgrade in the booted initramfs recovery OS, or by using the bootloader menu and TFTP. That's it. Go ahead and mess around with a bootchain built almost completely from source (only DRAM calibration blobs are fitted in bl2, and the irreplacable on-chip ROM loader remains, of course). And enjoy U-Boot built with many great features out-of-the-box. You can access the bootloader environment from within OpenWrt using the 'fw_printenv' and 'fw_setenv' commands. Don't be afraid, once you got the new bootchain installed the device should be fairly unbrickable (holding reset button before and during power-on resets things and allows reflashing recovery image via TFTP) Special thanks to @dvn0 (Devan Carpenter) for providing amazingly fast infra for test-builds, allowing for `make clean ; make -j$(nproc)` in less than two minutes :) Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add Linksys E8450 supportJohn Crispin2021-02-281-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linksys E8450, also known as Belkin RT3200, is a dual-band IEEE 802.11bgn/ac/ax router based on MediaTek MT7622BV and MediaTek MT7915AN chips. FCC: K7S-03571 and K7S-03572 Hardware highlights: - CPU: MediaTek MT7622BV (2x ARM Cortex-A53 @ 1350 MHz max.) - RAM: 512MB DDR3 - Flash: 128MB SPI-NAND (2k+64) - Ethernet: MT7531BE switch with 5 1000Base-T ports CPU port connected with 2500Base-X - WiFi 2.4 GHz: 802.11bgn 4T4R built-in antennas MT7622VB built-in - WiFi 5 GHz: 802.11ac/ax 4T4R built-in antennas MT7915AN chip on-board via PCIe MT7975AN front-end - Buttons: Reset and WPS - LEDS: 3 user controllable LEDs, 4 wired to switch - USB: USB2.0, single port - no Bluetooth (supported by SoC, not wired on board) - Serial: JST PH 2.0MM 6 Pin connector inside device ----_____________---- [ GND RX - TX - - ] --------------------- - JTAG: unpopulated ARM JTAG 20-pin connector (works) This commit adds support for the device in a way that is compatible with the vendor firmware's bootloader and dual-boot flash layout, the resulting image can directly be flashed using the vendor firmware. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mediatek: mt7622: add Linux 5.10 supportFelix Fietkau2021-02-281-1/+6
| | | | | | | Switch mt7622 subtarget to Linux 5.10, it has been tested by many of us on several devices for a couple of weeks already. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mediatek: switch to use seperate ramdisk for initramfs imagesDaniel Golle2021-02-251-1/+1
| | | | | | | | | | | | | | | | | | MediaTek targets always use U-Boot's modern uImage.FIT format which allows bundling several blobs into a single file including hashes, descriptions and more. In fact, we are already using that to bundle the Flattened Device Tree blob with the kernel on this and many other targets. In the same fashion, we can now make use of the newly introduced support for building seperate ramdisk to uImage.FIT with a dedicated initrd blob checked and loaded by U-Boot instead of embedding the cpio archive into the kernel itself. This allows for having larger ramdisks, choosing ramdisk compression independently of kernel compression (while only kernel is decompressed by the bootloader) and for more easily replacing or modifying the filesystem contained in an initramfs image. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: fix bpi-r64 emmc f2fs overlayOskari Lemmela2021-02-241-1/+2
| | | | | | | | f2fs tools are needed for generating f2fs overlay. vfat modules are used for recovery mounting. Fixes: f72a2b004c3 ("mediatek: add bpi-r64 emmc support") Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
* mediatek: move mt7623a-unielec-u7623*.dts* out of patchDaniel Golle2021-02-191-0/+2
| | | | | | | Instead of adding those device tree sources using a patch, simply move them to the newly created dts folder. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: more clean solution for out-of-tree DTSDaniel Golle2021-02-191-1/+1
| | | | | | | | | | | Use approach suggested by Adrian Schmutzler instead of introducing another device variable. Also revert the unnecessary white-space changes accidentally introduced by the previous commit. Fixed: c067b1e79b ("mediatek: move out-of-tree DTS files to dedicated dts folder") Suggested-by: Adrian Schmutzler <mail@adrianschmutzler.de> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: move out-of-tree DTS files to dedicated dts folderDaniel Golle2021-02-191-6/+5
| | | | | | | | | | | Use dedicated dts folder like on ramips to store device tree source files for boards not already supported in vanilla Linux. Doing so instead of having them in files-* has several advantages: * we don't need to duplicate them for several kernel versions * changes to a device tree don't trigger a complete kernel rebuild * the files are more obvious to find Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add support for Ubiquiti UniFi 6 LRDavid Bauer2021-02-181-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware -------- MediaTek MT7622 512MB DDR3 RAM 64M SPI-NOR Flash (Winbond W25Q512JV) MediaTek MT7622 802.11bgn 4T4R WMAC MediaTek MT7915 802.11ax 4T4R Marvell AQR1112 100/1000/2500 NBase-T PHY Holtek HT32F52241 LED controller Reset Switch UART ---- CPU UART0 at the pinout next to the Holtek MCU. Pinout (first pin next to SoC / MCU) 0 3V3 1 RX 2 TX 3 GND Settings are 115200 8N1. Opening the case ---------------- Opening the case is not a nice task, as itis glued together. Insert a flat knife between the front and back casing below the ethernet port. Open up a gap this way and insert a flat scredriver, remove the knife. Work your way around the casing by applying force to seperate the front and back casing. This losens the glue and opens the plastic clips. Be gentle, as these clips are very cheap and break quickly. Installation ------------ 1. Connect to the booted device at 192.168.1.20 using username/password "ubnt". 2. Transfer the OpenWrt sysupgrade image to the device using SCP. 3. Check the mtd partition number for bs / kernel0 / kernel1 $ cat /proc/mtd 4. Set the bootselect flag to boot from kernel0 $ dd if=/dev/zero bs=1 count=1 of=/dev/mtdblock6 5. Write the OpenWrt sysupgrade image to both kernel0 as well as kernel1 $ dd if=openwrt.bin of=/dev/mtdblock8 $ dd if=openwrt.bin of=/dev/mtdblock9 6. Reboot the device. It should boot into OpenWrt. Signed-off-by: David Bauer <mail@david-bauer.net>
* target: use SPDX license identifiers on scriptsAdrian Schmutzler2021-02-102-7/+2
| | | | | | Use SPDX license tags to allow machines to check licenses. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* target: use SPDX license identifiers on MakefilesAdrian Schmutzler2021-02-101-4/+2
| | | | | | Use SPDX license tags to allow machines to check licenses. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: provide global default for SUPPORTED_DEVICESAdrian Schmutzler2021-01-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The majority of our targets provide a default value for the variable SUPPORTED_DEVICES, which is used in images to check against the compatible on a running device: SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) At the moment, this is implemented in the Device/Default block of the individual targets or even subtargets. However, since we standardized device names and compatible in the recent past, almost all targets are following the same scheme now: device/image name: vendor_model compatible: vendor,model The equal redundant definitions are a symptom of this process. Consequently, this patch moves the definition to image.mk making it a global default. For the few targets not using the scheme above, SUPPORTED_DEVICES will be defined to a different value in Device/Default anyway, overwriting the default. In other words: This change is supposed to be cosmetic. This can be used as a global measure to get the current compatible with: $(firstword $(SUPPORTED_DEVICES)) (Though this is not precisely an achievement of this commit.) Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* mediatek: mt7622: select bluetooth module instead of firmwareChuanhong Guo2020-09-221-1/+1
| | | | Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* mediatek: mt7623: use bash for generating bootable imagesDavid Woodhouse2020-09-191-1/+1
| | | | | | | | | | | | | | | | | It turns out that 'echo -e' isn't portable; it doesn't work in the dash builtin echo and Ubuntu users are complaining. I can't even get octal (specified by POSIX) to work consistently because those variants of 'echo' which *do* support -e don't seem to interpret octalwithout it. I could switch to /bin/echo but using -e with that isn't actually portable *either* even though it works today. For now just stick with bash, and use its builtin. We may end up using something else entirely; perhaps perl. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* mediatek: mt7623: add full system image for UniElec U7623David Woodhouse2020-07-263-4/+48
| | | | | | | | | | | | | This adds a full eMMC image including U-Boot, which means that the kernel can inherit the true RAM size detected by the preloader. As implemented in previous commits, sysupgrade to this image from the legacy layout (and via that, from the vendor-installed image) is supported. Rename the legacy image for the 512MiB board, for clarity. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* mediatek: mt7623: rename gen_banana_pi_img.sh → gen_mtk_mmc_img.shDavid Woodhouse2020-07-263-11/+11
| | | | | | | As I buy more hardware and continue to work on consolidation, This will apply to a lot of MediaTek platforms; rename it accordingly. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* mediatek: mt7623: make gen_banana_pi_img.sh more genericDavid Woodhouse2020-07-262-15/+24
| | | | | | | | | | | This actually covers fairly much all the MediaTek platforms; they only have different images because they don't include the preloader and U-Boot, and rely on preinstalled stuff from the vendor. So this script can slowly take over the world as we complete the support for various other platforms, starting with UniElec U7623… Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* mediatek: mt7623: add scatter file for unbricking with SP Flash ToolDavid Woodhouse2020-07-262-0/+88
| | | | | | | | | | | | | | | | | | | | Many MediaTek SoCs can be unbricked by using the SP Flash Tool from http://spflashtool.com/ along with a "scatter list" file, which is just a text file listing which image gets loaded where. We use a trivial partition layout for the tool, with the whole eMMC image as a single "partition", which means users just need to unzip the sysupgrade image. Doing the real partition layout would be overly complex and would require the individual partitions to be shipped as artifacts — or users to extract them out of the sysupgrade image just for the tool to put them adjacent to each other on the eMMC anyway. The tool does require a copy of the preloader in order to operate, even when it isn't flashing the preloader to the eMMC boot region. So drop that into the bin directory as an artifact too. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* mediatek: mt7623: build lzma fit for bpi-r2Chuanhong Guo2020-07-261-3/+0
| | | | | | | | | bpi-r2 images are shipped with mainline u-boot which can extract lzma with no problem. remove custom kernel recipe to build lzma fit image instead of uncompressed fit with zboot. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* mediatek: mt7623: fix sysupgrade from vendor OpenWrt on UniElec U7623David Woodhouse2020-07-261-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This board ships with an ancient 14.07-based OpenWrt using block2mtd, and the MBR partition table contains nonsense. It is possible to sysupgrade to an upstream OpenWrt image, but the legacy layout of the OpenWrt images start at 0xA00 in the eMMC, with a raw uImage. The legacy OpenWrt image doesn't "own" the beginning of the device, including the MBR and U-Boot. This means that when a user upgrades to upstream OpenWrt, it doesn't boot because it can't find the right partitions. So hard-code them on the kernel's command line using CONFIG_CMDLINE_PARTITION (for block). Additionally, the vendor firmware doesn't cope with images larger than about 36MiB, because it only overwrites the contents of its "firmware" MTD partition. The current layout of the legacy image wastes a lot of space, allowing over 32MiB for the kernel and another 10MiB for the FAT recovery file system which is only created as 3MiB. So pull those in to allow 4¾ MiB for the kernel, 3MiB for recovery, and then we have over 20MiB for the root file system. This doesn't affect the new images which ship with a full eMMC image including a different MBR layout and a partition for U-Boot, because our modern U-Boot can actually pass the command line to the kernel, and the built-in one doesn't get used anyway. Tested by upgrading from vendor OpenWrt to the current legacy image, from legacy to itself, to the previous legacy layout, and then to finally the full-system image. This commit probably wants backporting to 19.07, which also doesn't install over the vendor OpenWrt and doesn't even have a full-system installation option. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* mediatek: remove condition in Device/DefaultAdrian Schmutzler2020-07-252-16/+16
| | | | | | | | | | | | | | | | The current condition with part of the variables set dependent on the subtarget in Device/Default isn't really nice to read and also defeats the purpose of having a default node. This removes the special settings for mt7623 and moves them to the individual devices, which is not much of a problem as there are actually just two of them and they partly use different settings anyway. While at it, slightly adjust the order of variables and wrap some long lines. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* mediatek: generate UBI images for the rev boardJohn Crispin2020-07-161-1/+19
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* mediatek: fix bashism in gen_banana_pi_img.shDavid Woodhouse2020-07-091-1/+1
| | | | | | | | There was a bashism in the script. This fixes the script so that it doesn't actually require bash, and can be run with any POSIX shell as its shebang suggests. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* mediatek: Implement sysupgrade support for Banana Pi R2David Woodhouse2020-07-081-1/+1
| | | | | | Based on work by Alexey Loukianov <lx2@lexa2.ru> and others. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* mediatek: add SD card image creation for Banana Pi R2David Woodhouse2020-07-084-0/+257
| | | | | | Based on work by Alexey Loukianov <lx2@lexa2.ru> and others. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* mediatek: enable SATA for mt7623David Woodhouse2020-07-081-2/+2
| | | | | | | The MT7623 SoC has the same SATA block as the MT7622, so enable it in MT7623 builds too and add it to the DEVICE_PACKAGES for those boards. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* mediatek/mt7623: unify features and packages, add ext4 and usbDavid Woodhouse2020-07-081-2/+4
| | | | | | | | The supported MT7623 boards are mostly identical (what with being a System-on-Chip and all), so unify the DEVICE_PACKAGES for them, and add ext4 and usb support for them. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* mediatek: fix image/mt7622.mkJohn Crispin2020-06-071-1/+1
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* mediatek: add bpi-r64 emmc supportJohn Crispin2020-06-071-1/+13
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* mediatek: make emmc image generation work on mt7622John Crispin2020-06-072-1/+20
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* mediatek: tidy up image subtarget MakefilesSungbo Eo2020-06-072-24/+23
| | | | | | | | | | - sort device recipes alphabetically - adjust board name of ELECOM WRC-2533GENT - harmonize line wrapping Signed-off-by: Sungbo Eo <mans0n@gorani.run> [rebased] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>