Commit Graph

334 Commits (3b89849b57a88d0919b6442509131f045af580a8)

Author SHA1 Message Date
Adrian Schmutzler 3b89849b57 ramips: add common definition netgear_sercomm_nor
Like NAND-based devices, SPI-NOR based Netgear devices also share
a common setup for their images. This creates a common defition
for them in image/Makefile, so it can be reused across subtargets.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 11478524a2 ramips: consolidate Netgear devices for mt7628
This creates a common DTSI and shared image definition for the
relatively similar Netgear devices for mt7628 platform.

As a side effect, this raises SPI flash frequency for the R6120,
as it's expected to work there as well if it works for R6080 and
R6020.

Based on the data from the other devices, it also seems probable
the 5g MAC address for R6120 could be extracted from the caldata,
and the mtd-mac-address there could be dropped.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 479adb0929 ramips: consolidate recipes with uimage_padhdr
There are already two very similar recipes using uimage_padhdr
in ramips target, and a third one is about to be added.

Make the recipe more generic, so redefinitions are not necessary
anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Bjørn Mork <bjorn@mork.no> [Zyxel WAP6805]
4 years ago
David Bauer e959048c12 ramips: add support for RAVPower RP-WD009
The RAVPower RP-WD009 is a batter-powered pocket sized router with SD
card lot and USB port.

Hardware
--------
CPU:   MediaTek MT7628AN
RAM:   64M DDR2
FLASH: 16M GigaDevices SPI-NOR
WLAN:  MediaTek MT7628AN 2T2R b/g/n
       MediaTek MT7610E  1T1R n/ac
ETH:   1x FastEthernet
SD:    SD Card slot
USB:   USB 2.0

Custom PMIC on the I2C bus (address 0x0a).

Installation
------------

1. Press and hold down the reset button.

2. Power up the Device. Keep pressing the reset button for 10
   more seconds until the Globe LED lights up.

3. Attach your Computer to the Ethernet port. Assign yourself the
   address 10.10.10.1/24.

4. Access the recovery page at 10.10.10.128 and upload the OpenWrt
   factory image.

5. The flashing will take around 1 minute. The device will reboot
   automatically into OpenWrt.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Sungbo Eo a4e9c8f14b ramips: add support for netis WF2770
netis WF2770 is a 2.4/5GHz band AC750 router, based on MediaTek MT7620A.

Specifications:
- SoC: MT7620A
- RAM: DDR2 64MB
- Flash: SPI NOR 16MB
- WiFi:
  - 2.4GHz: SoC internal
  - 5GHz: MT7610EN
- Ethernet: 5x 10/100/1000Mbps
  - Switch: MT7530BU
- UART:
  - J2: 3.3V, RX, TX, GND (3.3V is the square pad) / 57600 8N1

MAC addresses in factory partition:
0x0004: LAN, WiFi 2.4GHz (label_mac-6)
0x0028: not used (label_mac-1)
0x002e: WAN (label_mac)
0x8004: WiFi 5GHz (label_mac+2)

Installation via web interface:
1.  Flash **initramfs** image through the stock web interface.
2.  Boot into OpenWrt and perform sysupgrade with sysupgrade image.

Revert to stock firmware:
1.  Perform sysupgrade with stock image.

Reviewed-by: Pawel Dembicki <paweldembicki@gmail.com>
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo c5fdab84ed ramips: tidy up image Makefile
- sort recipes alphabetically
- simplify subtarget include directives

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Chuanhong Guo 1e5d014ba2 ramips: don't reuse KERNEL_DTB for lzma-loader
mt7621 overrides KERNEL_DTB to limit dictionary size, which isn't needed
for our lzma loader.
This saves 15KB on mt7621 devices using uimage-lzma-loader.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Chuanhong Guo 75f19deb3a ramips: define image recipe for uncompressed uimage with loader
Some devices have bootloaders with broken lzma code resulting in failed
decompression or corrupted kernel code.
This image recipe allows to sacrifice 5KB for OpenWrt LZMA loader and
take over the task of decompress kernel.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Chuanhong Guo d9e9a0e6b1 ramips: define lzma loader platform in target
Loader platform is a per-soc variable instead of a per-device one.
Determine corresponding loader platform at the beginning of image
Makefile.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Chuanhong Guo 111029bea7 ramips: add missing DEVICE_VARS for lzma-loader
LOADER_TYPE is a per-device variable which should be included in
DEVICE_VARS.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Sungbo Eo 3f14f034fb treewide: omit IMAGE_SIZE argument from check-size
Now that check-size uses IMAGE_SIZE by default, we can skip the argument from
image recipes to reduce redundancy.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[do not touch ar71xx]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo 90daff4cf8 build: image: move IMAGE_SIZE to image.mk
IMAGE_SIZE is widely used in many targets. Declare it in the default template to
clean up redundant code. This also prevents deriving IMAGE_SIZE unintentionally
from the previously defined device.

While at it, remove duplicate KERNEL_SIZE declaration.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Adrian Schmutzler dc862be301 ramips: define SOC only once for uniform targets
In ramips, all devices in mt7621, mt76x8 and rt288x subtarget have
the same value set to the SOC variable for each device individually.

This patch introduces a non-device-dependent variable DEFAULT_SOC,
which is used if no specific SOC is set for a device, and thus reduces
the number of redundant definitions drastically.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 58e71e322b ramips: rename MTK_SOC to SOC
This replaces MTK_SOC by the newly introduced common SOC device
variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 0bf4d681d4 ramips: allow JCG_MAXSIZE in kiB in Build/jcg-header
This allows JCG_MAXSIZE to be specified in kilobytes. This makes
this value more consistent and easier comparable with other size
variables.

This also changes the only occurence of the variable, for Cudy WR1000.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler c4f6850efc ramips: remove unused DTS variable from DEVICE_VARS
The DTS variable has been removed in 402138d12d ("ramips: Derive
DTS name from device name in Makefile"), but the DEVICE_VARS entry
has been overlooked.

Remove it now since we are not using this variable.

This must _not_ be backported to 19.07, where the variable is still
in use.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
INAGAKI Hiroshi c1394dabf6 ramips: move "elx-header" to Makefile from mt7620.mk and mt7621.mk
I-O DATA WNPR2600G has an "elx-header", so move this definition to
generic makefile to use it from mt7621 subtarget.
This definition is also added to mt7621.mk in
f285e8634c, so remove it from mt7621.mk.

And added a line to cleanup used header file.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
NOGUCHI Hiroshi a1c6a316d2 ramips: add support for Fon FON2601
FON2601 is a wireless router.

Specification:
- SoC: Mediatek MT7620A (580MHz)
- RAM: 128 MiB
- ROM: 16 MiB SPI Flash
- Wireless:
   for 11b/g/n (upto 300 Mbps):  MT7620A built-in WMAC
   for 11a/n/ac (upto 867 Mbps): MT7662E
- Ethernet LAN: 1 port, upto 100 Mbps
- Ethernet WAN: 1 port, upto 1000 Mbps
- USB: 1 port (USB 2.0 host)
- LEDs: 4 (all can be controlled by SoC's GPIO)
- buttons: 1 (Displayed as "WPS" on enclosure)
- serial port: 57600n8
 pins: Vcc(3.3V), Rx, Tx, GND
(left to right, viewed from outside of board)

Installation (only available via UART):
  1. download sysupgrade binary image by wget command
  2. write sysupgrade binary image to Flash
     command is:
       mtd write sysupgrade.bin firmware
  3. reboot

Important Notice:
  Only one button is displayed as "WPS" on enclosure.
  However, it is configured as "reset" (factory resetting feature).

Signed-off-by: NOGUCHI Hiroshi <drvlabo@gmail.com>
[removed unrelated openwrt-keyring revert, missing -Wall for uimage_padhdr]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Adrian Schmutzler 9d87a58d34 ramips: remove ralink_default_fw_size_xxx variables
There are frequent examples of the ralink_default_fw_size_xxx
variables being used to "roughly" set flash size without caring
about the actual size of the firmware partition.

To discourage this behavior, this patch removes the variables and
just sets IMAGE_SIZE by its numeric value for each target.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 363197311b ramips: remove default IMAGE_SIZE for ramips target
Currently, ramips target defines 0x7b0000 as default IMAGE_SIZE
for all devices in ramips target, i.e. this will be set if a
device does not specify IMAGE_SIZE itself.

From 92 devices using that default due to a "missing" IMAGE_SIZE,
14 were incorrect by a small amount (i.e. still "8M" flash) and
12 were completely off ("16M", "4M", ...).

This patch thus removes the _default_ IMAGE_SIZE and defines
IMAGE_SIZE for each device individually. This should indicate to
people supporting new devices that this parameter has to be cared
about.

For the present code, this patch is cosmetical.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler a6cd311b0b ramips: support IMAGE_SIZE in kiB for Build/trx
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 7392af7520 ramips: fix ralink_default_fw_size_16M
In ramips, there are the following predefined values for IMAGE_SIZE
ralink_default_fw_size_4M    3866624   3776k   0x3B0000
ralink_default_fw_size_8M    8060928   7872k   0x7B0000
ralink_default_fw_size_16M  16121856  15744k   0xF60000
ralink_default_fw_size_32M  33226752  32448k  0x1FB0000

Out of those, the "16M" value is obviously odd, as it provides more
room for the remaining partitions than the tree others.
Of the devices in all subtargets, there are actually > 50 that have
a firmware partition with 0xFB0000 size, while only 5 (!) have
0xF60000. From the former, many are set to
ralink_default_fw_size_16M anyway, although it is wrong at the
present point.

Consequently, it makes sense to change ralink_default_fw_size_16M
to 0xFB0000, and to update IMAGE_SIZE for the 5 devices with
0xF60000.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 402138d12d ramips: Derive DTS name from device name in Makefile
This will automatically derive the DTS name as in ath79 and thus
makes specifying DTS for every device obsolete.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

---

This patch only introduces the mechanism and is then followed by
commits with renames and Makefile adjustments per subtarget.

Eventually, those can be all squashed into a single commit or left
as they are to enhance overview.
5 years ago
Chuanhong Guo 7a8d3432c7 ramips: use upstream RAW_APPENDED_DTB instead of our OWRTDTB
Upstream kernel added support for RAW_APPENDED_DTB on ralink arch
in the following commit:
02564fc89d3d ("ralink: Introduce fw_passed_dtb to arch/mips/ralink")

Use upstream solution and get rid of our OWRTDTB hack.
This commit set DEVICE_DTS to $$(DTS) instead of replacing DTS with
DEVICE_DTS in device profile because DTS variable will be dropped
in later commits.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
[Tested on mt7621/mt76x8]
Tested-by: Chuanhong Guo <gch981213@gmail.com>
[Tested on rt305x/mt7620]
Tested-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
Davide Fioravanti 62ce6d58f2 ramips: unify JCG helper command definition
This patch makes the JCG helper command definition available
for every rampis target

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
5 years ago
Jan Hoffmann 2fdd02cc7c ramips: add factory image for WNDR3700v5
This uses the existing rules for Sercomm factory images and moves them
to the ramips image Makefile, so they can be used in all subtargets.

The new factory image for WNDR3700v5 can be flashed using nmrpflash.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
5 years ago
Pawel Dembicki 1f149fcad3 firmware-utils: mkdlinkfw: add kernel image offset
Some boards with JBOOT have partiton between bootloader
and kernel image. This patch add possibility to change kernel
partition start address.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
5 years ago
Mathias Kresin fd35c5b205 build: move seama commands to image-commands.mk
Move it to image-commands.mk to get rid of duplicate recipes.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 7c1332d95f ramips: consolidate seama image build code
Create a common template which has the required image build code
defined. Add some new variables to pass individual parts to the seama
recipes.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 8e40fbff0b ramips: drop support for ALLNET ALL0239-3G and Sitecom WL-341 v3
Beside one exception, no one took care of these two remaining boards
still using the legacy image build code during the last two years.

Since OpenWrt 14.07 the ALLNET ALL0239-3G image building is broken.

The Sitecom WL-341 v3 image build code looks pretty hackish and broken.
It's questionable if the legacy image works as all.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 78ca6a5578 ramips: merge relocate compile into build recipe
Compile the loader if the relocate-kernel image recipe is used and get
rid of the legacy build code to do so.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Jo-Philipp Wich 77e2bccde8 ramips: only limit lzma dictionary size on mt7621
The changed dictionary size leads to a different LZMA header which breaks
sysupgrade image magic checkibng on at least some RT288x boards.

Since the commit message only mentions testing on MT7621 and since the
change appears to break at least one other ramips subtarget, do not take
any chances and restrict the size limitation to only MT7621.

Fixes FS#1797
Fixes 09b6755946 ("ramips: limit dictionary size for lzma compression")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
INAGAKI Hiroshi a6369206fe ath79: add support for I-O DATA WN-AC1600DGR2
I-O DATA WN-AC1600DGR2 is a 2.4/5 GHz band 11ac router, based on
Qualcomm Atheros QCA9557.

Specification:

- Qualcomm Atheros QCA9557
- 128 MB of RAM
- 16 MB of Flash
- 2.4/5 GHz wifi
  - 2.4 GHz: 2T2R (SoC internal)
  - 5 GHz: 3T3R (QCA9880)
- 5x 10/100/1000 Mbps Ethernet
- 6x LEDs, 6x keys (4x buttons, 1x slide switch)
- UART header on PCB
  - Vcc, GND, TX, RX from ethernet port side
  - 115200n8

Flash instruction using factory image:

1. Connect the computer to the LAN port of WN-AC1600DGR2
2. Connect power cable to WN-AC1600DGR2 and turn on it
3. Access to "http://192.168.0.1/" and open firmware update page
("ファームウェア")
4. Select the OpenWrt factory image and click update ("更新") button
5. Wait ~150 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Maxim Anisimov 9e2c28472c ramips: move zyimage define to common Makefile
Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
6 years ago
Felix Fietkau 09b6755946 ramips: limit dictionary size for lzma compression
In some cases, recent builds fail to boot from flash with at least some
MT7621 based devices. The error message is:
"LZMA ERROR 1 - must RESET board to recover"
Booting the same kernel via TFTP works for some reason.

Through testing I figured out that limiting the LZMA dictionary size
seems to prevent these errors

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Tobias Schramm c0167abcb0 ramips: Add lzma-loader targets
Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
6 years ago
Pawel Dembicki a5bd8de0bd ramips: add support for D-Link DWR-116-A1/2
The DWR-116-A1/2 Wireless Router is based on the MT7620N SoC.

Specification:

  MediaTek MT7620N (580 Mhz)
  32 MB of RAM
  8 MB of FLASH
  802.11bgn radio
  5x 10/100 Mbps Ethernet (1 WAN and 4 LAN)
  2x external, non-detachable antennas
  UART (J1 in A1, JP1 in A2) header on PCB (57600 8n1)
  6x LED (GPIO-controlled), 2x button
  JBOOT bootloader

Known issues:
WAN LED is drived by uartl tx pin. I decide to use this pin as
uartlite tx pin.

Installation:
Apply factory image via http web-gui.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
6 years ago
Felix Fietkau cde71a543c build: replace uses of OpenWrt with $(VERSION_DIST)
This makes the distribution name more configurable.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Mathias Kresin 6545c71d2c ramips: sync image filename with boardname
Use <manufacturer>_<modelname> as image name for board using the
devicetree compat string as boardname.

Replace the underline of the device define, to keep the SUPPORTED_DEVICES
in sync with a devicetree compat string based boardname.

Override the default SUPPORTED_DEVICES for board which are having an
userspace boardname with an underline.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
L. D. Pinney 3e36ca4b43 ramips: merge mt7628/mt7688 into mt76x8
The ramips subtargets of mt7628 and mt7688 dts files all #include "mt7628an.dtsi"

They are essentially a single subtarget.

This patch merges the ramips subtargets mt7628 and mt7688 into a single subtarget mt76x8.

Signed-off-by: L. D. Pinney <ldpinney@gmail.com>
7 years ago
Tobias Wolf bf2f09c005 ramips: Introduce CONFIG_MIPS_APPENDED_RAW_DTB to F5D8235 V1 (rt288x)
This activates the CONFIG_MIPS_APPENDED_RAW_DTB kernel configuration and
configures the F5D8235 V1 target to use append-dtb for kernel creation
instead of OWRTDTB.

Signed-off-by: Tobias Wolf <github-NTEO@vplace.de>
[Jo-Philipp Wich: rewrap commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
FUKAUMI Naoki 6b0b526a4f ramips: add support for Buffalo WCR-1166DS
Buffalo WCR-1166DS is a small wireless router with

 - MT7628AN + MT7612E
 - 64MiB DDR2 SDRAM
 - 16MiB SPI flash
 - 2T2R 11ac/a/b/g/n Wi-Fi
 - 2x 10/100M ethernet switch
 - 8x programmable LED
 - 3x button
 - UART pad on PCB (J2: 3.3V, GND, TX, RX)

factory image can be installed via stock web UI.

due to the "dual image" function in the bootloader, the second half of
the SPI flash ("firmware2" partition) cannot be used as a part of the
file system.

Signed-off-by: FUKAUMI Naoki <naobsd@gmail.com>
7 years ago
Joseph C. Lehner f93a121533 ramips: cleanup mt7620 Netgear image code
1. Reuse functions defined in `image-commands.mk`
2. Rename fakeroot image

Signed-off-by: Joseph C. Lehner <joseph.c.lehner@gmail.com>
7 years ago
Mathias Kresin 0cf581ca3a ramips: use new image build code for more devices
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 6cc0ae27b9 ramips: fix Airlink AR670W factory image
Move the mkwrgimg build step to the makefile. It will be required by
other boards as well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Felix Fietkau 478f1f6b16 ramips: append metadata to images
metadata checks are not enforced yet, because some images are still
being built by legacy code

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Mathias Kresin e7ec5df33b ramips: move edimax images to the new build code
Images installed via TFTP recovery or the Edimax webinterface of the
3g-6200n(l) are writting with the edimax header to flash.

Use only one image type for these boards. The migration to the
factory only images need to be done via TFTP recovery.

Use the same start address for the 3g-6200n(l) factory images as the
stock firmware images.

Thanks to Jan Dostrasil for reporting all the issues of the 3g-6200nl
and the patient testing of all changes.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 1cd0a4c688 image: add KERNEL_SIZE to the default device vars
This reverts commit ec37a56587 and fixes
the underlying issue.
8 years ago
Mathias Kresin 9f531efc59 ramips: remove old build code seama recipe
Now that all seama images are using the new build code this seama recipe
used with the old build code can be dropped.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 0f3600ccee ramips: move seama build recipe to Makefile
The identical build step is defined twice. Move it to the parent
Makefile to use only one version.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago