aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/image/mt7622.mk
Commit message (Collapse)AuthorAgeFilesLines
* mediatek: rework support for BananaPi BPi-R64Daniel Golle2021-02-281-20/+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: 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: 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>
* mediatek: mt7622: select bluetooth module instead of firmwareChuanhong Guo2020-09-221-1/+1
| | | | Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* mediatek: generate UBI images for the rev boardJohn Crispin2020-07-161-1/+19
| | | | Signed-off-by: John Crispin <john@phrozen.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: tidy up image subtarget MakefilesSungbo Eo2020-06-071-15/+13
| | | | | | | | | | - 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>
* ramips/mediatek: select kmod-mt7615-firmware where kmod-mt7615e is selectedFelix Fietkau2020-06-041-1/+2
| | | | | | | The new mt76 version splits out the firmware, because the driver can also be used for MT7663/MT7613 Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mediatek: fix image buildingJohn Crispin2020-05-041-0/+2
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* mediatek: fix elecom board nameJohn Crispin2020-04-061-1/+1
| | | | | | menuconfig was showing the the company name twice. Signed-off-by: John Crispin <john@phrozen.org>
* mediatke: add support for elecom-wrc-2533gentJohn Crispin2020-03-271-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for the MT7622-based Elecom WRC-2533gent router, with spi-nand storage and 512MB RAM. The device has the following specifications: * MT7622 (arm64 dual-core) * 512MB RAM (DDR3) * 4GB storage (spi-nand) * 5x 1Gbps Ethernet (RTL8337C switch) * 1x UART header * 1x USB 3.0 port * 5x LEDs * 1x reset button * 1x WPS button * 1x slider switch * 1x DC jack for main power (12V) The following has been tested and is working: * Ethernet switch * 2.4g and 5g wifi * USB 3.0 port * sysupgrade * buttons/leds Not working: * bluetooth firmware does not load even though it is present int he rootfs Signed-off-by: John Crispin <john@phrozen.org>
* kernel: make kmod-ata-core selected by dependent modulesupstreamless-old-masterSungbo Eo2020-03-111-4/+2
| | | | | | | | | | | | | | | | Currently kmod-ata-* will not get into images unless kmod-ata-core is added to DEVICE_PACKAGES as well. By changing the dependencies from "depends on" to "select", we do not have the issue anymore. Furthermore, we can remove most occurrences of the package from DEVICE_PACKAGES and similar variables, as it is now pulled by dependent modules such as: - kmod-ata-ahci - kmod-ata-ahci-mtk - kmod-ata-sunxi While at it, use AddDepends/ata for kmod-ata-pdc202xx-old. Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* mediatek: add latest fixes provided by MTKJohn Crispin2020-02-251-14/+3
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* mediatek: use consistent naming scheme for device nodesAdrian Schmutzler2020-01-261-6/+8
| | | | | | | | | | | | | | | | | | | | | This harmonizes the device node names (and thus the image names, too) between subtargets of the mediatek target. So far, each subtarget has somewhat used its own naming scheme. Now, we use the vendor_device syntax there, too. Since DTS names have different patterns and the target only contains a few devices, this does not replace DEVICE_DTS by a calculated default value (like for other targets). SUPPORTED_DEVICES is adjusted based on the node rename where necessary, though it looks like for several older devices it was not set up correctly so far. While at it, this also changes the DTS name for u7623-02-emmc-512m to all-lower-case. Cc: John Crispin <john@phrozen.org> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* mediatek: split up DEVICE_TITLEMoritz Warning2019-10-191-3/+6
| | | | | | DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT Signed-off-by: Moritz Warning <moritzwarning@web.de>
* treewide: remove kmod-usb-core from DEVICE_PACKAGESAdrian Schmutzler2019-10-061-3/+3
| | | | | | | | | | | | | | | | | | | This removes _all_ occurrences of kmod-usb-core from DEVICE_PACKAGES and similar variables. This package is pulled as dependency by one of the following packages in any case: - kmod-usb-chipidea - kmod-usb-dwc2 - kmod-usb-ledtrig-usbport - kmod-usb-ohci - kmod-usb2 - kmod-usb2-pci - kmod-usb3 Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> [remove kmod-usb-core from EnGenius ESR600] Signed-off-by: David Bauer <mail@david-bauer.net>
* mediatek: fix typo in Banana Pi R64 device titleAdrian Schmutzler2019-08-041-1/+1
| | | | | | | The DEVICE_TITLE introduced in 66458c49aa14 ("mediatek: add v4.19 support") is mistyped. Fix it. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* mediatek: add v4.19 supportJohn Crispin2019-08-021-3/+20
| | | | | | | | Bump the target to v4.19. Add a patch with additional eth driver fixes/features that MTK provided aswell as the driver for the new mt7530 switch. Signed-off-by: John Crispin <john@phrozen.org>
* mediatek: add mt7622 subtargetJohn Crispin2018-05-241-0/+9
Signed-off-by: John Crispin <john@phrozen.org>