Commit Graph

295 Commits (d3c0a944059bb0d45c3b56278249100258378b0c)

Author SHA1 Message Date
Florian Fainelli 32e4eaef1b sunxi: Turn on CONFIG_PINCTRL_SUN4I_A10 for A20
CONFIG_PINCTRL_SUN4I_A10 controls both the A10 and the A20 enablong of
the pinctrl driver, this is necessary since upstream commit
5d8d349618a9464714c07414c5888bfd9416638f ("pinctrl: sunxi: add A20
support to A10 driver") which has been included in v4.13 and onwards.

Fixes: ad2b3bf310 ("sunxi: Add support for kernel 4.14")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
4 years ago
Rosen Penev 0713afd298 sunxi: gen_sunxi_sdcard_img.sh: switch to /bin/sh
This has nothing that needs bash.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add prefix to commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler b085e0586f sunxi: rename SUNXI_SOC to SOC
This replaces SUNXI_SOC by the newly introduced common SOC device
variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Roman Bazalevsky 69fff339e9 sunxi: add support for FriendlyARM Nano PI NEO Air dev board
Hardware:

  Allwinner H3 upto 1.2GHz
  512MB DDR3 RAM
  8GB on-board eMMC - mountable, can be used as boot with custom boot.scr
  microSD-card slot
  WiFi 802.11n (AP6212A) - working
  Bluetooth (AP6212A) - not working for now
  Micro-USB OTG + 2*USB headers
  UART 3.3V - working
  GPIO/I2C/SPI 2.54mm headers

Standard sunxi SD-card installation procedure - copy image to SD card,
insert in into slot and boot. First time you will need UART adapter to
enable on-board wireless (or just build custom image with enabled WiFi).

To boot from eMMC:

  - boot from SD
  - copy SD image to emmc (dd bs=... if=.... of=/dev/mmcblk2)
  - mount eMMC boot partition and replace boot script on it
  - unmount, reboot

To use i2c, spi and more uarts - replace dtb on boot partition with
fixed one (use dtc or fdt-tools).

Signed-off-by: Roman Bazalevsky <rvb@rvb.name>
[rebase onto device name consolidation patches]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 3a4ad758f5 sunxi: construct DTS name from device node name and SOC
The device part in the SUNXI_DTS variable always corresponds to
device node name. This is another redundancy that can be removed
by calculating the DTS name from a newly introduced SUNXI_SOC
variable and the node name.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler a4cdb537b1 sunxi: use vendor_device scheme for device definitions
This changes device definition to resemble the vendor_device scheme
already present for the majority of device compatible strings.

By doing this, we achieve several advantages at once:
- Image names and node names are more consistent with other targets.
- SUPPORTED_DEVICES can be set automatically for all but two cases.
- Image names and node names are in line with DEVICE_TITLEs.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Daniel Golle 2105354968 sunxi: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
Petr Štetiar 3bbcffa0b6 treewide: kernel config: remove runtime options
Remove CC_HAS_ASM_GOTO, CC_IS_GCC and GCC_VERSION kernel config options
which are set at runtime and which should be ignored now.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Andre Heider 3b874c2c81 sunxi: update kernel config
This is just a `make kernel_oldconfig` run without further changes.

Signed-off-by: Andre Heider <a.heider@gmail.com>
5 years ago
Adrian Schmutzler c5b4fa20fa treewide: replace backticks by $(...) in gen_*_img.sh scripts
This replaces deprecated backticks by more versatile $(...) syntax.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[decapitalized patch subject at submitter's request]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Hal Martin 3819c1638a sunxi: Add support for Banana Pi M2 Ultra
CPU: Allwinner R40 Quad-Core Cortex-A7 @ 1.2GHz
GPU: Mali 400 MP2
Memory: 2GB DDR3 onboard (shared with GPU)
Onboard: Storage microSD card slot
Onboard: Storage 8GB eMMC
Onboard: Network 10/100/1000M Ethernet RJ45
Onboard: Network WiFi 802.11b/g/n 1x1 (AMPAK AP6212; brcmfmac)
Onboard header: SPI, I2C, GPIO, UART
USB: Two USB 2.0 Host, One USB 2.0 OTG

Known issues:
- WiFi doesn't work
- eMMC not supported

Signed-off-by: Hal Martin <hal.martin@gmail.com>
5 years ago
Rafał Miłecki 641f6b6c26 treewide: use new procd sysupgrade $UPGRADE_BACKUP variable
It's a variable set by procd that should replace hardcoded
/tmp/sysupgrade.tgz.

This change requires the most recent procd with the commit 0f3c136
("sysupgrade: set UPGRADE_BACKUP env variable").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki 62dbe361a1 treewide: when copying a backup file always specify dest name
$CONF_TAR shouldn't be assumed to always point to the sysupgrade.tgz.
This change makes code more generic and allows refactoring $CONF_TAR.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki bf39047872 treewide: don't hardcode "sysupgrade.tgz" file name
1) Add BACKUP_FILE and use it when copying an archive to be restored
   after sysupgrade (on the next preinit).
2) Use CONF_TAR for copying backup prepared by the /sbin/sysupgrade

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki b6f4cd57e1 treewide: sysupgrade: pass "save_partitions" option to the "sysupgrade" method
This explicitly lets stage2 know if partitions should be preserved. No
more "touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap" hack.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Luis Araneda 472dbaba81 sunxi: convert to multi-variable device title
Use data from the linux-sunxi community wiki to
fill-in missing device information

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
5 years ago
Petr Štetiar f342ffd300 treewide: kernel: bump some targets to 4.19
Lets bump kernel to 4.19 on targets which were run tested or got ACKed
so we've enough time to make it ready for next release:

 armvirt/32 (runtested in qemu)
 armvirt/64 (runtested in qemu)
 ath79/generic (runtested on Carambola2)
 gemini/generic (runtested on DIR-685, DNS-313, SQ201, SL93512R)
 imx6/generic (runtested on Apalis)
 ipq40xx/generic (runtested on nbg6617)
 malta/be64 (runtested in qemu)
 malta/be (runtested in qemu)
 malta/le (runtested in qemu)
 malta/le64 (runtested in qemu)
 mpc85xx/generic (runtested on TL-WDR4900)
 mpc85xx/p2020 (runtested on P2020RDB)
 mvebu/cortexa53
 mvebu/cortexa72
 mvebu/cortexa10
 octeon/generic (runtested on EdgeRouter Lite)
 sunxi/cortexa53 (build tested only)
 sunxi/cortexa7 (runtested on Lime2-K)
 sunxi/cortexa8 (build tested only)
 tegra/generic
 x86/64 (runtested in qemu)

Acked-by: Zoltan HERPAI <wigyori@uid0.hu> [sunxi]
Tested-by: Linus Walleij <linus.walleij@linaro.org> [gemini]
Tested-by: Tomasz Maciej Nowak <tomek_n@o2.pl> [mvebu, tegra]
Tested-by: Daniel Engberg <daniel.engberg.lists@pyret.net> [octeon]
Tested-by: Pawel Dembicki <paweldembicki@gmail.com> [mpc85xx/generic mpc85xx/p2020]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Koen Vandeputte f442b306f9 kernel: bump 4.14 to 4.14.120
Refreshed all patches.

Remove upstreamed:
- 103-MIPS-perf-ath79-Fix-perfcount-IRQ-assignment.patch
- 060-fix-oxnas-rps-dt-match.patch

Altered patches:
- 0067-generic-Mangle-bootloader-s-kernel-arguments.patch
- 006-mvebu-Mangle-bootloader-s-kernel-arguments.patch
- 996-generic-Mangle-bootloader-s-kernel-arguments.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Hauke Mehrtens 75eb8a146d kernel: Deactivate CONFIG_BINFMT_MISC
CONFIG_BINFMT_MISC allows it to add support for new executable formats
to the kernel from user space, the kernel will then detect for example a
java binary and call the java execution program automatically. I am not
aware that this feature is used in OpenWrt and this could be used to
exploit something. Deactivate it for all targets for now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens 46af22de16 kernel: Remove CONFIG_COMPAT
This removes support for executing old 32 bit applications on 64 bit ARM
and MIPS kernels.
On OpenWrt we normally compile all the user space applications on our
own and do not support third party binary only modules especial not 32
bit applications on 64 bit CPUs.

This reduces the attack surface on such systems and should also save
some memory.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens 32eb66881c kernel: Activate CONFIG_ARM64_SW_TTBR0_PAN
This activates "Emulate Privileged Access Never using TTBR0_EL1
switching" on ARM64.

This should prevent the kernel from reading code from user space in
kernel context.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Klaus Kudielka ad62247800 base-files: improve lib/upgrade/common.sh
Recently, upgrade device autodetection has been added to the mvebu target.
This exposes some shortcomings of the generic export_bootdevice function,
e.g. on the Turris Omnia: export_bootdevice silently reports the root
partition to be the boot device. This makes the sysupgrade process fail at
several places.

Fix this by clearly distinguishing between /proc/cmdline arguments which
specify the boot disk, and those which specify the root partition. Only in
the latter case, strip off the partition, and do it consistently.
root=PARTUUID=<pseudo PARTUUID for MBR> (any partition) and root=/dev/*
(any partition) are accepted.

The root of the problem is that the *existing* export_bootdevice in
/lib/upgrade/common.sh behaves differently, if the kernel is booted with
root=/dev/..., or if it is booted with root=PARTUUID=...

In the former case, it reports back major/minor of the root partition,
in the latter case it reports back major/minor of the complete boot disk.

Targets, which boot with root=/dev/... *and* use export_bootdevice /
export_partdevice, have added workarounds to this behaviour, by specifying
*negative* increments to the export_partdevice function.

Consequently, those targets have to be adapted to use positive increments,
otherwise they are broken by the change to export_bootdevice.

Fixes: 4e8345ff68 ("mvebu: base-files: autodetect upgrade device")
Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
Tested-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Felix Fietkau 85017c40f4 build: add a config option for enabling a testing version of the target kernel
If the target supports a newer kernel version that is not used by default
yet, it can be enabled with this option

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Hauke Mehrtens 1f839c8584 sunxi: Remove already applied patch
This patch is already included in kernel v4.19.31.

Fixes: 8df12d76c6 ("kernel: bump 4.19 to 4.19.34")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Koen Vandeputte 8df12d76c6 kernel: bump 4.19 to 4.19.34
Refreshed all patches.

Removed:
- 030-PCI-dwc-skip-MSI-init-if-MSIs-have-been-explicitly-d.patch

Altered:
- 366-netfilter-nf_flow_table-clean-up-and-fix-dst-handlin.patch
- 650-netfilter-add-xt_OFFLOAD-target.patch
- 662-remove_pfifo_fast.patch
- 332-arc-add-OWRTDTB-section.patch
- 100-clocksource-drivers-arch_timer-Workaround-for-Allwin.patch
- 702-phy_add_aneg_done_function.patch

New symbols:
- ARC_IRQ_NO_AUTOSAVE
- SUN50I_ERRATUM_UNKNOWN1

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Aleksander Jan Bajkowski 445ca981d1 sunxi: add support for Orange Pi PC Plus
CPU: H3 Quad-core Cortex-A7 H.265/HEVC 4K @ 1.2 Ghz
GPU: Mali400MP2 GPU @ 600MHz (supports OpenGL ES 2.0)
Memory: 1GB DDR3 (shared with GPU)
Onboard: Storage TF card (Max. 64GB) / MMC card slot
Onboard: Storage 8 GB eMMC
Onboard: Network 10/100M Ethernet RJ45
Onboard: Network WiFi 802.11 b/g/n (Realtek RTL8189FTV)
Onboard header: SPI, I2C, GPIO, UART
USB 2.0: Three USB 2.0 HOST, One USB 2.0 OTG

Known issues:
-Wifi diesn't work

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
5 years ago
Koen Vandeputte 364ab348dc kernel: bump 4.14 to 4.14.105
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Aleksander Jan Bajkowski 00d89b4a89 sunxi: add support for Orange Pi One
CPU: H3 Quad-core Cortex-A7 H.265/HEVC 4K @ 1.2 Ghz
GPU: Mali400MP2 GPU @ 600MHz (supports OpenGL ES 2.0)
Memory: 512MB DDR3 (shared with GPU)
Onboard: Storage TF card (Max. 64GB) / MMC card slot
Onboard header: SPI, I2C, GPIO, UART
USB 2.0: One USB 2.0 HOST, One USB 2.0 OTG

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
5 years ago
Oskari Lemmela cd1e9c88f3 sunxi: fix: A64 unstable timer
Backport A64 unstable timer patches from linux 5.1

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
[Split the single patch into the two original patches]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Pawel Dembicki d5f615bf2a sunxi: add support for Sinovoip Banana Pi M2 Plus
CPU: H3 Quad-core Cortex-A7 H.265/HEVC 4K @ 1.2 Ghz
GPU: Mali400MP2 GPU @ 600MHz (supports OpenGL ES 2.0)
Memory: 1GB DDR3 (shared with GPU)
Onboard: Storage TF card (Max. 64GB) / MMC card slot
Onboard: Network 10/100M Ethernet RJ45 (Realtek RTL8211E)
Onboard: Network BT4.0/WiFi 802.11 b/g/n (Ampak AP6212)
Onboard header: SPI, I2C, GPIO, UART
USB 2.0: Two USB 2.0 HOST, One USB 2.0 OTG

Untested:
Audio, Video

Not working:
Bluetooth

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
5 years ago
Koen Vandeputte f003d732d7 kernel: bump 4.19 to 4.19.18
Refreshed all patches.

Removed upstreamed:
- 031-v5.0-MIPS-BCM47XX-Setup-struct-device-for-the-SoC.patch
- 142-jffs2-Fix-use-of-uninitialized-delayed_work-lockdep-.patch

Removed upstreamed hunk in:
- 800-bcma-get-SoC-device-struct-copy-its-DMA-params-to-th.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 3662157d8b kernel: bump 4.14 to 4.14.96
Refreshed all patches.

Remove upstreamed patches:
- 142-jffs2-Fix-use-of-uninitialized-delayed_work-lockdep-.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Daniel Engberg be1d70e0a2 sunxi: Add support for SY8106A voltage regulator
Add support for Silergy SY8106A voltage regulator which is
needed for cpufreq support on boards such as Orange Pi PC

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
[Remove CONFIG_REGULATOR_SY8106A from cortexa7]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Oskari Lemmela 538127cf98 sunxi: spi flash dts changes
Backport A64 SPI flash DTS changes to 4.14 kernel.

Add Openwrt specific flash partitions to Sopine.

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
5 years ago
Oskari Lemmela 72102b11b8 sunxi: add spi flash support to kernel
Some of sunxi devices have onboard SPI flash.
Enable SPI NOR support and MTD fit split in kernel config.

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
5 years ago
Oskari Lemmela 7f06db06f2 sunxi: add a64 watchdog support
Backport A64 watchdog DTS change to 4.14 kernel.

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
5 years ago
Hauke Mehrtens 900c6b1a42 sunxi: Add support for kernel 4.19
This adds supprot for kernel 4.19 to the sunxi target. The patches and
the configuration were copied from the kernel 4.14 patches folder and
adapted for kernel 4.19.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens 2eeb5d6aac sunxi: Refresh kernel 4.14 configuration
Refresh the sunxi kernel configuration without doing any intentional
changes.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens 0057beab1b sunxi: Use kernel specific sub target configuration
To make it easier to support multiple kernel versions in parallel also
copy the sub target specific kernel configurations into kernel specific
files.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens 48f81ee1d0 sunxi: Remove unneeded patches
In the device tree file the higher offsets of the reset controller are
not used, so this patch supporting higher bits is not needed.
The sunxi architecture switched to the simple reset controller with
kernel 4.19 and then this patch does not apply any more.
The sunxi target in OpenWrt is very close to mainline, so if the device
tree files from the mainline Linux kernel need this the mainline kernel
will get support for this.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Koen Vandeputte ca88f4153f kernel: bump 4.14 to 4.14.77
Refreshed all patches.

Altered patches:
- 666-Add-support-for-MAP-E-FMRs-mesh-mode.patch

New symbol for arm targets:
- HARDEN_BRANCH_PREDICTOR

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.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
Felix Fietkau 212aa33226 kernel: enable memory compaction
Compaction is the only memory management component to form high order (larger
physically contiguous) memory blocks reliably. The page allocator relies on
compaction heavily and the lack of the feature can lead to unexpected OOM
killer invocations for high order memory requests. You shouldn't disable this
option unless there really is a strong reason for it.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Michal Hrusecky <michal.hrusecky@nic.cz>
6 years ago
Julian Haupt 0308385d1d sunxi: add support for Orange Pi Zero
Signed-off-by: Julian Haupt <julian.haupt@hauptmedia.de>
6 years ago
Florian Fainelli 2cc821e7ed sunxi: Turn on CONFIG_SUN4I_A10_CCU for A20
CONFIG_SUN4I_A10_CCU controls both the A10 and the A20 enabling of the
CCU (LCCF) driver, this will be necessary once we move beyond kernel
4.14 because 4.15 has commit f18698e1c66338b902de386e4ad97b8b1b9d999d
("ARM: dts: sun7i: Convert to CCU") which requires this driver.

Fixes: ad2b3bf310 ("sunxi: Add support for kernel 4.14")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
6 years ago
Felix Fietkau 2ad995ccfe sunxi: remove linux 4.9 support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Hauke Mehrtens 247ef4d98b sunxi: enable CONFIG_BPF_SYSCALL and CONFIG_EMBEDDED
This takes the options from the generic configuration

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Jasper Scholte a689307c97 sunxi: build image/uboot for the NanoPi NEO2
The NanoPi NEO2 is a small Allwinner H5 based board available with
different DRAM configurations.
This board is very similar to the NanoPi NEO PLUS2

Signed-off-by: Jasper Scholte <NightNL@outlook.com>
6 years ago
Koen Vandeputte 22f899c6dd kernel: bump 4.9 to 4.9.124
Refreshed all patches.

Compile-tested on: ar71xx
Runtime-tested on: ar71xx

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

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago