Commit Graph

144 Commits (6ba58b7b020c4b793e6fb7a43c8adef070579d8d)

Author SHA1 Message Date
Christian Lamparter 257de1b01f apm821xx: sata: boot-part feature integration
This patch adds the boot-part feature to the apm82181 sata target.
This makes it possible to configure the boot partition size with
the generic CONFIG_TARGET_KERNEL_PARTSIZE symbol.

Please note: For people using custom images: Just like with
CONFIG_TARGET_ROOTFS_PARTSIZE changing the value can cause
sysupgrade to repartition the device!

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 7d009d8e6a apm821xx: use bin file extension for sysupgrade-tar images
Use the file extension bin for sysupgrade-tar images with
metadata to unify the file extension across the target/tree.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 2271967f57 apm821xx: utilize build ARTIFACTs
The exported kernel dtbs can be build as artifacts.
This way, the MyBook Live's DTB is not generated twice.

While at it, give the artifacts their proper name.
For the wndr4700 use the "device-tree" partition name and
for the MyBook Live: "apollo3g.dtb" to match the mbl_boot.scr.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter eb43efa997 apm821xx: fix MBL DUO SUPPORTED_DEVICES compat id
The MyBook Live DUO used "wd,mybooklive-duo" as the first
compatible string and not "wd_mybooklive-duo".

Fixes: 9b47aa93c7 ("apm821xx: unify My Book Live Single + Duo images")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter e59a6c8d4c apm821xx: switch MyBook Live's recovery images to multi-file
This patch converts the MyBook Live's recovery image to utilize the
multi-image method which integrates the device-tree binary directly
into the image.

The new initramfs can be loaded through the MyBook Live's U-boot
in the following way:

=> setenv ipaddr 192.168.1.1
=> setenv serverip 192.168.1.2
=> sata init; run addtty; tftp $kernel_addr_r wd_mybooklive-initramfs.bin; bootm
   Waiting for PHY auto negotiation to complete... done
   ENET Speed is 1000 Mbps - FULL duplex connection (EMAC0)
   Using ppc_4xx_eth0 device
   TFTP from server 192.168.1.2; our IP address is 192.168.1.1
   Filename 'wd_mybooklive-initramfs.bin'.
   Load address: 0x1000000
   Loading: ################################################ [...]
   done
   [...]
   Booting kernel from Legacy Image at 01000000 ...
      Image Name:    initramfs
      Image Type:   PowerPC Linux Multi-File Image (gzip compressed)
   [...]

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 4cd533411e apm821xx: 4.14: switch to upstream dw-dma-hport patch
This patch fixes the build regression on 4.14 build
due to dt-bindings/dma/dw-dmac.h MIA.

apm82181.dtsi:24:10: fatal error: dt-bindings/dma/dw-dmac.h: No such file or directory

Fixes: 32141c183a ("apm821xx: add linux 4.19 apm821xx patches")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 32141c183a apm821xx: add linux 4.19 apm821xx patches
This patch updates the apm821xx target to use the 4.19 kernel.

4.19 ships with all the crypto4xx driver patches. Furthermore,
the DW-DMA fix for the SATA controller has been backported from
4.20 and integrated.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 1155793809 apm821xx: sata: set rootfs-part feature flag
The rootfs-part feature flag ensures that
CONFIG_ROOTFS_PART_SIZE symbol will be present
at all times.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 36c19c9f0b apm821xx: switch MX60(W)'s recovery images to multi-image method
In the past, the MX60(W)'s recovery images always had problems
with the size restriction and never really worked without manual
intervention. But starting with 4.19, the MX60(W)'s kernel image
outgrew the allocated space for sysupgrade images as well. Hence
This patch reworks the initramfs, which allows the device to ease
up on the impossible tight kernel size requirements for the
sysupgrade creation and packaging. And as a result, the now
orphaned special ramdisk setup is removed in the process.

This new initramfs can be loaded through the MX60(W) U-boot
in the following way:

=> setenv bootargs console=ttyS0,$baudrate
=> tftpboot $meraki_loadaddr meraki_mx60-initramfs-kernel.bin
   [...]
   Load address: 0x800000
    Loading: ################################################ [...]
    done
   [...]

=> bootm $fileaddr
   \## Booting kernel from Legacy Image at 00800000 ...
    ...

Updated Flashing instructions for new installations which integrates
the new recovery method. Users of existing installations that only
want to sysupgrade don't need to update their existing u-boot env.

=> setenv owrt_load1 ubi read \${meraki_loadaddr} kernel
=> setenv owrt_load2 ubi read \${meraki_loadaddr} recovery
=> setenv lede_bootkernel bootm \${meraki_loadaddr_kernel} - \${meraki_loadaddr_fdt}
=> setenv owrt_bootkernel bootm \${meraki_loadaddr}
=> setenv owrt_bootargs setenv bootargs console=ttyS0,\${baudrate} rootfstype=squashfs mtdoops.mtddev=oops
=> setenv owrt_boot run meraki_ubi owrt_bootargs\; run owrt_load1 meraki_checkpart lede_bootkernel\; run owrt_load2 owrt_bootkernel
=> setenv bootcmd run owrt_boot
=> saveenv

For more information and the latest flashing guide:
please visit the OpenWrt Wiki Page for the MR60:
<https://openwrt.org/toh/meraki/mx60#flashing>

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Koen Vandeputte fdd11a6eae kernel: bump 4.14 to 4.14.88
Refreshed all patches.

Altered patches:
- 180-usb-xhci-add-support-for-performing-fake-doorbell.patch

Fixes CVE:
- CVE-2018-14625

Compile-tested on: ar71xx, cns3xxx, imx6
Runtime-tested on: ar71xx, cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Koen Vandeputte 0028f86687 kernel: bump 4.14 to 4.14.86
Refreshed all patches.

Altered patches:
- 180-usb-xhci-add-support-for-performing-fake-doorbell.patch

Compile-tested on: ar71xx, cns3xxx, imx6
Runtime-tested on: ar71xx, cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Christian Lamparter 0bce89037f apm821xx: WNDAP620: remove bad semicolon in dts after #include
This patch fixes a build warning triggered by a semicolon in
the dts after the #include directive.

netgear-wndap620.dts:11:33: warning: extra tokens at end of #include directive

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter bd3e234473 apm821xx: move fifo-entry-size property to WNDR4700
This property (and value) came from Netgear's WNDR4700
stock firmware dts. However, other devices do not set
it and the EMAC default is 16, which matches that of
the programming notes of the APM82181 spec.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Petr Štetiar 9da6cd40eb apm821xx, ath79, ipq40xx, ipq806x, lantiq, ramips: base-files: Use generic diag.sh
I wanted to add status LEDs support to my imx6 based board and have found out,
that I could use diag.sh script found in ramips platform, which seems to be
also shared in a few other platforms:

 4801276bc2078c5bcf03003c831e3b0a target/linux/ramips/base-files/etc/diag.sh
 4801276bc2078c5bcf03003c831e3b0a target/linux/ipq40xx/base-files/etc/diag.sh
 4801276bc2078c5bcf03003c831e3b0a target/linux/ath79/base-files/etc/diag.sh

And @chunkeey suggested to me, that I can also add lantiq, ipq806x and
apm821xx to the list of platforms which could share this generic
diag.sh.

I've extended the base diag.sh in a way, that if it detects any of the
DTS LED aliases, then it would use the generic DTS set_led_state code.
The code in platform's diag.sh has moved to base-files package in this
commit:

 base-files: diag.sh: Make it more generic towards DTS so it could be reused

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Tested-by: Christian Lamparter <chunkeey@gmail.com> (apm821xx and ipq40xx)
6 years ago
Christian Lamparter 5d5c0b0582 apm821xx: wndr4700: restore sd-card media detection
This was not converted to the new, dt-based board name.

