From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AYwgCwU2mWNzGgAAbAwnHQ (envelope-from ) for ; Wed, 14 Dec 2022 03:33:41 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MNJwCgU2mWO4cQAAauVa8A (envelope-from ) for ; Wed, 14 Dec 2022 03:33:41 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7BAB64218E for ; Wed, 14 Dec 2022 03:33:40 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5HZx-0000lX-Ub; Tue, 13 Dec 2022 21:33:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5HZv-0000kn-TQ for guix-patches@gnu.org; Tue, 13 Dec 2022 21:33:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5HZv-0005gS-Le for guix-patches@gnu.org; Tue, 13 Dec 2022 21:33:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p5HZv-0000YY-HW for guix-patches@gnu.org; Tue, 13 Dec 2022 21:33:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59761] [PATCH v3 3/4] gnu: Add u-boot-ts7970-q-2g-1000mhz-c. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 14 Dec 2022 02:33:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59761 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59761@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 59761-submit@debbugs.gnu.org id=B59761.16709851752111 (code B ref 59761); Wed, 14 Dec 2022 02:33:03 +0000 Received: (at 59761) by debbugs.gnu.org; 14 Dec 2022 02:32:55 +0000 Received: from localhost ([127.0.0.1]:36091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5HZm-0000Xu-Fi for submit@debbugs.gnu.org; Tue, 13 Dec 2022 21:32:55 -0500 Received: from mail-qv1-f52.google.com ([209.85.219.52]:38702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5HZj-0000XI-K9 for 59761@debbugs.gnu.org; Tue, 13 Dec 2022 21:32:52 -0500 Received: by mail-qv1-f52.google.com with SMTP id pp21so10900295qvb.5 for <59761@debbugs.gnu.org>; Tue, 13 Dec 2022 18:32:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GzD/1gUpfRpcC5GIq5E+O+IujjtUUyVFqH8QryLhJ+w=; b=IrKlP2VuZd1TsQK0cD2E4z1V5WO4dxUds/IozSSwxufnewELSSFm7ID1+3QOiKkf7R zKSSf1EGRlvxTtwL6gZ2HyE4OkkCeseqROgJgWvrDG1zfK7WFjqZysBaGYBLLuQnjLUn FUxt7zkcokMDttxK3XNJIcsarm3SUeUyjb0Idt2VkAjtRo5F2mRsNV15TH0CUyxqfgkz oizsMBr7T4Hq8O1i5H261CkqjEgcLqKRDdZXj7zO3ZUwY2EnD/ftmNua1xoke3nPg7i5 NYiFSbFO6RwdEKr2PXm5xUXvKv9Cla77gM5w/FB6zHErM78jjVypd/l4hWxY/W7W01Bj VsJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GzD/1gUpfRpcC5GIq5E+O+IujjtUUyVFqH8QryLhJ+w=; b=TENR527G/OEE4Txr814PuBCOCDZ0gdEa9dPwGFn86xWcPtTOTvhd+7b2Evs2R3ZcwL 5OAwvSyA75K2MgVVGdOtZHtkY90/1BQjcQYPgffBJ/s6SFav/a7Hv34wd8rDzX/8AheQ P7lbF/PLDKzh7IdytikjQnHVYU6gpYV6i4H/W3rX3Hfmi0wqJCpmJ2QKSXx3fGImGbcz D+XGpCgcUO6LWHzpIqy5n85bS+cdfR7xVJryrJmZY4yba+dCRiYoZI1azX4wpCrYn4Pj Fd8NmGVKW3AUtPooYa6XeS39dBw2f8E1bWQgjNu4JRnMT2AnnEi3Q1drOrJDJrYBnSWC OIVA== X-Gm-Message-State: ANoB5plCLfg+1WdnrwC/R9xekV1DVVlmz6xq7oEtNi31WPI+5q5Bj+SF Q0iwmWVg//S0x5GuvkzNPVNOSwDaHtrXGQ== X-Google-Smtp-Source: AA0mqf4zaT7kMN8VbZciBkizPjp4mzlwMS8t9Z/w8ZPqFyKpO+P2Exibwu/VTzB97fKaz3oDi12Z9A== X-Received: by 2002:a0c:dc81:0:b0:4c7:2677:77cc with SMTP id n1-20020a0cdc81000000b004c7267777ccmr36107142qvk.8.1670985165922; Tue, 13 Dec 2022 18:32:45 -0800 (PST) Received: from localhost.localdomain ([2607:fad8:4:3::1006]) by smtp.gmail.com with ESMTPSA id k12-20020a05620a414c00b006e42a8e9f9bsm9191306qko.121.2022.12.13.18.32.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Dec 2022 18:32:45 -0800 (PST) From: Maxim Cournoyer Date: Tue, 13 Dec 2022 21:32:35 -0500 Message-Id: <20221214023236.25345-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221214023236.25345-1-maxim.cournoyer@gmail.com> References: <20221214023236.25345-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670985220; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=GzD/1gUpfRpcC5GIq5E+O+IujjtUUyVFqH8QryLhJ+w=; b=AomjZ6jCBTQaL8o4qPtwSsYpKKUpvG3DVJeLhVsvCVJ0dOPAqdqi178fLST2FyElWfQwed Lz6RZDKF34xWbwLmK49pROeLrHBDxpX0zLFMBYsRj5rJFxjsTG6iQn2nATxjU91dsvjw2H qRU01x41gusMuVl2RS9eBMzeLXceuMUMAfeideByu1pvdY61VjOvuNDRIQohrSz2xZZ4bT mgSW4NEtahUuPbLHwJ1cSgF0AxIs36Zot5NNWS4RvlbBB++2kuzoQQxt4FVW8qgds1+GRO Yh33xqqBmr9tlvGXCtR8FBHSwXan4hbMBUzXJC8X6ADjnc5q5Vb0G1HBSxcjEA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=IrKlP2Vu; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670985220; a=rsa-sha256; cv=none; b=hjjy4QBn8+Ictm0LE+M527XNidAxHduRZtObthxuY8ecBOHBRgPRjnkKYbOs2jSuOCHKx4 yBU79upLHIzRLJs6hgIixi/iTD2i8ys4VEYpmEbgUMTifyYh9Xk2v3y3BtyfTLPQ8G9oI2 WxLgESIxWHC0yQ+bwx6PNJ4h2uo8WrwdYMMrjpX7etGO89X6f+dxcMn/tLbfHBvwTTnpmE PDrmSAZxrsQiKYHy2wQADA2Oaq6tjv1zG+ShYMuCcbMmkINItd1suq1sIqJvdE/9MVLI0R tE1EbTuVmdQ+VnqZFeSHroD2oSyyGB9Ww7l99UOEvvolA4PKRCe9H84T90vAzw== X-Migadu-Spam-Score: 7.23 X-Spam-Score: 7.23 X-Migadu-Queue-Id: 7BAB64218E X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=IrKlP2Vu; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) X-TUID: j4rTnqzjI3rO * gnu/packages/bootloaders.scm (u-boot-ts-mx6): New variable. (u-boot-ts7970-q-2g-1000mhz-c): Likewise. --- gnu/packages/bootloaders.scm | 150 +++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index ab2cf06fd5..02c1c1a17a 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -1271,6 +1271,156 @@ (define-public u-boot-rpi-4-32b-efi-bin (define-public u-boot-rpi-arm64-efi-bin (make-u-boot-bin-package u-boot-rpi-arm64-efi)) +(define u-boot-ts-mx6 + ;; There is no release; use the latest commit of the + ;; 'imx_v2015.04_3.14.52_1.1.0_ga' branch. + (let ((revision "0") + (commit "344403c64d93813fce8c6d94ed4c3ffb1fe2a181")) + (package + (inherit u-boot) + (name "u-boot-ts-mx6") + (version (git-version "2015.04_3" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/embeddedTS/u-boot-imx") + (commit commit))) + (file-name (git-file-name "u-boot-imx-ts" version)) + (sha256 + (base32 + "081swfz204dsy0nss4r55b8453w766yp2wgrh5y10l3gjc0fkrs1")))) + (arguments + (substitute-keyword-arguments (package-arguments u-boot) + ((#:phases phases '%standard-phases) + #~(modify-phases #$phases + (add-after 'unpack 'patch-u-boot + (lambda _ + (substitute* (find-files "include/configs" "^ts[0-9]{4}\\.h$") + ;; Default to boot a standard zImage instead of a uImage. + (("/boot/uImage") + "/boot/zImage") + (("uimage") + "zimage") + (("bootm \\$\\{loadaddr}") + "bootz ${loadaddr}") + ;; This reference DTB is not available in mainline. + (("ts7970-revf.dtb") + "ts7970.dtb") + ;; Enable support for DISTRO_DEFAULTS, which enables to + ;; use 'sysboot' to boot Guix System. Also enable + ;; "standard" boot commands for dealing with discovery and + ;; booting of syslinux configurations (extlinux.conf). + + ;; Disable the stock CONFIG_BOOTCOMMAND to avoid a + ;; redefinition error. + (("CONFIG_BOOTCOMMAND") + "CONFIG_BOOTCOMMAND_DISABLED") + (("CONFIG_BOOTDELAY") + "CONFIG_BOOTDELAY_DISABLED") + ;; Inspired by include/configs/embestmx6boards.h + (("#define CONFIG_EXTRA_ENV_SETTINGS.*" anchor) + (string-append + "#include \n\n" + "#define MEM_LAYOUT_ENV_SETTINGS \\\n" + " \"bootm_size=0x10000000\\0\" \\\n" + " \"kernel_addr_r=0x10800000\\0\" \\\n" + " \"fdt_addr_r=0x18000000\\0\" \\\n" + " \"scriptaddr=0x18100000\\0\" \\\n" + " \"pxefile_addr_r=0x18200000\\0\" \\\n" + " \"ramdisk_addr_r=0x18300000\\0\"\n\n" + "#define BOOT_TARGET_DEVICES(func) \\\n" + " func(MMC, mmc, 0) \\\n" + " func(MMC, mmc, 1) \\\n" + " func(SATA, sata, 0) \\\n" + " func(USB, usb, 0) \\\n" + " func(PXE, pxe, na) \\\n" + " func(DHCP, dhcp, na)\n\n" + "#include \n\n" + anchor + ;; Sadly, the user config CONFIG_DEFAULT_FDT_FILE did + ;; not exist in that older U-Boot, a placeholder is + ;; added here, to be substituted in each TS U-Boot board + ;; package. + " \"fdtfile=DEFAULT_FDT_FILE\\0\" \\\n" + " MEM_LAYOUT_ENV_SETTINGS \\\n" + " BOOTENV \\\n"))))) + (add-after 'unpack 'patch-for-reproducibility + (lambda _ + ;; Substitute dynamically computed timestamps with static + ;; ones. + (substitute* "Makefile" + (("U_BOOT_DATE \"%b %d %C%y\"") + "U_BOOT_DATE \"Jan 01 1969\"") + (("U_BOOT_TIME \"%T\"") + "U_BOOT_TIME \"00:00:00\"")))) + (add-before 'build 'adjust-for-gcc10 + (lambda _ + (copy-file "include/linux/compiler-gcc6.h" + "include/linux/compiler-gcc10.h") + (substitute* "arch/arm/Makefile" + (("march=armv5") + "march=armv5te")))) + (add-after 'install 'build+install-tools + (lambda* (#:key make-flags #:allow-other-keys) + ;; Apply a trivial patch not backported from mainline to fix + ;; cross-compilation of tools (see: + ;; https://source.denx.de/u-boot/u-boot/-/commit/ + ;; 3b0825296aeba69c2cbfd3e179db2e9cbe5e70d7). + (substitute* '("tools/Makefile" "tools/env/Makefile") + (("^HOSTCC = \\$\\(CC)" all) + (string-append "override " all))) + (apply invoke "make" "tools-all" make-flags) + (install-file "tools/env/fw_printenv" + (string-append #$output "/bin")) + (symlink (string-append #$output "/bin/fw_printenv") + (string-append #$output "/bin/fw_setenv")))))))) + (native-inputs + (modify-inputs (package-native-inputs u-boot) + (delete "dtc")))))) ;otherwise the build fails + +(define-public u-boot-ts7970-q-2g-1000mhz-c + (let ((base + (make-u-boot-package "ts7970-q-2g-1000mhz-c" "arm-linux-gnueabihf" + #:u-boot u-boot-ts-mx6 + #:append-description + "This U-Boot variant is for the Technologic +Systems TS-7970 revision C board, which includes a quad core Freescale i.MX6 +CPU and 2 GiB of RAM clocked at 1000MHz. The binary U-Boot image to flash is +the @file{libexec/u-boot.imx} file. It can be used with the @file{zImage} and +the @file{imx6q-ts7970.dtb} files provided by the +@code{linux-libre-arm-generic} image. + +To flash this bootloader, write it to an SD card, then using the U-Boot serial +console: +@example +mmc dev 0 +load mmc 0:1 ${loadaddr} /u-boot.imx +sf probe +sf erase 0 0x80000 +sf write ${loadaddr} 0x400 $filesize +@end example + +The factory values of U-Boot must also be reset so that it boots using a +zImage instead of the default uImage: +@example +run clearenv +reset +@end example + +For more information, refer to +@url{https://docs.embeddedts.com/TS-7970#Update_U-Boot}."))) + (package + (inherit base) + (arguments + (substitute-keyword-arguments (package-arguments base) + ((#:phases phases '%standard-phases) + #~(modify-phases #$phases + (add-after 'patch-u-boot 'set-default-fdt-file + (lambda _ + (substitute* "include/configs/ts7970.h" + (("DEFAULT_FDT_FILE") + "imx6q-ts7970.dtb"))))))))))) + (define-public vboot-utils (package (name "vboot-utils") -- 2.38.1