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

2019-03-31 Thread Tomasz Maciej Nowak
Hi Jo,

W dniu 31.03.2019 o 14:30, Jo-Philipp Wich pisze:
> Hi Tomasz,
> 
>> BTW Is there somewhere a list of packages installed on buildbots and is the 
>> list consistent across all of them? 
> 
> we're slowly converging towards this:
> 
> apt-get install -y \
> pwgen \
> locales \
> buildbot-slave \
> build-essential \
> git-core \
>   subversion \
> libncurses5-dev \
> gawk \
> unzip \
> wget \
>   curl \
> ccache \
> rsync
> 
> on top of a Debian 9 base image. The effective resulting package list is
> attached to this mail.

Thank You for this list, it'll help in future contributions to avoid breakages.

> 
> The packages installed are not yet consistent among all slaves but the
> list attached to this mail should be the common subset.

Would be nice to see this list on OpenWrt documentation, after all builbots 
setups are identical.

> 
> ~ Jo
> 

Regards

-- 
TMN

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


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

2019-03-31 Thread Tomasz Maciej Nowak
W dniu 31.03.2019 o 14:12, Tomasz Maciej Nowak pisze:
> W dniu 31.03.2019 o 00:01, Hauke Mehrtens pisze:
>> On 3/28/19 5:20 PM, Tomasz Maciej Nowak wrote:
>>> 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 
>>> ---
>>
>> U-Boot uses binman for tegra and binman needs swig to build.
>> In mainline U-Boot sunxi, tegra and x86 are using binman for building
>> and depend on swig at build time. On sunxi I patched this dependency
>> out, but I do not know how we should handle this here?
> 
> Thanks for pointing this out. Looks like tegra has already definition in 
> place for building without binman[1], so deleting 'select BINMAN' from 
> arch/arm/mach-tegra/Kconfig lets the package build without swig.
> After testing on the hardware, I'll send next iteration of the patches.
> 
>>
>> "apt install swig" solves the problem for me, I do not know if we can
>> easily build swig in the tools and if this would be sufficient.
> 
> Following documentation[2] it needs libpcre, but I don't have any insight if 
> we can rely on host library or should provide one in tools. Anyway U-Boot is 
> building fine *for now* without it.

Oh wait, if it links against libpcre, that would definitely require us to 
provide libpcre in tools, but as mentioned swig is not required, for now.

> 
> BTW Is there somewhere a list of packages installed on buildbots and is the 
> list consistent across all of them? 
> 
> 1. 
> http://git.denx.de/?p=u-boot.git;a=blob;f=Makefile;h=c1af9307b38e2b941d651bc316dcdf82e1bff8e6#l1363
> 2. http://swig.org/Doc4.0/Preface.html#Preface_unix_installation
> 
>>
>> Hauke
>>
> 
> Regards
> 

Regards

-- 
TMN

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


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

2019-03-31 Thread Jo-Philipp Wich
Hi Tomasz,

> BTW Is there somewhere a list of packages installed on buildbots and is the 
> list consistent across all of them? 

we're slowly converging towards this:

apt-get install -y \
pwgen \
locales \
buildbot-slave \
build-essential \
git-core \
subversion \
libncurses5-dev \
gawk \
unzip \
wget \
curl \
ccache \
rsync

on top of a Debian 9 base image. The effective resulting package list is
attached to this mail.

The packages installed are not yet consistent among all slaves but the
list attached to this mail should be the common subset.

~ Jo
root@1be523fcdeb0:/# dpkg --get-selections
adduser install
apt install
base-files  install
base-passwd install
bashinstall
binutilsinstall
bsdutilsinstall
build-essential install
buildbot-slave  install
bzip2   install
ca-certificates install
ccache  install
coreutils   install
cpp install
cpp-6   install
curlinstall
dashinstall
debconf install
debian-archive-keyring  install
debianutils install
diffutils   install
dirmngr install
dpkginstall
dpkg-devinstall
e2fslibs:amd64  install
e2fsprogs   install
fakerootinstall
fileinstall
findutils   install
g++ install
g++-6   install
gawkinstall
gcc install
gcc-6   install
gcc-6-base:amd64install
git install
git-coreinstall
git-man install
gnupg   install
gnupg-agent install
gnupg-l10n  install
gosuinstall
gpgvinstall
grepinstall
gzipinstall
hostnameinstall
init-system-helpers install
iproute2install
iputils-pinginstall
krb5-localesinstall
lessinstall
libacl1:amd64   install
libalgorithm-diff-perl  install
libalgorithm-diff-xs-perl   install
libalgorithm-merge-perl install
libapr1:amd64   install
libaprutil1:amd64   install
libapt-pkg5.0:amd64 install
libasan3:amd64  install
libassuan0:amd64install
libatomic1:amd64install
libattr1:amd64  install
libaudit-common install
libaudit1:amd64 install
libblkid1:amd64 install
libbsd0:amd64   install
libbz2-1.0:amd64install
libc-bininstall
libc-dev-bininstall
libc-l10n   install
libc6:amd64 install
libc6-dev:amd64 install
libcap-ng0:amd64install
libcap2:amd64   install
libcc1-0:amd64  install
libcilkrts5:amd64   install
libcomerr2:amd64   

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

2019-03-31 Thread Tomasz Maciej Nowak
W dniu 31.03.2019 o 00:01, Hauke Mehrtens pisze:
> On 3/28/19 5:20 PM, Tomasz Maciej Nowak wrote:
>> 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 
>> ---
> 
> U-Boot uses binman for tegra and binman needs swig to build.
> In mainline U-Boot sunxi, tegra and x86 are using binman for building
> and depend on swig at build time. On sunxi I patched this dependency
> out, but I do not know how we should handle this here?

Thanks for pointing this out. Looks like tegra has already definition in place 
for building without binman[1], so deleting 'select BINMAN' from 
arch/arm/mach-tegra/Kconfig lets the package build without swig.
After testing on the hardware, I'll send next iteration of the patches.

> 
> "apt install swig" solves the problem for me, I do not know if we can
> easily build swig in the tools and if this would be sufficient.

Following documentation[2] it needs libpcre, but I don't have any insight if we 
can rely on host library or should provide one in tools. Anyway U-Boot is 
building fine *for now* without it.

BTW Is there somewhere a list of packages installed on buildbots and is the 
list consistent across all of them? 

1. 
http://git.denx.de/?p=u-boot.git;a=blob;f=Makefile;h=c1af9307b38e2b941d651bc316dcdf82e1bff8e6#l1363
2. http://swig.org/Doc4.0/Preface.html#Preface_unix_installation

> 
> Hauke
> 

Regards

-- 
TMN

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


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

2019-03-30 Thread Hauke Mehrtens
On 3/28/19 5:20 PM, Tomasz Maciej Nowak wrote:
> 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 
> ---

U-Boot uses binman for tegra and binman needs swig to build.
In mainline U-Boot sunxi, tegra and x86 are using binman for building
and depend on swig at build time. On sunxi I patched this dependency
out, but I do not know how we should handle this here?

"apt install swig" solves the problem for me, I do not know if we can
easily build swig in the tools and if this would be sufficient.

Hauke

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


[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