2021-02-19 01:13:26 +00:00
|
|
|
DTS_DIR := $(DTS_DIR)/mediatek
|
2020-10-24 19:15:20 +00:00
|
|
|
|
2021-03-07 17:36:16 +00:00
|
|
|
define Image/Prepare
|
|
|
|
# For UBI we want only one extra block
|
|
|
|
rm -f $(KDIR)/ubi_mark
|
|
|
|
echo -ne '\xde\xad\xc0\xde' > $(KDIR)/ubi_mark
|
|
|
|
endef
|
|
|
|
|
2023-08-27 08:29:12 +00:00
|
|
|
define Build/buffalo-trx
|
2021-03-07 17:36:16 +00:00
|
|
|
$(eval magic=$(word 1,$(1)))
|
2023-08-27 08:29:12 +00:00
|
|
|
$(eval kern_bin=$(if $(1),$(IMAGE_KERNEL),$@))
|
|
|
|
$(eval rtfs_bin=$(word 2,$(1)))
|
|
|
|
$(eval apnd_bin=$(word 3,$(1)))
|
2021-03-07 17:36:16 +00:00
|
|
|
$(eval kern_size=$(if $(KERNEL_SIZE),$(KERNEL_SIZE),0x400000))
|
|
|
|
|
2023-08-27 08:29:12 +00:00
|
|
|
$(if $(rtfs_bin),touch $(rtfs_bin))
|
2021-03-07 17:36:16 +00:00
|
|
|
$(STAGING_DIR_HOST)/bin/otrx create $@.new \
|
|
|
|
$(if $(magic),-M $(magic),) \
|
2023-08-27 08:29:12 +00:00
|
|
|
-f $(kern_bin) \
|
|
|
|
$(if $(rtfs_bin),\
|
2021-03-07 17:36:16 +00:00
|
|
|
-a 0x20000 \
|
|
|
|
-b $$(( $(subst k, * 1024,$(kern_size)) )) \
|
2023-08-27 08:29:12 +00:00
|
|
|
-f $(rtfs_bin),) \
|
|
|
|
$(if $(apnd_bin),\
|
|
|
|
-A $(apnd_bin) \
|
|
|
|
-a 0x20000)
|
2021-03-07 17:36:16 +00:00
|
|
|
mv $@.new $@
|
|
|
|
endef
|
|
|
|
|
mediatek: add alternative UBI NAND layout for Linksys E8450
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>
2021-02-09 23:07:42 +00:00
|
|
|
define Build/bl2
|
mediatek: rework support for BananaPi BPi-R64
**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>
2021-02-27 14:17:09 +00:00
|
|
|
cat $(STAGING_DIR_IMAGE)/mt7622-$1-bl2.img >> $@
|
mediatek: add alternative UBI NAND layout for Linksys E8450
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>
2021-02-09 23:07:42 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/bl31-uboot
|
mediatek: rework support for BananaPi BPi-R64
**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>
2021-02-27 14:17:09 +00:00
|
|
|
cat $(STAGING_DIR_IMAGE)/mt7622_$1-u-boot.fip >> $@
|
mediatek: add alternative UBI NAND layout for Linksys E8450
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>
2021-02-09 23:07:42 +00:00
|
|
|
endef
|
|
|
|
|
mediatek: Add support for D-Link EAGLE PRO AI M32
Specification:
- MT7622BV SoC with 2.4GHz wifi
- MT7975AN + MT7915AN for 5GHz
- MT7531BE Switch
- 512MB RAM
- 128 MB flash
- 3 LEDs (red, orange, white)
- 2 buttons (WPS and Reset)
MAC addresses:
- WAN MAC is stored in partition "Odm" at offset 0x83
- LAN (as printed on the device) is WAN MAC + 1
- WLAN MAC (2.4 GHz) is WAN MAC + 2
- WLAN MAC (5GHz) is WAN MAC + 3
Disassembly: Remove 4 screws in the bottom and 2 screws in the top (after removing the blue cover on the top), then the board can be pulled out.
The pins for the serial console are already labeled on the board (VCC, TX, RX, GND). Serial settings: 3.3V, 115200,8n1
Flashing via Recovery Web Interface:
- Set your IP address to 192.168.0.10, subnetmask 255.255.255.25
- Press the reset button while powering on the deivce
- Keep the reset button pressed until the status LED blinks fast
- Open a Chromium based and goto http://192.168.0.1
- Download openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-a1-squashfs-recovery.bin
Flashing via uBoot:
- Open the case, connect to the UART console
- Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
- Run a tftp server which provides openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-initramfs-kernel.bin. You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later.
- Power on the device and select "1. System Load Linux to SDRAM via TFTP." in the boot menu
- Enter image file, tftp server IP and device IP (if they differ from the default).
- TFTP download to RAM will start. After a few seconds OpenWrt initramfs should start
- The initramfs is accessible via 192.168.1.1, change your IP address accordingly (or use multiple IP addresses on your interface)
- Create a backup of the Kernel1 partition, this file is required if a revert to stock should be done later
- Perform a sysupgrade using openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-squashfs-sysupgrade.bin
- Reboot the device. OpenWrt should start from flash now
Revert back to stock using the Recovery Web Interface:
- Set your IP address to 192.168.0.10, subnetmask 255.255.255.25
- Press the reset button while powering on the deivce
- Keep the reset button pressed until the status LED blinks fast
- Open a Chromium based and goto http://192.168.0.1
- Flash a decrypted firmware image from D-Link. Decrypting an firmware image is described below.
Decrypting a D-Link firmware image:
- Download https://github.com/RolandoMagico/firmware-utils/blob/M32/src/m32-firmware-util.c
- Compile a binary from the downloaded file, e.g. gcc m32-firmware-util.c -lcrypto -o m32-firmware-util
- Run ./m32-firmware-util M32 --DecryptFactoryImage <OriginalFirmware> <OutputFile>
- Example for firmware 1.03.01_HOTFIX: ./m32-firmware-util M32 --DecryptFactoryImage M32-REVA_1.03.01_HOTFIX.enc.bin M32-REVA_1.03.01_HOTFIX.decrypted.bin
Revert back to stock using uBoot:
- Open the case, connect to the UART console
- Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
- Run a tftp server which provides the previously created backup of the Kernel1 partition. You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later.
- Power on the device and select "2. System Load Linux Kernel then write to Flash via TFTP." in the boot menu
- Enter image file, tftp server IP and device IP (if they differ from the default).
- TFTP download to FLASH will start. After a few seconds the stock firmware should start again
There is also an image openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-a1-squashfs-tftp.bin which can directly be flashed via U-Boot and TFTP. It can be used if no backup of the Kernel1 partition is reuqired.
Flahsing via OEM web interface is currently not possible, the OEM images are encrypted and require a specific memory layout which is not compatible to the partition layout of OpenWrt.
Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
(cherry picked from commit e3a6945b58daf0cda1db1b356bed304404cb77f5)
2023-07-20 14:00:50 +00:00
|
|
|
# Append header to a D-Link M32 Kernel 1 partition
|
|
|
|
define Build/m32-recovery-header-kernel1
|
|
|
|
echo -en "DLK6E6010001\x00\x00\xCF\x33" > "$@.header"
|
|
|
|
echo -en "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x8D\x57\x30\x0B" >> "$@.header"
|
|
|
|
# Byte 0-3: Erase Start 0x002C0000
|
|
|
|
# Byte 4-7: Erase Length 0x02D00000
|
|
|
|
# Byte 8-11: Data offset: 0x002C0000
|
|
|
|
# Byte 12-15: Data Length: 0x02D00000
|
|
|
|
echo -en "\x00\x00\x2C\x00\x00\x00\xD0\x02\x00\x00\x2C\x00\x00\x00\xD0\x02" >> "$@.header"
|
|
|
|
# Only zeros
|
|
|
|
echo -en "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" >> "$@.header"
|
|
|
|
# Note: The last 2 bytes of the following line are the checksum of the header
|
|
|
|
# If any data in the header will be changed, the checksum must be re-calculated
|
|
|
|
echo -en "\x42\x48\x02\x00\x00\x00\x08\x00\x00\x00\x00\x00\x60\x6E\x68\x61" >> "$@.header"
|
|
|
|
cat "$@.header" "$@" > "$@.new"
|
|
|
|
mv "$@.new" "$@"
|
|
|
|
rm "$@.header"
|
|
|
|
endef
|
|
|
|
|
mediatek: rework support for BananaPi BPi-R64
**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>
2021-02-27 14:17:09 +00:00
|
|
|
define Build/mt7622-gpt
|
2021-03-14 19:11:14 +00:00
|
|
|
cp $@ $@.tmp 2>/dev/null || true
|
2021-03-02 19:42:10 +00:00
|
|
|
ptgen -g -o $@.tmp -a 1 -l 1024 \
|
mediatek: rework support for BananaPi BPi-R64
**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>
2021-02-27 14:17:09 +00:00
|
|
|
$(if $(findstring sdmmc,$1), \
|
2021-03-02 19:42:10 +00:00
|
|
|
-H \
|
2021-03-14 19:11:14 +00:00
|
|
|
-t 0x83 -N bl2 -r -p 512k@512k \
|
mediatek: rework support for BananaPi BPi-R64
**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>
2021-02-27 14:17:09 +00:00
|
|
|
) \
|
2021-04-10 17:16:05 +00:00
|
|
|
-t 0xef -N fip -r -p 2M@2M \
|
2021-03-14 19:11:14 +00:00
|
|
|
-t 0x83 -N ubootenv -r -p 1M@4M \
|
|
|
|
-N recovery -r -p 32M@6M \
|
mediatek: rework support for BananaPi BPi-R64
**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>
2021-02-27 14:17:09 +00:00
|
|
|
$(if $(findstring sdmmc,$1), \
|
2021-04-10 17:16:05 +00:00
|
|
|
-N install -r -p 7M@38M \
|
2022-01-22 00:20:53 +00:00
|
|
|
-t 0x2e -N production -p $(CONFIG_TARGET_ROOTFS_PARTSIZE)M@45M \
|
mediatek: rework support for BananaPi BPi-R64
**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>
2021-02-27 14:17:09 +00:00
|
|
|
) \
|
|
|
|
$(if $(findstring emmc,$1), \
|
2022-01-22 00:20:53 +00:00
|
|
|
-t 0x2e -N production -p $(CONFIG_TARGET_ROOTFS_PARTSIZE)M@40M \
|
mediatek: rework support for BananaPi BPi-R64
**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>
2021-02-27 14:17:09 +00:00
|
|
|
)
|
2021-03-02 01:41:00 +00:00
|
|
|
cat $@.tmp >> $@
|
|
|
|
rm $@.tmp
|
2019-08-02 08:33:28 +00:00
|
|
|
endef
|
2020-03-27 15:13:06 +00:00
|
|
|
|
mediatek: rework support for BananaPi BPi-R64
**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>
2021-02-27 14:17:09 +00:00
|
|
|
define Device/bananapi_bpi-r64
|
|
|
|
DEVICE_VENDOR := Bananapi
|
|
|
|
DEVICE_MODEL := BPi-R64
|
|
|
|
DEVICE_DTS := mt7622-bananapi-bpi-r64
|
2021-03-17 17:36:54 +00:00
|
|
|
DEVICE_DTS_OVERLAY := mt7622-bananapi-bpi-r64-pcie1 mt7622-bananapi-bpi-r64-sata
|
2021-03-14 19:11:14 +00:00
|
|
|
DEVICE_PACKAGES := kmod-ata-ahci-mtk kmod-btmtkuart kmod-usb3 e2fsprogs mkf2fs f2fsck
|
2023-06-06 12:04:08 +00:00
|
|
|
DEVICE_DTC_FLAGS := --pad 4096
|
2023-08-31 18:20:49 +00:00
|
|
|
DEVICE_DTS_LOADADDR := 0x43f00000
|
2021-05-01 21:31:28 +00:00
|
|
|
ARTIFACTS := emmc-preloader.bin emmc-bl31-uboot.fip sdcard.img.gz snand-preloader.bin snand-bl31-uboot.fip
|
mediatek: rework support for BananaPi BPi-R64
**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>
2021-02-27 14:17:09 +00:00
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
2021-05-01 21:31:28 +00:00
|
|
|
ARTIFACT/emmc-preloader.bin := bl2 emmc-2ddr
|
|
|
|
ARTIFACT/emmc-bl31-uboot.fip := bl31-uboot bananapi_bpi-r64-emmc
|
2021-04-10 17:16:08 +00:00
|
|
|
ARTIFACT/snand-preloader.bin := bl2 snand-2ddr
|
|
|
|
ARTIFACT/snand-bl31-uboot.fip := bl31-uboot bananapi_bpi-r64-snand
|
2021-03-24 13:44:52 +00:00
|
|
|
ARTIFACT/sdcard.img.gz := mt7622-gpt sdmmc |\
|
|
|
|
pad-to 512k | bl2 sdmmc-2ddr |\
|
|
|
|
pad-to 2048k | bl31-uboot bananapi_bpi-r64-sdmmc |\
|
2022-09-08 01:44:30 +00:00
|
|
|
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\
|
2022-09-08 18:29:44 +00:00
|
|
|
pad-to 6144k | append-image-stage initramfs-recovery.itb | check-size 38912k |\
|
2022-09-08 01:44:30 +00:00
|
|
|
) \
|
2021-04-10 17:16:05 +00:00
|
|
|
pad-to 38912k | mt7622-gpt emmc |\
|
|
|
|
pad-to 39424k | bl2 emmc-2ddr |\
|
|
|
|
pad-to 40960k | bl31-uboot bananapi_bpi-r64-emmc |\
|
2021-04-10 17:16:08 +00:00
|
|
|
pad-to 43008k | bl2 snand-2ddr |\
|
|
|
|
pad-to 43520k | bl31-uboot bananapi_bpi-r64-snand |\
|
2023-05-26 09:26:49 +00:00
|
|
|
$(if $(CONFIG_TARGET_ROOTFS_SQUASHFS), \
|
|
|
|
pad-to 46080k | append-image squashfs-sysupgrade.itb | check-size |\
|
|
|
|
) \
|
|
|
|
gzip
|
2023-06-15 14:11:27 +00:00
|
|
|
ifeq ($(DUMP),)
|
2022-09-08 01:44:30 +00:00
|
|
|
IMAGE_SIZE := $$(shell expr 45 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
|
2023-06-15 14:11:27 +00:00
|
|
|
endif
|
mediatek: rework support for BananaPi BPi-R64
**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>
2021-02-27 14:17:09 +00:00
|
|
|
KERNEL := kernel-bin | gzip
|
2021-03-02 19:42:11 +00:00
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb with-initrd | pad-to 128k
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb external-static-with-rootfs | append-metadata
|
2023-06-04 18:55:11 +00:00
|
|
|
DEVICE_COMPAT_VERSION := 1.1
|
|
|
|
DEVICE_COMPAT_MESSAGE := Device tree overlay mechanism needs bootloader update
|
2020-06-04 12:26:11 +00:00
|
|
|
endef
|
mediatek: rework support for BananaPi BPi-R64
**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>
2021-02-27 14:17:09 +00:00
|
|
|
TARGET_DEVICES += bananapi_bpi-r64
|
2020-06-04 12:26:11 +00:00
|
|
|
|
2021-03-07 17:36:16 +00:00
|
|
|
define Device/buffalo_wsr-2533dhp2
|
|
|
|
DEVICE_VENDOR := Buffalo
|
|
|
|
DEVICE_MODEL := WSR-2533DHP2
|
|
|
|
DEVICE_DTS := mt7622-buffalo-wsr-2533dhp2
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
IMAGE_SIZE := 59392k
|
|
|
|
KERNEL_SIZE := 4096k
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
SUBPAGESIZE := 512
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BUFFALO_TAG_PLATFORM := MTK
|
|
|
|
BUFFALO_TAG_VERSION := 9.99
|
|
|
|
BUFFALO_TAG_MINOR := 9.99
|
|
|
|
IMAGES += factory.bin factory-uboot.bin
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | \
|
2023-08-27 08:29:12 +00:00
|
|
|
buffalo-trx
|
|
|
|
IMAGE/factory.bin := append-ubi | \
|
|
|
|
buffalo-trx 0x32504844 $$$$@ $(KDIR)/ubi_mark | \
|
2021-03-07 17:36:16 +00:00
|
|
|
buffalo-enc WSR-2533DHP2 $$(BUFFALO_TAG_VERSION) -l | \
|
|
|
|
buffalo-tag-dhp WSR-2533DHP2 JP JP | buffalo-enc-tag -l | buffalo-dhp-image
|
2023-08-27 08:29:12 +00:00
|
|
|
IMAGE/factory-uboot.bin := append-ubi | \
|
|
|
|
buffalo-trx 0x32504844 $$$$@ $(KDIR)/ubi_mark
|
|
|
|
IMAGE/sysupgrade.bin := \
|
|
|
|
buffalo-trx 0x32504844 $(KDIR)/tmp/$$(DEVICE_NAME).null | \
|
2021-03-07 17:36:16 +00:00
|
|
|
sysupgrade-tar kernel=$$$$@ | append-metadata
|
2022-12-17 12:50:55 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7615-firmware swconfig
|
2021-03-07 17:36:16 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += buffalo_wsr-2533dhp2
|
|
|
|
|
2023-08-27 14:23:20 +00:00
|
|
|
define Device/buffalo_wsr-3200ax4s
|
|
|
|
DEVICE_VENDOR := Buffalo
|
|
|
|
DEVICE_MODEL := WSR-3200AX4S
|
|
|
|
DEVICE_DTS := mt7622-buffalo-wsr-3200ax4s
|
|
|
|
IMAGE_SIZE := 24576k
|
|
|
|
BUFFALO_TRX_MAGIC := 0x33504844
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
KERNEL_SIZE := 6144k
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BUFFALO_TAG_PLATFORM := MTK
|
|
|
|
BUFFALO_TAG_VERSION := 9.99
|
|
|
|
BUFFALO_TAG_MINOR := 9.99
|
|
|
|
IMAGES += factory.bin factory-uboot.bin
|
|
|
|
KERNEL_INITRAMFS = kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | \
|
|
|
|
buffalo-trx
|
|
|
|
IMAGE/factory.bin = append-ubi | \
|
|
|
|
buffalo-trx $$$$(BUFFALO_TRX_MAGIC) $$$$@ $(KDIR)/ubi_mark | \
|
|
|
|
buffalo-enc $$(DEVICE_MODEL) $$(BUFFALO_TAG_VERSION) -l | \
|
|
|
|
buffalo-tag-dhp $$(DEVICE_MODEL) JP JP | buffalo-enc-tag -l | buffalo-dhp-image
|
|
|
|
IMAGE/factory-uboot.bin := append-ubi | \
|
|
|
|
buffalo-trx $$$$(BUFFALO_TRX_MAGIC) $$$$@ $(KDIR)/ubi_mark
|
|
|
|
IMAGE/sysupgrade.bin := \
|
|
|
|
buffalo-trx $$$$(BUFFALO_TRX_MAGIC) $(KDIR)/tmp/$$(DEVICE_NAME).null | \
|
|
|
|
sysupgrade-tar kernel=$$$$@ | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += buffalo_wsr-3200ax4s
|
|
|
|
|
mediatek: Add support for D-Link EAGLE PRO AI M32
Specification:
- MT7622BV SoC with 2.4GHz wifi
- MT7975AN + MT7915AN for 5GHz
- MT7531BE Switch
- 512MB RAM
- 128 MB flash
- 3 LEDs (red, orange, white)
- 2 buttons (WPS and Reset)
MAC addresses:
- WAN MAC is stored in partition "Odm" at offset 0x83
- LAN (as printed on the device) is WAN MAC + 1
- WLAN MAC (2.4 GHz) is WAN MAC + 2
- WLAN MAC (5GHz) is WAN MAC + 3
Disassembly: Remove 4 screws in the bottom and 2 screws in the top (after removing the blue cover on the top), then the board can be pulled out.
The pins for the serial console are already labeled on the board (VCC, TX, RX, GND). Serial settings: 3.3V, 115200,8n1
Flashing via Recovery Web Interface:
- Set your IP address to 192.168.0.10, subnetmask 255.255.255.25
- Press the reset button while powering on the deivce
- Keep the reset button pressed until the status LED blinks fast
- Open a Chromium based and goto http://192.168.0.1
- Download openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-a1-squashfs-recovery.bin
Flashing via uBoot:
- Open the case, connect to the UART console
- Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
- Run a tftp server which provides openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-initramfs-kernel.bin. You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later.
- Power on the device and select "1. System Load Linux to SDRAM via TFTP." in the boot menu
- Enter image file, tftp server IP and device IP (if they differ from the default).
- TFTP download to RAM will start. After a few seconds OpenWrt initramfs should start
- The initramfs is accessible via 192.168.1.1, change your IP address accordingly (or use multiple IP addresses on your interface)
- Create a backup of the Kernel1 partition, this file is required if a revert to stock should be done later
- Perform a sysupgrade using openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-squashfs-sysupgrade.bin
- Reboot the device. OpenWrt should start from flash now
Revert back to stock using the Recovery Web Interface:
- Set your IP address to 192.168.0.10, subnetmask 255.255.255.25
- Press the reset button while powering on the deivce
- Keep the reset button pressed until the status LED blinks fast
- Open a Chromium based and goto http://192.168.0.1
- Flash a decrypted firmware image from D-Link. Decrypting an firmware image is described below.
Decrypting a D-Link firmware image:
- Download https://github.com/RolandoMagico/firmware-utils/blob/M32/src/m32-firmware-util.c
- Compile a binary from the downloaded file, e.g. gcc m32-firmware-util.c -lcrypto -o m32-firmware-util
- Run ./m32-firmware-util M32 --DecryptFactoryImage <OriginalFirmware> <OutputFile>
- Example for firmware 1.03.01_HOTFIX: ./m32-firmware-util M32 --DecryptFactoryImage M32-REVA_1.03.01_HOTFIX.enc.bin M32-REVA_1.03.01_HOTFIX.decrypted.bin
Revert back to stock using uBoot:
- Open the case, connect to the UART console
- Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
- Run a tftp server which provides the previously created backup of the Kernel1 partition. You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later.
- Power on the device and select "2. System Load Linux Kernel then write to Flash via TFTP." in the boot menu
- Enter image file, tftp server IP and device IP (if they differ from the default).
- TFTP download to FLASH will start. After a few seconds the stock firmware should start again
There is also an image openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-a1-squashfs-tftp.bin which can directly be flashed via U-Boot and TFTP. It can be used if no backup of the Kernel1 partition is reuqired.
Flahsing via OEM web interface is currently not possible, the OEM images are encrypted and require a specific memory layout which is not compatible to the partition layout of OpenWrt.
Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
(cherry picked from commit e3a6945b58daf0cda1db1b356bed304404cb77f5)
2023-07-20 14:00:50 +00:00
|
|
|
define Device/dlink_eagle-pro-ai-m32-a1
|
|
|
|
IMAGE_SIZE := 46080k
|
|
|
|
DEVICE_VENDOR := D-Link
|
|
|
|
DEVICE_MODEL := EAGLE PRO AI M32
|
|
|
|
DEVICE_VARIANT := A1
|
|
|
|
DEVICE_DTS := mt7622-dlink-eagle-pro-ai-m32-a1
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware
|
|
|
|
KERNEL_SIZE := 8192k
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
IMAGES += tftp.bin recovery.bin
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
IMAGE/tftp.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size
|
|
|
|
IMAGE/recovery.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | pad-to $$(IMAGE_SIZE) | m32-recovery-header-kernel1
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += dlink_eagle-pro-ai-m32-a1
|
|
|
|
|
2020-06-07 18:59:17 +00:00
|
|
|
define Device/elecom_wrc-2533gent
|
2020-03-27 15:13:06 +00:00
|
|
|
DEVICE_VENDOR := Elecom
|
2020-04-03 09:18:26 +00:00
|
|
|
DEVICE_MODEL := WRC-2533GENT
|
2020-03-27 15:13:06 +00:00
|
|
|
DEVICE_DTS := mt7622-elecom-wrc-2533gent
|
2021-02-18 19:17:22 +00:00
|
|
|
DEVICE_DTS_DIR := ../dts
|
2022-12-17 12:50:55 +00:00
|
|
|
DEVICE_PACKAGES := kmod-btmtkuart kmod-mt7615-firmware kmod-usb3 swconfig
|
2020-03-27 15:13:06 +00:00
|
|
|
endef
|
2020-05-29 11:49:44 +00:00
|
|
|
TARGET_DEVICES += elecom_wrc-2533gent
|
|
|
|
|
mediatek: mt7622: add support for ELECOM WRC-X3200GST3
ELECOM WRC-X3200GST3 is a 2.4/5 GHz band 11ax (Wi-Fi 6) router, based on
MT7622B.
Specifications:
- SoC : MediaTek MT7622B
- RAM : DDR3 512 MiB (Nanya NT5CC256M16ER-EK)
- Flash : SPI-NAND 128 MiB (Winbond W25N01GVZEIG)
- WLAN : 2.4/5 GHz 4T4R
- 2.4 GHz : MediaTek MT7622B (SoC)
- 5 GHz : MediaTek MT7915A
- Ethernet : 5x 10/100/1000 Mbps
- Switch : MediaTek MT7531
- LEDs/Keys : 6x/4x (2x buttons, 1x slide-switch)
- UART : through-hole on PCB
- J19: 3.3V, GND, TX, RX from power jack side
- 115200n8
- Power : 12 VDC, 1.5 A
Flash instruction using factory image:
1. Boot WRC-X3200GST3 normally with "Router" mode
2. Access to "http://192.168.2.1/" and open firmware update page
("ファームウェア更新")
3. Select the OpenWrt factory image and click apply ("適用") button
4. Wait ~120 seconds to complete flashing
MAC Addresses:
LAN : 04:AB:18:xx:xx:77 (Factory, 0x7FFF4 (hex))
WAN : 04:AB:18:xx:xx:78 (Factory, 0x7FFFA (hex))
2.4 GHz: 04:AB:18:xx:xx:79 (Factory, 0x4 (hex))
5 GHz : 04:AB:18:xx:xx:7A (none)
Note:
- currently, there is no "phy1tpt" trigger for 5 GHz wlan (MT7915) in
"trigger" file of LEDs, use "phy1radio" trigger instead
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2021-04-23 09:32:11 +00:00
|
|
|
define Device/elecom_wrc-x3200gst3
|
|
|
|
DEVICE_VENDOR := ELECOM
|
|
|
|
DEVICE_MODEL := WRC-X3200GST3
|
|
|
|
DEVICE_DTS := mt7622-elecom-wrc-x3200gst3
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
IMAGE_SIZE := 25600k
|
|
|
|
KERNEL_SIZE := 6144k
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
IMAGES += factory.bin
|
|
|
|
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | \
|
|
|
|
append-ubi | check-size | \
|
|
|
|
elecom-wrc-gs-factory WRC-X3200GST3 0.00 -N | \
|
|
|
|
append-string MT7622_ELECOM_WRC-X3200GST3
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
2022-12-17 12:50:52 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware
|
mediatek: mt7622: add support for ELECOM WRC-X3200GST3
ELECOM WRC-X3200GST3 is a 2.4/5 GHz band 11ax (Wi-Fi 6) router, based on
MT7622B.
Specifications:
- SoC : MediaTek MT7622B
- RAM : DDR3 512 MiB (Nanya NT5CC256M16ER-EK)
- Flash : SPI-NAND 128 MiB (Winbond W25N01GVZEIG)
- WLAN : 2.4/5 GHz 4T4R
- 2.4 GHz : MediaTek MT7622B (SoC)
- 5 GHz : MediaTek MT7915A
- Ethernet : 5x 10/100/1000 Mbps
- Switch : MediaTek MT7531
- LEDs/Keys : 6x/4x (2x buttons, 1x slide-switch)
- UART : through-hole on PCB
- J19: 3.3V, GND, TX, RX from power jack side
- 115200n8
- Power : 12 VDC, 1.5 A
Flash instruction using factory image:
1. Boot WRC-X3200GST3 normally with "Router" mode
2. Access to "http://192.168.2.1/" and open firmware update page
("ファームウェア更新")
3. Select the OpenWrt factory image and click apply ("適用") button
4. Wait ~120 seconds to complete flashing
MAC Addresses:
LAN : 04:AB:18:xx:xx:77 (Factory, 0x7FFF4 (hex))
WAN : 04:AB:18:xx:xx:78 (Factory, 0x7FFFA (hex))
2.4 GHz: 04:AB:18:xx:xx:79 (Factory, 0x4 (hex))
5 GHz : 04:AB:18:xx:xx:7A (none)
Note:
- currently, there is no "phy1tpt" trigger for 5 GHz wlan (MT7915) in
"trigger" file of LEDs, use "phy1radio" trigger instead
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2021-04-23 09:32:11 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += elecom_wrc-x3200gst3
|
|
|
|
|
2021-02-02 15:29:58 +00:00
|
|
|
define Device/linksys_e8450
|
|
|
|
DEVICE_VENDOR := Linksys
|
|
|
|
DEVICE_MODEL := E8450
|
|
|
|
DEVICE_ALT0_VENDOR := Belkin
|
|
|
|
DEVICE_ALT0_MODEL := RT3200
|
|
|
|
DEVICE_DTS := mt7622-linksys-e8450
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2022-12-17 12:50:52 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3
|
2021-02-02 15:29:58 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += linksys_e8450
|
|
|
|
|
mediatek: add alternative UBI NAND layout for Linksys E8450
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>
2021-02-09 23:07:42 +00:00
|
|
|
define Device/linksys_e8450-ubi
|
|
|
|
DEVICE_VENDOR := Linksys
|
|
|
|
DEVICE_MODEL := E8450
|
|
|
|
DEVICE_VARIANT := UBI
|
|
|
|
DEVICE_ALT0_VENDOR := Belkin
|
|
|
|
DEVICE_ALT0_MODEL := RT3200
|
|
|
|
DEVICE_ALT0_VARIANT := UBI
|
|
|
|
DEVICE_DTS := mt7622-linksys-e8450-ubi
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2022-12-17 12:50:52 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3
|
mediatek: add alternative UBI NAND layout for Linksys E8450
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>
2021-02-09 23:07:42 +00:00
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
UBOOTENV_IN_UBI := 1
|
|
|
|
KERNEL_IN_UBI := 1
|
|
|
|
KERNEL := kernel-bin | gzip
|
|
|
|
# recovery can also be used with stock firmware web-ui, hence the padding...
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 128k
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := bl2 snand-1ddr
|
|
|
|
ARTIFACT/bl31-uboot.fip := bl31-uboot linksys_e8450
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += linksys_e8450-ubi
|
|
|
|
|
2020-05-29 11:49:44 +00:00
|
|
|
define Device/mediatek_mt7622-rfb1
|
|
|
|
DEVICE_VENDOR := MediaTek
|
|
|
|
DEVICE_MODEL := MTK7622 rfb1 AP
|
|
|
|
DEVICE_DTS := mt7622-rfb1
|
2021-03-14 19:11:14 +00:00
|
|
|
DEVICE_PACKAGES := kmod-ata-ahci-mtk kmod-btmtkuart kmod-usb3
|
2020-05-29 11:49:44 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += mediatek_mt7622-rfb1
|
2020-07-16 07:16:34 +00:00
|
|
|
|
2021-03-01 11:42:27 +00:00
|
|
|
define Device/mediatek_mt7622-rfb1-ubi
|
2020-07-16 07:16:34 +00:00
|
|
|
DEVICE_VENDOR := MediaTek
|
2021-03-01 11:42:27 +00:00
|
|
|
DEVICE_MODEL := MTK7622 rfb1 AP (UBI)
|
2020-07-16 07:16:34 +00:00
|
|
|
DEVICE_DTS := mt7622-rfb1-ubi
|
2021-02-18 19:17:22 +00:00
|
|
|
DEVICE_DTS_DIR := ../dts
|
2021-03-14 19:11:14 +00:00
|
|
|
DEVICE_PACKAGES := kmod-ata-ahci-mtk kmod-btmtkuart kmod-usb3
|
2022-01-10 11:35:08 +00:00
|
|
|
BOARD_NAME := mediatek,mt7622-rfb1-ubi
|
2020-07-16 07:16:34 +00:00
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_SIZE := 4194304
|
|
|
|
IMAGE_SIZE := 32768k
|
|
|
|
IMAGES += factory.bin
|
|
|
|
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
|
|
|
|
check-size $$$$(IMAGE_SIZE)
|
2021-03-04 02:49:38 +00:00
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
2020-07-16 07:16:34 +00:00
|
|
|
endef
|
2021-03-01 11:42:27 +00:00
|
|
|
TARGET_DEVICES += mediatek_mt7622-rfb1-ubi
|
2021-02-11 16:09:06 +00:00
|
|
|
|
mediatek: add support for Netgear WAX206
Specifications:
* SoC: MediaTek MT7622BV
* RAM: DDR3 512 MiB (Nanya NT5CC256M16ER-EK)
* Flash: SPI-NAND 256 MiB (Toshiba TC58CVG1S3HRAIJ)
* Wi-Fi 2.4/5 GHz 4T4R:
* 2.4 GHz: MediaTek MT7622BV
* 5 GHz: MediaTek MT7915AN/MT7975AN
* Ethernet: 4x 10/100/1000 Mbps LAN,
1x 10/100/1000/2500 Mbps WAN (Realtek RTL8221B PHY)
* Switch: MediaTek MT7531AE
* LEDs/Keys: 8/1 (Power, Internet, LAN1, LAN2, LAN3, LAN4,
Wifin and Wifia dual-colour LEDs + Reset pin)
* UART: Marked J19 on board VCC GND TX RX, beginning from "1". 3.3v,
115200n8
* Power: 12 VDC, 2.5 A
Installation:
* Flash the factory image through the stock web interface, or TFTP to
the bootloader. NMRP can be used to TFTP without opening the case.
* U-Boot allows booting an initramfs image via TFTP as follows:
setenv ipaddr 192.168.1.1
setenv serverip 192.168.1.100
tftpboot openwrt-mediatek-mt7622-netgear_wax206-initramfs-recovery.itb
bootm
Known Limitations:
* The 2.5G WAN port labeled 'wan' only works for speeds up to 1G at the
moment. If connected to a multi-gig port the speed has to be manually
set to 1G/full either for the switch port or in OpenWrt. For example
add the following to /etc/rc.local to set it on boot:
/usr/sbin/ethtool -s wan speed 1000 duplex full
Revert to stock firmware:
* Flash the stock firmware to the bootloader using TFTP/NMRP.
References to WAX206 GPL source:
https://www.downloads.netgear.com/files/GPL/WAX206_V1.0.4.0_Source.rar
* openwrt/target/linux/mediatek/dts/mt7622-netgear-wax206.dts
DTS file for this device.
* openwrt/target/linux/mediatek/image/mt7622.mk
Image creation code for this device
Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
[fix WAN port (1G only), adjust partition layout, adjust image creation]
Signed-off-by: Thomas Kupper <thomas.kupper@gmail.com>
2022-09-29 20:40:31 +00:00
|
|
|
define Device/netgear_wax206
|
|
|
|
$(Device/dsa-migration)
|
|
|
|
DEVICE_VENDOR := NETGEAR
|
|
|
|
DEVICE_MODEL := WAX206
|
|
|
|
DEVICE_DTS := mt7622-netgear-wax206
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
NETGEAR_ENC_MODEL := WAX206
|
|
|
|
NETGEAR_ENC_REGION := US
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware
|
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_SIZE := 6144k
|
|
|
|
IMAGE_SIZE := 32768k
|
|
|
|
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \
|
|
|
|
append-squashfs4-fakeroot
|
|
|
|
# recovery can also be used with stock firmware web-ui, hence the padding...
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
|
|
|
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 128k
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
IMAGES += factory.img
|
|
|
|
IMAGE/factory.img := append-kernel | pad-to $$(KERNEL_SIZE) | \
|
|
|
|
append-ubi | check-size | netgear-encrypted-factory
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += netgear_wax206
|
|
|
|
|
2022-03-04 13:41:46 +00:00
|
|
|
define Device/ruijie_rg-ew3200gx-pro
|
|
|
|
DEVICE_VENDOR := Ruijie
|
|
|
|
DEVICE_MODEL := RG-EW3200GX PRO
|
|
|
|
DEVICE_DTS := mt7622-ruijie-rg-ew3200gx-pro
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2022-12-17 12:50:52 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware
|
2022-03-04 13:41:46 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += ruijie_rg-ew3200gx-pro
|
|
|
|
|
2022-10-13 18:36:40 +00:00
|
|
|
define Device/reyee_ax3200-e5
|
|
|
|
DEVICE_VENDOR := reyee
|
|
|
|
DEVICE_MODEL := AX3200 E5
|
|
|
|
DEVICE_DTS := mt7622-reyee-ax3200-e5
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2022-12-17 12:50:52 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware
|
2022-10-13 18:36:40 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += reyee_ax3200-e5
|
|
|
|
|
2021-08-23 16:18:23 +00:00
|
|
|
define Device/totolink_a8000ru
|
|
|
|
DEVICE_VENDOR := TOTOLINK
|
|
|
|
DEVICE_MODEL := A8000RU
|
|
|
|
DEVICE_DTS := mt7622-totolink-a8000ru
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2022-12-17 12:50:55 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7615-firmware swconfig
|
2021-08-23 16:18:23 +00:00
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += totolink_a8000ru
|
|
|
|
|
2022-05-31 17:18:06 +00:00
|
|
|
define Device/ubnt_unifi-6-lr-v1
|
2021-02-11 16:09:06 +00:00
|
|
|
DEVICE_VENDOR := Ubiquiti
|
|
|
|
DEVICE_MODEL := UniFi 6 LR
|
2022-05-31 17:18:06 +00:00
|
|
|
DEVICE_VARIANT := v1
|
2021-03-17 23:56:02 +00:00
|
|
|
DEVICE_DTS_CONFIG := config@1
|
2022-05-31 17:18:06 +00:00
|
|
|
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v1
|
2021-02-18 19:17:22 +00:00
|
|
|
DEVICE_DTS_DIR := ../dts
|
2022-12-17 12:50:52 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware kmod-leds-ubnt-ledbar
|
2022-05-31 17:18:06 +00:00
|
|
|
SUPPORTED_DEVICES += ubnt,unifi-6-lr
|
2021-02-11 16:09:06 +00:00
|
|
|
endef
|
2022-05-31 17:18:06 +00:00
|
|
|
TARGET_DEVICES += ubnt_unifi-6-lr-v1
|
2021-04-02 23:43:50 +00:00
|
|
|
|
2022-05-31 17:49:49 +00:00
|
|
|
define Device/ubnt_unifi-6-lr-v1-ubootmod
|
2021-04-02 23:43:50 +00:00
|
|
|
DEVICE_VENDOR := Ubiquiti
|
|
|
|
DEVICE_MODEL := UniFi 6 LR
|
2022-05-31 17:49:49 +00:00
|
|
|
DEVICE_VARIANT := v1 U-Boot mod
|
|
|
|
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v1-ubootmod
|
2021-04-02 23:43:50 +00:00
|
|
|
DEVICE_DTS_DIR := ../dts
|
2022-12-17 12:50:52 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware kmod-leds-ubnt-ledbar
|
2021-04-02 23:43:50 +00:00
|
|
|
KERNEL := kernel-bin | lzma
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | pad-rootfs | append-metadata
|
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := bl2 nor-2ddr
|
2023-08-27 23:14:10 +00:00
|
|
|
ARTIFACT/bl31-uboot.fip := bl31-uboot ubnt_unifi-6-lr-v1
|
2022-05-31 17:49:49 +00:00
|
|
|
SUPPORTED_DEVICES += ubnt,unifi-6-lr-ubootmod
|
2021-04-02 23:43:50 +00:00
|
|
|
endef
|
2022-05-31 17:49:49 +00:00
|
|
|
TARGET_DEVICES += ubnt_unifi-6-lr-v1-ubootmod
|
2021-12-01 01:27:39 +00:00
|
|
|
|
2022-05-31 17:52:24 +00:00
|
|
|
define Device/ubnt_unifi-6-lr-v2
|
|
|
|
DEVICE_VENDOR := Ubiquiti
|
|
|
|
DEVICE_MODEL := UniFi 6 LR
|
|
|
|
DEVICE_VARIANT := v2
|
|
|
|
DEVICE_DTS_CONFIG := config@1
|
|
|
|
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v2
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2022-12-17 12:50:52 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware
|
2022-05-31 17:52:24 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += ubnt_unifi-6-lr-v2
|
|
|
|
|
|
|
|
define Device/ubnt_unifi-6-lr-v2-ubootmod
|
|
|
|
DEVICE_VENDOR := Ubiquiti
|
|
|
|
DEVICE_MODEL := UniFi 6 LR
|
|
|
|
DEVICE_VARIANT := v2 U-Boot mod
|
|
|
|
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v2-ubootmod
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
2022-12-17 12:50:52 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware
|
2022-05-31 17:52:24 +00:00
|
|
|
KERNEL := kernel-bin | lzma
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | pad-rootfs | append-metadata
|
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := bl2 nor-2ddr
|
2023-08-27 23:14:10 +00:00
|
|
|
ARTIFACT/bl31-uboot.fip := bl31-uboot ubnt_unifi-6-lr-v2
|
2022-05-31 17:52:24 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += ubnt_unifi-6-lr-v2-ubootmod
|
|
|
|
|
2023-08-27 23:14:10 +00:00
|
|
|
define Device/ubnt_unifi-6-lr-v3
|
|
|
|
DEVICE_VENDOR := Ubiquiti
|
|
|
|
DEVICE_MODEL := UniFi 6 LR
|
|
|
|
DEVICE_VARIANT := v3
|
|
|
|
DEVICE_DTS_CONFIG := config@1
|
|
|
|
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v3
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += ubnt_unifi-6-lr-v3
|
|
|
|
|
|
|
|
define Device/ubnt_unifi-6-lr-v3-ubootmod
|
|
|
|
DEVICE_VENDOR := Ubiquiti
|
|
|
|
DEVICE_MODEL := UniFi 6 LR
|
|
|
|
DEVICE_VARIANT := v3 U-Boot mod
|
|
|
|
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v3-ubootmod
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware
|
|
|
|
KERNEL := kernel-bin | lzma
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
|
|
|
IMAGES := sysupgrade.itb
|
|
|
|
IMAGE/sysupgrade.itb := append-kernel | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | pad-rootfs | append-metadata
|
|
|
|
ARTIFACTS := preloader.bin bl31-uboot.fip
|
|
|
|
ARTIFACT/preloader.bin := bl2 nor-2ddr
|
|
|
|
ARTIFACT/bl31-uboot.fip := bl31-uboot ubnt_unifi-6-lr-v3
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += ubnt_unifi-6-lr-v3-ubootmod
|
|
|
|
|
2021-12-01 01:27:39 +00:00
|
|
|
define Device/xiaomi_redmi-router-ax6s
|
|
|
|
DEVICE_VENDOR := Xiaomi
|
|
|
|
DEVICE_MODEL := Redmi Router AX6S
|
|
|
|
DEVICE_ALT0_VENDOR := Xiaomi
|
|
|
|
DEVICE_ALT0_MODEL := Router AX3200
|
|
|
|
DEVICE_DTS := mt7622-xiaomi-redmi-router-ax6s
|
|
|
|
DEVICE_DTS_DIR := ../dts
|
|
|
|
BOARD_NAME := xiaomi,redmi-router-ax6s
|
2022-12-17 12:50:52 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915-firmware
|
2021-12-01 01:27:39 +00:00
|
|
|
UBINIZE_OPTS := -E 5
|
|
|
|
IMAGES += factory.bin
|
|
|
|
BLOCKSIZE := 128k
|
|
|
|
PAGESIZE := 2048
|
|
|
|
KERNEL_SIZE := 4096k
|
|
|
|
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
|
|
|
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi
|
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += xiaomi_redmi-router-ax6s
|