Fixes: e90dc8d272 ("apm821xx: convert to device-tree board detection")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter a2266a6d42 apm821xx: shuffle helper scripts to the front
In a patch for the ath79, Mathias Kresin mentioned that
helper scripts should be in front of the device targets.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter d82d84694e apm821xx: add support for the Netgear WNDAP620 and WNDAP660
This patch adds support for the Netgear WNDAP620 and WNDAP660,
they are similar devices, but due to the LAN LED configuration,
the switch setup and WIFI configuration each gets a different
device target.

Hardware Highlights WNDAP620:
CPU: AMCC PowerPC APM82181 at 1000 MHz
DRAM:  128 MB, 2 x 64 MiB DDR2 Hynix H5PS5162GF
CPU: AMCC PowerPC APM82181 at 1000 MHz
FLASH: 32 MiB, NAND SLC, Hynix HY27US08561A
Ethernet: RealTek RTL8363SB 2x2-Port Switch PHY - Only 1 GBit Port (POE)
Wifi: Atheros AR9380 minipcie - Dual-Band - 3x3:3
Serial: console port with RJ45 Interface (9600-N-8-1)
LEDS: Power, LAN-Activity, dual color LAN-Linkspeed, 2.4GHz, 5GHz LEDs
Button: Soft Reset Button
Antennae: 3 internal dual-band antennae + 3 x RSMA for external antennaes

Hardware Highlights WNDAP660:
CPU: AMCC PowerPC APM82181 at 1000 MHz + 2 Heatsinks
DRAM:  256 MB, 2 x 128 MiB DDR2
FLASH: 32 MiB, NAND SLC, Hynix HY27US08561A
Ethernet: RealTek RTL8363SB 2x2-Port Switch PHY (POE)
Wifi1: Atheros AR9380 minipcie - Dual-Band - 3x3:3
Wifi2: Atheros AR9380 minipcie - Dual-Band - 3x3:3
Serial: console port with RJ45 Interface (9600-N-8-1)
LEDS: Power, LAN-Activity, 2x dual color LAN-Linkspeed, 2.4GHz, 5GHz LEDs
Button: Soft Reset Button
Antennae: 6 internal dual-band antennae + 3 x RSMA for external antennaes

Flashing requirements:

 - needs a tftp server at 192.168.1.10/serverip.
 - special 8P8C(aka RJ45)<->D-SUB9 Console Cable
   ("Cisco Console Cable"). Note: Both WNDAP6x0 have
   a MAX3232 transceivers, hence no need for any separate
   CMOS/TTL level shifters.

External Antenna:
The antennae mux is controlled by GPIO 11 and GPIO14. Valid Configurations:
 = Config# = | = GPIO 11 = | = GPIO 14 = |  ===== Description =====
      1.     |   1 / High  |  0 / Low    | Use the internal antennae (default)
      2.     |   0 / Low   |  1 / High   | Use the external antennae

The external antennaes are only meant for the 2.4 GHz band.

One-way Flashing instructions via u-boot:

 0. connect the serial cable to the RJ45 Console Port
    Note: This requires a poper RS232 and not a TTL/USB adaptor.

 1. power up the AP and interrupt the u-boot process at

    'Hit any key to stop autoboot'

 2. setup serverip and ipaddr env settings
    Enter the following commands into the u-boot shell
    # setenv ipaddr 192.168.1.1
    # setenv serverip 192.168.1.10

 3. download the factory.img image to the AP
    Enter the following commands into the u-boot shell

    # tftp ${kernel_addr_r} openwrt-apm821xx-nand-netgear_wndap660-squashfs-factory.img

 4. verfiy image integrity
    Enter the following commands into the u-boot shell

    # crc32 $fileaddr $filesize

    If the calculated crc32 checksum does not match, go back to step 3.

 5. flash the image
    Enter the following commands into the u-boot shell

    # nand erase 0x110000 0x1bd0000
    # nand write ${kernel_addr_r} 0x110000 ${filesize}

 6. setup uboot environment
    Enter the following commands into the u-boot shell

    # setenv bootargs
    # setenv fileaddr
    # setenv filesize
    # setenv addroot 'setenv bootargs ${bootargs} root=/dev/ubiblock0_0'
    # setenv owrt_boot 'nboot ${kernel_addr_r} nand0 0x110000; run addroot; run addtty; bootm ${kernel_addr_r}'
    # setenv bootcmd 'run owrt_boot'
    # saveenv

 7. boot
    # run bootcmd

Booting initramfs instructions via u-boot:

 Follow steps 0 - 2 from above.

 3. boot initramfs
    Enter the following commands into the u-boot shell

    # tftp ${kernel_addr_r} openwrt-apm821xx-nand-netgear_wndap660-initramfs-kernel.bin
    # run addtty
    # bootm ${kernel_addr_r}

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter fb4bed5fe9 apm821xx: import gpio-export DT code from lantiq
This will come in handy for the Netgear WNDAP620's antennae mux.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter f6968952df apm821xx: MR24: add to uboot-envtools
This patch adds the complicated u-boot
environment access settings for to the
MR24 target.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Koen Vandeputte bc3d47cd12 kernel: bump 4.14 to 4.14.78
Refreshed all patches.

Remove upstreamed:
- 050-net-emac-fix-fixed-link-setup-for-the-RTL8363SB-swit.patch

Compile-tested on: cns3xxx, imx6
Runtime-tested on: cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Christian Lamparter fc70276e6c apm821xx: add disk-activity triggers via DT.
The WNDR4700 and the MBL have a dedicated HDD activity LED.
This patch adds the default led triggers to the DTS and
removes the entries in 01_leds.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 1d5d77612f apm821xx: apm82181.dtsi overhaul
- order entries by mmio address where possible

 - switch to lower-case address values

 - comment on BSP u-boot behaviour in regards to
   what it edits and look for

 - annotate irq lines with the help of interrupt-names

 - remove deprecated "device_type" properties
   The pci and network device_type had to stay since
   they are required by the drivers and u-boot.
   the cpu and memory device_types will remain as well
   as they are still part of the DT Spec.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 9ca82c2374 apm821xx: force WNDR4700 console to 115200n8
With the upcoming 4.19 release, the serial console on the
Netgear WNDR4700 would no longer work as it is never really
set and always relied on the kernel's serial code not to
change the baud rate.

On the stock firmware, Netgear forced the console setting
through a custom CONFIG_CMDLINE in their kernel to 115200.
Normally, they should have done it in a different way and
just passed the baudrate through a "console=..." kernel
parameter via the bootargs in the "/chosen" dt node.
But in their default u-boot bootcmd setting, they somehow
forgot to add the "run addtty", so there's no easy way to
pass the baudrate from u-boot to the kernel. So it has
to be forced as otherwise it ends up as 9600 baud.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 68bb91018d apm821xx: set uart compatible to ns16750
The APM821XX/PPC460EX datasheet mentions:
"Register compatibility with 16750 register set"

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Mathias Kresin 80c61c161a treewide: use wpad-basic for not small flash targets
Add out of the box support for 802.11r and 802.11w to all targets not
suffering from small flash.

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

Mathias did all the heavy lifting on this, but I'm the one who should
get shouted at for committing.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years ago
Koen Vandeputte 0d0bd8e6da kernel: bump 4.14 to 4.14.76
Refreshed all patches.

Compile-tested on: ar71xx, cns3xxx, imx6
Runtime-tested on: ar71xx, cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Christian Lamparter 64756a9a30 apm821xx: net: emac: fix fixed-link setup for the RTL8363SB switch
On the Netgear WNDAP620, the emac ethernet isn't receiving nor
xmitting any frames from/to the RTL8363SB (identifies itself
as a RTL8367RB).

This is caused by hardware not knowing the right forced link
settings (speed, duplex, pause, etc.) settings.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter c417aee9f1 apm821xx: fix dtc compiler warnings for MX60(W) and MR24's dts files
This patch fixes some of the dtc warnings:

MR24:
"reg" property in [...]mdio/phy@1 has invalid length (4 bytes)
Node [...]button@1 has a unit name, but no reg property
Relying on default #address-cells value for [...]phy@1
Relying on default #size-cells value for [...]phy@1

MX60(W):
Node [..]nand/all has a reg or ranges property, but no unit name
Node [..]button@1 has a unit name, but no reg property

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 2a926b1a0a apm821xx: remove wd, mybooklive-duo leftovers
The unification of the My Book Live Single and duo image in
commit 9b47aa93c7 ("apm821xx: unify My Book Live Single + Duo images")
made the wd,mybooklive-duo obsolete in most places and can
be removed.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 63a7cf6791 treewide: replace 'linux, stdout-path' with 'stdout-path'
This follows a similar upstream patch by Rob Herring:

|commit 78e5dfea84dc15d69940831b3981b3014d17222e
|Author: Rob Herring <robh@kernel.org>
|Date:   Wed Feb 28 16:44:06 2018 -0600
|    powerpc: dts: replace 'linux,stdout-path' with 'stdout-path'
|
|    'linux,stdout-path' has been deprecated for some time in favor of
|    'stdout-path'. Now dtc will warn on occurrences of 'linux,stdout-path'.
|    Search and replace all the of occurrences with 'stdout-path'.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Koen Vandeputte e9d92bf1e1 kernel: bump 4.14 to 4.14.72
Refreshed all patches.

Removed upstreamed:
- 203-MIPS-ath79-fix-restart.patch
- 0013-MIPS-ath79-fix-system-restart.patch
- 180-earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch
- 181-earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon. patch
- 700-1-6-e1000e-Remove-Other-from-EIAC.patch
- 700-2-6-Partial-revert-e1000e-Avoid-receiver-overrun-interrupt-bursts.patch
- 700-3-6-e1000e-Fix-queue-interrupt-re-raising-in-Other-interrupt.patch
- 700-4-6-e1000e-Avoid-missed-interrupts-following-ICR-read.patch

Compile-tested on: cns3xxx, imx6
Runtime-tested on: cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Freddy Leitner 7aa5dc46ee apm821xx: MBL: load kernel/dtb from SATA 0:1 first
This remedies an issue with the MBL Duo if both disks are inserted
and contain OpenWrt. kernel and dtb would be loaded from SATA 1:1
while rootfs (/dev/sda2) would be mounted on SATA 0:1.

Such a mix&match would obviously only work if both OpenWrt versions/
builds are identical, and especially fail after sysupgrade upgraded
the system disk on SATA 0:1.

The fallback to SATA 1:1 needs to be kept for MBL Single (only has
SATA 1:1) and MBL Duo with one disk inserted on SATA 1:1. To speed
up booting in those cases, the unneccesarily doubled "sata init"
will only be called once. (In theory it could be omitted completely
since the on-flash boot script already initializes SATA to load the
on-disk boot script.)

Tested on MBL Duo (all possible combination of disks) and MBL Single

Acked-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Freddy Leitner <hello@square.wf>
6 years ago
Paul Wassi e348ccc4e6 treewide: fix some cosmetic glitches in dts files
- fix single spaces hidden by a tab
- replace indentation with spaces by tabs
- make empty lines empty
- drop trailing whitespace
- drop unnecessary blank lines

Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Paul Wassi <p.wassi@gmx.at>
6 years ago
Mathias Kresin dd448cd276 treewide: fix upgrade led handling
The upgrade led is only used if a running led is defined. If no running
led is defined, the upgrade led is ignored and upgrade isn't indicated
at all.

Instead, turn off the running led prior to turning the upgrade led on.
In most cases there isn't any visual change, but it allows to use an
independent led for upgrade indication.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Stijn Tintel 22b9f99b87 kernel: bump 4.14 to 4.14.59
Drop patch that was superseded upstream:
ramips/0036-mtd-fix-cfi-cmdset-0002-erase-status-check.patch

Drop upstreamed patches:
- apm821xx/020-0001-crypto-crypto4xx-remove-bad-list_del.patch
- apm821xx/020-0011-crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch
- ath79/0011-MIPS-ath79-fix-register-address-in-ath79_ddr_wb_flus.patch
- brcm63xx/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch
- brcm63xx/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch
- generic/backport/080-net-convert-sock.sk_wmem_alloc-from-atomic_t-to-refc.patch
- generic/pending/170-usb-dwc2-Fix-DMA-alignment-to-start-at-allocated-boun.patch
- generic/pending/900-gen_stats-fix-netlink-stats-padding.patch

In 4.14.55, a patch was introduced that breaks ext4 images in some
cases. The newly introduced patch
backport-4.14/500-ext4-fix-check-to-prevent-initializing-reserved-inod.patch
addresses this breakage.

Fixes the following CVEs:
- CVE-2018-10876
- CVE-2018-10877
- CVE-2018-10879
- CVE-2018-10880
- CVE-2018-10881
- CVE-2018-10882
- CVE-2018-10883

Compile-tested: ath79, octeon, x86/64
Runtime-tested: ath79, octeon, x86/64

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
6 years ago
Christian Lamparter b70d3557e0 apm821xx: clean up gpio-hogs
convert the usb and both sata port power related gpio-hogs to
what they really are: fixed-regulators.

The ethernet phy-reset gpio-hog is replaced by a proper
upstream (4.15+) reset-gpios property in the mdio-node.
So this will work eventually.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter cff6548948 apm821xx: split MBL's rootfs.img.gz into a sysupgrade and factory image
@vahid-dan reported a issue with extracting the rpi images with
Gnome's Archive Manager:
"Ubuntu Archive Manager cannot extract the file and it just
throws a general error message: "An error occurred while
extracting files".
<https://forum.lede-project.org/t/corrupted-pre-built-v18-06-0-rc2-image-for-rpi>

The MBL's rootfs.img.gz image is generated in much the same way.
Hence this patch preemptively splits the rootfs.img.gz image into
a sysupgrade and a factory image.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter aed4799d6d apm821xx: build squashfs-rootfs images for the MBL
This patch adds support for squashfs as the root filesystem.

advantages:
 - migrate from a existing -ext4 installation and back
   with the sysupgrade utility
 - existing partition layout will not be lost during switch
 - slightly smaller image size as compared to the -ext4 image.

disadvantages:
 - needs f2fs + tools. This is because fstools rootdisk.c decides based
   on the partition size (currently root partitions > 100 MiB) f2fs is
   used as the rootfs_data filesystem.
 - rootfs_data is placed into the rootfs partition after the squashfs.
   This makes it difficult for tools that expect a /dev/sda${X} device.
   It also makes it difficult for data recovery tools as they might not
   expect to find a embedded partition or will be slightly confused.
   ... or will not support f2fs.

For people with existing build configurations: make sure to include mkf2fs
and f2fsck packages into the image. Otherwise the new -squashfs image will
only boot from the ram-overlay.

Note:
All overlay data (configurations/all installed packages/...) will be
placed in inside the rootfs partition (i.e. /dev/sda2) just after the
squashfs image.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 9b47aa93c7 apm821xx: unify My Book Live Single + Duo images
By takimata:
"Come to think of it, an MBL Single board boots up just fine on an
MBL Duo image, and the MBL Single board identifies completely
identical to the MBL Duo
(Board: Apollo-3G - APM82181 Board, 2*SATA, 1*USB).
I wonder if there is any downside to just using the MBL Duo firmware
on a MBL Single. I wonder if the two firmwares could even be unified."

<https://forum.lede-project.org/t/wd-mybook-live-duo-two-disks/16195/9>

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter c3f9a1ac0e apm821xx: attempt to fix sata access freezes
The original vendor's driver programmed the dma controller's
AHB HPROT values to enable bufferable, privileged mode. This
along with the "same priorty for both channels" could very
well fix the freezes that have been reported on the forum by
@ticerex and @takimata.

<https://forum.lede-project.org/t/wd-mybook-live-duo-two-disks/16195/46>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter 12b80f1cab apm821xx: fix usb-otg on 4.14
Starting with 4.14, the "amcc,dwc-otg" needs to be used
in order to get the usb-otg to work.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Stijn Tintel e52f3e9b13 kernel: bump 4.14 to 4.14.48
Remove upstreamed patches:
generic/pending/101-clocksource-mips-gic-timer-fix-clocksource-counter-w.patch
generic/pending/103-MIPS-c-r4k-fix-data-corruption-related-to-cache-coherence.patch
generic/pending/182-net-qmi_wwan-add-BroadMobi-BM806U-2020-2033.patch
lantiq/0025-MIPS-lantiq-gphy-Remove-reboot-remove-reset-asserts.patch
Update patches that no longer apply:
generic/pending/811-pci_disable_usb_common_quirks.patch
ath79/0009-MIPS-ath79-add-lots-of-missing-registers.patch

Fixes CVE-2018-6412.

Compile-tested: octeon, x86/64.
Runtime-tested: octeon, x86/64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
6 years ago
Sergey Ryazanov 67a3cdcbb0 kernel: enable THIN_ARCHIVES by default
THIN_ARCHIVES option is enabled by default in the kernel configuration
and no one target config disables it. So enable it by default and remove
this symbol from target specific configs to keep them light.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Sergey Ryazanov bdc2b58c4b kernel: enable FUTEX_PI by default
New FUTEX_PI configuration symbol enabled if FUTEX and RT_MUTEX symbols
are enabled. Both of these symbols are enabled by default in the
generic config, so enable FUTEX_PI by default too to keep platform
specific configs minimal.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Sergey Ryazanov a08b0d0c31 kernel: enable EXPORTFS by default
OVERLAY_FS config symbol selects EXPORTFS since 4.12 kernel, we have
OVERLAY_FS enabled by default, so enable EXPORTFS in the generic config
of 4.14 and remove this option from platform specific configs.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Sergey Ryazanov 978543a246 kernel: disable DRM_LIB_RANDOM by default
DRM_LIB_RANDOM config symbol selected only by DRM_DEBUG_MM_SELFTEST
which is disable by default, so disable DRM_LIB_RANDOM by default too.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Sergey Ryazanov ead26e9db6 kernel: disable DMA_{NOOP|VIRT}_OPS by default
These options do not used by any supported arch, so disable them by
default to make arch configs a bit more clean.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Sergey Ryazanov f928c338ad kernel: disable ARCH_WANTS_THP_SWAP by default
Only one arch (x86_64) enables this option. So disable
ARCH_WANTS_THP_SWAP by default and remove referencies to it from all
configs (except x86_64) to make them clean.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
6 years ago
Christian Lamparter 16e39624b7 apm821xx: backport and reassign crypto4xx patches
This patch backports several patches that went upstream into
Herbert Xu's cryptodev-2.6 tree:

crypto: Use zeroing memory allocator instead of allocator/memset
crypto: crypto4xx - performance optimizations
crypto: crypto4xx - convert to skcipher
crypto: crypto4xx - avoid VLA use
crypto: crypto4xx - add aes-ctr support
crypto: crypto4xx - properly set IV after de- and encrypt
crypto: crypto4xx - extend aead fallback checks
crypto: crypto4xx - put temporary dst sg into request ctx

The older, outstanding patches from 120-wxyz series have been
upstreamed as well and therefore they have been reassigned to
fit into the series.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Christian Lamparter e6e51ce87f apm821xx: don't select swconfig for the MR24
The swconfig package is part of the DEFAULT_PACKAGES list in
the apm821xx's nand subtarget. It's enabled by default because
the MX60(W) and WNDR4700 need it for their initramfs. However
the package is not necessary for the MR24's sysupgrade image, as
the MR24 does not have a switch.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago