Commit Graph

230 Commits (fbd4214bb0727268aa535af5b600d38939ec8dbc)

Author SHA1 Message Date
Christian Lamparter e4371779d2 apm821xx: convert MR24 to use DT PHY defintion
Convert the MR24 to use the DT phy probing and at803x PHY driver.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 15faf389ad apm821xx: add linux 4.14 apm821xx patches
This patch updates the apm821xx target to use the 4.14 kernel.

4.14 finally ships with a driver for the WNDR4700's tc654 fan
controller. The custom driver is deprecated in favor of the
upstream driver and the thermal cooling definitions in the DTS
are updated.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Kevin Darbyshire-Bryant 1d2590f838 kernel: bump 4.9 to 4.9.75
Refresh patches

Fixes:  CVE-2017-5754 aka Meltdown

Tested-on: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
[fix conflict after 4.14 bump]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
6 years ago
Christian Lamparter e90dc8d272 apm821xx: convert to device-tree board detection
This patch converts all apm821xx devices to the device-tree
board-detection method. All instances of the legacy
boardnames (mbl,mr24,...) are converted to "vendor,device"
identifier.

The custom board-detection code in apm821xx.sh is removed as
it no longer serves any purpose.

Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Christian Lamparter 213ba77359 apm821xx: enable metadata for packaging
This patch enables metadata-supported image verification
for all apm821xx supported devices. Since this method comes
with a built-in image verification tool (fwtool), the previous
image checks can be removed.

Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Christian Lamparter e6604fab51 apm821xx: align device names with vendor_device format
Currently, the device name handle does not include the
manufacturer. This can make it hard do differentiate
between products from different vendors that have the
same product name. As the handle is used to derive
the image name.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Christian Lamparter 1adeecf0d3 apm821xx: dts: rename devices dts files to include the manufacturer
This patch rename all the DT source files in order to
match upstream's "manufacturer-device.dts" format.

Please note that the DEVICE_DTB isn't changed. This is
because the u-boot of the MyBook Live defines the
fdt_file variable to be "apollo3g/apollo3g.dtb".

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Christian Lamparter 70301af915 apm821xx: add product names to the dt compatible for Meraki
Meraki choose to use their product's codename as the main
compatible string. Mathias Kresin commented that this is
a poor choice as this will confuse the users and devs once
the device-tree compatible is used for board-detection and
possible the image name.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Christian Lamparter 64b36fee8e apm821xx: dts: append SoC compatible to DTS
This patch appends the "apm,bluestone" or "amcc,apollo3g"
machine compatible string to the current device tree source.

Please note that unlike other archs the PPC DT code does
not regard the machine's compatible string as a priority
list. This is explained in the kernel's usage-model.txt as follows:
"PowerPC uses a slightly different scheme where it calls the .probe()
hook from each machine_desc, and the first one returning TRUE is used.
However, this approach does not take into account the priority of the
compatible list, and probably should be avoided for new architecture
support."

For this reason, the "apm,bluestone" compatible string can't be
added to the WNDR4700. As otherwise the target specific pci
fix-up code will get ignored and this causes the ath9k WIFI
to not get initialized.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Christian Lamparter e4a50d115f apm821xx: replace DEVICE_{PROFILE|NAME} with BOARD_NAME
This patch sets the BOARD_NAME variable on each affected
apm821xx device. The existing DEVICE_PROFILE and
DEVICE_NAME assignments are deprecated as they no longer
serve any purpose.

The BOARD_NAME variable is used by the sysupgrade-tar
method to specifiy a directory overwrite for the
sysupgrade-$dir directory in the generated tar file.
Keeping the original boardname in this context will be
necessary for targets that utilize the sysupgrade-tar
method. Otherwise, sysupgrade on an previous installation
will not recognize the newly generated images.

This step is necessary since an upcoming patch realigns
the existing shortname for a device with a proper
"manufacturer_device" identifier.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Christian Lamparter f895f1e51a apm821xx: replace whitespace with tabs
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Christian Lamparter 7c2106696d apm821xx: explicitly build the rootfs.img.gz target
The commit 87b668765e
("image: when using the new image build code, gzip ext4 images by default")

forced that all targets that select the ext4 as the root filesystem
to always compress the generated rootfs. This is fine, but this method
doesn't not allow to append the metadata on a per-target base.

Therefore this patch changes the rootfs image production rule to generate
the gzip step manually. This way the metadata can be appended at a later
date.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Christian Lamparter cb02a376b3 apm821xx: use x86's upgrade scripts for MyBook Live
Advantages:
 - preserves existing partition layout. On the hard-drive.
   Only the boot and rootfs partition will be overwritten.

Disadvantages:
 - The upgrade process takes much longer to run.
   from 2-3 seconds to 15-25 seconds.

Please note that sysupgrade will refuse to upgrade, if the existing
installation has an incompatible partition layout. Future changes
to the bootfs and/or rootfs partition size will likely cause breakage
to the sysupgrade procedure. In these cases, the ext4-rootfs.img.gz
has to be written manually onto the disk. Please don't forget to backup
your configuration in this cases.

Note2: This patch requires
"base-files: upgrade: make get_partitions() endian agnostic"

Note3: If your current installation does not host the two
changes, sysupgrading will wipe the existing partition
layout. Don't forget to backup your data!

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Christian Lamparter 0cad9f09be apm821xx: MyBook Live convert to DT PHY
Changes MyBook Live to use DT PHY probing and the broadcom phy driver.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Christian Lamparter 6ad56fb34c apm821xx: convert to dt based diag LED script
Please note that users with a Netgear WNDR4700
will need to update the device-tree partition
manually.

For instructions, please refere to commit 49856a4bb5
("apm821xx: make it possible to update the dtb partition on the WNDR4700")

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Zoltan HERPAI 7b5c989ab9 merge: targets: update image generation and targets
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
7 years ago
Kevin Darbyshire-Bryant 886d66abcd kernel: bump 4.9 to 4.9.57
Refresh patches.
Compile-tested for ar71xx - Archer C7 v2
Runtime-tested on  ar71xx - Archer C7 v2

Fixes the following CVEs:

- CVE-2017-7518
- CVE-2017-0786
- CVE-2017-1000255
- CVE-2017-12188
- CVE-2017-15265

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
Hauke Mehrtens 88f3c63572 kernel: update kernel 4.9 to version 4.9.40
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Mathias Kresin e4e984f2a0 treewide: use only board_name function to get name
Do not parse /tmp/sysinfo/board_name, /proc/cpuinfo or the device tree
compatible string directly. Always use the board_name function to get
the board name.

The admswconfig package still reads /proc/cpuinfo directly. The code
looks somehow broken and the whole adm5120 which uses this package
looks unmaintained. Leave it as it is for now.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin e0b9ec8e96 treewide: drop target board_name functions
They are not used any longer.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin f12a32630f treewide: use the generic board_name function
Use the generic function instead ot the target specific ones.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin ac3e05c5d7 treewide: populate boardname and model earlier
For targets using the generic board detection and board specific
settings in diag.sh, the board name is still unset at the time the
set_state() provided by diag.sh is called by 10_indicate_preinit.

Change the execution order to ensure the boardname is populated before
required the first time. Do the target specific board detection as
early as possible, directly followed by the generic one to allow a
seamless switch to the generic function for populating /tmp/sysinfo/.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Koen Vandeputte cd54b2d42b kernel: update kernel 4.9 to 4.9.37
- Refreshed all patches
- Removed upstreamed
- Adapted 4 patches:

473-fix-marvell-phy-initialization-issues.patch
-----------------------------------------------
Removed hunk 5 which got upstreamed

403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch
404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch
--------------------------------------------------------------
Adapted these 2 RFC patches, merging the delta's from an upstream commit
(see below) which made it before these 2.

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-
stable.git/commit/?h=v4.9.36&id=97ace183074d306942b903a148aebd5d061758f0

180-usb-xhci-add-support-for-performing-fake-doorbell.patch
-----------------------------------------------------------
- Moved fake_doorbell bitmask due to new item

Compile tested on: cns3xxx, imx6
Run tested on: cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
7 years ago
Stijn Tintel 880f73c327 kernel: cleanup CONFIG_SCHED_HRTICK
Remove CONFIG_SCHED_HRTICK from target configs, as it was added to the
generic config in b47fd76563.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Koen Vandeputte 69649a1b45 kernel: update kernel 4.9 to 4.9.34
- Refreshed all patches
- Adapted 1 (0031-mtd-add-SMEM-parser-for-QCOM-platforms.patch)

Compile tested on: brcm2708, cns3xxx, imx6
Run tested on: brcm2708, cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
[Compile and run tested on brcm2708]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
7 years ago
Christian Lamparter 6adc757097 apm821xx: MR24: fix ethernet phy detection on the MR24
To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
This patch fixes a problem where the AR8035 PHY can't be
detected on the Cisco Meraki MR24, when the ethernet cable
is not connected during boot.

Russell Senior reported:
|This appears to be a problem during probing of the AR8035
|phy chip. When ethernet has no link, the phy detection fails,
|and eth0 is not created. Plugging ethernet later has no effect,
|because there is no interface as far as the kernel is
|concerned. The relevant part of the boot log looks like this:
|
|[    0.876611] /plb/opb/emac-rgmii@ef601500: input 0 in RGMII mode
|[    0.882532] /plb/opb/ethernet@ef600c00: reset timeout
|[    0.888546] /plb/opb/ethernet@ef600c00: can't find PHY!
(<https://bugs.lede-project.org/index.php?do=details&task_id=687>)

Fixes FS#687
Cc: Chris Blake <chrisrblake93@gmail.com>
Reported-by: Russell Senior <russell@personaltelco.net>
Fixes: 23fbb5a87c56e98 ("emac: Fix EMAC soft reset on 460EX/GT")
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
7 years ago
Sergey Ryazanov 68e7a2a0b7 kernel: disable CONFIG_SG_POOL by default
CONFIG_SG_POOL symbol is selected only by CONFIG_SCSI, since the last
one is disabled by default then disable CONFIG_SG_POOL by default too.
And explicitly enable it only for platforms that use CONFIG_SCSI.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
7 years ago
Hauke Mehrtens 0b17375931 kernel: update kernel 4.9 to 4.9.30
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Koen Vandeputte e842e16f45 kernel: update kernel 4.9 to 4.9.29
- Refresh all patches
- Removed upstreamed
- Adapted 1

Compile tested on: bcm53xx, cns3xxx, imx6, lantiq
Run tested on: cns3xxx & imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
[update from 4.9.28 to 4.9.29]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Chris Blake 8f43ba8c48 apm821xx: Merge the Cisco Meraki MX60 & MX60W
Both of these boards share the same DTS, and hardware. The only
difference would be the PCI-E slot, and ath9k card found on the MX60W.
Due to the similarities, it would be more efficient to merge these
profiles.

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
7 years ago
Chris Blake d1c3a9485a apm821xx: Add default packages to NAND target
This moves core router packages to the NAND target, to ensure they are
applied to all images. This change is being done due to an issue found
when flashing the MX60W image, which came without these when built as a
multi image.

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
7 years ago
Christian Lamparter cead8f9dfd apm821xx: remove 4.4 kernel support
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
7 years ago
Hauke Mehrtens 31c6452107 kernel: update kernel 4.4 to 4.4.53
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Felix Fietkau 9467ce42da build: get rid of host.mk
Defined required host related variables in toplevel.mk instead

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
John Crispin 60a52cd4b4 apm821xx: adds missing symbol to v4.9 default config
Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Christian Lamparter 9a9f2f97e6 apm821xx: add linux 4.9 apm821xx patches
This patch updates the apm821xx target to use the 4.9 kernel.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
7 years ago
Joseph C. Lehner 7d00cfe9bb build: centralize fakeroot code
This patch moves the fakeroot code required by some devices to
`image-commands.mk`.

Create the fakeroot on the fly by using the undocumented -s (skip copy)
parameter of mkimage.

Signed-off-by: Joseph C. Lehner <joseph.c.lehner@gmail.com>
[remove unused NETGEAR_KERNEL_MAGIC, remove workarounds to have a dummy
rootfs for mkimage]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Hauke Mehrtens 5b089e45a6 kernel: update 4.4 kernel to 4.4.42
Refresh patches on all 4.4 supported platforms.
Compile & run tested: lantiq/xrx200

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Felix Fietkau 87b668765e image: when using the new image build code, gzip ext4 images by default
This reduces the amount of hacks in the makefile code.

Remove the apm821xx code to do the same - it was broken and left both
compressed and uncompressed images in $(BIN_DIR)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 018d80007e kernel: remove ubifs xz decompression support
It has been unused, and less useful than squashfs for cases where flash
space usage matters.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Kevin Darbyshire-Bryant 102cb4742c kernel: bump to 4.4.35
Refresh patches on all 4.4 supported platforms.

077-0005-bgmac-stop-clearing-DMA-receive-control-register-rig.patch
removed as now upstream.

Compile & run tested: ar71xx - Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
8 years ago
Christian Lamparter 49856a4bb5 apm821xx: make it possible to update the dtb partition on the WNDR4700
Currently, the device-tree partition is marked as read-only.
Hence, userspace tools like mtd can't write into the partition.
This however will be necessary in case the DTB needs to be
updated.

This patch also adds the kernel.dtb image, so the compiled
DTB is exported as a file and available in the binary
directory along the firmware images.

Note: the u-boot does expects the dtb to be a uimage.

To update the dtb manually:
 1. copy the generated dtb to the router.
 2. mtd erase /dev/mtd2
 3. mtd write wndr4700.dtb /dev/mtd2

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Chris Blake f478ec2007 apm821xx: Add support for the Cisco Meraki MX60/MX60W
This patch adds support for the Cisco Meraki MX60/MX60W Security
Appliance. Flashing information can be found at
https://github.com/riptidewave93/LEDE-MX60

Specs are as follows:
AppliedMicro APM82181 SoC at 800MHz
1GiB NAND - Samsung K9K8G08U0D
512MB DDR RAM - 4x Nanya NT5TU128M8GE-AC
Atheros AR8327-BL1A Gigabit Ethernet Switch
1x USB 2.0 Port

More info can be found at https://wiki.openwrt.org/toh/meraki/mx60

Cc: Christian Lamparter <chunkeey@gmail.com>

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
8 years ago
Stijn Tintel 8e47655d4e kernel: update kernel 4.4 to version 4.4.32
Refresh patches for all targets that support kernel 4.4.
Compile-tested on all targets that use kernel 4.4 and aren't marked broken.
Runtime-tested on ar71xx, octeon.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
8 years ago
Christian Lamparter b9f609161d apm821xx: remove replaced netgear, wndr4700-usb dwc2 definiton
This special dwc2 device definition for the Netgear WNDR4700
has been replaced by amcc,usb-otg-405ex.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Christian Lamparter ebaa82a2ca apm821xx: consolidate apm821xx device trees files
This patch moves the common SoC device tree entries
from the currently four supported platforms into a
common apm82181.dtsi.

Furthermore, this patch also changes the GPIO, IRQ and
input definitions of the supported platforms to use the
defined dt-bindings macros for GPIO_ACTIVE_LOW|HIGH,
KEY_WPS|RESTART|*, IRQ_TYPE_* when it's appropriate.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Christian Lamparter 3a112113e7 apm821xx: add amcc, usb-otg-405ex devicetree definition
This patch adds support for the amcc,usb-otg-405ex device
which is found in all APM82181 SoCs.
Note: The system can't use the generic "snps,dwc2" compatible
because of the special ahbcfg configuration. The default
GAHBCFG_HBSTLEN_INCR4 of snps,dwc2 can cause a system hang
when the USB and SATA is used concurrently.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Christian Lamparter b5638bb64e apm821xx: redo WAN green and yellow LEDs
Because the WAN port is handled by the internal AR8327N switch, the
device should use swconfig_leds trigger to handle the link activity
of the WAN LED. This has the added bonus that the WAN LED will now
go dark if there's no ethernet cable connected to the WAN port.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Christian Lamparter 8f2c2f94cf apm821xx: add back end-of-UBI marker for the WNDR4700 and MR24
The patch "build: drop UBI EOF marker from images by default"
(commit d27bce8d28) removed the
end-of-UBI marker. Without this marker, the boards will panic
during boot:

[    1.683458] ubi0: attaching mtd4
[    1.696181] ubi0 warning: scan_peb: valid VID header but corrupted EC header at PEB 31
[    1.704367] ubi0 error: scan_peb: bad image sequence number 549886691 in PEB 32, expected 184585623
[    1.713377] Erase counter header dump:
[    1.717110]  magic          0x55424923
[    1.720843]  version        1
[    1.723797]  ec             0
[    1.726752]  vid_hdr_offset 512
[    1.729880]  data_offset    2048
[    1.733094]  image_seq      549886691
[    1.736740]  hdr_crc        0x92ba8130
[    1.740472] erase counter header hexdump:
[    1.744493] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd4, error -22
[    1.751528] UBI error: cannot attach mtd4
[    1.755373] hctosys: unable to open rtc device (rtc0)
[    1.761130] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.768604] Please append a correct "root=" boot option; here are the available partitions:
[...]
[    1.856992] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.866519] Rebooting in 1 seconds..Auto calibration ---

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Rafał Miłecki c9fdb23345 apm821xx: fix USB LED trigger for WNDR4700
The old usbdev trigger never supported assigning more than 1 USB port.
This code we got was never working as expected and it was missing 2 more
ports. Switch to usbport to have LED working with all ports.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Tested-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Rafał Miłecki 0658527e1e switch to the new usbport LED trigger
This makes init.d script handle existing UCI entries using the new
trigger. It also switches all targets to use its package.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
8 years ago
Christian Lamparter 4fc48a8cf2 apm821xx: replace recovery image for the MBL with initramfs
The patch "images: bump default rootfs size to 256 MB"
a1f83bad60 caused a crash
during boot for the recovery images. This is because
both variants of the MyBook Live only have 256MB of RAM
and for the recovery option, the ext4 rootfs was simply
stored in the RAMDISK.

This patch replaces recovery image for the MBL with an
initramfs kernel.

In order to boot the initramfs (for recovery or development):

0. copy the initramfs and device tree into tftp's server directory
   # cp *-initramfs-kernel.bin to /tftp-server/mbl.bin
   # cp *-ext4-kernel.dtb to /tftp-server/fdt.bin

1. Connect the MyBook Live (Duo) serial port.
   (Warning! Use a 3.3v level shifter).

2. Hit Enter during u-boot and insert these three lines:
   # setenv serverip 192.168.1.254; setenv ipaddr 192.168.1.1;
   # tftp ${kernel_addr_r} mbl.bin; tftp ${fdt_addr_r} fdt.bin
   # run addtty addmisc; bootm ${kernel_addr_r} - ${fdt_addr_r}

   Where 192.168.1.254 is your TFTP server.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Álvaro Fernández Rojas d14c28fc80 kernel: update kernel 4.4 to version 4.4.20
Refresh patches for all targets that support kernel 4.4.
Compile-tested on brcm2708 only.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
8 years ago
Mathias Kresin a499d0a6b5 image: specify max image size in Kilobyte/Megabyte
Use the k and m unit suffix to be consistent with the blocksize.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin e7ec7a08aa image: use k as unit suffix for blocksize
Use k as unit suffix for kilobyte to have a the same unit regardless of
the used filesystem.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin d7b6f0ea88 apm821xx: image: add support for k unit suffix to boot-img
Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Christian Lamparter e9f86c6cac apm821xx: backport generic HDD led-triggers for WNDR4700 and MBL
This patch backports the new generic HDD/SDD led-trigger
from 4.8-rc1.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Christian Lamparter f7c1d9c8a5 apm821xx: detect sd-card media changes for the WNDR4700
The insertion or removal of the sd-card cannot be detected
by the hardware itself. This is by design. To workaround this,
for the WNDR4700 unload/load the dwc2 module in case the
the special SD CARD GPIO line is low/high.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Christian Lamparter 78e63ce7e3 apm821xx: add size check for initramfs kernel for the Meraki MR24
Russell Senior reported an issue with the MR24 initramfs kernels:
> ## Booting kernel from Legacy Image at 00c10000 ...
>   Image Name:   POWERPC LEDE Linux-4.4.19
>   Created:      2016-08-31  11:57:05 UTC
>   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
>   Data Size:    2155723 Bytes = 2.1 MiB
>   Load Address: 00000000
>   Entry Point:  00000000
>   Verifying Checksum ... OK
>Wrong Ramdisk Image Format
>Ramdisk image is corrupt or invalid

For the MR24, the kernel is uploaded to 0x10000. The ramdisk starts
at 0x200000. This leaves the kernel with just 0x1f0000 bytes = 1984kb.
This patch adds a size check so the image creation script will abort
instead of producing a unbootable initramfs image. A separate patch
"apm821xx: Fix initramfs image for the Meraki MR24" which fixed the
reported issue was submitted earlier.

Cc: Russell Senior <russell@personaltelco.net>
Cc: Chris Blake <chrisrblake93@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
riptidewave93 bc36678bdb apm821xx: Fix initramfs image for the Meraki MR24
When gzip is used, our kernel is too large and this causes the ramdisk
to be at the wrong offset. Fix by moving to lzma.

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
8 years ago
Felix Fietkau aa53f78038 build: fix subtarget descriptions
Move Target/Description above the target.mk include

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Stijn Tintel 8072264b96 kernel: update kernel 4.4 to version 4.4.19
Refresh patches for all targets that support kernel 4.4.
Compile-tested on all targets that use kernel 4.4 and aren't marked broken.
Runtime-tested on ar71xx, octeon and x86/64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
8 years ago
Jo-Philipp Wich 4d9fc1bd44 apm821xx: fix IB image building
Change the image build code to generate the DTB files as part of the kernel
build phase in order to fix the image build in the ImageBuilder environment.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Felix Fietkau 63b525dd6b image: add a helper variable for getting kernel/rootfs from within image Build/* templates
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Jo-Philipp Wich db49dd894e build: rename sysupgrade-nand to sysupgrade-tar
Now that the "sysupgrade-nand" step is used by non-NAND targets as well,
rename it to "sysupgrade-tar" to make it more generic.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Felix Fietkau 119b4422f8 apm821xx: only attempt to mount /boot on MyBook Live
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Christian Lamparter 3f506bdbb0 apm821xx: fix atheros PCIe cards on the MR24
The consolidation of the MR24 and WNDR4700 subtargets
into the nand subtarget broke MR24's atheros wlan.
This was because the wndr4700's board code used a
pci_fixup routines to supply the ath9k module with
the calibration data.

This is not necessary on the MR24 as it has standard
mini-pcie ports. Hence the two AR9380 mini-pcie cards
do not need any calibration data overrides.

Cc: chrisrblake93@gmail.com
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Christian Lamparter 08257a4053 apm821xx: use lzma compression for the initramfs images
The MR24's u-boot takes it sweet time decompressing the
LZMA-packed initramfs image. A user reported that
compared to the old gzip method in v2: it "takes a ton
longer to decompress like 4\x the old boot time for
decompression".

This patch also fixes a issue with the WNDR4700's initramfs
image getting to big and causing the following u-boot crash
during the decompression:

"Uncompressing Multi-File Image ... Error: inflate() returned -5
out-of-mem or overwrite error - must RESET board to recover"

This patch fixes both issues by reverting the MR24's initramfs
compression method back to gzip. And choosing to compress the
initramfs within the initramfs image as LZMA by default.

Cc: chrisrblake93@gmail.com
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Felix Fietkau 07577c5ebe tools: bring back genext2fs for apm821xx
This reverts commit 8c68c104ea.
It is used for apm821xx, which needs ext2 (not ext4) images for some
devices.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 39429b3d20 apm821xx: rework image build code for MyBook Live
Eliminate redundant mkfs calls, preparation for upcoming image build
core rework

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 3886644632 apm821xx: add DEVICE_DTS_DIR variable, remove redundant DEVICE_VARS entry
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 44c39d5812 apm821xx: add missing default profiles for subtargets
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Christian Lamparter 9e0fd1b52a apm821xx: add support for the Netgear Centria N900 WNDR4700/WNDR4720
This patch adds support for Netgear Centria N900 WNDR4700/WNDR4720

hardware highlights:

CPU:	AMCC PowerPC APM82181 Rev. E at 1000 MHz (PLB=166, OPB=83, EBC=83 MHz)
	Security support, Boot ROM Location NAND wo/ECC 2k page (8 bits)
	32 kB I-Cache 32 kB D-Cache, 256 kB L2-Cache, 32 kB OnChip Memory
Board:	AMCC APM82181 Evaluation Board, PCIE0/SATA1, 1*USB OTG
DRAM:	256 MB (ECC not enabled, 500 Mb/s, 32-bit, CL3)
NAND:	128 MiB (SLC, erase size: 128 KiB, page size: 2048, OOB size: 64)
ETH:	Atheros AR8327N Gigabit Switch (4 x LAN, 1 x WAN)
USB:	2 x 3.0 (Renesas uPD720202K8-711-BAA-A, firmware not included)
SATA:	1 x SATA-II 3.5" Hard Drive Bay for HDDs (DesignWare SATA).
WLAN1:	Atheros AR9380 5GHz 802.11an 3:3x3
WLAN2:	Atheros AR9581 2.4GHz 802.11bgn 3:3x3
SDCARD:	GL827L SD/MMC/MS Flash Card Reader (on internal dwc2 USB 2.0 host)
I2C:	GMT G781 (i2c-0 @ 0x4d - lm90 compatible temperature sensor)
	TC654    (i2c-0 @ 0x1b - Dual PWM fan Speed controller)

WARNING: The serial port needs a TTL/RS-232 v3.3 level converter!

INFO: Since this device only has a NAND chip. I opted for going with
root.squashfs in a UBI volume. There's no squashfs/jffs2 image.

This target produces three images.
  a. netgear factory image
     This image can be used to flash the Netgear WNDR4700 via the
     firmware recovery mechanism and the web admin site.

     The bootloader can be instructed to do a firmware recovery via the
     # fw_recovery
     command. It will start a tftp server and listen on 192.168.1.1
     (the ipaddr variable in u-boot) for incoming, binary tftp clients.
     The firmware recovery mechanism is also started if any of the flash
     content which contains the kernel, device-tree definitions or the
     (fake)rootfs fails to verify or load.

  b. sysupgrade.tar image for sysupgrade
     An sysupgrade will replace the entire current LEDE installation
     with a newer version. This does include the kernel and the ubi rootfs
     partition. The configuration can be carried over automatically as well
     if desired.

     simply copy the sysupgrade.tar to a the WNDR4700 running LEDE and run:

     root@lede:~# sysupgrade sysupgrade.tar

     and let it reboot.

     Note: The devicetree flash area is NOT updated. Until the devicetree
	   definition is stable, this can lead to all sorts of hardware
	   detection problems! So make sure, if you experience issues: try
	   the fw_recovery. If you are unsure whenever this affects you:
	   test if you can reproduce your issue with the initramfs method.
	   As it will always have up-to-date device-tree definitions.

  c. initramfs image for TFTP (for development and testing)
     To use the initramfs method, follow the following steps:
       1) Move the "lede-apm821xx-netgear-WNDR4700-initramfs-kernel.bin"
	  file to to the root directory of your TFTP server.

       2) rename it to wndr4700.bin

       3) On the WNDR4700 - Hit Enter during u-boot and insert:
	  # tftp 400000 wndr4700.bin; run addtty; bootm 400000 -

     This will boot the LEDE image.

     Note: The default tftp server is 192.168.1.7, if you want to change it:
     # setenv serverip 192.168.8.7;

     Note2: The default address for the WNDR4700 is 192.168.1.1:
     # setenv ipaddr 192.168.8.8;

     Note: Connect you tftp server on the last LAN port (not the WAN)

Note: The firmware for the USB 3.0 Host chip is not included anymore.
Therefore the two USB 3.0 ports will not work without the
uPD7070x-firmware package installed.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Christian Lamparter 47eeb9f857 apm821xx: lm90 add thermal sensor interface support for device tree
From 912-hwmon-lm90-expose-to-thermal-fw-via-DT.patch:
"This patch adds to lm90 temperature sensor the possibility
to expose itself as thermal zone device, registered on the
thermal framework.

The thermal zone is built only if a device tree node
describing a thermal zone for this sensor is present
inside the lm90 DT node. Otherwise, the driver behavior
will be the same."

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Christian Lamparter b46e2a6d95 apm821xx: tc654: add driver for Microchip TC654/TC655 PWM fan controllers
This patch adds a hwmon driver for the Microchip TC654 and TC655
Dual SMBus PWM Fan Speed Controllers with Fan Fault detection.

The chip is described in the DS2001734C Spec Document from Microchip.
It supports:
	- Shared PWM Fan Drive for two fans
	- Provides RPM
	- automatic PWM controller (needs additional
	  NTC/PTC Thermistors.)
	- Overtemperature alarm (when using NTC/PTC
	  Thermistors)

The TC654 is used by the Netgear WNDR47X0 to control its
system fan.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Christian Lamparter dc7efaefb5 apm821xx: add support for the Western Digital MyBook Live Series
Hardware Highlights:

This patch adds support for Western Digital MyBook Live Series:
CPU: AMCC PowerPC  UNKNOWN (PVR=12c41c83) at 800 MHz (PLB=200, OPB=100, EBC=100 MHz)
     32 kB I-Cache 32 kB D-Cache, 256 kB L2-Cache, 32 kB OnChip Memory
Board: Apollo-3G - APM82181 Board, 1*SATA
DRAM:  256 MB (2x NT5TU64M16GG-AC)
FLASH: 512 kB (SST 39VF040)
Ethernet: 1xRGMII - 1 Gbit - Broadcom PHY BCM54610

WARNING: The serial port needs a TTL/RS-232 v3.3 level converter!

The MyBook Live Duo additionally features a 1x USB 2.0 host port
and can support a second hard-drive.

This target produces two images for a target.
 1. ext4 image
    The extracted/raw image can be directly installed on
    the internal HDD via "dd if=img.ext4 of=/dev/sdX".

    This can either be done in place with the stock MyBook Live
    firmware via ssh. Or by removing the HDD and writing the image
    with a different PC.

    The the compressed images are useful for sysupgrade.

 2. recovery.tar image for TFTP and Serial.

    extract the recovery.tar to a TFTP server directory.

    On the MyBook Live (Duo) serial port - Hit Enter during u-boot and insert:
    # setenv serverip 192.168.1.254; setenv ipaddr 192.168.1.1; run net_self

    Where 192.168.1.254 is your TFTP server.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Christian Lamparter d37d16488c apm821xx: sata_dwc_460ex: backport fixes and cleanups from 4.7
This patch fixes the sata_dwc_460ex SATA driver which is used
by the SATA controllers in the MyBook Live Series and WNDR4700.

The code was backported from the upstream kernel.
It can be dropped completely on 4.7+.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Christian Lamparter ea91ee13a7 apm821xx: dw_dmac: backport fixes and cleanups from 4.7
This patch fixes the dw_dmac dma engine which is used
by the SATA controllers in the MyBook Live Series and WNDR4700.

The code was backported from the upstream kernel.
It can be dropped completely on 4.7+.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Chris Blake a57d6e2d47 apm821xx: add support for the Cisco Meraki MR24
This patch adds support for the Cisco Meraki MR24 Access point
to the apm821xx target.

Board:		MR24 - Meraki MR24 Cloud Managed Access Point
CPU:		APM82181 SoC 800 MHz (PLB=200 OPB=100 EBC=100)
Flash size:	32MiB
RAM Size:	128MiB
Wireless:	Atheros AR9380 5.0GHz + Atheros AR9380 2.4GHz
Ethernet ports:	1x Gigabit Atheros AR8035

WARNING: The serial port needs a TTL/RS-232 v3.3 level converter!

For flashing instructions, visit:
<https://github.com/riptidewave93/Openwrt-MR24/blob/master/README.md#flashing>

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
8 years ago
Chris Blake 3827ce2c3d apm821xx: add support for the apm821xx device target
This adds a new target for PowerPC APM82181 and APM82161
(464-based) boards, as well as adds support for the booke-wdt
watchdog package.

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
8 years ago