diff options
185 files changed, 4535 insertions, 2164 deletions
diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 00000000..6a61ba3b --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,34 @@ +# Maintainers, Mailing list, Patches + +Please send any patches, pull requests, comments or questions for this layer to +the [meta-xilinx mailing list](https://lists.yoctoproject.org/g/meta-xilinx): + + meta-xilinx@lists.yoctoproject.org + +When sending patches, please make sure the email subject line includes +"[meta-xilinx][PATCH]" and cc'ing the maintainers. + +For more details follow the OE community patch submission guidelines, as described in: + +https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines +https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded + +`git send-email --subject-prefix 'meta-xilinx][PATCH' --to meta-xilinx@yoctoproject.org` + +**Maintainers:** + + Mark Hatle <mark.hatle@amd.com> + Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com> + John Toomey <john.toomey@amd.com> + +> **Note:** + +* meta-xilinx-contrib layer: + * We don't have any maintainers when user submit a patch to this layer + email meta-xilinx@yoctoproject.org and cc'ing below reviewers. + +**Reviewers:** + + Mark Hatle <mark.hatle@xilinx.com> + Sandeep Gundlupet Raju <sandeep.gundlupet-raju@xilinx.com> + John Toomey <john.toomey@xilinx.com> diff --git a/meta-xilinx-bsp/README.booting.md b/README.booting.md index dc48f6b2..dc48f6b2 100644 --- a/meta-xilinx-bsp/README.booting.md +++ b/README.booting.md diff --git a/meta-microblaze/README.md b/meta-microblaze/README.md index 9e7ea2c6..acf6c253 100644 --- a/meta-microblaze/README.md +++ b/meta-microblaze/README.md @@ -1,24 +1,8 @@ -meta-microblaze -=============== +# meta-microblaze This layer provides support specific to the MicroBlaze architecture - -Maintainers, Mailing list, Patches -================================== - -Please send any patches, pull requests, comments or questions for this layer to -the [meta-xilinx mailing list](https://lists.yoctoproject.org/listinfo/meta-xilinx): - - meta-xilinx@lists.yoctoproject.org - -Maintainers: - - Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> - Mark Hatle <mark.hatle@xilinx.com> - -Dependencies -============ +## Dependencies This layer depends on: @@ -26,3 +10,8 @@ This layer depends on: URI: git://git.openembedded.org/openembedded-core layers: meta + branch: master or xilinx current release version (e.g. hosister) + + URI: git://git.yoctoproject.org/meta-xilinx.git + layers: meta-xilinx-core + branch: master or xilinx current release version (e.g. hosister) diff --git a/meta-microblaze/recipes-devtools/gdb/gdb-microblaze.inc b/meta-microblaze/recipes-devtools/gdb/gdb-microblaze.inc index dddbaf82..1df17062 100644 --- a/meta-microblaze/recipes-devtools/gdb/gdb-microblaze.inc +++ b/meta-microblaze/recipes-devtools/gdb/gdb-microblaze.inc @@ -5,14 +5,15 @@ LTTNGUST:microblaze = "" FILESEXTRAPATHS:append := ":${THISDIR}/gdb" SRC_URI:append:microblaze = " \ - file://0001-Add-initial-port-of-linux-gdbserver.patch \ + file://0001-Patch-MicroBlaze.patch \ file://0002-Initial-port-of-core-reading-support.patch \ file://0003-Fix-debug-message-when-register-is-unavailable.patch \ file://0004-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch \ - file://0005-Initial-support-for-native-gdb.patch \ - file://0006-Fixing-the-issues-related-to-GDB-7.12.patch \ + file://0005-Fixing-the-issues-related-to-GDB-7.12.patch \ + file://0006-Patch-MicroBlaze-MicroBlaze-native-gdb-port.patch \ file://0007-Patch-microblaze-Adding-64-bit-MB-support.patch \ - file://0008-gdb-Fix-microblaze-target-compilation-3.patch \ - file://0009-Patch-MicroBlaze-these-changes-will-make-64-bit-vect.patch \ - file://0010-Patch-MicroBlaze-Added-m64-abi-for-64-bit-target-des.patch \ + file://0008-Patch-MicroBlaze-these-changes-will-make-64-bit-vect.patch \ + file://0009-Patch-MicroBlaze-Added-m64-abi-for-64-bit-target-des.patch \ + file://0010-Patch-MicroBlaze-Code-changes-for-gdbserver.patch \ + file://0011-Patch-Microblaze-Depth-Total-number.patch \ " diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0001-Add-initial-port-of-linux-gdbserver.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0001-Patch-MicroBlaze.patch index bc1c1a93..b5a2726b 100644 --- a/meta-microblaze/recipes-devtools/gdb/gdb/0001-Add-initial-port-of-linux-gdbserver.patch +++ b/meta-microblaze/recipes-devtools/gdb/gdb/0001-Patch-MicroBlaze.patch @@ -1,8 +1,8 @@ -From 699248a2fc4b9334f5042e1657116ac6b67b7321 Mon Sep 17 00:00:00 2001 +From b7b3c1eb19b770b2d700dd3c9fa23a7ae225a72b Mon Sep 17 00:00:00 2001 From: Mahesh Bodapati <mbodapat@xilinx.com> -Date: Mon, 23 Jan 2017 19:07:44 +0530 -Subject: [PATCH 01/10] Add initial port of linux gdbserver add - gdb_proc_service_h to gdbserver microblaze-linux +Date: Thu, 16 Jun 2022 09:50:14 +0530 +Subject: [PATCH 01/10] [Patch,MicroBlaze] : Add initial port of linux + gdbserver add gdb_proc_service_h to gdbserver microblaze-linux gdbserver needs to initialise the microblaze registers @@ -451,7 +451,7 @@ index 00000000000..bd8a4384424 +32:slr +32:shr diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in -index 2bd3a578932..7bee1f1894e 100644 +index 2bd3a578932..46b5a0c7c60 100644 --- a/gdbserver/Makefile.in +++ b/gdbserver/Makefile.in @@ -184,7 +184,8 @@ SFILES = \ @@ -468,7 +468,7 @@ index 2bd3a578932..7bee1f1894e 100644 $(srcdir)/../gdb/nat/linux-namespaces.c \ $(srcdir)/../gdb/nat/linux-osdata.c \ $(srcdir)/../gdb/nat/linux-personality.c \ -+ $(srcdir)/../gdb/nat/microblaze-linux.c \ ++ $(srcdir)/../gdb/nat/microblaze-linux.c \ $(srcdir)/../gdb/nat/mips-linux-watch.c \ $(srcdir)/../gdb/nat/ppc-linux.c \ $(srcdir)/../gdb/nat/riscv-linux-tdesc.c \ diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0002-Initial-port-of-core-reading-support.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0002-Initial-port-of-core-reading-support.patch index d49a7fe6..352ed92e 100644 --- a/meta-microblaze/recipes-devtools/gdb/gdb/0002-Initial-port-of-core-reading-support.patch +++ b/meta-microblaze/recipes-devtools/gdb/gdb/0002-Initial-port-of-core-reading-support.patch @@ -1,4 +1,4 @@ -From eae6f2fc7324729056f4bd3bfa66c0c5887d7b94 Mon Sep 17 00:00:00 2001 +From da36639f95d23083088a27c27f631d304ae316f1 Mon Sep 17 00:00:00 2001 From: Mahesh Bodapati <mbodapat@xilinx.com> Date: Tue, 24 Jan 2017 14:55:56 +0530 Subject: [PATCH 02/10] Initial port of core reading support Added support for diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0003-Fix-debug-message-when-register-is-unavailable.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0003-Fix-debug-message-when-register-is-unavailable.patch index 68d90f27..255bb9b5 100644 --- a/meta-microblaze/recipes-devtools/gdb/gdb/0003-Fix-debug-message-when-register-is-unavailable.patch +++ b/meta-microblaze/recipes-devtools/gdb/gdb/0003-Fix-debug-message-when-register-is-unavailable.patch @@ -1,4 +1,4 @@ -From 80c56ef8463c23f51759f5c64ce0165e259a4071 Mon Sep 17 00:00:00 2001 +From da93f5715ff333ac4807b73fe678dde21fb3bd6c Mon Sep 17 00:00:00 2001 From: Nathan Rossi <nathan.rossi@petalogix.com> Date: Tue, 8 May 2012 18:11:17 +1000 Subject: [PATCH 03/10] Fix debug message when register is unavailable diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0004-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0004-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch index e63a696d..f1555b8a 100644 --- a/meta-microblaze/recipes-devtools/gdb/gdb/0004-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch +++ b/meta-microblaze/recipes-devtools/gdb/gdb/0004-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch @@ -1,4 +1,4 @@ -From 7d970a0c616063a5095ce3725efed0feb40ceb30 Mon Sep 17 00:00:00 2001 +From 82ee589db2c1191fb274f4a76e217df318f8d6b2 Mon Sep 17 00:00:00 2001 From: David Holsgrove <david.holsgrove@xilinx.com> Date: Mon, 16 Dec 2013 16:37:32 +1000 Subject: [PATCH 04/10] microblaze: Add build_gdbserver=yes to top level diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0006-Fixing-the-issues-related-to-GDB-7.12.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0005-Fixing-the-issues-related-to-GDB-7.12.patch index eb1efa71..48e203a9 100644 --- a/meta-microblaze/recipes-devtools/gdb/gdb/0006-Fixing-the-issues-related-to-GDB-7.12.patch +++ b/meta-microblaze/recipes-devtools/gdb/gdb/0005-Fixing-the-issues-related-to-GDB-7.12.patch @@ -1,34 +1,19 @@ -From 41b0d54fa00ce765e9a2ce09136938b72b2b96d7 Mon Sep 17 00:00:00 2001 +From ca1158d19ab9879167ca9fbe2fdf8d19094cc53f Mon Sep 17 00:00:00 2001 From: Nagaraju Mekala <nmekala@xilix.com> Date: Fri, 17 Feb 2017 14:09:40 +0530 -Subject: [PATCH 06/10] Fixing the issues related to GDB-7.12 +Subject: [PATCH 05/10] Fixing the issues related to GDB-7.12 added all the required function which are new in 7.12 and removed few deprecated functions from 7.6 + +Conflicts: + gdb/config/microblaze/linux.mh --- - gdb/config/microblaze/linux.mh | 4 +- gdb/gdbserver/linux-microblaze-low.c | 97 ++++++++++++++++++++++++---- gdb/microblaze-tdep.h | 1 + gdbserver/configure.srv | 3 +- - 4 files changed, 89 insertions(+), 16 deletions(-) + 3 files changed, 86 insertions(+), 15 deletions(-) -diff --git a/gdb/config/microblaze/linux.mh b/gdb/config/microblaze/linux.mh -index a4eaf540e1d..74a53b854a4 100644 ---- a/gdb/config/microblaze/linux.mh -+++ b/gdb/config/microblaze/linux.mh -@@ -1,9 +1,11 @@ - # Host: Microblaze, running Linux - -+#linux-nat.o linux-waitpid.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o - NAT_FILE= config/nm-linux.h - NATDEPFILES= inf-ptrace.o fork-child.o \ - microblaze-linux-nat.o proc-service.o linux-thread-db.o \ -- linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o -+ linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \ -+ linux-waitpid.o linux-personality.o linux-namespaces.o - NAT_CDEPS = $(srcdir)/proc-service.list - - LOADLIBES = -ldl $(RDYNAMIC) diff --git a/gdb/gdbserver/linux-microblaze-low.c b/gdb/gdbserver/linux-microblaze-low.c index cba5d6fc585..a2733f3c21c 100644 --- a/gdb/gdbserver/linux-microblaze-low.c diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0005-Initial-support-for-native-gdb.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0005-Initial-support-for-native-gdb.patch deleted file mode 100644 index 3482bcd8..00000000 --- a/meta-microblaze/recipes-devtools/gdb/gdb/0005-Initial-support-for-native-gdb.patch +++ /dev/null @@ -1,492 +0,0 @@ -From bac086097dfa813fcc0b978dc32eb9ae469bf4a8 Mon Sep 17 00:00:00 2001 -From: David Holsgrove <david.holsgrove@petalogix.com> -Date: Fri, 20 Jul 2012 15:18:35 +1000 -Subject: [PATCH 05/10] Initial support for native gdb - -microblaze: Follow PPC method of getting setting registers -using PTRACE PEEK/POKE - -Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com> ---- - gdb/Makefile.in | 2 + - gdb/config/microblaze/linux.mh | 9 + - gdb/microblaze-linux-nat.c | 431 +++++++++++++++++++++++++++++++++ - 3 files changed, 442 insertions(+) - create mode 100644 gdb/config/microblaze/linux.mh - create mode 100644 gdb/microblaze-linux-nat.c - -diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index ec371fc7e52..2e8d4cfe82e 100644 ---- a/gdb/Makefile.in -+++ b/gdb/Makefile.in -@@ -1336,6 +1336,7 @@ HFILES_NO_SRCDIR = \ - memory-map.h \ - memrange.h \ - microblaze-tdep.h \ -+ microblaze-linux-tdep.h \ - mips-linux-tdep.h \ - mips-nbsd-tdep.h \ - mips-tdep.h \ -@@ -2216,6 +2217,7 @@ ALLDEPFILES = \ - m68k-tdep.c \ - microblaze-linux-tdep.c \ - microblaze-tdep.c \ -+ microblaze-linux-nat.c \ - mingw-hdep.c \ - mips-fbsd-nat.c \ - mips-fbsd-tdep.c \ -diff --git a/gdb/config/microblaze/linux.mh b/gdb/config/microblaze/linux.mh -new file mode 100644 -index 00000000000..a4eaf540e1d ---- /dev/null -+++ b/gdb/config/microblaze/linux.mh -@@ -0,0 +1,9 @@ -+# Host: Microblaze, running Linux -+ -+NAT_FILE= config/nm-linux.h -+NATDEPFILES= inf-ptrace.o fork-child.o \ -+ microblaze-linux-nat.o proc-service.o linux-thread-db.o \ -+ linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o -+NAT_CDEPS = $(srcdir)/proc-service.list -+ -+LOADLIBES = -ldl $(RDYNAMIC) -diff --git a/gdb/microblaze-linux-nat.c b/gdb/microblaze-linux-nat.c -new file mode 100644 -index 00000000000..e9b8c9c5221 ---- /dev/null -+++ b/gdb/microblaze-linux-nat.c -@@ -0,0 +1,431 @@ -+/* Microblaze GNU/Linux native support. -+ -+ Copyright (C) 1988-1989, 1991-1992, 1994, 1996, 2000-2012 Free -+ Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -+ -+#include "defs.h" -+#include "arch-utils.h" -+#include "dis-asm.h" -+#include "frame.h" -+#include "trad-frame.h" -+#include "symtab.h" -+#include "value.h" -+#include "gdbcmd.h" -+#include "breakpoint.h" -+#include "inferior.h" -+#include "regcache.h" -+#include "target.h" -+#include "frame.h" -+#include "frame-base.h" -+#include "frame-unwind.h" -+#include "dwarf2-frame.h" -+#include "osabi.h" -+ -+#include "gdb_assert.h" -+#include "gdb_string.h" -+#include "target-descriptions.h" -+#include "opcodes/microblaze-opcm.h" -+#include "opcodes/microblaze-dis.h" -+ -+#include "linux-nat.h" -+#include "target-descriptions.h" -+ -+#include <sys/user.h> -+#include <sys/utsname.h> -+#include <sys/procfs.h> -+#include <sys/ptrace.h> -+ -+/* Prototypes for supply_gregset etc. */ -+#include "gregset.h" -+ -+#include "microblaze-tdep.h" -+ -+#include <elf/common.h> -+#include "auxv.h" -+ -+/* Defines ps_err_e, struct ps_prochandle. */ -+#include "gdb_proc_service.h" -+ -+/* On GNU/Linux, threads are implemented as pseudo-processes, in which -+ case we may be tracing more than one process at a time. In that -+ case, inferior_ptid will contain the main process ID and the -+ individual thread (process) ID. get_thread_id () is used to get -+ the thread id if it's available, and the process id otherwise. */ -+ -+int -+get_thread_id (ptid_t ptid) -+{ -+ int tid = TIDGET (ptid); -+ if (0 == tid) -+ tid = PIDGET (ptid); -+ return tid; -+} -+ -+#define GET_THREAD_ID(PTID) get_thread_id (PTID) -+ -+/* Non-zero if our kernel may support the PTRACE_GETREGS and -+ PTRACE_SETREGS requests, for reading and writing the -+ general-purpose registers. Zero if we've tried one of -+ them and gotten an error. */ -+int have_ptrace_getsetregs = 1; -+ -+static int -+microblaze_register_u_addr (struct gdbarch *gdbarch, int regno) -+{ -+ int u_addr = -1; -+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -+ /* NOTE: cagney/2003-11-25: This is the word size used by the ptrace -+ interface, and not the wordsize of the program's ABI. */ -+ int wordsize = sizeof (long); -+ -+ /* General purpose registers occupy 1 slot each in the buffer. */ -+ if (regno >= MICROBLAZE_R0_REGNUM -+ && regno <= MICROBLAZE_FSR_REGNUM) -+ u_addr = (regno * wordsize); -+ -+ return u_addr; -+} -+ -+ -+static void -+fetch_register (struct regcache *regcache, int tid, int regno) -+{ -+ struct gdbarch *gdbarch = get_regcache_arch (regcache); -+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -+ /* This isn't really an address. But ptrace thinks of it as one. */ -+ CORE_ADDR regaddr = microblaze_register_u_addr (gdbarch, regno); -+ int bytes_transferred; -+ unsigned int offset; /* Offset of registers within the u area. */ -+ char buf[MAX_REGISTER_SIZE]; -+ -+ if (regaddr == -1) -+ { -+ memset (buf, '\0', register_size (gdbarch, regno)); /* Supply zeroes */ -+ regcache_raw_supply (regcache, regno, buf); -+ return; -+ } -+ -+ /* Read the raw register using sizeof(long) sized chunks. On a -+ 32-bit platform, 64-bit floating-point registers will require two -+ transfers. */ -+ for (bytes_transferred = 0; -+ bytes_transferred < register_size (gdbarch, regno); -+ bytes_transferred += sizeof (long)) -+ { -+ long l; -+ -+ errno = 0; -+ l = ptrace (PTRACE_PEEKUSER, tid, (PTRACE_TYPE_ARG3) regaddr, 0); -+ regaddr += sizeof (long); -+ if (errno != 0) -+ { -+ char message[128]; -+ sprintf (message, "reading register %s (#%d)", -+ gdbarch_register_name (gdbarch, regno), regno); -+ perror_with_name (message); -+ } -+ memcpy (&buf[bytes_transferred], &l, sizeof (l)); -+ } -+ -+ /* Now supply the register. Keep in mind that the regcache's idea -+ of the register's size may not be a multiple of sizeof -+ (long). */ -+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE) -+ { -+ /* Little-endian values are always found at the left end of the -+ bytes transferred. */ -+ regcache_raw_supply (regcache, regno, buf); -+ } -+ else if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) -+ { -+ /* Big-endian values are found at the right end of the bytes -+ transferred. */ -+ size_t padding = (bytes_transferred - register_size (gdbarch, regno)); -+ regcache_raw_supply (regcache, regno, buf + padding); -+ } -+ else -+ internal_error (__FILE__, __LINE__, -+ _("fetch_register: unexpected byte order: %d"), -+ gdbarch_byte_order (gdbarch)); -+} -+ -+/* This function actually issues the request to ptrace, telling -+ it to get all general-purpose registers and put them into the -+ specified regset. -+ -+ If the ptrace request does not exist, this function returns 0 -+ and properly sets the have_ptrace_* flag. If the request fails, -+ this function calls perror_with_name. Otherwise, if the request -+ succeeds, then the regcache gets filled and 1 is returned. */ -+static int -+fetch_all_gp_regs (struct regcache *regcache, int tid) -+{ -+ struct gdbarch *gdbarch = get_regcache_arch (regcache); -+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -+ gdb_gregset_t gregset; -+ -+ if (ptrace (PTRACE_GETREGS, tid, 0, (void *) &gregset) < 0) -+ { -+ if (errno == EIO) -+ { -+ have_ptrace_getsetregs = 0; -+ return 0; -+ } -+ perror_with_name (_("Couldn't get general-purpose registers.")); -+ } -+ -+ supply_gregset (regcache, (const gdb_gregset_t *) &gregset); -+ -+ return 1; -+} -+ -+ -+/* This is a wrapper for the fetch_all_gp_regs function. It is -+ responsible for verifying if this target has the ptrace request -+ that can be used to fetch all general-purpose registers at one -+ shot. If it doesn't, then we should fetch them using the -+ old-fashioned way, which is to iterate over the registers and -+ request them one by one. */ -+static void -+fetch_gp_regs (struct regcache *regcache, int tid) -+{ -+ struct gdbarch *gdbarch = get_regcache_arch (regcache); -+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -+ int i; -+ -+ if (have_ptrace_getsetregs) -+ if (fetch_all_gp_regs (regcache, tid)) -+ return; -+ -+ /* If we've hit this point, it doesn't really matter which -+ architecture we are using. We just need to read the -+ registers in the "old-fashioned way". */ -+ for (i = MICROBLAZE_R0_REGNUM; i <= MICROBLAZE_FSR_REGNUM; i++) -+ fetch_register (regcache, tid, i); -+} -+ -+ -+static void -+store_register (const struct regcache *regcache, int tid, int regno) -+{ -+ struct gdbarch *gdbarch = get_regcache_arch (regcache); -+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -+ /* This isn't really an address. But ptrace thinks of it as one. */ -+ CORE_ADDR regaddr = microblaze_register_u_addr (gdbarch, regno); -+ int i; -+ size_t bytes_to_transfer; -+ char buf[MAX_REGISTER_SIZE]; -+ -+ if (regaddr == -1) -+ return; -+ -+ /* First collect the register. Keep in mind that the regcache's -+ idea of the register's size may not be a multiple of sizeof -+ (long). */ -+ memset (buf, 0, sizeof buf); -+ bytes_to_transfer = align_up (register_size (gdbarch, regno), sizeof (long)); -+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE) -+ { -+ /* Little-endian values always sit at the left end of the buffer. */ -+ regcache_raw_collect (regcache, regno, buf); -+ } -+ else if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) -+ { -+ /* Big-endian values sit at the right end of the buffer. */ -+ size_t padding = (bytes_to_transfer - register_size (gdbarch, regno)); -+ regcache_raw_collect (regcache, regno, buf + padding); -+ } -+ -+ for (i = 0; i < bytes_to_transfer; i += sizeof (long)) -+ { -+ long l; -+ -+ memcpy (&l, &buf[i], sizeof (l)); -+ errno = 0; -+ ptrace (PTRACE_POKEUSER, tid, (PTRACE_TYPE_ARG3) regaddr, l); -+ regaddr += sizeof (long); -+ -+ if (errno != 0) -+ { -+ char message[128]; -+ sprintf (message, "writing register %s (#%d)", -+ gdbarch_register_name (gdbarch, regno), regno); -+ perror_with_name (message); -+ } -+ } -+} -+ -+/* This function actually issues the request to ptrace, telling -+ it to store all general-purpose registers present in the specified -+ regset. -+ -+ If the ptrace request does not exist, this function returns 0 -+ and properly sets the have_ptrace_* flag. If the request fails, -+ this function calls perror_with_name. Otherwise, if the request -+ succeeds, then the regcache is stored and 1 is returned. */ -+static int -+store_all_gp_regs (const struct regcache *regcache, int tid, int regno) -+{ -+ struct gdbarch *gdbarch = get_regcache_arch (regcache); -+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -+ gdb_gregset_t gregset; -+ -+ if (ptrace (PTRACE_GETREGS, tid, 0, (void *) &gregset) < 0) -+ { -+ if (errno == EIO) -+ { -+ have_ptrace_getsetregs = 0; -+ return 0; -+ } -+ perror_with_name (_("Couldn't get general-purpose registers.")); -+ } -+ -+ fill_gregset (regcache, &gregset, regno); -+ -+ if (ptrace (PTRACE_SETREGS, tid, 0, (void *) &gregset) < 0) -+ { -+ if (errno == EIO) -+ { -+ have_ptrace_getsetregs = 0; -+ return 0; -+ } -+ perror_with_name (_("Couldn't set general-purpose registers.")); -+ } -+ -+ return 1; -+} -+ -+/* This is a wrapper for the store_all_gp_regs function. It is -+ responsible for verifying if this target has the ptrace request -+ that can be used to store all general-purpose registers at one -+ shot. If it doesn't, then we should store them using the -+ old-fashioned way, which is to iterate over the registers and -+ store them one by one. */ -+static void -+store_gp_regs (const struct regcache *regcache, int tid, int regno) -+{ -+ struct gdbarch *gdbarch = get_regcache_arch (regcache); -+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -+ int i; -+ -+ if (have_ptrace_getsetregs) -+ if (store_all_gp_regs (regcache, tid, regno)) -+ return; -+ -+ /* If we hit this point, it doesn't really matter which -+ architecture we are using. We just need to store the -+ registers in the "old-fashioned way". */ -+ for (i = MICROBLAZE_R0_REGNUM; i <= MICROBLAZE_FSR_REGNUM; i++) -+ store_register (regcache, tid, i); -+} -+ -+ -+/* Fetch registers from the child process. Fetch all registers if -+ regno == -1, otherwise fetch all general registers or all floating -+ point registers depending upon the value of regno. */ -+ -+static void -+microblaze_linux_fetch_inferior_registers (struct target_ops *ops, -+ struct regcache *regcache, int regno) -+{ -+ /* Get the thread id for the ptrace call. */ -+ int tid = GET_THREAD_ID (inferior_ptid); -+ -+ if (regno == -1) -+ fetch_gp_regs (regcache, tid); -+ else -+ fetch_register (regcache, tid, regno); -+} -+ -+/* Store registers back into the inferior. Store all registers if -+ regno == -1, otherwise store all general registers or all floating -+ point registers depending upon the value of regno. */ -+ -+static void -+microblaze_linux_store_inferior_registers (struct target_ops *ops, -+ struct regcache *regcache, int regno) -+{ -+ /* Get the thread id for the ptrace call. */ -+ int tid = GET_THREAD_ID (inferior_ptid); -+ -+ if (regno >= 0) -+ store_register (regcache, tid, regno); -+ else -+ store_gp_regs (regcache, tid, -1); -+} -+ -+/* Wrapper functions for the standard regset handling, used by -+ thread debugging. */ -+ -+void -+fill_gregset (const struct regcache *regcache, -+ gdb_gregset_t *gregsetp, int regno) -+{ -+ microblaze_collect_gregset (NULL, regcache, regno, gregsetp); -+} -+ -+void -+supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp) -+{ -+ microblaze_supply_gregset (NULL, regcache, -1, gregsetp); -+} -+ -+void -+fill_fpregset (const struct regcache *regcache, -+ gdb_fpregset_t *fpregsetp, int regno) -+{ -+ /* FIXME. */ -+} -+ -+void -+supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp) -+{ -+ /* FIXME. */ -+} -+ -+static const struct target_desc * -+microblaze_linux_read_description (struct target_ops *ops) -+{ -+ CORE_ADDR microblaze_hwcap = 0; -+ -+ if (target_auxv_search (ops, AT_HWCAP, µblaze_hwcap) != 1) -+ return NULL; -+ -+ return NULL; -+} -+ -+ -+void _initialize_microblaze_linux_nat (void); -+ -+void -+_initialize_microblaze_linux_nat (void) -+{ -+ struct target_ops *t; -+ -+ /* Fill in the generic GNU/Linux methods. */ -+ t = linux_target (); -+ -+ /* Add our register access methods. */ -+ t->to_fetch_registers = microblaze_linux_fetch_inferior_registers; -+ t->to_store_registers = microblaze_linux_store_inferior_registers; -+ -+ t->to_read_description = microblaze_linux_read_description; -+ -+ /* Register the target. */ -+ linux_nat_add_target (t); -+} --- -2.17.1 - diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0006-Patch-MicroBlaze-MicroBlaze-native-gdb-port.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0006-Patch-MicroBlaze-MicroBlaze-native-gdb-port.patch new file mode 100644 index 00000000..9498e8f7 --- /dev/null +++ b/meta-microblaze/recipes-devtools/gdb/gdb/0006-Patch-MicroBlaze-MicroBlaze-native-gdb-port.patch @@ -0,0 +1,831 @@ +From b37df6ced77898e8cb7e1c343af005d5bfe1272f Mon Sep 17 00:00:00 2001 +From: Mahesh Bodapati <mbodapat@xilinx.com> +Date: Wed, 15 Jun 2022 10:29:09 +0530 +Subject: [PATCH 06/10] [Patch,MicroBlaze] : MicroBlaze native gdb port. + +--- + gdb/Makefile.in | 2 + + gdb/configure.nat | 4 + + gdb/features/microblaze-linux.c | 79 +++++++ + gdb/microblaze-linux-nat.c | 366 ++++++++++++++++++++++++++++++++ + gdb/microblaze-linux-tdep.c | 2 + + gdb/microblaze-linux-tdep.h | 24 +++ + gdb/microblaze-tdep.c | 151 ++++++++++++- + gdb/microblaze-tdep.h | 15 +- + 8 files changed, 629 insertions(+), 14 deletions(-) + create mode 100755 gdb/features/microblaze-linux.c + create mode 100755 gdb/microblaze-linux-nat.c + create mode 100644 gdb/microblaze-linux-tdep.h + +diff --git a/gdb/Makefile.in b/gdb/Makefile.in +index ec371fc7e52..0449b8e4c2b 100644 +--- a/gdb/Makefile.in ++++ b/gdb/Makefile.in +@@ -1336,6 +1336,7 @@ HFILES_NO_SRCDIR = \ + memory-map.h \ + memrange.h \ + microblaze-tdep.h \ ++ microblaze-linux-tdep.h \ + mips-linux-tdep.h \ + mips-nbsd-tdep.h \ + mips-tdep.h \ +@@ -2214,6 +2215,7 @@ ALLDEPFILES = \ + m68k-linux-nat.c \ + m68k-linux-tdep.c \ + m68k-tdep.c \ ++ microblaze-linux-nat.c \ + microblaze-linux-tdep.c \ + microblaze-tdep.c \ + mingw-hdep.c \ +diff --git a/gdb/configure.nat b/gdb/configure.nat +index bb70e303384..53f19a3d263 100644 +--- a/gdb/configure.nat ++++ b/gdb/configure.nat +@@ -261,6 +261,10 @@ case ${gdb_host} in + # Host: Motorola m68k running GNU/Linux. + NATDEPFILES="${NATDEPFILES} m68k-linux-nat.o" + ;; ++ microblaze) ++ # Host: Microblaze running GNU/Linux. ++ NATDEPFILES="${NATDEPFILES} microblaze-linux-nat.o" ++ ;; + mips) + # Host: Linux/MIPS + NATDEPFILES="${NATDEPFILES} linux-nat-trad.o \ +diff --git a/gdb/features/microblaze-linux.c b/gdb/features/microblaze-linux.c +new file mode 100755 +index 00000000000..29f681bf2ac +--- /dev/null ++++ b/gdb/features/microblaze-linux.c +@@ -0,0 +1,79 @@ ++/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro: ++ Original: microblaze.xml */ ++ ++#include "defs.h" ++#include "osabi.h" ++#include "target-descriptions.h" ++ ++struct target_desc *tdesc_microblaze_linux; ++static void ++initialize_tdesc_microblaze_linux (void) ++{ ++ struct target_desc *result = allocate_target_description (); ++ struct tdesc_feature *feature; ++ set_tdesc_architecture (result, bfd_scan_arch ("microblaze")); ++ set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux")); ++ ++ feature = tdesc_create_feature (result, "org.gnu.gdb.microblaze.core"); ++ tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r24", 24, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r25", 25, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r26", 26, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r27", 27, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r28", 28, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpc", 32, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rmsr", 33, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rear", 34, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "resr", 35, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rfsr", 36, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rbtr", 37, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpvr0", 38, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpvr1", 39, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpvr2", 40, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpvr3", 41, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpvr4", 42, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpvr5", 43, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpvr6", 44, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpvr7", 45, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpvr8", 46, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpvr9", 47, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpvr10", 48, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpvr11", 49, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "redr", 50, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rpid", 51, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rzpr", 52, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rtlbx", 53, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rtlbsx", 54, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rtlblo", 55, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "rtlbhi", 56, 1, NULL, 32, "int"); ++ tdesc_create_reg (feature, "slr", 57, 1, NULL, 64, "uint64"); ++ tdesc_create_reg (feature, "shr", 58, 1, NULL, 64, "uint64"); ++ ++ tdesc_microblaze_linux = result; ++} +diff --git a/gdb/microblaze-linux-nat.c b/gdb/microblaze-linux-nat.c +new file mode 100755 +index 00000000000..6b9daa23120 +--- /dev/null ++++ b/gdb/microblaze-linux-nat.c +@@ -0,0 +1,366 @@ ++/* Native-dependent code for GNU/Linux MicroBlaze.
++ Copyright (C) 2021 Free Software Foundation, Inc.
++
++ This file is part of GDB.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++#include "defs.h"
++#include "arch-utils.h"
++#include "dis-asm.h"
++#include "frame.h"
++#include "trad-frame.h"
++#include "symtab.h"
++#include "value.h"
++#include "gdbcmd.h"
++#include "breakpoint.h"
++#include "inferior.h"
++#include "gdbthread.h"
++#include "gdbcore.h"
++#include "regcache.h"
++#include "regset.h"
++#include "target.h"
++#include "frame.h"
++#include "frame-base.h"
++#include "frame-unwind.h"
++#include "osabi.h"
++#include "gdbsupport/gdb_assert.h"
++#include <string.h>
++#include "target-descriptions.h"
++#include "opcodes/microblaze-opcm.h"
++#include "opcodes/microblaze-dis.h"
++#include "gregset.h"
++
++#include "linux-nat.h"
++#include "linux-tdep.h"
++#include "target-descriptions.h"
++
++#include <sys/user.h>
++#include <sys/ioctl.h>
++#include <sys/uio.h>
++#include "gdbsupport/gdb_wait.h"
++#include <fcntl.h>
++#include <sys/procfs.h>
++#include "nat/gdb_ptrace.h"
++#include "nat/linux-ptrace.h"
++#include "inf-ptrace.h"
++#include <algorithm>
++#include <unordered_map>
++#include <list>
++#include <sys/ptrace.h>
++
++/* Prototypes for supply_gregset etc. */
++#include "gregset.h"
++
++#include "microblaze-tdep.h"
++#include "microblaze-linux-tdep.h"
++#include "inferior.h"
++
++#include "elf/common.h"
++
++#include "auxv.h"
++#include "linux-tdep.h"
++
++#include <sys/ptrace.h>
++
++
++//int have_ptrace_getsetregs=1;
++
++/* MicroBlaze Linux native additions to the default linux support. */
++
++class microblaze_linux_nat_target final : public linux_nat_target
++{
++public:
++ /* Add our register access methods. */
++ void fetch_registers (struct regcache *regcache, int regnum) override;
++ void store_registers (struct regcache *regcache, int regnum) override;
++
++ /* Read suitable target description. */
++ const struct target_desc *read_description () override;
++};
++
++static microblaze_linux_nat_target the_microblaze_linux_nat_target;
++
++static int
++microblaze_register_u_addr (struct gdbarch *gdbarch, int regno)
++{
++ int u_addr = -1;
++ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
++ /* NOTE: cagney/2003-11-25: This is the word size used by the ptrace
++ * interface, and not the wordsize of the program's ABI. */
++ int wordsize = sizeof (long);
++
++ /* General purpose registers occupy 1 slot each in the buffer. */
++ if (regno >= MICROBLAZE_R0_REGNUM
++ && regno <= MICROBLAZE_FSR_REGNUM)
++ u_addr = ((regno - MICROBLAZE_R0_REGNUM)* wordsize);
++
++ return u_addr;
++}
++
++/* Copy general purpose register REGNUM (or all gp regs if REGNUM == -1)
++ from regset GREGS into REGCACHE. */
++
++static void
++supply_gregset_regnum (struct regcache *regcache, const prgregset_t *gregs,
++ int regnum)
++{
++ int i;
++ const elf_greg_t *regp = *gregs;
++ /* Access all registers */
++ if (regnum == -1)
++ {
++ /* We fill the general purpose registers. */
++ for (i = MICROBLAZE_R0_REGNUM + 1; i < MICROBLAZE_FSR_REGNUM; i++)
++ regcache->raw_supply (i, regp + i);
++
++ /* Supply MICROBLAZE_PC_REGNUM from index 32. */
++ regcache->raw_supply (MICROBLAZE_PC_REGNUM, regp + 32);
++
++ /* Fill the inaccessible zero register with zero. */
++ regcache->raw_supply_zeroed (0);
++ }
++ else if (regnum == MICROBLAZE_R0_REGNUM)
++ regcache->raw_supply_zeroed (0);
++ else if (regnum == MICROBLAZE_PC_REGNUM)
++ regcache->raw_supply (MICROBLAZE_PC_REGNUM, regp + 32);
++ else if (regnum > MICROBLAZE_R0_REGNUM && regnum < MICROBLAZE_FSR_REGNUM)
++ regcache->raw_supply (regnum, regp + regnum);
++}
++
++/* Copy all general purpose registers from regset GREGS into REGCACHE. */
++
++void
++supply_gregset (struct regcache *regcache, const prgregset_t *gregs)
++{
++ supply_gregset_regnum (regcache, gregs, -1);
++}
++
++/* Copy general purpose register REGNUM (or all gp regs if REGNUM == -1)
++ from REGCACHE into regset GREGS. */
++
++void
++fill_gregset (const struct regcache *regcache, prgregset_t *gregs, int regnum)
++{
++ elf_greg_t *regp = *gregs;
++ if (regnum == -1)
++ {
++ /* We fill the general purpose registers. */
++ for (int i = MICROBLAZE_R0_REGNUM + 1; i < MICROBLAZE_FSR_REGNUM; i++)
++ regcache->raw_collect (i, regp + i);
++
++ regcache->raw_collect (MICROBLAZE_PC_REGNUM, regp + 32);
++ }
++ else if (regnum == MICROBLAZE_R0_REGNUM)
++ /* Nothing to do here. */
++ ;
++ else if (regnum > MICROBLAZE_R0_REGNUM && regnum < MICROBLAZE_FSR_REGNUM)
++ regcache->raw_collect (regnum, regp + regnum);
++ else if (regnum == MICROBLAZE_PC_REGNUM)
++ regcache->raw_collect (MICROBLAZE_PC_REGNUM, regp + 32);
++}
++
++/* Transfering floating-point registers between GDB, inferiors and cores.
++ Since MicroBlaze floating-point registers are the same as GPRs these do
++ nothing. */
++
++void
++supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregs)
++{
++}
++
++void
++fill_fpregset (const struct regcache *regcache,
++ gdb_fpregset_t *fpregs, int regno)
++{
++}
++
++
++static void
++fetch_register (struct regcache *regcache, int tid, int regno)
++{
++ struct gdbarch *gdbarch = regcache->arch ();
++ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
++ /* This isn't really an address. But ptrace thinks of it as one. */
++ CORE_ADDR regaddr = microblaze_register_u_addr (gdbarch, regno);
++ int bytes_transferred;
++ char buf[MICROBLAZE_MAX_REGISTER_SIZE];
++
++ if (regaddr == -1)
++ {
++ memset (buf, '\0', register_size (gdbarch, regno)); /* Supply zeroes */
++ regcache->raw_supply (regno, buf);
++ return;
++ }
++
++ /* Read the raw register using sizeof(long) sized chunks. On a
++ * 32-bit platform, 64-bit floating-point registers will require two
++ * transfers. */
++ for (bytes_transferred = 0;
++ bytes_transferred < register_size (gdbarch, regno);
++ bytes_transferred += sizeof (long))
++ {
++ long l;
++
++ errno = 0;
++ l = ptrace (PTRACE_PEEKUSER, tid, (PTRACE_TYPE_ARG3) regaddr, 0);
++ if (errno == EIO)
++ {
++ printf("ptrace io error\n");
++ }
++ regaddr += sizeof (long);
++ if (errno != 0)
++ {
++ char message[128];
++ sprintf (message, "reading register %s (#%d)",
++ gdbarch_register_name (gdbarch, regno), regno);
++ perror_with_name (message);
++ }
++ memcpy (&buf[bytes_transferred], &l, sizeof (l));
++ }
++
++ /* Now supply the register. Keep in mind that the regcache's idea
++ * of the register's size may not be a multiple of sizeof
++ * (long). */
++ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
++ {
++ /* Little-endian values are always found at the left end of the
++ * bytes transferred. */
++ regcache->raw_supply (regno, buf);
++ }
++ else if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
++ {
++ /* Big-endian values are found at the right end of the bytes
++ * transferred. */
++ size_t padding = (bytes_transferred - register_size (gdbarch, regno));
++ regcache->raw_supply (regno, buf + padding);
++ }
++ else
++ internal_error (__FILE__, __LINE__,
++ _("fetch_register: unexpected byte order: %d"),
++ gdbarch_byte_order (gdbarch));
++}
++
++
++/* This is a wrapper for the fetch_all_gp_regs function. It is
++ * responsible for verifying if this target has the ptrace request
++ * that can be used to fetch all general-purpose registers at one
++ * shot. If it doesn't, then we should fetch them using the
++ * old-fashioned way, which is to iterate over the registers and
++ * request them one by one. */
++static void
++fetch_gp_regs (struct regcache *regcache, int tid)
++{
++ int i;
++/* If we've hit this point, it doesn't really matter which
++ architecture we are using. We just need to read the
++ registers in the "old-fashioned way". */
++ for (i = MICROBLAZE_R0_REGNUM; i <= MICROBLAZE_FSR_REGNUM; i++)
++ fetch_register (regcache, tid, i);
++}
++
++/* Return a target description for the current target. */
++
++const struct target_desc *
++microblaze_linux_nat_target::read_description ()
++{
++ return tdesc_microblaze_linux;
++}
++
++/* Fetch REGNUM (or all registers if REGNUM == -1) from the target
++ into REGCACHE using PTRACE_GETREGSET. */
++
++void
++microblaze_linux_nat_target::fetch_registers (struct regcache * regcache,
++ int regno)
++{
++ /* Get the thread id for the ptrace call. */
++ int tid = regcache->ptid ().lwp ();
++//int tid = get_ptrace_pid (regcache->ptid());
++#if 1
++ if (regno == -1)
++#endif
++ fetch_gp_regs (regcache, tid);
++#if 1
++ else
++ fetch_register (regcache, tid, regno);
++#endif
++}
++
++
++/* Store REGNUM (or all registers if REGNUM == -1) to the target
++ from REGCACHE using PTRACE_SETREGSET. */
++
++void
++microblaze_linux_nat_target::store_registers (struct regcache *regcache, int regno)
++{
++ int tid;
++
++ tid = get_ptrace_pid (regcache->ptid ());
++
++ struct gdbarch *gdbarch = regcache->arch ();
++ /* This isn't really an address. But ptrace thinks of it as one. */
++ CORE_ADDR regaddr = microblaze_register_u_addr (gdbarch, regno);
++ int i;
++ size_t bytes_to_transfer;
++ char buf[MICROBLAZE_MAX_REGISTER_SIZE];
++
++ if (regaddr == -1)
++ return;
++
++ /* First collect the register. Keep in mind that the regcache's
++ * idea of the register's size may not be a multiple of sizeof
++ * (long). */
++ memset (buf, 0, sizeof buf);
++ bytes_to_transfer = align_up (register_size (gdbarch, regno), sizeof (long));
++ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
++ {
++ /* Little-endian values always sit at the left end of the buffer. */
++ regcache->raw_collect (regno, buf);
++ }
++ else if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
++ {
++ /* Big-endian values sit at the right end of the buffer. */
++ size_t padding = (bytes_to_transfer - register_size (gdbarch, regno));
++ regcache->raw_collect (regno, buf + padding);
++ }
++
++ for (i = 0; i < bytes_to_transfer; i += sizeof (long))
++ {
++ long l;
++
++ memcpy (&l, &buf[i], sizeof (l));
++ errno = 0;
++ ptrace (PTRACE_POKEUSER, tid, (PTRACE_TYPE_ARG3) regaddr, l);
++ regaddr += sizeof (long);
++
++ if (errno != 0)
++ {
++ char message[128];
++ sprintf (message, "writing register %s (#%d)",
++ gdbarch_register_name (gdbarch, regno), regno);
++ perror_with_name (message);
++ }
++ }
++}
++
++void _initialize_microblaze_linux_nat (void);
++
++void
++_initialize_microblaze_linux_nat (void)
++{
++ /* Register the target. */
++ linux_target = &the_microblaze_linux_nat_target;
++ add_inf_child_target (linux_target);
++}
+diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c +index b8277dfd735..b77acc9dc61 100644 +--- a/gdb/microblaze-linux-tdep.c ++++ b/gdb/microblaze-linux-tdep.c +@@ -37,6 +37,7 @@ + #include "tramp-frame.h" + #include "linux-tdep.h" + #include "glibc-tdep.h" ++#include "features/microblaze-linux.c" + + static int microblaze_debug_flag = 0; + +@@ -179,4 +180,5 @@ _initialize_microblaze_linux_tdep () + { + gdbarch_register_osabi (bfd_arch_microblaze, 0, GDB_OSABI_LINUX, + microblaze_linux_init_abi); ++ initialize_tdesc_microblaze_linux (); + } +diff --git a/gdb/microblaze-linux-tdep.h b/gdb/microblaze-linux-tdep.h +new file mode 100644 +index 00000000000..a2c744e2961 +--- /dev/null ++++ b/gdb/microblaze-linux-tdep.h +@@ -0,0 +1,24 @@ ++/* Target-dependent code for GNU/Linux on OpenRISC. ++ ++ Copyright (C) 2021 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see <http://www.gnu.org/licenses/>. */ ++#ifndef MICROBLAZE_LINUX_TDEP_H ++#define MICROBLAZE_LINUX_TDEP_H ++ /* Target descriptions. */ ++ extern struct target_desc *tdesc_microblaze_linux; ++ ++#endif /* MICROBLAZE_LINUX_TDEP_H */ +diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c +index 399fa0e3dca..0a5b5ab59cc 100644 +--- a/gdb/microblaze-tdep.c ++++ b/gdb/microblaze-tdep.c +@@ -295,6 +295,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, + cache->frameless_p = 0; /* Frame found. */ + save_hidden_pointer_found = 0; + non_stack_instruction_found = 0; ++ cache->register_offsets[rd] = -imm; + continue; + } + else if (IS_SPILL_SP(op, rd, ra)) +@@ -443,15 +444,17 @@ microblaze_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) + if (find_pc_partial_function (start_pc, NULL, &func_start, &func_end)) + { + sal = find_pc_line (func_start, 0); +- +- if (sal.end < func_end +- && start_pc <= sal.end) ++ ++ if (sal.line !=0 && sal.end <= func_end && start_pc <= sal.end) { + start_pc = sal.end; ++ microblaze_debug("start_pc is %d\t sal.end is %d\t func_end is %d\t",start_pc,sal.end,func_end); ++ } + } + + ostart_pc = microblaze_analyze_prologue (gdbarch, func_start, 0xffffffffUL, + &cache); + ++ + if (ostart_pc > start_pc) + return ostart_pc; + return start_pc; +@@ -465,6 +468,7 @@ microblaze_frame_cache (struct frame_info *next_frame, void **this_cache) + struct microblaze_frame_cache *cache; + struct gdbarch *gdbarch = get_frame_arch (next_frame); + int rn; ++ CORE_ADDR current_pc; + + if (*this_cache) + return (struct microblaze_frame_cache *) *this_cache; +@@ -478,10 +482,17 @@ microblaze_frame_cache (struct frame_info *next_frame, void **this_cache) + cache->register_offsets[rn] = -1; + + /* Call for side effects. */ +- get_frame_func (next_frame); +- +- cache->pc = get_frame_address_in_block (next_frame); +- ++ cache->pc = get_frame_func (next_frame); ++ ++// cache->pc = get_frame_address_in_block (next_frame); ++ current_pc = get_frame_pc (next_frame); ++ if (cache->pc) ++ microblaze_analyze_prologue (gdbarch, cache->pc, current_pc, cache); ++ ++ cache->saved_sp = cache->base + cache->framesize; ++ cache->register_offsets[MICROBLAZE_PREV_PC_REGNUM] = cache->base; ++ cache->register_offsets[MICROBLAZE_SP_REGNUM] = cache->saved_sp; ++ + return cache; + } + +@@ -506,6 +517,25 @@ microblaze_frame_prev_register (struct frame_info *this_frame, + struct microblaze_frame_cache *cache = + microblaze_frame_cache (this_frame, this_cache); + ++if ((regnum == MICROBLAZE_SP_REGNUM && ++ cache->register_offsets[MICROBLAZE_SP_REGNUM]) ++ || (regnum == MICROBLAZE_FP_REGNUM && ++ cache->register_offsets[MICROBLAZE_SP_REGNUM])) ++ ++ return frame_unwind_got_constant (this_frame, regnum, ++ cache->register_offsets[MICROBLAZE_SP_REGNUM]); ++ ++if (regnum == MICROBLAZE_PC_REGNUM) ++{ ++ regnum = 15; ++ return frame_unwind_got_memory (this_frame, regnum, ++ cache->register_offsets[MICROBLAZE_PREV_PC_REGNUM]); ++ ++} ++if (regnum == MICROBLAZE_SP_REGNUM) ++ regnum = 1; ++#if 0 ++ + if (cache->frameless_p) + { + if (regnum == MICROBLAZE_PC_REGNUM) +@@ -518,7 +548,9 @@ microblaze_frame_prev_register (struct frame_info *this_frame, + else + return trad_frame_get_prev_register (this_frame, cache->saved_regs, + regnum); +- ++#endif ++ return trad_frame_get_prev_register (this_frame, cache->saved_regs, ++ regnum); + } + + static const struct frame_unwind microblaze_frame_unwind = +@@ -633,7 +665,106 @@ microblaze_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type) + return (TYPE_LENGTH (type) == 16); + } + +- ++#if 1 ++static std::vector<CORE_ADDR> ++microblaze_software_single_step (struct regcache *regcache) ++{ ++ struct gdbarch *arch = regcache->arch (); ++ //struct gdbarch_tdep *tdep = gdbarch_tdep (arch); ++ static int le_breakp[] = MICROBLAZE_BREAKPOINT_LE; ++ static int be_breakp[] = MICROBLAZE_BREAKPOINT; ++ enum bfd_endian byte_order = gdbarch_byte_order (arch); ++ int *breakp = byte_order == BFD_ENDIAN_BIG ? be_breakp : le_breakp; ++// std::vector<CORE_ADDR> ret = NULL; ++ ++ /* Save the address and the values of the next_pc and the target */ ++ static struct sstep_breaks ++ { ++ CORE_ADDR address; ++ bfd_boolean valid; ++ /* Shadow contents. */ ++ char data[INST_WORD_SIZE]; ++ } stepbreaks[2]; ++ int ii; ++ ++ CORE_ADDR pc; ++ std::vector<CORE_ADDR> next_pcs; ++ long insn; ++ enum microblaze_instr minstr; ++ bfd_boolean isunsignednum; ++ enum microblaze_instr_type insn_type; ++ short delay_slots; ++ int imm; ++ bfd_boolean immfound = FALSE; ++ ++ /* Set a breakpoint at the next instruction */ ++ /* If the current instruction is an imm, set it at the inst after */ ++ /* If the instruction has a delay slot, skip the delay slot */ ++ pc = regcache_read_pc (regcache); ++ insn = microblaze_fetch_instruction (pc); ++ minstr = get_insn_microblaze (insn, &isunsignednum, &insn_type, &delay_slots); ++ if (insn_type == immediate_inst) ++ { ++ int rd, ra, rb; ++ immfound = TRUE; ++ minstr = microblaze_decode_insn (insn, &rd, &ra, &rb, &imm); ++ pc = pc + INST_WORD_SIZE; ++ insn = microblaze_fetch_instruction (pc); ++ minstr = get_insn_microblaze (insn, &isunsignednum, &insn_type, &delay_slots); ++ } ++ stepbreaks[0].address = pc + (delay_slots * INST_WORD_SIZE) + INST_WORD_SIZE; ++ if (insn_type != return_inst) { ++ stepbreaks[0].valid = TRUE; ++ } else { ++ stepbreaks[0].valid = FALSE; ++ } ++ ++ microblaze_debug ("single-step insn_type=%x insn=%x\n", insn_type, insn); ++ /* Now check for branch or return instructions */ ++ if (insn_type == branch_inst || insn_type == return_inst) { ++ int limm; ++ int lrd, lra, lrb; ++ int ra, rb; ++ bfd_boolean targetvalid; ++ bfd_boolean unconditionalbranch; ++ microblaze_decode_insn(insn, &lrd, &lra, &lrb, &limm); ++ if (lra >= 0 && lra < MICROBLAZE_NUM_REGS) ++ ra = regcache_raw_get_unsigned(regcache, lra); ++ else ++ ra = 0; ++ if (lrb >= 0 && lrb < MICROBLAZE_NUM_REGS) ++ rb = regcache_raw_get_unsigned(regcache, lrb); ++ else ++ rb = 0; ++ stepbreaks[1].address = microblaze_get_target_address (insn, immfound, imm, pc, ra, rb, &targetvalid, &unconditionalbranch); ++ microblaze_debug ("single-step uncondbr=%d targetvalid=%d target=%x\n", unconditionalbranch, targetvalid, stepbreaks[1].address); ++ if (unconditionalbranch) ++ stepbreaks[0].valid = FALSE; /* This is a unconditional branch: will not come to the next address */ ++ if (targetvalid && (stepbreaks[0].valid == FALSE || ++ (stepbreaks[0].address != stepbreaks[1].address)) ++ && (stepbreaks[1].address != pc)) { ++ stepbreaks[1].valid = TRUE; ++ } else { ++ stepbreaks[1].valid = FALSE; ++ } ++ } else { ++ stepbreaks[1].valid = FALSE; ++ } ++ ++ /* Insert the breakpoints */ ++ for (ii = 0; ii < 2; ++ii) ++ { ++ ++ /* ignore invalid breakpoint. */ ++ if (stepbreaks[ii].valid) { ++ // VEC_safe_push (CORE_ADDR, next_pcs, stepbreaks[ii].address);; ++ next_pcs.push_back (stepbreaks[ii].address); ++ } ++ } ++ return next_pcs; ++} ++#endif ++ + static int dwarf2_to_reg_map[78] = + { 0 /* r0 */, 1 /* r1 */, 2 /* r2 */, 3 /* r3 */, /* 0- 3 */ + 4 /* r4 */, 5 /* r5 */, 6 /* r6 */, 7 /* r7 */, /* 4- 7 */ +@@ -805,6 +936,8 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) + microblaze_breakpoint::bp_from_kind); + set_gdbarch_memory_remove_breakpoint (gdbarch, microblaze_linux_memory_remove_breakpoint); + ++ set_gdbarch_software_single_step (gdbarch, microblaze_software_single_step); ++ + set_gdbarch_frame_args_skip (gdbarch, 8); + + set_gdbarch_unwind_pc (gdbarch, microblaze_unwind_pc); +diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h +index 872a3931f20..7f75c693b74 100644 +--- a/gdb/microblaze-tdep.h ++++ b/gdb/microblaze-tdep.h +@@ -59,11 +59,11 @@ enum microblaze_regnum + MICROBLAZE_R12_REGNUM, + MICROBLAZE_R13_REGNUM, + MICROBLAZE_R14_REGNUM, +- MICROBLAZE_R15_REGNUM, ++ MICROBLAZE_R15_REGNUM,MICROBLAZE_PREV_PC_REGNUM = MICROBLAZE_R15_REGNUM, + MICROBLAZE_R16_REGNUM, + MICROBLAZE_R17_REGNUM, + MICROBLAZE_R18_REGNUM, +- MICROBLAZE_R19_REGNUM, ++ MICROBLAZE_R19_REGNUM,MICROBLAZE_FP_REGNUM = MICROBLAZE_R19_REGNUM, + MICROBLAZE_R20_REGNUM, + MICROBLAZE_R21_REGNUM, + MICROBLAZE_R22_REGNUM, +@@ -76,7 +76,8 @@ enum microblaze_regnum + MICROBLAZE_R29_REGNUM, + MICROBLAZE_R30_REGNUM, + MICROBLAZE_R31_REGNUM, +- MICROBLAZE_PC_REGNUM, ++ MICROBLAZE_MAX_GPR_REGS, ++ MICROBLAZE_PC_REGNUM=32, + MICROBLAZE_MSR_REGNUM, + MICROBLAZE_EAR_REGNUM, + MICROBLAZE_ESR_REGNUM, +@@ -101,17 +102,21 @@ enum microblaze_regnum + MICROBLAZE_RTLBSX_REGNUM, + MICROBLAZE_RTLBLO_REGNUM, + MICROBLAZE_RTLBHI_REGNUM, +- MICROBLAZE_SLR_REGNUM, MICROBLAZE_NUM_CORE_REGS = MICROBLAZE_SLR_REGNUM, ++ MICROBLAZE_SLR_REGNUM, + MICROBLAZE_SHR_REGNUM, +- MICROBLAZE_NUM_REGS ++ MICROBLAZE_NUM_REGS, MICROBLAZE_NUM_CORE_REGS = MICROBLAZE_NUM_REGS + }; + ++/* Big enough to hold the size of the largest register in bytes. */ ++#define MICROBLAZE_MAX_REGISTER_SIZE 64 ++ + struct microblaze_frame_cache + { + /* Base address. */ + CORE_ADDR base; + CORE_ADDR pc; + ++ CORE_ADDR saved_sp; + /* Do we have a frame? */ + int frameless_p; + +-- +2.17.1 + diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0007-Patch-microblaze-Adding-64-bit-MB-support.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0007-Patch-microblaze-Adding-64-bit-MB-support.patch index 6536c22d..564562da 100644 --- a/meta-microblaze/recipes-devtools/gdb/gdb/0007-Patch-microblaze-Adding-64-bit-MB-support.patch +++ b/meta-microblaze/recipes-devtools/gdb/gdb/0007-Patch-microblaze-Adding-64-bit-MB-support.patch @@ -1,4 +1,4 @@ -From f9e5f9f884470d0a216126b347b4699d6051fcdd Mon Sep 17 00:00:00 2001 +From 0eea9a3f068837d4792719a8f9ba15736938eea4 Mon Sep 17 00:00:00 2001 From: Nagaraju Mekala <nmekala@xilix.com> Date: Thu, 31 Jan 2019 14:36:00 +0530 Subject: [PATCH 07/10] [Patch, microblaze]: Adding 64 bit MB support Added new @@ -16,6 +16,9 @@ Conflicts: Conflicts: bfd/configure opcodes/microblaze-opcm.h + +Conflicts: + gdb/microblaze-tdep.c --- bfd/Makefile.am | 2 + bfd/Makefile.in | 3 + @@ -41,8 +44,8 @@ Conflicts: gdb/features/microblaze64.c | 77 + gdb/features/microblaze64.xml | 11 + gdb/microblaze-linux-tdep.c | 36 +- - gdb/microblaze-tdep.c | 210 +- - gdb/microblaze-tdep.h | 8 +- + gdb/microblaze-tdep.c | 102 +- + gdb/microblaze-tdep.h | 4 +- .../microblaze-with-stack-protect.dat | 4 +- .../linux-microblaze-low.c | 0 include/elf/common.h | 1 + @@ -50,7 +53,7 @@ Conflicts: opcodes/microblaze-dis.c | 51 +- opcodes/microblaze-opc.h | 180 +- opcodes/microblaze-opcm.h | 36 +- - 41 files changed, 5454 insertions(+), 248 deletions(-) + 41 files changed, 5345 insertions(+), 245 deletions(-) create mode 100755 bfd/elf64-microblaze.c create mode 100644 gdb/features/microblaze64-core.xml create mode 100644 gdb/features/microblaze64-stack-protect.xml @@ -4880,18 +4883,18 @@ index 00000000000..515d18e65cf + <xi:include href="microblaze64-core.xml"/> +</target> diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c -index b8277dfd735..0c9ec82cee5 100644 +index b77acc9dc61..ba87d0bbd63 100644 --- a/gdb/microblaze-linux-tdep.c +++ b/gdb/microblaze-linux-tdep.c -@@ -39,6 +39,7 @@ - #include "glibc-tdep.h" +@@ -40,6 +40,7 @@ + #include "features/microblaze-linux.c" static int microblaze_debug_flag = 0; +int MICROBLAZE_REGISTER_SIZE=4; static void microblaze_debug (const char *fmt, ...) -@@ -54,6 +55,7 @@ microblaze_debug (const char *fmt, ...) +@@ -55,6 +56,7 @@ microblaze_debug (const char *fmt, ...) } } @@ -4899,7 +4902,7 @@ index b8277dfd735..0c9ec82cee5 100644 static int microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt) -@@ -85,6 +87,8 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, +@@ -86,6 +88,8 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, return val; } @@ -4908,7 +4911,7 @@ index b8277dfd735..0c9ec82cee5 100644 static void microblaze_linux_sigtramp_cache (struct frame_info *next_frame, struct trad_frame_cache *this_cache, -@@ -146,8 +150,8 @@ microblaze_linux_init_abi (struct gdbarch_info info, +@@ -147,8 +151,8 @@ microblaze_linux_init_abi (struct gdbarch_info info, linux_init_abi (info, gdbarch); @@ -4919,7 +4922,7 @@ index b8277dfd735..0c9ec82cee5 100644 /* Shared library handling. */ set_solib_svr4_fetch_link_map_offsets (gdbarch, -@@ -159,10 +163,30 @@ microblaze_linux_init_abi (struct gdbarch_info info, +@@ -160,10 +164,30 @@ microblaze_linux_init_abi (struct gdbarch_info info, /* BFD target for core files. */ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) @@ -4952,7 +4955,7 @@ index b8277dfd735..0c9ec82cee5 100644 /* Shared library handling. */ set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); -@@ -177,6 +201,8 @@ void _initialize_microblaze_linux_tdep (); +@@ -178,7 +202,9 @@ void _initialize_microblaze_linux_tdep (); void _initialize_microblaze_linux_tdep () { @@ -4961,9 +4964,10 @@ index b8277dfd735..0c9ec82cee5 100644 + microblaze_linux_init_abi); + gdbarch_register_osabi (bfd_arch_microblaze, bfd_mach_microblaze64, GDB_OSABI_LINUX, microblaze_linux_init_abi); + initialize_tdesc_microblaze_linux (); } diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c -index 399fa0e3dca..e51c022c1ba 100644 +index 0a5b5ab59cc..667d658adfd 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -40,7 +40,9 @@ @@ -5023,7 +5027,7 @@ index 399fa0e3dca..e51c022c1ba 100644 /* Allocate and initialize a frame cache. */ static struct microblaze_frame_cache * -@@ -556,17 +568,16 @@ microblaze_extract_return_value (struct type *type, struct regcache *regcache, +@@ -588,17 +600,16 @@ microblaze_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf) { gdb_byte buf[8]; @@ -5043,118 +5047,10 @@ index 399fa0e3dca..e51c022c1ba 100644 return; case 4: /* for sizes 4 or 8, copy the required length. */ case 8: -@@ -633,7 +644,119 @@ microblaze_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type) - return (TYPE_LENGTH (type) == 16); +@@ -765,6 +776,12 @@ microblaze_software_single_step (struct regcache *regcache) } + #endif -- -+#if 0 -+static std::vector<CORE_ADDR> -+microblaze_software_single_step (struct regcache *regcache) -+{ -+// struct gdbarch *arch = get_frame_arch(frame); -+ struct gdbarch *arch = get_regcache_arch (regcache); -+ struct address_space *aspace = get_regcache_aspace (regcache); -+// struct address_space *aspace = get_frame_address_space (frame); -+ struct gdbarch_tdep *tdep = gdbarch_tdep (arch); -+ static char le_breakp[] = MICROBLAZE_BREAKPOINT_LE; -+ static char be_breakp[] = MICROBLAZE_BREAKPOINT; -+ enum bfd_endian byte_order = gdbarch_byte_order (arch); -+ char *breakp = byte_order == BFD_ENDIAN_BIG ? be_breakp : le_breakp; -+ std::vector<CORE_ADDR> ret = 0; -+ -+ /* Save the address and the values of the next_pc and the target */ -+ static struct sstep_breaks -+ { -+ CORE_ADDR address; -+ bfd_boolean valid; -+ /* Shadow contents. */ -+ char data[INST_WORD_SIZE]; -+ } stepbreaks[2]; -+ int ii; -+ -+ if (1) -+ { -+ CORE_ADDR pc; -+ std::vector<CORE_ADDR> *next_pcs = NULL; -+ long insn; -+ enum microblaze_instr minstr; -+ bfd_boolean isunsignednum; -+ enum microblaze_instr_type insn_type; -+ short delay_slots; -+ int imm; -+ bfd_boolean immfound = FALSE; -+ -+ /* Set a breakpoint at the next instruction */ -+ /* If the current instruction is an imm, set it at the inst after */ -+ /* If the instruction has a delay slot, skip the delay slot */ -+ pc = regcache_read_pc (regcache); -+ insn = microblaze_fetch_instruction (pc); -+ minstr = get_insn_microblaze (insn, &isunsignednum, &insn_type, &delay_slots); -+ if (insn_type == immediate_inst) -+ { -+ int rd, ra, rb; -+ immfound = TRUE; -+ minstr = microblaze_decode_insn (insn, &rd, &ra, &rb, &imm); -+ pc = pc + INST_WORD_SIZE; -+ insn = microblaze_fetch_instruction (pc); -+ minstr = get_insn_microblaze (insn, &isunsignednum, &insn_type, &delay_slots); -+ } -+ stepbreaks[0].address = pc + (delay_slots * INST_WORD_SIZE) + INST_WORD_SIZE; -+ if (insn_type != return_inst) { -+ stepbreaks[0].valid = TRUE; -+ } else { -+ stepbreaks[0].valid = FALSE; -+ } -+ -+ microblaze_debug ("single-step insn_type=%x insn=%x\n", insn_type, insn); -+ /* Now check for branch or return instructions */ -+ if (insn_type == branch_inst || insn_type == return_inst) { -+ int limm; -+ int lrd, lra, lrb; -+ int ra, rb; -+ bfd_boolean targetvalid; -+ bfd_boolean unconditionalbranch; -+ microblaze_decode_insn(insn, &lrd, &lra, &lrb, &limm); -+ if (lra >= 0 && lra < MICROBLAZE_NUM_REGS) -+ ra = regcache_raw_get_unsigned(regcache, lra); -+ else -+ ra = 0; -+ if (lrb >= 0 && lrb < MICROBLAZE_NUM_REGS) -+ rb = regcache_raw_get_unsigned(regcache, lrb); -+ else -+ rb = 0; -+ stepbreaks[1].address = microblaze_get_target_address (insn, immfound, imm, pc, ra, rb, &targetvalid, &unconditionalbranch); -+ microblaze_debug ("single-step uncondbr=%d targetvalid=%d target=%x\n", unconditionalbranch, targetvalid, stepbreaks[1].address); -+ if (unconditionalbranch) -+ stepbreaks[0].valid = FALSE; /* This is a unconditional branch: will not come to the next address */ -+ if (targetvalid && (stepbreaks[0].valid == FALSE || -+ (stepbreaks[0].address != stepbreaks[1].address)) -+ && (stepbreaks[1].address != pc)) { -+ stepbreaks[1].valid = TRUE; -+ } else { -+ stepbreaks[1].valid = FALSE; -+ } -+ } else { -+ stepbreaks[1].valid = FALSE; -+ } -+ -+ /* Insert the breakpoints */ -+ for (ii = 0; ii < 2; ++ii) -+ { -+ -+ /* ignore invalid breakpoint. */ -+ if (stepbreaks[ii].valid) { -+ VEC_safe_push (CORE_ADDR, next_pcs, stepbreaks[ii].address);; -+// insert_single_step_breakpoint (arch, aspace, stepbreaks[ii].address); -+ ret = next_pcs; -+ } -+ } -+ } -+ return ret; -+} -+#endif -+ +static void +microblaze_write_pc (struct regcache *regcache, CORE_ADDR pc) +{ @@ -5164,7 +5060,7 @@ index 399fa0e3dca..e51c022c1ba 100644 static int dwarf2_to_reg_map[78] = { 0 /* r0 */, 1 /* r1 */, 2 /* r2 */, 3 /* r3 */, /* 0- 3 */ 4 /* r4 */, 5 /* r5 */, 6 /* r6 */, 7 /* r7 */, /* 4- 7 */ -@@ -668,13 +791,14 @@ microblaze_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg) +@@ -799,13 +816,14 @@ microblaze_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg) static void microblaze_register_g_packet_guesses (struct gdbarch *gdbarch) { @@ -5182,7 +5078,7 @@ index 399fa0e3dca..e51c022c1ba 100644 } void -@@ -682,7 +806,7 @@ microblaze_supply_gregset (const struct regset *regset, +@@ -813,7 +831,7 @@ microblaze_supply_gregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs) { @@ -5191,7 +5087,7 @@ index 399fa0e3dca..e51c022c1ba 100644 if (regnum >= 0) regcache->raw_supply (regnum, regs + regnum); -@@ -690,7 +814,7 @@ microblaze_supply_gregset (const struct regset *regset, +@@ -821,7 +839,7 @@ microblaze_supply_gregset (const struct regset *regset, int i; for (i = 0; i < 50; i++) { @@ -5200,7 +5096,7 @@ index 399fa0e3dca..e51c022c1ba 100644 } } } -@@ -713,6 +837,17 @@ microblaze_iterate_over_regset_sections (struct gdbarch *gdbarch, +@@ -844,6 +862,17 @@ microblaze_iterate_over_regset_sections (struct gdbarch *gdbarch, } @@ -5218,7 +5114,7 @@ index 399fa0e3dca..e51c022c1ba 100644 static struct gdbarch * microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) -@@ -727,8 +862,15 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) +@@ -858,8 +887,15 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (arches != NULL) return arches->gdbarch; if (tdesc == NULL) @@ -5236,7 +5132,7 @@ index 399fa0e3dca..e51c022c1ba 100644 /* Check any target description for validity. */ if (tdesc_has_registers (tdesc)) { -@@ -736,27 +878,35 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) +@@ -867,27 +903,35 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) int valid_p; int i; @@ -5277,7 +5173,7 @@ index 399fa0e3dca..e51c022c1ba 100644 } if (!valid_p) -@@ -764,6 +914,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) +@@ -895,6 +939,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdesc_data_cleanup (tdesc_data); return NULL; } @@ -5285,7 +5181,7 @@ index 399fa0e3dca..e51c022c1ba 100644 } /* Allocate space for the new architecture. */ -@@ -783,7 +934,17 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) +@@ -914,7 +959,17 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Register numbers of various important registers. */ set_gdbarch_sp_regnum (gdbarch, MICROBLAZE_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, MICROBLAZE_PC_REGNUM); @@ -5303,7 +5199,7 @@ index 399fa0e3dca..e51c022c1ba 100644 /* Map Dwarf2 registers to GDB registers. */ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, microblaze_dwarf2_reg_to_regnum); -@@ -803,13 +964,15 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) +@@ -934,7 +989,9 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) microblaze_breakpoint::kind_from_pc); set_gdbarch_sw_breakpoint_from_kind (gdbarch, microblaze_breakpoint::bp_from_kind); @@ -5312,7 +5208,9 @@ index 399fa0e3dca..e51c022c1ba 100644 + +// set_gdbarch_software_single_step (gdbarch, microblaze_software_single_step); - set_gdbarch_frame_args_skip (gdbarch, 8); + set_gdbarch_software_single_step (gdbarch, microblaze_software_single_step); + +@@ -942,7 +999,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_unwind_pc (gdbarch, microblaze_unwind_pc); @@ -5321,7 +5219,7 @@ index 399fa0e3dca..e51c022c1ba 100644 frame_base_set_default (gdbarch, µblaze_frame_base); -@@ -824,12 +987,11 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) +@@ -957,12 +1014,11 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdesc_use_registers (gdbarch, tdesc, tdesc_data); //frame_base_append_sniffer (gdbarch, microblaze_frame_sniffer); @@ -5336,7 +5234,7 @@ index 399fa0e3dca..e51c022c1ba 100644 return gdbarch; } -@@ -841,6 +1003,8 @@ _initialize_microblaze_tdep () +@@ -974,6 +1030,8 @@ _initialize_microblaze_tdep () initialize_tdesc_microblaze_with_stack_protect (); initialize_tdesc_microblaze (); @@ -5346,7 +5244,7 @@ index 399fa0e3dca..e51c022c1ba 100644 add_setshow_zuinteger_cmd ("microblaze", class_maintenance, µblaze_debug_flag, _("\ diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h -index 872a3931f20..dc1d4686914 100644 +index 7f75c693b74..e0fa7ef9b12 100644 --- a/gdb/microblaze-tdep.h +++ b/gdb/microblaze-tdep.h @@ -27,7 +27,7 @@ struct microblaze_gregset @@ -5358,19 +5256,7 @@ index 872a3931f20..dc1d4686914 100644 }; struct gdbarch_tdep -@@ -101,9 +101,9 @@ enum microblaze_regnum - MICROBLAZE_RTLBSX_REGNUM, - MICROBLAZE_RTLBLO_REGNUM, - MICROBLAZE_RTLBHI_REGNUM, -- MICROBLAZE_SLR_REGNUM, MICROBLAZE_NUM_CORE_REGS = MICROBLAZE_SLR_REGNUM, -+ MICROBLAZE_SLR_REGNUM, - MICROBLAZE_SHR_REGNUM, -- MICROBLAZE_NUM_REGS -+ MICROBLAZE_NUM_REGS, MICROBLAZE_NUM_CORE_REGS = MICROBLAZE_NUM_REGS - }; - - struct microblaze_frame_cache -@@ -128,7 +128,7 @@ struct microblaze_frame_cache +@@ -133,7 +133,7 @@ struct microblaze_frame_cache struct trad_frame_saved_reg *saved_regs; }; /* All registers are 32 bits. */ diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0009-Patch-MicroBlaze-these-changes-will-make-64-bit-vect.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0008-Patch-MicroBlaze-these-changes-will-make-64-bit-vect.patch index fca85fa2..abbea266 100644 --- a/meta-microblaze/recipes-devtools/gdb/gdb/0009-Patch-MicroBlaze-these-changes-will-make-64-bit-vect.patch +++ b/meta-microblaze/recipes-devtools/gdb/gdb/0008-Patch-MicroBlaze-these-changes-will-make-64-bit-vect.patch @@ -1,7 +1,7 @@ -From 9ab0a0a551902e5196d46178b57fa1b33b587092 Mon Sep 17 00:00:00 2001 +From cc8ee172b9145ce488c556a2eb50f931f0676eea Mon Sep 17 00:00:00 2001 From: Mahesh Bodapati <mbodapat@xilinx.com> Date: Mon, 19 Apr 2021 14:33:27 +0530 -Subject: [PATCH 09/10] [Patch,MicroBlaze] : these changes will make 64 bit +Subject: [PATCH 08/10] [Patch,MicroBlaze] : these changes will make 64 bit vectors as default target types when we built gdb with microblaze 64 bit type targets,for instance microblaze-xilinx-elf64/microblazeel-xilinx-elf64 diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0008-gdb-Fix-microblaze-target-compilation-3.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0008-gdb-Fix-microblaze-target-compilation-3.patch deleted file mode 100644 index 6a570b6a..00000000 --- a/meta-microblaze/recipes-devtools/gdb/gdb/0008-gdb-Fix-microblaze-target-compilation-3.patch +++ /dev/null @@ -1,288 +0,0 @@ -From 306ca46b3f330ee39601b9aede6b53c9cdbe9f86 Mon Sep 17 00:00:00 2001 -From: Mark Hatle <mark.hatle@xilinx.com> -Date: Wed, 9 Dec 2020 23:35:35 -0600 -Subject: [PATCH 08/10] gdb: Fix microblaze target compilation (#3) - -Add microblaze-linux-nat.c to configure.nat - -Transition microblaze-linux-nat.c to use the new gdb C++ style functions. - -Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> ---- - gdb/configure.nat | 5 ++ - gdb/microblaze-linux-nat.c | 96 ++++++++++++++------------------------ - gdb/microblaze-tdep.h | 3 ++ - 3 files changed, 43 insertions(+), 61 deletions(-) - -diff --git a/gdb/configure.nat b/gdb/configure.nat -index bb70e303384..d8548a6b666 100644 ---- a/gdb/configure.nat -+++ b/gdb/configure.nat -@@ -261,6 +261,11 @@ case ${gdb_host} in - # Host: Motorola m68k running GNU/Linux. - NATDEPFILES="${NATDEPFILES} m68k-linux-nat.o" - ;; -+ microblaze) -+ # Host: Microblaze running GNU/Linux. -+ NATDEPFILES="${NATDEPFILES} microblaze-linux-nat.o" -+ NAT_CDEPS= -+ ;; - mips) - # Host: Linux/MIPS - NATDEPFILES="${NATDEPFILES} linux-nat-trad.o \ -diff --git a/gdb/microblaze-linux-nat.c b/gdb/microblaze-linux-nat.c -index e9b8c9c5221..bac4697e1e6 100644 ---- a/gdb/microblaze-linux-nat.c -+++ b/gdb/microblaze-linux-nat.c -@@ -36,13 +36,14 @@ - #include "dwarf2-frame.h" - #include "osabi.h" - --#include "gdb_assert.h" --#include "gdb_string.h" -+#include "gdbsupport/gdb_assert.h" -+#include <string.h> - #include "target-descriptions.h" - #include "opcodes/microblaze-opcm.h" - #include "opcodes/microblaze-dis.h" - - #include "linux-nat.h" -+#include "linux-tdep.h" - #include "target-descriptions.h" - - #include <sys/user.h> -@@ -61,22 +62,17 @@ - /* Defines ps_err_e, struct ps_prochandle. */ - #include "gdb_proc_service.h" - --/* On GNU/Linux, threads are implemented as pseudo-processes, in which -- case we may be tracing more than one process at a time. In that -- case, inferior_ptid will contain the main process ID and the -- individual thread (process) ID. get_thread_id () is used to get -- the thread id if it's available, and the process id otherwise. */ -- --int --get_thread_id (ptid_t ptid) -+class microblaze_linux_nat_target final : public linux_nat_target - { -- int tid = TIDGET (ptid); -- if (0 == tid) -- tid = PIDGET (ptid); -- return tid; --} -+public: -+ /* Add our register access methods. */ -+ void fetch_registers (struct regcache *, int) override; -+ void store_registers (struct regcache *, int) override; -+ -+ const struct target_desc *read_description () override; -+}; - --#define GET_THREAD_ID(PTID) get_thread_id (PTID) -+static microblaze_linux_nat_target the_microblaze_linux_nat_target; - - /* Non-zero if our kernel may support the PTRACE_GETREGS and - PTRACE_SETREGS requests, for reading and writing the -@@ -88,7 +84,6 @@ static int - microblaze_register_u_addr (struct gdbarch *gdbarch, int regno) - { - int u_addr = -1; -- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - /* NOTE: cagney/2003-11-25: This is the word size used by the ptrace - interface, and not the wordsize of the program's ABI. */ - int wordsize = sizeof (long); -@@ -105,18 +100,16 @@ microblaze_register_u_addr (struct gdbarch *gdbarch, int regno) - static void - fetch_register (struct regcache *regcache, int tid, int regno) - { -- struct gdbarch *gdbarch = get_regcache_arch (regcache); -- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -+ struct gdbarch *gdbarch = regcache->arch (); - /* This isn't really an address. But ptrace thinks of it as one. */ - CORE_ADDR regaddr = microblaze_register_u_addr (gdbarch, regno); - int bytes_transferred; -- unsigned int offset; /* Offset of registers within the u area. */ -- char buf[MAX_REGISTER_SIZE]; -+ char buf[MICROBLAZE_MAX_REGISTER_SIZE]; - - if (regaddr == -1) - { - memset (buf, '\0', register_size (gdbarch, regno)); /* Supply zeroes */ -- regcache_raw_supply (regcache, regno, buf); -+ regcache->raw_supply (regno, buf); - return; - } - -@@ -149,14 +142,14 @@ fetch_register (struct regcache *regcache, int tid, int regno) - { - /* Little-endian values are always found at the left end of the - bytes transferred. */ -- regcache_raw_supply (regcache, regno, buf); -+ regcache->raw_supply (regno, buf); - } - else if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) - { - /* Big-endian values are found at the right end of the bytes - transferred. */ - size_t padding = (bytes_transferred - register_size (gdbarch, regno)); -- regcache_raw_supply (regcache, regno, buf + padding); -+ regcache->raw_supply (regno, buf + padding); - } - else - internal_error (__FILE__, __LINE__, -@@ -175,8 +168,6 @@ fetch_register (struct regcache *regcache, int tid, int regno) - static int - fetch_all_gp_regs (struct regcache *regcache, int tid) - { -- struct gdbarch *gdbarch = get_regcache_arch (regcache); -- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - gdb_gregset_t gregset; - - if (ptrace (PTRACE_GETREGS, tid, 0, (void *) &gregset) < 0) -@@ -204,8 +195,6 @@ fetch_all_gp_regs (struct regcache *regcache, int tid) - static void - fetch_gp_regs (struct regcache *regcache, int tid) - { -- struct gdbarch *gdbarch = get_regcache_arch (regcache); -- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - int i; - - if (have_ptrace_getsetregs) -@@ -223,13 +212,12 @@ fetch_gp_regs (struct regcache *regcache, int tid) - static void - store_register (const struct regcache *regcache, int tid, int regno) - { -- struct gdbarch *gdbarch = get_regcache_arch (regcache); -- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -+ struct gdbarch *gdbarch = regcache->arch (); - /* This isn't really an address. But ptrace thinks of it as one. */ - CORE_ADDR regaddr = microblaze_register_u_addr (gdbarch, regno); - int i; - size_t bytes_to_transfer; -- char buf[MAX_REGISTER_SIZE]; -+ char buf[MICROBLAZE_MAX_REGISTER_SIZE]; - - if (regaddr == -1) - return; -@@ -242,13 +230,13 @@ store_register (const struct regcache *regcache, int tid, int regno) - if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE) - { - /* Little-endian values always sit at the left end of the buffer. */ -- regcache_raw_collect (regcache, regno, buf); -+ regcache->raw_collect (regno, buf); - } - else if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) - { - /* Big-endian values sit at the right end of the buffer. */ - size_t padding = (bytes_to_transfer - register_size (gdbarch, regno)); -- regcache_raw_collect (regcache, regno, buf + padding); -+ regcache->raw_collect (regno, buf + padding); - } - - for (i = 0; i < bytes_to_transfer; i += sizeof (long)) -@@ -281,8 +269,6 @@ store_register (const struct regcache *regcache, int tid, int regno) - static int - store_all_gp_regs (const struct regcache *regcache, int tid, int regno) - { -- struct gdbarch *gdbarch = get_regcache_arch (regcache); -- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - gdb_gregset_t gregset; - - if (ptrace (PTRACE_GETREGS, tid, 0, (void *) &gregset) < 0) -@@ -319,8 +305,6 @@ store_all_gp_regs (const struct regcache *regcache, int tid, int regno) - static void - store_gp_regs (const struct regcache *regcache, int tid, int regno) - { -- struct gdbarch *gdbarch = get_regcache_arch (regcache); -- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - int i; - - if (have_ptrace_getsetregs) -@@ -339,12 +323,12 @@ store_gp_regs (const struct regcache *regcache, int tid, int regno) - regno == -1, otherwise fetch all general registers or all floating - point registers depending upon the value of regno. */ - --static void --microblaze_linux_fetch_inferior_registers (struct target_ops *ops, -- struct regcache *regcache, int regno) -+void -+microblaze_linux_nat_target::fetch_registers (struct regcache * regcache, -+ int regno) - { - /* Get the thread id for the ptrace call. */ -- int tid = GET_THREAD_ID (inferior_ptid); -+ int tid = regcache->ptid ().lwp (); - - if (regno == -1) - fetch_gp_regs (regcache, tid); -@@ -356,12 +340,12 @@ microblaze_linux_fetch_inferior_registers (struct target_ops *ops, - regno == -1, otherwise store all general registers or all floating - point registers depending upon the value of regno. */ - --static void --microblaze_linux_store_inferior_registers (struct target_ops *ops, -- struct regcache *regcache, int regno) -+void -+microblaze_linux_nat_target::store_registers (struct regcache *regcache, -+ int regno) - { - /* Get the thread id for the ptrace call. */ -- int tid = GET_THREAD_ID (inferior_ptid); -+ int tid = regcache->ptid ().lwp (); - - if (regno >= 0) - store_register (regcache, tid, regno); -@@ -398,12 +382,12 @@ supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp) - /* FIXME. */ - } - --static const struct target_desc * --microblaze_linux_read_description (struct target_ops *ops) -+const struct target_desc * -+microblaze_linux_nat_target::read_description () - { -- CORE_ADDR microblaze_hwcap = 0; -+ CORE_ADDR microblaze_hwcap = linux_get_hwcap (this); - -- if (target_auxv_search (ops, AT_HWCAP, µblaze_hwcap) != 1) -+ if (microblaze_hwcap != 1) - return NULL; - - return NULL; -@@ -415,17 +399,7 @@ void _initialize_microblaze_linux_nat (void); - void - _initialize_microblaze_linux_nat (void) - { -- struct target_ops *t; -- -- /* Fill in the generic GNU/Linux methods. */ -- t = linux_target (); -- -- /* Add our register access methods. */ -- t->to_fetch_registers = microblaze_linux_fetch_inferior_registers; -- t->to_store_registers = microblaze_linux_store_inferior_registers; -- -- t->to_read_description = microblaze_linux_read_description; -- - /* Register the target. */ -- linux_nat_add_target (t); -+ linux_target = &the_microblaze_linux_nat_target; -+ add_inf_child_target (&the_microblaze_linux_nat_target); - } -diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h -index dc1d4686914..a5c12c10e0b 100644 ---- a/gdb/microblaze-tdep.h -+++ b/gdb/microblaze-tdep.h -@@ -106,6 +106,9 @@ enum microblaze_regnum - MICROBLAZE_NUM_REGS, MICROBLAZE_NUM_CORE_REGS = MICROBLAZE_NUM_REGS - }; - -+/* Big enough to hold the size of the largest register in bytes. */ -+#define MICROBLAZE_MAX_REGISTER_SIZE 64 -+ - struct microblaze_frame_cache - { - /* Base address. */ --- -2.17.1 - diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0010-Patch-MicroBlaze-Added-m64-abi-for-64-bit-target-des.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0009-Patch-MicroBlaze-Added-m64-abi-for-64-bit-target-des.patch index 78ef9202..35466e8f 100644 --- a/meta-microblaze/recipes-devtools/gdb/gdb/0010-Patch-MicroBlaze-Added-m64-abi-for-64-bit-target-des.patch +++ b/meta-microblaze/recipes-devtools/gdb/gdb/0009-Patch-MicroBlaze-Added-m64-abi-for-64-bit-target-des.patch @@ -1,7 +1,7 @@ -From 67fd78c3fa5894e0038c09a858cb518c20340abf Mon Sep 17 00:00:00 2001 +From a721a7063f829ccaf6cf8273be04b763b53a735d Mon Sep 17 00:00:00 2001 From: Mahesh Bodapati <mbodapat@xilinx.com> Date: Tue, 9 Nov 2021 16:19:17 +0530 -Subject: [PATCH 10/10] [Patch,MicroBlaze] : Added m64 abi for 64 bit target +Subject: [PATCH 09/10] [Patch,MicroBlaze] : Added m64 abi for 64 bit target descriptions. set m64 abi for 64 bit elf. --- @@ -22,7 +22,7 @@ index 515d18e65cf..9c1b7d22003 100644 <xi:include href="microblaze64-core.xml"/> </target> diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c -index e51c022c1ba..3bffbbe4b3d 100644 +index 667d658adfd..aad6a9cae6e 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -65,8 +65,94 @@ @@ -139,7 +139,7 @@ index e51c022c1ba..3bffbbe4b3d 100644 static void ATTRIBUTE_PRINTF (1, 2) microblaze_debug (const char *fmt, ...) { -@@ -855,15 +953,30 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) +@@ -880,15 +978,30 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) struct gdbarch_tdep *tdep; struct gdbarch *gdbarch; struct tdesc_arch_data *tdesc_data = NULL; @@ -172,7 +172,7 @@ index e51c022c1ba..3bffbbe4b3d 100644 { tdesc = tdesc_microblaze64; reg_size = 8; -@@ -878,7 +991,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) +@@ -903,7 +1016,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) int valid_p; int i; @@ -181,7 +181,7 @@ index e51c022c1ba..3bffbbe4b3d 100644 feature = tdesc_find_feature (tdesc, "org.gnu.gdb.microblaze64.core"); else -@@ -892,7 +1005,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) +@@ -917,7 +1030,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) for (i = 0; i < MICROBLAZE_NUM_REGS; i++) valid_p &= tdesc_numbered_register (feature, tdesc_data, i, microblaze_register_names[i]); @@ -190,7 +190,7 @@ index e51c022c1ba..3bffbbe4b3d 100644 feature = tdesc_find_feature (tdesc, "org.gnu.gdb.microblaze64.stack-protect"); else -@@ -943,7 +1056,8 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) +@@ -968,7 +1081,8 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_ptr_bit (gdbarch, 64); break; } @@ -200,7 +200,7 @@ index e51c022c1ba..3bffbbe4b3d 100644 /* Map Dwarf2 registers to GDB registers. */ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, microblaze_dwarf2_reg_to_regnum); -@@ -1000,7 +1114,30 @@ void +@@ -1027,7 +1141,30 @@ void _initialize_microblaze_tdep () { register_gdbarch_init (bfd_arch_microblaze, microblaze_gdbarch_init); @@ -232,14 +232,14 @@ index e51c022c1ba..3bffbbe4b3d 100644 initialize_tdesc_microblaze_with_stack_protect (); initialize_tdesc_microblaze (); initialize_tdesc_microblaze64_with_stack_protect (); -@@ -1015,5 +1152,4 @@ When non-zero, microblaze specific debugging is enabled."), +@@ -1042,5 +1179,4 @@ When non-zero, microblaze specific debugging is enabled."), NULL, &setdebuglist, &showdebuglist); - } diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h -index a5c12c10e0b..29da6d29dcb 100644 +index e0fa7ef9b12..9cb9628295f 100644 --- a/gdb/microblaze-tdep.h +++ b/gdb/microblaze-tdep.h @@ -19,8 +19,16 @@ diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0010-Patch-MicroBlaze-Code-changes-for-gdbserver.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0010-Patch-MicroBlaze-Code-changes-for-gdbserver.patch new file mode 100644 index 00000000..dc38b480 --- /dev/null +++ b/meta-microblaze/recipes-devtools/gdb/gdb/0010-Patch-MicroBlaze-Code-changes-for-gdbserver.patch @@ -0,0 +1,401 @@ +From 01e16382c8fce4448c911a4c5780259e181e83dd Mon Sep 17 00:00:00 2001 +From: Mahesh Bodapati <mbodapat@xilinx.com> +Date: Fri, 8 Jul 2022 12:53:51 +0530 +Subject: [PATCH 10/10] [Patch,MicroBlaze]: Code changes for gdbserver. + +--- + gdb/features/Makefile | 1 + + gdb/features/microblaze-linux.xml | 1 + + gdb/regformats/microblaze-linux.dat | 64 +++++++++ + gdbserver/Makefile.in | 5 +- + gdbserver/configure.srv | 1 + + ...croblaze-low.c => linux-microblaze-low.cc} | 132 ++++++++++-------- + 6 files changed, 138 insertions(+), 66 deletions(-) + create mode 100644 gdb/regformats/microblaze-linux.dat + rename gdbserver/{linux-microblaze-low.c => linux-microblaze-low.cc} (72%) + +diff --git a/gdb/features/Makefile b/gdb/features/Makefile +index 131fc14adbf..1b15305862e 100644 +--- a/gdb/features/Makefile ++++ b/gdb/features/Makefile +@@ -47,6 +47,7 @@ + WHICH = mips-linux mips-dsp-linux \ + microblaze-with-stack-protect \ + microblaze64-with-stack-protect \ ++ microblaze-linux \ + mips64-linux mips64-dsp-linux \ + nios2-linux \ + rs6000/powerpc-32 \ +diff --git a/gdb/features/microblaze-linux.xml b/gdb/features/microblaze-linux.xml +index 8983e66eb3d..688a3f83d1e 100644 +--- a/gdb/features/microblaze-linux.xml ++++ b/gdb/features/microblaze-linux.xml +@@ -7,6 +7,7 @@ + + <!DOCTYPE target SYSTEM "gdb-target.dtd"> + <target> ++ <architecture>microblaze</architecture> + <osabi>GNU/Linux</osabi> + <xi:include href="microblaze-core.xml"/> + </target> +diff --git a/gdb/regformats/microblaze-linux.dat b/gdb/regformats/microblaze-linux.dat +new file mode 100644 +index 00000000000..b5b49f485cd +--- /dev/null ++++ b/gdb/regformats/microblaze-linux.dat +@@ -0,0 +1,64 @@ ++# THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi :set ro: ++# Generated from: microblaze-linux.xml ++name:microblaze_linux ++xmltarget:microblaze-linux.xml ++expedite:r1,rpc ++32:r0 ++32:r1 ++32:r2 ++32:r3 ++32:r4 ++32:r5 ++32:r6 ++32:r7 ++32:r8 ++32:r9 ++32:r10 ++32:r11 ++32:r12 ++32:r13 ++32:r14 ++32:r15 ++32:r16 ++32:r17 ++32:r18 ++32:r19 ++32:r20 ++32:r21 ++32:r22 ++32:r23 ++32:r24 ++32:r25 ++32:r26 ++32:r27 ++32:r28 ++32:r29 ++32:r30 ++32:r31 ++32:rpc ++32:rmsr ++32:rear ++32:resr ++32:rfsr ++32:rbtr ++32:rpvr0 ++32:rpvr1 ++32:rpvr2 ++32:rpvr3 ++32:rpvr4 ++32:rpvr5 ++32:rpvr6 ++32:rpvr7 ++32:rpvr8 ++32:rpvr9 ++32:rpvr10 ++32:rpvr11 ++32:redr ++32:rpid ++32:rzpr ++32:rtlbx ++32:rtlbsx ++32:rtlblo ++32:rtlbhi ++32:slr ++32:shr +diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in +index 46b5a0c7c60..eaaf6820fe0 100644 +--- a/gdbserver/Makefile.in ++++ b/gdbserver/Makefile.in +@@ -184,7 +184,7 @@ SFILES = \ + $(srcdir)/linux-ia64-low.cc \ + $(srcdir)/linux-low.cc \ + $(srcdir)/linux-m68k-low.cc \ +- $(srcdir)/linux-microblaze-low.c \ ++ $(srcdir)/linux-microblaze-low.cc \ + $(srcdir)/linux-mips-low.cc \ + $(srcdir)/linux-nios2-low.cc \ + $(srcdir)/linux-ppc-low.cc \ +@@ -222,7 +222,6 @@ SFILES = \ + $(srcdir)/../gdb/nat/linux-namespaces.c \ + $(srcdir)/../gdb/nat/linux-osdata.c \ + $(srcdir)/../gdb/nat/linux-personality.c \ +- $(srcdir)/../gdb/nat/microblaze-linux.c \ + $(srcdir)/../gdb/nat/mips-linux-watch.c \ + $(srcdir)/../gdb/nat/ppc-linux.c \ + $(srcdir)/../gdb/nat/riscv-linux-tdesc.c \ +@@ -564,8 +563,6 @@ target/%.o: ../gdb/target/%.c + + %-generated.cc: ../gdb/regformats/rs6000/%.dat $(regdat_sh) + $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@ +-microblaze-linux.c : $(srcdir)/../regformats/reg-microblaze.dat $(regdat_sh) +- $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-microblaze.dat microblaze-linux.c + + # + # Dependency tracking. +diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv +index af10cb05683..026b156bd60 100644 +--- a/gdbserver/configure.srv ++++ b/gdbserver/configure.srv +@@ -169,6 +169,7 @@ case "${gdbserver_host}" in + microblaze*-*-linux*) srv_regobj="microblaze-linux.o" + srv_tgtobj="$srv_linux_obj linux-microblaze-low.o " + srv_xmlfiles="microblaze-linux.xml" ++ srv_xmlfiles="${srv_xmlfiles} microblaze-core.xml" + srv_linux_regsets=yes + srv_linux_usrregs=yes + srv_linux_thread_db=yes +diff --git a/gdbserver/linux-microblaze-low.c b/gdbserver/linux-microblaze-low.cc +similarity index 72% +rename from gdbserver/linux-microblaze-low.c +rename to gdbserver/linux-microblaze-low.cc +index a2733f3c21c..d30fa102b5e 100644 +--- a/gdbserver/linux-microblaze-low.c ++++ b/gdbserver/linux-microblaze-low.cc +@@ -20,12 +20,17 @@ + #include "server.h" + #include "linux-low.h" + ++#include "elf/common.h" ++#include "nat/gdb_ptrace.h" ++#include <endian.h> ++ + #include <asm/ptrace.h> + #include <sys/procfs.h> + #include <sys/ptrace.h> + + #include "gdb_proc_service.h" + ++ + static int microblaze_regmap[] = + {PT_GPR(0), PT_GPR(1), PT_GPR(2), PT_GPR(3), + PT_GPR(4), PT_GPR(5), PT_GPR(6), PT_GPR(7), +@@ -39,14 +44,46 @@ static int microblaze_regmap[] = + PT_FSR + }; + ++ ++ ++class microblaze_target : public linux_process_target ++{ ++public: ++ ++ const regs_info *get_regs_info () override; ++ ++ const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override; ++ // CORE_ADDR microblaze_reinsert_addr (regcache *regcache); ++ ++protected: ++ ++ void low_arch_setup () override; ++ ++ bool low_cannot_fetch_register (int regno) override; ++ ++ bool low_cannot_store_register (int regno) override; ++ ++ // bool low_supports_breakpoints () override; ++ ++ CORE_ADDR low_get_pc (regcache *regcache) override; ++ ++ void low_set_pc (regcache *regcache, CORE_ADDR newpc) override; ++ ++ bool low_breakpoint_at (CORE_ADDR pc) override; ++}; ++ ++/* The singleton target ops object. */ ++ ++static microblaze_target the_microblaze_target; ++ + #define microblaze_num_regs (sizeof (microblaze_regmap) / sizeof (microblaze_regmap[0])) + + /* Defined in auto-generated file microblaze-linux.c. */ +-void init_registers_microblaze (void); +-extern const struct target_desc *tdesc_microblaze; ++void init_registers_microblaze_linux (void); ++extern const struct target_desc *tdesc_microblaze_linux; + +-static int +-microblaze_cannot_store_register (int regno) ++bool ++microblaze_target::low_cannot_store_register (int regno) + { + if (microblaze_regmap[regno] == -1 || regno == 0) + return 1; +@@ -54,14 +91,14 @@ microblaze_cannot_store_register (int regno) + return 0; + } + +-static int +-microblaze_cannot_fetch_register (int regno) ++bool ++microblaze_target::low_cannot_fetch_register (int regno) + { + return 0; + } + +-static CORE_ADDR +-microblaze_get_pc (struct regcache *regcache) ++CORE_ADDR ++microblaze_target::low_get_pc (struct regcache *regcache) + { + unsigned long pc; + +@@ -69,8 +106,8 @@ microblaze_get_pc (struct regcache *regcache) + return (CORE_ADDR) pc; + } + +-static void +-microblaze_set_pc (struct regcache *regcache, CORE_ADDR pc) ++void ++microblaze_target::low_set_pc (struct regcache *regcache, CORE_ADDR pc) + { + unsigned long newpc = pc; + +@@ -84,34 +121,35 @@ static const unsigned long microblaze_breakpoint = 0xba0c0018; + + /* Implementation of linux_target_ops method "sw_breakpoint_from_kind". */ + +-static const gdb_byte * +-microblaze_sw_breakpoint_from_kind (int kind, int *size) ++const gdb_byte * ++microblaze_target::sw_breakpoint_from_kind (int kind, int *size) + { + *size = microblaze_breakpoint_len; + return (const gdb_byte *) µblaze_breakpoint; + } + +-static int +-microblaze_breakpoint_at (CORE_ADDR where) ++bool ++microblaze_target::low_breakpoint_at (CORE_ADDR where) + { + unsigned long insn; + +- (*the_target->read_memory) (where, (unsigned char *) &insn, 4); ++ read_memory (where, (unsigned char *) &insn, 4); + if (insn == microblaze_breakpoint) + return 1; + /* If necessary, recognize more trap instructions here. GDB only uses the + one. */ + return 0; + } +- +-static CORE_ADDR +-microblaze_reinsert_addr (struct regcache *regcache) ++#if 0 ++CORE_ADDR ++microblaze_target::microblaze_reinsert_addr (struct regcache *regcache) + { + unsigned long pc; + collect_register_by_name (regcache, "r15", &pc); + return pc; + } +- ++#endif ++#if 0 + #ifdef HAVE_PTRACE_GETREGS + + static void +@@ -166,12 +204,15 @@ microblaze_store_gregset (struct regcache *regcache, const void *buf) + } + + #endif /* HAVE_PTRACE_GETREGS */ ++#endif + + static struct regset_info microblaze_regsets[] = { ++#if 0 + #ifdef HAVE_PTRACE_GETREGS + { PTRACE_GETREGS, PTRACE_SETREGS, 0, sizeof (elf_gregset_t), GENERAL_REGS, microblaze_fill_gregset, microblaze_store_gregset }, + { 0, 0, 0, -1, GENERAL_REGS, NULL, NULL }, + #endif /* HAVE_PTRACE_GETREGS */ ++#endif + { 0, 0, 0, -1, GENERAL_REGS, NULL, NULL }, + NULL_REGSET + }; +@@ -189,17 +230,17 @@ static struct regsets_info microblaze_regsets_info = + NULL, /* disabled_regsets */ + }; + +-static struct regs_info regs_info = ++static struct regs_info microblaze_regs_info = + { + NULL, /* regset_bitmap */ + µblaze_usrregs_info, + µblaze_regsets_info + }; + +-static const struct regs_info * +-microblaze_regs_info (void) ++const regs_info * ++microblaze_target::get_regs_info (void) + { +- return ®s_info; ++ return µblaze_regs_info; + } + + /* Support for hardware single step. */ +@@ -211,50 +252,17 @@ microblaze_supports_hardware_single_step (void) + } + + +-static void +-microblaze_arch_setup (void) ++void ++microblaze_target::low_arch_setup (void) + { +- current_process ()->tdesc = tdesc_microblaze; ++ current_process ()->tdesc = tdesc_microblaze_linux; + } + +-struct linux_target_ops the_low_target = { +- microblaze_arch_setup, +- microblaze_regs_info, +- microblaze_cannot_fetch_register, +- microblaze_cannot_store_register, +- NULL, /* fetch_register */ +- microblaze_get_pc, +- microblaze_set_pc, +- NULL, +- microblaze_sw_breakpoint_from_kind, +- NULL, +- 0, +- microblaze_breakpoint_at, +- NULL, +- NULL, +- NULL, +- NULL, +- NULL, +- microblaze_collect_ptrace_register, +- microblaze_supply_ptrace_register, +- NULL, /* siginfo_fixup */ +- NULL, /* new_process */ +- NULL, /* new_thread */ +- NULL, /* new_fork */ +- NULL, /* prepare_to_resume */ +- NULL, /* process_qsupported */ +- NULL, /* supports_tracepoints */ +- NULL, /* get_thread_area */ +- NULL, /* install_fast_tracepoint_jump_pad */ +- NULL, /* emit_ops */ +- NULL, /* get_min_fast_tracepoint_insn_len */ +- NULL, /* supports_range_stepping */ +- NULL, /* breakpoint_kind_from_current_state */ +- microblaze_supports_hardware_single_step, +-}; ++linux_process_target *the_linux_target = &the_microblaze_target; + + void + initialize_low_arch (void) + { +- init_registers_microblaze (); ++ init_registers_microblaze_linux (); ++ initialize_regsets_info (µblaze_regsets_info); + } +-- +2.17.1 + diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0011-Patch-Microblaze-Depth-Total-number.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0011-Patch-Microblaze-Depth-Total-number.patch new file mode 100644 index 00000000..0e9c1a74 --- /dev/null +++ b/meta-microblaze/recipes-devtools/gdb/gdb/0011-Patch-Microblaze-Depth-Total-number.patch @@ -0,0 +1,61 @@ +From 1f6eef2eb2e6974ba9989977d1b1c8dfdeca94f4 Mon Sep 17 00:00:00 2001 +From: Mahesh Bodapati <mbodapat@xilinx.com> +Date: Thu, 21 Jul 2022 11:45:01 +0530 +Subject: [PATCH] =?UTF-8?q?[Patch,MicroBlaze]:=20Depth:=20=20Total=20numbe?= + =?UTF-8?q?r=20of=20inline=20functions=20[refer=20inline-frame.c]=20state-?= + =?UTF-8?q?>skipped=5Fframes=20:=20Number=20of=20inline=20functions=20skip?= + =?UTF-8?q?ped.=20the=20current=20unwind=5Fpc=20is=20causing=20an=20issue?= + =?UTF-8?q?=20when=20we=20try=20to=20step=20into=20inline=20functions[Dept?= + =?UTF-8?q?h=20is=20becoming=200].=20It=E2=80=99s=20incrementing=20pc=20by?= + =?UTF-8?q?=208=20even=20with=20si=20instruction.?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + gdb/microblaze-tdep.c | 14 +++----------- + 1 file changed, 3 insertions(+), 11 deletions(-) + +diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c +index aad6a9cae6e..41a2eb511d6 100644 +--- a/gdb/microblaze-tdep.c ++++ b/gdb/microblaze-tdep.c +@@ -524,16 +524,8 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, + static CORE_ADDR + microblaze_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) + { +- gdb_byte buf[4]; + CORE_ADDR pc; +- +- frame_unwind_register (next_frame, MICROBLAZE_PC_REGNUM, buf); +- pc = extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr); +- /* For sentinel frame, return address is actual PC. For other frames, +- return address is pc+8. This is a workaround because gcc does not +- generate correct return address in CIE. */ +- if (frame_relative_level (next_frame) >= 0) +- pc += 8; ++ pc=frame_unwind_register_unsigned (next_frame, MICROBLAZE_PC_REGNUM); + return pc; + } + +@@ -564,7 +556,6 @@ microblaze_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) + ostart_pc = microblaze_analyze_prologue (gdbarch, func_start, 0xffffffffUL, + &cache); + +- + if (ostart_pc > start_pc) + return ostart_pc; + return start_pc; +@@ -670,7 +661,8 @@ static const struct frame_unwind microblaze_frame_unwind = + microblaze_frame_this_id, + microblaze_frame_prev_register, + NULL, +- default_frame_sniffer ++ default_frame_sniffer, ++ NULL, + }; + + static CORE_ADDR +-- +2.17.1 + diff --git a/meta-microblaze/recipes-devtools/gdb/gdb_%.bbappend b/meta-microblaze/recipes-devtools/gdb/gdb_%.bbappend index 23866471..33fbe158 100644 --- a/meta-microblaze/recipes-devtools/gdb/gdb_%.bbappend +++ b/meta-microblaze/recipes-devtools/gdb/gdb_%.bbappend @@ -1,11 +1,4 @@ MICROBLAZEPATCHES = "" MICROBLAZEPATCHES:microblaze = "gdb-microblaze.inc" -# We don't have ptrace support for on-target microblaze GDB currently. Need -# to use tcf-agent or other external debug interface. -MB_DOES_NOT_WORK = "" -MB_DOES_NOT_WORK:microblaze = "GDB is not currently supported on Microblaze." - -PNBLACKLIST[gdb] = "${MB_DOES_NOT_WORK}" - require ${MICROBLAZEPATCHES} diff --git a/meta-microblaze/recipes-extended/ltp/ltp_%.bbappend b/meta-microblaze/recipes-extended/ltp/ltp_%.bbappend deleted file mode 100644 index 85bcc731..00000000 --- a/meta-microblaze/recipes-extended/ltp/ltp_%.bbappend +++ /dev/null @@ -1,2 +0,0 @@ -# gdb on-target is not supported on Microblaze -RDEPENDS:${PN}:remove:microblaze = "gdb" diff --git a/meta-xilinx-bsp/README.md b/meta-xilinx-bsp/README.md index e4142861..f41f6d4a 100644 --- a/meta-xilinx-bsp/README.md +++ b/meta-xilinx-bsp/README.md @@ -1,56 +1,38 @@ -meta-xilinx -=========== +# meta-xilinx -This layer provides support for MicroBlaze, Zynq and ZynqMP. +This layer provides support for MicroBlaze, Zynq, ZynqMP and Versal architectures Xilinx evaluation boards. -Additional documentation: +## Additional documentation: -* [Building](README.building.md) -* [Booting](README.booting.md) +* [Building](../README.building.md) +* [Booting](../README.booting.md) -Supported Boards/Machines -========================= +## Supported Boards/Machines -Boards/Machines supported by this layer: +**Boards/Machines supported by this layer:** -* MicroBlaze: - * [Xilinx ML605 (QEMU)](conf/machine/ml605-qemu-microblazeel.conf) - `ml605-qemu-microblazeel` (QEMU support) - * [Xilinx S3A DSP 1800 (QEMU)](conf/machine/s3adsp1800-qemu-microblazeeb.conf) - `s3adsp1800-qemu-microblazeeb` (QEMU support) - * [Xilinx KC705](conf/machine/kc705-microblazeel.conf) - `kc705-microblazeel` -* Zynq: - * [Zynq (QEMU)](conf/machine/qemu-zynq7.conf) - `qemu-zynq7` (QEMU Support) - * [Xilinx ZC702](conf/machine/zc702-zynq7.conf) - `zc702-zynq7` (with QEMU support) - * [Xilinx ZC706](conf/machine/zc706-zynq7.conf) - `zc706-zynq7` (with QEMU support) - * [Avnet MicroZed](conf/machine/microzed-zynq7.conf) - `microzed-zynq7` - * [Avnet PicoZed](conf/machine/picozed-zynq7.conf) - `picozed-zynq7` - * [Avnet/Digilent ZedBoard](conf/machine/zedboard-zynq7.conf) - `zedboard-zynq7` - * [Digilent Zybo](conf/machine/zybo-zynq7.conf) - `zybo-zynq7` - * [Digilent Zybo Linux BD](conf/machine/zybo-linux-bd-zynq7.conf) - `zybo-linux-bd-zynq7` -* ZynqMP: - * [Xilinx ZCU102](conf/machine/zcu102-zynqmp.conf) - `zcu102-zynqmp` (QEMU support) - * [Xilinx ZCU106](conf/machine/zcu106-zynqmp.conf) - `zcu106-zynqmp` - * [Xilinx ZCU104](conf/machine/zcu104-zynqmp.conf) - `zcu104-zynqmp` +| Platform | Xilinx Board Variant | Machine Configuration file | Board Device tree | +| ---| --- | ---| ---------- | +|MicroBlaze|[Xilinx KC705](https://www.xilinx.com/products/boards-and-kits/ek-k7-kc705-g.html)|[kc705-microblazeel](conf/machine/kc705-microblazeel.conf)|`kc705-full`| +|Zynq-7000|Zynq (QEMU)|[qemu-zynq7](conf/machine/qemu-zynq7.conf)|NA| +||[Xilinx ZC702](https://www.xilinx.com/products/boards-and-kits/ek-z7-zc702-g.html)|[zc702-zynq7](conf/machine/zc702-zynq7.conf)|`zc702`| +||[Xilinx ZC706](https://www.xilinx.com/products/boards-and-kits/ek-z7-zc706-g.html)|[zc706-zynq7](conf/machine/zc706-zynq7.conf)|`zc706`| +|ZynqMP|[Xilinx ZCU102](https://www.xilinx.com/products/boards-and-kits/ek-u1-zcu102-g.html)|[zcu102-zynqmp](conf/machine/zcu102-zynqmp.conf)|`zcu102-rev1.0`| +||[Xilinx ZCU104](https://www.xilinx.com/products/boards-and-kits/zcu104.html)|[zcu104-zynqmp](conf/machine/zcu104-zynqmp.conf)|`zcu104-revc`| +||[Xilinx ZCU106](https://www.xilinx.com/products/boards-and-kits/zcu106.html)|[zcu106-zynqmp](conf/machine/zcu106-zynqmp.conf)|`zcu106-reva`| +||[Xilinx ZCU111](https://www.xilinx.com/products/boards-and-kits/zcu111.html)|[zcu111-zynqmp](conf/machine/zcu111-zynqmp.conf)|`zcu111-reva`| +||[Xilinx ZCU1275](https://www.xilinx.com/products/boards-and-kits/zcu1275.html)|[zcu1275-zynqmp](conf/machine/zcu1275-zynqmp.conf)|`zcu1275-revb`| +||[Xilinx ZCU1285](https://www.xilinx.com/products/boards-and-kits/zcu1285.html)|[zcu1285-zynqmp](conf/machine/zcu1285-zynqmp.conf)|`zcu1285-reva`| +||[Xilinx ZCU208](https://www.xilinx.com/products/boards-and-kits/zcu208.html)|[zcu208-zynqmp](conf/machine/zcu208-zynqmp.conf)|`zcu208-reva`| +||[Xilinx ZCU216](https://www.xilinx.com/products/boards-and-kits/zcu216.html)|[zcu216-zynqmp](conf/machine/zcu216-zynqmp.conf)|`zcu216-reva`| +|Versal|[Xilinx VCK190](https://www.xilinx.com/products/boards-and-kits/vck190.html)|[vck190-versal](conf/machine/vck190-versal.conf)|`versal-vck190-reva-x-ebm-01-reva`| +||[Xilinx VMK180](https://www.xilinx.com/products/boards-and-kits/vmk180.html)|[vmk180-versal](conf/machine/vmk180-versal.conf)|`versal-vmk180-reva-x-ebm-01-reva`| +||[Xilinx VCK5000](https://www.xilinx.com/products/boards-and-kits/vck5000.html)|[vck5000-versal](conf/machine/vck5000-versal.conf)|`versal-vck5000-reva-x-ebm-01-reva`| -Additional information on Xilinx architectures can be found at: - http://www.xilinx.com/support/index.htm +> **Note:** Additional information on Xilinx architectures can be found at: + https://www.xilinx.com/products/silicon-devices.html -For Zybo Linux BD reference design, please see meta-xilinx-contrib layer - -Maintainers, Mailing list, Patches -================================== - -Please send any patches, pull requests, comments or questions for this layer to -the [meta-xilinx mailing list](https://lists.yoctoproject.org/listinfo/meta-xilinx): - - meta-xilinx@lists.yoctoproject.org - -Maintainers: - - Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> - Mark Hatle <mark.hatle@xilinx.com> - -Dependencies -============ +## Dependencies This layer depends on: @@ -58,31 +40,9 @@ This layer depends on: URI: git://git.openembedded.org/openembedded-core layers: meta + branch: master or xilinx current release version (e.g. hosister) -Recipe Licenses -=============== - -Due to licensing restrictions some recipes in this layer rely on closed source -or restricted content provided by Xilinx. In order to use these recipes you must -accept or agree to the licensing terms (e.g. EULA, Export Compliance, NDA, -Redistribution, etc). This layer **does not enforce** any legal requirement, it -is the **responsibility of the user** the ensure that they are in compliance -with any licenses or legal requirements for content used. - -In order to use recipes that rely on restricted content the `xilinx` license -flag must be white-listed in the build configuration (e.g. `local.conf`). This -can be done on a per package basis: - - LICENSE_FLAGS_WHITELIST += "xilinx_pmu-rom" - -or generally: - - LICENSE_FLAGS_WHITELIST += "xilinx" - -Generally speaking Xilinx content that is provided as a restricted download -cannot be obtained without a Xilinx account, in order to use this content you -must first download it with your Xilinx account and place the downloaded content -in the `downloads/` directory of your build or on a `PREMIRROR`. Attempting to -fetch the content using bitbake will fail, indicating the URL from which to -acquire the content. + URI: git://git.yoctoproject.org/meta-xilinx.git + layers: meta-xilinx-microblaze, meta-xilinx-core + branch: master or xilinx current release version (e.g. hosister) diff --git a/meta-xilinx-bsp/conf/layer.conf b/meta-xilinx-bsp/conf/layer.conf index b5bb3b19..ef9e1a1d 100644 --- a/meta-xilinx-bsp/conf/layer.conf +++ b/meta-xilinx-bsp/conf/layer.conf @@ -17,3 +17,5 @@ BBFILE_PRIORITY_xilinx-bsp = "5" LAYERDEPENDS_xilinx-bsp = "xilinx" LAYERSERIES_COMPAT_xilinx-bsp = "honister" + +PREFERRED_VERSION_kc705-bitstream ?= "${XILINX_RELEASE_VERSION}" diff --git a/meta-xilinx-bsp/conf/machine/qemu-zynq7.conf b/meta-xilinx-bsp/conf/machine/qemu-zynq7.conf deleted file mode 100644 index f28e3d4a..00000000 --- a/meta-xilinx-bsp/conf/machine/qemu-zynq7.conf +++ /dev/null @@ -1,9 +0,0 @@ -#@TYPE: Machine -#@NAME: qemu-zynq7 -#@DESCRIPTION: Zynq QEMU machine support ('xilinx-zynq-a9' model) - -require conf/machine/zynq-generic.conf - -# Use the networking setup from qemuarm -MACHINEOVERRIDES:prepend:pn-init-ifupdown = "qemuall:" -FILESOVERRIDES:append:pn-init-ifupdown = ":qemuarm" diff --git a/meta-xilinx-bsp/conf/machine/s3adsp1800-qemu-microblazeeb.conf b/meta-xilinx-bsp/conf/machine/s3adsp1800-qemu-microblazeeb.conf deleted file mode 100644 index 12621357..00000000 --- a/meta-xilinx-bsp/conf/machine/s3adsp1800-qemu-microblazeeb.conf +++ /dev/null @@ -1,21 +0,0 @@ -#@TYPE: Machine -#@NAME: s3adsp1800-qemu-microblazeeb -#@DESCRIPTION: MicroBlaze QEMU machine support ('petalogix-s3adsp1800' model) - -TUNE_FEATURES:tune-microblaze ?= "microblaze v8.00 bigendian barrel-shift pattern-compare multiply-low" - -require conf/machine/microblaze-generic.conf - -MACHINE_FEATURES = "" - -USE_VT = "" -SERIAL_CONSOLES ?= "115200;ttyUL0" - -KERNEL_IMAGETYPE ?= "linux.bin.ub" - -# This machine is a targeting a QEMU model, runqemu setup: -QB_MEM = "-m 256" -QB_MACHINE = "-machine petalogix-s3adsp1800" -QB_OPT_APPEND = "-nographic -serial mon:stdio" -QB_NETWORK_DEVICE = "-net nic,netdev=net0,macaddr=@MAC@" - diff --git a/meta-xilinx-bsp/conf/machine/v350-versal.conf b/meta-xilinx-bsp/conf/machine/v350-versal.conf deleted file mode 100644 index d865dc5a..00000000 --- a/meta-xilinx-bsp/conf/machine/v350-versal.conf +++ /dev/null @@ -1,19 +0,0 @@ -#@TYPE: Machine -#@NAME: v350-versal -##@DESCRIPTION: Machine support for v350 versal. - -SOC_VARIANT = "ai-core" - -require conf/machine/versal-generic.conf - -# Add board compatibility override -MACHINEOVERRIDES .= ":v350" - -EXTRA_IMAGEDEPENDS += " \ - arm-trusted-firmware \ - virtual/boot-bin \ - virtual/bootloader \ - virtual/psm-firmware \ - virtual/plm \ - u-boot-zynq-scr \ -" diff --git a/meta-xilinx-bsp/conf/machine/vc-p-a2197-00-versal.conf b/meta-xilinx-bsp/conf/machine/vc-p-a2197-00-versal.conf deleted file mode 100644 index c20166e3..00000000 --- a/meta-xilinx-bsp/conf/machine/vc-p-a2197-00-versal.conf +++ /dev/null @@ -1,10 +0,0 @@ -#@TYPE: Machine -#@NAME: vc-p-a2197-versal -##@DESCRIPTION: Machine support for vc-p-a2197 versal . - -SOC_VARIANT = "ai-core" - -require conf/machine/versal-generic.conf - -# Add board compatibility override -MACHINEOVERRIDES .= ":vc-p-a2197-00" diff --git a/meta-xilinx-bsp/dynamic-layers/meta-xilinx-tools/recipes-bsp/device-tree/device-tree.bbappend b/meta-xilinx-bsp/dynamic-layers/meta-xilinx-tools/recipes-bsp/device-tree/device-tree.bbappend index f3c932db..0b41fb1f 100644 --- a/meta-xilinx-bsp/dynamic-layers/meta-xilinx-tools/recipes-bsp/device-tree/device-tree.bbappend +++ b/meta-xilinx-bsp/dynamic-layers/meta-xilinx-tools/recipes-bsp/device-tree/device-tree.bbappend @@ -1,7 +1,3 @@ -YAML_MAIN_MEMORY_CONFIG:ultra96 ?= "psu_ddr_0" -YAML_CONSOLE_DEVICE_CONFIG:ultra96 ?= "psu_uart_1" -YAML_DT_BOARD_FLAGS:ultra96 ?= "{BOARD avnet-ultra96-rev1}" - YAML_MAIN_MEMORY_CONFIG:kc705 ?= "mig_7series_0" YAML_CONSOLE_DEVICE_CONFIG:kc705 ?= "axi_uartlite_0" YAML_DT_BOARD_FLAGS:kc705 ?= "{BOARD kc705-full}" @@ -10,7 +6,6 @@ YAML_DT_BOARD_FLAGS:zcu102 ?= "{BOARD zcu102-rev1.0}" YAML_DT_BOARD_FLAGS:zcu106 ?= "{BOARD zcu106-reva}" YAML_DT_BOARD_FLAGS:zc702 ?= "{BOARD zc702}" YAML_DT_BOARD_FLAGS:zc706 ?= "{BOARD zc706}" -YAML_DT_BOARD_FLAGS:zedboard ?= "{BOARD zedboard}" YAML_DT_BOARD_FLAGS:zc1254 ?= "{BOARD zc1254-reva}" YAML_DT_BOARD_FLAGS:zcu104 ?= "{BOARD zcu104-revc}" YAML_DT_BOARD_FLAGS:zcu111 ?= "{BOARD zcu111-reva}" @@ -37,4 +32,6 @@ YAML_DT_BOARD_FLAGS:k26 ?= "{BOARD zynqmp-sm-k26-reva}" YAML_DT_BOARD_FLAGS:zcu670 ?= "{BOARD zcu670-revb}" YAML_DT_BOARD_FLAGS:vpk120 ?= "{BOARD versal-vpk120-reva}" YAML_DT_BOARD_FLAGS:vpk-sc ?= "{BOARD zynqmp-vpk120-reva}" - +YAML_DT_BOARD_FLAGS:vpk180 ?= "{BOARD versal-vpk180-reva}" +YAML_DT_BOARD_FLAGS:vhk158 ?= "{BOARD versal-vhk158-reva}" +YAML_DT_BOARD_FLAGS:vek280 ?= "{BOARD versal-vek280-reva}" diff --git a/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bbappend b/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bbappend index df31778c..9ab3f24e 100644 --- a/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bbappend +++ b/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bbappend @@ -1,23 +1,13 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:" # device tree sources for the various machines -COMPATIBLE_MACHINE:picozed-zynq7 = ".*" -SRC_URI:append:picozed-zynq7 = " file://picozed-zynq7.dts" - COMPATIBLE_MACHINE:qemu-zynq7 = ".*" SRC_URI:append:qemu-zynq7 = " file://qemu-zynq7.dts" -COMPATIBLE_MACHINE:zybo-linux-bd-zynq7 = ".*" -SRC_URI:append:zybo-linux-bd-zynq7 = " \ - file://zybo-linux-bd-zynq7.dts \ - file://pcw.dtsi \ - file://pl.dtsi \ - " - -COMPATIBLE_MACHINE:kc705-microblazeel = ".*" -SRC_URI:append:kc705-microblazeel = " \ - file://kc705-microblazeel.dts \ - file://pl.dtsi \ - file://system-conf.dtsi \ - " +SRC_URI:append = "${@bb.utils.contains('MACHINE_FEATURES', 'provencore', ' file://pnc.dtsi', '', d)}" +do_configure:append() { + if [ ${@bb.utils.contains('MACHINE_FEATURES', 'provencore', 'true', '', d)} ]; then + echo '#include "pnc.dtsi"' >> ${DT_FILES_PATH}/system-top.dts + fi +} diff --git a/meta-xilinx-bsp/recipes-bsp/device-tree/files/kc705-microblazeel/kc705-microblazeel.dts b/meta-xilinx-bsp/recipes-bsp/device-tree/files/kc705-microblazeel/kc705-microblazeel.dts deleted file mode 100644 index 45e488c1..00000000 --- a/meta-xilinx-bsp/recipes-bsp/device-tree/files/kc705-microblazeel/kc705-microblazeel.dts +++ /dev/null @@ -1,56 +0,0 @@ -/dts-v1/; -/include/ "pl.dtsi" -/include/ "system-conf.dtsi" -/ { - hard-reset-gpios = <&reset_gpio 0 1>; - aliases { - ethernet0 = &axi_ethernet; - i2c0 = &iic_main; - serial0 = &rs232_uart; - }; - memory { - device_type = "memory"; - reg = <0x80000000 0x40000000>; - }; -}; - -&iic_main { - i2cswitch@74 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x74>; - i2c@0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - si570: clock-generator@5d { - #clock-cells = <0>; - compatible = "silabs,si570"; - temperature-stability = <50>; - reg = <0x5d>; - factory-fout = <156250000>; - clock-frequency = <148500000>; - }; - }; - i2c@3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - eeprom@54 { - compatible = "at,24c08"; - reg = <0x54>; - }; - }; - }; -}; - -&axi_ethernet { - phy-handle = <&phy0>; - axi_ethernet_mdio: mdio { - phy0: phy@7 { - device_type = "ethernet-phy"; - reg = <7>; - }; - }; -}; diff --git a/meta-xilinx-bsp/recipes-bsp/device-tree/files/kc705-microblazeel/pl.dtsi b/meta-xilinx-bsp/recipes-bsp/device-tree/files/kc705-microblazeel/pl.dtsi deleted file mode 100644 index 43bc2ab7..00000000 --- a/meta-xilinx-bsp/recipes-bsp/device-tree/files/kc705-microblazeel/pl.dtsi +++ /dev/null @@ -1,445 +0,0 @@ -/ { - #address-cells = <1>; - #size-cells = <1>; - compatible = "xlnx,microblaze"; - model = "Xilinx MicroBlaze"; - cpus { - #address-cells = <1>; - #cpus = <1>; - #size-cells = <0>; - microblaze_0: cpu@0 { - bus-handle = <&amba_pl>; - clock-frequency = <200000000>; - clocks = <&clk_cpu>; - compatible = "xlnx,microblaze-10.0"; - d-cache-baseaddr = <0x0000000080000000>; - d-cache-highaddr = <0x00000000bfffffff>; - d-cache-line-size = <0x20>; - d-cache-size = <0x4000>; - device_type = "cpu"; - i-cache-baseaddr = <0x0000000080000000>; - i-cache-highaddr = <0x00000000bfffffff>; - i-cache-line-size = <0x10>; - i-cache-size = <0x4000>; - interrupt-handle = <µblaze_0_axi_intc>; - model = "microblaze,10.0"; - timebase-frequency = <200000000>; - xlnx,addr-size = <0x20>; - xlnx,addr-tag-bits = <0x10>; - xlnx,allow-dcache-wr = <0x1>; - xlnx,allow-icache-wr = <0x1>; - xlnx,area-optimized = <0x0>; - xlnx,async-interrupt = <0x1>; - xlnx,async-wakeup = <0x3>; - xlnx,avoid-primitives = <0x0>; - xlnx,base-vectors = <0x0000000000000000>; - xlnx,branch-target-cache-size = <0x0>; - xlnx,cache-byte-size = <0x4000>; - xlnx,d-axi = <0x1>; - xlnx,d-lmb = <0x1>; - xlnx,d-lmb-mon = <0x0>; - xlnx,daddr-size = <0x20>; - xlnx,data-size = <0x20>; - xlnx,dc-axi-mon = <0x0>; - xlnx,dcache-addr-tag = <0x10>; - xlnx,dcache-always-used = <0x1>; - xlnx,dcache-byte-size = <0x4000>; - xlnx,dcache-data-width = <0x0>; - xlnx,dcache-force-tag-lutram = <0x0>; - xlnx,dcache-line-len = <0x8>; - xlnx,dcache-use-writeback = <0x0>; - xlnx,dcache-victims = <0x0>; - xlnx,debug-counter-width = <0x20>; - xlnx,debug-enabled = <0x1>; - xlnx,debug-event-counters = <0x5>; - xlnx,debug-external-trace = <0x0>; - xlnx,debug-interface = <0x0>; - xlnx,debug-latency-counters = <0x1>; - xlnx,debug-profile-size = <0x0>; - xlnx,debug-trace-async-reset = <0x0>; - xlnx,debug-trace-size = <0x2000>; - xlnx,div-zero-exception = <0x1>; - xlnx,dp-axi-mon = <0x0>; - xlnx,dynamic-bus-sizing = <0x0>; - xlnx,ecc-use-ce-exception = <0x0>; - xlnx,edge-is-positive = <0x1>; - xlnx,enable-discrete-ports = <0x0>; - xlnx,endianness = <0x1>; - xlnx,fault-tolerant = <0x0>; - xlnx,fpu-exception = <0x0>; - xlnx,freq = <0xbebc200>; - xlnx,fsl-exception = <0x0>; - xlnx,fsl-links = <0x0>; - xlnx,i-axi = <0x0>; - xlnx,i-lmb = <0x1>; - xlnx,i-lmb-mon = <0x0>; - xlnx,iaddr-size = <0x20>; - xlnx,ic-axi-mon = <0x0>; - xlnx,icache-always-used = <0x1>; - xlnx,icache-data-width = <0x0>; - xlnx,icache-force-tag-lutram = <0x0>; - xlnx,icache-line-len = <0x4>; - xlnx,icache-streams = <0x1>; - xlnx,icache-victims = <0x8>; - xlnx,ill-opcode-exception = <0x1>; - xlnx,imprecise-exceptions = <0x0>; - xlnx,instr-size = <0x20>; - xlnx,interconnect = <0x2>; - xlnx,interrupt-is-edge = <0x0>; - xlnx,interrupt-mon = <0x0>; - xlnx,ip-axi-mon = <0x0>; - xlnx,lockstep-master = <0x0>; - xlnx,lockstep-select = <0x0>; - xlnx,lockstep-slave = <0x0>; - xlnx,mmu-dtlb-size = <0x4>; - xlnx,mmu-itlb-size = <0x2>; - xlnx,mmu-privileged-instr = <0x0>; - xlnx,mmu-tlb-access = <0x3>; - xlnx,mmu-zones = <0x2>; - xlnx,num-sync-ff-clk = <0x2>; - xlnx,num-sync-ff-clk-debug = <0x2>; - xlnx,num-sync-ff-clk-irq = <0x1>; - xlnx,num-sync-ff-dbg-clk = <0x1>; - xlnx,num-sync-ff-dbg-trace-clk = <0x2>; - xlnx,number-of-pc-brk = <0x1>; - xlnx,number-of-rd-addr-brk = <0x0>; - xlnx,number-of-wr-addr-brk = <0x0>; - xlnx,opcode-0x0-illegal = <0x1>; - xlnx,optimization = <0x0>; - xlnx,pc-width = <0x20>; - xlnx,piaddr-size = <0x20>; - xlnx,pvr = <0x2>; - xlnx,pvr-user1 = <0x00>; - xlnx,pvr-user2 = <0x00000000>; - xlnx,reset-msr = <0x00000000>; - xlnx,reset-msr-bip = <0x0>; - xlnx,reset-msr-dce = <0x0>; - xlnx,reset-msr-ee = <0x0>; - xlnx,reset-msr-eip = <0x0>; - xlnx,reset-msr-ice = <0x0>; - xlnx,reset-msr-ie = <0x0>; - xlnx,sco = <0x0>; - xlnx,trace = <0x0>; - xlnx,unaligned-exceptions = <0x1>; - xlnx,use-barrel = <0x1>; - xlnx,use-branch-target-cache = <0x0>; - xlnx,use-config-reset = <0x0>; - xlnx,use-dcache = <0x1>; - xlnx,use-div = <0x1>; - xlnx,use-ext-brk = <0x0>; - xlnx,use-ext-nm-brk = <0x0>; - xlnx,use-extended-fsl-instr = <0x0>; - xlnx,use-fpu = <0x0>; - xlnx,use-hw-mul = <0x2>; - xlnx,use-icache = <0x1>; - xlnx,use-interrupt = <0x2>; - xlnx,use-mmu = <0x3>; - xlnx,use-msr-instr = <0x1>; - xlnx,use-non-secure = <0x0>; - xlnx,use-pcmp-instr = <0x1>; - xlnx,use-reorder-instr = <0x1>; - xlnx,use-stack-protection = <0x0>; - }; - }; - clocks { - #address-cells = <1>; - #size-cells = <0>; - clk_cpu: clk_cpu@0 { - #clock-cells = <0>; - clock-frequency = <200000000>; - clock-output-names = "clk_cpu"; - compatible = "fixed-clock"; - reg = <0>; - }; - clk_bus_0: clk_bus_0@1 { - #clock-cells = <0>; - clock-frequency = <200000000>; - clock-output-names = "clk_bus_0"; - compatible = "fixed-clock"; - reg = <1>; - }; - }; - amba_pl: amba_pl { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges ; - axi_ethernet: ethernet@40c00000 { - axistream-connected = <&axi_ethernet_dma>; - axistream-control-connected = <&axi_ethernet_dma>; - clock-frequency = <100000000>; - compatible = "xlnx,axi-ethernet-1.00.a"; - device_type = "network"; - interrupt-parent = <µblaze_0_axi_intc>; - interrupts = <4 2>; - phy-mode = "gmii"; - reg = <0x40c00000 0x40000>; - xlnx = <0x0>; - xlnx,axiliteclkrate = <0x0>; - xlnx,axisclkrate = <0x0>; - xlnx,clockselection = <0x0>; - xlnx,enableasyncsgmii = <0x0>; - xlnx,gt-type = <0x0>; - xlnx,gtinex = <0x0>; - xlnx,gtlocation = <0x0>; - xlnx,gtrefclksrc = <0x0>; - xlnx,include-dre ; - xlnx,instantiatebitslice0 = <0x0>; - xlnx,phy-type = <0x1>; - xlnx,phyaddr = <0x1>; - xlnx,rable = <0x0>; - xlnx,rxcsum = <0x0>; - xlnx,rxlane0-placement = <0x0>; - xlnx,rxlane1-placement = <0x0>; - xlnx,rxmem = <0x1000>; - xlnx,rxnibblebitslice0used = <0x0>; - xlnx,tx-in-upper-nibble = <0x1>; - xlnx,txcsum = <0x0>; - xlnx,txlane0-placement = <0x0>; - xlnx,txlane1-placement = <0x0>; - axi_ethernet_mdio: mdio { - #address-cells = <1>; - #size-cells = <0>; - }; - }; - axi_ethernet_dma: dma@41e00000 { - #dma-cells = <1>; - axistream-connected = <&axi_ethernet>; - axistream-control-connected = <&axi_ethernet>; - clock-frequency = <200000000>; - clock-names = "s_axi_lite_aclk"; - clocks = <&clk_bus_0>; - compatible = "xlnx,eth-dma"; - interrupt-parent = <µblaze_0_axi_intc>; - interrupts = <3 2 2 2>; - reg = <0x41e00000 0x10000>; - xlnx,include-dre ; - }; - axi_timer_0: timer@41c00000 { - clock-frequency = <200000000>; - clocks = <&clk_bus_0>; - compatible = "xlnx,xps-timer-1.00.a"; - interrupt-parent = <µblaze_0_axi_intc>; - interrupts = <5 2>; - reg = <0x41c00000 0x10000>; - xlnx,count-width = <0x20>; - xlnx,gen0-assert = <0x1>; - xlnx,gen1-assert = <0x1>; - xlnx,one-timer-only = <0x0>; - xlnx,trig0-assert = <0x1>; - xlnx,trig1-assert = <0x1>; - }; - calib_complete_gpio: gpio@40010000 { - #gpio-cells = <2>; - compatible = "xlnx,xps-gpio-1.00.a"; - gpio-controller ; - reg = <0x40010000 0x10000>; - xlnx,all-inputs = <0x1>; - xlnx,all-inputs-2 = <0x0>; - xlnx,all-outputs = <0x0>; - xlnx,all-outputs-2 = <0x0>; - xlnx,dout-default = <0x00000000>; - xlnx,dout-default-2 = <0x00000000>; - xlnx,gpio-width = <0x1>; - xlnx,gpio2-width = <0x20>; - xlnx,interrupt-present = <0x0>; - xlnx,is-dual = <0x0>; - xlnx,tri-default = <0xFFFFFFFF>; - xlnx,tri-default-2 = <0xFFFFFFFF>; - }; - dip_switches_4bits: gpio@40020000 { - #gpio-cells = <2>; - compatible = "xlnx,xps-gpio-1.00.a"; - gpio-controller ; - reg = <0x40020000 0x10000>; - xlnx,all-inputs = <0x1>; - xlnx,all-inputs-2 = <0x0>; - xlnx,all-outputs = <0x0>; - xlnx,all-outputs-2 = <0x0>; - xlnx,dout-default = <0x00000000>; - xlnx,dout-default-2 = <0x00000000>; - xlnx,gpio-width = <0x4>; - xlnx,gpio2-width = <0x20>; - xlnx,interrupt-present = <0x0>; - xlnx,is-dual = <0x0>; - xlnx,tri-default = <0xFFFFFFFF>; - xlnx,tri-default-2 = <0xFFFFFFFF>; - }; - iic_main: i2c@40800000 { - #address-cells = <1>; - #size-cells = <0>; - clock-frequency = <200000000>; - clocks = <&clk_bus_0>; - compatible = "xlnx,xps-iic-2.00.a"; - interrupt-parent = <µblaze_0_axi_intc>; - interrupts = <1 2>; - reg = <0x40800000 0x10000>; - }; - led_8bits: gpio@40030000 { - #gpio-cells = <2>; - compatible = "xlnx,xps-gpio-1.00.a"; - gpio-controller ; - reg = <0x40030000 0x10000>; - xlnx,all-inputs = <0x0>; - xlnx,all-inputs-2 = <0x0>; - xlnx,all-outputs = <0x1>; - xlnx,all-outputs-2 = <0x0>; - xlnx,dout-default = <0x00000000>; - xlnx,dout-default-2 = <0x00000000>; - xlnx,gpio-width = <0x8>; - xlnx,gpio2-width = <0x20>; - xlnx,interrupt-present = <0x0>; - xlnx,is-dual = <0x0>; - xlnx,tri-default = <0xFFFFFFFF>; - xlnx,tri-default-2 = <0xFFFFFFFF>; - }; - linear_flash: flash@60000000 { - bank-width = <2>; - compatible = "cfi-flash"; - reg = <0x60000000 0x8000000>; - xlnx,axi-clk-period-ps = <0x1388>; - xlnx,include-datawidth-matching-0 = <0x1>; - xlnx,include-datawidth-matching-1 = <0x1>; - xlnx,include-datawidth-matching-2 = <0x1>; - xlnx,include-datawidth-matching-3 = <0x1>; - xlnx,include-negedge-ioregs = <0x0>; - xlnx,lflash-period-ps = <0x1388>; - xlnx,linear-flash-sync-burst = <0x0>; - xlnx,max-mem-width = <0x10>; - xlnx,mem-a-lsb = <0x0>; - xlnx,mem-a-msb = <0x1f>; - xlnx,mem0-type = <0x2>; - xlnx,mem0-width = <0x10>; - xlnx,mem1-type = <0x0>; - xlnx,mem1-width = <0x10>; - xlnx,mem2-type = <0x0>; - xlnx,mem2-width = <0x10>; - xlnx,mem3-type = <0x0>; - xlnx,mem3-width = <0x10>; - xlnx,num-banks-mem = <0x1>; - xlnx,page-size = <0x10>; - xlnx,parity-type-mem-0 = <0x0>; - xlnx,parity-type-mem-1 = <0x0>; - xlnx,parity-type-mem-2 = <0x0>; - xlnx,parity-type-mem-3 = <0x0>; - xlnx,port-diff = <0x0>; - xlnx,s-axi-en-reg = <0x0>; - xlnx,s-axi-mem-addr-width = <0x20>; - xlnx,s-axi-mem-data-width = <0x20>; - xlnx,s-axi-mem-id-width = <0x1>; - xlnx,s-axi-reg-addr-width = <0x5>; - xlnx,s-axi-reg-data-width = <0x20>; - xlnx,synch-pipedelay-0 = <0x1>; - xlnx,synch-pipedelay-1 = <0x1>; - xlnx,synch-pipedelay-2 = <0x1>; - xlnx,synch-pipedelay-3 = <0x1>; - xlnx,tavdv-ps-mem-0 = <0x1fbd0>; - xlnx,tavdv-ps-mem-1 = <0x3a98>; - xlnx,tavdv-ps-mem-2 = <0x3a98>; - xlnx,tavdv-ps-mem-3 = <0x3a98>; - xlnx,tcedv-ps-mem-0 = <0x1fbd0>; - xlnx,tcedv-ps-mem-1 = <0x3a98>; - xlnx,tcedv-ps-mem-2 = <0x3a98>; - xlnx,tcedv-ps-mem-3 = <0x3a98>; - xlnx,thzce-ps-mem-0 = <0x88b8>; - xlnx,thzce-ps-mem-1 = <0x1b58>; - xlnx,thzce-ps-mem-2 = <0x1b58>; - xlnx,thzce-ps-mem-3 = <0x1b58>; - xlnx,thzoe-ps-mem-0 = <0x1b58>; - xlnx,thzoe-ps-mem-1 = <0x1b58>; - xlnx,thzoe-ps-mem-2 = <0x1b58>; - xlnx,thzoe-ps-mem-3 = <0x1b58>; - xlnx,tlzwe-ps-mem-0 = <0xc350>; - xlnx,tlzwe-ps-mem-1 = <0x0>; - xlnx,tlzwe-ps-mem-2 = <0x0>; - xlnx,tlzwe-ps-mem-3 = <0x0>; - xlnx,tpacc-ps-flash-0 = <0x61a8>; - xlnx,tpacc-ps-flash-1 = <0x61a8>; - xlnx,tpacc-ps-flash-2 = <0x61a8>; - xlnx,tpacc-ps-flash-3 = <0x61a8>; - xlnx,twc-ps-mem-0 = <0x11170>; - xlnx,twc-ps-mem-1 = <0x3a98>; - xlnx,twc-ps-mem-2 = <0x3a98>; - xlnx,twc-ps-mem-3 = <0x3a98>; - xlnx,twp-ps-mem-0 = <0x13880>; - xlnx,twp-ps-mem-1 = <0x2ee0>; - xlnx,twp-ps-mem-2 = <0x2ee0>; - xlnx,twp-ps-mem-3 = <0x2ee0>; - xlnx,twph-ps-mem-0 = <0x13880>; - xlnx,twph-ps-mem-1 = <0x2ee0>; - xlnx,twph-ps-mem-2 = <0x2ee0>; - xlnx,twph-ps-mem-3 = <0x2ee0>; - xlnx,use-startup = <0x0>; - xlnx,use-startup-int = <0x0>; - xlnx,wr-rec-time-mem-0 = <0x186a0>; - xlnx,wr-rec-time-mem-1 = <0x6978>; - xlnx,wr-rec-time-mem-2 = <0x6978>; - xlnx,wr-rec-time-mem-3 = <0x6978>; - }; - microblaze_0_axi_intc: interrupt-controller@41200000 { - #interrupt-cells = <2>; - compatible = "xlnx,xps-intc-1.00.a"; - interrupt-controller ; - reg = <0x41200000 0x10000>; - xlnx,kind-of-intr = <0x0>; - xlnx,num-intr-inputs = <0x6>; - }; - push_buttons_5bits: gpio@40040000 { - #gpio-cells = <2>; - compatible = "xlnx,xps-gpio-1.00.a"; - gpio-controller ; - reg = <0x40040000 0x10000>; - xlnx,all-inputs = <0x1>; - xlnx,all-inputs-2 = <0x0>; - xlnx,all-outputs = <0x0>; - xlnx,all-outputs-2 = <0x0>; - xlnx,dout-default = <0x00000000>; - xlnx,dout-default-2 = <0x00000000>; - xlnx,gpio-width = <0x5>; - xlnx,gpio2-width = <0x20>; - xlnx,interrupt-present = <0x0>; - xlnx,is-dual = <0x0>; - xlnx,tri-default = <0xFFFFFFFF>; - xlnx,tri-default-2 = <0xFFFFFFFF>; - }; - reset_gpio: gpio@40000000 { - #gpio-cells = <2>; - compatible = "xlnx,xps-gpio-1.00.a"; - gpio-controller ; - reg = <0x40000000 0x10000>; - xlnx,all-inputs = <0x0>; - xlnx,all-inputs-2 = <0x0>; - xlnx,all-outputs = <0x1>; - xlnx,all-outputs-2 = <0x0>; - xlnx,dout-default = <0x00000000>; - xlnx,dout-default-2 = <0x00000000>; - xlnx,gpio-width = <0x1>; - xlnx,gpio2-width = <0x20>; - xlnx,interrupt-present = <0x0>; - xlnx,is-dual = <0x0>; - xlnx,tri-default = <0xFFFFFFFF>; - xlnx,tri-default-2 = <0xFFFFFFFF>; - }; - rs232_uart: serial@44a00000 { - clock-frequency = <200000000>; - clocks = <&clk_bus_0>; - compatible = "xlnx,xps-uart16550-2.00.a", "ns16550a"; - current-speed = <115200>; - device_type = "serial"; - interrupt-parent = <µblaze_0_axi_intc>; - interrupts = <0 2>; - port-number = <0>; - reg = <0x44a00000 0x10000>; - reg-offset = <0x1000>; - reg-shift = <2>; - xlnx,external-xin-clk-hz = <0x17d7840>; - xlnx,external-xin-clk-hz-d = <0x19>; - xlnx,has-external-rclk = <0x0>; - xlnx,has-external-xin = <0x0>; - xlnx,is-a-16550 = <0x1>; - xlnx,s-axi-aclk-freq-hz-d = "200.0"; - xlnx,use-modem-ports = <0x1>; - xlnx,use-user-ports = <0x1>; - }; - }; -}; diff --git a/meta-xilinx-bsp/recipes-bsp/device-tree/files/kc705-microblazeel/system-conf.dtsi b/meta-xilinx-bsp/recipes-bsp/device-tree/files/kc705-microblazeel/system-conf.dtsi deleted file mode 100644 index 09b26c6a..00000000 --- a/meta-xilinx-bsp/recipes-bsp/device-tree/files/kc705-microblazeel/system-conf.dtsi +++ /dev/null @@ -1,43 +0,0 @@ -/* - * CAUTION: This file is automatically generated by PetaLinux SDK. - * DO NOT modify this file - */ - - -/ { - chosen { - bootargs = "console=ttyS0,115200 earlyprintk"; - stdout-path = "serial0:115200n8"; - }; -}; - -&axi_ethernet { - local-mac-address = [00 0a 35 00 22 01]; -}; - -&linear_flash { - reg = <0x60000000 0x08000000>; - #address-cells = <1>; - #size-cells = <1>; - partition@0x00000000 { - label = "fpga"; - reg = <0x00000000 0x00b00000>; - }; - partition@0x00b00000 { - label = "boot"; - reg = <0x00b00000 0x00080000>; - }; - partition@0x00b80000 { - label = "bootenv"; - reg = <0x00b80000 0x00020000>; - }; - partition@0x00ba0000 { - label = "kernel"; - reg = <0x00ba0000 0x00c00000>; - }; - partition@0x017a0000 { - label = "spare"; - reg = <0x017a0000 0x00000000>; - }; -}; - diff --git a/meta-xilinx-bsp/recipes-bsp/device-tree/files/pnc.dtsi b/meta-xilinx-bsp/recipes-bsp/device-tree/files/pnc.dtsi new file mode 100644 index 00000000..760b76be --- /dev/null +++ b/meta-xilinx-bsp/recipes-bsp/device-tree/files/pnc.dtsi @@ -0,0 +1,13 @@ +/ { + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + pnc-reserved-memory@70000000{ + compatible = "pnc,secure-memory"; + reg = <0x0 0x70000000 0x0 0x0FF00000>; + no-map; + }; + }; +}; diff --git a/meta-xilinx-bsp/recipes-bsp/reference-design/kc705-bitstream_2022.2.bb b/meta-xilinx-bsp/recipes-bsp/reference-design/kc705-bitstream_2022.2.bb new file mode 100644 index 00000000..e512777c --- /dev/null +++ b/meta-xilinx-bsp/recipes-bsp/reference-design/kc705-bitstream_2022.2.bb @@ -0,0 +1,48 @@ +SUMMARY = "KC705 Pre-built Bitstream" +DESCRIPTION = "A Pre-built bitstream for the KC705, which is capable of booting a Linux system." +HOMEPAGE = "http://www.xilinx.com" +SECTION = "bsp" + +# The BSP package does not include any license information. +LICENSE = "Proprietary" +LICENSE_FLAGS = "xilinx" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28" + +COMPATIBLE_MACHINE = "kc705-microblazeel" + +inherit deploy +inherit xilinx-fetch-restricted + +BSP_NAME = "xilinx-kc705" +BSP_FILE = "${BSP_NAME}-v${PV}-final.bsp" +SRC_URI = "https://www.xilinx.com/member/forms/download/xef.html?filename=${BSP_FILE};downloadfilename=${BSP_FILE}" +SRC_URI[md5sum] = "5c0365a8a26cc27b4419aa1d7dd82351" +SRC_URI[sha256sum] = "a909a91a37a9925ee2f972ccb10f986a26ff9785c1a71a483545a192783bf773" + +PROVIDES = "virtual/bitstream" + +FILES:${PN} += "/boot/download.bit" + +INHIBIT_DEFAULT_DEPS = "1" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# deps needed to extract content from the .bsp file +DEPENDS += "tar-native gzip-native" + +do_compile() { + # Extract the bitstream into workdir + tar -xf ${WORKDIR}/${BSP_FILE} ${BSP_NAME}-axi-full-${PV}/pre-built/linux/images/download.bit -C ${S} + # move the bit file to ${S}/ as it is in a subdir in the tar file + for i in $(find -type f -name download.bit); do mv $i ${S}; done +} + +do_install() { + install -D ${S}/download.bit ${D}/boot/download.bit +} + +do_deploy () { + install -D ${S}/download.bit ${DEPLOYDIR}/download.bit +} + +addtask deploy before do_build after do_install + diff --git a/meta-xilinx-contrib/README.md b/meta-xilinx-contrib/README.md index 952392af..1b11d347 100644 --- a/meta-xilinx-contrib/README.md +++ b/meta-xilinx-contrib/README.md @@ -1,35 +1,21 @@ -meta-xilinx-contrib -=================== +# meta-xilinx-contrib This layer is a contribution layer to support for MicroBlaze, Zynq and ZynqMP architectures. -This layer depends on meta-xilinx-bsp layer. +Any patches from open source contributors for vendor board can be added here. -Supported Boards/Machines -========================= +## Supported Boards/Machines -* Zynq: - * Digilent Zybo Linux BD Reference design - * [Avnet MiniZed](conf/machine/minized-zynq7.conf) - `minized-zynq7` +**Boards/Machines supported by this layer:** -Maintainers, Mailing list, Patches -================================== -Please send any patches, comments or questions for this layer to -the [meta-xilinx mailing list](https://lists.yoctoproject.org/listinfo/meta-xilinx): +| Platform | Vendor Board Variant | Machine Configuration file | Board Device tree | +| ---| --- | ---| ---------- | +|MicroBlaze|[Xilinx ML605 (QEMU)](https://www.digikey.com/en/products/detail/amd-xilinx/EK-V6-ML605-G/2175174)|[ml605-qemu-microblazeel](conf/machine/ml605-qemu-microblazeel.conf)|NA| +|Zynq-7000|NA|NA|NA| +|ZynqMP|NA|NA|NA| +|Versal|NA|NA|NA| - meta-xilinx@lists.yoctoproject.org with '[meta-xilinx-contrib]' in the subject. - - -Subscribe to mailing list at -https://lists.yoctoproject.org/listinfo/meta-xilinx - -Maintainers: - - Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> - Mark Hatle <mark.hatle@xilinx.com> - -Dependencies -============ +## Dependencies This layer depends on: @@ -37,7 +23,9 @@ This layer depends on: URI: git://git.openembedded.org/openembedded-core layers: meta + branch: master or xilinx current release version (e.g. hosister) - URI: git://git.openembedded.org/meta-xilinx - + URI: git://git.yoctoproject.org/meta-xilinx.git + layers: meta-xilinx-microblaze, meta-xilinx-core, meta-xilinx-vendor + branch: master or xilinx current release version (e.g. hosister) diff --git a/meta-xilinx-contrib/conf/layer.conf b/meta-xilinx-contrib/conf/layer.conf index 026d79d2..4b813365 100644 --- a/meta-xilinx-contrib/conf/layer.conf +++ b/meta-xilinx-contrib/conf/layer.conf @@ -13,5 +13,3 @@ LAYERDEPENDS_xilinx-contrib = "core" LAYERDEPENDS_xilinx-contrib = "xilinx" LAYERSERIES_COMPAT_xilinx-contrib = "honister" - -XILINX_RELEASE_VERSION = "v2022.1" diff --git a/meta-xilinx-bsp/conf/machine/ml605-qemu-microblazeel.conf b/meta-xilinx-contrib/conf/machine/ml605-qemu-microblazeel.conf index 157a75c2..157a75c2 100644 --- a/meta-xilinx-bsp/conf/machine/ml605-qemu-microblazeel.conf +++ b/meta-xilinx-contrib/conf/machine/ml605-qemu-microblazeel.conf diff --git a/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx/v2022.2/0001-drm-xilinx-Add-encoder-for-Digilent-boards.patch b/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx/v2022.2/0001-drm-xilinx-Add-encoder-for-Digilent-boards.patch new file mode 100644 index 00000000..660bc218 --- /dev/null +++ b/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx/v2022.2/0001-drm-xilinx-Add-encoder-for-Digilent-boards.patch @@ -0,0 +1,305 @@ +From 21cc8144efdaa3cd8dbd7279f87b14fa3432fae4 Mon Sep 17 00:00:00 2001 +From: Jason Wu <jason.wu.misc@gmail.com> +Date: Sun, 10 Apr 2016 13:14:13 +1000 +Subject: [PATCH 1/3] drm: xilinx: Add encoder for Digilent boards + +Add the dglnt_encoder driver that enables DRM support for the VGA and +HDMI output ports found on many Digilent boards. + +Upstream-Status: Pending + +Signed-off-by: Sam Bobrowicz <sbobrowicz@digilentinc.com> +Signed-off-by: Jason Wu <jason.wu.misc@gmail.com> +--- + .../bindings/drm/xilinx/dglnt_encoder.txt | 23 +++ + drivers/gpu/drm/xilinx/Kconfig | 6 + + drivers/gpu/drm/xilinx/Makefile | 1 + + drivers/gpu/drm/xilinx/dglnt_encoder.c | 217 +++++++++++++++++++++ + 4 files changed, 247 insertions(+) + create mode 100644 Documentation/devicetree/bindings/drm/xilinx/dglnt_encoder.txt + create mode 100644 drivers/gpu/drm/xilinx/dglnt_encoder.c + +diff --git a/Documentation/devicetree/bindings/drm/xilinx/dglnt_encoder.txt b/Documentation/devicetree/bindings/drm/xilinx/dglnt_encoder.txt +new file mode 100644 +index 0000000..242b24e +--- /dev/null ++++ b/Documentation/devicetree/bindings/drm/xilinx/dglnt_encoder.txt +@@ -0,0 +1,23 @@ ++Device-Tree bindings for Digilent DRM Encoder Slave ++ ++This driver provides support for VGA and HDMI outputs on Digilent FPGA boards. ++The VGA or HDMI port must be connected to a Xilinx display pipeline via an ++axi2vid IP core. ++ ++Required properties: ++ - compatible: Should be "digilent,drm-encoder". ++ ++Optional properties: ++ - dglnt,edid-i2c: The I2C device connected to the DDC bus on the video ++ connector. This is used to obtain the supported resolutions ++ of an attached monitor. If not defined, then a default ++ set of resolutions is used and the display will initialize ++ to 720p. Note most VGA connectors on Digilent boards do ++ not have the DDC bus routed out. ++ ++Example: ++ ++ encoder_0: digilent_encoder { ++ compatible = "digilent,drm-encoder"; ++ dglnt,edid-i2c = <&i2c1>; ++ }; +diff --git a/drivers/gpu/drm/xilinx/Kconfig b/drivers/gpu/drm/xilinx/Kconfig +index 57e18a9..d9ecff2 100644 +--- a/drivers/gpu/drm/xilinx/Kconfig ++++ b/drivers/gpu/drm/xilinx/Kconfig +@@ -33,6 +33,12 @@ config DRM_XILINX_DP_SUB + help + DRM driver for Xilinx Display Port Subsystem. + ++config DRM_DIGILENT_ENCODER ++ tristate "Digilent VGA/HDMI DRM Encoder Driver" ++ depends on DRM_XILINX ++ help ++ DRM slave encoder for Video-out on Digilent boards. ++ + config DRM_XILINX_DP_SUB_DEBUG_FS + bool "Xilinx DRM DPSUB debugfs" + depends on DEBUG_FS && DRM_XILINX_DP_SUB +diff --git a/drivers/gpu/drm/xilinx/Makefile b/drivers/gpu/drm/xilinx/Makefile +index 19bc154..c2717e40 100644 +--- a/drivers/gpu/drm/xilinx/Makefile ++++ b/drivers/gpu/drm/xilinx/Makefile +@@ -7,6 +7,7 @@ xilinx_drm-y := xilinx_drm_crtc.o xilinx_drm_connector.o xilinx_drm_drv.o \ + xilinx_drm_plane.o + xilinx_drm-y += xilinx_cresample.o xilinx_osd.o xilinx_rgb2yuv.o xilinx_vtc.o + ++obj-$(CONFIG_DRM_DIGILENT_ENCODER) += dglnt_encoder.o + obj-$(CONFIG_DRM_XILINX) += xilinx_drm.o + obj-$(CONFIG_DRM_XILINX_DP) += xilinx_drm_dp.o + obj-$(CONFIG_DRM_XILINX_DP_SUB) += xilinx_drm_dp_sub.o +diff --git a/drivers/gpu/drm/xilinx/dglnt_encoder.c b/drivers/gpu/drm/xilinx/dglnt_encoder.c +new file mode 100644 +index 0000000..cb9fc7d +--- /dev/null ++++ b/drivers/gpu/drm/xilinx/dglnt_encoder.c +@@ -0,0 +1,217 @@ ++/* ++ * dglnt_encoder.c - DRM slave encoder for Video-out on Digilent boards ++ * ++ * Copyright (C) 2015 Digilent ++ * Author: Sam Bobrowicz <sbobrowicz@digilentinc.com> ++ * ++ * Based on udl_encoder.c and udl_connector.c, Copyright (C) 2012 Red Hat. ++ * Also based on xilinx_drm_dp.c, Copyright (C) 2014 Xilinx, Inc. ++ * ++ * This software is licensed under the terms of the GNU General Public ++ * License version 2, as published by the Free Software Foundation, and ++ * may be copied, distributed, and modified under those terms. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ */ ++ ++#include <drm/drmP.h> ++#include <drm/drm_edid.h> ++#include <drm/drm_encoder_slave.h> ++ ++#include <linux/device.h> ++#include <linux/module.h> ++#include <linux/err.h> ++#include <linux/i2c.h> ++#include <linux/of.h> ++#include <linux/of_platform.h> ++#include <linux/platform_device.h> ++ ++#define DGLNT_ENC_MAX_FREQ 150000 ++#define DGLNT_ENC_MAX_H 1920 ++#define DGLNT_ENC_MAX_V 1080 ++#define DGLNT_ENC_PREF_H 1280 ++#define DGLNT_ENC_PREF_V 720 ++ ++struct dglnt_encoder { ++ struct drm_encoder *encoder; ++ struct i2c_adapter *i2c_bus; ++ bool i2c_present; ++}; ++ ++static inline struct dglnt_encoder *to_dglnt_encoder( ++ struct drm_encoder *encoder) ++{ ++ return to_encoder_slave(encoder)->slave_priv; ++} ++ ++static bool dglnt_mode_fixup(struct drm_encoder *encoder, ++ const struct drm_display_mode *mode, ++ struct drm_display_mode *adjusted_mode) ++{ ++ return true; ++} ++ ++static void dglnt_encoder_mode_set(struct drm_encoder *encoder, ++ struct drm_display_mode *mode, ++ struct drm_display_mode *adjusted_mode) ++{ ++} ++ ++static void ++dglnt_encoder_dpms(struct drm_encoder *encoder, int mode) ++{ ++} ++ ++static void dglnt_encoder_save(struct drm_encoder *encoder) ++{ ++} ++ ++static void dglnt_encoder_restore(struct drm_encoder *encoder) ++{ ++} ++ ++static int dglnt_encoder_mode_valid(struct drm_encoder *encoder, ++ struct drm_display_mode *mode) ++{ ++ if (mode && ++ !(mode->flags & ((DRM_MODE_FLAG_INTERLACE | ++ DRM_MODE_FLAG_DBLCLK) | DRM_MODE_FLAG_3D_MASK)) && ++ (mode->clock <= DGLNT_ENC_MAX_FREQ) && ++ (mode->hdisplay <= DGLNT_ENC_MAX_H) && ++ (mode->vdisplay <= DGLNT_ENC_MAX_V)) ++ return MODE_OK; ++ return MODE_BAD; ++} ++ ++static int dglnt_encoder_get_modes(struct drm_encoder *encoder, ++ struct drm_connector *connector) ++{ ++ struct dglnt_encoder *dglnt = to_dglnt_encoder(encoder); ++ struct edid *edid; ++ int num_modes = 0; ++ ++ if (dglnt->i2c_present) { ++ edid = drm_get_edid(connector, dglnt->i2c_bus); ++ drm_connector_update_edid_property(connector, edid); ++ if (edid) { ++ num_modes = drm_add_edid_modes(connector, edid); ++ kfree(edid); ++ } ++ } else { ++ num_modes = drm_add_modes_noedid(connector, DGLNT_ENC_MAX_H, ++ DGLNT_ENC_MAX_V); ++ drm_set_preferred_mode(connector, DGLNT_ENC_PREF_H, ++ DGLNT_ENC_PREF_V); ++ } ++ return num_modes; ++} ++ ++static enum drm_connector_status dglnt_encoder_detect( ++ struct drm_encoder *encoder, ++ struct drm_connector *connector) ++{ ++ struct dglnt_encoder *dglnt = to_dglnt_encoder(encoder); ++ ++ if (dglnt->i2c_present) { ++ if (drm_probe_ddc(dglnt->i2c_bus)) ++ return connector_status_connected; ++ return connector_status_disconnected; ++ } else ++ return connector_status_unknown; ++} ++ ++static struct drm_encoder_slave_funcs dglnt_encoder_slave_funcs = { ++ .dpms = dglnt_encoder_dpms, ++ .save = dglnt_encoder_save, ++ .restore = dglnt_encoder_restore, ++ .mode_fixup = dglnt_mode_fixup, ++ .mode_valid = dglnt_encoder_mode_valid, ++ .mode_set = dglnt_encoder_mode_set, ++ .detect = dglnt_encoder_detect, ++ .get_modes = dglnt_encoder_get_modes, ++}; ++ ++static int dglnt_encoder_encoder_init(struct platform_device *pdev, ++ struct drm_device *dev, ++ struct drm_encoder_slave *encoder) ++{ ++ struct dglnt_encoder *dglnt = platform_get_drvdata(pdev); ++ struct device_node *sub_node; ++ ++ encoder->slave_priv = dglnt; ++ encoder->slave_funcs = &dglnt_encoder_slave_funcs; ++ ++ dglnt->encoder = &encoder->base; ++ ++ /* get i2c adapter for edid */ ++ dglnt->i2c_present = false; ++ sub_node = of_parse_phandle(pdev->dev.of_node, "dglnt,edid-i2c", 0); ++ if (sub_node) { ++ dglnt->i2c_bus = of_find_i2c_adapter_by_node(sub_node); ++ if (!dglnt->i2c_bus) ++ DRM_INFO("failed to get the edid i2c adapter, using default modes\n"); ++ else ++ dglnt->i2c_present = true; ++ of_node_put(sub_node); ++ } ++ ++ return 0; ++} ++ ++static int dglnt_encoder_probe(struct platform_device *pdev) ++{ ++ struct dglnt_encoder *dglnt; ++ ++ dglnt = devm_kzalloc(&pdev->dev, sizeof(*dglnt), GFP_KERNEL); ++ if (!dglnt) ++ return -ENOMEM; ++ ++ platform_set_drvdata(pdev, dglnt); ++ ++ return 0; ++} ++ ++static int dglnt_encoder_remove(struct platform_device *pdev) ++{ ++ return 0; ++} ++ ++static const struct of_device_id dglnt_encoder_of_match[] = { ++ { .compatible = "digilent,drm-encoder", }, ++ { /* end of table */ }, ++}; ++MODULE_DEVICE_TABLE(of, dglnt_encoder_of_match); ++ ++static struct drm_platform_encoder_driver dglnt_encoder_driver = { ++ .platform_driver = { ++ .probe = dglnt_encoder_probe, ++ .remove = dglnt_encoder_remove, ++ .driver = { ++ .owner = THIS_MODULE, ++ .name = "dglnt-drm-enc", ++ .of_match_table = dglnt_encoder_of_match, ++ }, ++ }, ++ ++ .encoder_init = dglnt_encoder_encoder_init, ++}; ++ ++static int __init dglnt_encoder_init(void) ++{ ++ return platform_driver_register(&dglnt_encoder_driver.platform_driver); ++} ++ ++static void __exit dglnt_encoder_exit(void) ++{ ++ platform_driver_unregister(&dglnt_encoder_driver.platform_driver); ++} ++ ++module_init(dglnt_encoder_init); ++module_exit(dglnt_encoder_exit); ++ ++MODULE_AUTHOR("Digilent, Inc."); ++MODULE_DESCRIPTION("DRM slave encoder for Video-out on Digilent boards"); ++MODULE_LICENSE("GPL v2"); +-- +2.7.4 + diff --git a/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx/v2022.2/0002-clk-Add-driver-for-axi_dynclk-IP-Core.patch b/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx/v2022.2/0002-clk-Add-driver-for-axi_dynclk-IP-Core.patch new file mode 100644 index 00000000..9b6229db --- /dev/null +++ b/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx/v2022.2/0002-clk-Add-driver-for-axi_dynclk-IP-Core.patch @@ -0,0 +1,607 @@ +From 217e3b6f4393926b8dcad841381527ef3fc808c2 Mon Sep 17 00:00:00 2001 +From: Jason Wu <jason.wu.misc@gmail.com> +Date: Sun, 10 Apr 2016 13:16:06 +1000 +Subject: [PATCH 2/3] clk: Add driver for axi_dynclk IP Core + +Add support for the axi_dynclk IP Core available from Digilent. This IP +core dynamically configures the clock resources inside a Xilinx FPGA to +generate a clock with a software programmable frequency. + +Upstream-Status: Pending + +Signed-off-by: Sam Bobrowicz <sbobrowicz@digilentinc.com> +Signed-off-by: Jason Wu <jason.wu.misc@gmail.com> +--- + drivers/clk/Kconfig | 8 + + drivers/clk/Makefile | 1 + + drivers/clk/clk-dglnt-dynclk.c | 547 +++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 556 insertions(+) + create mode 100644 drivers/clk/clk-dglnt-dynclk.c + +diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig +index dccb111100..7fe65a702b 100644 +--- a/drivers/clk/Kconfig ++++ b/drivers/clk/Kconfig +@@ -148,6 +148,14 @@ config CLK_QORIQ + This adds the clock driver support for Freescale QorIQ platforms + using common clock framework. + ++config COMMON_CLK_DGLNT_DYNCLK ++ tristate "Digilent axi_dynclk Driver" ++ depends on ARCH_ZYNQ || MICROBLAZE ++ help ++ ---help--- ++ Support for the Digilent AXI Dynamic Clock core for Xilinx ++ FPGAs. ++ + config COMMON_CLK_XGENE + bool "Clock driver for APM XGene SoC" + default y +diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile +index 0760449dde..45ce97d053 100644 +--- a/drivers/clk/Makefile ++++ b/drivers/clk/Makefile +@@ -24,6 +24,7 @@ obj-$(CONFIG_COMMON_CLK_CDCE706) += clk-cdce706.o + obj-$(CONFIG_COMMON_CLK_CDCE925) += clk-cdce925.o + obj-$(CONFIG_ARCH_CLPS711X) += clk-clps711x.o + obj-$(CONFIG_COMMON_CLK_CS2000_CP) += clk-cs2000-cp.o ++obj-$(CONFIG_COMMON_CLK_DGLNT_DYNCLK) += clk-dglnt-dynclk.o + obj-$(CONFIG_ARCH_EFM32) += clk-efm32gg.o + obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o + obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o +diff --git a/drivers/clk/clk-dglnt-dynclk.c b/drivers/clk/clk-dglnt-dynclk.c +new file mode 100644 +index 0000000000..496ad5fc90 +--- /dev/null ++++ b/drivers/clk/clk-dglnt-dynclk.c +@@ -0,0 +1,547 @@ ++/* ++ * clk-dglnt-dynclk.c - Digilent AXI Dynamic Clock (axi_dynclk) Driver ++ * ++ * Copyright (C) 2015 Digilent ++ * Author: Sam Bobrowicz <sbobrowicz@digilentinc.com> ++ * ++ * Reused code from clk-axi-clkgen.c, Copyright (C) 2012-2013 Analog Devices Inc. ++ * ++ * This software is licensed under the terms of the GNU General Public ++ * License version 2, as published by the Free Software Foundation, and ++ * may be copied, distributed, and modified under those terms. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ */ ++ ++#include <linux/platform_device.h> ++#include <linux/clk-provider.h> ++#include <linux/clk.h> ++#include <linux/slab.h> ++#include <linux/io.h> ++#include <linux/of.h> ++#include <linux/module.h> ++#include <linux/err.h> ++#include <linux/kernel.h> ++ ++#define CLK_BIT_WEDGE 13 ++#define CLK_BIT_NOCOUNT 12 ++ ++/* This value is used to signal an error */ ++#define ERR_CLKCOUNTCALC 0xFFFFFFFF ++#define ERR_CLKDIVIDER (1 << CLK_BIT_WEDGE | 1 << CLK_BIT_NOCOUNT) ++ ++#define DYNCLK_DIV_1_REGMASK 0x1041 ++/* 25 MHz (125 KHz / 5) */ ++#define DYNCLK_DEFAULT_FREQ 125000 ++ ++#define MMCM_FREQ_VCOMIN 600000 ++#define MMCM_FREQ_VCOMAX 1200000 ++#define MMCM_FREQ_PFDMIN 10000 ++#define MMCM_FREQ_PFDMAX 450000 ++#define MMCM_FREQ_OUTMIN 4000 ++#define MMCM_FREQ_OUTMAX 800000 ++#define MMCM_DIV_MAX 106 ++#define MMCM_FB_MIN 2 ++#define MMCM_FB_MAX 64 ++#define MMCM_CLKDIV_MAX 128 ++#define MMCM_CLKDIV_MIN 1 ++ ++#define OFST_DISPLAY_CTRL 0x0 ++#define OFST_DISPLAY_STATUS 0x4 ++#define OFST_DISPLAY_CLK_L 0x8 ++#define OFST_DISPLAY_FB_L 0x0C ++#define OFST_DISPLAY_FB_H_CLK_H 0x10 ++#define OFST_DISPLAY_DIV 0x14 ++#define OFST_DISPLAY_LOCK_L 0x18 ++#define OFST_DISPLAY_FLTR_LOCK_H 0x1C ++ ++static const u64 lock_lookup[64] = { ++ 0b0011000110111110100011111010010000000001, ++ 0b0011000110111110100011111010010000000001, ++ 0b0100001000111110100011111010010000000001, ++ 0b0101101011111110100011111010010000000001, ++ 0b0111001110111110100011111010010000000001, ++ 0b1000110001111110100011111010010000000001, ++ 0b1001110011111110100011111010010000000001, ++ 0b1011010110111110100011111010010000000001, ++ 0b1100111001111110100011111010010000000001, ++ 0b1110011100111110100011111010010000000001, ++ 0b1111111111111000010011111010010000000001, ++ 0b1111111111110011100111111010010000000001, ++ 0b1111111111101110111011111010010000000001, ++ 0b1111111111101011110011111010010000000001, ++ 0b1111111111101000101011111010010000000001, ++ 0b1111111111100111000111111010010000000001, ++ 0b1111111111100011111111111010010000000001, ++ 0b1111111111100010011011111010010000000001, ++ 0b1111111111100000110111111010010000000001, ++ 0b1111111111011111010011111010010000000001, ++ 0b1111111111011101101111111010010000000001, ++ 0b1111111111011100001011111010010000000001, ++ 0b1111111111011010100111111010010000000001, ++ 0b1111111111011001000011111010010000000001, ++ 0b1111111111011001000011111010010000000001, ++ 0b1111111111010111011111111010010000000001, ++ 0b1111111111010101111011111010010000000001, ++ 0b1111111111010101111011111010010000000001, ++ 0b1111111111010100010111111010010000000001, ++ 0b1111111111010100010111111010010000000001, ++ 0b1111111111010010110011111010010000000001, ++ 0b1111111111010010110011111010010000000001, ++ 0b1111111111010010110011111010010000000001, ++ 0b1111111111010001001111111010010000000001, ++ 0b1111111111010001001111111010010000000001, ++ 0b1111111111010001001111111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001, ++ 0b1111111111001111101011111010010000000001 ++}; ++ ++static const u32 filter_lookup_low[64] = { ++ 0b0001011111, ++ 0b0001010111, ++ 0b0001111011, ++ 0b0001011011, ++ 0b0001101011, ++ 0b0001110011, ++ 0b0001110011, ++ 0b0001110011, ++ 0b0001110011, ++ 0b0001001011, ++ 0b0001001011, ++ 0b0001001011, ++ 0b0010110011, ++ 0b0001010011, ++ 0b0001010011, ++ 0b0001010011, ++ 0b0001010011, ++ 0b0001010011, ++ 0b0001010011, ++ 0b0001010011, ++ 0b0001010011, ++ 0b0001010011, ++ 0b0001010011, ++ 0b0001100011, ++ 0b0001100011, ++ 0b0001100011, ++ 0b0001100011, ++ 0b0001100011, ++ 0b0001100011, ++ 0b0001100011, ++ 0b0001100011, ++ 0b0001100011, ++ 0b0001100011, ++ 0b0001100011, ++ 0b0001100011, ++ 0b0001100011, ++ 0b0001100011, ++ 0b0010010011, ++ 0b0010010011, ++ 0b0010010011, ++ 0b0010010011, ++ 0b0010010011, ++ 0b0010010011, ++ 0b0010010011, ++ 0b0010010011, ++ 0b0010010011, ++ 0b0010010011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011, ++ 0b0010100011 ++}; ++ ++struct dglnt_dynclk_reg; ++struct dglnt_dynclk_mode; ++struct dglnt_dynclk; ++ ++struct dglnt_dynclk_reg { ++ u32 clk0L; ++ u32 clkFBL; ++ u32 clkFBH_clk0H; ++ u32 divclk; ++ u32 lockL; ++ u32 fltr_lockH; ++}; ++ ++struct dglnt_dynclk_mode { ++ u32 freq; ++ u32 fbmult; ++ u32 clkdiv; ++ u32 maindiv; ++}; ++ ++struct dglnt_dynclk { ++ void __iomem *base; ++ struct clk_hw clk_hw; ++ unsigned long freq; ++}; ++ ++u32 dglnt_dynclk_divider(u32 divide) ++{ ++ u32 output = 0; ++ u32 highTime = 0; ++ u32 lowTime = 0; ++ ++ if ((divide < 1) || (divide > 128)) ++ return ERR_CLKDIVIDER; ++ ++ if (divide == 1) ++ return DYNCLK_DIV_1_REGMASK; ++ ++ highTime = divide / 2; ++ /* if divide is odd */ ++ if (divide & 0x1) { ++ lowTime = highTime + 1; ++ output = 1 << CLK_BIT_WEDGE; ++ } else { ++ lowTime = highTime; ++ } ++ ++ output |= 0x03F & lowTime; ++ output |= 0xFC0 & (highTime << 6); ++ return output; ++} ++ ++u32 dglnt_dynclk_count_calc(u32 divide) ++{ ++ u32 output = 0; ++ u32 divCalc = 0; ++ ++ divCalc = dglnt_dynclk_divider(divide); ++ if (divCalc == ERR_CLKDIVIDER) ++ output = ERR_CLKCOUNTCALC; ++ else ++ output = (0xFFF & divCalc) | ((divCalc << 10) & 0x00C00000); ++ return output; ++} ++ ++ ++int dglnt_dynclk_find_reg(struct dglnt_dynclk_reg *regValues, ++ struct dglnt_dynclk_mode *clkParams) ++{ ++ if ((clkParams->fbmult < 2) || clkParams->fbmult > 64) ++ return -EINVAL; ++ ++ regValues->clk0L = dglnt_dynclk_count_calc(clkParams->clkdiv); ++ if (regValues->clk0L == ERR_CLKCOUNTCALC) ++ return -EINVAL; ++ ++ regValues->clkFBL = dglnt_dynclk_count_calc(clkParams->fbmult); ++ if (regValues->clkFBL == ERR_CLKCOUNTCALC) ++ return -EINVAL; ++ ++ regValues->clkFBH_clk0H = 0; ++ ++ regValues->divclk = dglnt_dynclk_divider(clkParams->maindiv); ++ if (regValues->divclk == ERR_CLKDIVIDER) ++ return -EINVAL; ++ ++ regValues->lockL = (u32)(lock_lookup[clkParams->fbmult - 1] & ++ 0xFFFFFFFF); ++ ++ regValues->fltr_lockH = (u32)((lock_lookup[clkParams->fbmult - 1] >> ++ 32) & 0x000000FF); ++ regValues->fltr_lockH |= ((filter_lookup_low[clkParams->fbmult - 1] << ++ 16) & 0x03FF0000); ++ ++ return 0; ++} ++ ++void dglnt_dynclk_write_reg(struct dglnt_dynclk_reg *regValues, ++ void __iomem *baseaddr) ++{ ++ writel(regValues->clk0L, baseaddr + OFST_DISPLAY_CLK_L); ++ writel(regValues->clkFBL, baseaddr + OFST_DISPLAY_FB_L); ++ writel(regValues->clkFBH_clk0H, baseaddr + OFST_DISPLAY_FB_H_CLK_H); ++ writel(regValues->divclk, baseaddr + OFST_DISPLAY_DIV); ++ writel(regValues->lockL, baseaddr + OFST_DISPLAY_LOCK_L); ++ writel(regValues->fltr_lockH, baseaddr + OFST_DISPLAY_FLTR_LOCK_H); ++} ++ ++u32 dglnt_dynclk_find_mode(u32 freq, u32 parentFreq, ++ struct dglnt_dynclk_mode *bestPick) ++{ ++ u32 bestError = MMCM_FREQ_OUTMAX; ++ u32 curError; ++ u32 curClkMult; ++ u32 curFreq; ++ u32 divVal; ++ u32 curFb, curClkDiv; ++ u32 minFb = 0; ++ u32 maxFb = 0; ++ u32 curDiv = 1; ++ u32 maxDiv; ++ bool freq_found = false; ++ ++ bestPick->freq = 0; ++ if (parentFreq == 0) ++ return 0; ++ ++ /* minimum frequency is actually dictated by VCOmin */ ++ if (freq < MMCM_FREQ_OUTMIN) ++ freq = MMCM_FREQ_OUTMIN; ++ if (freq > MMCM_FREQ_OUTMAX) ++ freq = MMCM_FREQ_OUTMAX; ++ ++ if (parentFreq > MMCM_FREQ_PFDMAX) ++ curDiv = 2; ++ maxDiv = parentFreq / MMCM_FREQ_PFDMIN; ++ if (maxDiv > MMCM_DIV_MAX) ++ maxDiv = MMCM_DIV_MAX; ++ ++ while (curDiv <= maxDiv && !freq_found) { ++ minFb = curDiv * DIV_ROUND_UP(MMCM_FREQ_VCOMIN, parentFreq); ++ maxFb = curDiv * (MMCM_FREQ_VCOMAX / parentFreq); ++ if (maxFb > MMCM_FB_MAX) ++ maxFb = MMCM_FB_MAX; ++ if (minFb < MMCM_FB_MIN) ++ minFb = MMCM_FB_MIN; ++ ++ divVal = curDiv * freq; ++ /* ++ * This multiplier is used to find the best clkDiv value for ++ * each FB value ++ */ ++ curClkMult = ((parentFreq * 1000) + (divVal / 2)) / divVal; ++ ++ curFb = minFb; ++ while (curFb <= maxFb && !freq_found) { ++ curClkDiv = ((curClkMult * curFb) + 500) / 1000; ++ if (curClkDiv > MMCM_CLKDIV_MAX) ++ curClkDiv = MMCM_CLKDIV_MAX; ++ if (curClkDiv < MMCM_CLKDIV_MIN) ++ curClkDiv = MMCM_CLKDIV_MIN; ++ curFreq = (((parentFreq * curFb) / curDiv) / curClkDiv); ++ if (curFreq >= freq) ++ curError = curFreq - freq; ++ else ++ curError = freq - curFreq; ++ if (curError < bestError) { ++ bestError = curError; ++ bestPick->clkdiv = curClkDiv; ++ bestPick->fbmult = curFb; ++ bestPick->maindiv = curDiv; ++ bestPick->freq = curFreq; ++ } ++ if (!curError) ++ freq_found = true; ++ curFb++; ++ } ++ curDiv++; ++ } ++ return bestPick->freq; ++} ++ ++static struct dglnt_dynclk *clk_hw_to_dglnt_dynclk(struct clk_hw *clk_hw) ++{ ++ return container_of(clk_hw, struct dglnt_dynclk, clk_hw); ++} ++ ++ ++static int dglnt_dynclk_enable(struct clk_hw *clk_hw) ++{ ++ struct dglnt_dynclk *dglnt_dynclk = clk_hw_to_dglnt_dynclk(clk_hw); ++ unsigned int clock_state; ++ ++ if (dglnt_dynclk->freq) { ++ writel(1, dglnt_dynclk->base + OFST_DISPLAY_CTRL); ++ do { ++ clock_state = readl(dglnt_dynclk->base + ++ OFST_DISPLAY_STATUS); ++ } while (!clock_state); ++ } ++ return 0; ++} ++ ++static void dglnt_dynclk_disable(struct clk_hw *clk_hw) ++{ ++ struct dglnt_dynclk *dglnt_dynclk = clk_hw_to_dglnt_dynclk(clk_hw); ++ ++ writel(0, dglnt_dynclk->base + OFST_DISPLAY_CTRL); ++} ++ ++static int dglnt_dynclk_set_rate(struct clk_hw *clk_hw, ++ unsigned long rate, unsigned long parent_rate) ++{ ++ struct dglnt_dynclk *dglnt_dynclk = clk_hw_to_dglnt_dynclk(clk_hw); ++ struct dglnt_dynclk_reg clkReg; ++ struct dglnt_dynclk_mode clkMode; ++ ++ if (parent_rate == 0 || rate == 0) ++ return -EINVAL; ++ if (rate == dglnt_dynclk->freq) ++ return 0; ++ ++ /* ++ * Convert from Hz to KHz, then multiply by five to account for ++ * BUFR division ++ */ ++ rate = (rate + 100) / 200; ++ /* convert from Hz to KHz */ ++ parent_rate = (parent_rate + 500) / 1000; ++ if (!dglnt_dynclk_find_mode(rate, parent_rate, &clkMode)) ++ return -EINVAL; ++ ++ /* ++ * Write to the PLL dynamic configuration registers to configure it ++ * with the calculated parameters. ++ */ ++ dglnt_dynclk_find_reg(&clkReg, &clkMode); ++ dglnt_dynclk_write_reg(&clkReg, dglnt_dynclk->base); ++ dglnt_dynclk->freq = clkMode.freq * 200; ++ dglnt_dynclk_disable(clk_hw); ++ dglnt_dynclk_enable(clk_hw); ++ ++ return 0; ++} ++ ++static long dglnt_dynclk_round_rate(struct clk_hw *hw, unsigned long rate, ++ unsigned long *parent_rate) ++{ ++ struct dglnt_dynclk_mode clkMode; ++ ++ dglnt_dynclk_find_mode(((rate + 100) / 200), ++ ((*parent_rate) + 500) / 1000, &clkMode); ++ ++ return (clkMode.freq * 200); ++} ++ ++static unsigned long dglnt_dynclk_recalc_rate(struct clk_hw *clk_hw, ++ unsigned long parent_rate) ++{ ++ struct dglnt_dynclk *dglnt_dynclk = clk_hw_to_dglnt_dynclk(clk_hw); ++ ++ return dglnt_dynclk->freq; ++} ++ ++ ++static const struct clk_ops dglnt_dynclk_ops = { ++ .recalc_rate = dglnt_dynclk_recalc_rate, ++ .round_rate = dglnt_dynclk_round_rate, ++ .set_rate = dglnt_dynclk_set_rate, ++ .enable = dglnt_dynclk_enable, ++ .disable = dglnt_dynclk_disable, ++}; ++ ++static const struct of_device_id dglnt_dynclk_ids[] = { ++ { .compatible = "digilent,axi-dynclk", }, ++ { }, ++}; ++MODULE_DEVICE_TABLE(of, dglnt_dynclk_ids); ++ ++static int dglnt_dynclk_probe(struct platform_device *pdev) ++{ ++ const struct of_device_id *id; ++ struct dglnt_dynclk *dglnt_dynclk; ++ struct clk_init_data init; ++ const char *parent_name; ++ const char *clk_name; ++ struct resource *mem; ++ struct clk *clk; ++ ++ if (!pdev->dev.of_node) ++ return -ENODEV; ++ ++ id = of_match_node(dglnt_dynclk_ids, pdev->dev.of_node); ++ if (!id) ++ return -ENODEV; ++ ++ dglnt_dynclk = devm_kzalloc(&pdev->dev, sizeof(*dglnt_dynclk), ++ GFP_KERNEL); ++ if (!dglnt_dynclk) ++ return -ENOMEM; ++ ++ mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ dglnt_dynclk->base = devm_ioremap_resource(&pdev->dev, mem); ++ if (IS_ERR(dglnt_dynclk->base)) ++ return PTR_ERR(dglnt_dynclk->base); ++ ++ parent_name = of_clk_get_parent_name(pdev->dev.of_node, 0); ++ if (!parent_name) ++ return -EINVAL; ++ ++ clk_name = pdev->dev.of_node->name; ++ of_property_read_string(pdev->dev.of_node, "clock-output-names", ++ &clk_name); ++ ++ init.name = clk_name; ++ init.ops = &dglnt_dynclk_ops; ++ init.flags = 0; ++ init.parent_names = &parent_name; ++ init.num_parents = 1; ++ ++ dglnt_dynclk->freq = 0; ++ dglnt_dynclk_disable(&dglnt_dynclk->clk_hw); ++ ++ dglnt_dynclk->clk_hw.init = &init; ++ clk = devm_clk_register(&pdev->dev, &dglnt_dynclk->clk_hw); ++ if (IS_ERR(clk)) ++ return PTR_ERR(clk); ++ ++ return of_clk_add_provider(pdev->dev.of_node, of_clk_src_simple_get, ++ clk); ++} ++ ++static int dglnt_dynclk_remove(struct platform_device *pdev) ++{ ++ of_clk_del_provider(pdev->dev.of_node); ++ ++ return 0; ++} ++ ++static struct platform_driver dglnt_dynclk_driver = { ++ .driver = { ++ .name = "dglnt-dynclk", ++ .owner = THIS_MODULE, ++ .of_match_table = dglnt_dynclk_ids, ++ }, ++ .probe = dglnt_dynclk_probe, ++ .remove = dglnt_dynclk_remove, ++}; ++module_platform_driver(dglnt_dynclk_driver); ++ ++MODULE_LICENSE("GPL v2"); ++MODULE_AUTHOR("Sam Bobrowicz <sbobrowicz@digilentinc.com>"); ++MODULE_DESCRIPTION("CCF Driver for Digilent axi_dynclk IP Core"); +-- +2.14.2 + diff --git a/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx/v2022.2/0003-drm-xilinx-Fix-DPMS-transition-to-on.patch b/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx/v2022.2/0003-drm-xilinx-Fix-DPMS-transition-to-on.patch new file mode 100644 index 00000000..a98d84c5 --- /dev/null +++ b/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx/v2022.2/0003-drm-xilinx-Fix-DPMS-transition-to-on.patch @@ -0,0 +1,54 @@ +From 1a18e2b514ae9e75145597ac509a87f656c976ba Mon Sep 17 00:00:00 2001 +From: Nathan Rossi <nathan@nathanrossi.com> +Date: Mon, 2 May 2016 23:46:42 +1000 +Subject: [PATCH 3/3] drm: xilinx: Fix DPMS transition to on + +Fix the issues where the VTC is reset (losing its timing config). + +Also fix the issue where the plane destroys its DMA descriptors and +marks the DMA channels as inactive but never recreates the descriptors +and never updates the active state when turning DPMS back on. + +Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> +Upstream-Status: Pending [This is a workaround] +--- + drivers/gpu/drm/xilinx/xilinx_drm_crtc.c | 1 - + drivers/gpu/drm/xilinx/xilinx_drm_plane.c | 3 ++- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/xilinx/xilinx_drm_crtc.c b/drivers/gpu/drm/xilinx/xilinx_drm_crtc.c +index 631d35b921..93dbd4b58a 100644 +--- a/drivers/gpu/drm/xilinx/xilinx_drm_crtc.c ++++ b/drivers/gpu/drm/xilinx/xilinx_drm_crtc.c +@@ -88,7 +88,6 @@ static void xilinx_drm_crtc_dpms(struct drm_crtc *base_crtc, int dpms) + default: + if (crtc->vtc) { + xilinx_vtc_disable(crtc->vtc); +- xilinx_vtc_reset(crtc->vtc); + } + if (crtc->cresample) { + xilinx_cresample_disable(crtc->cresample); +diff --git a/drivers/gpu/drm/xilinx/xilinx_drm_plane.c b/drivers/gpu/drm/xilinx/xilinx_drm_plane.c +index 6a248b72d4..d2518a4bdf 100644 +--- a/drivers/gpu/drm/xilinx/xilinx_drm_plane.c ++++ b/drivers/gpu/drm/xilinx/xilinx_drm_plane.c +@@ -140,7 +140,7 @@ void xilinx_drm_plane_commit(struct drm_plane *base_plane) + for (i = 0; i < MAX_NUM_SUB_PLANES; i++) { + struct xilinx_drm_plane_dma *dma = &plane->dma[i]; + +- if (dma->chan && dma->is_active) { ++ if (dma->chan) { + flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT; + desc = dmaengine_prep_interleaved_dma(dma->chan, + &dma->xt, +@@ -153,6 +153,7 @@ void xilinx_drm_plane_commit(struct drm_plane *base_plane) + dmaengine_submit(desc); + + dma_async_issue_pending(dma->chan); ++ dma->is_active = true; + } + } + } +-- +2.14.2 + diff --git a/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx/v2022.2/0004-minized-wifi-bluetooth.cfg b/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx/v2022.2/0004-minized-wifi-bluetooth.cfg new file mode 100644 index 00000000..f71e53ab --- /dev/null +++ b/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx/v2022.2/0004-minized-wifi-bluetooth.cfg @@ -0,0 +1,33 @@ +# +# Bluetooth config +# +CONFIG_BT=y +CONFIG_BT_BREDR=y +CONFIG_BT_HS=y +CONFIG_BT_LE=y +CONFIG_BT_BCM=y +CONFIG_BT_HCIUART=y +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_BCM=y +CONFIG_BT_HIDP=y +CONFIG_CFG80211=y +CONFIG_CFG80211_DEFAULT_PS=y +CONFIG_CFG80211_CRDA_SUPPORT=y +CONFIG_BRCMUTIL=y +CONFIG_BRCMFMAC=y +CONFIG_BRCMFMAC_PROTO_BCDC=y +CONFIG_BRCMFMAC_SDIO=y +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_ECB=y +CONFIG_CRYPTO_CMAC=y +CONFIG_CRYPTO_SHA256=y + +# +# Regulator config +# +CONFIG_REGMAP_IRQ=y +CONFIG_I2C_XILINX=y +CONFIG_MFD_DA9062=y +CONFIG_REGULATOR_DA9062=y + diff --git a/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx_2022.1.bbappend b/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx_2022.1.bbappend index 2ce919ac..8ba7a490 100644 --- a/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx_2022.1.bbappend +++ b/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx_2022.1.bbappend @@ -1,9 +1,12 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/linux-xlnx:" -SRC_URI:append:zybo-linux-bd-zynq7 = " \ - file://0001-drm-xilinx-Add-encoder-for-Digilent-boards.patch \ - file://0002-clk-Add-driver-for-axi_dynclk-IP-Core.patch \ - file://0003-drm-xilinx-Fix-DPMS-transition-to-on.patch \ - " +# Note: These patches are very old and doesn't apply on top of 5.x +# kernel. For more details refer README.md file. + +#SRC_URI:append:zybo-linux-bd-zynq7 = " \ +# file://0001-drm-xilinx-Add-encoder-for-Digilent-boards.patch \ +# file://0002-clk-Add-driver-for-axi_dynclk-IP-Core.patch \ +# file://0003-drm-xilinx-Fix-DPMS-transition-to-on.patch \ +# " SRC_URI:append:minized-zynq7 = " file://0004-minized-wifi-bluetooth.cfg" diff --git a/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx_2022.2.bbappend b/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx_2022.2.bbappend new file mode 100644 index 00000000..8ba7a490 --- /dev/null +++ b/meta-xilinx-contrib/recipes-kernel/linux/linux-xlnx_2022.2.bbappend @@ -0,0 +1,12 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/linux-xlnx:" + +# Note: These patches are very old and doesn't apply on top of 5.x +# kernel. For more details refer README.md file. + +#SRC_URI:append:zybo-linux-bd-zynq7 = " \ +# file://0001-drm-xilinx-Add-encoder-for-Digilent-boards.patch \ +# file://0002-clk-Add-driver-for-axi_dynclk-IP-Core.patch \ +# file://0003-drm-xilinx-Fix-DPMS-transition-to-on.patch \ +# " + +SRC_URI:append:minized-zynq7 = " file://0004-minized-wifi-bluetooth.cfg" diff --git a/meta-xilinx-core/README.md b/meta-xilinx-core/README.md index 8997760c..d450c4b3 100644 --- a/meta-xilinx-core/README.md +++ b/meta-xilinx-core/README.md @@ -1,24 +1,8 @@ -meta-xilinx-core -================ +# meta-xilinx-core -This layer provides support for MicroBlaze, Zynq and ZynqMP. +This layer provides support for MicroBlaze, Zynq, ZynqMP and Versal architectures. - -Maintainers, Mailing list, Patches -================================== - -Please send any patches, pull requests, comments or questions for this layer to -the [meta-xilinx mailing list](https://lists.yoctoproject.org/listinfo/meta-xilinx): - - meta-xilinx@lists.yoctoproject.org - -Maintainers: - - Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> - Mark Hatle <mark.hatle@xilinx.com> - -Dependencies -============ +## Dependencies This layer depends on: @@ -26,9 +10,10 @@ This layer depends on: URI: git://git.openembedded.org/openembedded-core layers: meta + branch: master or xilinx current release version (e.g. hosister) + -Configuring Machines -==================== +## Configuring Machines All machines that use meta-xilinx-tools should be derived from one of the following: microblaze-generic, zynq-generic, zynqmp-generic, or @@ -58,8 +43,7 @@ require you to specify the path to a PDI file using PDI_PATH. The XSCT version will extract the PDI automatically. -Recipe Licenses -=============== +## Recipe Licenses Due to licensing restrictions some recipes in this layer rely on closed source or restricted content provided by Xilinx. In order to use these recipes you must diff --git a/meta-xilinx-core/README.qemu.md b/meta-xilinx-core/README.qemu.md index d0040b09..d3a02a90 100644 --- a/meta-xilinx-core/README.qemu.md +++ b/meta-xilinx-core/README.qemu.md @@ -12,7 +12,7 @@ to make this available: pmu-rom-native. The license on the software is Xilinx proprietary, so you may be required to enable the approprate LICENSE_FLAGS_WHITELIST to trigger the download. The license itself is available within the download at the URL referred to in -meta-xilinx-core/recipes-bsp/pmu-firmware/pmu-rom-native_2022.1.bb. +meta-xilinx-core/recipes-bsp/pmu-firmware/pmu-rom-native_2022.2.bb. Add the following to your local.conf to acknowledge you accept the proprietary xilinx license. diff --git a/meta-xilinx-core/classes/fpgamanager_custom.bbclass b/meta-xilinx-core/classes/fpgamanager_custom.bbclass index 848727fb..555e2a66 100644 --- a/meta-xilinx-core/classes/fpgamanager_custom.bbclass +++ b/meta-xilinx-core/classes/fpgamanager_custom.bbclass @@ -1,6 +1,3 @@ -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" - inherit devicetree DEPENDS = "dtc-native bootgen-native" diff --git a/meta-xilinx-core/classes/image-types-xilinx-qemu.bbclass b/meta-xilinx-core/classes/image-types-xilinx-qemu.bbclass index 63318087..9532287d 100644 --- a/meta-xilinx-core/classes/image-types-xilinx-qemu.bbclass +++ b/meta-xilinx-core/classes/image-types-xilinx-qemu.bbclass @@ -5,6 +5,55 @@ # block device to match that of valid SD card sizes (which are multiples of # 512K). -CONVERSIONTYPES:append = " qemu-sd" -CONVERSION_CMD:qemu-sd = "cp ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.qemu-sd; truncate -s %256M ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.qemu-sd" -CONVERSION_DEPENDS_qemu-sd = "coreutils-native" +CONVERSIONTYPES:append = " qemu-sd qemu-sd-fatimg" +CONVERSION_CMD:qemu-sd () { + cp ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.qemu-sd + # Get the wic.qemu-sd file size + file_size=`stat -c '%s' ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.qemu-sd` + powerof2=1 + file_size=${file_size%.*} + # Get the next power of 2 value for the image size value + while [ ${powerof2} -lt ${file_size} ]; do + powerof2=$(expr $powerof2 \* 2) + done + # Resize the image using qemu-img + qemu-img resize -f raw ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.qemu-sd ${powerof2} +} + +BOOT_VOLUME_ID ?= "BOOT" +BOOT_SPACE ?= "1047552" +IMAGE_ALIGNMENT ?= "1024" + +# Create SD image in case of INITRAMFS_IMAGE set due to circular dependencies. +# This creates FAT partitioned SD image containing boot.bin,boot.scr and rootfs.cpio.gz.u-boot files. +# This is a workaround fix until we fix the circular dependencies +# Usage: IMAGE_FSTYPES:append = " cpio.gz.u-boot.qemu-sd-fatimg" +CONVERSION_CMD:qemu-sd-fatimg () { + QEMU_IMG="${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.qemu-sd-fatimg" + BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE} + ${IMAGE_ALIGNMENT} - 1) + BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE_ALIGNED} - ${BOOT_SPACE_ALIGNED} % ${IMAGE_ALIGNMENT}) + QEMUIMG_SIZE=$(expr ${IMAGE_ALIGNMENT} + ${BOOT_SPACE_ALIGNED}) + dd if=/dev/zero of=${QEMU_IMG} bs=1024 count=0 seek=${QEMUIMG_SIZE} + parted -s ${QEMU_IMG} mklabel msdos + parted -s ${QEMU_IMG} unit KiB mkpart primary fat32 ${IMAGE_ALIGNMENT} $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ALIGNMENT} \- 1) + parted -s ${QEMU_IMG} set 1 boot on + parted ${QEMU_IMG} print + BOOT_BLOCKS=$(LC_ALL=C parted -s ${QEMU_IMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }') + rm -f ${WORKDIR}/${BOOT_VOLUME_ID}.img + mkfs.vfat -n "${BOOT_VOLUME_ID}" -S 512 -C ${WORKDIR}/${BOOT_VOLUME_ID}.img $BOOT_BLOCKS + if [ -e ${DEPLOY_DIR_IMAGE}/boot.bin ]; then + mcopy -i ${WORKDIR}/${BOOT_VOLUME_ID}.img -s ${DEPLOY_DIR_IMAGE}/boot.bin ::/ + fi + if [ -e ${DEPLOY_DIR_IMAGE}/boot.scr ]; then + mcopy -i ${WORKDIR}/${BOOT_VOLUME_ID}.img -s ${DEPLOY_DIR_IMAGE}/boot.scr ::/ + fi + if [ ${INITRAMFS_IMAGE} = ${IMAGE_BASENAME} ] && [ x"${INITRAMFS_IMAGE_BUNDLE}" != "x1" ]; then + mcopy -i ${WORKDIR}/${BOOT_VOLUME_ID}.img -s ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ::rootfs.cpio.gz.u-boot + fi + dd if=${WORKDIR}/${BOOT_VOLUME_ID}.img of=${QEMU_IMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ALIGNMENT} \* 1024) +} + +CONVERSION_DEPENDS_qemu-sd = "qemu-xilinx-system-native" +CONVERSION_DEPENDS_qemu-sd-fatimg = "mtools-native:do_populate_sysroot \ + dosfstools-native:do_populate_sysroot \ + parted-native:do_populate_sysroot" diff --git a/meta-xilinx-core/classes/qemuboot-xilinx.bbclass b/meta-xilinx-core/classes/qemuboot-xilinx.bbclass index 48dfa6e2..58ade1b9 100644 --- a/meta-xilinx-core/classes/qemuboot-xilinx.bbclass +++ b/meta-xilinx-core/classes/qemuboot-xilinx.bbclass @@ -10,11 +10,133 @@ QB_MACHINE_XILINX:aarch64 = "-machine arm-generic-fdt" QB_MACHINE_XILINX:arm = "-M arm-generic-fdt-7series" QB_MACHINE_XILINX:microblaze = "-M microblaze-fdt-plnx" +QB_SYSTEM_NAME ?= "${@qemu_target_binary(d)}" +QB_DEFAULT_FSTYPE ?= "${@qemu_rootfs_params(d,'fstype')}" +QB_ROOTFS ?= "${@qemu_rootfs_params(d,'rootfs')}" +QB_ROOTFS_OPT ?= "${@qemu_rootfs_params(d,'rootfs-opt')}" +QB_DTB ?= "${@qemu_default_dtb(d)}" + # defaults QB_DEFAULT_KERNEL ?= "none" +QB_DEFAULT_KERNEL:zynq ?= "${@'zImage' if \ + d.getVar('INITRAMFS_IMAGE_BUNDLE') != '1' else 'zImage-initramfs-${MACHINE}.bin'}" +QB_DEFAULT_KERNEL:microblaze ?= "${@'simpleImage.mb' if \ + d.getVar('INITRAMFS_IMAGE_BUNDLE') != '1' else 'simpleImage.mb-initramfs-${MACHINE}.bin'}" inherit qemuboot +def qemu_target_binary(data): + package_arch = data.getVar("PACKAGE_ARCH") + qemu_target_binary = (data.getVar("QEMU_TARGET_BINARY_%s" % package_arch) or "") + if qemu_target_binary: + return qemu_target_binary + + target_arch = data.getVar("TARGET_ARCH") + if target_arch == "microblazeeb": + target_arch = "microblaze" + elif target_arch == "aarch64": + target_arch += "-multiarch" + elif target_arch == "arm": + target_arch = "aarch64" + return "qemu-system-%s" % target_arch + +def qemu_add_extra_args(data): + initramfs_image = data.getVar('INITRAMFS_IMAGE') or "" + bundle_image = data.getVar('INITRAMFS_IMAGE_BUNDLE') or "" + deploy_dir = data.getVar('DEPLOY_DIR_IMAGE') or "" + machine_name = data.getVar('MACHINE') or "" + soc_family = data.getVar('SOC_FAMILY') or "" + qb_extra_args = '' + # Add kernel image and boot.scr to qemu boot command when initramfs_image supplied + kernel_name = '' + bootscr_image = '%s/boot.scr' % deploy_dir + if soc_family in ('zynqmp', 'versal'): + kernel_name = 'Image' + bootscr_loadaddr = '0x20000000' + if initramfs_image: + kernel_image = '%s/%s' % (deploy_dir, kernel_name) + if bundle_image == "1": + kernel_image = '%s/%s-initramfs-%s.bin' % (deploy_dir, kernel_name, machine_name) + kernel_loadaddr = '0x200000' + if kernel_name: + qb_extra_args = ' -device loader,file=%s,addr=%s,force-raw=on' % (kernel_image, kernel_loadaddr) + qb_extra_args += ' -device loader,file=%s,addr=%s,force-raw=on' % (bootscr_image, bootscr_loadaddr) + if soc_family == 'versal': + qb_extra_args += ' -boot mode=5' + else: + if soc_family in ('zynqmp', 'versal'): + qb_extra_args = ' -boot mode=5' + return qb_extra_args + +def qemu_rootfs_params(data, param): + initramfs_image = data.getVar('INITRAMFS_IMAGE') or "" + bundle_image = data.getVar('INITRAMFS_IMAGE_BUNDLE') or "" + soc_family = data.getVar('SOC_FAMILY') or "" + tune_features = (data.getVar('TUNE_FEATURES') or []).split() + if 'microblaze' in tune_features: + soc_family = 'microblaze' + soc_variant = data.getVar('SOC_VARIANT') or "" + + if param == 'rootfs': + return 'none' if bundle_image == "1" else '' + + elif param == 'fstype': + fstype_dict = { + "microblaze": "cpio.gz", + "zynq": "cpio.gz", + "zynqmp": "cpio.gz.u-boot", + "versal": "cpio.gz.u-boot.qemu-sd-fatimg" + } + if not initramfs_image: + image_fs = data.getVar('IMAGE_FSTYPES') + if 'wic.qemu-sd' in image_fs: + return 'wic.qemu-sd' + return fstype_dict[soc_family] + + elif param == 'rootfs-opt': + sd_index = "1" + if soc_family == 'zynq': + sd_index = "0" + if soc_family == 'versal' and soc_variant == 'net': + sd_index = "0" + + # Device is using a disk + if not initramfs_image: + return ' -drive if=sd,index=%s,file=@ROOTFS@,format=raw' % (sd_index) + + # Device is using a ramdisk + if soc_family not in ('zynq', 'microblaze'): + return ' -device loader,file=@ROOTFS@,addr=0x04000000,force-raw=on' + + # Ramdisk must be compiled into the kernel + return '' + +def qemu_default_dtb(data): + if data.getVar("IMAGE_BOOT_FILES", True): + dtbs = data.getVar("IMAGE_BOOT_FILES", True).split(" ") + # IMAGE_BOOT_FILES has extra renaming info in the format '<source>;<target>' + # Note: Wildcard sources work here only because runqemu expands them at run time + dtbs = [f.split(";")[0] for f in dtbs] + dtbs = [f for f in dtbs if f.endswith(".dtb")] + if len(dtbs) != 0: + return dtbs[0] + return "" + +def qemu_default_serial(data): + if data.getVar("SERIAL_CONSOLES", True): + first_console = data.getVar("SERIAL_CONSOLES", True).split(" ")[0] + speed, console = first_console.split(";", 1) + # zynqmp uses earlycon and stdout (in dtb) + if "zynqmp" in data.getVar("MACHINEOVERRIDES", True).split(":"): + return "" + return "console=%s,%s earlyprintk" % (console, speed) + return "" + +def qemu_zynqmp_unhalt(data, multiarch): + if multiarch: + return "-global xlnx,zynqmp-boot.cpu-num=0 -global xlnx,zynqmp-boot.use-pmufw=true" + return "-device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4" + # rewrite the qemuboot with the custom sysroot bindir python do_write_qemuboot_conf:append() { val = os.path.join(d.getVar('BASE_WORKDIR'), d.getVar('BUILD_SYS'), 'qemu-xilinx-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/') @@ -24,4 +146,3 @@ python do_write_qemuboot_conf:append() { with open(qemuboot, 'w') as f: cf.write(f) } - diff --git a/meta-xilinx-core/conf/bblayers.conf.sample b/meta-xilinx-core/conf/bblayers.conf.sample index 890ef3b6..a98e8936 100644 --- a/meta-xilinx-core/conf/bblayers.conf.sample +++ b/meta-xilinx-core/conf/bblayers.conf.sample @@ -23,6 +23,7 @@ BBLAYERS ?= " \ ##OEROOT##/../meta-xilinx/meta-xilinx-pynq \ ##OEROOT##/../meta-xilinx/meta-xilinx-standalone \ ##OEROOT##/../meta-xilinx/meta-xilinx-contrib \ + ##OEROOT##/../meta-xilinx/meta-xilinx-vendor \ ##OEROOT##/../meta-xilinx-tools \ ##OEROOT##/../meta-petalinux \ ##OEROOT##/../meta-virtualization \ diff --git a/meta-xilinx-core/conf/layer.conf b/meta-xilinx-core/conf/layer.conf index 457853f7..9090abe6 100644 --- a/meta-xilinx-core/conf/layer.conf +++ b/meta-xilinx-core/conf/layer.conf @@ -18,6 +18,8 @@ meta-python:${LAYERDIR}/dynamic-layers/meta-python/recipes-*/*/*.bb \ meta-python:${LAYERDIR}/dynamic-layers/meta-python/recipes-*/*/*.bbappend \ virtualization-layer:${LAYERDIR}/dynamic-layers/virtualization-layer/recipes-*/*/*.bb \ virtualization-layer:${LAYERDIR}/dynamic-layers/virtualization-layer/recipes-*/*/*.bbappend \ +xilinx-tools:${LAYERDIR}/dynamic-layers/meta-xilinx-tools/recipes-*/*/*.bb \ +xilinx-tools:${LAYERDIR}/dynamic-layers/meta-xilinx-tools/recipes-*/*/*.bbappend \ " LAYERDEPENDS_xilinx = "core" @@ -42,4 +44,15 @@ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \ *->xserver-xorg \ " -XILINX_RELEASE_VERSION = "v2022.1" +XILINX_RELEASE_VERSION ??= "v2022.2" + +BUILDCFG_VARS:append = " XILINX_RELEASE_VERSION" + +PREFERRED_VERSION_qemu-xilinx ?= "v6.1.0-xilinx-${XILINX_RELEASE_VERSION}%" +PREFERRED_VERSION_qemu-xilinx-native ?= "v6.1.0-xilinx-${XILINX_RELEASE_VERSION}%" +PREFERRED_VERSION_qemu-xilinx-system-native ?= "v6.1.0-xilinx-${XILINX_RELEASE_VERSION}%" +PREFERRED_VERSION_qemu-devicetrees ?= "xilinx-${XILINX_RELEASE_VERSION}%" +PREFERRED_VERSION_arm-trusted-firmware ?= "2.6-xilinx-${XILINX_RELEASE_VERSION}%" +PREFERRED_VERSION_u-boot-xlnx ?= "v2021.01-xilinx-${XILINX_RELEASE_VERSION}%" +PREFERRED_VERSION_pmu-rom-native ?= "${@d.getVar("XILINX_RELEASE_VERSION").replace('v','')}" +PREFERRED_VERSION_linux-xlnx ?= "${@'5.15.19' if d.getVar("XILINX_RELEASE_VERSION") == 'v2022.1' else '5.15.36'}%" diff --git a/meta-xilinx-core/conf/local.conf.sample b/meta-xilinx-core/conf/local.conf.sample index a7173fb8..10134d53 100644 --- a/meta-xilinx-core/conf/local.conf.sample +++ b/meta-xilinx-core/conf/local.conf.sample @@ -206,11 +206,11 @@ BB_DISKMON_DIRS ??= "\ #file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \ #file://.* file:///some/local/dir/sstate/PATH" -XILINX_VER_MAIN = "2022.1" +XILINX_RELEASE_VERSION = "v2022.2" # Uncomment below lines to provide path for custom xsct trim # -#EXTERNAL_XSCT_TARBALL = "/proj/yocto/xsct-trim/2022.1_xsct_daily_latest" +#EXTERNAL_XSCT_TARBALL = "/proj/yocto/xsct-trim/2022.2_xsct_daily_latest" #VALIDATE_XSCT_CHECKSUM = '0' # diff --git a/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc b/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc index a15e92c6..aa91f771 100644 --- a/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc +++ b/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc @@ -38,6 +38,13 @@ XSERVER ?= " \ ${XSERVER_EXT} \ " +# Automatically add WKS_FILE_DEPENDS based on the configuration +WKS_FILE_DEPENDS:append = "${@bb.utils.contains('IMAGE_BOOT_FILES', 'boot.bin', ' xilinx-bootbin', '', d)}" +WKS_FILE_DEPENDS:append = "${@bb.utils.contains('IMAGE_BOOT_FILES', 'system.dtb', ' virtual/dtb', '', d)}" +WKS_FILE_DEPENDS:append = "${@bb.utils.contains('IMAGE_BOOT_FILES', 'boot.scr', ' u-boot-zynq-scr', '', d)}" +WKS_FILE_DEPENDS:append = "${@bb.utils.contains('IMAGE_BOOT_FILES', 'uEnv.txt', ' u-boot-zynq-uenv', '', d)}" +WKS_FILE_DEPENDS:append = "${@bb.utils.contains('IMAGE_BOOT_FILES', 'atf-uboot.ub', ' arm-trusted-firmware', '', d)}" + IMAGE_BOOT_FILES ?= "${@get_default_image_boot_files(d)}" def get_default_image_boot_files(d): @@ -46,6 +53,7 @@ def get_default_image_boot_files(d): # kernel images kerneltypes = set((d.getVar("KERNEL_IMAGETYPE") or "").split()) kerneltypes |= set((d.getVar("KERNEL_IMAGETYPES") or "").split()) + kerneltypes |= set((d.getVar("KERNEL_ALT_IMAGETYPE") or "").split()) for i in kerneltypes: files.append(i) diff --git a/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc b/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc index c2093ca6..7b953975 100644 --- a/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc +++ b/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc @@ -1,55 +1,17 @@ # This include is used to setup default QEMU and qemuboot config for meta-xilinx # machines. -# Use the xilinx specific version for these users -IMAGE_CLASSES += "qemuboot-xilinx" - -# depend on qemu-helper-native, which will depend on QEMU -EXTRA_IMAGEDEPENDS += "qemu-helper-native" - PREFERRED_PROVIDER_qemu-helper-native = "qemu-xilinx-helper-native" PREFERRED_PROVIDER_qemu = "qemu-xilinx" PREFERRED_PROVIDER_qemu-native = "qemu-xilinx-native" +PREFERRED_PROVIDER_qemu-system-native = "qemu-xilinx-system-native" PREFERRED_PROVIDER_nativesdk-qemu = "nativesdk-qemu-xilinx" -def qemu_default_dtb(d): - if d.getVar("IMAGE_BOOT_FILES", True): - dtbs = d.getVar("IMAGE_BOOT_FILES", True).split(" ") - # IMAGE_BOOT_FILES has extra renaming info in the format '<source>;<target>' - # Note: Wildcard sources work here only because runqemu expands them at run time - dtbs = [f.split(";")[0] for f in dtbs] - dtbs = [f for f in dtbs if f.endswith(".dtb")] - if len(dtbs) != 0: - return dtbs[0] - return "" - -def qemu_default_serial(d): - if d.getVar("SERIAL_CONSOLES", True): - first_console = d.getVar("SERIAL_CONSOLES", True).split(" ")[0] - speed, console = first_console.split(";", 1) - # zynqmp uses earlycon and stdout (in dtb) - if "zynqmp" in d.getVar("MACHINEOVERRIDES", True).split(":"): - return "" - return "console=%s,%s earlyprintk" % (console, speed) - return "" +# enable the overrides for the context of the conf only +MACHINEOVERRIDES =. "qemuboot-xilinx:" -def qemu_target_binary(d): - ta = d.getVar("TARGET_ARCH", True) - if ta == "microblazeeb": - ta = "microblaze" - elif ta == "arm": - ta = "aarch64" - return "qemu-system-%s" % ta - -def qemu_zynqmp_unhalt(d, multiarch): - if multiarch: - return "-global xlnx,zynqmp-boot.cpu-num=0 -global xlnx,zynqmp-boot.use-pmufw=true" - return "-device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4" - -# For qemuboot, default setup across all machines in meta-xilinx -QB_SYSTEM_NAME:aarch64 ?= "${@qemu_target_binary(d)}-multiarch" -QB_SYSTEM_NAME ?= "${@qemu_target_binary(d)}" -QB_DEFAULT_FSTYPE ?= "cpio" -QB_DTB ?= "${@qemu_default_dtb(d)}" -QB_KERNEL_CMDLINE_APPEND ?= "${@qemu_default_serial(d)}" +# depend on qemu-helper-native, which will depend on QEMU +EXTRA_IMAGEDEPENDS += "qemu-system-native qemu-helper-native:do_addto_recipe_sysroot" +# Use the xilinx specific version for these users +IMAGE_CLASSES += "qemuboot-xilinx" diff --git a/meta-xilinx-core/conf/machine/include/soc-versal.inc b/meta-xilinx-core/conf/machine/include/soc-versal.inc index 40145963..dcf3796e 100644 --- a/meta-xilinx-core/conf/machine/include/soc-versal.inc +++ b/meta-xilinx-core/conf/machine/include/soc-versal.inc @@ -7,6 +7,7 @@ SOC_FAMILY ?= "versal" # "hbm" - Versal HMB Devices # "ai-core" - Versal AI-core Devices # "ai-edge" - Versal AI-Edge Devices +# "net" - Versal Net Devices SOC_VARIANT ?= "prime" diff --git a/meta-xilinx-core/conf/machine/microblaze-generic.conf b/meta-xilinx-core/conf/machine/microblaze-generic.conf index 9004282a..92412681 100644 --- a/meta-xilinx-core/conf/machine/microblaze-generic.conf +++ b/meta-xilinx-core/conf/machine/microblaze-generic.conf @@ -29,15 +29,31 @@ MACHINE_ARCH = "${@['${MB_MACHINE_ARCH}', '${DEF_MACHINE_ARCH}']['microblaze-gen MACHINE_FEATURES = "" -KERNEL_IMAGETYPE = "linux.bin.ub" +KERNEL_IMAGETYPE ?= "linux.bin.ub" KERNEL_IMAGETYPES = "" -SERIAL_CONSOLES ?= "115200;ttyS0" +SERIAL_CONSOLES ?= "115200;ttyUL0" + +MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "device-tree" + +IMAGE_BOOT_FILES += " \ + ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', '', d)} \ + " EXTRA_IMAGEDEPENDS += "libyaml-native python3-cython-native python3-pyyaml-native" UBOOT_MACHINE ?= "microblaze-generic_defconfig" UBOOT_INITIAL_ENV = "" +BOOTMODE ?= "generic.root" + +HDF_MACHINE = "kc705-microblazeel" +IMAGE_FSTYPES += "cpio.gz" + +QB_KERNEL_CMDLINE = "none" + +QB_OPT_APPEND = "" + +QB_NETWORK_DEVICE = "-net nic,netdev=net0,macaddr=@MAC@" #### No additional settings should be after the Postamble #### Postamble diff --git a/meta-xilinx-core/conf/machine/versal-generic.conf b/meta-xilinx-core/conf/machine/versal-generic.conf index 3509d8c4..9b9ebf31 100644 --- a/meta-xilinx-core/conf/machine/versal-generic.conf +++ b/meta-xilinx-core/conf/machine/versal-generic.conf @@ -20,6 +20,7 @@ MACHINE_FEATURES += "rtc ext2 ext3 vfat usbhost" EXTRA_IMAGEDEPENDS += "libyaml-native python3-cython-native python3-pyyaml-native" UBOOT_MACHINE ?= "xilinx_versal_virt_defconfig" +BOOTMODE ?= "generic.root" SERIAL_CONSOLES ?= "115200;ttyAMA0" @@ -29,7 +30,9 @@ HDF_MACHINE = "vck190-versal" # Default SD image build onfiguration, use qemu-sd to pad IMAGE_CLASSES += "image-types-xilinx-qemu" -IMAGE_FSTYPES += "wic.qemu-sd" +# Add wic.qemu-sd only if initramfs_image not set due to circular dependecies +IMAGE_FSTYPES += "${@'wic.qemu-sd' if (d.getVar('INITRAMFS_IMAGE') or '') == '' else 'cpio.gz.u-boot.qemu-sd-fatimg'}" + WKS_FILES ?= "sdimage-bootpart.wks" EXTRA_IMAGEDEPENDS += " \ @@ -58,24 +61,17 @@ QB_NETWORK_DEVICE = "" QB_KERNEL_CMDLINE_APPEND ?= "" QB_NET = "none" -QB_DEFAULT_FSTYPE:qemuboot-xilinx = "wic.qemu-sd" -QB_OPT_APPEND:append:qemuboot-xilinx = " -boot mode=5" -QB_ROOTFS_OPT:qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw" - -# Use booti 80000 6000000 4000000 to launch -QB_OPT_APPEND ?= " -serial null -serial null -serial mon:stdio -display none" - QEMU_HW_DTB_PATH = "${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch" -QEMU_HW_DTB_PS ?="${QEMU_HW_DTB_PATH}/board-versal-ps-vck190.dtb" -QEMU_HW_DTB_PMC ?="${QEMU_HW_DTB_PATH}/board-versal-pmc-vc-p-a2197-00.dtb" +QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/board-versal-ps-vck190.dtb" +QEMU_HW_DTB_PMC = "${QEMU_HW_DTB_PATH}/board-versal-pmc-vc-p-a2197-00.dtb" QEMU_HW_DTB_PS_vp1202-versal = "${QEMU_HW_DTB_PATH}/board-versal-vp1202-ps-virt.dtb" QEMU_HW_DTB_PMC_vp1202-versal = "${QEMU_HW_DTB_PATH}/board-versal-vp1202-pmc-virt.dtb" -QB_OPT_APPEND:append:qemuboot-xilinx = " \ +QB_OPT_APPEND = " \ -hw-dtb ${QEMU_HW_DTB_PS} \ - -display none \ - -net nic -net user,tftp=${DEPLOY_DIR_IMAGE} \ + -serial null -serial null \ + ${@qemu_add_extra_args(d)} \ " # PLM instance args @@ -84,14 +80,14 @@ QB_PLM_OPT = " \ -device loader,file=${DEPLOY_DIR_IMAGE}/BOOT-${MACHINE}_bh.bin,addr=0xF201E000,force-raw \ -device loader,addr=0xf0000000,data=0xba020004,data-len=4 \ -device loader,addr=0xf0000004,data=0xb800fffc,data-len=4 \ - -device loader,file=${DEPLOY_DIR_IMAGE}/pmc_cdo.bin,addr=0xf2000000,force-raw \ + -device loader,file=${DEPLOY_DIR_IMAGE}/CDO/pmc_cdo.bin,addr=0xf2000000,force-raw \ -device loader,file=${DEPLOY_DIR_IMAGE}/plm-${MACHINE}.elf,cpu-num=1 \ -device loader,addr=0xF1110624,data=0x0,data-len=4 \ -device loader,addr=0xF1110620,data=0x1,data-len=4 \ -hw-dtb ${QEMU_HW_DTB_PMC} \ -display none \ " -QB_OPT_APPEND:append:qemuboot-xilinx = " -plm-args '${QB_PLM_OPT}'" +QB_OPT_APPEND += " -plm-args '${QB_PLM_OPT}'" #### No additional settings should be after the Postamble #### Postamble diff --git a/meta-xilinx-core/conf/machine/versal-net-generic.conf b/meta-xilinx-core/conf/machine/versal-net-generic.conf new file mode 100644 index 00000000..1941235a --- /dev/null +++ b/meta-xilinx-core/conf/machine/versal-net-generic.conf @@ -0,0 +1,30 @@ +#@TYPE: Machine +#@NAME: Versal Net Generic +##@DESCRIPTION: Versal Net + +#### Preamble +MACHINEOVERRIDES =. "${@['', 'versal-net-generic:']['versal-net-generic' != '${MACHINE}']}" +#### Regular settings follow + +SOC_VARIANT = "net" + +# Must be set first, or versal-generic will set it +UBOOT_MACHINE ?= "xilinx_versal_net_virt_defconfig" + +require conf/machine/versal-generic.conf + +#### REMOVE THE FOLLOWING WHEN BOOTGEN IS SYNCED +# required for bootgen native/nativesdk +MACHINEOVERRIDES:class-native = "versal-net" +MACHINEOVERRIDES:class-nativesdk = "versal-net" +#### REMOVE THE ABOVE + +HDF_MACHINE = "versal-net-generic" + +QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/board-versal-net-psx-spp-1.4.dtb" +QEMU_HW_DTB_PMC = "${QEMU_HW_DTB_PATH}/board-versal-pmx-virt.dtb" + +#### No additional settings should be after the Postamble +#### Postamble +PACKAGE_EXTRA_ARCHS:append = "${@['', ' versal_net_generic']['versal-net-generic' != "${MACHINE}"]}" + diff --git a/meta-xilinx-core/conf/machine/zynq-generic.conf b/meta-xilinx-core/conf/machine/zynq-generic.conf index 59fc3976..e8ecfb34 100644 --- a/meta-xilinx-core/conf/machine/zynq-generic.conf +++ b/meta-xilinx-core/conf/machine/zynq-generic.conf @@ -20,31 +20,38 @@ MACHINE_FEATURES += "rtc ext2 ext3 vfat usbhost usbgadget" EXTRA_IMAGEDEPENDS += "libyaml-native python3-cython-native python3-pyyaml-native" UBOOT_MACHINE ?= "xilinx_zynq_virt_defconfig" +BOOTMODE ?= "generic.root" SERIAL_CONSOLES ?= "115200;ttyPS0" MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "device-tree" +IMAGE_BOOT_FILES += " \ + ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', '', d)} \ + boot.scr \ + " + HDF_MACHINE = "zc702-zynq7" +IMAGE_CLASSES += "image-types-xilinx-qemu" +# Add wic.qemu-sd only if initramfs_image not set due to circular dependecies +IMAGE_FSTYPES += "${@'wic.qemu-sd' if (d.getVar('INITRAMFS_IMAGE') or '') == '' else 'cpio.gz'}" +WKS_FILES ?= "sdimage-bootpart.wks" QB_MEM = "-m 1024" -QB_NETWORK_DEVICE = "-net nic,netdev=eth0 -netdev user,id=eth0,tftp=/tftpboot -net nic" -QB_DEFAULT_KERNEL:qemuboot-xilinx = "zImage" +QB_NETWORK_DEVICE = "-net nic,netdev=net0,macaddr=@MAC@" -QB_SYSTEM_NAME ?= "${@qemu_target_binary(d)}" -QB_DEFAULT_FSTYPE = "cpio.gz" -QB_DTB = "system.dtb" -QB_ROOTFS_OPT:qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw" +QB_KERNEL_ROOT = "/dev/mmcblk0p2" # Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW) -QB_OPT_APPEND = " \ - -nographic -serial null -serial mon:stdio \ +QB_OPT_APPEND ?= " \ + -serial null \ -gdb tcp::9000 \ -device loader,addr=0xf8000008,data=0xDF0D,data-len=4 \ -device loader,addr=0xf8000140,data=0x00500801,data-len=4 \ -device loader,addr=0xf800012c,data=0x1ed044d,data-len=4 \ -device loader,addr=0xf8000108,data=0x0001e008,data-len=4 \ -device loader,addr=0xF8000910,data=0xF,data-len=0x4 \ + -machine linux=on \ " #### No additional settings should be after the Postamble diff --git a/meta-xilinx-core/conf/machine/zynqmp-generic.conf b/meta-xilinx-core/conf/machine/zynqmp-generic.conf index 6bc42364..32de4d50 100644 --- a/meta-xilinx-core/conf/machine/zynqmp-generic.conf +++ b/meta-xilinx-core/conf/machine/zynqmp-generic.conf @@ -31,10 +31,12 @@ EXTRA_IMAGEDEPENDS += "libyaml-native python3-cython-native python3-pyyaml-nativ UBOOT_MACHINE ?= "xilinx_zynqmp_virt_defconfig" SPL_BINARY ?= "spl/boot.bin" +BOOTMODE ?= "generic.root" # Default SD image build onfiguration, use qemu-sd to pad IMAGE_CLASSES += "image-types-xilinx-qemu" -IMAGE_FSTYPES += "wic.qemu-sd" +# Add wic.qemu-sd only if initramfs_image not set due to circular dependecies +IMAGE_FSTYPES += "${@'wic.qemu-sd' if (d.getVar('INITRAMFS_IMAGE') or '') == '' else 'cpio.gz.u-boot'}" WKS_FILES ?= "sdimage-bootpart.wks" SERIAL_CONSOLES ?= "115200;ttyPS0" @@ -62,23 +64,18 @@ IMAGE_BOOT_FILES += " \ # This machine has a QEMU model, runqemu setup: QB_MEM = "-m 4096" -QB_OPT_APPEND ?= "-nographic -serial mon:stdio -serial null" QB_NETWORK_DEVICE = "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MAC@" # Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW) -QB_OPT_APPEND:append:qemuboot-xilinx = " \ +QB_OPT_APPEND = " \ -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zcu102-arm.dtb \ ${@qemu_zynqmp_unhalt(d, True)} \ -device loader,file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware.elf,cpu-num=0 \ -device loader,file=${DEPLOY_DIR_IMAGE}/u-boot.elf \ - -device loader,file=${DEPLOY_DIR_IMAGE}/system.dtb,addr=0x100000 \ + -device loader,file=${DEPLOY_DIR_IMAGE}/system.dtb,addr=0x100000,force-raw=on \ + ${@qemu_add_extra_args(d)} \ " -# Attach the rootfs disk image to the second SD interface of QEMU (which is SD0) -QB_DEFAULT_FSTYPE:qemuboot-xilinx = "wic.qemu-sd" -QB_OPT_APPEND:append:qemuboot-xilinx = " -boot mode=5" -QB_ROOTFS_OPT:qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw" - QB_PMU_OPT = " \ -M microblaze-fdt \ -display none \ @@ -88,7 +85,7 @@ QB_PMU_OPT = " \ -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \ -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \ " -QB_OPT_APPEND:append:qemuboot-xilinx = " -pmu-args '${QB_PMU_OPT}'" +QB_OPT_APPEND += " -pmu-args '${QB_PMU_OPT}'" do_write_qemuboot_conf[depends] += "u-boot-zynq-uenv:do_deploy" diff --git a/meta-xilinx-core/dynamic-layers/meta-xilinx-tools/recipes-bsp/device-tree/device-tree.bbappend b/meta-xilinx-core/dynamic-layers/meta-xilinx-tools/recipes-bsp/device-tree/device-tree.bbappend new file mode 100644 index 00000000..151bd0e0 --- /dev/null +++ b/meta-xilinx-core/dynamic-layers/meta-xilinx-tools/recipes-bsp/device-tree/device-tree.bbappend @@ -0,0 +1,18 @@ +# Set Board DTSI files for generic manchine configuration files based on HDF_MACHINE. + +# microblaze-generic.conf uses HDF_MACHINE = "kc705-microblazeel", Hence set kc705-full dtsi file. +YAML_MAIN_MEMORY_CONFIG:microblaze-generic ?= "mig_7series_0" +YAML_CONSOLE_DEVICE_CONFIG:microblaze-generic ?= "axi_uartlite_0" +YAML_DT_BOARD_FLAGS:microblaze-generic ?= "{BOARD kc705-full}" + +# zynq-generic.conf uses HDF_MACHINE = "zc702-zynq7", Hence set zc702 dtsi file. +YAML_DT_BOARD_FLAGS:zynq-generic ?= "{BOARD zc702}" + +# zynqmp-generic.conf uses HDF_MACHINE = "zcu102-zynqmp", Hence set zcu102-rev1.0 dtsi file. +YAML_DT_BOARD_FLAGS:zynqmp-generic ?= "{BOARD zcu102-rev1.0}" + +# versal-generic.conf file uses HDF_MACHINE = "vck190-versal", Hence set versal-vck190-reva-x-ebm-01-reva dtsi file. +YAML_DT_BOARD_FLAGS:versal-generic ?= "{BOARD versal-vck190-reva-x-ebm-01-reva}" + +# versal-net-generic.conf uses HDF_MACHINE = "versal-net-generic", Hence set versal-net-ipp-rev1.9 dtsi file. +YAML_DT_BOARD_FLAGS:versal-net-generic ?= "{BOARD versal-net-ipp-rev1.9}" diff --git a/meta-xilinx-core/dynamic-layers/virtualization-layer/recipes-kernel/lopper/lopper.bbappend b/meta-xilinx-core/dynamic-layers/virtualization-layer/recipes-kernel/lopper/lopper.bbappend index ccbc19e2..51c3f79e 100644 --- a/meta-xilinx-core/dynamic-layers/virtualization-layer/recipes-kernel/lopper/lopper.bbappend +++ b/meta-xilinx-core/dynamic-layers/virtualization-layer/recipes-kernel/lopper/lopper.bbappend @@ -5,8 +5,8 @@ SECTION = "bootloader" FILESEXTRAPATHS:append := ":${THISDIR}/lopper" -SRC_URI = "git://github.com/devicetree-org/lopper.git;branch=master;protocol=https" -SRCREV = "f70eb86385f49545070a84ad756902b3cd607e21" +SRC_URI = "git://github.com/devicetree-org/lopper.git;branch=v0.2022.x;protocol=https" +SRCREV = "cdb1a7b55c375f5237683a512257e0fc573063a2" S = "${WORKDIR}/git" PV="v1.0.2+git${SRCPV}" diff --git a/meta-xilinx-core/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware.inc b/meta-xilinx-core/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware.inc index 5591fa63..bbbeb507 100644 --- a/meta-xilinx-core/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware.inc +++ b/meta-xilinx-core/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware.inc @@ -14,9 +14,8 @@ B = "${WORKDIR}/build" SYSROOT_DIRS += "/boot" -XILINX_RELEASE_VERSION ?= "" ATF_VERSION ?= "2.2" -ATF_VERSION_EXTENSION ?= "-xilinx-${XILINX_RELEASE_VERSION}" +ATF_VERSION_EXTENSION ?= "-xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}" PV = "${ATF_VERSION}${ATF_VERSION_EXTENSION}+git${SRCPV}" BRANCH ?= "" @@ -36,6 +35,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" PLATFORM:zynqmp = "zynqmp" PLATFORM:versal = "versal" +PLATFORM:versal-net = "versal_net" # requires CROSS_COMPILE set by hand as there is no configure script export CROSS_COMPILE="${TARGET_PREFIX}" @@ -55,6 +55,7 @@ DEBUG_ATF:versal ?= "1" EXTRA_OEMAKE:append:zynqmp = "${@' ZYNQMP_CONSOLE=${ATF_CONSOLE}' if d.getVar('ATF_CONSOLE', True) != '' else ''}" EXTRA_OEMAKE:append:versal = "${@' VERSAL_CONSOLE=${ATF_CONSOLE}' if d.getVar('ATF_CONSOLE', True) != '' else ''}" +EXTRA_OEMAKE:append:versal-net = "${@' VERSAL_NET_CONSOLE=${ATF_CONSOLE}' if d.getVar('ATF_CONSOLE', True) != '' else ''}" EXTRA_OEMAKE:append = " ${@bb.utils.contains('DEBUG_ATF', '1', ' DEBUG=${DEBUG_ATF}', '', d)}" OUTPUT_DIR = "${@bb.utils.contains('DEBUG_ATF', '1', '${B}/${PLATFORM}/debug', '${B}/${PLATFORM}/release', d)}" @@ -68,7 +69,10 @@ EXTRA_OEMAKE:append:zynqmp = "${@' ZYNQMP_ATF_MEM_SIZE=${ATF_MEM_SIZE}' if d.get EXTRA_OEMAKE:append:versal = "${@' VERSAL_ATF_MEM_BASE=${ATF_MEM_BASE}' if d.getVar('ATF_MEM_BASE', True) != '' else ''}" EXTRA_OEMAKE:append:versal = "${@' VERSAL_ATF_MEM_SIZE=${ATF_MEM_SIZE}' if d.getVar('ATF_MEM_SIZE', True) != '' else ''}" -ATF_PROVENCORE = "SPD=pncd ZYNQMP_BL32_MEM_BASE=0x70000000 ZYNQMP_BL32_MEM_SIZE=0x10000000 PRELOADED_BL33_BASE=0x80000000" +EXTRA_OEMAKE:append:versal-net = "${@' VERSAL_NET_ATF_MEM_BASE=${ATF_MEM_BASE}' if d.getVar('ATF_MEM_BASE', True) != '' else ''}" +EXTRA_OEMAKE:append:versal-net = "${@' VERSAL_NET_ATF_MEM_SIZE=${ATF_MEM_SIZE}' if d.getVar('ATF_MEM_SIZE', True) != '' else ''}" + +ATF_PROVENCORE = "SPD=pncd SPD_PNCD_NS_IRQ=51 ZYNQMP_BL32_MEM_BASE=0x70000000 ZYNQMP_BL32_MEM_SIZE=0x0FF00000" EXTRA_OEMAKE:append = "${@bb.utils.contains('MACHINE_FEATURES', 'provencore', ' ${ATF_PROVENCORE}', '', d)}" do_configure() { diff --git a/meta-xilinx-core/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2022.2.bb b/meta-xilinx-core/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2022.2.bb new file mode 100644 index 00000000..5ef2e6ac --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2022.2.bb @@ -0,0 +1,8 @@ +ATF_VERSION = "2.6" +SRCREV = "0897efd45ccad29a3dbab610578c70e3a52b2caa" +BRANCH = "xlnx_rebase_v2.6" +LIC_FILES_CHKSUM = "file://license.rst;md5=1dd070c98a281d18d9eefd938729b031" + + +include arm-trusted-firmware.inc + diff --git a/meta-xilinx-core/recipes-bsp/bootgen/bootgen_1.0.bb b/meta-xilinx-core/recipes-bsp/bootgen/bootgen_1.0.bb index 101d4ca2..fdf28f41 100644 --- a/meta-xilinx-core/recipes-bsp/bootgen/bootgen_1.0.bb +++ b/meta-xilinx-core/recipes-bsp/bootgen/bootgen_1.0.bb @@ -10,8 +10,8 @@ DEPENDS += "openssl" RDEPENDS:${PN} += "openssl" REPO ?= "git://github.com/Xilinx/bootgen.git;protocol=https" -BRANCH ?= "xlnx_rel_v2022.1" -SRCREV = "4eac958eb6c831ffa5768a0e2cd4be23c5efe2e0" +BRANCH ?= "xlnx_rel_v2022.2" +SRCREV = "cf4ba93b99644dc4429ef633471a639e1382f0e7" BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" SRC_URI = "${REPO};${BRANCHARG}" diff --git a/meta-xilinx-core/recipes-bsp/cdo/extract-cdo_1.0.bb b/meta-xilinx-core/recipes-bsp/cdo/extract-cdo_1.0.bb index 37c284ad..8b1e52ac 100644 --- a/meta-xilinx-core/recipes-bsp/cdo/extract-cdo_1.0.bb +++ b/meta-xilinx-core/recipes-bsp/cdo/extract-cdo_1.0.bb @@ -1,4 +1,4 @@ -DESCRIPTION = "Recipe to copy external cdos" +DESCRIPTION = "Recipe to extract pmc_cdo for qemu usage" LICENSE = "CLOSED" @@ -21,14 +21,19 @@ BOOTGEN_CMD ?= "bootgen" BOOTGEN_ARGS ?= "-arch versal" BOOTGEN_OUTFILE ?= "${DEPLOY_DIR_IMAGE}/boot.bin" -#The following line creates the pmc_cdo.bin file at the same dir as the boot.bin which is DEPLOY_DIR_IMAGE +# bootgen extracts the pmc_cdo file from the boot.bin. By default this +# happens in the same directory as the boot.bin. We need to move it to +# this directory, as do_compile should never write into a deploy dir do_compile() { - ${BOOTGEN_CMD} ${BOOTGEN_ARGS} -dump ${BOOTGEN_OUTFILE} pmc_cdo + ${BOOTGEN_CMD} ${BOOTGEN_ARGS} -dump_dir ${B} -dump ${BOOTGEN_OUTFILE} pmc_cdo } +do_install[noexec] = '1' + do_deploy() { install -d ${DEPLOYDIR}/CDO - install -m 0644 ${DEPLOY_DIR_IMAGE}/pmc_cdo.bin ${DEPLOYDIR}/CDO/pmc_cdo.bin + install -m 0644 ${B}/pmc_cdo.bin ${DEPLOYDIR}/CDO/pmc_cdo.bin + install -m 0644 ${B}/pmc_cdo.bin ${DEPLOYDIR}/pmc_cdo.bin } -addtask do_deploy after do_install +addtask do_deploy after do_compile diff --git a/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr/dfx-mgr.service b/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr/dfx-mgr.service deleted file mode 100644 index 12239266..00000000 --- a/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr/dfx-mgr.service +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-License-Identifier: MIT -# -# DFX manager daemon is used to demonstrate Dynamic Function eXchange (DFX) -# or partial reconfiguration feature on Xilinx Zynq UltraScale+ and newer. -# See: UG909 "Vivado Design Suite User Guide Dynamic Function eXchange" - -[Unit] -Description=dfx-mgrd Dynamic Function eXchange -Documentation=https://github.com/Xilinx/dfx-mgr - -[Service] -ExecStart=/usr/bin/dfx-mgrd - -[Install] -WantedBy=multi-user.target diff --git a/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr_1.0.bb b/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr_1.0.bb index 914349eb..2232b1da 100644 --- a/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr_1.0.bb +++ b/meta-xilinx-core/recipes-bsp/dfx-mgr/dfx-mgr_1.0.bb @@ -8,8 +8,8 @@ REPO ?= "git://github.com/Xilinx/dfx-mgr.git;protocol=https" BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" SRC_URI = "${REPO};${BRANCHARG}" -BRANCH = "xlnx_rel_v2022.1" -SRCREV = "b82419d93ec3cff6fe8095b5298a28bffb75b184" +BRANCH = "xlnx_rel_v2022.2" +SRCREV = "bc06691eb35d7f0acb7c2508b6d050d77b0264a0" SOMAJOR = "1" SOMINOR = "0" SOVERSION = "${SOMAJOR}.${SOMINOR}" @@ -23,13 +23,13 @@ S = "${WORKDIR}/git" inherit cmake update-rc.d systemd DEPENDS += " libwebsockets inotify-tools libdfx zocl libdrm" +RDEPENDS:${PN} += " fru-print" EXTRA_OECMAKE += " \ -DCMAKE_SYSROOT:PATH=${RECIPE_SYSROOT} \ " INITSCRIPT_NAME = "dfx-mgr.sh" INITSCRIPT_PARAMS = "start 99 S ." -SRC_URI:append = " file://dfx-mgr.service" SYSTEMD_PACKAGES="${PN}" SYSTEMD_SERVICE:${PN}="dfx-mgr.service" SYSTEMD_AUTO_ENABLE:${PN}="enable" @@ -47,7 +47,7 @@ do_install(){ chrpath -d ${D}${bindir}/dfx-mgrd chrpath -d ${D}${bindir}/dfx-mgr-client install -m 0644 ${S}/src/dfxmgr_client.h ${D}${includedir} - + oe_soinstall ${B}/src/libdfx-mgr.so.${SOVERSION} ${D}${libdir} install -m 0755 ${S}/src/daemon.conf ${D}${sysconfdir}/dfx-mgrd/ @@ -57,9 +57,11 @@ do_install(){ install -m 0755 ${S}/src/dfx-mgr.sh ${D}${sysconfdir}/init.d/ fi - install -m 0755 ${S}/src/dfx-mgr.sh ${D}${bindir}/ - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${WORKDIR}/dfx-mgr.service ${D}${systemd_system_unitdir} + install -m 0755 ${S}/src/dfx-mgr.sh ${D}${bindir} + install -m 0755 ${S}/src/scripts/xlnx-firmware-detect ${D}${bindir} + + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${S}/src/dfx-mgr.service ${D}${systemd_system_unitdir} } PACKAGES =+ "libdfx-mgr" diff --git a/meta-xilinx-core/recipes-bsp/fpga-manager-script/files/fpgautil.c b/meta-xilinx-core/recipes-bsp/fpga-manager-script/files/fpgautil.c new file mode 100644 index 00000000..04777a91 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/fpga-manager-script/files/fpgautil.c @@ -0,0 +1,471 @@ +/****************************************************************************** + * + * Copyright (C) 2019-2022 Xilinx, Inc. All rights reserved. + * Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished to do + * so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + ******************************************************************************/ +/*****************************************************************************/ +/** + * @file: fpgautil.c + * Simple command line tool to load fpga via overlay or through sysfs interface + * and read fpga configuration using Xilinx Zynq/ZynqMP fpga manager + * Author: Appana Durga Kedareswara Rao <appanad@xilinx.com> + * Author: Nava kishore Manne <navam@xilinx.com> + */ +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <string.h> +#include <signal.h> +#include <getopt.h> +#include <poll.h> +#include <ctype.h> +#include <libgen.h> +#include <time.h> +#include <errno.h> +#include <sys/time.h> +#include <sys/stat.h> + +#define OVERLAY 1 +#define FPGA_SYSFS 2 +#define READBACK 3 +#define ENCRYPTION_USERKEY_EN (0x20U) + +int fpga_getplatform() +{ + char fpstr[100]; + FILE *fptr; + char *zynqmpstr = "Xilinx ZynqMP FPGA Manager"; + + if ((fptr = fopen("/sys/class/fpga_manager/fpga0/name", "r")) == NULL) + { + printf("Error! opening file"); + // Program exits if file pointer returns NULL. + exit(1); + } + + // reads text until newline + fscanf(fptr,"%[^\n]", fpstr); + fclose(fptr); + + if (!strcmp(zynqmpstr, fpstr)) + return 1; + else + return 0; + +} + +void print_usage(char *prg) +{ + int iszynqmp = fpga_getplatform(); + + fprintf(stderr, "\n%s: FPGA Utility for Loading/reading PL Configuration\n\n", prg); + fprintf(stderr, "Usage: %s -b <bin file path> -o <dtbo file path>\n\r", prg); + fprintf(stderr, "\n"); + fprintf(stderr, "Options: -b <binfile> (Bin file path)\n"); + fprintf(stderr, " -o <dtbofile> (DTBO file path)\n"); + fprintf(stderr, " -f <flags> Optional: <Bitstream type flags>\n"); + fprintf(stderr, " f := <Full | Partial > \n"); + fprintf(stderr, " -n <Fpga region info> FPGA Regions represent FPGA's\n"); + fprintf(stderr, " and partial reconfiguration\n"); + fprintf(stderr, " regions of FPGA's in the\n"); + fprintf(stderr, " Device Tree\n"); + if (iszynqmp) + { + fprintf(stderr, " Default: <full>\n"); + fprintf(stderr, " -s <secure flags> Optional: <Secure flags>\n"); + fprintf(stderr, " s := <AuthDDR | AuthOCM | EnUsrKey | EnDevKey | AuthEnUsrKeyDDR | AuthEnUsrKeyOCM | AuthEnDevKeyDDR | AuthEnDevKeyOCM>\n"); + fprintf(stderr, " -k <AesKey> Optional: <AES User Key>\n"); + fprintf(stderr, " -r <Readback> Optional: <file name>\n"); + fprintf(stderr, " Default: By default Read back contents will be stored in readback.bin file\n"); + fprintf(stderr, " -t Optional: <Readback Type>\n"); + fprintf(stderr, " 0 - Configuration Register readback\n"); + fprintf(stderr, " 1 - Configuration Data Frames readback\n"); + fprintf(stderr, " Default: 0 (Configuration register readback)\n"); + fprintf(stderr, " -R Optional: Remove overlay from a live tree\n"); + } + + fprintf(stderr, " \n"); + fprintf(stderr, "Examples:\n"); + fprintf(stderr, "(Load Full bitstream using Overlay)\n"); + fprintf(stderr, "%s -b top.bit.bin -o can.dtbo -f Full -n full \n", prg); + fprintf(stderr, "(Load Partial bitstream using Overlay)\n"); + fprintf(stderr, "%s -b rm0.bit.bin -o rm0.dtbo -f Partial -n PR0\n", prg); + fprintf(stderr, "(Load Full bitstream using sysfs interface)\n"); + fprintf(stderr, "%s -b top.bit.bin -f Full\n", prg); + fprintf(stderr, "(Load Partial bitstream using sysfs interface)\n"); + fprintf(stderr, "%s -b rm0.bit.bin -f Partial\n", prg); + if (iszynqmp) + { + fprintf(stderr, "(Load Authenticated bitstream through the sysfs interface)\n"); + fprintf(stderr, "%s -b top.bit.bin -f Full -s AuthDDR \n", prg); + fprintf(stderr, "(Load Parital Encrypted Userkey bitstream using Overlay)\n"); + fprintf(stderr, "%s -b top.bit.bin -o pl.dtbo -f Partial -s EnUsrKey -k <32byte key value>\n", prg); + fprintf(stderr, "(Read PL Configuration Registers)\n"); + fprintf(stderr, "%s -b top.bit.bin -r\n", prg); + } + + fprintf(stderr, "(Remove Partial Overlay)\n"); + fprintf(stderr, "%s -R -n PR0\n", prg); + fprintf(stderr, "(Remove Full Overlay)\n"); + fprintf(stderr, "%s -R -n full\n", prg); + fprintf(stderr, "Note: %s -R is responsible for only removing the dtbo file from the livetree. it will not remove the PL logic from the FPGA region.\n", prg); + fprintf(stderr, " \n"); +} + +int gettime(struct timeval t0, struct timeval t1) +{ + return ((t1.tv_sec - t0.tv_sec) * 1000.0f + (t1.tv_usec -t0.tv_usec) / 1000.0f); +} + +int fpga_state() +{ + FILE *fptr; + char buf[10]; + char *state_operating = "operating"; + char *state_unknown = "unknown"; + + system("cat /sys/class/fpga_manager/fpga0/state >> state.txt"); + fptr = fopen("state.txt", "r"); + if (fptr) { + fgets(buf, 10, fptr); + fclose(fptr); + system("rm state.txt"); + if ((strncmp(buf, state_operating, 9) == 0) || (strncmp(buf, state_unknown, 7) == 0)) + return 0; + else + return 1; + } + + return 1; +} + +static int fpga_overlay_check(char *cmd, char *state) +{ + char buf[512]; + FILE *fptr; + int len; + + system(cmd); + len = strlen(state) + 1; + fptr = fopen("state.txt", "r"); + if (fptr) { + fgets(buf, len, fptr); + fclose(fptr); + system("rm state.txt"); + if (!strcmp(buf, state)) + return 0; + else + return 1; + } + + return 1; +} + +struct fpgaflag { + char *flag; + unsigned int value; +}; + +static struct fpgaflag flagdump[] = { + {.flag = "Full", .value = 0x0}, + {.flag = "Partial", .value = 0x1}, + {.flag = "AuthDDR", .value = 0x40}, + {.flag = "AuthOCM", .value = 0x80}, + {.flag = "EnUsrKey", .value = 0x20}, + {.flag = "EnDevKey", .value = 0x4}, + {.flag = "AuthEnUsrKeyDDR", .value = 0x60}, + {.flag = "AuthEnUsrKeyOCM", .value = 0xA0}, + {.flag = "AuthEnDevKeyDDR", .value = 0x44}, + {.flag = "AuthEnDevKeyOCM", .value = 0x84}, + {} +}; + +static int cmd_flags(int argc, const char *name) +{ + int valid_flag = 0; + int flag = 0; + struct fpgaflag *p = flagdump; + + while (p->flag) { + if (!strcmp(name, p->flag)) { + flag = p->value; + break; + } + p++; + } + + return flag; +} + +static int isvalid_flags(int argc, const char *name, bool is_secure) +{ + int valid_flag = 0; + int count = 0; + struct fpgaflag *p; + + if (!is_secure) + p = flagdump; + else + p = &flagdump[2]; + + while (p->flag) { + if (!strcmp(name, p->flag)) + return 0; + else if ((!is_secure) && (++count == 2)) + return 1; + p++; + } + + return 1; +} + +int main(int argc, char **argv) +{ + int ret; + int iszynqmp = fpga_getplatform(); + char *binfile = NULL, *overlay = NULL, *AesKey = NULL, *flag = NULL, *partial_overlay = NULL; + char *region = NULL, *Module[100] = {0}; + int opt, flags = 0, flow = 0,rm_overlay = 0, readback_type = 0, sflags = 0; + char command[2048], folder[512], *token, *tmp, *tmp1, *tmp2 , *tmp3; + const char *filename = "readback", *name; + struct stat sb; + double time; + struct timeval t1, t0; + + if (argc == 1) { + print_usage(basename(argv[0])); + return 1; + } + + while ((opt = getopt(argc, argv, "o:b:n:f:s:p:k:rt::Rh?:")) != -1) { + switch (opt) { + case 'o': + overlay = optarg; + flow = OVERLAY; + break; + case 'b': + binfile = optarg; + if (!(flow == OVERLAY)) + flow = FPGA_SYSFS; + break; + case 'n': + region = optarg; + break; + case 'f': + if (flow == OVERLAY) { + name = argv[6]; + flags = cmd_flags(argc, name); + } else if (flow == FPGA_SYSFS) { + name = argv[4]; + flags = cmd_flags(argc, name); + } + + ret = isvalid_flags(argc, name, false); + if (ret) { + printf("Error: Invalid arugments :%s\n", strerror(1)); + print_usage(basename(argv[0])); + return -EINVAL; + } + + flags += sflags; + break; + case 's': + if (flow == OVERLAY) { + name = argv[8]; + sflags = cmd_flags(argc, name); + } else if (flow == FPGA_SYSFS) { + name = argv[6]; + sflags = cmd_flags(argc, name); + } + + ret = isvalid_flags(argc, name, true); + if (ret) { + printf("Error: Invalid arugments :%s\n", strerror(1)); + print_usage(basename(argv[0])); + return -EINVAL; + } + + flags += sflags; + break; + case 'p': + partial_overlay = optarg; + break; + case 'k': + AesKey = optarg; + break; + case 't': + if (optarg == NULL && argv[4] != NULL) + readback_type = atoi(argv[4]); + break; + case 'r': + if (optarg == NULL && argv[2] != NULL) + filename = argv[2]; + flow = READBACK; + break; + case 'R': + rm_overlay = 1; + break; + case '?': + case 'h': + default: + print_usage(basename(argv[0])); + return 1; + break; + } + } + + if(region != NULL) + snprintf(folder, sizeof(folder), "/configfs/device-tree/overlays/%s", region); + else if (!(flags & 1)) + snprintf(folder, sizeof(folder), "/configfs/device-tree/overlays/full"); + else if (overlay != NULL) { + printf("Error: Provide valid Overlay region info\n\r"); + return 1; + } + system("mkdir -p /lib/firmware"); + if (rm_overlay) { + if (((stat(folder, &sb) == 0) && S_ISDIR(sb.st_mode))) { + snprintf(command, sizeof(command), "rmdir %s", folder); + system(command); + } + return 0; + } + + if (flow == OVERLAY) { + if (((stat(folder, &sb) == 0) && S_ISDIR(sb.st_mode))) { + printf("Error: Overlay already exists in the live tree\n\r"); + return 1; + } + + if (((stat("/configfs/device-tree/", &sb) == 0) && S_ISDIR(sb.st_mode))) { + } else { + system("mkdir /configfs"); + system("mount -t configfs configfs /configfs"); + } + + if (binfile != NULL) { + snprintf(command, sizeof(command), "cp %s /lib/firmware", binfile); + system(command); + } + + snprintf(command, sizeof(command), "cp %s /lib/firmware", overlay); + system(command); + tmp = strdup(overlay); + while((token = strsep(&tmp, "/"))) { + tmp1 = token; + } + + if (binfile != NULL) { + snprintf(command, sizeof(command), "echo %x > /sys/class/fpga_manager/fpga0/flags", flags); + system(command); + if (ENCRYPTION_USERKEY_EN & flags) { + snprintf(command, sizeof(command), "echo %s > /sys/class/fpga_manager/fpga0/key", AesKey); + system(command); + } + } + + snprintf(command, sizeof(command), "mkdir %s", folder); + system(command); + snprintf(command, sizeof(command), "echo -n %s > %s/path", tmp1, folder); + gettimeofday(&t0, NULL); + system(command); + gettimeofday(&t1, NULL); + time = gettime(t0, t1); + + snprintf(command, sizeof(command), "cat %s/path >> state.txt", folder); + ret = fpga_overlay_check(command, tmp1); + if (ret) { + printf("Failed to apply Overlay\n\r"); + } + + /* Delete Bin file and DTBO file*/ + snprintf(command, sizeof(command), "rm /lib/firmware/%s", tmp1); + system(command); + if (binfile != NULL) { + tmp = strdup(binfile); + while((token = strsep(&tmp, "/"))) { + tmp1 = token; + } + snprintf(command, sizeof(command), "rm /lib/firmware/%s", tmp1); + system(command); + } + + /* FPGA state check */ + if (binfile != NULL) { + if (!fpga_state()) { + printf("Time taken to load BIN is %f Milli Seconds\n\r", time); + printf("BIN FILE loaded through FPGA manager successfully\n\r"); + } else { + printf("BIN FILE loading through FPGA manager failed\n\r"); + } + } + } else if (flow == FPGA_SYSFS) { + if (argc < 3) { + printf("%s: For more information run %s -h\n", strerror(22), basename(argv[0])); + return 1; + } + snprintf(command, sizeof(command), "cp %s /lib/firmware", binfile); + system(command); + snprintf(command, sizeof(command), "echo %x > /sys/class/fpga_manager/fpga0/flags", flags); + system(command); + if (ENCRYPTION_USERKEY_EN & flags) { + snprintf(command, sizeof(command), "echo %s > /sys/class/fpga_manager/fpga0/key", AesKey); + system(command); + } + tmp = strdup(binfile); + while((token = strsep(&tmp, "/"))) { + tmp1 = token; + } + snprintf(command, sizeof(command), "echo %s > /sys/class/fpga_manager/fpga0/firmware", tmp1); + gettimeofday(&t0, NULL); + system(command); + gettimeofday(&t1, NULL); + time = gettime(t0, t1); + + /* Delete Bin file and DTBO file*/ + snprintf(command, sizeof(command), "rm /lib/firmware/%s", tmp1); + system(command); + + /* FPGA state check */ + if (!fpga_state()) { + printf("Time taken to load BIN is %f Milli Seconds\n\r", time); + printf("BIN FILE loaded through FPGA manager successfully\n\r"); + } else { + printf("BIN FILE loading through FPGA manager failed\n\r"); + } + } else if (flow == READBACK) { + if (readback_type > 1) { + printf("Invalid arugments :%s\n", strerror(1)); + printf("For more information run %s -h\n", basename(argv[0])); + return -EINVAL; + } + snprintf(command, sizeof(command), "echo %x > /sys/module/zynqmp_fpga/parameters/readback_type", readback_type); + system(command); + snprintf(command, sizeof(command), "cat /sys/kernel/debug/fpga/fpga0/image >> %s.bin", filename); + system(command); + printf("Readback contents are stored in the file %s.bin\n\r", filename); + } + + return 0; +} diff --git a/meta-xilinx-core/recipes-bsp/fpga-manager-script/fpga-manager-script_1.0.bb b/meta-xilinx-core/recipes-bsp/fpga-manager-script/fpga-manager-script_1.0.bb new file mode 100644 index 00000000..d22c995c --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/fpga-manager-script/fpga-manager-script_1.0.bb @@ -0,0 +1,23 @@ +SUMMARY = "Install user script to support fpga-manager" +DESCRIPTION = "Install user script that loads and unloads overlays using kernel fpga-manager" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://${WORKDIR}/fpgautil.c;beginline=1;endline=24;md5=0c02eabf57dba52842c5df9b96bccfae" + +SRC_URI = "\ + file://fpgautil.c \ + " +S = "${WORKDIR}" + +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +do_compile() { + ${CC} ${LDFLAGS} fpgautil.c -o fpgautil +} + +do_install() { + install -Dm 0755 ${S}/fpgautil ${D}${bindir}/fpgautil +} + +FILES:${PN} = "\ + ${bindir}/fpgautil \ + " diff --git a/meta-xilinx-core/recipes-bsp/libdfx/libdfx_1.0.bb b/meta-xilinx-core/recipes-bsp/libdfx/libdfx_1.0.bb index 93f3b621..4ec38467 100644 --- a/meta-xilinx-core/recipes-bsp/libdfx/libdfx_1.0.bb +++ b/meta-xilinx-core/recipes-bsp/libdfx/libdfx_1.0.bb @@ -4,11 +4,11 @@ DESCRIPTION = "Xilinx libdfx Library and headers" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://LICENSE.md;md5=94aba86aec117f003b958a52f019f1a7" -BRANCH ?= "xlnx_rel_v2022.1" +BRANCH ?= "xlnx_rel_v2022.2" REPO ?= "git://github.com/Xilinx/libdfx.git;protocol=https" BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" SRC_URI = "${REPO};${BRANCHARG}" -SRCREV = "6d423bbafd9ac14194a6a80f4d276c9024d2defa" +SRCREV = "f2b7bbca9d6936141024becfb92266600eeefc2b" COMPATIBLE_MACHINE = "^$" COMPATIBLE_MACHINE:zynqmp = "zynqmp" @@ -18,17 +18,6 @@ S = "${WORKDIR}/git" inherit cmake -do_install () { - install -d ${D}${libdir} - install -d ${D}${includedir} - install -d ${D}${bindir} - oe_libinstall -so -C ${B}/src/ libdfx ${D}${libdir} - install -m 0644 ${B}/src/libdfx.a ${D}${libdir} - install -m 0644 ${B}/include/libdfx.h ${D}${includedir} - install -m 0755 ${B}/apps/dfx_app ${D}${bindir} -} - -SOLIBSDEV = ".so" -FILES:${PN} += "${libdir}/libdfx.so ${bindir}/*" -FILES:${PN}-staticdev = "${libdir}/libdfx.a" -FILES:${PN}-dev = "${includedir}" +# Due to an update where the soname/version was defined, we need to use an RREPLACES +# so updates will work properly. +RREPLACES:${PN} = "libdfx" diff --git a/meta-xilinx-core/recipes-bsp/pmu-firmware/pmu-rom-native_2022.2.bb b/meta-xilinx-core/recipes-bsp/pmu-firmware/pmu-rom-native_2022.2.bb new file mode 100644 index 00000000..44ad9368 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/pmu-firmware/pmu-rom-native_2022.2.bb @@ -0,0 +1,27 @@ +SUMMARY = "PMU ROM for QEMU" +DESCRIPTION = "The ZynqMP PMU ROM for QEMU emulation" +HOMEPAGE = "http://www.xilinx.com" +SECTION = "bsp" + +LICENSE = "Proprietary" +LICENSE_FLAGS = "xilinx" +LIC_FILES_CHKSUM = "file://PMU_ROM-LICENSE.txt;md5=d43d49bc1eb1c907fc6f4ea75abafdfc" + +SRC_URI = "https://www.xilinx.com/bin/public/openDownload?filename=PMU_ROM.tar.gz" +SRC_URI[sha256sum] = "f9a450ef960979463ea0a87a35fafb4a5b62d3a741de30cbcef04c8edc22a7cf" + +S = "${WORKDIR}/PMU_ROM" + +inherit deploy native + +INHIBIT_DEFAULT_DEPS = "1" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_install[noexec] = "1" + +do_deploy () { + install -D ${S}/pmu-rom.elf ${DEPLOYDIR}/pmu-rom.elf +} + +addtask deploy before do_build after do_install diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-blob.inc b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-blob.inc new file mode 100644 index 00000000..5f09a99f --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-blob.inc @@ -0,0 +1,157 @@ +# U-boot fitimage/blob generator + +UBOOT_IMAGE_BLOB_DEFAULT = "" +UBOOT_IMAGE_BLOB ?= "${UBOOT_IMAGE_BLOB_DEFAULT}" +DT_BLOB_DIR ?= "${B}/arch/arm/dts/dt-blob" +UBOOT_BLOB_NAME ?= "${MACHINE}-fit-dtb${IMAGE_VERSION_SUFFIX}.blob" + +IMPORT_CC_DTBS ?= "" +CC_DTBS_DUP ?= "" + +MKIMAGE_DTBLOB_OPTS ?= "-E -B 0x8" + +# Everything is swtiched on with UBOOT_IMAGE_BLOB = '1' +inherit ${@'image-artifact-names' if d.getVar('UBOOT_IMAGE_BLOB') == "1" else ''} + +python() { + if d.getVar('UBOOT_IMAGE_BLOB') == "1": + d.appendVarFlag('do_compile', 'postfuncs', ' do_blob_generate') + d.appendVarFlag('do_compile', 'cleandirs', ' ${DT_BLOB_DIR}') + d.appendVar('PROVIDES', ' u-boot-xlnx-fit-blob') + d.appendVar('DEPENDS', ' u-boot-mkimage-native') +} + +dtblob_emit_its_section() { + case $2 in + header) + cat << EOF > $1 +/dts-v1/; + +/ { + description = "DT Blob Creation"; +EOF + ;; + imagestart) + cat << EOF >> $1 + + images { +EOF + ;; + confstart) + cat << EOF >> $1 + + configurations { +EOF + ;; + sectend) + cat << EOF >> $1 + }; +EOF + ;; + fitend) + cat << EOF >> $1 +}; +EOF + ;; + esac +} + +dtblob_emit_dtb () { + dtb_csum="md5" + cat << EOF >> $1 + fdt-$2 { + description = "$(basename $3 .dtb)"; + data = /incbin/("$3"); + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + hash-1 { + algo = "$dtb_csum"; + }; + }; +EOF +} + +#1.file name +#2.config node +#3.config node description +#4.DTB count +dtblob_emit_config () { + default_dtb=1 + if [ $4 -eq $default_dtb ]; then + cat << EOF >> $1 + default = "config_$4"; +EOF + fi + cat << EOF >> $1 + config_$4 { + description = "$3"; + fdt = "fdt-$2"; + }; +EOF +} + +do_blob_generate () { + oe_runmake -C ${S} O=${B} dtbs + install -d ${DT_BLOB_DIR} + for CC_DTB in ${IMPORT_CC_DTBS}; do + DTBO=$(echo $CC_DTB | cut -d: -f1) + DTB=$(echo $CC_DTB | cut -d: -f2) + bbnote "fdtoverlay -o ${DT_BLOB_DIR}/${DTB} -i ${RECIPE_SYSROOT}/${DTB_PATH}/${DTB_NAME} ${B}/arch/arm/dts/${DTBO}" + if [ -f ${B}/arch/arm/dts/${DTBO} ]; then + fdtoverlay -o ${DT_BLOB_DIR}/${DTB} \ + -i ${RECIPE_SYSROOT}/${DTB_PATH}/${DTB_NAME} ${B}/arch/arm/dts/${DTBO} + fi + done + + cd ${DT_BLOB_DIR} + its_filename="dtblob.its" + dtblob_emit_its_section "${its_filename}" "header" + dtblob_emit_its_section "${its_filename}" "imagestart" + for dtb in ${RECIPE_SYSROOT}/${DTB_PATH}/${DTB_NAME} $(find ${DT_BLOB_DIR} -name '*.dtb' | sort); do + dtblob_emit_dtb "${its_filename}" "$(basename $dtb .dtb)" "$dtb" + done + dtblob_emit_its_section "${its_filename}" "sectend" + dtblob_emit_its_section "${its_filename}" "confstart" + dtbcount=1 + for dtb in ${RECIPE_SYSROOT}/${DTB_PATH}/${DTB_NAME} $(find ${DT_BLOB_DIR} -name '*.dtb' | sort); do + dtblob_emit_config "${its_filename}" "$(basename $dtb .dtb)" "$(basename $dtb .dtb)" "$dtbcount" + dtbcount=`expr $dtbcount + 1` + done + + for CC_DTB_DUP in ${CC_DTBS_DUP}; do + DTB=$(echo $CC_DTB_DUP | cut -d: -f1) + DUP_DTB=$(echo $CC_DTB_DUP | cut -d: -f2) + if [ -f ${DT_BLOB_DIR}/${DTB}.dtb ]; then + bbnote "Node ${DT_BLOB_DIR}/${DTB} with ${DT_BLOB_DIR}/${DUP_DTB}" + dtblob_emit_config "${its_filename}" "$DTB" "$DUP_DTB" "$dtbcount" + dtbcount=`expr $dtbcount + 1` + fi + done + + dtblob_emit_its_section "${its_filename}" "sectend" + dtblob_emit_its_section "${its_filename}" "fitend" + + mkimage ${MKIMAGE_DTBLOB_OPTS} -f "${its_filename}" "${UBOOT_BLOB_NAME}" +} + +do_install:append() { + ( + cd ${B} + + if [ -e "${DT_BLOB_DIR}/${UBOOT_BLOB_NAME}" ]; then + install -d ${D}/boot + install -m 0644 ${DT_BLOB_DIR}/${UBOOT_BLOB_NAME} ${D}/boot + ln -sf `basename ${UBOOT_BLOB_NAME}` ${D}/boot/fit-dtb.blob + fi + ) +} + +do_deploy:prepend() { + cd ${B} + + if [ -e "${DT_BLOB_DIR}/${UBOOT_BLOB_NAME}" ]; then + install -m 0644 ${DT_BLOB_DIR}/${UBOOT_BLOB_NAME} ${DEPLOYDIR}/ + ln -sf `basename ${UBOOT_BLOB_NAME}` ${DEPLOYDIR}/fit-dtb.blob + fi +} diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-dev.bb b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-dev.bb index 3e40bfa1..0c7685a5 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-dev.bb +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx-dev.bb @@ -17,12 +17,3 @@ SRCREV ?= "${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/bootloader", "u-b PV = "${UBRANCH}-xilinx-dev+git${SRCPV}" -# Newer versions of u-boot have support for these -HAS_PLATFORM_INIT ?= " \ - zynq_microzed_config \ - zynq_zed_config \ - zynq_zc702_config \ - zynq_zc706_config \ - zynq_zybo_config \ - " - diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx.inc b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx.inc index d9113cc7..8971d58f 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx.inc +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx.inc @@ -2,8 +2,8 @@ require recipes-bsp/u-boot/u-boot.inc DEPENDS += "bc-native dtc-native bison-native xxd-native" -XILINX_RELEASE_VERSION ?= "" -UBOOT_VERSION_EXTENSION ?= "-xilinx-${XILINX_RELEASE_VERSION}" +# Use the name of the .bb for the extension +UBOOT_VERSION_EXTENSION ?= "-xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}" PV = "${UBOOT_VERSION}${UBOOT_VERSION_EXTENSION}+git${SRCPV}" UBOOTURI ?= "git://github.com/Xilinx/u-boot-xlnx.git;protocol=https" @@ -18,3 +18,64 @@ B = "${WORKDIR}/build" FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot:" SYSROOT_DIRS += "/boot" + +BASE_DTS ?= "${@os.path.basename(d.getVar('CONFIG_DTFILE') or '').rstrip('.dtb') or 'system-top'}" +DTB_PATH ?= "boot/devicetree/" +DTB_NAME ?= "" + +# This vairable is used for U-boot user specified dts from u-boot repo path +# u-boot-xlnx/arch/arm/dts/versal-vck190-revA-x-ebm-01-revA.dts. +# Note: .dts extension is not required for this variable settings. +# Example: UBOOT_USER_SPECIFIED_DTS = "versal-vck190-revA-x-ebm-01-revA" +UBOOT_USER_SPECIFIED_DTS ?= "" + +EXTRA_OEMAKE += "${@'EXT_DTB=${RECIPE_SYSROOT}/${DTB_PATH}/${DTB_NAME}' if (d.getVar('DTB_NAME') != '' and d.getVar('UBOOT_USER_SPECIFIED_DTS') == '') else '' }" +EXTRA_OEMAKE += "${@'DEVICE_TREE=${UBOOT_USER_SPECIFIED_DTS}' if (d.getVar('UBOOT_USER_SPECIFIED_DTS') != '') else '' }" + +python __anonymous () { + #check if there are any dtb providers + providerdtb = d.getVar("PREFERRED_PROVIDER_virtual/dtb") + if providerdtb: + d.appendVarFlag('do_configure', 'depends', ' virtual/dtb:do_populate_sysroot') + if d.getVar("DTB_NAME") is not None: + d.setVar('DTB_NAME', d.getVar('BASE_DTS')+ '.dtb') +} + +do_configure:prepend () { + if [ -n "${UBOOT_USER_SPECIFIED_DTS}" && ! -f ${S}/arch/arm/dts/${UBOOT_USER_SPECIFIED_DTS}.dts ]; then + bbfatal "Uboot user specified dts (${UBOOT_USER_SPECIFIED_DTS}.dts) is not found in \ +the${S}/arch/arm/dts directory, you need to patch dts file to u-boot source and use this configuration. \ +For more details refer https://u-boot.readthedocs.io/en/latest/develop/devicetree/control.html#configuration " + fi +} + +require u-boot-xlnx-blob.inc + +UBOOTELF_NODTB_IMAGE ?= "u-boot-nodtb.elf" +UBOOTELF_NODTB_BINARY ?= "u-boot" +do_deploy:prepend() { + cd ${B} + + if [ -f "${UBOOTELF_NODTB_BINARY}" ]; then + install ${UBOOTELF_NODTB_BINARY} ${DEPLOYDIR}/${UBOOTELF_NODTB_IMAGE} + fi + + #following lines are from uboot-sign.bbclass, vars are defined there + if [ -e "${UBOOT_DTB_BINARY}" ]; then + install ${UBOOT_DTB_BINARY} ${DEPLOYDIR}/${UBOOT_DTB_IMAGE} + ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_BINARY} + ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_SYMLINK} + fi + if [ -f "${UBOOT_NODTB_BINARY}" ]; then + install ${UBOOT_NODTB_BINARY} ${DEPLOYDIR}/${UBOOT_NODTB_IMAGE} + ln -sf ${UBOOT_NODTB_IMAGE} ${DEPLOYDIR}/${UBOOT_NODTB_SYMLINK} + ln -sf ${UBOOT_NODTB_IMAGE} ${DEPLOYDIR}/${UBOOT_NODTB_BINARY} + fi + + # In ZynqMP u-boot.dtb is generated by default but not for versal, Hence manually deploy. + if [ "${SOC_FAMILY}" == "versal" ]; then + if [ -f ${B}/arch/arm/dts/${UBOOT_USER_SPECIFIED_DTS}.dtb ]; then + install -Dm 0644 ${B}/arch/arm/dts/${UBOOT_USER_SPECIFIED_DTS}.dtb ${DEPLOYDIR}/u-boot.dtb + fi + fi +} diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx_2022.1.bb b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx_2022.1.bb index e309783f..f90edfc0 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx_2022.1.bb +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx_2022.1.bb @@ -1,8 +1,8 @@ UBOOT_VERSION = "v2021.01" -UBRANCH ?= "xlnx_rebase_v2022.01" +UBRANCH ?= "xlnx_rebase_v2022.01_2022.1_update" -SRCREV = "c50d6c48f4e1368cd38699278e35563cb4b0e444" +SRCREV = "91ad7924e7f59584d597353e1bb86794341e0a7e" include u-boot-xlnx.inc include u-boot-spl-zynq-init.inc diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx_2022.2.bb b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx_2022.2.bb new file mode 100644 index 00000000..7b09917f --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx_2022.2.bb @@ -0,0 +1,19 @@ +UBOOT_VERSION = "v2021.01" + +UBRANCH ?= "xlnx_rebase_v2022.01" + +SRCREV = "b31476685debf5512ed0d4e8000fa5167a22f530" + +include u-boot-xlnx.inc +include u-boot-spl-zynq-init.inc + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://README;beginline=1;endline=4;md5=744e7e3bb0c94b4b9f6b3db3bf893897" + +# u-boot-xlnx has support for these +HAS_PLATFORM_INIT ?= " \ + xilinx_zynqmp_virt_config \ + xilinx_zynq_virt_defconfig \ + xilinx_versal_vc_p_a2197_revA_x_prc_01_revA \ + " + diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr.bb b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr.bb index 766b2b81..8a3a5db6 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr.bb +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr.bb @@ -16,19 +16,19 @@ COMPATIBLE_MACHINE:microblaze = "microblaze" KERNELDT = "${@os.path.basename(d.getVar('KERNEL_DEVICETREE').split(' ')[0]) if d.getVar('KERNEL_DEVICETREE') else ''}" DEVICE_TREE_NAME ?= "${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', d.getVar('KERNELDT'), d)}" -#Need to copy a rootfs.cpio.gz.u-boot as uramdisk.image.gz into boot partition -RAMDISK_IMAGE ?= "" -RAMDISK_IMAGE:zynq ?= "uramdisk.image.gz" +#Need to copy a rootfs.cpio.gz.u-boot into boot partition +RAMDISK_IMAGE ?= "rootfs.cpio.gz.u-boot" +RAMDISK_IMAGE1 ?= "ramdisk.cpio.gz.u-boot" -PXERAMDISK_IMAGE ?= "${@'ramdisk.cpio.gz.u-boot' if d.getVar('INITRAMFS_IMAGE') and d.getVar('INITRAMFS_IMAGE').find('initramfs') > 0 else '${RAMDISK_IMAGE}'}" +PXERAMDISK_IMAGE ?= "${@'${RAMDISK_IMAGE1}' if d.getVar('INITRAMFS_IMAGE') and d.getVar('INITRAMFS_IMAGE').find('initramfs') > 0 else '${RAMDISK_IMAGE}'}" KERNEL_BOOTCMD:zynqmp ?= "booti" KERNEL_BOOTCMD:zynq ?= "bootm" KERNEL_BOOTCMD:versal ?= "booti" KERNEL_BOOTCMD:microblaze ?= "bootm" -BOOTMODE ?= "sd" -BOOTFILE_EXT ?= ".${SOC_FAMILY}" +BOOTMODE ??= "generic" +BOOTFILE_EXT ?= "" #Make this value to "1" to skip appending base address to ddr offsets. SKIP_APPEND_BASEADDR ?= "0" @@ -43,6 +43,7 @@ SRC_URI = " \ file://boot.cmd.sd.versal \ file://boot.cmd.qspi.versal \ file://boot.cmd.generic \ + file://boot.cmd.generic.root \ file://boot.cmd.ubifs \ file://pxeboot.pxe \ " @@ -67,14 +68,14 @@ DEVICETREE_ADDRESS ?= "${@append_baseaddr(d,d.getVar('DEVICETREE_OFFSET'))}" DEVICETREE_OFFSET:microblaze ?= "0x1e00000" DEVICETREE_OFFSET:zynqmp ?= "0x100000" -DEVICETREE_OFFSET:zynq ?= "0x2000000" +DEVICETREE_OFFSET:zynq ?= "0x100000" DEVICETREE_OFFSET:versal ?= "0x1000" KERNEL_LOAD_ADDRESS ?= "${@append_baseaddr(d,d.getVar('KERNEL_OFFSET'))}" KERNEL_OFFSET:microblaze ?= "0x0" KERNEL_OFFSET:zynqmp ?= "0x200000" -KERNEL_OFFSET:zynq ?= "0x2080000" +KERNEL_OFFSET:zynq ?= "0x200000" KERNEL_OFFSET:versal ?= "0x200000" KERNEL_IMAGE ?= "${KERNEL_IMAGETYPE}" @@ -84,7 +85,7 @@ RAMDISK_IMAGE_ADDRESS ?= "${@append_baseaddr(d,d.getVar('RAMDISK_OFFSET'))}" RAMDISK_OFFSET:microblaze ?= "0x2e00000" RAMDISK_OFFSET:zynq ?= "0x4000000" RAMDISK_OFFSET:zynqmp ?= "0x4000000" -RAMDISK_OFFSET:versal ?= "0x6000000" +RAMDISK_OFFSET:versal ?= "0x4000000" FIT_IMAGE_LOAD_ADDRESS ?= "${@append_baseaddr(d,d.getVar('FIT_IMAGE_OFFSET'))}" FIT_IMAGE_OFFSET ?= "0x10000000" @@ -96,17 +97,18 @@ FIT_IMAGE ?= "image.ub" QSPI_KERNEL_OFFSET:microblaze ?= "0xBC0000" QSPI_KERNEL_SIZE:microblaze ?= "0x500000" QSPI_RAMDISK_SIZE:microblaze ?= "0xA00000" +QSPI_RAMDISK_SIZE:microblaze ?= "0x4000000" ## For zynq ## Load boot.scr at 0xFC0000 -> 15MB of QSPI/NAND Memory -QSPI_KERNEL_OFFSET:zynq ?= "0x1000000" -QSPI_RAMDISK_OFFSET:zynq ?= "0x1580000" +QSPI_KERNEL_OFFSET:zynq ?= "0xA00000" +QSPI_RAMDISK_OFFSET:zynq ?= "0x1000000" NAND_KERNEL_OFFSET:zynq ?= "0x1000000" NAND_RAMDISK_OFFSET:zynq ?= "0x4600000" -QSPI_KERNEL_SIZE:zynq ?= "0x500000" -QSPI_RAMDISK_SIZE:zynq ?= "0xA00000" +QSPI_KERNEL_SIZE:zynq ?= "0x600000" +QSPI_RAMDISK_SIZE:zynq ?= "0xF80000" NAND_KERNEL_SIZE ?= "0x3200000" NAND_RAMDISK_SIZE ?= "0x3200000" @@ -144,16 +146,29 @@ QSPI_KERNEL_IMAGE:versal ?= "image.ub" NAND_KERNEL_IMAGE ?= "image.ub" -QSPI_FIT_IMAGE_OFFSET ?= "0x1080000" +QSPI_FIT_IMAGE_OFFSET ?= "0xF40000" +QSPI_FIT_IMAGE_OFFSET:zynqmpdr ?= "0x3F80000" +QSPI_FIT_IMAGE_OFFSET:zynq ?= "0xA80000" +QSPI_FIT_IMAGE_OFFSET:microblaze ?= "0xC00000" + QSPI_FIT_IMAGE_SIZE ?= "0x6400000" QSPI_FIT_IMAGE_SIZE:zynqmpdr ?= "0x3F00000" -QSPI_FIT_IMAGE_SIZE:zynq ?= "0xF00000" +QSPI_FIT_IMAGE_SIZE:zynq ?= "0x1500000" QSPI_FIT_IMAGE_SIZE:microblaze ?= "0xF00000" -NAND_FIT_IMAGE_OFFSET ?= "0x1080000" +NAND_FIT_IMAGE_OFFSET ?= "0x4180000" +NAND_FIT_IMAGE_OFFSET:zynq ?= "0x1080000" NAND_FIT_IMAGE_SIZE ?= "0x6400000" -SDBOOTDEV ?= "0" +# Default to booting with the rootfs device being partition 2 for SD/eMMC +PARTNUM ?= "2" + +# Set Kernel root filesystem parameter for SD/eMMC boot +# Bootdev will automatically be set to 'sda' or 'mmcblkXp' +KERNEL_ROOT_SD ?= "root=/dev/\${bootdev}${PARTNUM} ro rootwait" + +# Set Kernel root filesystem parameter for JTAG/QSPI/OSPI/NAND(using RAMDISK) boot +KERNEL_ROOT_RAMDISK ?= "root=/dev/ram0 rw" BITSTREAM_LOAD_ADDRESS ?= "0x100000" @@ -211,6 +226,9 @@ do_compile() { -e 's/@@UENV_MMC_LOAD_ADDRESS@@/${UENV_MMC_LOAD_ADDRESS}/' \ -e 's/@@UENV_TEXTFILE@@/${UENV_TEXTFILE}/' \ -e 's/@@RAMDISK_IMAGE1@@/${RAMDISK_IMAGE1}/' \ + -e 's/@@PARTNUM@@/${PARTNUM}/' \ + -e 's:@@KERNEL_ROOT_SD@@:${KERNEL_ROOT_SD}:' \ + -e 's:@@KERNEL_ROOT_RAMDISK@@:${KERNEL_ROOT_RAMDISK}:' \ "${WORKDIR}/boot.cmd.${BOOTMODE}${BOOTFILE_EXT}" > "${WORKDIR}/boot.cmd" mkimage -A arm -T script -C none -n "Boot script" -d "${WORKDIR}/boot.cmd" boot.scr sed -e 's/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/' \ diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic.root b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic.root new file mode 100644 index 00000000..ca90cbe1 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic.root @@ -0,0 +1,98 @@ +# This is a boot script for U-Boot with generic root parameters used by yocto machine configuration file. +# Generate boot.scr: +# mkimage -c none -A arm -T script -d boot.cmd.default boot.scr +# +################ +fitimage_name=@@FIT_IMAGE@@ +kernel_name=@@KERNEL_IMAGE@@ +ramdisk_name=@@RAMDISK_IMAGE1@@ +rootfs_name=@@RAMDISK_IMAGE@@ +@@PRE_BOOTENV@@ + +for boot_target in ${boot_targets}; +do + echo "Trying to load boot images from ${boot_target}" + if test "${boot_target}" = "jtag" ; then + fdt addr @@DEVICETREE_ADDRESS@@ + fdt get value bootargs /chosen bootargs + setenv bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@ + @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ + fi + if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1" || test "${boot_target}" = "usb0" || test "${boot_target}" = "usb1"; then + if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1"; then + setenv bootdev mmcblk${devnum}p + fi + if test "${boot_target}" = "usb0" || test "${boot_target}" = "usb1"; then + setenv bootdev sda + fi + + if test -e ${devtype} ${devnum}:${distro_bootpart} /@@UENV_TEXTFILE@@; then + fatload ${devtype} ${devnum}:${distro_bootpart} @@UENV_MMC_LOAD_ADDRESS@@ @@UENV_TEXTFILE@@; + echo "Importing environment(@@UENV_TEXTFILE@@) from ${boot_target}..." + env import -t @@UENV_MMC_LOAD_ADDRESS@@ $filesize + if test -n $uenvcmd; then + echo "Running uenvcmd ..."; + run uenvcmd; + fi + fi + if test -e ${devtype} ${devnum}:${distro_bootpart} /${fitimage_name}; then + fatload ${devtype} ${devnum}:${distro_bootpart} @@FIT_IMAGE_LOAD_ADDRESS@@ ${fitimage_name}; + echo "Kernel root filesystem parameter needs to be set for FITIMAGE boot if not defined in DTB" + bootm @@FIT_IMAGE_LOAD_ADDRESS@@; + fi + if test -e ${devtype} ${devnum}:${distro_bootpart} /${kernel_name}; then + fatload ${devtype} ${devnum}:${distro_bootpart} @@KERNEL_LOAD_ADDRESS@@ ${kernel_name}; + fi + if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then + fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb; + fi + if test -e ${devtype} ${devnum}:${distro_bootpart} /${ramdisk_name} && test "${skip_tinyramdisk}" != "yes"; then + fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${ramdisk_name}; + fdt addr @@DEVICETREE_ADDRESS@@ + fdt get value bootargs /chosen bootargs + setenv bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@ + @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ + fi + if test -e ${devtype} ${devnum}:${distro_bootpart} /${rootfs_name} && test "${skip_ramdisk}" != "yes"; then + fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${rootfs_name}; + fdt addr @@DEVICETREE_ADDRESS@@ + fdt get value bootargs /chosen bootargs + setenv bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@ + @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ + fi + fdt addr @@DEVICETREE_ADDRESS@@ + fdt get value bootargs /chosen bootargs + setenv bootargs $bootargs @@KERNEL_ROOT_SD@@ + @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ - @@DEVICETREE_ADDRESS@@ + fi + if test "${boot_target}" = "xspi0" || test "${boot_target}" = "qspi" || test "${boot_target}" = "qspi0"; then + sf probe 0 0 0; + sf read @@FIT_IMAGE_LOAD_ADDRESS@@ @@QSPI_FIT_IMAGE_OFFSET@@ @@QSPI_FIT_IMAGE_SIZE@@ + echo "Kernel root filesystem parameter needs to be set for FITIMAGE boot if not defined in DTB" + bootm @@FIT_IMAGE_LOAD_ADDRESS@@; + echo "Booting using Fit image failed" + + sf read @@KERNEL_LOAD_ADDRESS@@ @@QSPI_KERNEL_OFFSET@@ @@QSPI_KERNEL_SIZE@@ + sf read @@RAMDISK_IMAGE_ADDRESS@@ @@QSPI_RAMDISK_OFFSET@@ @@QSPI_RAMDISK_SIZE@@ + fdt addr @@DEVICETREE_ADDRESS@@ + fdt get value bootargs /chosen bootargs + setenv bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@ + @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@; + echo "Booting using Separate images failed" + fi + if test "${boot_target}" = "nand" || test "${boot_target}" = "nand0"; then + nand info; + nand read @@FIT_IMAGE_LOAD_ADDRESS@@ @@NAND_FIT_IMAGE_OFFSET@@ @@NAND_FIT_IMAGE_SIZE@@ + echo "Kernel root filesystem parameter needs to be set for FITIMAGE boot if not defined in DTB" + bootm @@FIT_IMAGE_LOAD_ADDRESS@@; + echo "Booting using Fit image failed" + + nand read @@KERNEL_LOAD_ADDRESS@@ @@NAND_KERNEL_OFFSET@@ @@NAND_KERNEL_SIZE@@ + nand read @@RAMDISK_IMAGE_ADDRESS@@ @@NAND_RAMDISK_OFFSET@@ @@NAND_RAMDISK_SIZE@@ + fdt addr @@DEVICETREE_ADDRESS@@ + fdt get value bootargs /chosen bootargs + setenv bootargs $bootargs @@KERNEL_ROOT_RAMDISK@@ + @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@; + echo "Booting using Separate images failed" + fi +done diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.versal b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.versal index 10e83cd0..8eff483a 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.versal +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.sd.versal @@ -1,3 +1,5 @@ -setenv bootargs $bootargs root=/dev/mmcblk0p2 rw rootwait clk_ignore_unused +setenv sdbootdev @@SDBOOTDEV@@ +setenv bootargs $bootargs root=/dev/mmcblk${sdbootdev}p2 rw rootwait earlycon clk_ignore_unused +fatload mmc $sdbootdev @@DEVICETREE_ADDRESS@@ @@DEVICE_TREE_NAME@@ fatload mmc $sdbootdev:$partid @@KERNEL_LOAD_ADDRESS@@ @@KERNEL_IMAGETYPE@@ @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ - @@DEVICETREE_ADDRESS@@ diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-uenv.bb b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-uenv.bb index 4e02cb40..82936894 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-uenv.bb +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-uenv.bb @@ -4,8 +4,6 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda INHIBIT_DEFAULT_DEPS = "1" -DEPENDS:append := "virtual/kernel ${@oe.utils.str_filter_out(d.getVar("BPN"), d.getVar("EXTRA_IMAGEDEPENDS"), d)}" - COMPATIBLE_MACHINE = "^$" COMPATIBLE_MACHINE:zynq = ".*" COMPATIBLE_MACHINE:zynqmp = ".*" @@ -14,6 +12,18 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" inherit deploy image-wic-utils +def remove_task_from_depends(d): + extra_imagedepends = d.getVar('EXTRA_IMAGEDEPENDS') or '' + uenv_depends = '' + for imagedepend in extra_imagedepends.split(): + if imagedepend == d.getVar("BPN"): + continue + elif ':' in imagedepend: + uenv_depends += ' %s' % imagedepend.split(':')[0] + else: + uenv_depends += ' %s' % imagedepend + return uenv_depends + def uboot_boot_cmd(d): if d.getVar("KERNEL_IMAGETYPE") in ["uImage", "fitImage"]: return "bootm" @@ -25,7 +35,7 @@ def uboot_boot_cmd(d): def get_sdbootdev(d): if d.getVar("SOC_FAMILY") in ["zynqmp"]: - return "${sdbootdev}" + return "${devnum}" else: return "0" @@ -67,9 +77,11 @@ def uenv_populate(d): return env +DEPENDS:append := "virtual/kernel ${@remove_task_from_depends(d)}" + # bootargs, default to booting with the rootfs device being partition 2 KERNEL_BOOTARGS:zynq = "earlyprintk console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait" -KERNEL_BOOTARGS:zynqmp = "earlycon clk_ignore_unused root=/dev/mmcblk${sdbootdev}p2 rw rootwait" +KERNEL_BOOTARGS:zynqmp = "earlycon clk_ignore_unused root=/dev/mmcblk${devnum}p2 rw rootwait" KERNEL_LOAD_ADDRESS:zynq = "0x2080000" KERNEL_LOAD_ADDRESS:zynqmp = "0x200000" diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot_%.bbappend b/meta-xilinx-core/recipes-bsp/u-boot/u-boot_%.bbappend index b8522369..56083ce3 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot_%.bbappend +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot_%.bbappend @@ -1,11 +1,2 @@ include u-boot-spl-zynq-init.inc -# u-boot 2016.11 has support for these -HAS_PLATFORM_INIT ??= " \ - zynq_microzed_config \ - zynq_zed_config \ - zynq_zc702_config \ - zynq_zc706_config \ - zynq_zybo_config \ - " - diff --git a/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch b/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch index 6f7fb522..370e694b 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch +++ b/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch @@ -28,6 +28,8 @@ elif '-plm-args' in APU_args: APU_args.remove(MB_args) MB_args = MB_args.split() mbtype='PLM' +elif '--help' in APU_args: + mbtype='help' else: error_msg = '\nMultiarch not setup properly.' sys.exit(error_msg) diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc index 6d834297..3be623ac 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc @@ -7,10 +7,7 @@ inherit deploy LIC_FILES_CHKSUM = "file://Makefile;beginline=1;endline=27;md5=7348b6cbcae69912cb1dee68d6c68d99" -PV = "xilinx-${XILINX_RELEASE_VERSION}+git${SRCPV}" - -FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -SRC_URI:append = " file://0001-Makefile-Use-python3-instead-of-python.patch" +PV = "xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}+git${SRCPV}" REPO ?= "git://github.com/Xilinx/qemu-devicetrees.git;protocol=https" diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2022.1.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2022.1.bb index e2f134fe..7c734cd6 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2022.1.bb +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2022.1.bb @@ -3,3 +3,6 @@ require qemu-devicetrees.inc BRANCH ?= "xlnx_rel_v2022.1" SRCREV ?= "0499324af1178057c3730b0989c8fb5c5bbc4cf8" + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI:append = " file://0001-Makefile-Use-python3-instead-of-python.patch" diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2022.2.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2022.2.bb new file mode 100644 index 00000000..6675ba3e --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2022.2.bb @@ -0,0 +1,6 @@ + +require qemu-devicetrees.inc + +BRANCH ?= "xlnx_rel_v2022.2" +SRCREV ?= "cf5d357e16c13ac447861f908e83951ffb7b4301" + diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb index eb14c0c1..2450d275 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb @@ -2,6 +2,7 @@ FILESEXTRAPATHS:prepend := "${COREBASE}/meta/recipes-devtools/qemu/qemu-helper:" # provide it, to replace the existing PROVIDES = "qemu-helper-native" +PR = "r1" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${WORKDIR}/tunctl.c;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999" @@ -32,3 +33,4 @@ do_install() { install tunctl ${STAGING_BINDIR_NATIVE} } +addtask addto_recipe_sysroot after do_populate_sysroot before do_build diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native.inc index 3faabe5b..b22ab432 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native.inc +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native.inc @@ -1,7 +1,7 @@ require recipes-devtools/qemu/qemu-native.inc require qemu-xilinx.inc -DEPENDS = "glib-2.0-native zlib-native" +DEPENDS = "glib-2.0-native zlib-native ninja-native meson-native" SRC_URI:remove = "file://0012-fix-libcap-header-issue-on-some-distro.patch" SRC_URI:remove = "file://0013-cpus.c-Add-error-messages-when-qemi_cpu_kick_thread-.patch" diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2022.2.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2022.2.bb new file mode 100644 index 00000000..5e6c2d28 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2022.2.bb @@ -0,0 +1,7 @@ +require qemu-xilinx-native.inc +BPN = "qemu-xilinx" + +EXTRA_OECONF:append = " --target-list=${@get_qemu_usermode_target_list(d)} --disable-tools --disable-blobs --disable-guest-agent" + +PROVIDES = "qemu-native" +PACKAGECONFIG ??= "pie" diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2022.1.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2022.1.bb index f5b89f05..f177872a 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2022.1.bb +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2022.1.bb @@ -1,5 +1,7 @@ require qemu-xilinx-native.inc +PROVIDES = "qemu-system-native" + EXTRA_OECONF:append = " --target-list=${@get_qemu_system_target_list(d)}" PACKAGECONFIG ??= "fdt alsa kvm pie" diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2022.2.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2022.2.bb new file mode 100644 index 00000000..f177872a --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2022.2.bb @@ -0,0 +1,20 @@ +require qemu-xilinx-native.inc + +PROVIDES = "qemu-system-native" + +EXTRA_OECONF:append = " --target-list=${@get_qemu_system_target_list(d)}" + +PACKAGECONFIG ??= "fdt alsa kvm pie" + +PACKAGECONFIG:remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}" + +DEPENDS += "pixman-native qemu-xilinx-native bison-native ninja-native meson-native" + +do_install:append() { + # The following is also installed by qemu-native + rm -f ${D}${datadir}/qemu/trace-events-all + rm -rf ${D}${datadir}/qemu/keymaps + rm -rf ${D}${datadir}/icons + rm -rf ${D}${includedir}/qemu-plugin.h +} + diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx.inc index 56a10861..a656f749 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx.inc +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx.inc @@ -11,12 +11,12 @@ LIC_FILES_CHKSUM = " \ DEPENDS = "glib-2.0 zlib pixman bison-native ninja-native meson-native" XILINX_QEMU_VERSION ?= "v6.1.0" -BRANCH ?= "xlnx_rel_v2022.1" -SRCREV = "52a9b22faeb149a6b17646b1f912f06ea6c269ca" +BRANCH ?= "xlnx_rel_v2022.2" +SRCREV = "74d70f8008bfbd1566c2eed3496a077a974de0d0" FILESEXTRAPATHS:prepend := "${THISDIR}/files:" -PV = "${XILINX_QEMU_VERSION}-xilinx-${XILINX_RELEASE_VERSION}+git${SRCPV}" +PV = "${XILINX_QEMU_VERSION}-xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}+git${SRCPV}" REPO ?= "gitsm://github.com/Xilinx/qemu.git;protocol=https" BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" @@ -35,7 +35,6 @@ PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl2" PACKAGECONFIG[pie] = "--enable-pie,--disable-pie,," DISABLE_STATIC:pn-${PN} = "" -EXTRA_OECONF:remove = " --with-git=/bin/false --with-git-submodules=ignore" PTEST_ENABLED = "" diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2022.2.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2022.2.bb new file mode 100644 index 00000000..4983b4df --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2022.2.bb @@ -0,0 +1,17 @@ +require recipes-devtools/qemu/qemu.inc +require qemu-xilinx.inc + +BBCLASSEXTEND = "nativesdk" + +RDEPENDS:${PN}:class-target += "bash" + +PROVIDES:class-nativesdk = "nativesdk-qemu" +RPROVIDES:${PN}:class-nativesdk = "nativesdk-qemu" + +EXTRA_OECONF:append:class-target = " --target-list=${@get_qemu_target_list(d)}" +EXTRA_OECONF:append:class-nativesdk = " --target-list=${@get_qemu_target_list(d)}" +EXTRA_OECONF:append:class-target:mipsarcho32 = "${@bb.utils.contains('BBEXTENDCURR', 'multilib', ' --disable-capstone', '', d)}" + +do_install:append:class-nativesdk() { + ${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'make_qemu_wrapper', '', d)} +} diff --git a/meta-xilinx-core/recipes-graphics/libgles/libmali-xlnx.bb b/meta-xilinx-core/recipes-graphics/libgles/libmali-xlnx.bb index 4acce149..d1efc896 100644 --- a/meta-xilinx-core/recipes-graphics/libgles/libmali-xlnx.bb +++ b/meta-xilinx-core/recipes-graphics/libgles/libmali-xlnx.bb @@ -12,7 +12,7 @@ PROVIDES += "virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm" FILESEXTRAPATHS:prepend := "${THISDIR}/files:" REPO ?= "git://github.com/Xilinx/mali-userspace-binaries.git;protocol=https" -BRANCH ?= "xlnx_rel_v2022.1" +BRANCH ?= "xlnx_rel_v2022.2" SRCREV ?= "a1a22c9f03b20d8cb70b91727fe51c1db7f4b061" BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" diff --git a/meta-xilinx-core/recipes-graphics/wayland/files/weston.service b/meta-xilinx-core/recipes-graphics/wayland/files/weston.service index c58e0668..c7583e92 100644 --- a/meta-xilinx-core/recipes-graphics/wayland/files/weston.service +++ b/meta-xilinx-core/recipes-graphics/wayland/files/weston.service @@ -41,8 +41,8 @@ TimeoutStartSec=60 WatchdogSec=20 # The user to run Weston as. -User=root -Group=root +User=weston +Group=weston # Make sure the working directory is the users home directory WorkingDirectory=/home/weston diff --git a/meta-xilinx-core/recipes-graphics/x11-common/xserver-nodm-init_%.bbappend b/meta-xilinx-core/recipes-graphics/x11-common/xserver-nodm-init_%.bbappend index eadb7e4a..0a789a20 100755 --- a/meta-xilinx-core/recipes-graphics/x11-common/xserver-nodm-init_%.bbappend +++ b/meta-xilinx-core/recipes-graphics/x11-common/xserver-nodm-init_%.bbappend @@ -1 +1 @@ -FILESEXTRAPATHS:append := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:append := ":${THISDIR}/${PN}" diff --git a/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_git.bb b/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_git.bb index ae11f694..7214a8b8 100755 --- a/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_git.bb +++ b/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_git.bb @@ -4,14 +4,14 @@ SECTION = "kernel/modules" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://LICENSE.md;md5=eb723b61539feef013de476e68b5c50a" -XLNX_DP_VERSION = "5.15.19" +XLNX_DP_VERSION = "5.10.0" PV = "${XLNX_DP_VERSION}" S = "${WORKDIR}/git" -BRANCH ?= "xlnx_rel_v2022.1" +BRANCH ?= "xlnx_rel_v2022.2" REPO ?= "git://github.com/xilinx/dp-modules.git;protocol=https" -SRCREV ?= "9a025fdb7134a8af12de8d69f5a428c8284ae9b3" +SRCREV ?= "c57b2ce95ee6c86f35caecbc7007644ff8f6d337" BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" SRC_URI = "${REPO};${BRANCHARG}" diff --git a/meta-xilinx-core/recipes-kernel/hdmi/kernel-module-hdmi_git.bb b/meta-xilinx-core/recipes-kernel/hdmi/kernel-module-hdmi_git.bb index 27a5ffdb..101e9450 100644 --- a/meta-xilinx-core/recipes-kernel/hdmi/kernel-module-hdmi_git.bb +++ b/meta-xilinx-core/recipes-kernel/hdmi/kernel-module-hdmi_git.bb @@ -9,7 +9,7 @@ PV = "${XLNX_HDMI_VERSION}" S = "${WORKDIR}/git" -BRANCH ?= "xlnx_rel_v2022.1" +BRANCH ?= "xlnx_rel_v2022.2" REPO ?= "git://github.com/Xilinx/hdmi-modules.git;protocol=https" SRCREV = "25b6fe7a26a975be15c002b48cfd4c291486491e" diff --git a/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bb b/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bb new file mode 100644 index 00000000..f5b0ff95 --- /dev/null +++ b/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bb @@ -0,0 +1,37 @@ +SUMMARY = "Udev rules files for Linux drivers" +DESCRIPTION = "Generic udev rules recipe for Xilinx Linux in tree drivers" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = "\ + file://99-aie-device.rules \ +" + +S = "${WORKDIR}" + +inherit useradd + +COMPATIBLE_MACHINE ?= "^$" +COMPATIBLE_MACHINE:zynq = ".*" +COMPATIBLE_MACHINE:zynqmp = ".*" +COMPATIBLE_MACHINE:microblaze = ".*" +COMPATIBLE_MACHINE:versal = ".*" + +do_configure[noexec] = '1' +do_compile[noexec] = '1' + +do_install () { + install -d ${D}${sysconfdir}/udev/rules.d + for rule in $(find ${WORKDIR} -maxdepth 1 -type f -name "*.rules"); do + if ${@bb.utils.contains_any('SOC_VARIANT', ['ai-core', 'ai-edge'], 'true', 'false' ,d)}; then + install -m 0644 ${WORKDIR}/99-aie-device.rules ${D}${sysconfdir}/udev/rules.d/ + fi + install -m 0644 $rule ${D}${sysconfdir}/udev/rules.d/ + done +} + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM:${PN} += "${@bb.utils.contains_any('SOC_VARIANT', ['ai-core', 'ai-edge'], '-r aie;', '', d)}" + +FILES:${PN} += "${sysconfdir}/udev/rules.d/*" + diff --git a/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-aie-device.rules b/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-aie-device.rules new file mode 100644 index 00000000..fffcf6e6 --- /dev/null +++ b/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-aie-device.rules @@ -0,0 +1,2 @@ +# Device rules for AIE drivers. +ACTION=="add", SUBSYSTEM=="aie", KERNEL=="aie[0-9]*", MODE="0660", GROUP="aie" diff --git a/meta-xilinx-core/recipes-kernel/linux/linux-microblaze.inc b/meta-xilinx-core/recipes-kernel/linux/linux-microblaze.inc index 4555bc28..efd21a18 100644 --- a/meta-xilinx-core/recipes-kernel/linux/linux-microblaze.inc +++ b/meta-xilinx-core/recipes-kernel/linux/linux-microblaze.inc @@ -1,4 +1,7 @@ -SRC_URI += "file://mb-no-tree-loop-distribute-patterns.patch" +SRC_URI += " \ + file://mb-no-tree-loop-distribute-patterns.patch \ + file://microblaze_generic.cfg \ + " # MicroBlaze is a uImage target, but its not called 'uImage' instead it is called 'linux.bin.ub' python () { diff --git a/meta-xilinx-core/recipes-kernel/linux/linux-xlnx.inc b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx.inc index adefabea..dc79151a 100644 --- a/meta-xilinx-core/recipes-kernel/linux/linux-xlnx.inc +++ b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx.inc @@ -1,13 +1,12 @@ # This version extension should match CONFIG_LOCALVERSION in defconfig -XILINX_RELEASE_VERSION ?= "" -LINUX_VERSION_EXTENSION ?= "-xilinx-${XILINX_RELEASE_VERSION}" +LINUX_VERSION_EXTENSION ?= "-xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}" PV = "${LINUX_VERSION}+git${SRCPV}" # Sources, by default allow for the use of SRCREV pointing to orphaned tags/commits KBRANCH ?= "xlnx_rebase_v5.15_LTS" SRCBRANCHARG = "${@['nobranch=1', 'branch=${KBRANCH}'][d.getVar('KBRANCH', True) != '']}" -FILESOVERRIDES:append = ":${XILINX_RELEASE_VERSION}" +FILESOVERRIDES:append := ":${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}" KERNELURI ?= "git://github.com/Xilinx/linux-xlnx.git;protocol=https;name=machine" YOCTO_META ?= "git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.15;destsuffix=yocto-kmeta" SRC_URI = "${KERNELURI};${SRCBRANCHARG} ${YOCTO_META}" diff --git a/meta-xilinx-core/recipes-kernel/linux/linux-xlnx/microblaze_generic.cfg b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx/microblaze_generic.cfg new file mode 100644 index 00000000..6ec6a997 --- /dev/null +++ b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx/microblaze_generic.cfg @@ -0,0 +1,18 @@ +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_DP83867_PHY=y +CONFIG_EARLY_PRINTK=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_OF=y +CONFIG_NET_CORE=y +CONFIG_XILINX_PHY=y +CONFIG_XILINX_MICROBLAZE0_FAMILY="kintex7" +CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1 +CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1 +CONFIG_XILINX_MICROBLAZE0_USE_BARREL=1 +CONFIG_XILINX_MICROBLAZE0_USE_DIV=1 +CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=2 +CONFIG_XILINX_MICROBLAZE0_USE_FPU=1 +CONFIG_XILINX_MICROBLAZE0_HW_VER="11.0" +CONFIG_KERNEL_BASE_ADDR=0x80000000 +CONFIG_CMDLINE="console=ttyUL0,115200 earlycon root=/dev/ram0 rw" +CONFIG_BLK_DEV_INITRD=y
\ No newline at end of file diff --git a/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_2022.1.bb b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_2022.1.bb index 60301f18..41c1ffe2 100644 --- a/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_2022.1.bb +++ b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_2022.1.bb @@ -1,6 +1,6 @@ LINUX_VERSION = "5.15.19" -KBRANCH="xlnx_rebase_v5.15_LTS" -SRCREV = "b0c1be301e78c320df8c4d93b18393bfd7fd4e9d" +KBRANCH="xlnx_rebase_v5.15_LTS_2022.1_update" +SRCREV = "75872fda9ad270b611ee6ae2433492da1e22b688" KCONF_AUDIT_LEVEL="0" diff --git a/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_2022.2.bb b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_2022.2.bb new file mode 100644 index 00000000..260224b8 --- /dev/null +++ b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx_2022.2.bb @@ -0,0 +1,9 @@ +LINUX_VERSION = "5.15.36" +KBRANCH="xlnx_rebase_v5.15_LTS" +SRCREV = "19984dd147fa7fbb7cb14b17400263ad0925c189" + +KCONF_AUDIT_LEVEL="0" + +include linux-xlnx.inc + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" diff --git a/meta-xilinx-core/recipes-multimedia/vcu/kernel-module-vcu.bb b/meta-xilinx-core/recipes-multimedia/vcu/kernel-module-vcu_2022.1.bb index 1114a49d..77f00534 100644 --- a/meta-xilinx-core/recipes-multimedia/vcu/kernel-module-vcu.bb +++ b/meta-xilinx-core/recipes-multimedia/vcu/kernel-module-vcu_2022.1.bb @@ -5,7 +5,7 @@ LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://LICENSE.md;md5=eb723b61539feef013de476e68b5c50a" XILINX_VCU_VERSION = "1.0.0" -PV = "${XILINX_VCU_VERSION}-xilinx-${XILINX_RELEASE_VERSION}+git${SRCPV}" +PV = "${XILINX_VCU_VERSION}-xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}+git${SRCPV}" S = "${WORKDIR}/git" diff --git a/meta-xilinx-core/recipes-multimedia/vcu/kernel-module-vcu_2022.2.bb b/meta-xilinx-core/recipes-multimedia/vcu/kernel-module-vcu_2022.2.bb new file mode 100644 index 00000000..89fd6d82 --- /dev/null +++ b/meta-xilinx-core/recipes-multimedia/vcu/kernel-module-vcu_2022.2.bb @@ -0,0 +1,40 @@ +SUMMARY = "Linux kernel module for Video Code Unit" +DESCRIPTION = "Out-of-tree VCU decoder, encoder and common kernel modules provider for MPSoC EV devices" +SECTION = "kernel/modules" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://LICENSE.md;md5=eb723b61539feef013de476e68b5c50a" + +XILINX_VCU_VERSION = "1.0.0" +PV = "${XILINX_VCU_VERSION}-xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}+git${SRCPV}" + +S = "${WORKDIR}/git" + +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +BRANCH = "xlnx_rel_v2022.2" +REPO = "git://github.com/Xilinx/vcu-modules.git;protocol=https" +SRCREV = "b131e220285e06658b6ab27f9e19b1c592a55f3a" + +BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" +SRC_URI = " \ + ${REPO};${BRANCHARG} \ + file://99-vcu-enc-dec.rules \ + " + +inherit module + +EXTRA_OEMAKE += "O=${STAGING_KERNEL_BUILDDIR}" + +RDEPENDS:${PN} = "vcu-firmware" + +COMPATIBLE_MACHINE = "^$" +COMPATIBLE_MACHINE:zynqmp = "zynqmp" + +KERNEL_MODULE_AUTOLOAD += "dmaproxy" + +do_install:append() { + install -d ${D}${sysconfdir}/udev/rules.d + install -m 0644 ${WORKDIR}/99-vcu-enc-dec.rules ${D}${sysconfdir}/udev/rules.d/ +} + +FILES:${PN} = "${sysconfdir}/udev/rules.d/*" diff --git a/meta-xilinx-core/recipes-multimedia/vcu/libomxil-xlnx.bb b/meta-xilinx-core/recipes-multimedia/vcu/libomxil-xlnx_2022.1.bb index 958183a0..b4460a38 100644 --- a/meta-xilinx-core/recipes-multimedia/vcu/libomxil-xlnx.bb +++ b/meta-xilinx-core/recipes-multimedia/vcu/libomxil-xlnx_2022.1.bb @@ -4,7 +4,7 @@ LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://LICENSE.md;md5=03a7aef7e6f6a76a59fd9b8ba450b493" XILINX_VCU_VERSION = "1.0.0" -PV = "${XILINX_VCU_VERSION}-xilinx-${XILINX_RELEASE_VERSION}+git${SRCPV}" +PV = "${XILINX_VCU_VERSION}-xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}+git${SRCPV}" BRANCH ?= "xlnx_rel_v2022.1" REPO ?= "git://github.com/Xilinx/vcu-omx-il.git;protocol=https" diff --git a/meta-xilinx-core/recipes-multimedia/vcu/libomxil-xlnx_2022.2.bb b/meta-xilinx-core/recipes-multimedia/vcu/libomxil-xlnx_2022.2.bb new file mode 100644 index 00000000..5b958bee --- /dev/null +++ b/meta-xilinx-core/recipes-multimedia/vcu/libomxil-xlnx_2022.2.bb @@ -0,0 +1,50 @@ +SUMMARY = "OpenMAX Integration layer for VCU" +DESCRIPTION = "OMX IL Libraries,test applications and headers for VCU" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://LICENSE.md;md5=03a7aef7e6f6a76a59fd9b8ba450b493" + +XILINX_VCU_VERSION = "1.0.0" +PV = "${XILINX_VCU_VERSION}-xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}+git${SRCPV}" + +BRANCH ?= "xlnx_rel_v2022.2" +REPO ?= "git://github.com/Xilinx/vcu-omx-il.git;protocol=https" +SRCREV = "6752f5da88a8783f689ae762065295b89902d6d4" + +BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" +SRC_URI = "${REPO};${BRANCHARG}" + +S = "${WORKDIR}/git" + +COMPATIBLE_MACHINE = "^$" +COMPATIBLE_MACHINE:zynqmp = "zynqmp" + +PACKAGE_ARCH = "${SOC_FAMILY_ARCH}" + +DEPENDS = "libvcu-xlnx" +RDEPENDS:${PN} = "kernel-module-vcu libvcu-xlnx" + +EXTERNAL_INCLUDE="${STAGING_INCDIR}/vcu-ctrl-sw/include" + +EXTRA_OEMAKE = " \ + CC='${CC}' CXX='${CXX} ${CXXFLAGS}' \ + EXTERNAL_INCLUDE='${EXTERNAL_INCLUDE}' \ + " + +do_install() { + install -d ${D}${libdir} + install -d ${D}${includedir}/vcu-omx-il + + install -m 0644 ${S}/omx_header/*.h ${D}${includedir}/vcu-omx-il + + install -Dm 0755 ${S}/bin/omx_decoder ${D}/${bindir}/omx_decoder + install -Dm 0755 ${S}/bin/omx_encoder ${D}/${bindir}/omx_encoder + + oe_libinstall -C ${S}/bin/ -so libOMX.allegro.core ${D}/${libdir}/ + oe_libinstall -C ${S}/bin/ -so libOMX.allegro.video_decoder ${D}/${libdir}/ + oe_libinstall -C ${S}/bin/ -so libOMX.allegro.video_encoder ${D}/${libdir}/ +} + +# These libraries shouldn't get installed in world builds unless something +# explicitly depends upon them. + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-xilinx-core/recipes-multimedia/vcu/libvcu-xlnx.bb b/meta-xilinx-core/recipes-multimedia/vcu/libvcu-xlnx_2022.1.bb index 5608e5a8..91f15cc2 100644 --- a/meta-xilinx-core/recipes-multimedia/vcu/libvcu-xlnx.bb +++ b/meta-xilinx-core/recipes-multimedia/vcu/libvcu-xlnx_2022.1.bb @@ -4,7 +4,7 @@ LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://LICENSE.md;md5=03a7aef7e6f6a76a59fd9b8ba450b493" XILINX_VCU_VERSION = "1.0.0" -PV = "${XILINX_VCU_VERSION}-xilinx-${XILINX_RELEASE_VERSION}+git${SRCPV}" +PV = "${XILINX_VCU_VERSION}-xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}+git${SRCPV}" BRANCH ?= "xlnx_rel_v2022.1" REPO ?= "git://github.com/Xilinx/vcu-ctrl-sw.git;protocol=https" diff --git a/meta-xilinx-core/recipes-multimedia/vcu/libvcu-xlnx_2022.2.bb b/meta-xilinx-core/recipes-multimedia/vcu/libvcu-xlnx_2022.2.bb new file mode 100644 index 00000000..24be1173 --- /dev/null +++ b/meta-xilinx-core/recipes-multimedia/vcu/libvcu-xlnx_2022.2.bb @@ -0,0 +1,42 @@ +SUMMARY = "Control Software for VCU" +DESCRIPTION = "Control software libraries, test applications and headers provider for VCU" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://LICENSE.md;md5=03a7aef7e6f6a76a59fd9b8ba450b493" + +XILINX_VCU_VERSION = "1.0.0" +PV = "${XILINX_VCU_VERSION}-xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}+git${SRCPV}" + +BRANCH ?= "xlnx_rel_v2022.2" +REPO ?= "git://github.com/Xilinx/vcu-ctrl-sw.git;protocol=https" +SRCREV = "3c59dede1923a159a8db736ce0b4ab55633a2114" + +BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" +SRC_URI = "${REPO};${BRANCHARG}" + +S = "${WORKDIR}/git" + +COMPATIBLE_MACHINE = "^$" +COMPATIBLE_MACHINE:zynqmp = "zynqmp" + +PACKAGE_ARCH = "${SOC_FAMILY_ARCH}" + +RDEPENDS:${PN} = "kernel-module-vcu" + +EXTRA_OEMAKE = "CC='${CC}' CXX='${CXX} ${CXXFLAGS}'" + +do_install() { + install -d ${D}${libdir} + install -d ${D}${includedir}/vcu-ctrl-sw/include + + install -Dm 0755 ${S}/bin/ctrlsw_encoder ${D}/${bindir}/ctrlsw_encoder + install -Dm 0755 ${S}/bin/ctrlsw_decoder ${D}/${bindir}/ctrlsw_decoder + + oe_runmake install_headers INSTALL_HDR_PATH=${D}${includedir}/vcu-ctrl-sw/include + oe_libinstall -C ${S}/bin/ -so liballegro_decode ${D}/${libdir}/ + oe_libinstall -C ${S}/bin/ -so liballegro_encode ${D}/${libdir}/ +} + +# These libraries shouldn't get installed in world builds unless something +# explicitly depends upon them. + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-xilinx-core/recipes-multimedia/vcu/vcu-firmware.bb b/meta-xilinx-core/recipes-multimedia/vcu/vcu-firmware_2022.1.bb index 0013134d..fc9f34ca 100644 --- a/meta-xilinx-core/recipes-multimedia/vcu/vcu-firmware.bb +++ b/meta-xilinx-core/recipes-multimedia/vcu/vcu-firmware_2022.1.bb @@ -4,7 +4,7 @@ LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://LICENSE;md5=63b45903a9a50120df488435f03cf498" XILINX_VCU_VERSION = "1.0.0" -PV = "${XILINX_VCU_VERSION}-xilinx-${XILINX_RELEASE_VERSION}+git${SRCPV}" +PV = "${XILINX_VCU_VERSION}-xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}+git${SRCPV}" S = "${WORKDIR}/git" diff --git a/meta-xilinx-core/recipes-multimedia/vcu/vcu-firmware_2022.2.bb b/meta-xilinx-core/recipes-multimedia/vcu/vcu-firmware_2022.2.bb new file mode 100644 index 00000000..6be9fe54 --- /dev/null +++ b/meta-xilinx-core/recipes-multimedia/vcu/vcu-firmware_2022.2.bb @@ -0,0 +1,39 @@ +SUMMARY = "Firmware for VCU" +DESCRIPTION = "Firmware binaries provider for VCU" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://LICENSE;md5=63b45903a9a50120df488435f03cf498" + +XILINX_VCU_VERSION = "1.0.0" +PV = "${XILINX_VCU_VERSION}-xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}+git${SRCPV}" + +S = "${WORKDIR}/git" + +BRANCH ?= "xlnx_rel_v2022.2" +REPO ?= "git://github.com/Xilinx/vcu-firmware.git;protocol=https" +SRCREV = "3980c778d71fa51a15e89bf70fd8fb28d5cb12e0" + +BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" +SRC_URI = "${REPO};${BRANCHARG}" + +COMPATIBLE_MACHINE = "^$" +COMPATIBLE_MACHINE:zynqmp = "zynqmp" + +PACKAGE_ARCH = "${SOC_FAMILY_ARCH}" + +do_install() { + install -Dm 0644 ${S}/${XILINX_VCU_VERSION}/lib/firmware/al5d_b.fw ${D}/lib/firmware/al5d_b.fw + install -Dm 0644 ${S}/${XILINX_VCU_VERSION}/lib/firmware/al5d.fw ${D}/lib/firmware/al5d.fw + install -Dm 0644 ${S}/${XILINX_VCU_VERSION}/lib/firmware/al5e_b.fw ${D}/lib/firmware/al5e_b.fw + install -Dm 0644 ${S}/${XILINX_VCU_VERSION}/lib/firmware/al5e.fw ${D}/lib/firmware/al5e.fw +} + +# Inhibit warnings about files being stripped +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" +INHIBIT_PACKAGE_STRIP = "1" +FILES:${PN} = "/lib/firmware/*" + +# These libraries shouldn't get installed in world builds unless something +# explicitly depends upon them. +EXCLUDE_FROM_WORLD = "1" + +INSANE_SKIP:${PN} = "ldflags" diff --git a/meta-xilinx-core/recipes-xrt/xrt/xrt.inc b/meta-xilinx-core/recipes-xrt/xrt/xrt.inc index da09ec0f..52bed585 100644 --- a/meta-xilinx-core/recipes-xrt/xrt/xrt.inc +++ b/meta-xilinx-core/recipes-xrt/xrt/xrt.inc @@ -2,6 +2,7 @@ REPO ?= "git://github.com/Xilinx/XRT.git;protocol=https" BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" SRC_URI = "${REPO};${BRANCHARG}" -BRANCH= "2022.1" -SRCREV= "2a6dc026480914ea1c9f02977a6ab4b57e8a3c8d" -PV = "202210.2.13.0" +BRANCH= "2022.2" +SRCREV= "43926231f7183688add2dccfd391b36a1f000bea" +PV = "202220.2.14.0" + diff --git a/meta-xilinx-core/recipes-xrt/xrt/xrt_git.bb b/meta-xilinx-core/recipes-xrt/xrt/xrt_git.bb index 6ba6beab..7b87e217 100644 --- a/meta-xilinx-core/recipes-xrt/xrt/xrt_git.bb +++ b/meta-xilinx-core/recipes-xrt/xrt/xrt_git.bb @@ -8,8 +8,7 @@ LIC_FILES_CHKSUM = "file://../LICENSE;md5=da5408f748bce8a9851dac18e66f4bcf \ file://runtime_src/core/edge/drm/zocl/LICENSE;md5=7d040f51aae6ac6208de74e88a3795f8 \ file://runtime_src/core/pcie/driver/linux/xocl/LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ file://runtime_src/core/pcie/linux/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ - file://runtime_src/core/pcie/tools/xbutil/LICENSE;md5=d273d63619c9aeaf15cdaf76422c4f87 \ - file://runtime_src/core/edge/tools/xbutil/LICENSE;md5=d273d63619c9aeaf15cdaf76422c4f87 " + file://runtime_src/core/tools/xbutil2/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 " S = "${WORKDIR}/git/src" @@ -26,14 +25,14 @@ EXTRA_OECMAKE += " \ -DCMAKE_EXPORT_COMPILE_COMANDS=ON \ " PACKAGE_ARCH:versal-ai-core = "${SOC_VARIANT_ARCH}" -EXTRA_OECMAKE:append:versal-ai-core += "-DXRT_AIE_BUILD=true" -TARGET_CXXFLAGS:append:versal-ai-core += "-DXRT_ENABLE_AIE" -DEPENDS:append:versal-ai-core += " libmetal libxaiengine aiefal" -RDEPENDS:${PN}:append:versal-ai-core += " libxaiengine aiefal" -EXTRA_OECMAKE:append:versal += "-DXRT_LIBDFX=true" -EXTRA_OECMAKE:append:zynqmp += "-DXRT_LIBDFX=true" -DEPENDS:append:versal += "libdfx" -DEPENDS:append:zynqmp += "libdfx" +EXTRA_OECMAKE:append:versal-ai-core = " -DXRT_AIE_BUILD=true" +TARGET_CXXFLAGS:append:versal-ai-core = " -DXRT_ENABLE_AIE" +DEPENDS:append:versal-ai-core = " libmetal libxaiengine aiefal" +RDEPENDS:${PN}:append:versal-ai-core = " libxaiengine aiefal" +EXTRA_OECMAKE:append:versal = " -DXRT_LIBDFX=true" +EXTRA_OECMAKE:append:zynqmp = " -DXRT_LIBDFX=true" +DEPENDS:append:versal = " libdfx" +DEPENDS:append:zynqmp = " libdfx" FILES_SOLIBSDEV = "" @@ -41,7 +40,8 @@ FILES:${PN} += "\ ${libdir}/lib*.so \ ${libdir}/lib*.so.* \ ${libdir}/ps_kernels_lib \ - /lib/*.so* " + /lib/*.so* \ + ${datadir}" INSANE_SKIP:${PN} += "dev-so" pkg_postinst_ontarget:${PN}() { diff --git a/meta-xilinx-core/recipes-xrt/zocl/zocl_git.bb b/meta-xilinx-core/recipes-xrt/zocl/zocl_git.bb index 40578aa2..ea0728f3 100644 --- a/meta-xilinx-core/recipes-xrt/zocl/zocl_git.bb +++ b/meta-xilinx-core/recipes-xrt/zocl/zocl_git.bb @@ -1,6 +1,7 @@ SUMMARY = "Xilinx Runtime(XRT) driver module" DESCRIPTION = "Xilinx Runtime driver module provides memory management and compute unit schedule" +COMPATIBLE_MACHINE:microblaze = "none" require recipes-xrt/xrt/xrt.inc diff --git a/meta-xilinx-pynq/README.md b/meta-xilinx-pynq/README.md index a40ff96b..7f8163f2 100644 --- a/meta-xilinx-pynq/README.md +++ b/meta-xilinx-pynq/README.md @@ -1,26 +1,19 @@ # meta-xilinx-pynq -================================ - -Introduction -------------------------- +## Introduction This layer collects recipes required to build and run PYNQ based examples using jupyter-notebooks on yocto -Maintainers, Patches/Submissions, Community -=========================================== -Please open pull requests for any changes. - -Maintainers: - - Sai Hari Chandana Kalluri (chandana.kalluri@xilinx.com) - Peter Ogden (ogden@xilinx.com) +## Dependencies -Layer dependencies -===================== +This layer depends on: -URI: git://git.openembedded.org/bitbake + URI: git://git.openembedded.org/bitbake -URI: git://git.openembedded.org/openembedded-core + URI: git://git.openembedded.org/openembedded-core + layers: meta + branch: master or xilinx current release version (e.g. hosister) -URI: git://git.openembedded.org/meta-openembedded + URI: git://git.yoctoproject.org/meta-xilinx.git + layers: meta-xilinx-core + branch: master or xilinx current release version (e.g. hosister) diff --git a/meta-xilinx-pynq/conf/layer.conf b/meta-xilinx-pynq/conf/layer.conf index 5c0d3e77..4beedc2b 100644 --- a/meta-xilinx-pynq/conf/layer.conf +++ b/meta-xilinx-pynq/conf/layer.conf @@ -9,7 +9,7 @@ BBFILE_COLLECTIONS += "xilinx-pynq" BBFILE_PATTERN_xilinx-pynq = "^${LAYERDIR}/" BBFILE_PRIORITY_xilinx-pynq = "5" -LAYERDEPENDS_xilinx-pynq = "core xilinx" +LAYERDEPENDS_xilinx-pynq = "core xilinx meta-python" LAYERSERIES_COMPAT_xilinx-pynq = "honister" diff --git a/meta-xilinx-standalone-experimental/README.md b/meta-xilinx-standalone-experimental/README.md index e49b01f2..99675b0a 100644 --- a/meta-xilinx-standalone-experimental/README.md +++ b/meta-xilinx-standalone-experimental/README.md @@ -1,5 +1,5 @@ -meta-xilinx-standalone-experimental -=================================== +# meta-xilinx-standalone-experimental + This layer contains experimental items that may eventually be added to the meta-xilinx-standalone layer. The components in this layer may or may not be buildable as they may require unreleased code. @@ -9,9 +9,9 @@ this should be considered to be a preview release only. For instance, some components may not be buildable, expect APIs to change on various parts and pieces. -Build Instructions ------------------- -Note: to use this layer you must REMOVE meta-xilinx-tools from your +## Build Instructions + +**Note:** to use this layer you must REMOVE meta-xilinx-tools from your project. meta-xilinx-tools is not compatible with this experimental approach. You may also have to remove other layers that depend on meta-xilinx-tools, such as meta-som. @@ -32,27 +32,18 @@ To install the setup SDK: Then follow the instructions in the 'prestep/README-setup' file. -Maintainers, Mailing list, Patches -================================== - -Please send any patches, pull requests, comments or questions for this -layer to the [meta-xilinx mailing list] -(https://lists.yoctoproject.org/listinfo/meta-xilinx): - - meta-xilinx@lists.yoctoproject.org -Maintainers: - - Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> - Mark Hatle <mark.hatle@xilinx.com> - -Dependencies -============ +## Dependencies This layer depends on: - URI: git://git.yoctoproject.org/poky + URI: git://git.openembedded.org/bitbake + + URI: git://git.openembedded.org/openembedded-core + layers: meta + branch: master or xilinx current release version (e.g. hosister) - URI: git://git.yoctoproject.org/meta-xilinx/meta-xilinx-standalone + URI: git://git.yoctoproject.org/meta-xilinx.git + layers: meta-xilinx-core, meta-xilinx-bsp, meta-xilinx-standalone + branch: master or xilinx current release version (e.g. hosister) - URI: git://git.yoctoproject.org/meta-xilinx/meta-xilinx-bsp diff --git a/meta-xilinx-standalone-experimental/classes/esw.bbclass b/meta-xilinx-standalone-experimental/classes/esw.bbclass index efecb1f9..0b179a61 100644 --- a/meta-xilinx-standalone-experimental/classes/esw.bbclass +++ b/meta-xilinx-standalone-experimental/classes/esw.bbclass @@ -6,9 +6,7 @@ require conf/dtb-embeddedsw.inc SRCREV_FORMAT = "src_decouple" S = "${WORKDIR}/git" -#B = "${WORKDIR}/build" -B = "${S}" - +B = "${WORKDIR}/build" OECMAKE_SOURCEPATH = "${S}/${ESW_COMPONENT_SRC}" LICFILENAME = "license.txt" @@ -66,6 +64,7 @@ def get_xlnx_cmake_processor(tune, machine, d): XLNX_CMAKE_MACHINE = "${@get_xlnx_cmake_machine(d.getVar('SOC_FAMILY'), d)}" XLNX_CMAKE_PROCESSOR = "${@get_xlnx_cmake_processor(d.getVar('DEFAULTTUNE'), d.getVar('ESW_MACHINE'), d)}" XLNX_CMAKE_SYSTEM_NAME ?= "Generic" +XLNX_CMAKE_BSP_VARS ?= "" cmake_do_generate_toolchain_file:append() { cat >> ${WORKDIR}/toolchain.cmake <<EOF @@ -77,6 +76,7 @@ cmake_do_generate_toolchain_file:append() { # Will need this in the future to make cmake understand esw variables # set( CMAKE_SYSTEM_NAME `echo elf | sed -e 's/^./\u&/' -e 's/^\(Linux\).*/\1/'` ) set( CMAKE_SYSTEM_NAME "${XLNX_CMAKE_SYSTEM_NAME}" ) + add_definitions( "${XLNX_CMAKE_BSP_VARS}" ) EOF } diff --git a/meta-xilinx-standalone-experimental/classes/esw_examples.bbclass b/meta-xilinx-standalone-experimental/classes/esw_examples.bbclass index 64e0810c..508da535 100644 --- a/meta-xilinx-standalone-experimental/classes/esw_examples.bbclass +++ b/meta-xilinx-standalone-experimental/classes/esw_examples.bbclass @@ -3,10 +3,12 @@ inherit esw deploy python3native DEPENDS += "python3-dtc-native python3-pyyaml-native xilstandalone libxil xiltimer" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } ESW_CUSTOM_LINKER_FILE ?= "None" @@ -26,8 +28,8 @@ do_install() { } do_deploy() { - install -d ${DEPLOYDIR}/ - install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/ + install -d ${DEPLOYDIR}/${BPN}/ + install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${BPN}/ } addtask deploy before do_build after do_package diff --git a/meta-xilinx-standalone-experimental/conf/dtb-embeddedsw.inc b/meta-xilinx-standalone-experimental/conf/dtb-embeddedsw.inc index ee7492ea..2b461993 100644 --- a/meta-xilinx-standalone-experimental/conf/dtb-embeddedsw.inc +++ b/meta-xilinx-standalone-experimental/conf/dtb-embeddedsw.inc @@ -6,8 +6,7 @@ ESW_VER = "experimental" REPO = "git://github.com/Xilinx/embeddedsw-experimental-dt-support.git;protocol=https" -ESW_BRANCH[experimental] = "xilinx-v2021.1-sdt-experimental" -ESW_REV[experimental] = "329bf8fa54110034c8436d0b3b4aa40e8a56b02d" +ESW_BRANCH[experimental] = "xlnx_rel_v2022.1_sdt_experimental_beta" +ESW_REV[experimental] = "2f93defe078000965c8f7203da11817c9f0982d1" LIC_FILES_CHKSUM[master] = '7c92de7a21a6613265035c28f4a92f48' -LIC_FILES_CHKSUM[xilinx-v2021.1-sdt-experimental] = '7c92de7a21a6613265035c28f4a92f48' - +LIC_FILES_CHKSUM[xlnx_rel_v2022.1_sdt_experimental_beta] = 'e26f53a7d6f58f4b1a9687099417225c' diff --git a/meta-xilinx-standalone-experimental/recipes-applications/empty-application/empty-application_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/empty-application/empty-application_git.bb index 99771f38..8ffb01cb 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/empty-application/empty-application_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/empty-application/empty-application_git.bb @@ -7,11 +7,13 @@ DEPENDS += "libxil xiltimer" inherit python3native do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ install -m 0644 ${CUSTOM_SRCFILE}/* ${S}/${ESW_COMPONENT_SRC}/ + ) } CUSTOM_APP_IMAGE_NAME ??= "custom-application" diff --git a/meta-xilinx-standalone-experimental/recipes-applications/freertos-hello-world/freertos-hello-world_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/freertos-hello-world/freertos-hello-world_git.bb index e4a300d2..f97240f8 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/freertos-hello-world/freertos-hello-world_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/freertos-hello-world/freertos-hello-world_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_apps/freertos_hello_world/src/" DEPENDS += "libxil xilstandalone freertos10-xilinx xiltimer" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } do_install() { diff --git a/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-echo-server/freertos-lwip-echo-server_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-echo-server/freertos-lwip-echo-server_git.bb index 25610987..5e58c601 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-echo-server/freertos-lwip-echo-server_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-echo-server/freertos-lwip-echo-server_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_apps/freertos_lwip_echo_server/src/" DEPENDS += "libxil lwip xiltimer freertos10-xilinx" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } do_generate_app_data() { diff --git a/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-tcp-perf-client/freertos-lwip-tcp-perf-client_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-tcp-perf-client/freertos-lwip-tcp-perf-client_git.bb index cec949f9..e4a2b041 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-tcp-perf-client/freertos-lwip-tcp-perf-client_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-tcp-perf-client/freertos-lwip-tcp-perf-client_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_apps/freertos_lwip_tcp_perf_client/src/" DEPENDS += "libxil lwip xiltimer freertos10-xilinx" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } do_generate_app_data() { diff --git a/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-tcp-perf-server/freertos-lwip-tcp-perf-server_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-tcp-perf-server/freertos-lwip-tcp-perf-server_git.bb index a144ecfd..bf892954 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-tcp-perf-server/freertos-lwip-tcp-perf-server_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-tcp-perf-server/freertos-lwip-tcp-perf-server_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_apps/freertos_lwip_tcp_perf_server/src/" DEPENDS += "libxil lwip xiltimer freertos10-xilinx" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } do_generate_app_data() { diff --git a/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-udp-perf-client/freertos-lwip-udp-perf-client_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-udp-perf-client/freertos-lwip-udp-perf-client_git.bb index 3c3a27b0..0a28d3df 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-udp-perf-client/freertos-lwip-udp-perf-client_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-udp-perf-client/freertos-lwip-udp-perf-client_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_apps/freertos_lwip_udp_perf_client/src/" DEPENDS += "libxil lwip xiltimer freertos10-xilinx" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } do_generate_app_data() { diff --git a/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-udp-perf-server/freertos-lwip-udp-perf-server_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-udp-perf-server/freertos-lwip-udp-perf-server_git.bb index 8e532c3c..0212dab2 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-udp-perf-server/freertos-lwip-udp-perf-server_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/freertos-lwip-udp-perf-server/freertos-lwip-udp-perf-server_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_apps/freertos_lwip_udp_perf_server/src/" DEPENDS += "libxil lwip xiltimer freertos10-xilinx" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } do_generate_app_data() { diff --git a/meta-xilinx-standalone-experimental/recipes-applications/hello-world/hello-world_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/hello-world/hello-world_git.bb index 9b66c129..16d9d030 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/hello-world/hello-world_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/hello-world/hello-world_git.bb @@ -7,10 +7,12 @@ DEPENDS += "libxil xiltimer" inherit python3native do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } do_install() { diff --git a/meta-xilinx-standalone-experimental/recipes-applications/lwip-echo-server/lwip-echo-server_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/lwip-echo-server/lwip-echo-server_git.bb index d86e62a3..84909f18 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/lwip-echo-server/lwip-echo-server_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/lwip-echo-server/lwip-echo-server_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_apps/lwip_echo_server/src/" DEPENDS += "libxil lwip xiltimer" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } do_generate_app_data() { diff --git a/meta-xilinx-standalone-experimental/recipes-applications/lwip-tcp-perf-client/lwip-tcp-perf-client_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/lwip-tcp-perf-client/lwip-tcp-perf-client_git.bb index dd6501cf..eea50f60 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/lwip-tcp-perf-client/lwip-tcp-perf-client_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/lwip-tcp-perf-client/lwip-tcp-perf-client_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_apps/lwip_tcp_perf_client/src/" DEPENDS += "libxil lwip xiltimer" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } do_generate_app_data() { diff --git a/meta-xilinx-standalone-experimental/recipes-applications/lwip-tcp-perf-server/lwip-tcp-perf-server_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/lwip-tcp-perf-server/lwip-tcp-perf-server_git.bb index 1f7ae00c..fac6ace0 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/lwip-tcp-perf-server/lwip-tcp-perf-server_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/lwip-tcp-perf-server/lwip-tcp-perf-server_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_apps/lwip_tcp_perf_server/src/" DEPENDS += "libxil lwip xiltimer" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } do_generate_app_data() { diff --git a/meta-xilinx-standalone-experimental/recipes-applications/lwip-udp-perf-client/lwip-udp-perf-client_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/lwip-udp-perf-client/lwip-udp-perf-client_git.bb index 1b3105da..0c1b1f9b 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/lwip-udp-perf-client/lwip-udp-perf-client_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/lwip-udp-perf-client/lwip-udp-perf-client_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_apps/lwip_udp_perf_client/src/" DEPENDS += "libxil lwip xiltimer" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } do_generate_app_data() { diff --git a/meta-xilinx-standalone-experimental/recipes-applications/lwip-udp-perf-server/lwip-udp-perf-server_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/lwip-udp-perf-server/lwip-udp-perf-server_git.bb index be3d3d4b..8973ee60 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/lwip-udp-perf-server/lwip-udp-perf-server_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/lwip-udp-perf-server/lwip-udp-perf-server_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_apps/lwip_udp_perf_server/src/" DEPENDS += "libxil lwip xiltimer" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } do_generate_app_data() { diff --git a/meta-xilinx-standalone-experimental/recipes-applications/memory-tests/memory-tests_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/memory-tests/memory-tests_git.bb index 3e025962..f2af00f6 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/memory-tests/memory-tests_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/memory-tests/memory-tests_git.bb @@ -7,10 +7,12 @@ DEPENDS += "libxil xiltimer" inherit python3native do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} memtest install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } do_install() { diff --git a/meta-xilinx-standalone-experimental/recipes-applications/peripheral-tests/peripheral-tests_git.bb b/meta-xilinx-standalone-experimental/recipes-applications/peripheral-tests/peripheral-tests_git.bb index 61b60ad4..21422739 100644 --- a/meta-xilinx-standalone-experimental/recipes-applications/peripheral-tests/peripheral-tests_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-applications/peripheral-tests/peripheral-tests_git.bb @@ -7,10 +7,12 @@ DEPENDS += "libxil xiltimer" inherit python3native do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } python do_generate_app_data() { diff --git a/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/fsbl-firmware_git.bbappend b/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/fsbl-firmware_git.bbappend index 056ad990..43dcc106 100644 --- a/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/fsbl-firmware_git.bbappend +++ b/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/fsbl-firmware_git.bbappend @@ -8,6 +8,7 @@ inherit esw # Not compatible with Zynq COMPATIBLE_MACHINE:zynq = "none" +COMPATIBLE_MACHINE:microblaze = "none" ESW_COMPONENT_SRC = "/lib/sw_apps/undefined/src" ESW_COMPONENT_SRC:zynq = "/lib/sw_apps/zynq_fsbl/src" @@ -23,14 +24,31 @@ python() { psu_init_c = os.path.join(psu_init_path, 'psu_init.c') psu_init_h = os.path.join(psu_init_path, 'psu_init.h') + add_path = False if os.path.exists(psu_init_c): - d.appendVar('SRC_URI', ' file://%s' % psu_init_c) - else: - bb.warn("Unable to find %s, using default version" % psu_init_c) + d.appendVar('SRC_URI', ' file://psu_init.c') + add_path = True + if os.path.exists(psu_init_h): - d.appendVar('SRC_URI', ' file://%s' % psu_init_h) - else: - bb.warn("Unable to find %s, using default version" % psu_init_h) + d.appendVar('SRC_URI', ' file://psu_init.h') + add_path = True + + if add_path: + d.prependVar('FILESEXTRAPATHS', '%s:' % psu_init_path) +} + +do_configure:prepend() { + if [ -e ${WORKDIR}/psu_init.c ]; then + install -m 0644 ${WORKDIR}/psu_init.c ${S}/${ESW_COMPONENT_SRC} + else + bbwarn "Using the default psu_init.c, this may not work correctly." + fi + + if [ -e ${WORKDIR}/psu_init.h ]; then + install -m 0644 ${WORKDIR}/psu_init.h ${S}/${ESW_COMPONENT_SRC} + else + bbwarn "Using the default psu_init.h, this may not work correctly." + fi } do_install() { diff --git a/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/plm-firmware_git.bbappend b/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/plm-firmware_git.bbappend index 558e5fd9..8a72a184 100644 --- a/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/plm-firmware_git.bbappend +++ b/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/plm-firmware_git.bbappend @@ -18,4 +18,4 @@ do_install() { : } -DEPENDS += "xilstandalone xiltimer xilffs xilpdi xilplmi xilloader xilpm xilsecure xilsem" +DEPENDS += "xilstandalone xiltimer xilffs xilpdi xilplmi xilloader xilpm xilsecure xilsem xilnvm" diff --git a/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh b/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh index 4aba672d..fab16393 100755 --- a/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh +++ b/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh @@ -34,13 +34,15 @@ usage() { cat <<EOF $0 -c <config_dir> Location of the build conf directory - -s <system_dtb> Full path to system DTB - -d <domain_file> Full path to domain file (.yml/.dts) + -s <system_dtb> Path to system DTB + -d <domain_file> Path to domain file (.yml/.dts) [-o <overlay_dtb>] Generate overlay dts [-e <external_fpga>] Apply a partial overlay [-m <machine>] zynqmp or versal [-p <psu_init_path>] Path to psu_init files, defaults to system_dtb path + [-i <pdu_path>] Path to the pdi file [-l <config_file>] write local.conf changes to this file + [-P <petalinux_schema>] Path to petalinux schema file EOF exit @@ -49,7 +51,7 @@ EOF parse_args() { [ $# -eq 0 ] && usage - while getopts ":c:s:d:o:e:m:l:h" opt; do + while getopts ":c:s:d:o:e:m:l:hP:p:i:" opt; do case ${opt} in c) config_dir=$OPTARG ;; s) system_dtb=$OPTARG ;; @@ -58,18 +60,32 @@ parse_args() { e) external_fpga=$OPTARG ;; m) machine=$OPTARG ;; p) psu_init_path=$OPTARG ;; + i) pdi_path=$OPTARG ;; l) localconf=$OPTARG ;; + P) petalinux_schema=$OPTARG ;; h) usage ;; :) error "Missing argument for -$OPTARG" ;; - \?) error "Invalid option -$OPTARG" + \?) error "Invalid option -$OPTARG" ;; esac done [ -f "${config_dir}/local.conf" ] || error "Invalid config dir: ${config_dir}" [ -f "${system_dtb}" ] || error "Unable to find: ${system_dtb}" + system_dtb=$(realpath ${system_dtb}) if [ -z "$psu_init_path" ]; then psu_init_path=$(dirname ${system_dtb}) + else + psu_init_path=$(realpath ${psu_init_path}) + fi + if [ -z "$pdi_path" ]; then + pdi_path=$(dirname ${system_dtb}) + else + pdi_path=$(realpath ${pdi_path}) fi + if [ -n "$domain_file" ]; then + domain_file=$(realpath ${domain_file}) + fi + } detect_machine() { @@ -100,10 +116,12 @@ cortex_a53_linux() { if [ "$1" = "None" ]; then dtb_file="cortexa53-${machine}-linux.dtb" + dts_file="cortexa53-${machine}-linux.dts" system_conf=conf/cortexa53-${machine}-linux.conf conf_file=cortexa53-${machine}-linux.conf else dtb_file="cortexa53-${machine}-$1-linux.dtb" + dts_file="cortexa53-${machine}-$1-linux.dts" multiconf="${multiconf} cortexa53-${machine}-linux" conf_file=multiconfig/cortexa53-${machine}-$1-linux.conf fi @@ -121,13 +139,28 @@ cortex_a53_linux() { fi dtc -q -O dtb -o pl.dtbo -b 0 -@ pl.dtsi || error "dtc failed" elif [ -n "${domain_file}" ]; then - LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --permissive --enhanced -x '*.yaml' \ + LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-a53-imux.dts" \ - -i "${lops_dir}/lop-domain-linux-a53.dts" "${system_dtb}" "${dtb_file}" \ + -i "${lops_dir}/lop-domain-linux-a53.dts" \ + -i "${lops_dir}/lop-domain-linux-a53-prune.dts" \ + "${system_dtb}" "${dtb_file}" \ + || error "lopper failed" + LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ + -i "${domain_file}" -i "${lops_dir}/lop-a53-imux.dts" \ + -i "${lops_dir}/lop-domain-linux-a53.dts" \ + -i "${lops_dir}/lop-domain-linux-a53-prune.dts" \ + "${system_dtb}" "${dts_file}" \ || error "lopper failed" else LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-a53-imux.dts" \ - -i "${lops_dir}/lop-domain-linux-a53.dts" "${system_dtb}" "${dtb_file}" \ + -i "${lops_dir}/lop-domain-linux-a53.dts" \ + -i "${lops_dir}/lop-domain-linux-a53-prune.dts" \ + "${system_dtb}" "${dtb_file}" \ + || error "lopper failed" + LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-a53-imux.dts" \ + -i "${lops_dir}/lop-domain-linux-a53.dts" \ + -i "${lops_dir}/lop-domain-linux-a53-prune.dts" \ + "${system_dtb}" "${dts_file}" \ || error "lopper failed" fi rm -f pl.dtsi lop-a53-imux.dts.dtb lop-domain-linux-a53.dts.dtb @@ -135,6 +168,8 @@ cortex_a53_linux() { cat <<EOF >"${conf_file}" CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" +CONFIG_DTFILE[vardepsexclude] += "TOPDIR" + MACHINE = "${machine}-generic" # We don't want the kernel to build us a device-tree KERNEL_DEVICETREE:${machine}-generic = "" @@ -177,7 +212,7 @@ cortex_a53_baremetal() { ( cd dtb || error "Unable to cd to dtb dir" if [ -n "${domain_file}" ]; then - LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --permissive --enhanced -x '*.yaml' \ + LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-a53-imux.dts" "${system_dtb}" "${dtb_file}" \ || error "lopper failed" else @@ -189,7 +224,7 @@ cortex_a53_baremetal() { # Build baremetal multiconfig if [ -n "${domain_file}" ]; then - ${lopper} -f --permissive --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ + ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ -- baremetaldrvlist_xlnx cortexa53-${machine} "${embeddedsw}" \ || error "lopper failed" else @@ -216,6 +251,8 @@ EOF fi cat <<EOF >>"${conf_file}" CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" +CONFIG_DTFILE[vardepsexclude] += "TOPDIR" + ESW_MACHINE = "cortexa53-${machine}" DEFAULTTUNE = "cortexa53" @@ -248,7 +285,7 @@ cortex_a53_freertos() { ( cd dtb || error "Unable to cd to dtb dir" if [ -n "${domain_file}" ]; then - LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --permissive --enhanced -x '*.yaml' \ + LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-a53-imux.dts" "${system_dtb}" "${dtb_file}" \ || error "lopper failed" else @@ -260,7 +297,7 @@ cortex_a53_freertos() { # Build baremetal multiconfig if [ -n "${domain_file}" ]; then - ${lopper} -f --permissive --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ + ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ -- baremetaldrvlist_xlnx cortexa53-${machine} "${embeddedsw}" || error "lopper failed" else ${lopper} -f "${system_dtb}" -- baremetaldrvlist_xlnx cortexa53-${machine} "${embeddedsw}" \ @@ -272,6 +309,8 @@ cortex_a53_freertos() { cat <<EOF >"${conf_file}" CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" +CONFIG_DTFILE[vardepsexclude] += "TOPDIR" + ESW_MACHINE = "cortexa53-${machine}" DEFAULTTUNE = "cortexa53" @@ -291,12 +330,23 @@ EOF cortex_a72_linux() { info "cortex-a72 for Linux [ $1 ]" + # Find the first file ending in .pdi + full_pdi_path=$(ls ${pdi_path}/*.pdi 2>/dev/null | head -n 1) + if [ -z "${full_pdi_path}" ]; then + warn "Warning: Unable to find a pdi file in ${pdi_path}" + full_pdi_path="__PATH TO PDI FILE HERE__" + elif [ "${full_pdi_path}" != "$(ls ${pdi_path}/*.pdi 2>/dev/null)" ]; then + warn "Warning: multiple PDI files found, using first found $(basename ${full_pdi_path})." + fi + if [ "$1" = "None" ]; then dtb_file="cortexa72-${machine}-linux.dtb" + dts_file="cortexa72-${machine}-linux.dts" system_conf=conf/cortexa72-${machine}-linux.conf conf_file=cortexa72-${machine}-linux.conf else dtb_file="cortexa72-${machine}-$1-linux.dtb" + dts_file="cortexa72-${machine}-$1-linux.dts" multiconf="${multiconf} cortexa72-${machine}-linux" conf_file=multiconfig/cortexa72-${machine}-$1-linux.conf fi @@ -317,19 +367,35 @@ cortex_a72_linux() { fi dtc -q -O dtb -o pl.dtbo -b 0 -@ pl.dtsi || error "dtc failed" elif [ -n "${domain_file}" ]; then - LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --permissive --enhanced -x '*.yaml' \ + LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ + -i "${domain_file}" -i "${lops_dir}/lop-a72-imux.dts" \ + -i "${lops_dir}/lop-domain-a72.dts" \ + -i "${lops_dir}/lop-domain-a72-prune.dts" \ + "${system_dtb}" "${dtb_file}" \ + || error "lopper failed" + LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-a72-imux.dts" \ - -i "${lops_dir}/lop-domain-a72.dts" "${system_dtb}" "${dtb_file}" \ + -i "${lops_dir}/lop-domain-a72.dts" \ + -i "${lops_dir}/lop-domain-a72-prune.dts" \ + "${system_dtb}" "${dts_file}" \ || error "lopper failed" else LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-a72-imux.dts" \ - -i "${lops_dir}/lop-domain-a72.dts" "${system_dtb}" "${dtb_file}" || error "lopper failed" + -i "${lops_dir}/lop-domain-a72.dts" \ + -i "${lops_dir}/lop-domain-a72-prune.dts" \ + "${system_dtb}" "${dtb_file}" || error "lopper failed" + LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -i "${lops_dir}/lop-a72-imux.dts" \ + -i "${lops_dir}/lop-domain-a72.dts" \ + -i "${lops_dir}/lop-domain-a72-prune.dts" \ + "${system_dtb}" "${dts_file}" || error "lopper failed" fi rm -f pl.dtsi lop-a72-imux.dts.dtb lop-domain-a72.dts.dtb ) cat <<EOF >"${conf_file}" CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" +CONFIG_DTFILE[vardepsexclude] += "TOPDIR" + MACHINE = "${machine}-generic" # We don't want the kernel to build us a device-tree KERNEL_DEVICETREE:${machine}-generic = "" @@ -358,7 +424,7 @@ cortex_a72_baremetal() { ( cd dtb || error "Unable to cd to dtb dir" if [ -n "${domain_file}" ]; then - LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --permissive --enhanced -x '*.yaml' \ + LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-a72-imux.dts" "${system_dtb}" "${dtb_file}" \ || error "lopper failed" else @@ -370,7 +436,7 @@ cortex_a72_baremetal() { # Build baremetal multiconfig if [ -n "${domain_file}" ]; then - ${lopper} -f --permissive --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ + ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ -- baremetaldrvlist_xlnx cortexa72-${machine} "${embeddedsw}" || error "lopper failed" else ${lopper} -f "${system_dtb}" -- baremetaldrvlist_xlnx cortexa72-${machine} "${embeddedsw}" \ @@ -382,6 +448,8 @@ cortex_a72_baremetal() { cat <<EOF >"${conf_file}" CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" +CONFIG_DTFILE[vardepsexclude] += "TOPDIR" + ESW_MACHINE = "cortexa72-${machine}" DEFAULTTUNE = "cortexa72" @@ -414,7 +482,7 @@ cortex_a72_freertos() { ( cd dtb || error "Unable to cd to dtb dir" if [ -n "${domain_file}" ]; then - LOPPER_DTC_FLAGS="-b 0 -@" lopper -f --permissive --enhanced -x '*.yaml' \ + LOPPER_DTC_FLAGS="-b 0 -@" lopper -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-a72-imux.dts" "${system_dtb}" "${dtb_file}" \ || error "lopper failed" else @@ -426,7 +494,7 @@ cortex_a72_freertos() { # Build baremetal multiconfig if [ -n "${domain_file}" ]; then - ${lopper} -f --permissive --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ + ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ -- baremetaldrvlist_xlnx cortexa72-${machine} "${embeddedsw}" || error "lopper failed" else ${lopper} -f "${system_dtb}" -- baremetaldrvlist_xlnx cortexa72-${machine} "${embeddedsw}" \ @@ -438,6 +506,8 @@ cortex_a72_freertos() { cat <<EOF >"${conf_file}" CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" +CONFIG_DTFILE[vardepsexclude] += "TOPDIR" + ESW_MACHINE = "cortexa72-${machine}" DEFAULTTUNE = "cortexa72" @@ -485,7 +555,7 @@ cortex_r5_baremetal() { ( cd dtb || error "Unable to cd to dtb dir" if [ -n "$domain_file" ]; then - LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --permissive --enhanced -x '*.yaml' \ + LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-r5-imux.dts" "${system_dtb}" "${dtb_file}" \ || error "lopper failed" else @@ -497,7 +567,7 @@ cortex_r5_baremetal() { # Build baremetal multiconfig if [ -n "${domain_file}" ]; then - ${lopper} -f --permissive --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ + ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ -- baremetaldrvlist_xlnx cortexr5-${machine} "${embeddedsw}" || error "lopper failed" else ${lopper} -f "${system_dtb}" -- baremetaldrvlist_xlnx cortexr5-${machine} "${embeddedsw}" \ @@ -523,6 +593,8 @@ EOF fi cat <<EOF >>"${conf_file}" CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" +CONFIG_DTFILE[vardepsexclude] += "TOPDIR" + ESW_MACHINE = "cortexr5-${machine}" DEFAULTTUNE = "cortexr5" @@ -555,7 +627,7 @@ cortex_r5_freertos() { ( cd dtb || error "Unable to cd to dtb dir" if [ -n "$domain_file" ]; then - LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --permissive --enhanced -x '*.yaml' \ + LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} -f --enhanced -x '*.yaml' \ -i "${domain_file}" -i "${lops_dir}/lop-r5-imux.dts" "${system_dtb}" "${dtb_file}" \ || error "lopper failed" else @@ -567,7 +639,7 @@ cortex_r5_freertos() { # Build baremetal multiconfig if [ -n "${domain_file}" ]; then - ${lopper} -f --permissive --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ + ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ -- baremetaldrvlist_xlnx cortexr5-${machine} "${embeddedsw}" || error "lopper failed" else ${lopper} -f "${system_dtb}" -- baremetaldrvlist_xlnx cortexr5-${machine} "${embeddedsw}" \ @@ -579,6 +651,8 @@ cortex_r5_freertos() { cat <<EOF >"${conf_file}" CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" +CONFIG_DTFILE[vardepsexclude] += "TOPDIR" + ESW_MACHINE = "cortexr5-${machine}" DEFAULTTUNE = "cortexr5" @@ -635,7 +709,7 @@ pmu-microblaze() { # Build baremetal multiconfig if [ -n "${domain_file}" ]; then - ${lopper} -f --permissive --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ + ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ -- baremetaldrvlist_xlnx microblaze-pmu "${embeddedsw}" || error "lopper failed" else ${lopper} -f "${system_dtb}" -- baremetaldrvlist_xlnx microblaze-pmu "${embeddedsw}" \ @@ -647,6 +721,8 @@ pmu-microblaze() { cat <<EOF >"${conf_file}" CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" +CONFIG_DTFILE[vardepsexclude] += "TOPDIR" + ESW_MACHINE = "microblaze-pmu" require conf/microblaze.conf @@ -691,7 +767,7 @@ pmc-microblaze() { # Build baremetal multiconfig if [ -n "${domain_file}" ]; then - ${lopper} -f --permissive --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ + ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ -- baremetaldrvlist_xlnx microblaze-plm "${embeddedsw}" || error "lopper failed" else ${lopper} -f "${system_dtb}" -- baremetaldrvlist_xlnx microblaze-plm "${embeddedsw}" \ @@ -703,6 +779,8 @@ pmc-microblaze() { cat <<EOF >"${conf_file}" CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" +CONFIG_DTFILE[vardepsexclude] += "TOPDIR" + ESW_MACHINE = "microblaze-plm" require conf/microblaze.conf @@ -747,7 +825,7 @@ psm-microblaze() { # Build baremetal multiconfig if [ -n "${domain_file}" ]; then - ${lopper} -f --permissive --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ + ${lopper} -f --enhanced -x '*.yaml' -i "${domain_file}" "${system_dtb}" \ -- baremetaldrvlist_xlnx microblaze-psm "${embeddedsw}" || error "lopper failed" else ${lopper} -f "${system_dtb}" -- baremetaldrvlist_xlnx microblaze-psm "${embeddedsw}" \ @@ -759,6 +837,8 @@ psm-microblaze() { cat <<EOF >"${conf_file}" CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" +CONFIG_DTFILE[vardepsexclude] += "TOPDIR" + ESW_MACHINE = "microblaze-psm" require conf/microblaze.conf @@ -883,7 +963,7 @@ parse_cpus() { gen_local_conf() { echo "# Adjust BASE_TMPDIR if you want to move the tmpdirs elsewhere" >> $1 - echo "BASE_TMPDIR = \"\${TOPDIR}\"" >> $1 + echo "BASE_TMPDIR ?= \"\${TOPDIR}\"" >> $1 [ -n "${system_conf}" ] && echo "require ${system_conf}" >> $1 echo "SYSTEM_DTFILE = \"${system_dtb}\"" >> $1 echo "BBMULTICONFIG += \"${multiconf}\"" >> $1 @@ -912,10 +992,17 @@ gen_local_conf() { echo "PSM_MCDEPENDS = \"${psm_mcdepends}\"" >> $1 echo "PSM_FIRMWARE_DEPLOY_DIR = \"${psm_firmware_deploy_dir}\"" >> $1 fi - [ "${machine}" = "versal" ] && echo "PDI_PATH = \"__PATH TO PDI FILE HERE__\"" >> $1 + [ "${machine}" = "versal" ] && echo "PDI_PATH = \"${full_pdi_path}\"" >> $1 echo } +gen_petalinux_conf() { + cd "${config_dir}" || exit + ( + LOPPER_DTC_FLAGS="-b 0 -@" ${lopper} "${system_dtb}" -- petalinuxconfig_xlnx ${petalinux_schema} \ + || error "lopper failed" + ) +} parse_args "$@" lopper=$(command -v lopper) @@ -960,5 +1047,12 @@ else gen_local_conf ${localconf} fi +if [ -n "${petalinux_schema}" ]; then + echo + echo "Generating petalinux config file:" + echo + gen_petalinux_conf +fi + # Cleanup our temp file rm ${cpulist} diff --git a/meta-xilinx-standalone-experimental/recipes-drivers/bram-example_git.bb b/meta-xilinx-standalone-experimental/recipes-drivers/bram-example_git.bb new file mode 100644 index 00000000..6e2c4918 --- /dev/null +++ b/meta-xilinx-standalone-experimental/recipes-drivers/bram-example_git.bb @@ -0,0 +1,5 @@ +inherit esw_examples features_check + +REQUIRED_DISTRO_FEATURES = "bram" + +ESW_COMPONENT_SRC = "/XilinxProcessorIPLib/drivers/bram/examples/" diff --git a/meta-xilinx-standalone-experimental/recipes-drivers/clockps-example_git.bb b/meta-xilinx-standalone-experimental/recipes-drivers/clockps-example_git.bb index 0bc67b11..67fb695e 100644 --- a/meta-xilinx-standalone-experimental/recipes-drivers/clockps-example_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-drivers/clockps-example_git.bb @@ -9,10 +9,12 @@ DEPENDS += "libxil xiltimer resetps" inherit python3native do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } CLOCKPS_EX_IMAGE_NAME ??= "${BPN}" @@ -31,8 +33,8 @@ do_install() { } do_deploy() { - install -d ${DEPLOYDIR}/${MACHINE}-${BPN}/ - install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${MACHINE}-${BPN}/ + install -d ${DEPLOYDIR}/${BPN}/ + install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${BPN}/ } addtask deploy before do_build after do_package diff --git a/meta-xilinx-standalone-experimental/recipes-drivers/sysmonpsv_git.bb b/meta-xilinx-standalone-experimental/recipes-drivers/sysmonpsv_git.bb index 92c634a4..06b82811 100644 --- a/meta-xilinx-standalone-experimental/recipes-drivers/sysmonpsv_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-drivers/sysmonpsv_git.bb @@ -4,7 +4,7 @@ REQUIRED_DISTRO_FEATURES = "sysmonpsv" inherit esw python3native -DEPENDS += "xilstandalone " +DEPENDS += "xilstandalone ${@'scugic' if d.getVar('ESW_MACHINE') != 'microblaze-plm' and d.getVar('ESW_MACHINE') != 'microblaze-psm' else ''}" ESW_COMPONENT_SRC = "/XilinxProcessorIPLib/drivers/sysmonpsv/src/" ESW_COMPONENT_NAME = "libsysmonpsv.a" diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/freertos10-xilinx_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/freertos10-xilinx_git.bb index 46c349bc..22d7955e 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/freertos10-xilinx_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/freertos10-xilinx_git.bb @@ -7,7 +7,9 @@ DEPENDS += "libxil xilstandalone xiltimer" do_configure:prepend() { # This script should also not rely on relative paths and such + ( cd ${S} lopper ${DTS_FILE} -- bmcmake_metadata_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} hwcmake_metadata ${S} install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/libxil_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/libxil_git.bb index 4adfe46e..75c54837 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/libxil_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/libxil_git.bb @@ -9,7 +9,7 @@ ESW_COMPONENT_NAME = "libxil.a" DEPENDS += "xilstandalone " REQUIRED_DISTRO_FEATURES = "${DISTRO_FEATURES}" -PACKAGECONFIG ?= "${DISTRO_FEATURES} ${MACHINE_FEATURES}" +PACKAGECONFIG ?= "${DISTRO_FEATURES}" do_configure:prepend() { LOPPER_DTC_FLAGS="-b 0 -@" lopper ${DTS_FILE} -- baremetal_xparameters_xlnx.py ${ESW_MACHINE} ${S} diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/lwip_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/lwip_git.bb index 09bf4192..bced1499 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/lwip_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/lwip_git.bb @@ -15,10 +15,12 @@ EXTRA_OECMAKE:append:xilinx-freertos += "-Dlwip_api_mode=SOCKET_API" do_configure:prepend() { # This script should also not rely on relative paths and such + ( cd ${S} lopper ${DTS_FILE} -- bmcmake_metadata_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} hwcmake_metadata ${S} install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 xtopology_g.c ${S}/${ESW_COMPONENT_SRC}/ + ) } do_install() { diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/xilffs-example_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/xilffs-example_git.bb index d5c90bba..bb976377 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/xilffs-example_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/xilffs-example_git.bb @@ -1,14 +1,19 @@ inherit esw deploy +# Requires by dependency xilffs +REQUIRED_DISTRO_FEATURES = "sdps" + ESW_COMPONENT_SRC = "/lib/sw_services/xilffs/examples/" DEPENDS += "xilffs xiltimer" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } ESW_CUSTOM_LINKER_FILE ?= "None" @@ -20,8 +25,8 @@ do_install() { } do_deploy() { - install -d ${DEPLOYDIR}/${MACHINE}-${BPN}/ - install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${MACHINE}-${BPN}/ + install -d ${DEPLOYDIR}/${BPN}/ + install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${BPN}/ } addtask deploy before do_build after do_package diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/xilffs_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/xilffs_git.bb index 0649d3d8..8792fdbd 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/xilffs_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/xilffs_git.bb @@ -5,7 +5,7 @@ REQUIRED_DISTRO_FEATURES = "sdps" ESW_COMPONENT_SRC = "/lib/sw_services/xilffs/src/" ESW_COMPONENT_NAME = "libxilffs.a" -PACKAGECONFIG ??= "read_only" +PACKAGECONFIG ??= "read_only word_access" PACKAGECONFIG[use_mkfs] ="-DXILFFS_use_mkfs=ON,-DXILFFS_use_mkfs=OFF,," PACKAGECONFIG[read_only] ="-DXILFFS_read_only=ON,-DXILFFS_read_only=OFF,," PACKAGECONFIG[word_access]="-DXILFFS_word_access=ON,-DXILFFS_word_access=OFF,," diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/xilfpga-example_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/xilfpga-example_git.bb index e1af36e0..df5c1bbe 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/xilfpga-example_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/xilfpga-example_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_services/xilfpga/examples/" DEPENDS += "xilfpga" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } ESW_CUSTOM_LINKER_FILE ?= "None" @@ -20,8 +22,8 @@ do_install() { } do_deploy() { - install -d ${DEPLOYDIR}/${MACHINE}-${BPN}/ - install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${MACHINE}-${BPN}/ + install -d ${DEPLOYDIR}/${BPN}/ + install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${BPN}/ } addtask deploy before do_build after do_package diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/xilmailbox-example_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/xilmailbox-example_git.bb index 0fb74a63..1e457d18 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/xilmailbox-example_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/xilmailbox-example_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_services/xilmailbox/examples/" DEPENDS += "xilmailbox" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } ESW_CUSTOM_LINKER_FILE ?= "None" @@ -29,8 +31,8 @@ do_install() { } do_deploy() { - install -d ${DEPLOYDIR}/${MACHINE}-${BPN}/ - install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${MACHINE}-${BPN}/ + install -d ${DEPLOYDIR}/${BPN}/ + install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${BPN}/ } addtask deploy before do_build after do_package diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/xilnvm-example_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/xilnvm-example_git.bb index 7a931ed4..a656e7ec 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/xilnvm-example_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/xilnvm-example_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_services/xilnvm/examples/" DEPENDS += "xilnvm" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } ESW_CUSTOM_LINKER_FILE ?= "None" @@ -20,8 +22,8 @@ do_install() { } do_deploy() { - install -d ${DEPLOYDIR}/${MACHINE}-${BPN}/ - install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${MACHINE}-${BPN}/ + install -d ${DEPLOYDIR}/${BPN}/ + install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${BPN}/ } addtask deploy before do_build after do_package diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/xilnvm_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/xilnvm_git.bb index cd73f69f..9114aa72 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/xilnvm_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/xilnvm_git.bb @@ -3,4 +3,4 @@ inherit esw ESW_COMPONENT_SRC = "/lib/sw_services/xilnvm/src/" ESW_COMPONENT_NAME = "libxilnvm.a" -DEPENDS += "libxil xiltimer" +DEPENDS += "libxil xiltimer xilplmi" diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/xilpuf-example_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/xilpuf-example_git.bb index 64f49d71..ad2d5c47 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/xilpuf-example_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/xilpuf-example_git.bb @@ -2,13 +2,15 @@ inherit esw deploy ESW_COMPONENT_SRC = "/lib/sw_services/xilpuf/examples/" -DEPENDS += "xilpuf" +DEPENDS += "xilpuf xilsecure" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } ESW_CUSTOM_LINKER_FILE ?= "None" @@ -20,8 +22,8 @@ do_install() { } do_deploy() { - install -d ${DEPLOYDIR}/${MACHINE}-${BPN}/ - install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${MACHINE}-${BPN}/ + install -d ${DEPLOYDIR}/${BPN}/ + install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${BPN}/ } addtask deploy before do_build after do_package diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/xilpuf_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/xilpuf_git.bb index d6d3550c..266503d1 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/xilpuf_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/xilpuf_git.bb @@ -3,4 +3,4 @@ inherit esw ESW_COMPONENT_SRC = "/lib/sw_services/xilpuf/src/" ESW_COMPONENT_NAME = "libxilpuf.a" -DEPENDS += "libxil xiltimer" +DEPENDS += "libxil xiltimer ${@'xilplmi' if d.getVar('ESW_MACHINE') == 'microblaze-plm' else 'xilmailbox'}" diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/xilsecure-example_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/xilsecure-example_git.bb index 3c424215..2267571f 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/xilsecure-example_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/xilsecure-example_git.bb @@ -5,10 +5,12 @@ ESW_COMPONENT_SRC = "/lib/sw_services/xilsecure/examples/" DEPENDS += "xilsecure" do_configure:prepend() { + ( cd ${S} lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 memory.ld ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } ESW_CUSTOM_LINKER_FILE ?= "None" @@ -20,8 +22,8 @@ do_install() { } do_deploy() { - install -d ${DEPLOYDIR}/${MACHINE}-${BPN}/ - install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${MACHINE}-${BPN}/ + install -d ${DEPLOYDIR}/${BPN}/ + install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/*.elf ${DEPLOYDIR}/${BPN}/ } addtask deploy before do_build after do_package diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/xilsecure_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/xilsecure_git.bb index 8ccbb623..b8e2aa16 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/xilsecure_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/xilsecure_git.bb @@ -3,4 +3,4 @@ inherit esw ESW_COMPONENT_SRC = "/lib/sw_services/xilsecure/src/" ESW_COMPONENT_NAME = "libxilsecure.a" -DEPENDS += "libxil xiltimer ${@'xilplmi' if d.getVar('ESW_MACHINE') == 'microblaze-plm' else ''}" +DEPENDS += "libxil xiltimer ${@'xilplmi' if d.getVar('ESW_MACHINE') == 'microblaze-plm' else 'xilmailbox'}" diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/xilstandalone_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/xilstandalone_git.bb index 447c3cc3..70a46c5e 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/xilstandalone_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/xilstandalone_git.bb @@ -7,8 +7,10 @@ DEPENDS += "libgloss" do_configure:prepend() { # This script should also not rely on relative paths and such + ( cd ${S} lopper ${DTS_FILE} -- baremetal_bspconfig_xlnx ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} install -m 0755 MemConfig.cmake ${S}/${ESW_COMPONENT_SRC}/ install -m 0755 *.c ${S}/${ESW_COMPONENT_SRC}/common/ + ) } diff --git a/meta-xilinx-standalone-experimental/recipes-libraries/xiltimer_git.bb b/meta-xilinx-standalone-experimental/recipes-libraries/xiltimer_git.bb index 0e25bbb7..dd19671d 100644 --- a/meta-xilinx-standalone-experimental/recipes-libraries/xiltimer_git.bb +++ b/meta-xilinx-standalone-experimental/recipes-libraries/xiltimer_git.bb @@ -7,7 +7,9 @@ DEPENDS += "libxil" do_configure:prepend() { # This script should also not rely on relative paths and such + ( cd ${S} lopper ${DTS_FILE} -- bmcmake_metadata_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC} hwcmake_metadata ${S} install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/ + ) } diff --git a/meta-xilinx-standalone/README.md b/meta-xilinx-standalone/README.md index a3514230..ea9fdbc4 100644 --- a/meta-xilinx-standalone/README.md +++ b/meta-xilinx-standalone/README.md @@ -1,5 +1,4 @@ -meta-xilinx-standalone -====================== +# meta-xilinx-standalone This layer is meant to augment Yocto/OE functionality to provide a Baremetal/Standalone Toolchain as well as a generic version of various @@ -8,15 +7,14 @@ firmware that is required to boot a ZynqMP or Versal system. For optimized versions of the firmware and additional components you must use the meta-xilinx-tools layer. -Building --------- +## Building + The software in this layer may be used in either a standard single configuration build, or a multiconfig build. A multiconfig build, along with the MACHINES defined in meta-xilinx-bsps will automate the generation of certain firmwares. -Toolchains ----------- +## Toolchains To build standalone toolchains similar to those embedded with the Xilinx xsct tooling: @@ -29,8 +27,7 @@ Use one of the custom machines: MACHINE=<machine> DISTRO=xilinx-standalone bitbake meta-toolchain -Standalone Firmware -------------------- +## Standalone Firmware The standalone firmware is a genericly configured firmware, it can be build either in a single standalong configuration, or via an automated @@ -89,25 +86,17 @@ MACHINE=zynqmp-generic bitbake fsbl pmufw MACHINE=versal-generic bitbake plmfw psmfw -Maintainers, Mailing list, Patches -================================== - -Please send any patches, pull requests, comments or questions for this -layer to the [meta-xilinx mailing list] -(https://lists.yoctoproject.org/listinfo/meta-xilinx): - - meta-xilinx@lists.yoctoproject.org +## Dependencies -Maintainers: - - Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> - Mark Hatle <mark.hatle@xilinx.com> +This layer depends on: -Dependencies -============ + URI: git://git.openembedded.org/bitbake -This layer depends on: + URI: git://git.openembedded.org/openembedded-core + layers: meta + branch: master or xilinx current release version (e.g. hosister) - URI: git://git.yoctoproject.org/poky + URI: git://git.yoctoproject.org/meta-xilinx.git + layers: meta-xilinx-microblaze, meta-xilinx-core, meta-xilinx-bsp + branch: master or xilinx current release version (e.g. hosister) - URI: git://git.yoctoproject.org/meta-xilinx/meta-xilinx-bsp diff --git a/meta-xilinx-standalone/classes/xlnx-embeddedsw.bbclass b/meta-xilinx-standalone/classes/xlnx-embeddedsw.bbclass index 1c2b6819..13837a3e 100644 --- a/meta-xilinx-standalone/classes/xlnx-embeddedsw.bbclass +++ b/meta-xilinx-standalone/classes/xlnx-embeddedsw.bbclass @@ -3,38 +3,21 @@ ESW_VER ?= "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or 'master' REPO ??= "git://github.com/Xilinx/embeddedsw.git;protocol=https" -ESW_BRANCH[2019.1] = "release-2019.1" -ESW_BRANCH[2019.2] = "release-2019.2" -ESW_BRANCH[2020.1] = "release-2020.1" -ESW_BRANCH[2020.2] = "master-rel-2020.2" -ESW_BRANCH[2021.1] = "xlnx_rel_v2021.1" -ESW_BRANCH[2021.2] = "xlnx_rel_v2021.2" -ESW_BRANCH[2022.1] = "xlnx_rel_v2022.1" -ESW_BRANCH[git] = "xlnx_rel_v2022.1" +ESW_BRANCH[2022.1] = "xlnx_rel_v2022.1_update" +ESW_BRANCH[2022.2] = "xlnx_rel_v2022.2" BRANCH ??= "${@d.getVarFlag('ESW_BRANCH', d.getVar('ESW_VER')) or '${ESW_VER}'}" -ESW_REV[2019.1] = "26c14d9861010a0e3a55c73fb79efdb816eb42ca" -ESW_REV[2019.2] = "e8db5fb118229fdc621e0ec7848641a23bf60998" -ESW_REV[2020.1] = "338150ab3628a1ea6b06e964b16e712b131882dd" -ESW_REV[2020.2] = "2516d5ed8161e16c2813b0e8e4ceac693f23de5c" -ESW_REV[2021.1] = "d37a0e8824182597abf31ac3f1087a5321b33ad7" -ESW_REV[2021.2] = "49c6694fc3cab6b87dd564da58a83bb8656a7c03" -ESW_REV[2022.1] = "b3d8b420b421730ea505da55b42174dc90f885c1" -ESW_REV[git] = "b3d8b420b421730ea505da55b42174dc90f885c1" +ESW_REV[2022.1] = "56d94a506fd9f80949f4cff08e13015928603f01" +ESW_REV[2022.2] = "5330a64c8efd14f0eef09befdbb8d3d738c33ec2" SRCREV ??= "${@d.getVarFlag('ESW_REV', d.getVar('ESW_VER')) or '${AUTOREV}'}" EMBEDDEDSW_BRANCHARG ?= "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH') != '']}" EMBEDDEDSW_SRCURI ?= "${REPO};${EMBEDDEDSW_BRANCHARG}" LICENSE = "MIT" -LIC_FILES_CHKSUM[release-2019.1] = 'e9b6d01d45faccfbf05d8caea53f0a35' -LIC_FILES_CHKSUM[release-2019.2] = '39ab6ab638f4d1836ba994ec6852de94' -LIC_FILES_CHKSUM[release-2020.1] = '8b565227e1264d677db8f841c2948cba' -LIC_FILES_CHKSUM[master-rel-2020.2] = '3a6e22aebf6516f0f74a82e1183f74f8' -LIC_FILES_CHKSUM[xlnx_rel_v2021.1] = "73e8997d53c2137fdeea4331a73f40fa" -LIC_FILES_CHKSUM[xlnx_rel_v2021.2] = 'ba23909a4bcaf754a2e1ba996f1ca1b0' -LIC_FILES_CHKSUM[xlnx_rel_v2022.1] = 'e62cb7a722c4430999e0a55a7234035d' +LIC_FILES_CHKSUM[xlnx_rel_v2022.1_update] = 'e62cb7a722c4430999e0a55a7234035d' +LIC_FILES_CHKSUM[xlnx_rel_v2022.2] = 'ce611484168a6000bd35df68fc4f4290' LIC_FILES_CHKSUM ??= "file://license.txt;md5=${@d.getVarFlag('LIC_FILES_CHKSUM', d.getVar('BRANCH')) or '0'}" SRC_URI = "${EMBEDDEDSW_SRCURI}" -PV = "${ESW_VER}+git${SRCPV}" +PV .= "+git${SRCPV}" diff --git a/meta-xilinx-standalone/conf/layer.conf b/meta-xilinx-standalone/conf/layer.conf index f7ebaca4..492dda6f 100644 --- a/meta-xilinx-standalone/conf/layer.conf +++ b/meta-xilinx-standalone/conf/layer.conf @@ -16,4 +16,9 @@ LAYERDEPENDS_xilinx-standalone = "core xilinx" LAYERRECOMMENDS_xilinx-standalone = "xilinx-microblaze" LAYERSERIES_COMPAT_xilinx-standalone = "honister" -XILINX_RELEASE_VERSION = "v2022.1" + +PREFERRED_VERSION_plm-firmware ?= "${@d.getVar("XILINX_RELEASE_VERSION").replace('v','')}%" +PREFERRED_VERSION_psm-firmware ?= "${@d.getVar("XILINX_RELEASE_VERSION").replace('v','')}%" +PREFERRED_VERSION_pmu-firmware ?= "${@d.getVar("XILINX_RELEASE_VERSION").replace('v','')}%" +PREFERRED_VERSION_fsbl-firmware ?= "${@d.getVar("XILINX_RELEASE_VERSION").replace('v','')}%" + diff --git a/meta-xilinx-standalone/recipes-bsp/embeddedsw/fsbl-firmware_2021.2.bb b/meta-xilinx-standalone/recipes-bsp/embeddedsw/fsbl-firmware_2022.2.bb index 3f9740a0..3f9740a0 100644 --- a/meta-xilinx-standalone/recipes-bsp/embeddedsw/fsbl-firmware_2021.2.bb +++ b/meta-xilinx-standalone/recipes-bsp/embeddedsw/fsbl-firmware_2022.2.bb diff --git a/meta-xilinx-standalone/recipes-bsp/embeddedsw/plm-firmware_2020.1.bb b/meta-xilinx-standalone/recipes-bsp/embeddedsw/plm-firmware_2020.1.bb deleted file mode 100644 index 782c9dc4..00000000 --- a/meta-xilinx-standalone/recipes-bsp/embeddedsw/plm-firmware_2020.1.bb +++ /dev/null @@ -1 +0,0 @@ -require plm-firmware.inc diff --git a/meta-xilinx-standalone/recipes-bsp/embeddedsw/plm-firmware_2021.2.bb b/meta-xilinx-standalone/recipes-bsp/embeddedsw/plm-firmware_2022.2.bb index cc810241..cc810241 100644 --- a/meta-xilinx-standalone/recipes-bsp/embeddedsw/plm-firmware_2021.2.bb +++ b/meta-xilinx-standalone/recipes-bsp/embeddedsw/plm-firmware_2022.2.bb diff --git a/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_2020.1.bb b/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_2020.1.bb deleted file mode 100644 index 6b90f496..00000000 --- a/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_2020.1.bb +++ /dev/null @@ -1,9 +0,0 @@ -require pmu-firmware.inc - -FILESPATH .= ":${FILE_DIRNAME}/embeddedsw" - -SRC_URI += " \ - file://0001-zynqmp_pmufw-Fix-reset-ops-for-assert.patch \ - file://0001-zynqmp_pmufw-Correct-structure-header-of-PmResetOps.patch \ - " - diff --git a/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_2021.2.bb b/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_2022.2.bb index 2c554d6d..2c554d6d 100644 --- a/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_2021.2.bb +++ b/meta-xilinx-standalone/recipes-bsp/embeddedsw/pmu-firmware_2022.2.bb diff --git a/meta-xilinx-standalone/recipes-bsp/embeddedsw/psm-firmware_2021.2.bb b/meta-xilinx-standalone/recipes-bsp/embeddedsw/psm-firmware_2022.2.bb index d861fb1c..d861fb1c 100644 --- a/meta-xilinx-standalone/recipes-bsp/embeddedsw/psm-firmware_2021.2.bb +++ b/meta-xilinx-standalone/recipes-bsp/embeddedsw/psm-firmware_2022.2.bb diff --git a/meta-xilinx-vendor/COPYING.MIT b/meta-xilinx-vendor/COPYING.MIT new file mode 100644 index 00000000..fb950dc6 --- /dev/null +++ b/meta-xilinx-vendor/COPYING.MIT @@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/meta-xilinx-vendor/README.md b/meta-xilinx-vendor/README.md new file mode 100644 index 00000000..84cbf1be --- /dev/null +++ b/meta-xilinx-vendor/README.md @@ -0,0 +1,41 @@ +# meta-xilinx-vendor + +This layer provides support for MicroBlaze, Zynq, ZynqMP and Versal architectures vendor boards. + +## Supported Boards/Machines + +**Boards/Machines supported by this layer:** + + +| Platform | Vendor Board Variant | Machine Configuration file | Board Device tree | +| ---| --- | ---| ---------- | +|MicroBlaze|[Xilinx S3A DSP 1800](https://shop.trenz-electronic.de/en/TE0320-00-EV02I-FPGA-Module-with-Spartan-3A-DSP-1800K-EV02I-1-Gbit-DDR-RAM)|[s3adsp1800-qemu-microblazeeb](conf/machine/s3adsp1800-qemu-microblazeeb.conf)|NA| +|Zynq-7000|[Avent Microzed](https://www.xilinx.com/products/boards-and-kits/1-5lakcu.html)|[microzed-zynq7](conf/machine/microzed-zynq7.conf)|`zynq-microzed.dtb`| +||[Avnet Picozed](https://www.xilinx.com/products/boards-and-kits/1-58nuel.html)|[picozed-zynq7](conf/machine/picozed-zynq7.conf)|NA| +||[Avnet Minized](https://www.xilinx.com/products/boards-and-kits/1-odbhjd.html)|[minized-zynq7](conf/machine/minized-zynq7.conf)|NA| +||[Avnet/Digilent ZedBoard](https://www.xilinx.com/products/boards-and-kits/1-8dyf-11.html)|[zedboard-zynq7](conf/machine/zedboard-zynq7.conf)|NA| +||[Digilent Zybo](https://www.xilinx.com/support/university/boards-portfolio/xup-boards/DigilentZYBO.html)|[zybo-zynq7](conf/machine/zybo-zynq7.conf)|`zynq-zybo.dtb`| +||[Digilent Zybo Linux BD](https://www.xilinx.com/support/university/boards-portfolio/xup-boards/DigilentZYBO.html)|[zybo-linux-bd-zynq7](conf/machine/zybo-linux-bd-zynq7.conf)|NA| +|ZynqMP|[Avent Ultra96 v1](https://www.xilinx.com/products/boards-and-kits/1-vad4rl.html)|[ultra96-zynqmp](conf/machine/ultra96-zynqmp.conf)|`avnet-ultra96-rev1`| +|Versal|NA|NA|NA| + +> **Note:** +``` +1. For Zybo Linux BD reference design refer meta-xilinx-contrib layer. +2. Ultra96 Machine configuration file is unsupported and is compatible with v1 board only. Refer to meta-avnet for v2 board. +``` + + +## Dependencies + +This layer depends on: + + URI: git://git.openembedded.org/bitbake + + URI: git://git.openembedded.org/openembedded-core + layers: meta + branch: master or xilinx current release version (e.g. hosister) + + URI: git://git.yoctoproject.org/meta-xilinx.git + layers: meta-xilinx-microblaze, meta-xilinx-core + branch: master or xilinx current release version (e.g. hosister) diff --git a/meta-xilinx-vendor/conf/layer.conf b/meta-xilinx-vendor/conf/layer.conf new file mode 100644 index 00000000..3d1ff571 --- /dev/null +++ b/meta-xilinx-vendor/conf/layer.conf @@ -0,0 +1,18 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have a packages directory, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILES_DYNAMIC += " \ +xilinx-tools:${LAYERDIR}/dynamic-layers/meta-xilinx-tools/recipes-*/*/*.bb \ +xilinx-tools:${LAYERDIR}/dynamic-layers/meta-xilinx-tools/recipes-*/*/*.bbappend \ +" + +BBFILE_COLLECTIONS += "xilinx-vendor" +BBFILE_PATTERN_xilinx-vendor = "^${LAYERDIR}/" +BBFILE_PRIORITY_xilinx-vendor = "5" + +LAYERDEPENDS_xilinx-vendor = "xilinx" +LAYERSERIES_COMPAT_xilinx-vendor = "honister" diff --git a/meta-xilinx-bsp/conf/machine/include/board/ultra96.inc b/meta-xilinx-vendor/conf/machine/include/board/ultra96.inc index bfb57e00..bfb57e00 100644 --- a/meta-xilinx-bsp/conf/machine/include/board/ultra96.inc +++ b/meta-xilinx-vendor/conf/machine/include/board/ultra96.inc diff --git a/meta-xilinx-bsp/conf/machine/microzed-zynq7.conf b/meta-xilinx-vendor/conf/machine/microzed-zynq7.conf index c0e8e6dd..ce8058e4 100644 --- a/meta-xilinx-bsp/conf/machine/microzed-zynq7.conf +++ b/meta-xilinx-vendor/conf/machine/microzed-zynq7.conf @@ -4,9 +4,6 @@ require conf/machine/zynq-generic.conf -# u-boot configuration -PREFERRED_PROVIDER_virtual/bootloader = "u-boot" - SPL_BINARY ?= "spl/boot.bin" UBOOT_ELF = "u-boot" diff --git a/meta-xilinx-contrib/conf/machine/minized-zynq7.conf b/meta-xilinx-vendor/conf/machine/minized-zynq7.conf index a7c549cc..af9d982d 100644 --- a/meta-xilinx-contrib/conf/machine/minized-zynq7.conf +++ b/meta-xilinx-vendor/conf/machine/minized-zynq7.conf @@ -2,13 +2,10 @@ #@NAME: minized-zynq7 #@DESCRIPTION: Machine support for MiniZed. (http://www.minized.org/) -require conf/machine/include/tune-zynq.inc -require conf/machine/include/machine-xilinx-default.inc +require conf/machine/zynq-generic.conf MACHINE_FEATURES = "ext2 vfat usbhost wifi bluetooth" -# u-boot configuration -PREFERRED_PROVIDER_virtual/bootloader = "u-boot" UBOOT_MACHINE ?= "zynq_minized_config" EXTRA_IMAGEDEPENDS += " \ diff --git a/meta-xilinx-bsp/conf/machine/picozed-zynq7.conf b/meta-xilinx-vendor/conf/machine/picozed-zynq7.conf index d4f63f95..31f5e220 100644 --- a/meta-xilinx-bsp/conf/machine/picozed-zynq7.conf +++ b/meta-xilinx-vendor/conf/machine/picozed-zynq7.conf @@ -8,9 +8,6 @@ require conf/machine/zynq-generic.conf -# u-boot configuration -PREFERRED_PROVIDER_virtual/bootloader = "u-boot" - SPL_BINARY ?= "spl/boot.bin" UBOOT_ELF = "u-boot" diff --git a/meta-xilinx-bsp/conf/machine/ultra96-zynqmp.conf b/meta-xilinx-vendor/conf/machine/ultra96-zynqmp.conf index ff74ac3d..ff74ac3d 100644 --- a/meta-xilinx-bsp/conf/machine/ultra96-zynqmp.conf +++ b/meta-xilinx-vendor/conf/machine/ultra96-zynqmp.conf diff --git a/meta-xilinx-bsp/conf/machine/zedboard-zynq7.conf b/meta-xilinx-vendor/conf/machine/zedboard-zynq7.conf index 4da6bb4e..4da6bb4e 100644 --- a/meta-xilinx-bsp/conf/machine/zedboard-zynq7.conf +++ b/meta-xilinx-vendor/conf/machine/zedboard-zynq7.conf diff --git a/meta-xilinx-bsp/conf/machine/zybo-linux-bd-zynq7.conf b/meta-xilinx-vendor/conf/machine/zybo-linux-bd-zynq7.conf index df26ea0d..98718ae3 100644 --- a/meta-xilinx-bsp/conf/machine/zybo-linux-bd-zynq7.conf +++ b/meta-xilinx-vendor/conf/machine/zybo-linux-bd-zynq7.conf @@ -7,8 +7,6 @@ require conf/machine/zynq-generic.conf -PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot" - MACHINE_FEATURES += "keyboard screen alsa sdio" SPL_BINARY ?= "spl/boot.bin" @@ -22,6 +20,5 @@ IMAGE_BOOT_FILES += " \ " KERNEL_FEATURES += " \ - bsp/xilinx/zybo-linux-bd-zynq7/zybo-linux-bd-zynq7.scc \ features/xilinx/v4l2/v4l2.scc \ " diff --git a/meta-xilinx-bsp/conf/machine/zybo-zynq7.conf b/meta-xilinx-vendor/conf/machine/zybo-zynq7.conf index aa1eafe4..74d117c0 100644 --- a/meta-xilinx-bsp/conf/machine/zybo-zynq7.conf +++ b/meta-xilinx-vendor/conf/machine/zybo-zynq7.conf @@ -8,8 +8,6 @@ require conf/machine/zynq-generic.conf -# u-boot configuration -PREFERRED_PROVIDER_virtual/bootloader = "u-boot" SPL_BINARY ?= "spl/boot.bin" UBOOT_ELF = "u-boot" diff --git a/meta-xilinx-vendor/dynamic-layers/meta-xilinx-tools/recipes-bsp/device-tree/device-tree.bbappend b/meta-xilinx-vendor/dynamic-layers/meta-xilinx-tools/recipes-bsp/device-tree/device-tree.bbappend new file mode 100644 index 00000000..963940f5 --- /dev/null +++ b/meta-xilinx-vendor/dynamic-layers/meta-xilinx-tools/recipes-bsp/device-tree/device-tree.bbappend @@ -0,0 +1,7 @@ +# Ultra96 device tree configuration +YAML_MAIN_MEMORY_CONFIG:ultra96 ?= "psu_ddr_0" +YAML_CONSOLE_DEVICE_CONFIG:ultra96 ?= "psu_uart_1" +YAML_DT_BOARD_FLAGS:ultra96 ?= "{BOARD avnet-ultra96-rev1}" + +# ZedBoard device tree configuration +YAML_DT_BOARD_FLAGS:zedboard ?= "{BOARD zedboard}" diff --git a/meta-xilinx-bsp/dynamic-layers/meta-xilinx-tools/recipes-bsp/embeddedsw/pmu-firmware_%.bbappend b/meta-xilinx-vendor/dynamic-layers/meta-xilinx-tools/recipes-bsp/embeddedsw/pmu-firmware_%.bbappend index e925d608..e925d608 100644 --- a/meta-xilinx-bsp/dynamic-layers/meta-xilinx-tools/recipes-bsp/embeddedsw/pmu-firmware_%.bbappend +++ b/meta-xilinx-vendor/dynamic-layers/meta-xilinx-tools/recipes-bsp/embeddedsw/pmu-firmware_%.bbappend diff --git a/meta-xilinx-vendor/recipes-bsp/device-tree/device-tree.bbappend b/meta-xilinx-vendor/recipes-bsp/device-tree/device-tree.bbappend new file mode 100644 index 00000000..341e69dc --- /dev/null +++ b/meta-xilinx-vendor/recipes-bsp/device-tree/device-tree.bbappend @@ -0,0 +1,13 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +# device tree sources for the various machines +COMPATIBLE_MACHINE:picozed-zynq7 = ".*" +SRC_URI:append:picozed-zynq7 = " file://picozed-zynq7.dts" + +COMPATIBLE_MACHINE:zybo-linux-bd-zynq7 = ".*" +SRC_URI:append:zybo-linux-bd-zynq7 = " \ + file://zybo-linux-bd-zynq7.dts \ + file://pcw.dtsi \ + file://pl.dtsi \ + " + diff --git a/meta-xilinx-bsp/recipes-bsp/device-tree/files/picozed-zynq7.dts b/meta-xilinx-vendor/recipes-bsp/device-tree/files/picozed-zynq7.dts index 6f9b653a..6f9b653a 100644 --- a/meta-xilinx-bsp/recipes-bsp/device-tree/files/picozed-zynq7.dts +++ b/meta-xilinx-vendor/recipes-bsp/device-tree/files/picozed-zynq7.dts diff --git a/meta-xilinx-bsp/recipes-bsp/device-tree/files/zybo-linux-bd-zynq7/pcw.dtsi b/meta-xilinx-vendor/recipes-bsp/device-tree/files/zybo-linux-bd-zynq7/pcw.dtsi index 0f678d39..0f678d39 100644 --- a/meta-xilinx-bsp/recipes-bsp/device-tree/files/zybo-linux-bd-zynq7/pcw.dtsi +++ b/meta-xilinx-vendor/recipes-bsp/device-tree/files/zybo-linux-bd-zynq7/pcw.dtsi diff --git a/meta-xilinx-bsp/recipes-bsp/device-tree/files/zybo-linux-bd-zynq7/pl.dtsi b/meta-xilinx-vendor/recipes-bsp/device-tree/files/zybo-linux-bd-zynq7/pl.dtsi index 32bc7688..32bc7688 100644 --- a/meta-xilinx-bsp/recipes-bsp/device-tree/files/zybo-linux-bd-zynq7/pl.dtsi +++ b/meta-xilinx-vendor/recipes-bsp/device-tree/files/zybo-linux-bd-zynq7/pl.dtsi diff --git a/meta-xilinx-bsp/recipes-bsp/device-tree/files/zybo-linux-bd-zynq7/zybo-linux-bd-zynq7.dts b/meta-xilinx-vendor/recipes-bsp/device-tree/files/zybo-linux-bd-zynq7/zybo-linux-bd-zynq7.dts index 19654392..19654392 100644 --- a/meta-xilinx-bsp/recipes-bsp/device-tree/files/zybo-linux-bd-zynq7/zybo-linux-bd-zynq7.dts +++ b/meta-xilinx-vendor/recipes-bsp/device-tree/files/zybo-linux-bd-zynq7/zybo-linux-bd-zynq7.dts diff --git a/meta-xilinx-bsp/recipes-bsp/platform-init/platform-init.bbappend b/meta-xilinx-vendor/recipes-bsp/platform-init/platform-init.bbappend index fbe42821..fbe42821 100644 --- a/meta-xilinx-bsp/recipes-bsp/platform-init/platform-init.bbappend +++ b/meta-xilinx-vendor/recipes-bsp/platform-init/platform-init.bbappend diff --git a/meta-xilinx-bsp/recipes-bsp/platform-init/platform-init/picozed-zynq7/ps7_init_gpl.c b/meta-xilinx-vendor/recipes-bsp/platform-init/platform-init/picozed-zynq7/ps7_init_gpl.c index 5587ab25..5587ab25 100644 --- a/meta-xilinx-bsp/recipes-bsp/platform-init/platform-init/picozed-zynq7/ps7_init_gpl.c +++ b/meta-xilinx-vendor/recipes-bsp/platform-init/platform-init/picozed-zynq7/ps7_init_gpl.c diff --git a/meta-xilinx-bsp/recipes-bsp/platform-init/platform-init/picozed-zynq7/ps7_init_gpl.h b/meta-xilinx-vendor/recipes-bsp/platform-init/platform-init/picozed-zynq7/ps7_init_gpl.h index df5205e8..df5205e8 100644 --- a/meta-xilinx-bsp/recipes-bsp/platform-init/platform-init/picozed-zynq7/ps7_init_gpl.h +++ b/meta-xilinx-vendor/recipes-bsp/platform-init/platform-init/picozed-zynq7/ps7_init_gpl.h |