Re: [OpenWrt-Devel] [RFC 4/6] x86: geode: shrink amount of default packages

2019-01-14 Thread Tomasz Maciej Nowak
Hi Philip

W dniu 14.01.2019 o 21:10, Philip Prindeville pisze:

> Why is the hwclock being dropped everywhere?

It's provided by busybox and installed by default, also greping for its usage 
in target/linux/x86/base-files returned nothing. Am I missing something, is the 
full fledged one used somewhere or by something?

> And who says the geos2, net5501, or alix2 are obsolete?

They are not obsolete by any means, only the way to assign packages for 
specific device changes. Please take a look at patch nr 2 in this RFC and 
section adding target/linux/x86/image/geode.mk. There You have almost all 
packages replicated with additional geos device profile. Now You'll get two 
images, one generic, and one for geos. This distinction is here because with 
old way of adding packages, the generic image would end up with lot of useless, 
geos/dsl specific packages.

> I have some running right here…

I have WRAP which runs perfectly fine with these changes.

Regards, Tomasz

-- 
TMN

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] RFC: merge LibreMesh packages into OpenWrt?

2019-01-14 Thread William Fleurant
Hello,

There's a communities network-profile I contributed up to LibreMesh,
but am not a maintainer. Also a few projects in openwrt-routing I
keep maintainer eyes on as well.


I'm leaning towards #2 because its proper. However, I also want
to see #1 accepted into openwrt/master as a dependable mirror
at https://git.openwrt.org/feed/libremesh.git




Please see Inline response below:

> Currently we maintain a custom feed git repo at
> https://github.com/libremesh/lime-packages
> and what we would like to achieve in the end is that those packages
> become available in the official downloads.openwrt.org servers,
> basically.


The current feeds.conf.default (at openwrt/openwrt) is pointing to
git.openwrt.org. I'm betting because github has had multiple outages
due to content delivery network returning 404s or 500s.

I could be wrong, but.. Hah, yep @1e0f650d7d55

8<  GitHub seems to be a bit unreliable on feeds updates on the buildbot
8<  lately, so hopefully our own mirror will be more reliable than that.


> as far as i understand, we have two options (in decreasing order of
> desirability):
> 1) make a proposal (PR against this[0]) to include a new feed in
> feeds.conf.default, uncommented so that the packages inside are by
> default compiled and published along with other packages (luci, routing,
> telephony...)
>

I'd like to know a duplicate package is impossible. I haven't checked
every package, but I am betting 'tinc' would clash in openwrt-routing.

Having SNAPSHOT builds include LiMe feeds makes sense, but
for release builds it does not. Need to freeze at some point.

I trust Gui since they're both an Openwrt and LibreMesh maintainer. Accounting
for this case and perhaps others I've not considered is trivial. I'm
in agreement
having lime-feeds packages compiled and hosted by openwrt buildbots will
shift a bunch of weight from the LiMe developers and operators.

Obtaining LiMe packages via Openwrt builders/servers would be ideal.


> 2) alternatively, make a series of pull requests adding each of "our"
> packages to the standard "packages" feed
> https://git.openwrt.org/feed/packages.git
>

I'm thinking more eyes would be able to review because commits run
past LiMe and Openwrt eyes albeit at a different rate. I think there's
2 or more OpenWrt devs contributing to LiMe so not so much an issue.

> is there any other option i'm missing, or caveat regarding those two
> that would help us decide? (i.e. would a PR against feeds.conf.default
> be acceptable?)
>

I'm sure the 21 members of to LiMe packages are fun and develop in
good faith / good intention, but I'd want to see proof LiMe packages can't
conflict with upstream packages. I could have sworn the youngest
package rev wins compile time and becomes an .opkg, no?

The next obvious is github's dependability. I'd like to think we'd be able to
follow suit with say, https://git.openwrt.org/feed/libremesh.git

-Will

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] RFC: merge LibreMesh packages into OpenWrt?

2019-01-14 Thread Gui Iribarren via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---

Hello folks,
we're always looking for ways to get LibreMesh "closer to upstream", and 
one (old) idea is merging somehow our packages into OpenWrt.
(i remember briefly talking this with jow at battlemeshv8 in Porto, but 
in the end, we lime-devs never actually looked up on how that would 
happen, until now)


Currently we maintain a custom feed git repo at
https://github.com/libremesh/lime-packages
and what we would like to achieve in the end is that those packages 
become available in the official downloads.openwrt.org servers, 
basically.


as far as i understand, we have two options (in decreasing order of 
desirability):
1) make a proposal (PR against this[0]) to include a new feed in 
feeds.conf.default, uncommented so that the packages inside are by 
default compiled and published along with other packages (luci, routing, 
telephony...)


2) alternatively, make a series of pull requests adding each of "our" 
packages to the standard "packages" feed

https://git.openwrt.org/feed/packages.git

is there any other option i'm missing, or caveat regarding those two 
that would help us decide? (i.e. would a PR against feeds.conf.default 
be acceptable?)


[0]: https://github.com/openwrt/openwrt/blob/master/feeds.conf.default

--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCHv2] e2fsprogs: Update to 1.44.5

2019-01-14 Thread Rosen Penev
Added e4crypt tool for encrypting files and directories. To work properly
requires kernel and work on keyutils. That will be done in a future commit

Some top-level reorganization for consistency between packages.

Tested on GnuBee PC1 (mt7621).

Signed-off-by: Rosen Penev 
---
 v2: Readded patch 000 and rebased.
 package/utils/e2fsprogs/Makefile  | 18 +++--
 .../e2fsprogs/patches/000-relocatable.patch   | 26 +++
 2 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/package/utils/e2fsprogs/Makefile b/package/utils/e2fsprogs/Makefile
index 48f812a30c..edb9acfc76 100644
--- a/package/utils/e2fsprogs/Makefile
+++ b/package/utils/e2fsprogs/Makefile
@@ -8,13 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=e2fsprogs
-PKG_VERSION:=1.44.3
-PKG_HASH:=5d899f7d30f481cc0c6a049ebe26ebe145f1b524182ea1ecde4086162d4e4bb6
+PKG_VERSION:=1.44.5
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
+PKG_HASH:=ba5eb3069d69160d96818bb9700de9ab5a8458d9add1fd85d427cd34c5b9
+
 PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=NOTICE
 PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
 
 PKG_BUILD_DEPENDS:=util-linux e2fsprogs/host
@@ -107,6 +109,12 @@ $(call Package/e2fsprogs)
   DEPENDS:= +e2fsprogs
 endef
 
+define Package/e4crypt
+$(call Package/e2fsprogs)
+  TITLE:=Ext4 Filesystem encryption utility
+  DEPENDS:= +e2fsprogs
+endef
+
 define Package/filefrag
 $(call Package/e2fsprogs)
   TITLE:=Ext2 Filesystem file fragmentation report utility
@@ -278,6 +286,11 @@ define Package/e2freefrag/install
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2freefrag $(1)/usr/sbin/
 endef
 
+define Package/e4crypt/install
+   $(INSTALL_DIR) $(1)/usr/sbin
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e4crypt $(1)/usr/sbin/
+endef
+
 define Package/filefrag/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/filefrag $(1)/usr/sbin/
@@ -308,6 +321,7 @@ $(eval $(call BuildPackage,resize2fs))
 $(eval $(call BuildPackage,badblocks))
 $(eval $(call BuildPackage,dumpe2fs))
 $(eval $(call BuildPackage,e2freefrag))
+$(eval $(call BuildPackage,e4crypt))
 $(eval $(call BuildPackage,filefrag))
 $(eval $(call BuildPackage,debugfs))
 $(eval $(call BuildPackage,chattr))
diff --git a/package/utils/e2fsprogs/patches/000-relocatable.patch 
b/package/utils/e2fsprogs/patches/000-relocatable.patch
index 017aca1b05..0bf226f9ea 100644
--- a/package/utils/e2fsprogs/patches/000-relocatable.patch
+++ b/package/utils/e2fsprogs/patches/000-relocatable.patch
@@ -1,46 +1,40 @@
 --- a/lib/et/compile_et.sh.in
 +++ b/lib/et/compile_et.sh.in
-@@ -2,9 +2,15 @@
+@@ -2,8 +2,14 @@
  #
  #
  
--datarootdir=@datarootdir@
 -AWK=@AWK@
 -DIR=@datadir@/et
 +if test "x$STAGING_DIR" = x ; then
-+  datarootdir=@datarootdir@
 +  AWK=@AWK@
 +  DIR=@datadir@/et
 +else
-+  datarootdir="$STAGING_DIR/../hostpkg/share"
 +  AWK=awk
-+  DIR="$datarootdir/et"
++  DIR="$STAGING_DIR/../hostpkg/share/et"
 +fi
++
  
  if test "$1" = "--build-tree" ; then
  shift;
 --- a/lib/ss/mk_cmds.sh.in
 +++ b/lib/ss/mk_cmds.sh.in
-@@ -1,11 +1,17 @@
- #!/bin/sh
+@@ -2,10 +2,16 @@
  #
  #
--
--datarootdir=@datarootdir@
+ 
 -DIR=@datadir@/ss
 -AWK=@AWK@
--SED=@SED@
+ SED=sed
+ 
 +if test "x$STAGING_DIR" = x ; then
-+  datarootdir=@datarootdir@
 +  DIR=@datadir@/ss
 +  AWK=@AWK@
-+  SED=@SED@
 +else
-+  datarootdir="$STAGING_DIR/../hostpkg/share"
-+  DIR="$datarootdir/ss"
++  DIR="$STAGING_DIR/../hostpkg/share/ss"
 +  AWK=awk
-+  SED=sed
 +fi
- 
++
  for as_var in \
LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-- 
2.17.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 5/9] sunxi: add support for pine64 lts

2019-01-14 Thread Petr Štetiar
Oskari Lemmela  [2019-01-14 19:54:25]:

Hi,

> CPU: R18 High Performance Quad-core 64-bit Cortex-A53
> GPU: Mali400MP2 OpenGL ES 2.0/1.1/1.0, OpenVG 1.1, EGL
> Memory: 2GB LPDDR3 (shared with GPU)
> Onboard Storage: TF card / NOR flash(16MB)
> Onboard Network: 1000M/100M Ethernet RJ45

can you please add flashing instructions here?

>From https://openwrt.org/submitting-patches

"If you add support for new hardware: Include in your commit message a short
description of the hardware and how to install OpenWrt on it. Have a look at
the recent additions for some examples."

> +  IMAGES += sysupgrade.bin u-boot-with-spl.bin
> +  IMAGE/u-boot-with-spl.bin := sunxi-uboot | check-size 896k

Please use ARTIFACTS[1] for u-boot-with-spl.bin image.

1. 
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=493c9a35516c27a8ec412d97e63c8cf6f41a57ea

-- ynezz

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC 4/6] x86: geode: shrink amount of default packages

2019-01-14 Thread Philip Prindeville
Why is the hwclock being dropped everywhere?

And who says the geos2, net5501, or alix2 are obsolete?

I have some running right here…


> On Jan 13, 2019, at 2:49 PM, Tomasz Maciej Nowak  wrote:
> 
> Drop excesive amount of default packages, instead, rely on packages
> specified in device definitions.
> 
> Signed-off-by: Tomasz Maciej Nowak 
> ---
> target/linux/x86/geode/target.mk | 12 +---
> 1 file changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/target/linux/x86/geode/target.mk 
> b/target/linux/x86/geode/target.mk
> index 5473d2a32b..cd7afef944 100644
> --- a/target/linux/x86/geode/target.mk
> +++ b/target/linux/x86/geode/target.mk
> @@ -1,16 +1,6 @@
> BOARDNAME:=AMD Geode based systems
> FEATURES+=pci usb gpio
> -DEFAULT_PACKAGES += \
> - kmod-crypto-hw-geode kmod-crypto-cbc \
> - kmod-ath5k kmod-ath9k \
> - kmod-button-hotplug \
> - kmod-ledtrig-heartbeat kmod-ledtrig-gpio \
> - kmod-ledtrig-netdev hwclock wpad-basic
> -# Geos
> -DEFAULT_PACKAGES += \
> - soloscli linux-atm br2684ctl ppp-mod-pppoa pppdump pppstats \
> - hwclock flashrom tc kmod-pppoa kmod-8139cp kmod-mppe \
> - kmod-usb-ohci-pci kmod-hwmon-lm90
> +DEFAULT_PACKAGES+=kmod-button-hotplug
> 
> define Target/Description
>   Build firmware images for AMD Geode GX/LX based systems (net5501, alix, 
> geos)
> -- 
> 2.20.1
> 
> 
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 5/9] sunxi: add support for pine64 lts

2019-01-14 Thread Oskari Lemmela
CPU: R18 High Performance Quad-core 64-bit Cortex-A53
GPU: Mali400MP2 OpenGL ES 2.0/1.1/1.0, OpenVG 1.1, EGL
Memory: 2GB LPDDR3 (shared with GPU)
Onboard Storage: TF card / NOR flash(16MB)
Onboard Network: 1000M/100M Ethernet RJ45

Signed-off-by: Oskari Lemmela 
---
 package/boot/uboot-sunxi/Makefile |  9 +++
 .../010-sunxi-A64-Add-Pine64-LTS-board.patch  | 69 +++
 ...ner-sun50i-a64-Add-spi-flash-node-fo.patch | 64 +
 target/linux/sunxi/image/Makefile |  4 ++
 target/linux/sunxi/image/cortex-a53.mk| 13 
 ...ner-a64-Add-Pine64-LTS-device-tree-f.patch | 59 
 ...ner-a64-Add-Pine64-LTS-device-tree-f.patch | 59 
 7 files changed, 277 insertions(+)
 create mode 100644 
package/boot/uboot-sunxi/patches/010-sunxi-A64-Add-Pine64-LTS-board.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/073-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
 create mode 100644 
target/linux/sunxi/patches-4.14/062-arm64-dts-allwinner-a64-Add-Pine64-LTS-device-tree-f.patch
 create mode 100644 
target/linux/sunxi/patches-4.19/062-arm64-dts-allwinner-a64-Add-Pine64-LTS-device-tree-f.patch

diff --git a/package/boot/uboot-sunxi/Makefile 
b/package/boot/uboot-sunxi/Makefile
index 59aa4f0277..b904e166f9 100644
--- a/package/boot/uboot-sunxi/Makefile
+++ b/package/boot/uboot-sunxi/Makefile
@@ -196,6 +196,14 @@ define U-Boot/nanopi_neo2
   UENV:=a64
 endef
 
+define U-Boot/pine64-lts
+  BUILD_SUBTARGET:=cortexa53
+  NAME:=Pine64 LTS
+  BUILD_DEVICES:=sun50i-a64-pine64-lts
+  DEPENDS:=+PACKAGE_u-boot-pine64_lts:arm-trusted-firmware-sunxi
+  UENV:=a64
+endef
+
 define U-Boot/pine64_plus
   BUILD_SUBTARGET:=cortexa53
   NAME:=Pine64 Plus A64
@@ -259,6 +267,7 @@ UBOOT_TARGETS := \
orangepi_2 \
orangepi_pc2 \
pangolin \
+   pine64-lts \
pine64_plus \
sopine_baseboard \
orangepi_zero_plus
diff --git 
a/package/boot/uboot-sunxi/patches/010-sunxi-A64-Add-Pine64-LTS-board.patch 
b/package/boot/uboot-sunxi/patches/010-sunxi-A64-Add-Pine64-LTS-board.patch
new file mode 100644
index 00..3e5655ca5e
--- /dev/null
+++ b/package/boot/uboot-sunxi/patches/010-sunxi-A64-Add-Pine64-LTS-board.patch
@@ -0,0 +1,69 @@
+From 00ca215fe639051b3880821438949569691a2efc Mon Sep 17 00:00:00 2001
+From: Andre Przywara 
+Date: Mon, 29 Oct 2018 00:56:50 +
+Subject: [PATCH] sunxi: A64: Add Pine64-LTS board
+
+The Pine64 LTS is an updated version of the Pine64, copying the
+technical updates from the SoPine platform: LPDDR3 DRAM, eMMC socket and
+soldered SPI flash chip, even the broken SD card detect pin has been copied.
+Consequently this leads to the .dts (copied from the kernel) just including
+the SoPine baseboard .dts, and the defconfig being almost identical.
+Nevertheless the boards deserves a separate config.
+
+Signed-off-by: Andre Przywara 
+Acked-by: Maxime Ripard 
+Reviewed-by: Jagan Teki 
+---
+ arch/arm/dts/sun50i-a64-pine64-lts.dts | 13 +
+ configs/pine64-lts_defconfig   | 19 +++
+ 2 files changed, 32 insertions(+)
+ create mode 100644 arch/arm/dts/sun50i-a64-pine64-lts.dts
+ create mode 100644 configs/pine64-lts_defconfig
+
+diff --git a/arch/arm/dts/sun50i-a64-pine64-lts.dts 
b/arch/arm/dts/sun50i-a64-pine64-lts.dts
+new file mode 100644
+index 00..72d6961dc3
+--- /dev/null
 b/arch/arm/dts/sun50i-a64-pine64-lts.dts
+@@ -0,0 +1,13 @@
++/*
++ * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
++ *
++ * Copyright (c) 2018 ARM Ltd.
++ */
++
++#include "sun50i-a64-sopine-baseboard.dts"
++
++/ {
++  model = "Pine64 LTS";
++  compatible = "pine64,pine64-lts", "allwinner,sun50i-r18",
++   "allwinner,sun50i-a64";
++};
+diff --git a/configs/pine64-lts_defconfig b/configs/pine64-lts_defconfig
+new file mode 100644
+index 00..fd3cdeec85
+--- /dev/null
 b/configs/pine64-lts_defconfig
+@@ -0,0 +1,19 @@
++CONFIG_ARM=y
++CONFIG_ARCH_SUNXI=y
++CONFIG_SPL=y
++CONFIG_MACH_SUN50I=y
++CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
++CONFIG_DRAM_CLK=552
++CONFIG_DRAM_ZQ=3881949
++CONFIG_MMC0_CD_PIN=""
++CONFIG_MMC_SUNXI_SLOT_EXTRA=2
++CONFIG_SPL_SPI_SUNXI=y
++CONFIG_NR_DRAM_BANKS=1
++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
++# CONFIG_CMD_FLASH is not set
++# CONFIG_SPL_DOS_PARTITION is not set
++# CONFIG_SPL_EFI_PARTITION is not set
++CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-lts"
++CONFIG_SUN8I_EMAC=y
++CONFIG_USB_EHCI_HCD=y
++CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
+-- 
+2.17.1
+
diff --git 
a/package/boot/uboot-sunxi/patches/073-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
 
b/package/boot/uboot-sunxi/patches/073-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
new file mode 100644
index 00..7028aec555
--- /dev/null
+++ 
b/package/boot/uboot-sunxi/patches/073-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
@@ -0,0 +1,64 @@
+From 2912beffaa0a84c27493e59d73e89845008b62d4 Mon Sep 17 

[OpenWrt-Devel] [PATCH 6/9] uboot-sunxi: add spi driver for pine64 lts

2019-01-14 Thread Oskari Lemmela
Add support for SPI driver and booting from SPI.

Signed-off-by: Oskari Lemmela 
---
 ...i-allwinner-spi-driver-sun6i-support.patch | 311 ++
 ...er-sunxi-fix-spurious-timeout-issues.patch |  30 ++
 .../302-sunxi-add-spi-flash-bootcmd.patch |  81 +
 ...03-sunxi-dt-a64-sopine-add-spi-alias.patch |  27 ++
 ...4-sunxi-a64-enable-spi-in-pine64-lts.patch |  32 ++
 ...sunxi-enable-distro-spi-boot-command.patch |  25 ++
 6 files changed, 506 insertions(+)
 create mode 100644 
package/boot/uboot-sunxi/patches/300-arm-sunxi-allwinner-spi-driver-sun6i-support.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/301-arm-timer-sunxi-fix-spurious-timeout-issues.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/302-sunxi-add-spi-flash-bootcmd.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/303-sunxi-dt-a64-sopine-add-spi-alias.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/304-sunxi-a64-enable-spi-in-pine64-lts.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/305-sunxi-enable-distro-spi-boot-command.patch

diff --git 
a/package/boot/uboot-sunxi/patches/300-arm-sunxi-allwinner-spi-driver-sun6i-support.patch
 
b/package/boot/uboot-sunxi/patches/300-arm-sunxi-allwinner-spi-driver-sun6i-support.patch
new file mode 100644
index 00..553565501f
--- /dev/null
+++ 
b/package/boot/uboot-sunxi/patches/300-arm-sunxi-allwinner-spi-driver-sun6i-support.patch
@@ -0,0 +1,311 @@
+From 04b54c263c51eb28b50e01946989cc174102af8d Mon Sep 17 00:00:00 2001
+From: Oskari Lemmela 
+Date: Sat, 29 Dec 2018 10:55:20 +0200
+Subject: [PATCH] arm: sunxi: Allwinner SPI driver sun6i support
+
+Minimal changes to support sun6i based Allwinner SOCs
+Changes are based to SPL driver arch/arm/mach-sunxi/spl_spi_sunxi.c
+
+Signed-off-by: Oskari Lemmela 
+---
+ arch/arm/include/asm/arch-sunxi/clock_sun6i.h |   1 +
+ arch/arm/include/asm/arch-sunxi/clock_sun9i.h |   1 +
+ drivers/spi/Kconfig   |   4 +-
+ drivers/spi/sun4i_spi.c   | 116 --
+ 4 files changed, 107 insertions(+), 15 deletions(-)
+
+diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h 
b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
+index ee387127f3..4aaa0932d7 100644
+--- a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
 b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
+@@ -321,6 +321,7 @@ struct sunxi_ccm_reg {
+ #define AHB_GATE_OFFSET_MMC(n)(AHB_GATE_OFFSET_MMC0 + (n))
+ #define AHB_GATE_OFFSET_DMA   6
+ #define AHB_GATE_OFFSET_SS5
++#define AHB_GATE_OFFSET_SPI0  20
+ 
+ /* ahb_gate1 offsets */
+ #define AHB_GATE_OFFSET_DRC0  25
+diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun9i.h 
b/arch/arm/include/asm/arch-sunxi/clock_sun9i.h
+index 530e0dd73b..9bbd4d319e 100644
+--- a/arch/arm/include/asm/arch-sunxi/clock_sun9i.h
 b/arch/arm/include/asm/arch-sunxi/clock_sun9i.h
+@@ -194,6 +194,7 @@ struct sunxi_ccm_reg {
+ 
+ /* ahb gate1 field */
+ #define AHB_GATE_OFFSET_DMA   24
++#define AHB_GATE_OFFSET_SPI0  20
+ 
+ /* apb1_gate fields */
+ #define APB1_GATE_UART_SHIFT  16
+diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
+index 516188ea88..996ec9beb7 100644
+--- a/drivers/spi/Kconfig
 b/drivers/spi/Kconfig
+@@ -198,9 +198,9 @@ config STM32_QSPI
+ this ST IP core.
+ 
+ config SUN4I_SPI
+-  bool "Allwinner A10 SoCs SPI controller"
++  bool "Allwinner SoCs SPI driver"
+   help
+-SPI driver for Allwinner sun4i, sun5i and sun7i SoCs
++SPI driver for Allwinner SoCs
+ 
+ config TEGRA114_SPI
+   bool "nVidia Tegra114 SPI driver"
+diff --git a/drivers/spi/sun4i_spi.c b/drivers/spi/sun4i_spi.c
+index b86b5a00ad..9bc0b60a4e 100644
+--- a/drivers/spi/sun4i_spi.c
 b/drivers/spi/sun4i_spi.c
+@@ -37,6 +37,30 @@
+ 
+ #define SUN4I_TXDATA_REG  0x04
+ 
++#ifdef CONFIG_SUNXI_GEN_SUN6I
++#define SUN4I_CTL_REG 0x04
++#define SUN4I_CTL_ENABLE  BIT(0)
++#define SUN4I_CTL_MASTER  BIT(1)
++#define SUN4I_CTL_TP  BIT(7)
++#define SUN4I_CTL_SRSTBIT(31)
++
++#define SUN4I_CTL_CPHABIT(0)
++#define SUN4I_CTL_CPOLBIT(1)
++#define SUN4I_CTL_CS_ACTIVE_LOW   BIT(2)
++#define SUN4I_CTL_CS_MASK 0x30
++#define SUN4I_CTL_CS(cs)  (((cs) << 4) & SUN4I_CTL_CS_MASK)
++#define SUN4I_CTL_CS_MANUAL   BIT(6)
++#define SUN4I_CTL_CS_LEVELBIT(7)
++#define SUN4I_CTL_DHB BIT(8)
++#define SUN4I_CTL_XCH_MASK0x8000
++#define SUN4I_CTL_XCH BIT(31)
++
++#define SUN4I_CTL_RF_RST  BIT(15)
++#define SUN4I_CTL_TF_RST  BIT(31)
++
++#else
++#define SUN4I_CTL_SRST0
++
+ #define SUN4I_CTL_REG 0x08
+ #define SUN4I_CTL_ENABLE  BIT(0)
+ #define SUN4I_CTL_MASTER  BIT(1)
+@@ 

[OpenWrt-Devel] [PATCH 9/9] sunxi: sysupgrade: add support for pine64 lts spi flash

2019-01-14 Thread Oskari Lemmela
Add support for updating SPI flash device firmware.

U-boot has to be programmed to spi flash device /dev/mtd0
manually before switching from sdcard to SPI flash device.

Running sysupgrade with sysupgrade.bin will write firmware
partition and copy configuration files from sdcard.

Signed-off-by: Oskari Lemmela 
---
 .../sunxi/base-files/lib/upgrade/platform.sh  | 30 ++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/target/linux/sunxi/base-files/lib/upgrade/platform.sh 
b/target/linux/sunxi/base-files/lib/upgrade/platform.sh
index 88ef4790e9..436e4d8517 100644
--- a/target/linux/sunxi/base-files/lib/upgrade/platform.sh
+++ b/target/linux/sunxi/base-files/lib/upgrade/platform.sh
@@ -1,5 +1,17 @@
+PART_NAME=firmware
+
 platform_check_image() {
local diskdev partdev diff
+   local firmware_mtd=$(find_mtd_part firmware)
+   local image_magic="$(get_magic_long "$1")"
+
+   if [ -n "$firmware_mtd" ] && [ "$image_magic" != "" ]; then
+   REQUIRE_IMAGE_METADATA=1
+   if ! $(fwtool_check_image $@); then
+   return 1
+   fi
+   return 0
+   fi
 
export_bootdevice && export_partdevice diskdev -2 || {
echo "Unable to determine upgrade device"
@@ -35,7 +47,7 @@ platform_copy_config() {
fi
 }
 
-platform_do_upgrade() {
+platform_do_upgrade_mmc() {
local diskdev partdev diff
 
export_bootdevice && export_partdevice diskdev -2 || {
@@ -87,3 +99,19 @@ platform_do_upgrade() {
echo "Writing new UUID to /dev/$diskdev..."
get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 
conv=fsync
 }
+
+platform_do_upgrade() {
+   local board=$(board_name)
+   local image_magic="$(get_magic_long "$1")"
+
+   if [ "$image_magic" != "" ]; then
+   case "$board" in
+   pine64,pine64-lts)
+   default_do_upgrade "$ARGV"
+   ;;
+   esac
+   else
+   platform_do_upgrade_mmc "$ARGV"
+   fi
+
+}
-- 
2.17.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 7/9] uboot-sunxi: move pine64 lts env to spi flash

2019-01-14 Thread Oskari Lemmela
Patches to move pine64 LTS environment to SPI flash device.

Signed-off-by: Oskari Lemmela 
---
 ...-move-env-to-spi-flash-in-pine64-lts.patch | 27 +
 ...efines-if-config-env-is-in-spi-flash.patch | 57 +++
 2 files changed, 84 insertions(+)
 create mode 100644 
package/boot/uboot-sunxi/patches/306-sunxi-a64-move-env-to-spi-flash-in-pine64-lts.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/307-env-check-defines-if-config-env-is-in-spi-flash.patch

diff --git 
a/package/boot/uboot-sunxi/patches/306-sunxi-a64-move-env-to-spi-flash-in-pine64-lts.patch
 
b/package/boot/uboot-sunxi/patches/306-sunxi-a64-move-env-to-spi-flash-in-pine64-lts.patch
new file mode 100644
index 00..dc26c067eb
--- /dev/null
+++ 
b/package/boot/uboot-sunxi/patches/306-sunxi-a64-move-env-to-spi-flash-in-pine64-lts.patch
@@ -0,0 +1,27 @@
+From 1a4cfdf1bfe4706a11ab7cd724949f7551a53b42 Mon Sep 17 00:00:00 2001
+From: Oskari Lemmela 
+Date: Mon, 14 Jan 2019 12:34:55 +0200
+Subject: [PATCH] sunxi: a64: move env to spi flash in pine64 lts
+
+Move environment to SPI flash in pine64 LTS defconfig
+
+Signed-off-by: Oskari Lemmela 
+---
+ configs/pine64-lts_defconfig | 4 
+ 1 file changed, 4 insertions(+)
+
+diff --git a/configs/pine64-lts_defconfig b/configs/pine64-lts_defconfig
+index 82208f8a3e..cbf674e318 100644
+--- a/configs/pine64-lts_defconfig
 b/configs/pine64-lts_defconfig
+@@ -26,3 +26,7 @@ CONFIG_SPI=y
+ CONFIG_SPI_FLASH=y
+ CONFIG_SPI_FLASH_WINBOND=y
+ CONFIG_SUN4I_SPI=y
++CONFIG_ENV_IS_IN_FAT=n
++CONFIG_ENV_IS_IN_SPI_FLASH=y
++CONFIG_ENV_OFFSET=0xE
++CONFIG_ENV_SIZE=0x2
+-- 
+2.17.1
+
diff --git 
a/package/boot/uboot-sunxi/patches/307-env-check-defines-if-config-env-is-in-spi-flash.patch
 
b/package/boot/uboot-sunxi/patches/307-env-check-defines-if-config-env-is-in-spi-flash.patch
new file mode 100644
index 00..60a6e39589
--- /dev/null
+++ 
b/package/boot/uboot-sunxi/patches/307-env-check-defines-if-config-env-is-in-spi-flash.patch
@@ -0,0 +1,57 @@
+From f1579bf1f8278c650025469d19f31df41abd40c3 Mon Sep 17 00:00:00 2001
+From: Oskari Lemmela 
+Date: Wed, 2 Jan 2019 17:35:04 +0200
+Subject: [PATCH] env: check defines if config env is in spi flash
+
+Check config environment defines if
+CONFIG_ENV_IS_IN_SPI_FLASH is defined
+
+Signed-off-by: Oskari Lemmela 
+---
+ include/environment.h | 23 +--
+ 1 file changed, 13 insertions(+), 10 deletions(-)
+
+diff --git a/include/environment.h b/include/environment.h
+index 5e90f157e8..ff53b90c88 100644
+--- a/include/environment.h
 b/include/environment.h
+@@ -21,6 +21,19 @@
+  *
+  */
+ 
++#if defined(CONFIG_ENV_IS_IN_FLASH) || defined(CONFIG_ENV_IS_IN_SPI_FLASH)
++# if defined(CONFIG_ENV_SECT_SIZE) || defined(CONFIG_ENV_SIZE)
++#  ifndef CONFIG_ENV_SECT_SIZE
++#   defineCONFIG_ENV_SECT_SIZECONFIG_ENV_SIZE
++#  endif
++#  ifndef CONFIG_ENV_SIZE
++#   defineCONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
++#  endif
++# else
++#  error "Both CONFIG_ENV_SECT_SIZE and CONFIG_ENV_SIZE undefined"
++# endif
++#endif
++
+ #if defined(CONFIG_ENV_IS_IN_FLASH)
+ # ifndef  CONFIG_ENV_ADDR
+ #  define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET)
+@@ -32,16 +45,6 @@
+ #  define CONFIG_ENV_ADDR_REDUND  \
+   (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET_REDUND)
+ # endif
+-# if defined(CONFIG_ENV_SECT_SIZE) || defined(CONFIG_ENV_SIZE)
+-#  ifndef CONFIG_ENV_SECT_SIZE
+-#   defineCONFIG_ENV_SECT_SIZECONFIG_ENV_SIZE
+-#  endif
+-#  ifndef CONFIG_ENV_SIZE
+-#   defineCONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
+-#  endif
+-# else
+-#  error "Both CONFIG_ENV_SECT_SIZE and CONFIG_ENV_SIZE undefined"
+-# endif
+ # if defined(CONFIG_ENV_ADDR_REDUND) && !defined(CONFIG_ENV_SIZE_REDUND)
+ #  define CONFIG_ENV_SIZE_REDUND  CONFIG_ENV_SIZE
+ # endif
+-- 
+2.17.1
+
-- 
2.17.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 8/9] uboot-envtools: sunxi: add support for the pine64 lts

2019-01-14 Thread Oskari Lemmela
Add support for reading and writing environment stored in
SPI flash device.

Signed-off-by: Oskari Lemmela 
---
 package/boot/uboot-envtools/files/sunxi | 33 +
 1 file changed, 33 insertions(+)
 create mode 100644 package/boot/uboot-envtools/files/sunxi

diff --git a/package/boot/uboot-envtools/files/sunxi 
b/package/boot/uboot-envtools/files/sunxi
new file mode 100644
index 00..7d6c1d4912
--- /dev/null
+++ b/package/boot/uboot-envtools/files/sunxi
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# Copyright (C) 2018 OpenWrt.org
+#
+
+[ -e /etc/config/ubootenv ] && exit 0
+
+touch /etc/config/ubootenv
+
+. /lib/uboot-envtools.sh
+. /lib/functions.sh
+
+board=$(board_name)
+
+ubootenv_mtdinfo () {
+   UBOOTENV_PART=$(cat /proc/mtd | grep u-boot-env)
+   mtd_dev=$(echo $UBOOTENV_PART | awk '{print $1}' | sed 's/:$//')
+   mtd_size=$(echo $UBOOTENV_PART | awk '{print "0x"$2}')
+   mtd_erase=$(echo $UBOOTENV_PART | awk '{print "0x"$3}')
+   sectors=$(( $mtd_size / $mtd_erase ))
+   echo /dev/$mtd_dev 0x0 $mtd_size $mtd_erase $sectors
+}
+
+case "$board" in
+pine64,pine64-lts)
+   ubootenv_add_uci_config $(ubootenv_mtdinfo)
+   ;;
+esac
+
+config_load ubootenv
+config_foreach ubootenv_add_app_config ubootenv
+
+exit 0
-- 
2.17.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/9] sunxi: switch to lzma compressed fit image

2019-01-14 Thread Oskari Lemmela
Use LZMA compressed fit image to load kernel and dtb.
Fit image can be used load kernel and dtb from SPI flash.

Signed-off-by: Oskari Lemmela 
---
 package/boot/uboot-sunxi/uEnv-a64.txt  |  5 ++-
 package/boot/uboot-sunxi/uEnv-default.txt  |  5 ++-
 package/boot/uboot-sunxi/uEnv-pangolin.txt |  5 ++-
 target/linux/sunxi/Makefile|  2 +-
 target/linux/sunxi/cortexa53/target.mk |  1 -
 target/linux/sunxi/image/Makefile  | 17 +++---
 target/linux/sunxi/image/cortex-a53.mk | 25 ---
 target/linux/sunxi/image/cortex-a7.mk  | 36 +++---
 target/linux/sunxi/image/cortex-a8.mk  | 11 ---
 9 files changed, 49 insertions(+), 58 deletions(-)

diff --git a/package/boot/uboot-sunxi/uEnv-a64.txt 
b/package/boot/uboot-sunxi/uEnv-a64.txt
index 7a717fdc0f..713f4fbdc3 100644
--- a/package/boot/uboot-sunxi/uEnv-a64.txt
+++ b/package/boot/uboot-sunxi/uEnv-a64.txt
@@ -1,5 +1,4 @@
-setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage
-setenv loaddtb fatload mmc 0 \$fdt_addr_r dtb
+setenv loadkernel fatload mmc 0 \$ramdisk_addr_r uImage
 setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait 
earlycon=uart,mmio32,0x01c28000
-setenv uenvcmd run loadkernel \&\& run loaddtb \&\& booti \$kernel_addr_r - 
\$fdt_addr_r
+setenv uenvcmd run loadkernel \&\& bootm \$ramdisk_addr_r
 run uenvcmd
diff --git a/package/boot/uboot-sunxi/uEnv-default.txt 
b/package/boot/uboot-sunxi/uEnv-default.txt
index e024954516..ac478f9635 100644
--- a/package/boot/uboot-sunxi/uEnv-default.txt
+++ b/package/boot/uboot-sunxi/uEnv-default.txt
@@ -1,6 +1,5 @@
 setenv fdt_high 
-setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage
-setenv loaddtb fatload mmc 0 \$fdt_addr_r dtb
+setenv loadkernel fatload mmc 0 \$ramdisk_addr_r uImage
 setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
-setenv uenvcmd run loadkernel \&\& run loaddtb \&\& bootm \$kernel_addr_r - 
\$fdt_addr_r
+setenv uenvcmd run loadkernel \&\& bootm \$ramdisk_addr_r
 run uenvcmd
diff --git a/package/boot/uboot-sunxi/uEnv-pangolin.txt 
b/package/boot/uboot-sunxi/uEnv-pangolin.txt
index 9c4fa11220..2d4651c7a9 100644
--- a/package/boot/uboot-sunxi/uEnv-pangolin.txt
+++ b/package/boot/uboot-sunxi/uEnv-pangolin.txt
@@ -1,6 +1,5 @@
 setenv fdt_high 
-setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage
-setenv loaddtb fatload mmc 0 \$fdt_addr_r dtb
+setenv loadkernel fatload mmc 0 \$ramdisk_addr_r uImage
 setenv bootargs console=ttyS2,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
-setenv uenvcmd run loadkernel \&\& run loaddtb \&\& bootm \$kernel_addr_r - 
\$fdt_addr_r
+setenv uenvcmd run loadkernel \&\& bootm \$ramdisk_addr_r
 run uenvcmd
diff --git a/target/linux/sunxi/Makefile b/target/linux/sunxi/Makefile
index 8d09d4e939..b024f5e3a2 100644
--- a/target/linux/sunxi/Makefile
+++ b/target/linux/sunxi/Makefile
@@ -15,7 +15,7 @@ SUBTARGETS:=cortexa8 cortexa7 cortexa53
 MAINTAINER:=Zoltan HERPAI 
 
 KERNEL_PATCHVER:=4.14
-KERNELNAME:=zImage dtbs
+KERNELNAME:=Image dtbs
 
 # A10: Cortex-A8
 # A13: Cortex-A8
diff --git a/target/linux/sunxi/cortexa53/target.mk 
b/target/linux/sunxi/cortexa53/target.mk
index 6715d00bda..4e2c320bc0 100644
--- a/target/linux/sunxi/cortexa53/target.mk
+++ b/target/linux/sunxi/cortexa53/target.mk
@@ -10,4 +10,3 @@ include $(TOPDIR)/rules.mk
 ARCH:=aarch64
 BOARDNAME:=Allwinner A64
 CPU_TYPE:=cortex-a53
-KERNELNAME:=Image dtbs
diff --git a/target/linux/sunxi/image/Makefile 
b/target/linux/sunxi/image/Makefile
index 8f95c61906..b24cf70928 100644
--- a/target/linux/sunxi/image/Makefile
+++ b/target/linux/sunxi/image/Makefile
@@ -11,14 +11,11 @@ include $(INCLUDE_DIR)/image.mk
 FAT32_BLOCK_SIZE=1024
 FAT32_BLOCKS=$(shell echo 
$$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE
 
-KERNEL_LOADADDR:=0x40008000
-
 define Build/sunxi-sdcard
rm -f $@.boot
mkfs.fat $@.boot -C $(FAT32_BLOCKS)
 
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.scr ::boot.scr
-   mcopy -i $@.boot $(DTS_DIR)/$(SUNXI_DTS).dtb ::dtb
mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage
./gen_sunxi_sdcard_img.sh $@ \
$@.boot \
@@ -33,12 +30,22 @@ endef
 define Device/Default
   PROFILES := Default
   DEVICE_VARS := SUNXI_DTS SUNXI_UBOOT
-  KERNEL_NAME := zImage
-  KERNEL := kernel-bin | uImage none
+  KERNEL_NAME := Image
+  SUNXI_DTS := $(1)
   IMAGES := sdcard.img.gz
   IMAGE/sdcard.img.gz := sunxi-sdcard | append-metadata | gzip
 endef
 
+define Device/FitImageLzma
+  KERNEL_LOADADDR:=0x4200
+  KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(SUNXI_DTS).dtb
+endef
+
+define Device/FitImageLzma64
+  KERNEL_LOADADDR:=0x4008
+  KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/allwinner/$$(SUNXI_DTS).dtb
+endef
+
 include cortex-a7.mk
 include cortex-a8.mk
 include cortex-a53.mk
diff --git a/target/linux/sunxi/image/cortex-a53.mk 
b/target/linux/sunxi/image/cortex-a53.mk
index 

[OpenWrt-Devel] [PATCH 3/9] sunxi: spi flash dts changes

2019-01-14 Thread Oskari Lemmela
Backport A64 SPI flash DTS changes to 4.14 kernel.

Add Openwrt specific flash partitions to Sopine.

Signed-off-by: Oskari Lemmela 
---
 ...80-arm64-allwinner-a64-add-SPI-nodes.patch | 83 +++
 ...ner-sun50i-a64-Add-spi-flash-node-fo.patch | 41 +
 ...a64-sopine-Add-Sopine-flash-partitio.patch | 51 
 ...a64-sopine-Add-Sopine-flash-partitio.patch | 51 
 4 files changed, 226 insertions(+)
 create mode 100644 
target/linux/sunxi/patches-4.14/080-arm64-allwinner-a64-add-SPI-nodes.patch
 create mode 100644 
target/linux/sunxi/patches-4.14/081-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
 create mode 100644 
target/linux/sunxi/patches-4.14/400-arm64-allwinner-a64-sopine-Add-Sopine-flash-partitio.patch
 create mode 100644 
target/linux/sunxi/patches-4.19/400-arm64-allwinner-a64-sopine-Add-Sopine-flash-partitio.patch

diff --git 
a/target/linux/sunxi/patches-4.14/080-arm64-allwinner-a64-add-SPI-nodes.patch 
b/target/linux/sunxi/patches-4.14/080-arm64-allwinner-a64-add-SPI-nodes.patch
new file mode 100644
index 00..0608f13629
--- /dev/null
+++ 
b/target/linux/sunxi/patches-4.14/080-arm64-allwinner-a64-add-SPI-nodes.patch
@@ -0,0 +1,83 @@
+From b518bb159032aac33503fd4cf98706dc84cc1266 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Stefan=20Br=C3=BCns?= 
+Date: Thu, 31 Aug 2017 01:06:37 +0200
+Subject: [PATCH] arm64: allwinner: a64: add SPI nodes
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The A64 SPI controllers are register compatible to the h3/h5 SPI
+controllers.
+
+The A64 has two SPI controllers, each with a single chip select.
+The handles for the DMA channels (23/24 for SPI0/SPI1) are omitted,
+as the A64 DMA support is currently missing.
+
+Signed-off-by: Stefan Brüns 
+Signed-off-by: Maxime Ripard 
+---
+ arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 41 +++
+ 1 file changed, 41 insertions(+)
+
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi 
b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+index 8c8db1b057df..20aba7b186aa 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
 b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+@@ -325,6 +325,16 @@
+   drive-strength = <40>;
+   };
+ 
++  spi0_pins: spi0 {
++  pins = "PC0", "PC1", "PC2", "PC3";
++  function = "spi0";
++  };
++
++  spi1_pins: spi1 {
++  pins = "PD0", "PD1", "PD2", "PD3";
++  function = "spi1";
++  };
++
+   uart0_pins_a: uart0@0 {
+   pins = "PB8", "PB9";
+   function = "uart0";
+@@ -449,6 +459,37 @@
+   #size-cells = <0>;
+   };
+ 
++
++  spi0: spi@01c68000 {
++  compatible = "allwinner,sun8i-h3-spi";
++  reg = <0x01c68000 0x1000>;
++  interrupts = ;
++  clocks = < CLK_BUS_SPI0>, < CLK_SPI0>;
++  clock-names = "ahb", "mod";
++  pinctrl-names = "default";
++  pinctrl-0 = <_pins>;
++  resets = < RST_BUS_SPI0>;
++  status = "disabled";
++  num-cs = <1>;
++  #address-cells = <1>;
++  #size-cells = <0>;
++  };
++
++  spi1: spi@01c69000 {
++  compatible = "allwinner,sun8i-h3-spi";
++  reg = <0x01c69000 0x1000>;
++  interrupts = ;
++  clocks = < CLK_BUS_SPI1>, < CLK_SPI1>;
++  clock-names = "ahb", "mod";
++  pinctrl-names = "default";
++  pinctrl-0 = <_pins>;
++  resets = < RST_BUS_SPI1>;
++  status = "disabled";
++  num-cs = <1>;
++  #address-cells = <1>;
++  #size-cells = <0>;
++  };
++
+   gic: interrupt-controller@1c81000 {
+   compatible = "arm,gic-400";
+   reg = <0x01c81000 0x1000>,
+-- 
+2.17.1
+
diff --git 
a/target/linux/sunxi/patches-4.14/081-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
 
b/target/linux/sunxi/patches-4.14/081-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
new file mode 100644
index 00..c975823447
--- /dev/null
+++ 
b/target/linux/sunxi/patches-4.14/081-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
@@ -0,0 +1,41 @@
+From 4661c3afefe900ff7b5004aca0a2c927cfa37f3b Mon Sep 17 00:00:00 2001
+From: Emmanuel Vadot 
+Date: Mon, 21 May 2018 13:54:13 +0200
+Subject: [PATCH] arm64: dts: allwinner: sun50i: a64: Add spi flash 

[OpenWrt-Devel] [PATCH 0/9] sunxi: add support for pine64-lts

2019-01-14 Thread Oskari Lemmela
Patches for Pine64 LTS support. Pine64 LTS has onboard
16MB SPI flash device which can be used to boot Openwrt.

Following patch set enables: 
 - FIT image booting from flash and SD 
 - storing environment to flash
 - sysupgrade support for flash and SD to flash
 - modifying enviroment in flash

U-boot image can be written to SPI flash via booting
from SD card and then writing u-boot-with-spl.bin to 
/dev/mtd0.  

Oskari Lemmela (9):
  sunxi: add a64 watchdog support
  sunxi: add spi flash support to kernel
  sunxi: spi flash dts changes
  sunxi: switch to lzma compressed fit image
  sunxi: add support for pine64 lts
  uboot-sunxi: add spi driver for pine64 lts
  uboot-sunxi: move pine64 lts env to spi flash
  uboot-envtools: sunxi: add support for the pine64 lts
  sunxi: sysupgrade: add support for pine64 lts spi flash

 package/boot/uboot-envtools/files/sunxi   |  33 ++
 package/boot/uboot-sunxi/Makefile |   9 +
 .../010-sunxi-A64-Add-Pine64-LTS-board.patch  |  69 
 ...ner-sun50i-a64-Add-spi-flash-node-fo.patch |  64 
 ...i-allwinner-spi-driver-sun6i-support.patch | 311 ++
 ...er-sunxi-fix-spurious-timeout-issues.patch |  30 ++
 .../302-sunxi-add-spi-flash-bootcmd.patch |  81 +
 ...03-sunxi-dt-a64-sopine-add-spi-alias.patch |  27 ++
 ...4-sunxi-a64-enable-spi-in-pine64-lts.patch |  32 ++
 ...sunxi-enable-distro-spi-boot-command.patch |  25 ++
 ...-move-env-to-spi-flash-in-pine64-lts.patch |  27 ++
 ...efines-if-config-env-is-in-spi-flash.patch |  57 
 package/boot/uboot-sunxi/uEnv-a64.txt |   5 +-
 package/boot/uboot-sunxi/uEnv-default.txt |   5 +-
 package/boot/uboot-sunxi/uEnv-pangolin.txt|   5 +-
 target/linux/sunxi/Makefile   |   2 +-
 .../sunxi/base-files/lib/upgrade/platform.sh  |  30 +-
 target/linux/sunxi/config-4.14|   9 +-
 target/linux/sunxi/config-4.19|   9 +-
 target/linux/sunxi/cortexa53/target.mk|   1 -
 target/linux/sunxi/image/Makefile |  21 +-
 target/linux/sunxi/image/cortex-a53.mk|  38 +--
 target/linux/sunxi/image/cortex-a7.mk |  36 +-
 target/linux/sunxi/image/cortex-a8.mk |  11 +-
 ...arm64-dts-allwinner-a64-Add-watchdog.patch |  54 +++
 ...ner-a64-Add-Pine64-LTS-device-tree-f.patch |  59 
 ...80-arm64-allwinner-a64-add-SPI-nodes.patch |  83 +
 ...ner-sun50i-a64-Add-spi-flash-node-fo.patch |  41 +++
 ...a64-sopine-Add-Sopine-flash-partitio.patch |  51 +++
 ...ner-a64-Add-Pine64-LTS-device-tree-f.patch |  59 
 ...a64-sopine-Add-Sopine-flash-partitio.patch |  51 +++
 31 files changed, 1274 insertions(+), 61 deletions(-)
 create mode 100644 package/boot/uboot-envtools/files/sunxi
 create mode 100644 
package/boot/uboot-sunxi/patches/010-sunxi-A64-Add-Pine64-LTS-board.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/073-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/300-arm-sunxi-allwinner-spi-driver-sun6i-support.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/301-arm-timer-sunxi-fix-spurious-timeout-issues.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/302-sunxi-add-spi-flash-bootcmd.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/303-sunxi-dt-a64-sopine-add-spi-alias.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/304-sunxi-a64-enable-spi-in-pine64-lts.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/305-sunxi-enable-distro-spi-boot-command.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/306-sunxi-a64-move-env-to-spi-flash-in-pine64-lts.patch
 create mode 100644 
package/boot/uboot-sunxi/patches/307-env-check-defines-if-config-env-is-in-spi-flash.patch
 create mode 100644 
target/linux/sunxi/patches-4.14/040-arm64-dts-allwinner-a64-Add-watchdog.patch
 create mode 100644 
target/linux/sunxi/patches-4.14/062-arm64-dts-allwinner-a64-Add-Pine64-LTS-device-tree-f.patch
 create mode 100644 
target/linux/sunxi/patches-4.14/080-arm64-allwinner-a64-add-SPI-nodes.patch
 create mode 100644 
target/linux/sunxi/patches-4.14/081-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
 create mode 100644 
target/linux/sunxi/patches-4.14/400-arm64-allwinner-a64-sopine-Add-Sopine-flash-partitio.patch
 create mode 100644 
target/linux/sunxi/patches-4.19/062-arm64-dts-allwinner-a64-Add-Pine64-LTS-device-tree-f.patch
 create mode 100644 
target/linux/sunxi/patches-4.19/400-arm64-allwinner-a64-sopine-Add-Sopine-flash-partitio.patch

-- 
2.17.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/9] sunxi: add a64 watchdog support

2019-01-14 Thread Oskari Lemmela
Backport A64 watchdog DTS change to 4.14 kernel.

Signed-off-by: Oskari Lemmela 
---
 ...arm64-dts-allwinner-a64-Add-watchdog.patch | 54 +++
 1 file changed, 54 insertions(+)
 create mode 100644 
target/linux/sunxi/patches-4.14/040-arm64-dts-allwinner-a64-Add-watchdog.patch

diff --git 
a/target/linux/sunxi/patches-4.14/040-arm64-dts-allwinner-a64-Add-watchdog.patch
 
b/target/linux/sunxi/patches-4.14/040-arm64-dts-allwinner-a64-Add-watchdog.patch
new file mode 100644
index 00..5aadaa7b0b
--- /dev/null
+++ 
b/target/linux/sunxi/patches-4.14/040-arm64-dts-allwinner-a64-Add-watchdog.patch
@@ -0,0 +1,54 @@
+From d41850437c364ef7aba9bc25c1c701699d0240e0 Mon Sep 17 00:00:00 2001
+From: Harald Geyer 
+Date: Thu, 15 Mar 2018 16:25:07 +
+Subject: [PATCH] arm64: dts: allwinner: a64: Add watchdog
+
+Add a watchdog node for the A64, automatically enabled on all boards.
+Since the device is compatible with an existing driver, we only reserve
+a new compatible string to be used together with the fall back.
+Tested on Olimex Teres-I.
+
+Signed-off-by: Harald Geyer 
+Signed-off-by: Maxime Ripard 
+---
+ Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt | 6 --
+ arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi| 7 +++
+ 2 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt 
b/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
+index 62dd5baad70e..04fc368d828f 100644
+--- a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
 b/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
+@@ -2,8 +2,10 @@ Allwinner SoCs Watchdog timer
+ 
+ Required properties:
+ 
+-- compatible : should be either "allwinner,sun4i-a10-wdt" or
+-   "allwinner,sun6i-a31-wdt"
++- compatible : should be one of
++  "allwinner,sun4i-a10-wdt"
++  "allwinner,sun6i-a31-wdt"
++  "allwinner,sun50i-a64-wdt","allwinner,sun6i-a31-wdt"
+ - reg : Specifies base physical address and size of the registers.
+ 
+ Example:
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi 
b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+index 64e452a758fa..8401e7f887ff 100644
+--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
 b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+@@ -665,5 +665,12 @@
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
++
++  wdt0: watchdog@1c20ca0 {
++  compatible = "allwinner,sun50i-a64-wdt",
++   "allwinner,sun6i-a31-wdt";
++  reg = <0x01c20ca0 0x20>;
++  interrupts = ;
++  };
+   };
+ };
+-- 
+2.17.1
+
-- 
2.17.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/9] sunxi: add spi flash support to kernel

2019-01-14 Thread Oskari Lemmela
Some of sunxi devices have onboard SPI flash.
Enable SPI NOR support and MTD fit split in kernel config.

Signed-off-by: Oskari Lemmela 
---
 target/linux/sunxi/config-4.14 | 9 -
 target/linux/sunxi/config-4.19 | 9 -
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/target/linux/sunxi/config-4.14 b/target/linux/sunxi/config-4.14
index c13b1452ee..d7d9f60a6d 100644
--- a/target/linux/sunxi/config-4.14
+++ b/target/linux/sunxi/config-4.14
@@ -363,7 +363,14 @@ CONFIG_MMC_SUNXI=y
 CONFIG_MMU_NOTIFIER=y
 CONFIG_MODULES_TREE_LOOKUP=y
 CONFIG_MODULES_USE_ELF_REL=y
-# CONFIG_MTD is not set
+CONFIG_MTD=y
+CONFIG_MTD_SPLIT_SUPPORT=y
+CONFIG_MTD_SPLIT_FIT_FW=y
+CONFIG_MTD_OF_PARTS=y
+CONFIG_MTD_JEDECPROBE=y
+# CONFIG_MTD_IMPA7 is not set
+CONFIG_MTD_M25P80=y
+CONFIG_MTD_SPI_NOR=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NEED_DMA_MAP_STATE=y
diff --git a/target/linux/sunxi/config-4.19 b/target/linux/sunxi/config-4.19
index 042b2e8986..7ae1c9f71e 100644
--- a/target/linux/sunxi/config-4.19
+++ b/target/linux/sunxi/config-4.19
@@ -371,7 +371,14 @@ CONFIG_MMC_SUNXI=y
 CONFIG_MMU_NOTIFIER=y
 CONFIG_MODULES_TREE_LOOKUP=y
 CONFIG_MODULES_USE_ELF_REL=y
-# CONFIG_MTD is not set
+CONFIG_MTD=y
+CONFIG_MTD_SPLIT_SUPPORT=y
+CONFIG_MTD_SPLIT_FIT_FW=y
+CONFIG_MTD_OF_PARTS=y
+CONFIG_MTD_JEDECPROBE=y
+# CONFIG_MTD_IMPA7 is not set
+CONFIG_MTD_M25P80=y
+CONFIG_MTD_SPI_NOR=y
 CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEON=y
-- 
2.17.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC 0/6] x86: switch to generic image generation code and

2019-01-14 Thread Tomasz Maciej Nowak
Title of this series got halved, should be:
x86: switch to generic image generation code and add update bootloader on 
sysupgrade

Also forgot to mention, for anyone who wants to test it needs to be applied 
after https://patchwork.ozlabs.org/patch/1024153

-- 
TMN


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] e2fsprogs: Update to 1.43.5

2019-01-14 Thread Jo-Philipp Wich
Hi,

its not about symlinks, its about the paths embedded in these generated
scripts.

~ Jo



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel