[OpenWrt-Devel] [PATCH 3/3] scripts/qemustart: Allow specifying custom rootfs for malta

2019-03-28 Thread Petr Štetiar
Currently it's not possible to test boot squashfs root images, so this
patch now allows this use case as well.

Cc: Yousong Zhou 
Signed-off-by: Petr Štetiar 
---
 scripts/qemustart | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/scripts/qemustart b/scripts/qemustart
index 2012d43..951f225 100755
--- a/scripts/qemustart
+++ b/scripts/qemustart
@@ -205,6 +205,7 @@ start_qemu_malta() {
local is64
local isel
local qemu_exe
+   local rootfs="$o_rootfs"
local kernel="$o_kernel"
local mach="${o_mach:-malta}"
 
@@ -215,6 +216,16 @@ start_qemu_malta() {
 
[ -n "$kernel" ] || 
kernel="$o_bindir/openwrt-malta-${o_subtarget%-*}-vmlinux-initramfs.elf"
 
+   [ -z "$rootfs" ] || {
+   if [ ! -f "$rootfs" -a -s "$rootfs.gz" ]; then
+   gunzip "$rootfs.gz"
+   fi
+   o_qemu_extra+=( \
+   "-drive" "file=$rootfs,format=raw" \
+   "-append" "root=/dev/sda rootwait" \
+   )
+   }
+
# NOTE: order of wan, lan -device arguments matters as it will affect 
which
# one will be actually used as the wan, lan network interface inside the
# guest machine
-- 
1.9.1


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


[OpenWrt-Devel] [PATCH 1/3] scripts/qemustart: Allow usage without networking

2019-03-28 Thread Petr Štetiar
For basic tests it's not necessary to have the networking setup and this
allows testing as a normal user as well, without root privileges.

So this patch adds `--no-network` long option or `-n` short option,
which allows starting QEMU without network.

Cc: Yousong Zhou 
Signed-off-by: Petr Štetiar 
---
 scripts/qemustart | 41 +++--
 1 file changed, 31 insertions(+), 10 deletions(-)

diff --git a/scripts/qemustart b/scripts/qemustart
index b68e8bb..3b47986 100755
--- a/scripts/qemustart
+++ b/scripts/qemustart
@@ -74,6 +74,7 @@ check_setup_() {
 }
 
 check_setup() {
+   [ -z $o_nonetwork ] || return 0
check_setup_ || {
__errmsg "please check the script content to see the 
environment requirement"
return 1
@@ -122,6 +123,7 @@ parse_args() {
o_qemu_extra=()
while [ "$#" -gt 0 ]; do
case "$1" in
+   --no-network|-n) o_nonetwork=1; shift ;;
--kernel) o_kernel="$2"; shift 2 ;;
--rootfs) o_rootfs="$2"; shift 2 ;;
--machine|-machine|-M) o_mach="$2"; shift 2 ;;
@@ -185,9 +187,16 @@ start_qemu_armvirt() {
)
}
 
+   [ -n $o_nonetwork ] || {
+   o_qemu_extra+=( \
+   "-netdev" "bridge,id=lan,br=$BR_LAN,helper=$HELPER" \
+   "-device" 
"virtio-net-pci,id=devlan,netdev=lan,mac=$MAC_LAN" \
+   "-netdev" "bridge,id=wan,br=$BR_WAN,helper=$HELPER" 
"-device" \
+   "virtio-net-pci,id=devwan,netdev=wan,mac=$MAC_WAN" \
+   )
+   }
+
"$qemu_exe" -machine "$mach" -cpu "$cpu" -nographic \
-   -netdev bridge,id=lan,br="$BR_LAN,helper=$HELPER" -device 
virtio-net-pci,id=devlan,netdev=lan,mac="$MAC_LAN" \
-   -netdev bridge,id=wan,br="$BR_WAN,helper=$HELPER" -device 
virtio-net-pci,id=devwan,netdev=wan,mac="$MAC_WAN" \
-kernel "$kernel" \
"${o_qemu_extra[@]}"
 }
@@ -209,9 +218,16 @@ start_qemu_malta() {
# NOTE: order of wan, lan -device arguments matters as it will affect 
which
# one will be actually used as the wan, lan network interface inside the
# guest machine
+   [ -n $o_nonetwork ] || {
+   o_qemu_extra+=( \
+   "-netdev" "bridge,id=wan,br=$BR_WAN,helper=$HELPER" 
"-device" \
+   "virtio-net-pci,id=devwan,netdev=wan,mac=$MAC_WAN" \
+   "-netdev" "bridge,id=lan,br=$BR_LAN,helper=$HELPER" \
+   "-device" 
"virtio-net-pci,id=devlan,netdev=lan,mac=$MAC_LAN" \
+   )
+   }
+
"$qemu_exe" -machine "$mach" -nographic \
-   -netdev bridge,id=wan,br="$BR_WAN,helper=$HELPER" -device 
pcnet,netdev=wan,mac="$MAC_WAN" \
-   -netdev bridge,id=lan,br="$BR_LAN,helper=$HELPER" -device 
pcnet,netdev=lan,mac="$MAC_LAN" \
-kernel "$kernel" \
"${o_qemu_extra[@]}"
 }
@@ -241,6 +257,15 @@ start_qemu_x86() {
;;
esac
 
+   [ -n $o_nonetwork ] || {
+   o_qemu_extra+=( \
+   "-netdev" "bridge,id=lan,br=$BR_LAN,helper=$HELPER" \
+   "-device" 
"virtio-net-pci,id=devlan,netdev=lan,mac=$MAC_LAN" \
+   "-netdev" "bridge,id=wan,br=$BR_WAN,helper=$HELPER" 
"-device" \
+   "virtio-net-pci,id=devwan,netdev=wan,mac=$MAC_WAN" \
+   )
+   }
+
case "${o_subtarget%-*}" in
legacy)
# use IDE (PATA) disk instead of AHCI (SATA).  Refer to 
link
@@ -254,16 +279,12 @@ start_qemu_x86() {
#
# [1] https://dev.openwrt.org/ticket/17947
"$qemu_exe" -machine "$mach" -nographic \
-   -netdev 
bridge,id=lan,br="$BR_LAN,helper=$HELPER" -device 
e1000,id=devlan,netdev=lan,mac="$MAC_LAN" \
-   -netdev 
bridge,id=wan,br="$BR_WAN,helper=$HELPER" -device 
e1000,id=devwan,netdev=wan,mac="$MAC_WAN" \
-device ide-drive,drive=drv0 \
-drive 
"file=$rootfs,format=raw,id=drv0,if=none" \
"${o_qemu_extra[@]}"
;;
generic|64)
"$qemu_exe" -machine "$mach" -nographic \
-   -netdev 
bridge,id=lan,br="$BR_LAN,helper=$HELPER" -device 
virtio-net-pci,id=devlan,netdev=lan,mac="$MAC_LAN" \
-   -netdev 
bridge,id=wan,br="$BR_WAN,helper=$HELPER" -device 
virtio-net-pci,id=devwan,netdev=wan,mac="$MAC_WAN" \
-drive "file=$rootfs,format=raw,if=virtio" \
"${o_qemu_extra[@]}"
;;
@@ 

[OpenWrt-Devel] [PATCH 2/3] scripts/qemustart: Allow specifying custom kernel for x86

2019-03-28 Thread Petr Štetiar
Currently it's not possible to test boot squashfs root images, so this
patch now allows this use case as well.

Cc: Yousong Zhou 
Signed-off-by: Petr Štetiar 
---
 scripts/qemustart | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/scripts/qemustart b/scripts/qemustart
index 3b47986..2012d43 100755
--- a/scripts/qemustart
+++ b/scripts/qemustart
@@ -233,9 +233,10 @@ start_qemu_malta() {
 }
 
 start_qemu_x86() {
+   local qemu_exe
+   local kernel="$o_kernel"
local rootfs="$o_rootfs"
local mach="${o_mach:-pc}"
-   local qemu_exe
 
[ -n "$rootfs" ] || {

rootfs="$o_bindir/openwrt-$o_target-${o_subtarget%-*}-combined-ext4.img"
@@ -257,6 +258,13 @@ start_qemu_x86() {
;;
esac
 
+   [ -n "$kernel" ] && {
+   o_qemu_extra+=( \
+   "-kernel" "$kernel" \
+   "-append" "root=/dev/vda console=ttyS0 rootwait" \
+   )
+   }
+
[ -n $o_nonetwork ] || {
o_qemu_extra+=( \
"-netdev" "bridge,id=lan,br=$BR_LAN,helper=$HELPER" \
-- 
1.9.1


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


[OpenWrt-Devel] [PATCH 0/3] scripts/qemustart: Add few useful features

2019-03-28 Thread Petr Štetiar
While fixing broken squashfs images on malta, armvirt and x86, I've found few
missing features in qemustart script. I think, that this features might be
useful for others as well, so I'm sending them for review.

Cc: Yousong Zhou 

Petr Štetiar (3):
  scripts/qemustart: Allow usage without networking
  scripts/qemustart: Allow specifying custom kernel for x86
  scripts/qemustart: Allow specifying custom rootfs for malta

 scripts/qemustart | 62 +--
 1 file changed, 51 insertions(+), 11 deletions(-)

-- 
1.9.1


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


Re: [OpenWrt-Devel] Merged: ramips: Increase GB-PC2 SPI frequency to 80MHz

2019-03-28 Thread Rosen Penev
On Thu, Mar 28, 2019 at 3:16 AM Petr Štetiar  wrote:
>
> Christian Lamparter  [2019-03-25 21:43:26]:
>
> Hi,
>
> > > Thanks! Merged into my staging tree at 
> > > https://git.openwrt.org/openwrt/staging/ynezz.git
> >
> > https://patchwork.ozlabs.org/patch/1034614/#2088615
>
> Ah, so this is actually v2, but not being marked as such. Thanks for the info.
>
> This patch simply got my attention as I was looking for some ramips candidates
> I could include together in one build test, this patch was lingering in the
> patchwork for more then a month without any comments, looked correct to me at
> the first sight, and harmless enough so I've just merged it. I'll try to be
> more careful next time.
Erm careful with what?
>
> @Rosen could you please next time include v2 in the subject and changelog in
> your patches? :-) Thanks
>
> Rosen Penev  [2019-03-25 14:11:32]:
>
> > On Mon, Mar 25, 2019 at 1:43 PM Christian Lamparter  
> > wrote:
> > >
> > > So, I think in order for this to "work as expected" the sysclock
> > > in the mt7621.dtsi should be at 220 MHz (as in the upstream
> > > drivers/staging/mt7621-dts/mt7621.dtsi) instead of 50 MHz.
> >
> > According to GCH, that commit is wrong:
> > https://github.com/openwrt/openwrt/pull/1578#issuecomment-443661067
> >
> > As far as the clock goes, it's using a PLL now:
> > https://github.com/openwrt/openwrt/blob/master/target/linux/ramips/dts/mt7621.dtsi#L223
>
> Ok, thanks for the details. In order to move forward, could you please provide
> relevant parts from dmesg (from clean latest snapshot, without your local
> modifications) so we can see the clock information from the running GP-PC2
> system?
>
> I'll then include this additional details to the commit message as well, so it
> could be easily git blamed.
I'll see when I can get some time.
>
> > > That said, I don't think this will break anything since the mt7621-spi 
> > > driver
> > > from 0043-spi-add-mt7621-support.patch, just limits it at the fake "25 
> > > Mhz"
> > > (which should be ~110 MHz). So, this will just look odd and makes no sense
> > > at the first glance.
> >
> > Ah, none of my testing was done with the stock driver, only the upstream 
> > one.
>
> Honestly I find this little bit delicate, that you're submiting patches which
> are not thoroughly tested against our master. To be clear, it's not happening
> in this particular case, but I don't want to help merge patches which I'm not
> able to test myself and which might in some rare cases brick other people's
> devices.
This device specifically is not that popular. Any potential fallout
would be very minimal. Highly unlikely that there would be as there
are already devices that use 80MHz and nobody has complained.
>
> So the commit message simply contains garbage, as nobody else could confirm
> (and more likely deny) this dd values in the time of commit.
>
> We need to fix the commit message as well, please provide the dd values from
> clean latest snapshot as well and please include kernel version for the
> upstream kernel values as well (or if it was backport of upstream driver from
> version XY to version AB).
>
> > There are also other devices with an 80MHz clock in the ramips dts 
> > directory.
>
> I find this arguments quite silly and I'm tired to read them over and over
> again. It might be in the tree already for many reasons.
>
> > 80MHz looked like it was a peak so that's what I used.
>
> I'm wondering if it would hurt the performance if you would provide maximum
> clock value as written in datasheet. I mean this testing is nice, but does it
> provide some meaningful number? I think, that in order to make it a proper
> number, you would still need to test it on a few more devices, ideally from
> different production runs, and even after this we might still face
> possibility, that we get another patch from the other user, claiming, that his
> flash can do 121MHz so why it's crippled to 80MHz :-)
I tried higher values than 80 but they resulted in no speedup. I think
this is some mt7621 limitation. I've tested this on two devices with
two different flash chips (PC1 and PC2 having Winbond and Spansion
respectively).
>
> -- ynezz

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


[OpenWrt-Devel] [PATCH] ramips: enable R6120 USB power

2019-03-28 Thread David Bauer
Enable the USB power for the Netgear R6120. Otherwise, no power is
supplied to an attached USB device.

Signed-off-by: David Bauer 
---
 target/linux/ramips/dts/R6120.dts  | 15 ++-
 target/linux/ramips/mt76x8/config-4.14 |  2 ++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/target/linux/ramips/dts/R6120.dts 
b/target/linux/ramips/dts/R6120.dts
index 07b1a165d3..d263c7824b 100644
--- a/target/linux/ramips/dts/R6120.dts
+++ b/target/linux/ramips/dts/R6120.dts
@@ -65,13 +65,26 @@
gpios = < 7 GPIO_ACTIVE_LOW>;
};
};
+
+   usb-regulator {
+   compatible = "regulator-fixed";
+
+   regulator-name = "USB-power";
+   gpio = < 13 GPIO_ACTIVE_HIGH>;
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   enable-active-high;
+
+   regulator-always-on;
+   };
 };
 
  {
state_default: pinctrl0 {
gpio {
ralink,group = "p0led_an", "p1led_an", "p2led_an",
-  "p3led_an", "p4led_an", "wdt", "wled_an";
+  "p3led_an", "p4led_an", "wdt",
+  "wled_an", "uart1";
ralink,function = "gpio";
};
};
diff --git a/target/linux/ramips/mt76x8/config-4.14 
b/target/linux/ramips/mt76x8/config-4.14
index 62e51cbe43..5bcb948585 100644
--- a/target/linux/ramips/mt76x8/config-4.14
+++ b/target/linux/ramips/mt76x8/config-4.14
@@ -192,6 +192,8 @@ CONFIG_RALINK=y
 # CONFIG_RCU_STALL_COMMON is not set
 CONFIG_REGMAP=y
 CONFIG_REGMAP_MMIO=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_RESET_CONTROLLER=y
 # CONFIG_SCHED_INFO is not set
 # CONFIG_SCSI_DMA is not set
-- 
2.21.0


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


Re: [OpenWrt-Devel] [PATCH] download.mk, image.mk: add --mode=a-s option to tar

2019-03-28 Thread Bjørn Mork
Eneas U de Queiroz via openwrt-devel 
writes:

> Otherwise tar will keep the sgid bit when running from a sgid-set
> directory, resulting in a different file being generated.

Doh! Thanks a lot for looking at this.

Yes, I often set sgid on build-dirs to make sharing with other local
users easier.  I guess that's not very common.


Bjørn

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


[OpenWrt-Devel] [PATCH v2 3/7] mvebu: shrink amount of packages and reorganize them

2019-03-28 Thread Tomasz Maciej Nowak
Since most of devices using SD card image to boot, use ext4 as boot
files system we can drop fat fs related packages. Also move packages
which are added repeatedly across subtargets to their default packages,
with droping the ones that are enabled in target kernel configugation.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../mvebu/base-files/lib/preinit/79_move_config| 14 ++
 target/linux/mvebu/cortexa53/target.mk |  1 +
 target/linux/mvebu/cortexa72/target.mk |  1 +
 target/linux/mvebu/image/cortex-a53.mk |  2 --
 target/linux/mvebu/image/cortex-a72.mk |  4 +---
 target/linux/mvebu/image/cortex-a9.mk  |  4 ++--
 6 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/target/linux/mvebu/base-files/lib/preinit/79_move_config 
b/target/linux/mvebu/base-files/lib/preinit/79_move_config
index 1735ad8849..73ddf09155 100644
--- a/target/linux/mvebu/base-files/lib/preinit/79_move_config
+++ b/target/linux/mvebu/base-files/lib/preinit/79_move_config
@@ -3,12 +3,18 @@
 
 BOOTPART=/dev/mmcblk0p1
 
+. /lib/functions.sh
+
 move_config() {
if [ -b $BOOTPART ]; then
-   insmod nls_cp437
-   insmod nls_iso8859-1
-   insmod fat
-   insmod vfat
+   case $(board_name) in
+   turris-omnia)
+   insmod nls_cp437
+   insmod nls_iso8859-1
+   insmod fat
+   insmod vfat
+   ;;
+   esac
mkdir -p /boot
mount -o rw,noatime $BOOTPART /boot
[ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz /
diff --git a/target/linux/mvebu/cortexa53/target.mk 
b/target/linux/mvebu/cortexa53/target.mk
index acc18d3454..d420fd9f59 100644
--- a/target/linux/mvebu/cortexa53/target.mk
+++ b/target/linux/mvebu/cortexa53/target.mk
@@ -11,5 +11,6 @@ ARCH:=aarch64
 BOARDNAME:=Marvell Armada 3700LP (ARM64)
 CPU_TYPE:=cortex-a53
 FEATURES+=ext4
+DEFAULT_PACKAGES+=e2fsprogs ethtool mkf2fs
 
 KERNELNAME:=Image dtbs
diff --git a/target/linux/mvebu/cortexa72/target.mk 
b/target/linux/mvebu/cortexa72/target.mk
index 670c402a56..a9384f3fa6 100644
--- a/target/linux/mvebu/cortexa72/target.mk
+++ b/target/linux/mvebu/cortexa72/target.mk
@@ -11,5 +11,6 @@ ARCH:=aarch64
 BOARDNAME:=Marvell Armada 7k/8k (ARM64)
 CPU_TYPE:=cortex-a72
 FEATURES+=ext4
+DEFAULT_PACKAGES+=e2fsprogs ethtool mkf2fs
 
 KERNELNAME:=Image dtbs
diff --git a/target/linux/mvebu/image/cortex-a53.mk 
b/target/linux/mvebu/image/cortex-a53.mk
index 89c3363448..dd6176100b 100644
--- a/target/linux/mvebu/image/cortex-a53.mk
+++ b/target/linux/mvebu/image/cortex-a53.mk
@@ -4,7 +4,6 @@ define Device/globalscale-espressobin
   KERNEL_NAME := Image
   KERNEL := kernel-bin
   DEVICE_TITLE := ESPRESSObin (Marvell Armada 3700 Community Board)
-  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-usb2 kmod-usb3 
kmod-usb-storage
   IMAGES := sdcard.img.gz
   IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-3720-espressobin
@@ -17,7 +16,6 @@ define Device/armada-3720-db
   KERNEL_NAME := Image
   KERNEL := kernel-bin
   DEVICE_TITLE := Marvell Armada 3720 Development Board DB-88F3720-DDR3
-  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-usb2 kmod-usb3 
kmod-usb-storage
   IMAGES := sdcard.img.gz
   IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-3720-db
diff --git a/target/linux/mvebu/image/cortex-a72.mk 
b/target/linux/mvebu/image/cortex-a72.mk
index df0ace120d..25bcf534bc 100644
--- a/target/linux/mvebu/image/cortex-a72.mk
+++ b/target/linux/mvebu/image/cortex-a72.mk
@@ -4,7 +4,7 @@ define Device/armada-macchiatobin
   KERNEL_NAME := Image
   KERNEL := kernel-bin
   DEVICE_TITLE := MACCHIATObin (SolidRun Armada 8040 Community Board)
-  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc 
kmod-i2c-core kmod-i2c-mux kmod-i2c-mux-pca954x
+  DEVICE_PACKAGES += kmod-i2c-core kmod-i2c-mux kmod-i2c-mux-pca954x
   IMAGES := sdcard.img.gz
   IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-8040-mcbin
@@ -17,7 +17,6 @@ define Device/armada-8040-db
   KERNEL_NAME := Image
   KERNEL := kernel-bin
   DEVICE_TITLE := Marvell Armada 8040 DB board
-  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc
   IMAGES := sdcard.img.gz
   IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-8040-db
@@ -30,7 +29,6 @@ define Device/armada-7040-db
   KERNEL_NAME := Image
   KERNEL := kernel-bin
   DEVICE_TITLE := Marvell Armada 7040 DB board
-  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc
   IMAGES := sdcard.img.gz
   IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | 

[OpenWrt-Devel] [PATCH v2 7/7] mvebu: espressobin: add u-boot environment

2019-03-28 Thread Tomasz Maciej Nowak
This commit adds U-Boot environment defaults which extend the
bootloader to automatically boot the ESPRESSObin board from other
connected mediums i.e. SATA disk or USB disk.
The assigned boot probe order is as follows:
1. USB (usb0), 2. SATA (scsi0), 3. µSD (mmc0), 4. eMMC (mmc1).
U-Boot will iterate through them utill it'll find on one of devices the
uEnv.txt file. If not found, it'll fall back to loading using boot.scr
(loading from boot.scr is compatible only with U-Boot version 2017.03 or
later). There is also self update mechanism implemented which will
trigger if the variable 'owrt_uenv_ver' is changed.
This commit also adds compatibility with newer U-Boot versions in which
kernel_addr and fdt_addr environment variables changed names to
kernel_addr_r and fdt_addr_r.

The bootloader environment preparation needs to be done for every new
deployment and for every board with U-Boot 2015.01 version.
1. Connect/insert boot device with OpenWrt,
2. Power on the board and enter U-Boot command line,
3. Execute following commands:
usb start
scsi scan
ext4load mmc 0:1 $loadaddr uEnv.txt || ext4load scsi 0:1 $loadaddr uEnv.txt 
|| ext4load usb 0:1 $loadaddr uEnv.txt
env import -t $loadaddr
env delete $old_or_temp_vars
saveenv
reset
4. Now board should automatically find boot medium with OpenWrt
   installation and boot it.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/mvebu/image/Makefile | 10 
 target/linux/mvebu/image/cortex-a53.mk|  2 +-
 .../image/globalscale-espressobin.bootscript  | 14 ---
 .../mvebu/image/globalscale-espressobin.uenv  | 25 +++
 4 files changed, 47 insertions(+), 4 deletions(-)
 create mode 100644 target/linux/mvebu/image/globalscale-espressobin.uenv

diff --git a/target/linux/mvebu/image/Makefile 
b/target/linux/mvebu/image/Makefile
index 88790777d9..126136dc6a 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -26,6 +26,15 @@ define Build/boot-scr
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d 
$@-new.bootscript $@-boot.scr
 endef
 
+define Build/uenv-txt
+   rm -f $@-uEnv.txt
+   sed \
+   -e 's#@ROOT@#$(SIGNATURE)#g' \
+   -e 's#@DTB@#$(DEVICE_DTS)#g' \
+   -e 's#@KERNEL@#$(KERNEL_NAME)#g' \
+   $(DEVICE_NAME).uenv > $@-uEnv.txt
+endef
+
 define Build/boot-img
rm -f $@.boot
mkfs.fat -C $@.boot $$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 ))
@@ -40,6 +49,7 @@ define Build/boot-img-ext4
$(foreach dts,$(DEVICE_DTS), $(CP) $(DTS_DIR)/$(dts).dtb $@.boot;)
$(CP) $(IMAGE_KERNEL) $@.boot/$(KERNEL_NAME)
-$(CP) $@-boot.scr $@.boot/boot.scr
+   -$(CP) $@-uEnv.txt $@.boot/uEnv.txt
make_ext4fs -J -l $(CONFIG_TARGET_KERNEL_PARTSIZE)M $@.bootimg $@.boot
 endef
 
diff --git a/target/linux/mvebu/image/cortex-a53.mk 
b/target/linux/mvebu/image/cortex-a53.mk
index dd6176100b..338c29c7f9 100644
--- a/target/linux/mvebu/image/cortex-a53.mk
+++ b/target/linux/mvebu/image/cortex-a53.mk
@@ -5,7 +5,7 @@ define Device/globalscale-espressobin
   KERNEL := kernel-bin
   DEVICE_TITLE := ESPRESSObin (Marvell Armada 3700 Community Board)
   IMAGES := sdcard.img.gz
-  IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
+  IMAGE/sdcard.img.gz := uenv-txt | boot-scr | boot-img-ext4 | sdcard-img-ext4 
| gzip | append-metadata
   DEVICE_DTS := armada-3720-espressobin
   DTS_DIR := $(DTS_DIR)/marvell
   SUPPORTED_DEVICES := globalscale,espressobin
diff --git a/target/linux/mvebu/image/globalscale-espressobin.bootscript 
b/target/linux/mvebu/image/globalscale-espressobin.bootscript
index 0d03ac8513..d2a9653613 100644
--- a/target/linux/mvebu/image/globalscale-espressobin.bootscript
+++ b/target/linux/mvebu/image/globalscale-espressobin.bootscript
@@ -1,10 +1,18 @@
+if test -z "${owrt_uenv_ver}"; then
+   load mmc 0:1 ${loadaddr} uEnv.txt
+   env import -t ${loadaddr}
+   env delete ${old_or_temp_vars}
+   saveenv
+   boot
+fi
+
 setenv bootargs "root=PARTUUID=@ROOT@-02 rw rootwait"
 
 if test -n "${console}"; then
setenv bootargs "${bootargs} ${console}"
 fi
 
-load mmc 0:1 ${fdt_addr} armada-3720-espressobin.dtb
-load mmc 0:1 ${kernel_addr} Image
+load mmc 0:1 ${fdt_addr}${fdt_addr_r} armada-3720-espressobin.dtb
+load mmc 0:1 ${kernel_addr}${kernel_addr_r} Image
 
-booti ${kernel_addr} - ${fdt_addr}
+booti ${kernel_addr}${kernel_addr_r} - ${fdt_addr}${fdt_addr_r}
diff --git a/target/linux/mvebu/image/globalscale-espressobin.uenv 
b/target/linux/mvebu/image/globalscale-espressobin.uenv
new file mode 100644
index 00..986db9884b
--- /dev/null
+++ b/target/linux/mvebu/image/globalscale-espressobin.uenv
@@ -0,0 +1,25 @@
+owrt_uenv_ver=1
+old_or_temp_vars=devnum devtype fileaddr filesize root uenv_ver 
old_or_temp_vars
+boot_a_script=ext4load ${devtype} ${devnum}:${distro_bootpart} ${loadaddr} 

[OpenWrt-Devel] [PATCH v2 6/7] mvebu: espressobin: add node for eMMC in dts

2019-03-28 Thread Tomasz Maciej Nowak
Some ESPRESSObin boards come with soldered eMMC flash, backport upstream
patches adding this device and add patch to sync sdhci nodes order with
U-Boot.

Signed-off-by: Tomasz Maciej Nowak 
---
 ...l-armada37xx-Add-emmc-sdio-pinctrl-d.patch |  40 +++
 ...l-armada-37xx-Enable-emmc-on-espress.patch |  49 
 ...da-3720-espressobin-correct-spi-node.patch |   2 +-
 ...x-re-arrange-SDHCI-controllers-order.patch | 105 ++
 4 files changed, 195 insertions(+), 1 deletion(-)
 create mode 100644 
target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch
 create mode 100644 
target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch
 create mode 100644 
target/linux/mvebu/patches-4.14/522-arm64-dts-a37xx-re-arrange-SDHCI-controllers-order.patch

diff --git 
a/target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch
 
b/target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch
new file mode 100644
index 00..19702a61ed
--- /dev/null
+++ 
b/target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch
@@ -0,0 +1,40 @@
+From eefe328439642101774f0f5c4ea0dc6ba1cfb687 Mon Sep 17 00:00:00 2001
+From: Ding Tao 
+Date: Fri, 26 Oct 2018 11:50:27 +
+Subject: [PATCH] arm64: dts: marvell: armada37xx: Add emmc/sdio pinctrl
+ definition
+
+Add emmc/sdio pinctrl definition for marvell armada37xx SoCs.
+
+Signed-off-by: Ding Tao 
+Signed-off-by: Gregory CLEMENT 
+---
+ arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 10 ++
+ 1 file changed, 10 insertions(+)
+
+--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
 b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
+@@ -218,6 +218,11 @@
+   groups = "uart2";
+   function = "uart";
+   };
++
++  mmc_pins: mmc-pins {
++  groups = "emmc_nb";
++  function = "emmc";
++  };
+   };
+ 
+   nb_pm: syscon@14000 {
+@@ -247,6 +252,11 @@
+   function = "mii";
+   };
+ 
++  sdio_pins: sdio-pins {
++  groups = "sdio_sb";
++  function = "sdio";
++  };
++
+   };
+ 
+   eth0: ethernet@3 {
diff --git 
a/target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch
 
b/target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch
new file mode 100644
index 00..26d090f050
--- /dev/null
+++ 
b/target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch
@@ -0,0 +1,49 @@
+From 43ebc7c1b3ed8198b9acf3019eca16e722f7331c Mon Sep 17 00:00:00 2001
+From: Ding Tao 
+Date: Fri, 26 Oct 2018 11:50:28 +
+Subject: [PATCH] arm64: dts: marvell: armada-37xx: Enable emmc on espressobin
+
+The ESPRESSObin board has a emmc interface available on U11: declare it
+and let the bootloader enable it if the emmc is present.
+
+[gregory.clem...@bootlin.com: disable the emmc by default]
+Signed-off-by: Ding Tao 
+Signed-off-by: Gregory CLEMENT 
+---
+ .../dts/marvell/armada-3720-espressobin.dts   | 22 +++
+ 1 file changed, 22 insertions(+)
+
+--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
 b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
+@@ -93,9 +93,31 @@
+   cd-gpios = < 3 GPIO_ACTIVE_LOW>;
+   marvell,pad-type = "sd";
+   vqmmc-supply = <_sd_reg1>;
++
++  pinctrl-names = "default";
++  pinctrl-0 = <_pins>;
+   status = "okay";
+ };
+ 
++/* U11 */
++ {
++  non-removable;
++  bus-width = <8>;
++  mmc-ddr-1_8v;
++  mmc-hs400-1_8v;
++  marvell,xenon-emmc;
++  marvell,xenon-tun-count = <9>;
++  marvell,pad-type = "fixed-1-8v";
++
++  pinctrl-names = "default";
++  pinctrl-0 = <_pins>;
++/*
++ * This eMMC is not populated on all boards, so disable it by
++ * default and let the bootloader enable it, if it is present
++ */
++  status = "disabled";
++};
++
+  {
+   status = "okay";
+ 
diff --git 
a/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch
 
b/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch
index 1d2bdfca75..fc7cb2af1e 100644
--- 
a/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch
+++ 
b/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch
@@ -29,7 +29,7 @@ Signed-off-by: Tomasz Maciej Nowak 
 
 --- 

[OpenWrt-Devel] [PATCH v2 5/7] mvebu: sysupgrade: sdcard: keep user added partitons

2019-03-28 Thread Tomasz Maciej Nowak
Currently sysupgrade overwrites whole disk and destroys partitions added
by user. Sync the sysupgrade code with the one present in x86 target to
remedy this behaviour.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../mvebu/base-files/lib/upgrade/platform.sh  |  9 ++-
 .../mvebu/base-files/lib/upgrade/sdcard.sh| 74 +--
 target/linux/mvebu/cortexa53/target.mk|  2 +-
 target/linux/mvebu/cortexa72/target.mk|  2 +-
 target/linux/mvebu/image/cortex-a9.mk |  7 +-
 5 files changed, 83 insertions(+), 11 deletions(-)

diff --git a/target/linux/mvebu/base-files/lib/upgrade/platform.sh 
b/target/linux/mvebu/base-files/lib/upgrade/platform.sh
index e4ccf9d7f2..57b2f00a4c 100755
--- a/target/linux/mvebu/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mvebu/base-files/lib/upgrade/platform.sh
@@ -8,7 +8,14 @@ RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
 REQUIRE_IMAGE_METADATA=1
 
 platform_check_image() {
-   return 0
+   case "$(board_name)" in
+   
armada-385-turris-omnia|armada-388-clearfog-base|armada-388-clearfog-pro|globalscale,espressobin|marvell,armada8040-mcbin)
+   platform_check_image_sdcard "$ARGV"
+   ;;
+   *)
+   return 0
+   ;;
+   esac
 }
 
 platform_do_upgrade() {
diff --git a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh 
b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
index 7aa91f463c..28fad31757 100644
--- a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
+++ b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
@@ -6,7 +6,7 @@ get_magic_at() {
 
 platform_check_image_sdcard() {
local file="$1"
-   local magic
+   local magic diskdev partdev diff
 
magic=$(get_magic_at "$file" 510)
[ "$magic" != "55aa" ] && {
@@ -14,18 +14,82 @@ platform_check_image_sdcard() {
return 1
}
 
-   return 0;
+   export_bootdevice && export_partdevice diskdev 0 || {
+   echo "Unable to determine upgrade device"
+   return 1
+   }
+
+   get_partitions "/dev/$diskdev" bootdisk
+
+   #extract the boot sector from the image
+   get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b 2>/dev/null
+
+   get_partitions /tmp/image.bs image
+
+   #compare tables
+   diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)"
+
+   rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image
+
+   if [ -n "$diff" ]; then
+   echo "Partition layout has changed. Full image will be written."
+   ask_bool 0 "Abort" && exit 1
+   return 0
+   fi
 }
 
 platform_do_upgrade_sdcard() {
local board=$(board_name)
-   local diskdev
+   local diskdev partdev diff
+
+   export_bootdevice && export_partdevice diskdev 0 || {
+   echo "Unable to determine upgrade device"
+   return 1
+   }
 
sync
-   if export_bootdevice && export_partdevice diskdev 0; then
-   get_image "$1" | dd of=/dev/$diskdev bs=2M conv=fsync
+
+   if [ "$SAVE_PARTITIONS" = "1" ]; then
+   get_partitions "/dev/$diskdev" bootdisk
+
+   #extract the boot sector from the image
+   get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b
+
+   get_partitions /tmp/image.bs image
+
+   #compare tables
+   diff="$(grep -F -x -v -f /tmp/partmap.bootdisk 
/tmp/partmap.image)"
+   else
+   diff=1
+   fi
+
+   if [ -n "$diff" ]; then
+   get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync
+
+   # Separate removal and addtion is necessary; otherwise, 
partition 1
+   # will be missing if it overlaps with the old partition 2
+   partx -d - "/dev/$diskdev"
+   partx -a - "/dev/$diskdev"
+
+   return 0
fi
 
+   #write uboot image
+   get_image "$@" | dd of="$diskdev" bs=512 skip=1 seek=1 count=2048 
conv=fsync
+   #iterate over each partition from the image and write it to the boot 
disk
+   while read part start size; do
+   if export_partdevice partdev $part; then
+   echo "Writing image to /dev/$partdev..."
+   get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M 
skip="$start" count="$size" conv=fsync
+   else
+   echo "Unable to find partition $part device, skipped."
+   fi
+   done < /tmp/partmap.image
+
+   #copy partition uuid
+   echo "Writing new UUID to /dev/$diskdev..."
+   get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 
conv=fsync
+
case "$board" in
armada-385-turris-omnia)
fw_setenv openwrt_bootargs 'earlyprintk console=ttyS0,115200 
root=/dev/mmcblk0p2 rootfstype=auto rootwait'
diff --git a/target/linux/mvebu/cortexa53/target.mk 

[OpenWrt-Devel] [PATCH v2 4/7] mvebu: base-files: autodetect upgrade device

2019-03-28 Thread Tomasz Maciej Nowak
Since some boards could be also booted from other mediums than SD card,
lets make the upgrade block device autodetected.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../base-files/lib/preinit/79_move_config |  9 +
 .../mvebu/base-files/lib/upgrade/sdcard.sh| 19 +--
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/target/linux/mvebu/base-files/lib/preinit/79_move_config 
b/target/linux/mvebu/base-files/lib/preinit/79_move_config
index 73ddf09155..64c0cc0eea 100644
--- a/target/linux/mvebu/base-files/lib/preinit/79_move_config
+++ b/target/linux/mvebu/base-files/lib/preinit/79_move_config
@@ -1,12 +1,13 @@
 #!/bin/sh
 # Copyright (C) 2015 OpenWrt.org
 
-BOOTPART=/dev/mmcblk0p1
-
 . /lib/functions.sh
+. /lib/upgrade/common.sh
 
 move_config() {
-   if [ -b $BOOTPART ]; then
+   local partdev
+
+   if export_bootdevice && export_partdevice partdev 1; then
case $(board_name) in
turris-omnia)
insmod nls_cp437
@@ -16,7 +17,7 @@ move_config() {
;;
esac
mkdir -p /boot
-   mount -o rw,noatime $BOOTPART /boot
+   mount -o rw,noatime "/dev/$partdev" /boot
[ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz /
umount /boot
fi
diff --git a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh 
b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
index a05df834ba..7aa91f463c 100644
--- a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
+++ b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
@@ -19,9 +19,12 @@ platform_check_image_sdcard() {
 
 platform_do_upgrade_sdcard() {
local board=$(board_name)
+   local diskdev
 
sync
-   get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync
+   if export_bootdevice && export_partdevice diskdev 0; then
+   get_image "$1" | dd of=/dev/$diskdev bs=2M conv=fsync
+   fi
 
case "$board" in
armada-385-turris-omnia)
@@ -36,9 +39,13 @@ platform_do_upgrade_sdcard() {
 }
 
 platform_copy_config_sdcard() {
-   mkdir -p /boot
-   [ -f /boot/kernel.img ] || mount -o rw,noatime /dev/mmcblk0p1 /boot
-   cp -af "$CONF_TAR" /boot/
-   sync
-   umount /boot
+   local partdev
+
+   if export_partdevice partdev 1; then
+   mkdir -p /boot
+   [ -f /boot/kernel.img ] || mount -o rw,noatime /dev/$partdev 
/boot
+   cp -af "$CONF_TAR" /boot/
+   sync
+   umount /boot
+   fi
 }
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH v2 1/7] mvebu: make bootfs size for sdcard image configurable

2019-03-28 Thread Tomasz Maciej Nowak
Let's take this oportunity to implement boot-part and rootfs-part feature
flags.

Signed-off-by: Tomasz Maciej Nowak 
---
 config/Config-images.in   |  2 +-
 target/linux/mvebu/Makefile   |  2 +-
 target/linux/mvebu/image/Makefile | 16 ++--
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/config/Config-images.in b/config/Config-images.in
index 6610601d55..9daaf74915 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -272,7 +272,7 @@ menu "Target Images"
 
config TARGET_ROOTFS_PARTSIZE
int "Root filesystem partition size (in MB)"
-   depends on GRUB_IMAGES || USES_ROOTFS_PART || 
TARGET_ROOTFS_EXT4FS || TARGET_mvebu || TARGET_omap || TARGET_rb532 || 
TARGET_sunxi || TARGET_uml
+   depends on GRUB_IMAGES || USES_ROOTFS_PART || 
TARGET_ROOTFS_EXT4FS || TARGET_omap || TARGET_rb532 || TARGET_sunxi || 
TARGET_uml
default 256
help
  Select the root filesystem partition size.
diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile
index ee76c0b776..a920f6db7d 100644
--- a/target/linux/mvebu/Makefile
+++ b/target/linux/mvebu/Makefile
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 BOARD:=mvebu
 BOARDNAME:=Marvell EBU Armada
-FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk
+FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk boot-part rootfs-part
 SUBTARGETS:=cortexa9 cortexa53 cortexa72
 MAINTAINER:=Imre Kaloz 
 
diff --git a/target/linux/mvebu/image/Makefile 
b/target/linux/mvebu/image/Makefile
index be01623e86..88790777d9 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -19,12 +19,6 @@ define Build/dtb
$(call Image/BuildDTB,$(DTS_DIR)/$(DEVICE_DTS).dts,$@.dtb)
 endef
 
-# SD-Card Images:
-# these values are optimized for a 4GB labeled sdcard that actually holds 
7744512 sectors of 512 byte
-# MBR:2048 sectors
-# Partition 1:   32768 sectors
-# Partition 2:   98304 sectors (configurable)
-
 define Build/boot-scr
rm -f $@-boot.scr
sed -e 's#@ROOT@#$(SIGNATURE)#g' \
@@ -34,7 +28,7 @@ endef
 
 define Build/boot-img
rm -f $@.boot
-   mkfs.fat -C $@.boot 16384
+   mkfs.fat -C $@.boot $$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 ))
$(foreach dts,$(DEVICE_DTS), mcopy -i $@.boot $(DTS_DIR)/$(dts).dtb 
::$(dts).dtb;)
mcopy -i $@.boot $(IMAGE_KERNEL) ::$(KERNEL_NAME)
-mcopy -i $@.boot $@-boot.scr ::boot.scr
@@ -46,26 +40,28 @@ define Build/boot-img-ext4
$(foreach dts,$(DEVICE_DTS), $(CP) $(DTS_DIR)/$(dts).dtb $@.boot;)
$(CP) $(IMAGE_KERNEL) $@.boot/$(KERNEL_NAME)
-$(CP) $@-boot.scr $@.boot/boot.scr
-   make_ext4fs -J -l 16384K $@.bootimg $@.boot
+   make_ext4fs -J -l $(CONFIG_TARGET_KERNEL_PARTSIZE)M $@.bootimg $@.boot
 endef
 
 define Build/sdcard-img
if [ -n "$(UBOOT)" ]; then UBOOT="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi; \
+   BOOTFS_SIZE=$$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 * 2 )); \
ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \
SIGNATURE="$(SIGNATURE)" \
./gen_mvebu_sdcard_img.sh $@ \
$$UBOOT \
-   c 32768 $@.boot \
+   c $$BOOTFS_SIZE $@.boot \
83 $$ROOTFS_SIZE $(IMAGE_ROOTFS)
 endef
 
 define Build/sdcard-img-ext4
if [ -n "$(UBOOT)" ]; then UBOOT="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi; \
+   BOOTFS_SIZE=$$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 * 2 )); \
ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \
SIGNATURE="$(SIGNATURE)" \
./gen_mvebu_sdcard_img.sh $@ \
$$UBOOT \
-   83 32768 $@.bootimg \
+   83 $$BOOTFS_SIZE $@.bootimg \
83 $$ROOTFS_SIZE $(IMAGE_ROOTFS)
 endef
 
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH v2 2/7] mvebu: use ext4 for clearfog image bootfs

2019-03-28 Thread Tomasz Maciej Nowak
This will allow to drop additional packages and shrink image size.

Cc: Jonas Gorski 
Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/mvebu/image/cortex-a9.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/mvebu/image/cortex-a9.mk 
b/target/linux/mvebu/image/cortex-a9.mk
index 79c3bc7bdb..610ce36cd7 100644
--- a/target/linux/mvebu/image/cortex-a9.mk
+++ b/target/linux/mvebu/image/cortex-a9.mk
@@ -128,7 +128,7 @@ define Device/armada-388-clearfog-pro
   DEVICE_TITLE := SolidRun ClearFog Pro
   DEVICE_PACKAGES := mkf2fs e2fsprogs swconfig kmod-fs-vfat kmod-nls-cp437 
kmod-nls-iso8859-1
   IMAGES := sdcard.img.gz
-  IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip | 
append-metadata
+  IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base
   SUPPORTED_DEVICES := armada-388-clearfog-pro armada-388-clearfog
   UBOOT := clearfog-u-boot-spl.kwb
@@ -141,7 +141,7 @@ define Device/armada-388-clearfog-base
   DEVICE_TITLE := SolidRun ClearFog Base
   DEVICE_PACKAGES := mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 
kmod-nls-iso8859-1
   IMAGES := sdcard.img.gz
-  IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip | 
append-metadata
+  IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base
   UBOOT := clearfog-u-boot-spl.kwb
 endef
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH v2 0/7] mvebu: SD card image and other improvements

2019-03-28 Thread Tomasz Maciej Nowak
This series includes more or less dependent/related commits, so I decided
to send them in one bulk.

In few points what this series is about:

1. Align features of SD card image with other targets using block boot
   devices, commits:
   "mvebu: make bootfs size for sdcard image configurable"
   "mvebu: base-files: autodetect upgrade device"
   "mvebu: sysupgrade: sdcard: keep user added partitons".

2. Move another device to usage of ext4 formated boot partition:
   "mvebu: use ext4 for clearfog image bootfs"

3. Packages clean-up of devices relying ond SD card image to boot:
   "mvebu: shrink amount of packages and reorganize them"

4. Activate possibility of booting ESPRESSObin from USB, SATA disks or
   eMMC flash, this still needs manual intervention, similar one as when
   the device got introduced, commits:
   "mvebu: espressobin: add node for eMMC in dts"
   "mvebu: espressobin: add u-boot environment"

If sending this as one series is not acceptable, please speak up,
I'll send them in separate series, one at a time.

Changes in v2:
- rebase

Tomasz Maciej Nowak (7):
  mvebu: make bootfs size for sdcard image configurable
  mvebu: use ext4 for clearfog image bootfs
  mvebu: shrink amount of packages and reorganize them
  mvebu: base-files: autodetect upgrade device
  mvebu: sysupgrade: sdcard: keep user added partitons
  mvebu: espressobin: add node for eMMC in dts
  mvebu: espressobin: add u-boot environment

 config/Config-images.in   |   2 +-
 target/linux/mvebu/Makefile   |   2 +-
 .../base-files/lib/preinit/79_move_config |  21 ++--
 .../mvebu/base-files/lib/upgrade/platform.sh  |   9 +-
 .../mvebu/base-files/lib/upgrade/sdcard.sh|  87 +--
 target/linux/mvebu/cortexa53/target.mk|   1 +
 target/linux/mvebu/cortexa72/target.mk|   1 +
 target/linux/mvebu/image/Makefile |  26 +++--
 target/linux/mvebu/image/cortex-a53.mk|   4 +-
 target/linux/mvebu/image/cortex-a72.mk|   4 +-
 target/linux/mvebu/image/cortex-a9.mk |  11 +-
 .../image/globalscale-espressobin.bootscript  |  14 ++-
 .../mvebu/image/globalscale-espressobin.uenv  |  25 +
 ...l-armada37xx-Add-emmc-sdio-pinctrl-d.patch |  40 +++
 ...l-armada-37xx-Enable-emmc-on-espress.patch |  49 
 ...da-3720-espressobin-correct-spi-node.patch |   2 +-
 ...x-re-arrange-SDHCI-controllers-order.patch | 105 ++
 17 files changed, 360 insertions(+), 43 deletions(-)
 create mode 100644 target/linux/mvebu/image/globalscale-espressobin.uenv
 create mode 100644 
target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch
 create mode 100644 
target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch
 create mode 100644 
target/linux/mvebu/patches-4.14/522-arm64-dts-a37xx-re-arrange-SDHCI-controllers-order.patch

-- 
2.21.0


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


[OpenWrt-Devel] [PATCH] download.mk, image.mk: add --mode=a-s option to tar

2019-03-28 Thread Eneas U de Queiroz 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 ---
Otherwise tar will keep the sgid bit when running from a sgid-set
directory, resulting in a different file being generated.

Signed-off-by: Eneas U de Queiroz 
---

Notes:
This fixes an issue exposed in
https://github.com/openwrt/packages/pull/8513

Tested it by reproducing the wrong tarball with master by setting ./tmp
sgid.  Then applied the patch and ran it again, ending up with the right
file.

diff --git a/include/download.mk b/include/download.mk
index 33141910fc..09794e155e 100644
--- a/include/download.mk
+++ b/include/download.mk
@@ -55,7 +55,8 @@ define dl_pack
$(if $(dl_pack/$(call ext,$(1))),$(dl_pack/$(call 
ext,$(1))),$(dl_pack/unknown))
 endef
 define dl_tar_pack
-   $(TAR) --numeric-owner --owner=0 --group=0 --sort=name 
{TAR_TIMESTAMP:+--mtime="TAR_TIMESTAMP"} -c $(2) | $(call dl_pack,$(1))
+   $(TAR) --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name \
+   {TAR_TIMESTAMP:+--mtime="TAR_TIMESTAMP"} -c $(2) | 
$(call dl_pack,$(1))
 endef
 
 ifdef CHECK
diff --git a/include/image.mk b/include/image.mk
index 9e40a54f51..b91a3a3d7a 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -291,7 +291,7 @@ endef
 
 ifdef CONFIG_TARGET_ROOTFS_TARGZ
   define Image/Build/targz
-   $(TAR) -cp --numeric-owner --owner=0 --group=0 --sort=name \
+   $(TAR) -cp --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name \
$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
-C $(TARGET_DIR)/ . | gzip -9n > $(BIN_DIR)/$(IMG_PREFIX)$(if 
$(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))-rootfs.tar.gz
   endef

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


[OpenWrt-Devel] [PATCH v3 7/7] tegra: add kernel 4.19 support

2019-03-28 Thread Tomasz Maciej Nowak
Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/generic/config-4.19  |   1 +
 target/linux/tegra/config-4.19| 558 ++
 ...interrupts-due-to-tegra2-silicon-bug.patch |  77 +++
 ...enable-front-panel-leds-in-TrimSlice.patch |  46 ++
 4 files changed, 682 insertions(+)
 create mode 100644 target/linux/tegra/config-4.19
 create mode 100644 
target/linux/tegra/patches-4.19/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch
 create mode 100644 
target/linux/tegra/patches-4.19/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch

diff --git a/target/linux/generic/config-4.19 b/target/linux/generic/config-4.19
index 288c2c5836..e187241567 100644
--- a/target/linux/generic/config-4.19
+++ b/target/linux/generic/config-4.19
@@ -2397,6 +2397,7 @@ CONFIG_KERNFS=y
 # CONFIG_KEYBOARD_SUNKBD is not set
 # CONFIG_KEYBOARD_TCA6416 is not set
 # CONFIG_KEYBOARD_TCA8418 is not set
+# CONFIG_KEYBOARD_TEGRA is not set
 # CONFIG_KEYBOARD_TM2_TOUCHKEY is not set
 # CONFIG_KEYBOARD_TWL4030 is not set
 # CONFIG_KEYBOARD_XTKBD is not set
diff --git a/target/linux/tegra/config-4.19 b/target/linux/tegra/config-4.19
new file mode 100644
index 00..b42958a943
--- /dev/null
+++ b/target/linux/tegra/config-4.19
@@ -0,0 +1,558 @@
+CONFIG_AC97_BUS=y
+# CONFIG_AHCI_TEGRA is not set
+CONFIG_ALIGNMENT_TRAP=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_ARCH_HAS_FORTIFY_SOURCE=y
+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_ARCH_HAS_KCOV=y
+CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y
+CONFIG_ARCH_HAS_PHYS_TO_DMA=y
+CONFIG_ARCH_HAS_RESET_CONTROLLER=y
+CONFIG_ARCH_HAS_SET_MEMORY=y
+CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
+CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
+CONFIG_ARCH_HAS_TICK_BROADCAST=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+CONFIG_ARCH_MULTIPLATFORM=y
+CONFIG_ARCH_MULTI_V6_V7=y
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED=y
+CONFIG_ARCH_NR_GPIO=1024
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_ARCH_SUPPORTS_FIRMWARE=y
+CONFIG_ARCH_SUPPORTS_TRUSTED_FOUNDATIONS=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_TEGRA=y
+# CONFIG_ARCH_TEGRA_114_SOC is not set
+# CONFIG_ARCH_TEGRA_124_SOC is not set
+CONFIG_ARCH_TEGRA_2x_SOC=y
+# CONFIG_ARCH_TEGRA_3x_SOC is not set
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ARM=y
+CONFIG_ARM_AMBA=y
+CONFIG_ARM_ARCH_TIMER=y
+CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARM_CRYPTO=y
+CONFIG_ARM_ERRATA_720789=y
+CONFIG_ARM_ERRATA_754327=y
+CONFIG_ARM_ERRATA_764369=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_HAS_SG_CHAIN=y
+CONFIG_ARM_HEAVY_MB=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+# CONFIG_ARM_LPAE is not set
+CONFIG_ARM_PATCH_IDIV=y
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+# CONFIG_ARM_PL172_MPMC is not set
+# CONFIG_ARM_SMMU is not set
+# CONFIG_ARM_SP805_WATCHDOG is not set
+CONFIG_ARM_TEGRA20_CPUFREQ=y
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_THUMBEE=y
+CONFIG_ARM_VIRT_EXT=y
+CONFIG_ASN1=y
+CONFIG_ATA=y
+CONFIG_ATAGS=y
+CONFIG_AUTO_ZRELADDR=y
+CONFIG_BLK_DEV_BSG=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_MQ_PCI=y
+CONFIG_BLK_SCSI_REQUEST=y
+CONFIG_BOUNCE=y
+CONFIG_CACHE_L2X0=y
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CLZ_TAB=y
+CONFIG_CMA=y
+CONFIG_CMA_ALIGNMENT=8
+CONFIG_CMA_AREAS=7
+# CONFIG_CMA_DEBUG is not set
+# CONFIG_CMA_DEBUGFS is not set
+CONFIG_CMA_SIZE_MBYTES=16
+# CONFIG_CMA_SIZE_SEL_MAX is not set
+CONFIG_CMA_SIZE_SEL_MBYTES=y
+# CONFIG_CMA_SIZE_SEL_MIN is not set
+# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
+CONFIG_COMMON_CLK=y
+# CONFIG_CPUFREQ_DT is not set
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_GOV_ATTR_SET=y
+CONFIG_CPU_FREQ_GOV_COMMON=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_STAT is not set
+CONFIG_CPU_HAS_ASID=y
+# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_PM=y
+CONFIG_CPU_RMAP=y
+CONFIG_CPU_SPECTRE=y
+CONFIG_CPU_THUMB_CAPABLE=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_V7=y
+CONFIG_CRC16=y
+# CONFIG_CRC32_SARWATE is not set
+CONFIG_CRC32_SLICEBY8=y

[OpenWrt-Devel] [PATCH v3 1/7] tegra: add new target

2019-03-28 Thread Tomasz Maciej Nowak
New target introduces initial support for NVIDIA Tegra SoC based devices.
It focuses on Tegra 2 CPUs, for successors supporting NEON instruction
set the target should be split in two subtargets.
This initial commit doesn't create any device image, it's groundwork
for further additions.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/kernel/linux/modules/netdevices.mk|   4 +-
 target/linux/generic/config-4.14  |   2 +
 target/linux/tegra/Makefile   |  29 +
 target/linux/tegra/base-files/etc/inittab |   4 +
 .../base-files/lib/preinit/79_move_config |  22 +
 .../tegra/base-files/lib/upgrade/platform.sh  | 103 
 target/linux/tegra/config-4.14| 556 ++
 target/linux/tegra/image/Makefile |  47 ++
 target/linux/tegra/image/generic-bootscript   |   6 +
 ...interrupts-due-to-tegra2-silicon-bug.patch |  77 +++
 10 files changed, 848 insertions(+), 2 deletions(-)
 create mode 100644 target/linux/tegra/Makefile
 create mode 100644 target/linux/tegra/base-files/etc/inittab
 create mode 100644 target/linux/tegra/base-files/lib/preinit/79_move_config
 create mode 100644 target/linux/tegra/base-files/lib/upgrade/platform.sh
 create mode 100644 target/linux/tegra/config-4.14
 create mode 100644 target/linux/tegra/image/Makefile
 create mode 100644 target/linux/tegra/image/generic-bootscript
 create mode 100644 
target/linux/tegra/patches-4.14/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch

diff --git a/package/kernel/linux/modules/netdevices.mk 
b/package/kernel/linux/modules/netdevices.mk
index fbc24b8405..2e29a5441f 100644
--- a/package/kernel/linux/modules/netdevices.mk
+++ b/package/kernel/linux/modules/netdevices.mk
@@ -113,7 +113,7 @@ $(eval $(call KernelPackage,mii))
 define KernelPackage/mdio-gpio
   SUBMENU:=$(NETWORK_DEVICES_MENU)
   TITLE:= Supports GPIO lib-based MDIO busses
-  DEPENDS:=+kmod-libphy @GPIO_SUPPORT 
+(TARGET_armvirt||TARGET_brcm2708_bcm2708||TARGET_samsung):kmod-of-mdio
+  DEPENDS:=+kmod-libphy @GPIO_SUPPORT 
+(TARGET_armvirt||TARGET_brcm2708_bcm2708||TARGET_samsung||TARGET_tegra):kmod-of-mdio
   KCONFIG:= \
CONFIG_MDIO_BITBANG \
CONFIG_MDIO_GPIO
@@ -261,7 +261,7 @@ $(eval $(call KernelPackage,switch-rtl8306))
 define KernelPackage/switch-rtl8366-smi
   SUBMENU:=$(NETWORK_DEVICES_MENU)
   TITLE:=Realtek RTL8366 SMI switch interface support
-  DEPENDS:=@GPIO_SUPPORT +kmod-swconfig 
+(TARGET_armvirt||TARGET_brcm2708_bcm2708||TARGET_samsung):kmod-of-mdio
+  DEPENDS:=@GPIO_SUPPORT +kmod-swconfig 
+(TARGET_armvirt||TARGET_brcm2708_bcm2708||TARGET_samsung||TARGET_tegra):kmod-of-mdio
   KCONFIG:=CONFIG_RTL8366_SMI
   FILES:=$(LINUX_DIR)/drivers/net/phy/rtl8366_smi.ko
   AUTOLOAD:=$(call AutoLoad,42,rtl8366_smi)
diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14
index cabdd9d01d..b8f46c0e8c 100644
--- a/target/linux/generic/config-4.14
+++ b/target/linux/generic/config-4.14
@@ -2280,6 +2280,7 @@ CONFIG_KERNFS=y
 # CONFIG_KEYBOARD_SUNKBD is not set
 # CONFIG_KEYBOARD_TCA6416 is not set
 # CONFIG_KEYBOARD_TCA8418 is not set
+# CONFIG_KEYBOARD_TEGRA is not set
 # CONFIG_KEYBOARD_TM2_TOUCHKEY is not set
 # CONFIG_KEYBOARD_TWL4030 is not set
 # CONFIG_KEYBOARD_XTKBD is not set
@@ -5498,6 +5499,7 @@ CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
 # CONFIG_USB_WUSB is not set
 # CONFIG_USB_WUSB_CBAF is not set
 # CONFIG_USB_XHCI_HCD is not set
+# CONFIG_USB_XHCI_TEGRA is not set
 # CONFIG_USB_XUSBATM is not set
 # CONFIG_USB_YUREX is not set
 # CONFIG_USB_ZD1201 is not set
diff --git a/target/linux/tegra/Makefile b/target/linux/tegra/Makefile
new file mode 100644
index 00..57cb902cfd
--- /dev/null
+++ b/target/linux/tegra/Makefile
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2017-2019 Tomasz Maciej Nowak 
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+ARCH := arm
+BOARD := tegra
+BOARDNAME := NVIDIA Tegra
+FEATURES := audio boot-part display ext4 fpu gpio pci pcie rootfs-part rtc 
squashfs usb
+CPU_TYPE := cortex-a9
+CPU_SUBTYPE := vfpv3
+MAINTAINER := Tomasz Maciej Nowak 
+
+KERNEL_PATCHVER := 4.14
+
+include $(INCLUDE_DIR)/target.mk
+
+KERNELNAME := zImage dtbs
+
+DEFAULT_PACKAGES += e2fsprogs mkf2fs partx-utils
+
+define Target/Description
+   Build firmware image for NVIDIA Tegra SoC devices.
+endef
+
+$(eval $(call BuildTarget))
diff --git a/target/linux/tegra/base-files/etc/inittab 
b/target/linux/tegra/base-files/etc/inittab
new file mode 100644
index 00..b944a93ada
--- /dev/null
+++ b/target/linux/tegra/base-files/etc/inittab
@@ -0,0 +1,4 @@
+::sysinit:/etc/init.d/rcS S boot
+::shutdown:/etc/init.d/rcS K shutdown
+::askconsole:/usr/libexec/login.sh
+tty1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/tegra/base-files/lib/preinit/79_move_config 
b/target/linux/tegra/base-files/lib/preinit/79_move_config
new 

[OpenWrt-Devel] [PATCH v3 4/7] uboot-tegra: add U-Boot for tegra boards

2019-03-28 Thread Tomasz Maciej Nowak
Add U-Boot for NVIDIA Tegra based boards, with the first being CompuLab
TrimSlice. This is part of initial support for this board.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/boot/uboot-tegra/Makefile | 59 +++
 .../tegra/base-files/lib/upgrade/platform.sh  |  2 +
 target/linux/tegra/image/Makefile |  4 +-
 3 files changed, 64 insertions(+), 1 deletion(-)
 create mode 100644 package/boot/uboot-tegra/Makefile

diff --git a/package/boot/uboot-tegra/Makefile 
b/package/boot/uboot-tegra/Makefile
new file mode 100644
index 00..60d1b02a60
--- /dev/null
+++ b/package/boot/uboot-tegra/Makefile
@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2017-2019 Tomasz Maciej Nowak 
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_VERSION := 2019.01
+PKG_RELEASE := 1
+
+PKG_HASH := 50bd7e5a466ab828914d080d5f6a432345b500e8fba1ad3b7b61e95e60d51c22
+
+PKG_MAINTAINER := Tomasz Maciej Nowak 
+
+include $(INCLUDE_DIR)/u-boot.mk
+include $(INCLUDE_DIR)/package.mk
+
+define U-Boot/Default
+  BUILD_TARGET := tegra
+  HIDDEN := y
+endef
+
+define U-Boot/trimslice
+  NAME := CompuLab TrimSlice
+  BUILD_DEVICES := trimslice
+  UBOOT_IMAGE := trimslice-mmc.img trimslice-spi.img
+  SOC := tegra20
+  VENDOR := compulab
+endef
+
+UBOOT_TARGETS := trimslice
+
+define Build/bct-image
+   $(CP) $(PKG_BUILD_DIR)/u-boot-dtb-tegra.bin $(PKG_BUILD_DIR)/u-boot.bin
+   $(foreach bct,$(basename $(UBOOT_IMAGE)), \
+   cd $(PKG_BUILD_DIR); \
+   cbootimage -s $(SOC) -gbct \
+   
$(STAGING_DIR_HOST)/share/cbootimage-configs/$(SOC)/$(VENDOR)/$(VARIANT)/$(bct).bct.cfg
 \
+   $(bct).bct; \
+   cbootimage -s $(SOC) \
+   
$(STAGING_DIR_HOST)/share/cbootimage-configs/$(SOC)/$(VENDOR)/$(VARIANT)/$(bct).img.cfg
 \
+   $(PKG_BUILD_DIR)/$(bct).img; \
+   rm -f $(bct).bct; \
+   )
+endef
+
+define Build/Compile
+   $(call Build/Compile/U-Boot)
+   $(call Build/bct-image)
+endef
+
+define Build/InstallDev
+   $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
+   $(foreach img,$(UBOOT_IMAGE), \
+   $(CP) $(PKG_BUILD_DIR)/$(img) $(STAGING_DIR_IMAGE)/;)
+endef
+
+$(eval $(call BuildPackage/U-Boot))
diff --git a/target/linux/tegra/base-files/lib/upgrade/platform.sh 
b/target/linux/tegra/base-files/lib/upgrade/platform.sh
index be453bdf9f..97dd381041 100644
--- a/target/linux/tegra/base-files/lib/upgrade/platform.sh
+++ b/target/linux/tegra/base-files/lib/upgrade/platform.sh
@@ -87,6 +87,8 @@ platform_do_upgrade() {
return 0
fi
 
+   #write uboot image
+   get_image "$@" | dd of="$diskdev" bs=512 skip=1 seek=1 count=4097 
conv=fsync,notrunc
#iterate over each partition from the image and write it to the boot 
disk
while read part start size; do
if export_partdevice partdev $part; then
diff --git a/target/linux/tegra/image/Makefile 
b/target/linux/tegra/image/Makefile
index 757e5b823f..5e3427ad27 100644
--- a/target/linux/tegra/image/Makefile
+++ b/target/linux/tegra/image/Makefile
@@ -32,9 +32,11 @@ define Build/tegra-sdcard
$(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
2048
+
+   $(if $(UBOOT),dd if=$(STAGING_DIR_IMAGE)/$(UBOOT).img of=$@ bs=512 
skip=1 seek=1 conv=notrunc)
 endef
 
-DEVICE_VARS += BOOT_SCRIPT
+DEVICE_VARS += BOOT_SCRIPT UBOOT
 define Device/Default
   BOOT_SCRIPT := generic-bootscript
   IMAGES := sdcard.img.gz
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH v3 5/7] kernel: package rtc-em3027 module

2019-03-28 Thread Tomasz Maciej Nowak
Support for Microelectronic EM3027 real time clock chip.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/kernel/linux/modules/other.mk | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/package/kernel/linux/modules/other.mk 
b/package/kernel/linux/modules/other.mk
index 220452df9b..e279616f20 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -528,6 +528,24 @@ endef
 $(eval $(call KernelPackage,rtc-ds1672))
 
 
+define KernelPackage/rtc-em3027
+  SUBMENU:=$(OTHER_MENU)
+  TITLE:=Microelectronic EM3027 RTC support
+  DEFAULT:=m if ALL_KMODS && RTC_SUPPORT
+  DEPENDS:=+kmod-i2c-core
+  KCONFIG:=CONFIG_RTC_DRV_EM3027 \
+   CONFIG_RTC_CLASS=y
+  FILES:=$(LINUX_DIR)/drivers/rtc/rtc-em3027.ko
+  AUTOLOAD:=$(call AutoProbe,rtc-em3027)
+endef
+
+define KernelPackage/rtc-em3027/description
+ Kernel module for Microelectronic EM3027 RTC.
+endef
+
+$(eval $(call KernelPackage,rtc-em3027))
+
+
 define KernelPackage/rtc-isl1208
   SUBMENU:=$(OTHER_MENU)
   TITLE:=Intersil ISL1208 RTC support
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH v3 0/7] tegra: add new target with support for CompuLab TrimSlice

2019-03-28 Thread Tomasz Maciej Nowak
This is continuation of effort in [1] PR to old LEDE source tree. It
received few improvement and some commits got split.

Main changes worth mentioning:
- update tools and U-Boot to recent versions,
- added support for 4.19 kernel
- now SD card image is also an rescue image with embedded U-Boot
- the SD card creation process is more generic which makes adding basic
  support for other boards/devices trivial

1. https://github.com/lede-project/source/pull/1252

Changes in v3
- clean-up kernel configs in result of review by Hauke Mehrtens

Changes in v2
- there are no drastic storage space constraints for this target, so
  instead of creating packages for target speciffic modules, build them
  in the kernel, requested by Felix Fietkau
- since video drivers are now built-in I enabled also USB keyboard
  related drivers, because most users with connected monitors would
  expect to interact with the device OOTB


Tomasz Maciej Nowak (7):
  tegra: add new target
  tools: add cbootimage for tegra
  tools: add cbootimage-configs for tegra
  uboot-tegra: add U-Boot for tegra boards
  kernel: package rtc-em3027 module
  tegra: add support for CompuLab TrimSlice
  tegra: add kernel 4.19 support

 package/boot/uboot-tegra/Makefile |  59 ++
 package/kernel/linux/modules/netdevices.mk|   4 +-
 package/kernel/linux/modules/other.mk |  18 +
 target/linux/generic/config-4.14  |   2 +
 target/linux/generic/config-4.19  |   1 +
 target/linux/tegra/Makefile   |  29 +
 target/linux/tegra/base-files/etc/inittab |   4 +
 .../base-files/lib/preinit/79_move_config |  22 +
 .../tegra/base-files/lib/upgrade/platform.sh  | 105 
 target/linux/tegra/config-4.14| 558 ++
 target/linux/tegra/config-4.19| 558 ++
 target/linux/tegra/image/Makefile |  59 ++
 target/linux/tegra/image/generic-bootscript   |   6 +
 ...interrupts-due-to-tegra2-silicon-bug.patch |  77 +++
 ...enable-front-panel-leds-in-TrimSlice.patch |  46 ++
 ...interrupts-due-to-tegra2-silicon-bug.patch |  77 +++
 ...enable-front-panel-leds-in-TrimSlice.patch |  46 ++
 tools/Makefile|   2 +
 tools/cbootimage-configs/Makefile |  32 +
 tools/cbootimage/Makefile |  31 +
 20 files changed, 1734 insertions(+), 2 deletions(-)
 create mode 100644 package/boot/uboot-tegra/Makefile
 create mode 100644 target/linux/tegra/Makefile
 create mode 100644 target/linux/tegra/base-files/etc/inittab
 create mode 100644 target/linux/tegra/base-files/lib/preinit/79_move_config
 create mode 100644 target/linux/tegra/base-files/lib/upgrade/platform.sh
 create mode 100644 target/linux/tegra/config-4.14
 create mode 100644 target/linux/tegra/config-4.19
 create mode 100644 target/linux/tegra/image/Makefile
 create mode 100644 target/linux/tegra/image/generic-bootscript
 create mode 100644 
target/linux/tegra/patches-4.14/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch
 create mode 100644 
target/linux/tegra/patches-4.14/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
 create mode 100644 
target/linux/tegra/patches-4.19/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch
 create mode 100644 
target/linux/tegra/patches-4.19/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
 create mode 100644 tools/cbootimage-configs/Makefile
 create mode 100644 tools/cbootimage/Makefile

-- 
2.21.0


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


[OpenWrt-Devel] [PATCH v3 2/7] tools: add cbootimage for tegra

2019-03-28 Thread Tomasz Maciej Nowak
Tegra BCT and bootable flash image generator/compiler

>From documentation:
This project provides a tool which compiles BCT (Boot Configuration
Table) images to place into the boot flash of a Tegra-based device.

The tool will either:

a) Compile a textual representation of a BCT into a binary image.

b) Generate an entire boot image from a previously compiled BCT and a
   bootloader binary.

Signed-off-by: Tomasz Maciej Nowak 
---
 tools/Makefile|  2 ++
 tools/cbootimage/Makefile | 31 +++
 2 files changed, 33 insertions(+)
 create mode 100644 tools/cbootimage/Makefile

diff --git a/tools/Makefile b/tools/Makefile
index f7ff2db361..182821e66d 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -38,6 +38,7 @@ tools-$(BUILD_B43_TOOLS) += b43-tools
 tools-$(BUILD_ISL) += isl
 tools-$(CONFIG_USE_SPARSE) += sparse
 tools-$(CONFIG_TARGET_apm821xx)$(CONFIG_TARGET_gemini) += genext2fs
+tools-$(CONFIG_TARGET_tegra) += cbootimage
 
 # builddir dependencies
 $(curdir)/bison/compile := $(curdir)/flex/compile
@@ -76,6 +77,7 @@ $(curdir)/zlib/compile := $(curdir)/cmake/compile
 $(curdir)/wrt350nv2-builder/compile := $(curdir)/zlib/compile
 $(curdir)/lzma-old/compile := $(curdir)/zlib/compile
 $(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile
+$(curdir)/cbootimage/compile += $(curdir)/autoconf/compile
 
 ifneq ($(HOST_OS),Linux)
   $(curdir)/squashfskit4/compile += $(curdir)/coreutils/compile
diff --git a/tools/cbootimage/Makefile b/tools/cbootimage/Makefile
new file mode 100644
index 00..42640eab36
--- /dev/null
+++ b/tools/cbootimage/Makefile
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2017-2019 Tomasz Maciej Nowak 
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME := cbootimage
+PKG_VERSION := 1.8
+
+PKG_SOURCE_PROTO := git
+PKG_SOURCE_URL := https://github.com/NVIDIA/cbootimage.git
+PKG_SOURCE_VERSION := 7c9db585d06cce9efffa2a82245f233233680060
+PKG_MIRROR_HASH := 
84d9abaaa3eddde05f506dc16effe1c9e18eb94727ed59c5e0a879baeb04e0b2
+
+HOST_BUILD_PARALLEL := 1
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Configure
+   (cd $(HOST_BUILD_DIR); autoreconf --install --symlink)
+   $(call Host/Configure/Default)
+endef
+
+define Host/Clean
+   rm -f $(STAGING_DIR_HOST)/bin/$(PKG_NAME) \
+   $(STAGING_DIR_HOST)/share/man/man1/$(PKG_NAME).1
+endef
+
+$(eval $(call HostBuild))
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH v3 3/7] tools: add cbootimage-configs for tegra

2019-03-28 Thread Tomasz Maciej Nowak
This provides board configuraion tables for various Tegra boards needed
by cbootimage tool to create flashable bootloader images.

Signed-off-by: Tomasz Maciej Nowak 
---
 tools/Makefile|  2 +-
 tools/cbootimage-configs/Makefile | 32 +++
 2 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 tools/cbootimage-configs/Makefile

diff --git a/tools/Makefile b/tools/Makefile
index 182821e66d..cee9c0bf8a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -38,7 +38,7 @@ tools-$(BUILD_B43_TOOLS) += b43-tools
 tools-$(BUILD_ISL) += isl
 tools-$(CONFIG_USE_SPARSE) += sparse
 tools-$(CONFIG_TARGET_apm821xx)$(CONFIG_TARGET_gemini) += genext2fs
-tools-$(CONFIG_TARGET_tegra) += cbootimage
+tools-$(CONFIG_TARGET_tegra) += cbootimage cbootimage-configs
 
 # builddir dependencies
 $(curdir)/bison/compile := $(curdir)/flex/compile
diff --git a/tools/cbootimage-configs/Makefile 
b/tools/cbootimage-configs/Makefile
new file mode 100644
index 00..5a1fc568cb
--- /dev/null
+++ b/tools/cbootimage-configs/Makefile
@@ -0,0 +1,32 @@
+#
+# Copyright (c) 2017-2019 Tomasz Maciej Nowak 
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME := cbootimage-configs
+
+PKG_SOURCE_DATE := 2017-04-13
+PKG_SOURCE_PROTO := git
+PKG_SOURCE_URL := https://github.com/NVIDIA/cbootimage-configs.git
+PKG_SOURCE_VERSION := 7c3b458b93ed6947cd083623f543e93f9103cc0f
+PKG_MIRROR_HASH := 
1d24421af8cf74ec2d625e237aa8121b1273774c4380ad333e2954e052a5a4fe
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Compile
+endef
+
+define Host/Install
+   $(INSTALL_DIR) $(STAGING_DIR_HOST)/share/$(PKG_NAME)
+   $(CP) $(HOST_BUILD_DIR)/* \
+   $(STAGING_DIR_HOST)/share/$(PKG_NAME)
+endef
+
+define Host/Clean
+   rm -fR $(STAGING_DIR_HOST)/share/$(PKG_NAME)
+endef
+
+$(eval $(call HostBuild))
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH v3 6/7] tegra: add support for CompuLab TrimSlice

2019-03-28 Thread Tomasz Maciej Nowak
It is a small form factor computer with rich amount of expansion ports.
Some hardware specs and supported features in this commit:

CPU: NVIDIA Tegra 2 @ 1GHz
RAM: 1GB DDR2-667
Storage: SDHC card slot
 µSDHC card slot
 USB to SATA bridge (depends on model)
 1MB SPI NOR flash for bootloader (single partition)
LAN: RTL8111DL GbE
WIFI: RT3070 b/g/n with external antenna (depends on model)
RTC: EM3027 (mapped as rtc0; with battery backup)
 Tegra 2 built-in (mapped as rtc1)
Sound: Analog/Digital (TLV320AIC23b; S/PDIF not tested)
Connectors: 4x USB 2.0
RS232 (mini serial)
HDMI
DVI-D (depends on model, not supported atm)
Extension connector (24 pin ZIF, 0.5mm pitch):
2X UART
SPI
JTAG (1.8V)
Other: power button with green led (not functional for early revisions
   without programmed PMIC)
   2x GPIO configurable green led

TrimSlice uses U-Boot placed in NOR flash. Boots Linux from any media
connected to USB, SATA or SD card inserted in slot. Can also boot from
TFTP. To run OpenWrt one needs to update U-Boot to fairly recent version
(the versions, pre-dts/dts provided by CompuLab won't suffice):

 1. Boot TrimSlice into Your current linux distro,
 2. Download trimslice-spi.img from u-boot-trimslice subdir,
 3. Install mtd-utils,
 4. Run following commands:
 flash_erase /dev/mtd0 0 256
 nandwrite /dev/mtd0 trimslice-spi.img
 5. Poweroff, insert SD card with OpenWrt, boot and enjoy.

If by some obstacle You can't follow those instructions, it is possible
to flash U-Boot using serial console.

 1. Insert FAT or EXT2/EXT3 formatted SD card with trimslice-spi.img,
 2. Interrupt boot process to enter U-Boot command line,
 3. Run following commands:
 ${fs}load mmc 0 0x0408 trimslice-spi.img
 sf probe 0
 sf erase 0 0x10
 sf write 0x0408 0x0 ${filesize}
 reset
 4. Poweroff, insert SD card with OpenWrt, boot and enjoy.

If something went wrong with one of above steps, there is simple
recovery option:

 1. Open the µSD slot security door to access the recovery-boot button,
 2. Insert SD card with OpenWrt to the front slot while unpowered,
 3. Power on the TrimSlice while pressing the recovery-boot button,
 4. With this it should boot straigth to OpenWrt, from there download
trimslice-spi.img and execute following commands:
 mtd erase /dev/mtd0
 mtd write trimslice-spi.img /dev/mtd0
 5. Reboot, now it should boot straigth to OpenWrt, without pressing the
recovery-boot button, with proper U-Boot flashed.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/tegra/config-4.14|  4 +-
 target/linux/tegra/image/Makefile | 10 
 ...enable-front-panel-leds-in-TrimSlice.patch | 46 +++
 3 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 
target/linux/tegra/patches-4.14/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch

diff --git a/target/linux/tegra/config-4.14 b/target/linux/tegra/config-4.14
index 3df360d1fc..42547da301 100644
--- a/target/linux/tegra/config-4.14
+++ b/target/linux/tegra/config-4.14
@@ -482,10 +482,12 @@ CONFIG_SND_SOC_TEGRA20_SPDIF=y
 # CONFIG_SND_SOC_TEGRA_RT5640 is not set
 # CONFIG_SND_SOC_TEGRA_RT5677 is not set
 # CONFIG_SND_SOC_TEGRA_SGTL5000 is not set
-# CONFIG_SND_SOC_TEGRA_TRIMSLICE is not set
+CONFIG_SND_SOC_TEGRA_TRIMSLICE=y
 # CONFIG_SND_SOC_TEGRA_WM8753 is not set
 # CONFIG_SND_SOC_TEGRA_WM8903 is not set
 # CONFIG_SND_SOC_TEGRA_WM9712 is not set
+CONFIG_SND_SOC_TLV320AIC23=y
+CONFIG_SND_SOC_TLV320AIC23_I2C=y
 # CONFIG_SND_USB is not set
 CONFIG_SOC_BUS=y
 CONFIG_SOC_TEGRA_FLOWCTRL=y
diff --git a/target/linux/tegra/image/Makefile 
b/target/linux/tegra/image/Makefile
index 5e3427ad27..706cc65d92 100644
--- a/target/linux/tegra/image/Makefile
+++ b/target/linux/tegra/image/Makefile
@@ -46,4 +46,14 @@ define Device/Default
   PROFILES := Default
 endef
 
+define Device/trimslice
+  DEVICE_TITLE := CompuLab TrimSlice
+  DEVICE_DTS := tegra20-trimslice
+  DEVICE_PACKAGES := kmod-r8169 kmod-rt2800-usb kmod-rtc-em3027 \
+   kmod-usb-storage wpad-mini
+  SUPPORTED_DEVICES := compulab,trimslice
+  UBOOT := trimslice-mmc
+endef
+TARGET_DEVICES += trimslice
+
 $(eval $(call BuildImage))
diff --git 
a/target/linux/tegra/patches-4.14/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
 
b/target/linux/tegra/patches-4.14/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
new file mode 100644
index 00..ae48e8d862
--- /dev/null
+++ 
b/target/linux/tegra/patches-4.14/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
@@ -0,0 +1,46 @@
+--- a/arch/arm/boot/dts/tegra20-trimslice.dts
 b/arch/arm/boot/dts/tegra20-trimslice.dts
+@@ -200,16 +200,17 @@
+   conf_ata {
+   nvidia,pins = "ata", "atc", "atd", "ate",
+   "crtp", "dap2", "dap3", "dap4", 

[OpenWrt-Devel] [PATCH] mac80211: update to version 4.19.32-1

2019-03-28 Thread Hauke Mehrtens
Signed-off-by: Hauke Mehrtens 
---
 package/kernel/mac80211/Makefile  |  8 +-
 ...-only-mask-use_eeprom-on-of-noeeprom.patch | 73 
 .../patches/build/001-fix_build.patch | 12 +--
 ...ratelimited-variants-of-err-and-warn.patch |  2 +-
 .../110-mac80211_keep_keys_on_stop_ap.patch   |  2 +-
 .../mac80211/patches/subsys/210-ap_scan.patch |  2 +-
 ...e-tailroom-for-forwarded-mesh-packet.patch | 37 
 ...trel-reduce-minstrel_mcs_groups-size.patch | 86 +++
 ...time-accounting-and-scheduling-to-TX.patch |  8 +-
 ...1-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch |  6 +-
 ...op-redundant-rcu_read_lock-unlock-ca.patch |  2 +-
 .../357-mac80211-optimize-skb-resizing.patch  | 24 +++---
 ...ow-4addr-AP-operation-on-crypto-cont.patch |  2 +-
 .../522-mac80211_configure_antenna_gain.patch |  4 +-
 14 files changed, 86 insertions(+), 182 deletions(-)
 delete mode 100644 
package/kernel/mac80211/patches/ath/558-ath9k-only-mask-use_eeprom-on-of-noeeprom.patch
 delete mode 100644 
package/kernel/mac80211/patches/subsys/302-mac80211-allocate-tailroom-for-forwarded-mesh-packet.patch

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index d68738aca5..0db42aeb9a 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=mac80211
 
-PKG_VERSION:=4.19.23-1
-PKG_RELEASE:=5
-PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.23/
-PKG_HASH:=703e940b542eb56067fcd847a7c69398dcc9829f34472647eea4211cb2ab3b83
+PKG_VERSION:=4.19.32-1
+PKG_RELEASE:=1
+PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.32/
+PKG_HASH:=838db1565b54fe4bd1e769c54f30c65c9ea2fb5e99a0cddb7910561794ae317a
 
 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
diff --git 
a/package/kernel/mac80211/patches/ath/558-ath9k-only-mask-use_eeprom-on-of-noeeprom.patch
 
b/package/kernel/mac80211/patches/ath/558-ath9k-only-mask-use_eeprom-on-of-noeeprom.patch
deleted file mode 100644
index f0656de253..00
--- 
a/package/kernel/mac80211/patches/ath/558-ath9k-only-mask-use_eeprom-on-of-noeeprom.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-ath9k: Avoid OF no-EEPROM quirks without qca,no-eeprom
-
-ath9k_of_init() function[0] was initially written on the assumption that
-if someone had an explicit ath9k OF node that "there must be something
-wrong, why would someone add an OF node if everything is fine"[1]
-(Quoting Martin Blumenstingl)
-
-"it turns out it's not that simple. with your requirements I'm now aware
-of two use-cases where the current code in ath9k_of_init() doesn't work
-without modifications"[1]
-
-The "your requirements" Martin speaks of is the result of the fact that I
-have a device (PowerCloud Systems CR5000) that uses the EEPROM for
-caldata and firmware but for which the MAC address is take from the MTD
-"art" partition[2], or more succinctly:
-
-"some cards come with a physical EEPROM chip so "qca,no-eeprom" should not
-be set (your use-case). in this case AH_USE_EEPROM should be set (which
-is the default when there is no OF node)"[1]
-
-The other use case is:
-
-the firmware on some PowerMac G5 seems to add a OF node for the ath9k
-card automatically. depending on the EEPROM on the card AH_NO_EEP_SWAP
-should be unset (which is the default when there is no OF node). see [3]
-
-After this patch to ath9k_of_init() the new behavior will be:
-
-if there's no OF node then everything is the same as before
-if there's an empty OF node then ath9k will use the hardware EEPROM
-  (before ath9k would fail to initialize because no EEPROM data was
-  provided by userspace)
-if there's an OF node with only a MAC address then ath9k will use
-  the MAC address and the hardware EEPROM (see the case above)
-with "qca,no-eeprom" EEPROM data from userspace will be requested.
-  the behavior here will not change
-[1]
-
-Martin provides additional background on EEPROM swapping[1] which I have
-included in the patch annotation but not the commit message.
-
-Thanks to Christian Lampartar  for all his help on
-troubleshooting this issue and the basis for this patch.
-
-Fixes: 138b41253d9c ("ath9k: parse the device configuration from an OF node")
-
-[0]https://elixir.bootlin.com/linux/v4.20-rc7/source/drivers/net/wireless/ath/ath9k/init.c#L615
-[1]https://github.com/openwrt/openwrt/pull/1645#issuecomment-448027058
-[2]https://github.com/openwrt/openwrt/pull/1613
-[3]https://patchwork.kernel.org/patch/10241731/
-
-Signed-off-by: Daniel F. Dickinson 
 a/drivers/net/wireless/ath/ath9k/init.c
-+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -642,15 +642,15 @@ static int ath9k_of_init(struct ath_soft
-   ret = ath9k_eeprom_request(sc, eeprom_name);
-   if (ret)
-   return ret;
-+
-+  ah->ah_flags &= ~AH_USE_EEPROM;
-+  

[OpenWrt-Devel] [PATCH] iwinfo: Fix 802.11ad channel to frequency

2019-03-28 Thread Robert Marko
This patch enables proper identification of ad hwmode in channel2frequency 
function.
Now iwinfo will properly calculate frequency for a channels 1-6 in 802.11ad.

Fixes a8e827592338d7f10d93b4b93d04f367221465c2

Signed-off-by: Robert Marko 
---
 iwinfo_nl80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
index 13c69e3..200be28 100644
--- a/iwinfo_nl80211.c
+++ b/iwinfo_nl80211.c
@@ -1207,7 +1207,7 @@ static int nl80211_get_frequency_info_cb(struct nl_msg 
*msg, void *arg)
 
 static int nl80211_get_frequency(const char *ifname, int *buf)
 {
-   char *res, channel[4], hwmode[2];
+   char *res, channel[4], hwmode[3];
 
/* try to find frequency from interface info */
res = nl80211_phy2ifname(ifname);
-- 
2.20.1


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


Re: [OpenWrt-Devel] script error in target-metadata.pl

2019-03-28 Thread Koen Vandeputte



On 27.03.19 22:56, Daniel Golle wrote:

Hi Koen,

I hope I fixed the issue with commit
7204736076 IB: fix generating .profile.mk for profiles without metadata

Please report back if you also see it fixed by this.

Hi Daniel,

I'm pleased to confirm it's fixed :-)
Appreciated!

Koen


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


Re: [OpenWrt-Devel] [RFC] DTS vs UCI based LED triggers [Was: [PATCH] ramips: add Netgear EX6150]

2019-03-28 Thread Petr Štetiar
Petr Štetiar  [2019-03-25 16:38:10]:

> > +netgear,ex6150)
> > +   ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "$boardname:green:router" 
> > "phy1tpt"
> > +   ucidef_set_led_wlan "wlan5g" "WiFi 5GHz" "$boardname:green:client" 
> > "phy0tpt"
> > +   ;;
> 
> I would like to merge this patch[1], but I've moved this LED UCI settings to
> DTS under LED nodes, where I believe it belongs. While confirming this changes
> with David on IRC, I've been told, that he has done so on purpose as it might
> be prefered on ramips platform. So what are the preferences? Thanks!

Ok, so I read it as nobody has strong objections against it, so I'm inclined
to consider it as a green light and I'm going to build test it over night and
push it as it is in my staging tree tomorrow.

-- ynezz

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


Re: [OpenWrt-Devel] Merged: ramips: Increase GB-PC2 SPI frequency to 80MHz

2019-03-28 Thread Petr Štetiar
Christian Lamparter  [2019-03-25 21:43:26]:

Hi,

> > Thanks! Merged into my staging tree at 
> > https://git.openwrt.org/openwrt/staging/ynezz.git
> 
> https://patchwork.ozlabs.org/patch/1034614/#2088615

Ah, so this is actually v2, but not being marked as such. Thanks for the info.

This patch simply got my attention as I was looking for some ramips candidates
I could include together in one build test, this patch was lingering in the
patchwork for more then a month without any comments, looked correct to me at
the first sight, and harmless enough so I've just merged it. I'll try to be
more careful next time.

@Rosen could you please next time include v2 in the subject and changelog in
your patches? :-) Thanks

Rosen Penev  [2019-03-25 14:11:32]:

> On Mon, Mar 25, 2019 at 1:43 PM Christian Lamparter  
> wrote:
> >
> > So, I think in order for this to "work as expected" the sysclock
> > in the mt7621.dtsi should be at 220 MHz (as in the upstream
> > drivers/staging/mt7621-dts/mt7621.dtsi) instead of 50 MHz.
>
> According to GCH, that commit is wrong:
> https://github.com/openwrt/openwrt/pull/1578#issuecomment-443661067
> 
> As far as the clock goes, it's using a PLL now:
> https://github.com/openwrt/openwrt/blob/master/target/linux/ramips/dts/mt7621.dtsi#L223

Ok, thanks for the details. In order to move forward, could you please provide
relevant parts from dmesg (from clean latest snapshot, without your local
modifications) so we can see the clock information from the running GP-PC2
system?

I'll then include this additional details to the commit message as well, so it
could be easily git blamed.

> > That said, I don't think this will break anything since the mt7621-spi 
> > driver
> > from 0043-spi-add-mt7621-support.patch, just limits it at the fake "25 Mhz"
> > (which should be ~110 MHz). So, this will just look odd and makes no sense
> > at the first glance.
>
> Ah, none of my testing was done with the stock driver, only the upstream one.

Honestly I find this little bit delicate, that you're submiting patches which
are not thoroughly tested against our master. To be clear, it's not happening
in this particular case, but I don't want to help merge patches which I'm not
able to test myself and which might in some rare cases brick other people's
devices.

So the commit message simply contains garbage, as nobody else could confirm
(and more likely deny) this dd values in the time of commit.

We need to fix the commit message as well, please provide the dd values from
clean latest snapshot as well and please include kernel version for the
upstream kernel values as well (or if it was backport of upstream driver from
version XY to version AB).

> There are also other devices with an 80MHz clock in the ramips dts directory.

I find this arguments quite silly and I'm tired to read them over and over
again. It might be in the tree already for many reasons.

> 80MHz looked like it was a peak so that's what I used.

I'm wondering if it would hurt the performance if you would provide maximum
clock value as written in datasheet. I mean this testing is nice, but does it
provide some meaningful number? I think, that in order to make it a proper
number, you would still need to test it on a few more devices, ideally from
different production runs, and even after this we might still face
possibility, that we get another patch from the other user, claiming, that his
flash can do 121MHz so why it's crippled to 80MHz :-)

-- ynezz

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