From patchwork Fri Apr 6 16:34:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 895759 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lucaceresoli.net Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40HlfT2gwPz9s0x for ; Sat, 7 Apr 2018 02:34:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7BFE88903B; Fri, 6 Apr 2018 16:34:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id omfJdQ2pZG05; Fri, 6 Apr 2018 16:34:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id D9B6988DDA; Fri, 6 Apr 2018 16:34:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 6E12A1CF122 for ; Fri, 6 Apr 2018 16:34:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6B87C8A497 for ; Fri, 6 Apr 2018 16:34:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VFQ1QP9IUDR8 for ; Fri, 6 Apr 2018 16:34:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from srv-hp10-72.netsons.net (srv-hp10-72.netsons.net [94.141.22.72]) by hemlock.osuosl.org (Postfix) with ESMTPS id D34A18A133 for ; Fri, 6 Apr 2018 16:34:39 +0000 (UTC) Received: from [109.168.11.45] (port=35942 helo=pc-ceresoli.dev.aim) by srv-hp10.netsons.net with esmtpa (Exim 4.89_1) (envelope-from ) id 1f4UJw-000zs7-0V; Fri, 06 Apr 2018 18:34:36 +0200 From: Luca Ceresoli To: buildroot@buildroot.org Date: Fri, 6 Apr 2018 18:34:20 +0200 Message-Id: <1523032461-3295-6-git-send-email-luca@lucaceresoli.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523032461-3295-1-git-send-email-luca@lucaceresoli.net> References: <1523032461-3295-1-git-send-email-luca@lucaceresoli.net> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - srv-hp10.netsons.net X-AntiAbuse: Original Domain - buildroot.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: srv-hp10.netsons.net: authenticated_id: luca+lucaceresoli.net/only user confirmed/virtual account not confirmed X-Authenticated-Sender: srv-hp10.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: Subject: [Buildroot] [PATCH v2-RESEND 5/6] uboot: zynqmp: allow to use custom psu_init files X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Luca Ceresoli MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" U-Boot SPL configures pinmuxes, clocks and other low-level devices. On the Xilinx ZynqMP SoCs the code to do this resides in a file called psu_init_gpl.c which is initially generated by the Xilinx development tools. Add an option to pass these files from the outside (e.g. in the board files). Signed-off-by: Luca Ceresoli --- Changes v1 -> v2: - split from a larger patch doing 2 things - document the option of having psu_init_gpl.c without .h --- boot/uboot/Config.in | 22 ++++++++++++++++++++++ boot/uboot/uboot.mk | 12 ++++++++++++ 2 files changed, 34 insertions(+) diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index 68c0be05d95a..55a99aea23d8 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -379,6 +379,28 @@ config BR2_TARGET_UBOOT_ZYNQMP (downloaded by the zynqmp-pmufw-binaries package) formatted with the Xilinx-specific format. +if BR2_TARGET_UBOOT_ZYNQMP +config BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR + string "Custom psu_init_gpl files" + help + On ZynqMP the booloader is responsible for some basic + initializations, such as enabling peripherals and configuring + pinmuxes. The psu_init_gpl.c file (and, optionally, + psu_init_gpl.h), generated by the Xilinx development tools, + contains the code for such initializations. + + Although U-Boot contains psu_init_gpl.c files for some boards, + each of them describes only one specific configuration. Users of + a different board, or needing a different configuration, can + provide a different file here, and U-Boot will build and link + the user-provided file instead of the built-in one. + + Set this variable to the path where the psu_init_gpl.c file (and + psu_init_gpl.h if needed) is located. Leave empty to use the + files provided by U-Boot. + +endif + config BR2_TARGET_UBOOT_ALTERA_SOCFPGA_IMAGE_CRC bool "CRC image for Altera SoC FPGA (mkpimage)" depends on BR2_arm diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index e81a9fd41dab..38d3c4019ee9 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -289,6 +289,18 @@ define UBOOT_ZYNQMP_COPY_PMUFW endef UBOOT_PRE_CONFIGURE_HOOKS += UBOOT_ZYNQMP_COPY_PMUFW +ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR)),) +define UBOOT_ZYNQMP_COPY_PSU_INIT +# In U-Boot's board/xilinx/zynqmp/Makefile the bundled psu_init_gpl.c +# has precedence over ours if placed in a subdir whose name matches +# CONFIG_DEFAULT_DEVICE_TREE. Delete them all to be sure we use ours. + rm -f $(@D)/board/xilinx/zynqmp/*/psu_init*.[ch] + cp $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR))/psu_init_gpl.[ch] \ + $(@D)/board/xilinx/zynqmp/ +endef +UBOOT_PRE_CONFIGURE_HOOKS += UBOOT_ZYNQMP_COPY_PSU_INIT +endif # BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR + endif # BR2_TARGET_UBOOT_ZYNQMP define UBOOT_INSTALL_OMAP_IFT_IMAGE