2021-02-19 01:13:26 +00:00
|
|
|
DTS_DIR := $(DTS_DIR)/mediatek
|
2020-10-24 19:15:20 +00:00
|
|
|
|
|
|
|
ifdef CONFIG_LINUX_5_4
|
|
|
|
KERNEL_LOADADDR := 0x44080000
|
|
|
|
else
|
|
|
|
KERNEL_LOADADDR := 0x44000000
|
|
|
|
endif
|
2020-05-04 14:28:11 +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
|
|
|
|
|
|
|
|
define Build/buffalo-kernel-trx
|
|
|
|
$(eval magic=$(word 1,$(1)))
|
|
|
|
$(eval dummy=$(word 2,$(1)))
|
|
|
|
$(eval kern_size=$(if $(KERNEL_SIZE),$(KERNEL_SIZE),0x400000))
|
|
|
|
|
|
|
|
$(if $(dummy),touch $(dummy))
|
|
|
|
$(STAGING_DIR_HOST)/bin/otrx create $@.new \
|
|
|
|
$(if $(magic),-M $(magic),) \
|
|
|
|
-f $@ \
|
|
|
|
$(if $(dummy),\
|
|
|
|
-a 0x20000 \
|
|
|
|
-b $$(( $(subst k, * 1024,$(kern_size)) )) \
|
|
|
|
-f $(dummy),)
|
|
|
|
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: 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
|
|
|
|
2021-03-07 17:36:16 +00:00
|
|
|
define Build/trx-nand
|
|
|
|
# kernel: always use 4 MiB (-28 B or TRX header) to allow upgrades even
|
|
|
|
# if it grows up between releases
|
|
|
|
# root: UBI with one extra block containing UBI mark to trigger erasing
|
|
|
|
# rest of partition
|
|
|
|
$(STAGING_DIR_HOST)/bin/otrx create $@.new \
|
|
|
|
-M 0x32504844 \
|
|
|
|
-f $(IMAGE_KERNEL) -a 0x20000 -b 0x400000 \
|
|
|
|
-f $@ \
|
|
|
|
-A $(KDIR)/ubi_mark -a 0x20000
|
|
|
|
mv $@.new $@
|
|
|
|
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 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
|
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 |\
|
2021-04-23 22:10:08 +00:00
|
|
|
pad-to 6144k | append-image-stage initramfs-recovery.itb |\
|
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 |\
|
2021-04-10 17:16:05 +00:00
|
|
|
pad-to 46080k | append-image squashfs-sysupgrade.itb | gzip
|
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
|
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 | \
|
|
|
|
buffalo-kernel-trx
|
|
|
|
IMAGE/factory.bin := append-ubi | trx-nand | \
|
|
|
|
buffalo-enc WSR-2533DHP2 $$(BUFFALO_TAG_VERSION) -l | \
|
|
|
|
buffalo-tag-dhp WSR-2533DHP2 JP JP | buffalo-enc-tag -l | buffalo-dhp-image
|
|
|
|
IMAGE/factory-uboot.bin := append-ubi | trx-nand
|
|
|
|
IMAGE/sysupgrade.bin := append-kernel | \
|
|
|
|
buffalo-kernel-trx 0x32504844 $(KDIR)/tmp/$$(DEVICE_NAME).null | \
|
|
|
|
sysupgrade-tar kernel=$$$$@ | append-metadata
|
2021-03-15 16:39:20 +00:00
|
|
|
DEVICE_PACKAGES := swconfig
|
2021-03-07 17:36:16 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += buffalo_wsr-2533dhp2
|
|
|
|
|
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
|
2021-03-14 19:11:14 +00:00
|
|
|
DEVICE_PACKAGES := kmod-btmtkuart 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
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915e
|
|
|
|
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
|
2021-03-14 19:11:14 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e 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
|
2021-03-14 19:11:14 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e 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
|
|
|
|
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
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915e
|
|
|
|
endef
|
|
|
|
TARGET_DEVICES += ruijie_rg-ew3200gx-pro
|
|
|
|
|
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
|
|
|
|
DEVICE_PACKAGES := swconfig
|
|
|
|
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-04-30 15:08:00 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e 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-04-30 15:08:00 +00:00
|
|
|
DEVICE_PACKAGES := kmod-mt7915e 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
|
|
|
|
ARTIFACT/bl31-uboot.fip := bl31-uboot ubnt_unifi-6-lr
|
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
|
|
|
|
|
|
|
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
|
|
|
|
DEVICE_PACKAGES := kmod-mt7915e
|
|
|
|
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
|