Commit Graph

16 Commits (90daff4cf8a86622012217d3be7ce136c313a896)

Author SHA1 Message Date
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 071a637276 ath79: move lzma-loader to the end of available RAM
In certain cases, the uncompressed initramfs image will overwrite
the lzma-loader, which is currently only 10 MB away from kernel image
start. To prevent this, change LZMA_TEXT_START to 24 MB, so loader
and compressed image have 8 MB at the end of RAM and uncompressed
image has 24 MB available.

This is only enabled for ath79 at the moment, as there we can be sure
that all devices have 32+ MB RAM and TARGET_INITRAMFS_COMPRESSION_LZMA
is not enabled there.

Despite, since lzma-loader is currently build specifically for ath79
anyway, there is no need to re-specify LOADADDR and LZMA_TEXT_START
in image/Makefile, so the values are set directly in
image/lzma-loader/Makefile and the overwrite in image/Makefile is
removed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Adrian Schmutzler 95030ac0b6 ath79: rename ATH_SOC to SOC
This replaces ATH_SOC by the newly introduced common SOC device
variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler fe534392a5 ath79: revert erroneous second addition of files for WNDR4300
There are two recent commits stating to add support for Netgear
WNDR4300, where the second one seems to be just leftover from
an earlier patch having been rebased.

Since the first patch already provides support in the most recent
state, just revert the second one.

This reverts commit cd87272eb2.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Michal Cieslakiewicz cd87272eb2 ath79: add support for Netgear WNDR4300
This patch adds ath79 support for Netgear WNDR4300.
Router was previously supported by ar71xx target only.
Note: device requires 'ar934x-nand' driver in kernel.

Specification
=============
  * Description: Netgear WNDR4300
  * Loader: U-boot
  * SOC: Atheros AR9344 (560 MHz)
  * RAM: 128 MiB
  * Flash: 128 MiB (NAND)
	- U-boot binary: 256 KiB
	- U-boot environment: 256 KiB
	- ART: 256 KiB
	- POT: 512 KiB
	- Language: 2 MiB
	- Config: 512 KiB
	- Traffic Meter: 3 MiB
	- Firmware: 25 MiB
	- ART Backup: 256 KiB
	- Reserved: 96 MiB
  * Ethernet: 5 x 10/100/1000 (4 x LAN, 1 x WAN) (AR8327)
  * Wireless:
	- 2.4 GHz b/g/n (internal)
	- 5 GHz a/n (AR9580)
  * USB: yes, 1 x USB 2.0
  * Buttons:
	- Reset
	- WiFi (rfkill)
	- WPS
  * LEDs:
	- Power (amber/green)
	- WAN (amber/green)
	- WLAN 2G (green)
	- WLAN 5G (blue)
	- 4 x LAN (amber/green)
	- USB (green)
	- WPS (amber/green)
  * UART: 4-pin connector JP1, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 2.5A
  * MAC addresses: LAN=WLAN2G on case label, WAN +1, WLAN5G +2

Installation
============
  * TFTP recovery
  * TFTP via U-boot prompt
  * sysupgrade
  * Web interface

Note about partitioning: firmware partition offset (0x6c0000) is
hardcoded into vendor's u-boot, so this partition cannot be moved
and resized to include Netgear-specific flash areas (pot, language,
config, traffic_meter) not used by OpenWrt.

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_nand=y
CONFIG_TARGET_ath79_nand_DEVICE_netgear_wndr4300=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Chuanhong Guo 4d5dae2741 ath79: add support for PISEN WMB001N
Specifications:
- SoC: AR9341
- RAM: 64M
- Flash: 16M
- Ethernet: 1 * FE port
- WiFi: ar934x-wmac
- Sound: WM8918 DAC
         1 * 3.5mm headphone jack
         2 * RCA connectors for speakers
         1 * SPDIF out
- USB: 1 * USB2.0 port

Flash instruction:
 Upload generated factory image via vendor's web interface.

Notes:
A. Audio stuff:
 1. Since AR934x, all pins for peripheral blocks can be mapped to
    any available GPIOs. We currently don't have a PCM/I2S driver
    for AR934x so pinmux for i2s and SPDIF are bound to i2c gpio
    node. This should be moved into I2S node when a PCM/I2S driver
    is available.
 2. The i2c-gpio node is for WM8918. DT binding for it can't be added
    currently due to a missing clock from I2S PLL.

B. Factory image:
 Image contains a image header and a tar.gz archive.
 1. Header: A 288 byte header that has nothing to do with appended
    tarball. Format:
     0x0-0x7 and 0x18-0x1F: magic values
     0x20: Model number string
     0xFC: Action string. It's either "update" or "backup"
     0x11C: A 1 byte checksum. It's XOR result of 0x8-0x11B
    Firmware doesn't care about the rest of the header as long as
    checksum result is correct.
    The same header is used for backup and update routines so the
    magic values and model number can be obtained by generating a
    backup bin and grab values from it.
 2. Tarball: It contains two files named uImage and rootfs, which
    will be flashed into corresponding mtd partition.
 Writing a special utility that can only output a fixed binary
 blob is overkill so factory image header is placed under
 image/bin instead.

C. LED
 The wifi led has "Wi-Fi" marked on the case but vendor's firmware
 used it as system status indicator. I did the same in this device
 support patch.

D. Firmware
 Factory u-boot is built without 'savenv' support so it's impossible
 to change kernel offset. A 2MB kernel partition won't be enough in
 the future. OKLI loader is used here to migrate this problem:
  1. add OKLI image magic support into uImage parser.
  2. build an OKLI loader, compress it with lzma and add a normal
     uImage header.
  3. flash the loader to where the original kernel supposed to be.
  4. create a uImage firmware using OKLI loader.
  5. flash the created firmware to where rootfs supposed to be.
 By doing so, u-boot will start OKLI loader, which will then load
 the actual kernel at 0x20000.

 The kernel partition is 2MB, which is too much for our loader.
 To save this space, "mtd-concat" is used here:
  1. create a 64K (1 erase block) partition for OKLI loader and
     create another partition with the left space.
  2. concatenate rootfs and this partition into a virtual flash.
  3. use the virtual flash for firmware partition.

 Currently OKLI loader is flashed with factory image only.
 sysupgrade won't replace it. Since it only has one function
 and it works for several years, its unlikely to have some bugs
 that requires a replacement.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
INAGAKI Hiroshi 23519edbca ath79: add support for Buffalo BHR-4GRV2
Buffalo BHR-4GRV2 is a wired router, based on Qualcomm Atheros
QCA9558.
Ported from ar71xx target.

Specification:

- Qualcomm Atheros QCA9558
- 64 MB of RAM
- 16 MB of Flash
- 5x 10/100/1000 Ethernet
  - QCA8337N
- 4x LEDs, 2x keys
- UART header on PCB
  - Vcc, TX, RX, GND from LED side
  - 115200n8

Flash instruction using factory image:

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

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Zoltan HERPAI 51dd8ec62f ath79: add Netgear WNR612 v2
Netgear WNR612 v2:
 - cpu Atheros AR7240 (Python) @400MHz
 - flash 4MB
 - ram 32MB
 - ethernet 10/100: 1xwan + 2xlan (only two)
 - radio AR9285

As there is a rebranded WNR612v2 called ON Networks N150R, add
a dtsi which includes all device support, and add a separate dts
for the device only (with a separate one for the subsequent N150R).

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
6 years ago
Marty E. Plummer 0e81968ee8 ath79: add initial nand support for gl-ar300m
Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
6 years ago
Matthias Schiffer c57e182b56
ath79: lzma-loader: sync with ar71xx target
Import all improvements made in the lzma-loader since development on the
ath79 target started.

This also reverts fe594bf90d ("ath79: fix loader-okli, lzma-loader"), as
is obsoleted by 2ad60168b6af ("ar71xx: lzma-loader: move padding workaround
to gzip step").

Likely, many of the changes should be ported to the ramips lzma-loader as
well, but I don't have a device to test this.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Alex Maclean fc8360aa16 ath79: add tiny subtarget
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
6 years ago
Matthias Schiffer a5b77c9d9d
ath79: remove unused copy-file build step
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Mathias Kresin f7ec385c13 ath79: add and enforce image metadata
Add metadata to images and make the metdata mandatory.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin f77db1a590 ath79: cleanup image build code
Remove recipes for not yet migrated boards. Drop variables which aren't
required due to the switch to devicetree like boardname.

Drop the legacy image build code. Boards added to this target shouldn't
use the legacy image build code anyway.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Matthias Schiffer db34cdf6c5
ath79: Ubiquiti Airmax M: add relocate-kernel to invalidate cache
Apply ar71xx fix for broken Ubiquiti bootloader to ath79 as well.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
John Crispin 53c474abbd ath79: add new OF only target for QCA MIPS silicon
This target aims to replace ar71xx mid-term. The big part that is still
missing is making the MMIO/AHB wifi work using OF. NAND and mikrotik
subtargets will follow.

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago