Re: [meta-xilinx] [linux-xlnx] uio as module fails to link

2019-07-09 Thread Hyun Kwon
Hi JFD,

On Tue, 2019-07-09 at 11:07:03 -0700, Jean-Francois Dagenais wrote:
> 
> 
> > On Jul 9, 2019, at 12:59, Hyun Kwon  wrote:
> > 
> > 
> > The Kconfig takes care of it by selecting CONFIG_DMA_SHARED_BUFFER because
> > I didn't want to add #ifdefs for downstream changes.
> 
> Ok. But what if someone has no use for DMABUF and doesn't want the extra code
> weight, but does want UIO? I.e. a dmabuf-less UIO module? I mean, UIO exists
> without all these functions. Automatically adding all this code to the module,
> although it would not bother me all that much, might upset some.
> 
> Cheers!

Yes, I understand points you made. But for that, I may end up adding another
uio dmabuf config and adding several #ifdefs or even making it as a completely
separate module. It seemed overkill to me for a couple of hundred lines of code.
I wanted to keep it simple and less intrusive. Maybe I was being lazy. :-)

Thanks,
-hyun

-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


Re: [meta-xilinx] [meta-xilinx-tools][RFC][patch 1/3] xilinx-bootbin: rename BIF_PARTITION_ATTR to BIF_PARTITIONS for clarity

2019-07-09 Thread Jean-Francois Dagenais
Hi Manju,

> On Jul 9, 2019, at 15:22, Manjukumar Harthikote Matha  
> wrote:
> 
> Hi JD,
> 
>> -Original Message-
>> From: Jean-Francois Dagenais 
>> Sent: Tuesday, July 9, 2019 8:45 AM
>> To: meta-xilinx@yoctoproject.org; git 
>> Cc: Jean-Francois Dagenais 
>> Subject: [meta-xilinx-tools][RFC][patch 1/3] xilinx-bootbin: rename
>> BIF_PARTITION_ATTR to BIF_PARTITIONS for clarity
>> 
>> Using BIF_PARTITION_ATTR main variable as the list of partitions is a
>> reuse of the variable which makes the definition and code much harder to
>> read and understand. Simply renaming the list of partitions as
>> BIF_PARTITIONS alleviates this completely.
>> 
>> Signed-off-by: Jean-Francois Dagenais 
>> ---
>> README.md |  2 +-
>> recipes-bsp/bootbin/machine-xilinx-versal.inc |  2 +-
>> recipes-bsp/bootbin/machine-xilinx-zynq.inc   |  4 ++--
>> recipes-bsp/bootbin/machine-xilinx-zynqmp.inc |  4 ++--
>> recipes-bsp/bootbin/xilinx-bootbin_1.0.bb | 14 +++---
>> 5 files changed, 13 insertions(+), 13 deletions(-)
>> 
>> diff --git a/README.md b/README.md
>> index 65f6623..e4091e5 100644
>> --- a/README.md
>> +++ b/README.md
>> @@ -83,7 +83,7 @@ Examples for adding dependencies
>> 
>> See https://github.com/Xilinx/meta-xilinx-tools/blob/master/recipes-
>> bsp/bootbin/machine-xilinx-zynq.inc
>> 
>> -BIF_PARTITION_ATTR= "fsbl u-boot"
>> +BIF_PARTITIONS= "fsbl u-boot"
>> 
> 
> The reason to keep the variable name as "BIF partition attributes" is to 
> match with the user guide of bootgen.
> https://www.xilinx.com/support/documentation/sw_manuals/xilinx2019_1/ug1283-bootgen-user-guide.pdf

That's fine for the "partition attributes" of the definitions, which I have 
left as is. I just thought putting the list of partitions in the variable 
BIF_PARTITION_ATTR was a arbitrary, or am I not seeing something correctly?

Why not put the list of partitions (used as flag names on the other vars as 
well) on the BIF_PARTITION_DEPENDS or BIF_PARTITION_IMAGE then? Why is the 
_ATTR the one carrying the "top level" list of partition "names"?

After spending minutes analyzing the whole picture, it just seemed to me like 
there was such a distinct thing called "List of BIF partitions" and that the 
BIF_PARTITION_ATTR variable which, like it's brothers _IMAGE and _DEPENDS, is 
mostly used as storage for the varFlags (with partition name as key), seemed to 
have been arbitrarily chosen as the storage (getVar instead of getVarFlag) for 
the list of partitions.

My 2 cents. ;)

> 
>> BIF_PARTITION_ATTR[fsbl]="bootloader"
>> 
>> diff --git a/recipes-bsp/bootbin/machine-xilinx-versal.inc b/recipes-
>> bsp/bootbin/machine-xilinx-versal.inc
>> index 2cdaee7..8304448 100644
>> --- a/recipes-bsp/bootbin/machine-xilinx-versal.inc
>> +++ b/recipes-bsp/bootbin/machine-xilinx-versal.inc
>> @@ -8,7 +8,7 @@ DEPENDS += "virtual/cdo"
>> BIF_COMMON_ATTR ?= ""


-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


Re: [meta-xilinx] warrior branch

2019-07-09 Thread Manjukumar Harthikote Matha
Hi Oleg,

We are little behind on the warrior branch.
See https://github.com/Xilinx/meta-xilinx/commits/master-next this in the 
branch which will be merged to master to cut the warrior branch

We are targeting to get this done by July 17th

Thanks,
Manju

From: meta-xilinx-boun...@yoctoproject.org 
 On Behalf Of Oleg K Dzhimiev
Sent: Tuesday, July 9, 2019 10:52 AM
To: meta-xilinx@yoctoproject.org
Subject: [meta-xilinx] warrior branch

Hello,

What branch of meta-xilinx is currently compatible with the poky's warrior 
branch? If none what's the schedule?

meta-xilinx, master-next: some layer.confs:
LAYERSERIES_COMPAT_xilinx = "sumo thud"

Thanks

Best regards,
Oleg Dzhimiev
Electronics Engineer
phone: +1 801 783  x124
Elphel, Inc.
-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


Re: [meta-xilinx] [meta-xilinx-tools][RFC][patch 3/3] xilinx-bootbin: add multiple images support

2019-07-09 Thread Manjukumar Harthikote Matha
Hi JD,

> -Original Message-
> From: Jean-Francois Dagenais 
> Sent: Tuesday, July 9, 2019 8:45 AM
> To: meta-xilinx@yoctoproject.org; git 
> Cc: Jean-Francois Dagenais 
> Subject: [meta-xilinx-tools][RFC][patch 3/3] xilinx-bootbin: add multiple 
> images
> support
> 
> In certain scenarios, it might be desirable to produce multiple boot.bin 
> files. For
> example, a boot.bin which bundles kernel and dts, and another which loads u-
> boot.
> 
> The default behaviour is kept and the produced image, named boot-default.bin,
> will get the symlink named just "boot.bin".
> 

This is a good patch for generating multiple boot.bin .
I think we needed something like this for fpga-manager flow

> Signed-off-by: Jean-Francois Dagenais 
> ---
>  recipes-bsp/bootbin/xilinx-bootbin_1.0.bb | 78 ++--
> ---
>  1 file changed, 55 insertions(+), 23 deletions(-)
> 
> diff --git a/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb b/recipes-
> bsp/bootbin/xilinx-bootbin_1.0.bb
> index 41e5f1e..f4dca7f 100644
> --- a/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
> +++ b/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
> @@ -5,12 +5,16 @@ the image."
> 
>  LICENSE = "BSD"
> 
> +PR = "r2"
> +

We should never set PR in recipes, this is best maintained by a PR server

>  include machine-xilinx-${SOC_FAMILY}.inc
> 
>  inherit deploy
> 
>  PROVIDES = "virtual/boot-bin"
> 
> +B = "${WORKDIR}/build"
> +
>  do_configure[depends] += "${@get_bootbin_depends(d)}"
> 
>  PACKAGE_ARCH = "${MACHINE_ARCH}"
> @@ -21,15 +25,24 @@ BOOTGEN_EXTRA_ARGS ?= ""
> 
>  BIF_PARTITIONS_zynqmp = "${@'fsbl pmu atf u-boot' if
> d.getVar('FPGA_MNGR_RECONFIG_ENABLE') == '1' else 'fsbl bitstream pmu atf
> u-boot'}"
> 
> +XILINX_BOOTBIN_IMAGES ??= "default"
> +
>  inherit nopackages
>  deltask do_fetch
>  deltask do_patch
>  deltask do_unpack
>  deltask do_install
> 
> +python () {
> +if not d.getVar("BIF_PARTITIONS_default"):
> +d.setVar("BIF_PARTITIONS_default", d.getVar("BIF_PARTITIONS"))
> +}
> +
>  def get_bootbin_depends(d):
>  bootbindeps = ""
> -bifpartitions = (d.getVar("BIF_PARTITIONS", True) or "").split()
> +bifpartitions = set()
> +for image in d.getVar("XILINX_BOOTBIN_IMAGES").split():
> +bifpartitions |= set((d.getVar("BIF_PARTITIONS_%s" % image) or
> + "").split())
>  attrdepends = d.getVarFlags("BIF_PARTITION_DEPENDS") or {}
>  for partition in bifpartitions:
>  if partition in attrdepends:
> @@ -37,7 +50,7 @@ def get_bootbin_depends(d):
> 
>  return bootbindeps
> 
> -def create_bif(config, attrflags, attrimage, common_attr, biffd, d):
> +def create_bif_partitions(config, attrflags, attrimage, common_attr, biffd, 
> d):
>  import re, os
>  for cfg in config:
>  if cfg not in attrflags and common_attr:
> @@ -64,9 +77,7 @@ def create_bif(config, attrflags, attrimage, common_attr,
> biffd, d):
> 
>  return
> 
> -python do_configure() {
> -
> -fp = d.getVar("BIF_FILE_PATH", True)
> +def create_bif_file(d, fp, bifpartitions):
>  biffd = open(fp, 'w')
>  biffd.write("the_ROM_image:\n")
>  biffd.write("{\n")
> @@ -74,32 +85,47 @@ python do_configure() {
>  bifattr = (d.getVar("BIF_COMMON_ATTR", True) or "").split()
>  if bifattr:
>  attrflags = d.getVarFlags("BIF_COMMON_ATTR") or {}
> -create_bif(bifattr, attrflags,'', 1, biffd, d)
> +create_bif_partitions(bifattr, attrflags,'', 1, biffd, d)
> 
> -bifpartition = (d.getVar("BIF_PARTITIONS", True) or "").split()
> -if bifpartition:
> -attrflags = d.getVarFlags("BIF_PARTITION_ATTR") or {}
> -attrimage = d.getVarFlags("BIF_PARTITION_IMAGE") or {}
> -create_bif(bifpartition, attrflags, attrimage, 0, biffd, d)
> +attrflags = d.getVarFlags("BIF_PARTITION_ATTR") or {}
> +attrimage = d.getVarFlags("BIF_PARTITION_IMAGE") or {}
> +create_bif_partitions(bifpartitions, attrflags, attrimage, 0,
> + biffd, d)
> 
>  biffd.write("}")
>  biffd.close()
> -}
> 
> -do_configure[vardeps] += "BIF_PARTITIONS BIF_PARTITION_ATTR
> BIF_PARTITION_IMAGE BIF_COMMON_ATTR"
> +python do_configure() {
> +for image in d.getVar("XILINX_BOOTBIN_IMAGES").split():
> +bifpartitions = d.getVar("BIF_PARTITIONS_" + image)
> +if not bifpartitions:
> +continue
> +create_bif_file(d, "bootgen-%s.bif" % image,
> +bifpartitions.split()) } do_configure[vardeps] += "\
> +XILINX_BOOTBIN_IMAGES \
> +BIF_PARTITIONS \
> +BIF_PARTITION_ATTR \
> +BIF_PARTITION_IMAGE \
> +BIF_COMMON_ATTR \
> +"
> 
>  do_compile() {
> -cd ${WORKDIR}
> -rm -f ${B}/BOOT.bin
> -bootgen -image ${BIF_FILE_PATH} -arch ${SOC_FAMILY}
> ${BOOTGEN_EXTRA_ARGS} -w -o ${B}/BOOT.bin
> -if [ ! -e ${B}/BOOT.bin ]; then
> -bbfatal "bootgen failed. See log"
> -fi
> +pwd
> +ls -la
> +rm -f boot*.bin BOOT.bin
> +for image in ${XILINX_BOOTBIN_IMAGES}
> +do
> +bootbin=boot-${image}.bin
> +

Re: [meta-xilinx] [meta-xilinx-tools][RFC][patch 1/3] xilinx-bootbin: rename BIF_PARTITION_ATTR to BIF_PARTITIONS for clarity

2019-07-09 Thread Manjukumar Harthikote Matha
Hi JD,

> -Original Message-
> From: Jean-Francois Dagenais 
> Sent: Tuesday, July 9, 2019 8:45 AM
> To: meta-xilinx@yoctoproject.org; git 
> Cc: Jean-Francois Dagenais 
> Subject: [meta-xilinx-tools][RFC][patch 1/3] xilinx-bootbin: rename
> BIF_PARTITION_ATTR to BIF_PARTITIONS for clarity
> 
> Using BIF_PARTITION_ATTR main variable as the list of partitions is a
> reuse of the variable which makes the definition and code much harder to
> read and understand. Simply renaming the list of partitions as
> BIF_PARTITIONS alleviates this completely.
> 
> Signed-off-by: Jean-Francois Dagenais 
> ---
>  README.md |  2 +-
>  recipes-bsp/bootbin/machine-xilinx-versal.inc |  2 +-
>  recipes-bsp/bootbin/machine-xilinx-zynq.inc   |  4 ++--
>  recipes-bsp/bootbin/machine-xilinx-zynqmp.inc |  4 ++--
>  recipes-bsp/bootbin/xilinx-bootbin_1.0.bb | 14 +++---
>  5 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/README.md b/README.md
> index 65f6623..e4091e5 100644
> --- a/README.md
> +++ b/README.md
> @@ -83,7 +83,7 @@ Examples for adding dependencies
> 
>  See https://github.com/Xilinx/meta-xilinx-tools/blob/master/recipes-
> bsp/bootbin/machine-xilinx-zynq.inc
> 
> -BIF_PARTITION_ATTR= "fsbl u-boot"
> +BIF_PARTITIONS= "fsbl u-boot"
> 

The reason to keep the variable name as "BIF partition attributes" is to match 
with the user guide of bootgen.
https://www.xilinx.com/support/documentation/sw_manuals/xilinx2019_1/ug1283-bootgen-user-guide.pdf

>  BIF_PARTITION_ATTR[fsbl]="bootloader"
> 
> diff --git a/recipes-bsp/bootbin/machine-xilinx-versal.inc b/recipes-
> bsp/bootbin/machine-xilinx-versal.inc
> index 2cdaee7..8304448 100644
> --- a/recipes-bsp/bootbin/machine-xilinx-versal.inc
> +++ b/recipes-bsp/bootbin/machine-xilinx-versal.inc
> @@ -8,7 +8,7 @@ DEPENDS += "virtual/cdo"
>  BIF_COMMON_ATTR ?= ""
> 
>  # specify BIF partition attributes required for BOOT.bin
> -BIF_PARTITION_ATTR ?= "pmc_cdo plm psm dtb u-boot atf"
> +BIF_PARTITIONS ?= "pmc_cdo plm psm dtb u-boot atf"
> 
>  # specify BIF partition attributes for pmc_cdo
>  BIF_PARTITION_ATTR[pmc_cdo] ?= "pmcdata,load=0xF200"
> diff --git a/recipes-bsp/bootbin/machine-xilinx-zynq.inc b/recipes-
> bsp/bootbin/machine-xilinx-zynq.inc
> index b8d75c4..6ced4c3 100644
> --- a/recipes-bsp/bootbin/machine-xilinx-zynq.inc
> +++ b/recipes-bsp/bootbin/machine-xilinx-zynq.inc
> @@ -1,5 +1,5 @@
>  #specify BIF partition attributes required for BOOT.bin
> -BIF_PARTITION_ATTR ?= "fsbl bitstream u-boot"
> +BIF_PARTITIONS ?= "fsbl bitstream u-boot"
> 
>  #specify BIF partition attributes for FSBL
>  #bootloader is FSBL. Location where FSBL binary is present and dependency to
> build FSBL
> @@ -12,6 +12,6 @@ BIF_PARTITION_DEPENDS[fsbl] ?= "virtual/fsbl:do_deploy"
>  BIF_PARTITION_IMAGE[u-boot] ?= "${DEPLOY_DIR_IMAGE}/u-boot-
> ${MACHINE}.elf"
>  BIF_PARTITION_DEPENDS[u-boot] ?= "virtual/bootloader:do_deploy"
> 
> -# enable bitstream-Note this is not enabled by default (missing in
> BIF_PARTITION_ATTR)
> +# enable bitstream-Note this is not enabled by default (missing in
> BIF_PARTITIONS)
>  BIF_PARTITION_IMAGE[bitstream] ?= "${DEPLOY_DIR_IMAGE}/download-
> ${MACHINE}.bit"
>  BIF_PARTITION_DEPENDS[bitstream] ?= "virtual/bitstream:do_deploy"
> diff --git a/recipes-bsp/bootbin/machine-xilinx-zynqmp.inc b/recipes-
> bsp/bootbin/machine-xilinx-zynqmp.inc
> index 3cc2f8b..4d70590 100644
> --- a/recipes-bsp/bootbin/machine-xilinx-zynqmp.inc
> +++ b/recipes-bsp/bootbin/machine-xilinx-zynqmp.inc
> @@ -2,7 +2,7 @@
>  BIF_COMMON_ATTR ?= ""
> 
>  # specify BIF partition attributes required for BOOT.bin
> -BIF_PARTITION_ATTR ?= "fsbl pmu atf u-boot"
> +BIF_PARTITIONS ?= "fsbl pmu atf u-boot"
> 
>  # specify BIF partition attributes for FSBL
>  # bootloader is FSBL. Location where FSBL binary is present and dependency to
> build FSBL
> @@ -28,7 +28,7 @@ BIF_PARTITION_ATTR[u-boot] ?= "destination_cpu=a53-
> 0,exception_level=el-2"
>  BIF_PARTITION_IMAGE[u-boot] ?= "${DEPLOY_DIR_IMAGE}/u-boot-
> ${MACHINE}.elf"
>  BIF_PARTITION_DEPENDS[u-boot] ?= "virtual/bootloader:do_deploy"
> 
> -# enable bitstream-Note this is not enabled by default (missing in
> BIF_PARTITION_ATTR)
> +# enable bitstream-Note this is not enabled by default (missing in
> BIF_PARTITIONS)
>  BIF_PARTITION_ATTR[bitstream] ?= "destination_device=pl"
>  BIF_PARTITION_IMAGE[bitstream] ?= "${DEPLOY_DIR_IMAGE}/download-
> ${MACHINE}.bit"
>  BIF_PARTITION_DEPENDS[bitstream] ?= "virtual/bitstream:do_deploy"
> diff --git a/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb b/recipes-
> bsp/bootbin/xilinx-bootbin_1.0.bb
> index 1fb8d99..979c737 100644
> --- a/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
> +++ b/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
> @@ -19,7 +19,7 @@ BIF_FILE_PATH ?= "${B}/bootgen.bif"
> 
>  BOOTGEN_EXTRA_ARGS ?= ""
> 
> -BIF_PARTITION_ATTR_zynqmp = "${@'fsbl pmu atf u-boot' if
> d.getVar('FPGA_MNGR_RECONFIG_ENABLE') == '1' else 'fsbl bitstream pmu atf
> 

[meta-xilinx] [contrib][RFC] linux-boot-simple: introduce ultra trivial kernel Image launcher

2019-07-09 Thread Jean-Francois Dagenais
This very crude linux loader assumes the kernel image, the dtb and itself have
been copied to RAM at the addresses given at compile time (see variables in
recipe).

The kernel will use the "/chosen/bootargs" from the dtb.

It is meant to "replace" u-boot for very simple cases. One can load all these
binaries from boot.bin using the bif file "load=" syntax. FSBL then blindly
copies those to the specfied HW addresses.

Follow the thread around this message:
https://lists.yoctoproject.org/pipermail/meta-xilinx/2019-June/004433.html

Signed-off-by: Jean-Francois Dagenais 
---
 .../linux-boot-simple/files/linux-boot-simple.s| 45 ++
 .../linux-boot-simple/linux-boot-simple.bb | 29 ++
 2 files changed, 74 insertions(+)
 create mode 100644 
meta-xilinx-contrib/recipes-bsp/linux-boot-simple/files/linux-boot-simple.s
 create mode 100644 
meta-xilinx-contrib/recipes-bsp/linux-boot-simple/linux-boot-simple.bb

diff --git 
a/meta-xilinx-contrib/recipes-bsp/linux-boot-simple/files/linux-boot-simple.s 
b/meta-xilinx-contrib/recipes-bsp/linux-boot-simple/files/linux-boot-simple.s
new file mode 100644
index 000..4aa9a0d
--- /dev/null
+++ 
b/meta-xilinx-contrib/recipes-bsp/linux-boot-simple/files/linux-boot-simple.s
@@ -0,0 +1,45 @@
+/*
+* (C) Copyright 2015 - 2019, Xilinx, Inc
+*
+* Originally written by Edgar E. Iglesias and Jason Wu.
+* Modified for yocto by Jean-Francois Dagenais
+*
+* Set yocto variables BOOT_LOAD_KERNEL_ADDRESS and BOOT_LOAD_DTB_ADDRESS and
+* BOOT_LOAD_LINUX_BOOT_SIMPLE at the global scope (e.g. local.conf,
+* machine.conf or distro.conf) to tell this code where in RAM the kernel and
+* device-tree blob are.
+*
+* See linux-boot-simple.bb
+*
+* Example use in machine.conf with xilinx-bootbin's BIF_PARTITION_... 
variables:
+* (mymachine.conf)
+* BOOT_LOAD_DTB_ADDRESS = "0x6"
+* BOOT_LOAD_KERNEL_ADDRESS = "0x8"
+* BOOT_LOAD_LINUX_BOOT_SIMPLE = "0x5F000"
+* BIF_PARTITION_ATTR[linux-trampoline] = 
"destination_cpu=a53-0,exception_level=el-2"
+* BIF_PARTITION_IMAGE[linux-trampoline] = 
"${DEPLOY_DIR_IMAGE}/linux-boot-simple.elf"
+* BIF_PARTITION_DEPENDS[linux-trampoline] = "linux-boot-simple:do_deploy"
+* BIF_PARTITION_ATTR[dtb] := "load=${BOOT_LOAD_DTB_ADDRESS}"
+* BIF_PARTITION_IMAGE[dtb] = "${DEPLOY_DIR_IMAGE}/${MACHINE}.dtb"
+* BIF_PARTITION_DEPENDS[dtb] = "virtual/kernel:do_deploy"
+* BIF_PARTITION_ATTR[kernel] := "load=${BOOT_LOAD_KERNEL_ADDRESS}"
+* BIF_PARTITION_IMAGE[kernel] = "${DEPLOY_DIR_IMAGE}/Image-${MACHINE}.bin"
+* BIF_PARTITION_DEPENDS[kernel] = "virtual/kernel:do_deploy"
+*
+* Then replace "u-boot" with "linux-trampoline" in the list of bif partitions:
+* BIF_PARTITION_ATTR_mymachine = "fsbl bitstream pmu atf linux-trampoline dtb 
kernel"
+*/
+   .section.text
+   .global _start
+_start:
+   ldr  x17, kernel_start
+   ldr  x0, kernel_dts
+   mov  x1, xzr
+   mov  x2, xzr
+   mov  x3, xzr
+   blr  x17
+   .balign 8
+kernel_start:
+   .dword   __BOOT_LOAD_KERNEL_ADDRESS__
+kernel_dts:
+   .dword   __BOOT_LOAD_DTB_ADDRESS__
diff --git 
a/meta-xilinx-contrib/recipes-bsp/linux-boot-simple/linux-boot-simple.bb 
b/meta-xilinx-contrib/recipes-bsp/linux-boot-simple/linux-boot-simple.bb
new file mode 100644
index 000..7f0d57b
--- /dev/null
+++ b/meta-xilinx-contrib/recipes-bsp/linux-boot-simple/linux-boot-simple.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Simple Boot Loader for embedded devices"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = 
"file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+SRC_URI += "file://linux-boot-simple.s"
+
+B = "${WORKDIR}/build"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit xsct-tc
+
+do_configure() {
+sed "s/__BOOT_LOAD_KERNEL_ADDRESS__/${BOOT_LOAD_KERNEL_ADDRESS}/" 
${WORKDIR}/${PN}.s > ${B}/${PN}.s
+sed -i "s/__BOOT_LOAD_DTB_ADDRESS__/${BOOT_LOAD_DTB_ADDRESS}/" 
${B}/${PN}.s
+}
+
+do_compile() {
+aarch64-none-elf-gcc -nostartfiles -nodefaultlibs 
-Wl,--build-id=none,-Ttext=${BOOT_LOAD_LINUX_BOOT_SIMPLE} ${PN}.s -o ${PN}.elf
+}
+
+do_install[noexec] = "1"
+
+inherit deploy
+
+do_deploy() {
+cp ${B}/linux-boot-simple.elf ${DEPLOYDIR}
+}
+addtask deploy before do_build after do_compile
-- 
2.11.0

-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


[meta-xilinx] warrior branch

2019-07-09 Thread Oleg K Dzhimiev
Hello,

What branch of meta-xilinx is currently compatible with the poky's warrior
branch? If none what's the schedule?

meta-xilinx, master-next: some layer.confs:
> LAYERSERIES_COMPAT_xilinx = "sumo thud"


Thanks

Best regards,
Oleg Dzhimiev
Electronics Engineer
phone: +1 801 783  x124
Elphel, Inc.
-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


Re: [meta-xilinx] [linux-xlnx] uio as module fails to link

2019-07-09 Thread Jean-Francois Dagenais



> On Jul 9, 2019, at 12:59, Hyun Kwon  wrote:
> 
> 
> The Kconfig takes care of it by selecting CONFIG_DMA_SHARED_BUFFER because
> I didn't want to add #ifdefs for downstream changes.

Ok. But what if someone has no use for DMABUF and doesn't want the extra code
weight, but does want UIO? I.e. a dmabuf-less UIO module? I mean, UIO exists
without all these functions. Automatically adding all this code to the module,
although it would not bother me all that much, might upset some.

Cheers!
-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


Re: [meta-xilinx] [linux-xlnx] uio as module fails to link

2019-07-09 Thread Hyun Kwon
Hi JFD,

Thanks for taking a look.

On Tue, 2019-07-09 at 05:26:43 -0700, Jean-Francois Dagenais wrote:
> Quick turn-around!
> 
> > On Jul 8, 2019, at 14:51, Hyun Kwon  wrote:
> > 
> > Hi JFD,
> > 
> > Thanks for reporting the issue.
> > 
> > On Mon, 2019-07-08 at 09:01:03 -0700, Jean-Francois Dagenais wrote:
> >> Anyone tried that? I get:
> >> 
> >> WARNING: modpost: missing MODULE_LICENSE() in drivers/uio/uio_dmabuf.o
> >> see include/linux/module.h for more information
> >> ERROR: "uio_dmabuf_map" [drivers/uio/uio.ko] undefined!
> >> ERROR: "uio_dmabuf_unmap" [drivers/uio/uio.ko] undefined!
> >> ERROR: "uio_dmabuf_cleanup" [drivers/uio/uio.ko] undefined!
> >> 
> >> uio/Makefile shows:
> >> obj-$(CONFIG_UIO)  += uio.o uio_dmabuf.o
> >> 
> >> I got it to compile by hacking uio.c to #include uio_dmabuf.c instead of 
> >> the .h but that's probably not the correct way to fix this.
> >> 
> > 
> > The easiest fix would be to merge uio_dmabuf.c into uio.c. Please see
> > the attached patch and let me know if you see any other better way.
> 
> > Hehe, that was essentially what my #include "uio_dmabuf.c" was doing. This 
> > patch
> > fixes the problem. See my suggestion below.

Indeed. :-) It doesn't seem to work by fixing the makefile.

> > 
> > Thanks,
> > -hyun
> > 
> > From 84cbe02cf2775dca911c2b734dded794150698a8 Mon Sep 17 00:00:00 2001
> > From: Hyun Kwon 
> > Date: Mon, 8 Jul 2019 11:37:03 -0700
> > Subject: [PATCH 1/1] uio: dmabuf: Merge the dmabuf functions into uio.c
> > 
> > With a separate uio_dmabuf.c, it's tricky to build the uio as
> > a separate kernel module.
> > 
> > Reported-by: Jean-Francois Dagenais 
> > Signed-off-by: Hyun Kwon 
> 
> Tested-by: Jean-Francois Dagenais 
> 

Thanks. I'll take this tag into this patch.

> > ---
> > drivers/uio/Makefile |   2 +-
> > drivers/uio/uio.c| 191 ++
> > drivers/uio/uio_dmabuf.c | 210 
> > ---
> > 3 files changed, 192 insertions(+), 211 deletions(-)
> > delete mode 100644 drivers/uio/uio_dmabuf.c
> > 
> > diff --git a/drivers/uio/Makefile b/drivers/uio/Makefile
> > index 7af888a..aea3e17 100644
> > --- a/drivers/uio/Makefile
> > +++ b/drivers/uio/Makefile
> > @@ -1,5 +1,5 @@
> > # SPDX-License-Identifier: GPL-2.0
> > -obj-$(CONFIG_UIO)  += uio.o uio_dmabuf.o
> > +obj-$(CONFIG_UIO)  += uio.o
> > obj-$(CONFIG_UIO_CIF)   += uio_cif.o
> > obj-$(CONFIG_UIO_PDRV_GENIRQ)   += uio_pdrv_genirq.o
> > obj-$(CONFIG_UIO_DMEM_GENIRQ)   += uio_dmem_genirq.o
> > diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
> > index e054fa7..175fb6b 100644
> > --- a/drivers/uio/uio.c
> > +++ b/drivers/uio/uio.c
> > @@ -26,6 +26,7 @@
> > #include 
> > #include 
> > #include 
> > +#include 
> > 
> > #include 
> > 
> > @@ -455,6 +456,196 @@ static irqreturn_t uio_interrupt(int irq, void 
> > *dev_id)
> > return ret;
> > }
> 
> Would it be better to put all this dmabuf inside a
> #ifdef CONFIG_DMA_SHARED_BUFFER
> maybe? (Or IS_REACHABLE(CONFIG_DMA_SHARED_BUFFER), not sure which formulation 
> works for all cases...)

The Kconfig takes care of it by selecting CONFIG_DMA_SHARED_BUFFER because
I didn't want to add #ifdefs for downstream changes.

Thanks,
-hyun

> 
> > 
> > +struct uio_dmabuf_mem {
> > +   int dbuf_fd;
> > +   struct dma_buf *dbuf;
> > +   struct dma_buf_attachment *dbuf_attach;
> > +   struct sg_table *sgt;
> > +   enum dma_data_direction dir;
> > +   struct list_head list;
> > +};
> > +
> > +long uio_dmabuf_map(struct uio_device *dev, struct list_head *dbufs,
> > +   struct mutex *dbufs_lock, void __user *user_args)
> > +{
> > +   struct uio_dmabuf_args args;
> > +   struct uio_dmabuf_mem *dbuf_mem;
> > +   struct dma_buf *dbuf;
> > +   struct dma_buf_attachment *dbuf_attach;
> > +   enum dma_data_direction dir;
> > +   struct sg_table *sgt;
> > +   long ret;
> > +
> > +   if (copy_from_user(, user_args, sizeof(args))) {
> > +   ret = -EFAULT;
> > +   dev_err(dev->dev.parent, "failed to copy from user\n");
> > +   goto err;
> > +   }
> > +
> > +   dbuf = dma_buf_get(args.dbuf_fd);
> > +   if (IS_ERR(dbuf)) {
> > +   dev_err(dev->dev.parent, "failed to get dmabuf\n");
> > +   return PTR_ERR(dbuf);
> > +   }
> > +
> > +   dbuf_attach = dma_buf_attach(dbuf, dev->dev.parent);
> > +   if (IS_ERR(dbuf_attach)) {
> > +   dev_err(dev->dev.parent, "failed to attach dmabuf\n");
> > +   ret = PTR_ERR(dbuf_attach);
> > +   goto err_put;
> > +   }
> > +
> > [...]
> 
-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


Re: [meta-xilinx] [meta-xilinx-tools][RFC][patch 2/3] xilinx-bootbin: cleanup unecessary steps

2019-07-09 Thread Manjukumar Harthikote Matha
Hi JD,

> -Original Message-
> From: Jean-Francois Dagenais 
> Sent: Tuesday, July 9, 2019 8:45 AM
> To: meta-xilinx@yoctoproject.org; git 
> Cc: Jean-Francois Dagenais 
> Subject: [meta-xilinx-tools][RFC][patch 2/3] xilinx-bootbin: cleanup 
> unecessary
> steps
> 
> Signed-off-by: Jean-Francois Dagenais 
> ---
>  recipes-bsp/bootbin/xilinx-bootbin_1.0.bb | 12 +---
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb b/recipes-
> bsp/bootbin/xilinx-bootbin_1.0.bb
> index 979c737..41e5f1e 100644
> --- a/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
> +++ b/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
> @@ -21,9 +21,11 @@ BOOTGEN_EXTRA_ARGS ?= ""
> 
>  BIF_PARTITIONS_zynqmp = "${@'fsbl pmu atf u-boot' if
> d.getVar('FPGA_MNGR_RECONFIG_ENABLE') == '1' else 'fsbl bitstream pmu atf
> u-boot'}"
> 
> -do_fetch[noexec] = "1"
> -do_unpack[noexec] = "1"
> -do_patch[noexec] = "1"
> +inherit nopackages
> +deltask do_fetch
> +deltask do_patch
> +deltask do_unpack
> +deltask do_install
> 
>  def get_bootbin_depends(d):
>  bootbindeps = ""
> @@ -101,10 +103,6 @@ do_compile_append_versal() {
>  dd if=${DEPLOY_DIR_IMAGE}/boot.scr of=${B}/QEMU_qspi.bin bs=1
> seek=66584576 conv=notrunc  }
> 
> -do_install() {
> - :
> -}
> -

We are working on mechanism which enables boot.bin upgrade mechanism using RPM 
packages.
To do this, we would need do_install task and packaging tasks

Thanks,
Manju

-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


[meta-xilinx] [meta-xilinx-tools][RFC][patch 3/3] xilinx-bootbin: add multiple images support

2019-07-09 Thread Jean-Francois Dagenais
In certain scenarios, it might be desirable to produce multiple boot.bin
files. For example, a boot.bin which bundles kernel and dts, and another
which loads u-boot.

The default behaviour is kept and the produced image, named
boot-default.bin, will get the symlink named just "boot.bin".

Signed-off-by: Jean-Francois Dagenais 
---
 recipes-bsp/bootbin/xilinx-bootbin_1.0.bb | 78 ++-
 1 file changed, 55 insertions(+), 23 deletions(-)

diff --git a/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb 
b/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
index 41e5f1e..f4dca7f 100644
--- a/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
+++ b/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
@@ -5,12 +5,16 @@ the image."
 
 LICENSE = "BSD"
 
+PR = "r2"
+
 include machine-xilinx-${SOC_FAMILY}.inc
 
 inherit deploy
 
 PROVIDES = "virtual/boot-bin"
 
+B = "${WORKDIR}/build"
+
 do_configure[depends] += "${@get_bootbin_depends(d)}"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
@@ -21,15 +25,24 @@ BOOTGEN_EXTRA_ARGS ?= ""
 
 BIF_PARTITIONS_zynqmp = "${@'fsbl pmu atf u-boot' if 
d.getVar('FPGA_MNGR_RECONFIG_ENABLE') == '1' else 'fsbl bitstream pmu atf 
u-boot'}"
 
+XILINX_BOOTBIN_IMAGES ??= "default"
+
 inherit nopackages
 deltask do_fetch
 deltask do_patch
 deltask do_unpack
 deltask do_install
 
+python () {
+if not d.getVar("BIF_PARTITIONS_default"):
+d.setVar("BIF_PARTITIONS_default", d.getVar("BIF_PARTITIONS"))
+}
+
 def get_bootbin_depends(d):
 bootbindeps = ""
-bifpartitions = (d.getVar("BIF_PARTITIONS", True) or "").split()
+bifpartitions = set()
+for image in d.getVar("XILINX_BOOTBIN_IMAGES").split():
+bifpartitions |= set((d.getVar("BIF_PARTITIONS_%s" % image) or 
"").split())
 attrdepends = d.getVarFlags("BIF_PARTITION_DEPENDS") or {}
 for partition in bifpartitions:
 if partition in attrdepends:
@@ -37,7 +50,7 @@ def get_bootbin_depends(d):
 
 return bootbindeps
 
-def create_bif(config, attrflags, attrimage, common_attr, biffd, d):
+def create_bif_partitions(config, attrflags, attrimage, common_attr, biffd, d):
 import re, os
 for cfg in config:
 if cfg not in attrflags and common_attr:
@@ -64,9 +77,7 @@ def create_bif(config, attrflags, attrimage, common_attr, 
biffd, d):
 
 return
 
-python do_configure() {
-
-fp = d.getVar("BIF_FILE_PATH", True)
+def create_bif_file(d, fp, bifpartitions):
 biffd = open(fp, 'w')
 biffd.write("the_ROM_image:\n")
 biffd.write("{\n")
@@ -74,32 +85,47 @@ python do_configure() {
 bifattr = (d.getVar("BIF_COMMON_ATTR", True) or "").split()
 if bifattr:
 attrflags = d.getVarFlags("BIF_COMMON_ATTR") or {}
-create_bif(bifattr, attrflags,'', 1, biffd, d)
+create_bif_partitions(bifattr, attrflags,'', 1, biffd, d)
 
-bifpartition = (d.getVar("BIF_PARTITIONS", True) or "").split()
-if bifpartition:
-attrflags = d.getVarFlags("BIF_PARTITION_ATTR") or {}
-attrimage = d.getVarFlags("BIF_PARTITION_IMAGE") or {}
-create_bif(bifpartition, attrflags, attrimage, 0, biffd, d)
+attrflags = d.getVarFlags("BIF_PARTITION_ATTR") or {}
+attrimage = d.getVarFlags("BIF_PARTITION_IMAGE") or {}
+create_bif_partitions(bifpartitions, attrflags, attrimage, 0, biffd, d)
 
 biffd.write("}")
 biffd.close()
-}
 
-do_configure[vardeps] += "BIF_PARTITIONS BIF_PARTITION_ATTR 
BIF_PARTITION_IMAGE BIF_COMMON_ATTR"
+python do_configure() {
+for image in d.getVar("XILINX_BOOTBIN_IMAGES").split():
+bifpartitions = d.getVar("BIF_PARTITIONS_" + image)
+if not bifpartitions:
+continue
+create_bif_file(d, "bootgen-%s.bif" % image, bifpartitions.split())
+}
+do_configure[vardeps] += "\
+XILINX_BOOTBIN_IMAGES \
+BIF_PARTITIONS \
+BIF_PARTITION_ATTR \
+BIF_PARTITION_IMAGE \
+BIF_COMMON_ATTR \
+"
 
 do_compile() {
-cd ${WORKDIR}
-rm -f ${B}/BOOT.bin
-bootgen -image ${BIF_FILE_PATH} -arch ${SOC_FAMILY} ${BOOTGEN_EXTRA_ARGS} 
-w -o ${B}/BOOT.bin
-if [ ! -e ${B}/BOOT.bin ]; then
-bbfatal "bootgen failed. See log"
-fi
+pwd
+ls -la
+rm -f boot*.bin BOOT.bin
+for image in ${XILINX_BOOTBIN_IMAGES}
+do
+bootbin=boot-${image}.bin
+bootgen -image bootgen-${image}.bif -arch ${SOC_FAMILY} 
${BOOTGEN_EXTRA_ARGS} -w -o boot-${image}.bin
+if [ ! -e ${bootbin} ]; then
+bbfatal "bootgen ${bootbin} failed. See log"
+fi
+done
 }
 
 do_compile_append_versal() {
 dd if=/dev/zero bs=256M count=1  > ${B}/QEMU_qspi.bin
-dd if=${B}/BOOT.bin of=${B}/QEMU_qspi.bin bs=1 seek=0 conv=notrunc
+dd if=${B}/boot-default.bin of=${B}/QEMU_qspi.bin bs=1 seek=0 conv=notrunc
 dd if=${DEPLOY_DIR_IMAGE}/boot.scr of=${B}/QEMU_qspi.bin bs=1 
seek=66584576 conv=notrunc
 }
 
@@ -111,9 +137,15 @@ BOOTBIN_BASE_NAME[vardepsexclude] = "DATETIME"
 
 do_deploy() {
 install -d ${DEPLOYDIR}
-install -m 0644 ${B}/BOOT.bin 

[meta-xilinx] [meta-xilinx-tools][RFC][patch 2/3] xilinx-bootbin: cleanup unecessary steps

2019-07-09 Thread Jean-Francois Dagenais
Signed-off-by: Jean-Francois Dagenais 
---
 recipes-bsp/bootbin/xilinx-bootbin_1.0.bb | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb 
b/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
index 979c737..41e5f1e 100644
--- a/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
+++ b/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
@@ -21,9 +21,11 @@ BOOTGEN_EXTRA_ARGS ?= ""
 
 BIF_PARTITIONS_zynqmp = "${@'fsbl pmu atf u-boot' if 
d.getVar('FPGA_MNGR_RECONFIG_ENABLE') == '1' else 'fsbl bitstream pmu atf 
u-boot'}"
 
-do_fetch[noexec] = "1"
-do_unpack[noexec] = "1"
-do_patch[noexec] = "1"
+inherit nopackages
+deltask do_fetch
+deltask do_patch
+deltask do_unpack
+deltask do_install
 
 def get_bootbin_depends(d):
 bootbindeps = ""
@@ -101,10 +103,6 @@ do_compile_append_versal() {
 dd if=${DEPLOY_DIR_IMAGE}/boot.scr of=${B}/QEMU_qspi.bin bs=1 
seek=66584576 conv=notrunc
 }
 
-do_install() {
-   :
-}
-
 QEMUQSPI_BASE_NAME ?= "QEMU_qspi-${MACHINE}-${DATETIME}"
 QEMUQSPI_BASE_NAME[vardepsexclude] = "DATETIME"
 
-- 
2.11.0

-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


[meta-xilinx] [meta-xilinx-tools][RFC][patch 1/3] xilinx-bootbin: rename BIF_PARTITION_ATTR to BIF_PARTITIONS for clarity

2019-07-09 Thread Jean-Francois Dagenais
Using BIF_PARTITION_ATTR main variable as the list of partitions is a
reuse of the variable which makes the definition and code much harder to
read and understand. Simply renaming the list of partitions as
BIF_PARTITIONS alleviates this completely.

Signed-off-by: Jean-Francois Dagenais 
---
 README.md |  2 +-
 recipes-bsp/bootbin/machine-xilinx-versal.inc |  2 +-
 recipes-bsp/bootbin/machine-xilinx-zynq.inc   |  4 ++--
 recipes-bsp/bootbin/machine-xilinx-zynqmp.inc |  4 ++--
 recipes-bsp/bootbin/xilinx-bootbin_1.0.bb | 14 +++---
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/README.md b/README.md
index 65f6623..e4091e5 100644
--- a/README.md
+++ b/README.md
@@ -83,7 +83,7 @@ Examples for adding dependencies
 
 See 
https://github.com/Xilinx/meta-xilinx-tools/blob/master/recipes-bsp/bootbin/machine-xilinx-zynq.inc
 
-BIF_PARTITION_ATTR= "fsbl u-boot"
+BIF_PARTITIONS= "fsbl u-boot"
 
 BIF_PARTITION_ATTR[fsbl]="bootloader"
 
diff --git a/recipes-bsp/bootbin/machine-xilinx-versal.inc 
b/recipes-bsp/bootbin/machine-xilinx-versal.inc
index 2cdaee7..8304448 100644
--- a/recipes-bsp/bootbin/machine-xilinx-versal.inc
+++ b/recipes-bsp/bootbin/machine-xilinx-versal.inc
@@ -8,7 +8,7 @@ DEPENDS += "virtual/cdo"
 BIF_COMMON_ATTR ?= ""
 
 # specify BIF partition attributes required for BOOT.bin
-BIF_PARTITION_ATTR ?= "pmc_cdo plm psm dtb u-boot atf"
+BIF_PARTITIONS ?= "pmc_cdo plm psm dtb u-boot atf"
 
 # specify BIF partition attributes for pmc_cdo
 BIF_PARTITION_ATTR[pmc_cdo] ?= "pmcdata,load=0xF200"
diff --git a/recipes-bsp/bootbin/machine-xilinx-zynq.inc 
b/recipes-bsp/bootbin/machine-xilinx-zynq.inc
index b8d75c4..6ced4c3 100644
--- a/recipes-bsp/bootbin/machine-xilinx-zynq.inc
+++ b/recipes-bsp/bootbin/machine-xilinx-zynq.inc
@@ -1,5 +1,5 @@
 #specify BIF partition attributes required for BOOT.bin
-BIF_PARTITION_ATTR ?= "fsbl bitstream u-boot"
+BIF_PARTITIONS ?= "fsbl bitstream u-boot"
 
 #specify BIF partition attributes for FSBL
 #bootloader is FSBL. Location where FSBL binary is present and dependency to 
build FSBL
@@ -12,6 +12,6 @@ BIF_PARTITION_DEPENDS[fsbl] ?= "virtual/fsbl:do_deploy"
 BIF_PARTITION_IMAGE[u-boot] ?= "${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.elf"
 BIF_PARTITION_DEPENDS[u-boot] ?= "virtual/bootloader:do_deploy"
 
-# enable bitstream-Note this is not enabled by default (missing in 
BIF_PARTITION_ATTR)
+# enable bitstream-Note this is not enabled by default (missing in 
BIF_PARTITIONS)
 BIF_PARTITION_IMAGE[bitstream] ?= "${DEPLOY_DIR_IMAGE}/download-${MACHINE}.bit"
 BIF_PARTITION_DEPENDS[bitstream] ?= "virtual/bitstream:do_deploy"
diff --git a/recipes-bsp/bootbin/machine-xilinx-zynqmp.inc 
b/recipes-bsp/bootbin/machine-xilinx-zynqmp.inc
index 3cc2f8b..4d70590 100644
--- a/recipes-bsp/bootbin/machine-xilinx-zynqmp.inc
+++ b/recipes-bsp/bootbin/machine-xilinx-zynqmp.inc
@@ -2,7 +2,7 @@
 BIF_COMMON_ATTR ?= ""
 
 # specify BIF partition attributes required for BOOT.bin
-BIF_PARTITION_ATTR ?= "fsbl pmu atf u-boot"
+BIF_PARTITIONS ?= "fsbl pmu atf u-boot"
 
 # specify BIF partition attributes for FSBL
 # bootloader is FSBL. Location where FSBL binary is present and dependency to 
build FSBL
@@ -28,7 +28,7 @@ BIF_PARTITION_ATTR[u-boot] ?= 
"destination_cpu=a53-0,exception_level=el-2"
 BIF_PARTITION_IMAGE[u-boot] ?= "${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.elf"
 BIF_PARTITION_DEPENDS[u-boot] ?= "virtual/bootloader:do_deploy"
 
-# enable bitstream-Note this is not enabled by default (missing in 
BIF_PARTITION_ATTR)
+# enable bitstream-Note this is not enabled by default (missing in 
BIF_PARTITIONS)
 BIF_PARTITION_ATTR[bitstream] ?= "destination_device=pl"
 BIF_PARTITION_IMAGE[bitstream] ?= "${DEPLOY_DIR_IMAGE}/download-${MACHINE}.bit"
 BIF_PARTITION_DEPENDS[bitstream] ?= "virtual/bitstream:do_deploy"
diff --git a/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb 
b/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
index 1fb8d99..979c737 100644
--- a/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
+++ b/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
@@ -19,7 +19,7 @@ BIF_FILE_PATH ?= "${B}/bootgen.bif"
 
 BOOTGEN_EXTRA_ARGS ?= ""
 
-BIF_PARTITION_ATTR_zynqmp = "${@'fsbl pmu atf u-boot' if 
d.getVar('FPGA_MNGR_RECONFIG_ENABLE') == '1' else 'fsbl bitstream pmu atf 
u-boot'}"
+BIF_PARTITIONS_zynqmp = "${@'fsbl pmu atf u-boot' if 
d.getVar('FPGA_MNGR_RECONFIG_ENABLE') == '1' else 'fsbl bitstream pmu atf 
u-boot'}"
 
 do_fetch[noexec] = "1"
 do_unpack[noexec] = "1"
@@ -27,11 +27,11 @@ do_patch[noexec] = "1"
 
 def get_bootbin_depends(d):
 bootbindeps = ""
-bifpartition = (d.getVar("BIF_PARTITION_ATTR", True) or "").split()
+bifpartitions = (d.getVar("BIF_PARTITIONS", True) or "").split()
 attrdepends = d.getVarFlags("BIF_PARTITION_DEPENDS") or {}
-for cfg in bifpartition:
-if cfg in attrdepends:
-bootbindeps = bootbindeps + " " + attrdepends[cfg]
+for partition in bifpartitions:
+if partition in attrdepends:
+ 

[meta-xilinx] xilinx-bootbin improvements

2019-07-09 Thread Jean-Francois Dagenais
Hi guys,

Here are a few changes I have been using. The first is a variable naming
improvement, the second cleans up the inherited recipe steps which don't make
sense for this recipe, the third is a feature addition.

Enjoy.

-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


Re: [meta-xilinx] Custom ps7_init_gpl in Yocto Project

2019-07-09 Thread Jek F.
Great! I'll try your advice as soon as i can. For now thanks you all.

Il mar 9 lug 2019, 15:35 Jean-Francois Dagenais 
ha scritto:

> Hi Nathan,
>
> > On Jul 9, 2019, at 09:23, Nathan Rossi  wrote:
> >
> > You should not need to do this change to xilinx-init-platform.bbclass,
> > however you will need to make sure you recipe populates into the
> > sysroot correctly. By default /usr/src is not populated into the
> > sysroot (not to be confused with packaging). This is the purpose of
> > the "SYSROOT_DIRS" line in platform-init.bb
> > (
> http://git.yoctoproject.org/cgit/cgit.cgi/meta-xilinx/tree/meta-xilinx-bsp/recipes-bsp/platform-init/platform-init.bb#n24
> ).
>
> Great... for me. This will fix my problem. Unfortunately for Jek, I don't
> think this will help since he is using platform-init.bb.
>
> Jek, I suggest you look carefully at u-boot-spl-zynq-init.inc. Several
> variables must work right in order for your psu_init files to end up in
> u-boot's source directory prior to the configure and compile steps.
>
> Good luck!
>
> Thanks for the info Nathan!
-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


Re: [meta-xilinx] Custom ps7_init_gpl in Yocto Project

2019-07-09 Thread Jean-Francois Dagenais
Hi Nathan,

> On Jul 9, 2019, at 09:23, Nathan Rossi  wrote:
> 
> You should not need to do this change to xilinx-init-platform.bbclass,
> however you will need to make sure you recipe populates into the
> sysroot correctly. By default /usr/src is not populated into the
> sysroot (not to be confused with packaging). This is the purpose of
> the "SYSROOT_DIRS" line in platform-init.bb
> (http://git.yoctoproject.org/cgit/cgit.cgi/meta-xilinx/tree/meta-xilinx-bsp/recipes-bsp/platform-init/platform-init.bb#n24).

Great... for me. This will fix my problem. Unfortunately for Jek, I don't think 
this will help since he is using platform-init.bb.

Jek, I suggest you look carefully at u-boot-spl-zynq-init.inc. Several 
variables must work right in order for your psu_init files to end up in 
u-boot's source directory prior to the configure and compile steps.

Good luck!

Thanks for the info Nathan!
-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


Re: [meta-xilinx] Custom ps7_init_gpl in Yocto Project

2019-07-09 Thread Nathan Rossi
On Tue, 9 Jul 2019 at 23:12, Jean-Francois Dagenais
 wrote:
>
> Hi Jek, Xilinx people,
>
> > On Jul 7, 2019, at 12:51, Jek F.  wrote:
> >
> > i'm a newbie and i'm tring to build an image for microzed with a custom 
> > ps7_init_gpl created in Vivado. I tried to create a custom layer 
> > (meta-mylayer/recipes-bsp/platform-init/platform-init.bbappend) to append 
> > ps7_init_gpl files but this didn't work. Which is the right way to Insert 
> > ps7_init_gpl files in Yocto Project?
> >
>
> I also had trouble with this. I worked around it by changing 
> xilinx-init-platform.bbclass:
>
> -PLATFORM_INIT_DIR ?= "/usr/src/xilinx-platform-init"
> +PLATFORM_INIT_DIR ?= "/usr/lib/xilinx-platform-init"
>
> I was not using platform-init per se but our own recipe which declares it is 
> providing "virtual/xilinx-platform-init". So my u-boot recipe was indeed 
> pulling on my platform-init files. And my custom platform-init recipe was 
> indeed providing the psu_init_gpl.[ch] files in the default package. But 
> somehow do_prepare_recipe_sysroot did not put the psu_init_gpl files under 
> tmp/work/mymachine/u-boot/*/recipe_sysroot/usr/src ?
>
> I don't know exactly why it didn't work with /usr/src because I had to move 
> on. Perhaps there is a special case in populate_recipe_sysroot for /usr/src? 
> I know normally, the /usr/src contents are collected by the "${PN}-dbg" 
> packaging, not the default "${PN}" packaging.

You should not need to do this change to xilinx-init-platform.bbclass,
however you will need to make sure you recipe populates into the
sysroot correctly. By default /usr/src is not populated into the
sysroot (not to be confused with packaging). This is the purpose of
the "SYSROOT_DIRS" line in platform-init.bb
(http://git.yoctoproject.org/cgit/cgit.cgi/meta-xilinx/tree/meta-xilinx-bsp/recipes-bsp/platform-init/platform-init.bb#n24).

Regards,
Nathan

>
> It may be a regression caused by an update to the poky layer. The original 
> code in xilinx-init-platform.bbclass from Nathan is dated 2017-01-14 which 
> would be 2-3 Yocto releases back.
>
> Hope this helps!
-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


Re: [meta-xilinx] Custom ps7_init_gpl in Yocto Project

2019-07-09 Thread Jean-Francois Dagenais
Hi Jek, Xilinx people,

> On Jul 7, 2019, at 12:51, Jek F.  wrote:
> 
> i'm a newbie and i'm tring to build an image for microzed with a custom 
> ps7_init_gpl created in Vivado. I tried to create a custom layer 
> (meta-mylayer/recipes-bsp/platform-init/platform-init.bbappend) to append 
> ps7_init_gpl files but this didn't work. Which is the right way to Insert 
> ps7_init_gpl files in Yocto Project?
> 

I also had trouble with this. I worked around it by changing 
xilinx-init-platform.bbclass:

-PLATFORM_INIT_DIR ?= "/usr/src/xilinx-platform-init"
+PLATFORM_INIT_DIR ?= "/usr/lib/xilinx-platform-init"

I was not using platform-init per se but our own recipe which declares it is 
providing "virtual/xilinx-platform-init". So my u-boot recipe was indeed 
pulling on my platform-init files. And my custom platform-init recipe was 
indeed providing the psu_init_gpl.[ch] files in the default package. But 
somehow do_prepare_recipe_sysroot did not put the psu_init_gpl files under 
tmp/work/mymachine/u-boot/*/recipe_sysroot/usr/src ?

I don't know exactly why it didn't work with /usr/src because I had to move on. 
Perhaps there is a special case in populate_recipe_sysroot for /usr/src? I know 
normally, the /usr/src contents are collected by the "${PN}-dbg" packaging, not 
the default "${PN}" packaging.

It may be a regression caused by an update to the poky layer. The original code 
in xilinx-init-platform.bbclass from Nathan is dated 2017-01-14 which would be 
2-3 Yocto releases back.

Hope this helps!
-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


Re: [meta-xilinx] [linux-xlnx] uio as module fails to link

2019-07-09 Thread Jean-Francois Dagenais
Quick turn-around!

> On Jul 8, 2019, at 14:51, Hyun Kwon  wrote:
> 
> Hi JFD,
> 
> Thanks for reporting the issue.
> 
> On Mon, 2019-07-08 at 09:01:03 -0700, Jean-Francois Dagenais wrote:
>> Anyone tried that? I get:
>> 
>> WARNING: modpost: missing MODULE_LICENSE() in drivers/uio/uio_dmabuf.o
>> see include/linux/module.h for more information
>> ERROR: "uio_dmabuf_map" [drivers/uio/uio.ko] undefined!
>> ERROR: "uio_dmabuf_unmap" [drivers/uio/uio.ko] undefined!
>> ERROR: "uio_dmabuf_cleanup" [drivers/uio/uio.ko] undefined!
>> 
>> uio/Makefile shows:
>> obj-$(CONFIG_UIO)+= uio.o uio_dmabuf.o
>> 
>> I got it to compile by hacking uio.c to #include uio_dmabuf.c instead of the 
>> .h but that's probably not the correct way to fix this.
>> 
> 
> The easiest fix would be to merge uio_dmabuf.c into uio.c. Please see
> the attached patch and let me know if you see any other better way.

> Hehe, that was essentially what my #include "uio_dmabuf.c" was doing. This 
> patch
> fixes the problem. See my suggestion below.
> 
> Thanks,
> -hyun
> 
> From 84cbe02cf2775dca911c2b734dded794150698a8 Mon Sep 17 00:00:00 2001
> From: Hyun Kwon 
> Date: Mon, 8 Jul 2019 11:37:03 -0700
> Subject: [PATCH 1/1] uio: dmabuf: Merge the dmabuf functions into uio.c
> 
> With a separate uio_dmabuf.c, it's tricky to build the uio as
> a separate kernel module.
> 
> Reported-by: Jean-Francois Dagenais 
> Signed-off-by: Hyun Kwon 

Tested-by: Jean-Francois Dagenais 

> ---
> drivers/uio/Makefile |   2 +-
> drivers/uio/uio.c| 191 ++
> drivers/uio/uio_dmabuf.c | 210 ---
> 3 files changed, 192 insertions(+), 211 deletions(-)
> delete mode 100644 drivers/uio/uio_dmabuf.c
> 
> diff --git a/drivers/uio/Makefile b/drivers/uio/Makefile
> index 7af888a..aea3e17 100644
> --- a/drivers/uio/Makefile
> +++ b/drivers/uio/Makefile
> @@ -1,5 +1,5 @@
> # SPDX-License-Identifier: GPL-2.0
> -obj-$(CONFIG_UIO)+= uio.o uio_dmabuf.o
> +obj-$(CONFIG_UIO)+= uio.o
> obj-$(CONFIG_UIO_CIF) += uio_cif.o
> obj-$(CONFIG_UIO_PDRV_GENIRQ) += uio_pdrv_genirq.o
> obj-$(CONFIG_UIO_DMEM_GENIRQ) += uio_dmem_genirq.o
> diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
> index e054fa7..175fb6b 100644
> --- a/drivers/uio/uio.c
> +++ b/drivers/uio/uio.c
> @@ -26,6 +26,7 @@
> #include 
> #include 
> #include 
> +#include 
> 
> #include 
> 
> @@ -455,6 +456,196 @@ static irqreturn_t uio_interrupt(int irq, void *dev_id)
>   return ret;
> }

Would it be better to put all this dmabuf inside a
#ifdef CONFIG_DMA_SHARED_BUFFER
maybe? (Or IS_REACHABLE(CONFIG_DMA_SHARED_BUFFER), not sure which formulation 
works for all cases...)

> 
> +struct uio_dmabuf_mem {
> + int dbuf_fd;
> + struct dma_buf *dbuf;
> + struct dma_buf_attachment *dbuf_attach;
> + struct sg_table *sgt;
> + enum dma_data_direction dir;
> + struct list_head list;
> +};
> +
> +long uio_dmabuf_map(struct uio_device *dev, struct list_head *dbufs,
> + struct mutex *dbufs_lock, void __user *user_args)
> +{
> + struct uio_dmabuf_args args;
> + struct uio_dmabuf_mem *dbuf_mem;
> + struct dma_buf *dbuf;
> + struct dma_buf_attachment *dbuf_attach;
> + enum dma_data_direction dir;
> + struct sg_table *sgt;
> + long ret;
> +
> + if (copy_from_user(, user_args, sizeof(args))) {
> + ret = -EFAULT;
> + dev_err(dev->dev.parent, "failed to copy from user\n");
> + goto err;
> + }
> +
> + dbuf = dma_buf_get(args.dbuf_fd);
> + if (IS_ERR(dbuf)) {
> + dev_err(dev->dev.parent, "failed to get dmabuf\n");
> + return PTR_ERR(dbuf);
> + }
> +
> + dbuf_attach = dma_buf_attach(dbuf, dev->dev.parent);
> + if (IS_ERR(dbuf_attach)) {
> + dev_err(dev->dev.parent, "failed to attach dmabuf\n");
> + ret = PTR_ERR(dbuf_attach);
> + goto err_put;
> + }
> +
> [...]

-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx