From patchwork Fri Jan 9 22:46:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 427267 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id D7F1E140190 for ; Sat, 10 Jan 2015 09:46:40 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 26FC88E2CF; Fri, 9 Jan 2015 22:46:40 +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 3kn4A0N8oWwx; Fri, 9 Jan 2015 22:46:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id DCD068D83B; Fri, 9 Jan 2015 22:46:32 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 1B7301C288F for ; Fri, 9 Jan 2015 22:46:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1632732F4A for ; Fri, 9 Jan 2015 22:46:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id olHwKjS64LjR for ; Fri, 9 Jan 2015 22:46:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by silver.osuosl.org (Postfix) with ESMTPS id EA94832F3C for ; Fri, 9 Jan 2015 22:46:28 +0000 (UTC) Received: by mail-wg0-f43.google.com with SMTP id k14so10533196wgh.2 for ; Fri, 09 Jan 2015 14:46:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Pa76ZkzPzWIZse+WBiLXLVbNaYzvkMBT14w65BJ0STw=; b=ZXTZF/2O4umnjIWmNfeDVV73oXgGC1r91JnBJQuiMPl8sPYtEWsdWdAHxXpyPD1Jxl A+zrMqWRgCyGeFbVcIl6MyVqaO2zF2KuOaND/gWaNt2gimC1EuqdE7JjG9dBavf3b11F OS+xVsnjK2XUyx0+9pNGoxZajYQYKn/EObbvahTGNdD8RlftYZIwddUBaoHzFv4O5pmq QxlWZCztLnDxIzhs+85Th0lkPlGSKXn19TdDUN3XrnPpM2SgtuU6rp8L3OsvdbuRcGm9 grJaA0jqoXVZ2+5EjEBa/XKn1W8upDYRPpYsdripB9QErTNEgznb6BZ/M0I74sQkkTNf zEDw== X-Received: by 10.180.11.98 with SMTP id p2mr9396179wib.22.1420843587561; Fri, 09 Jan 2015 14:46:27 -0800 (PST) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id cs8sm264031wib.1.2015.01.09.14.46.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Jan 2015 14:46:26 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 9 Jan 2015 23:46:20 +0100 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 2/5 v2] package/rpi-firmware: install DTB blobs X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add an option to install all the DTBs: - standard DTBs for standalon A/B and A+/B+ models; - overlay DTBs for the 'hats' addon boards. Install the DTBs as per the traditional layout expected by all RPi users, that is: - base DTBs alongside the other boot files; - overlay DTBs in a sub-directory. This requires the user provide a specially configured Linux defconfig file, as the default ones do not enable USE_OF. Signed-off-by: "Yann E. MORIN" --- package/rpi-firmware/Config.in | 11 +++++++++++ package/rpi-firmware/rpi-firmware.mk | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/package/rpi-firmware/Config.in b/package/rpi-firmware/Config.in index cd45be4..80ba88a 100644 --- a/package/rpi-firmware/Config.in +++ b/package/rpi-firmware/Config.in @@ -45,4 +45,15 @@ config BR2_PACKAGE_RPI_FIRMWARE_BOOT default "_x" if BR2_PACKAGE_RPI_FIRMWARE_X default "_cd" if BR2_PACKAGE_RPI_FIRMWARE_CD +config BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTBS + bool "Install Device Tree Blobs (DTBs)" + help + Say 'y' here if you want to boot your kernel that has support + for the device tree. + + Note that the defconfig files in the Raspberry Pi fork of the + Linux kernel do not enable support for the Device Tree. You'll + have to provide your own Linux config or defconfig file with + device tree enabled, to make use of those DTBs. + endif # BR2_PACKAGE_RPI_FIRMWARE diff --git a/package/rpi-firmware/rpi-firmware.mk b/package/rpi-firmware/rpi-firmware.mk index eb835ee..04c6160 100644 --- a/package/rpi-firmware/rpi-firmware.mk +++ b/package/rpi-firmware/rpi-firmware.mk @@ -11,12 +11,26 @@ RPI_FIRMWARE_LICENSE_FILES = boot/LICENCE.broadcom RPI_FIRMWARE_INSTALL_TARGET = NO RPI_FIRMWARE_INSTALL_IMAGES = YES +ifeq ($(BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTBS),y) +RPI_FIRMWARE_DEPENDENCIES += host-rpi-firmware +# Override the version in this case. +RPI_FIRMWARE_VERSION = 09627457b9e15bf4ea4e6751d3c173a3fb65df07 +define RPI_FIRMWARE_INSTALL_DTB + $(INSTALL) -D -m 0644 $(@D)/boot/bcm2708-rpi-b.dtb $(BINARIES_DIR)/rpi-firmware/bcm2708-rpi-b.dtb + $(INSTALL) -D -m 0644 $(@D)/boot/bcm2708-rpi-b-plus.dtb $(BINARIES_DIR)/rpi-firmware/bcm2708-rpi-b-plus.dtb + for ovldtb in $(@D)/boot/overlays/*.dtb; do \ + $(INSTALL) -D -m 0644 $${ovldtb} $(BINARIES_DIR)/rpi-firmware/overlays/$${ovldtb##*/} || exit 1; \ + done +endef +endif + define RPI_FIRMWARE_INSTALL_IMAGES_CMDS $(INSTALL) -D -m 0644 $(@D)/boot/bootcode.bin $(BINARIES_DIR)/rpi-firmware/bootcode.bin $(INSTALL) -D -m 0644 $(@D)/boot/start$(BR2_PACKAGE_RPI_FIRMWARE_BOOT).elf $(BINARIES_DIR)/rpi-firmware/start.elf $(INSTALL) -D -m 0644 $(@D)/boot/fixup$(BR2_PACKAGE_RPI_FIRMWARE_BOOT).dat $(BINARIES_DIR)/rpi-firmware/fixup.dat $(INSTALL) -D -m 0644 package/rpi-firmware/config.txt $(BINARIES_DIR)/rpi-firmware/config.txt $(INSTALL) -D -m 0644 package/rpi-firmware/cmdline.txt $(BINARIES_DIR)/rpi-firmware/cmdline.txt + $(RPI_FIRMWARE_INSTALL_DTB) endef # We have no host sources to get, since we already