git.iko.soy/typeable/nixpkgs
on master help sign in
ubootRock64, ubootRockPro64: apply patch to allow building with latest dtc
commit1cb85dce07da6a4dd66c0df44fb6126c18e0a784 authorBen Wolsieffer <benwolsieffer@gmail.com> dateWed 17 Apr 2019, 21:19 (8 years ago) parentd5b52f3
4 files changed+111−28
pkgs/misc/uboot/rock64-fdt-dtc-compatibility.patch+105 pkgs/misc/uboot/rock64.nix+2 pkgs/misc/uboot/rockpro64.nix+2 pkgs/top-level/all-packages.nix+2−28
pkgs/misc/uboot/rock64-fdt-dtc-compatibility.patchnew file+105
@@ -0,0 +1,105 @@
1+From fbee2adffd39b03e10262b09779faef94c4d5a9d Mon Sep 17 00:00:00 2001
2+From: Ben Wolsieffer <benwolsieffer@gmail.com>
3+Date: Thu, 18 Apr 2019 15:50:24 -0400
4+Subject: [PATCH] fdt: make compatible with dtc >=1.4.6
5+
6+Signed-off-by: Ben Wolsieffer <benwolsieffer@gmail.com>
7+---
8+ include/libfdt_env.h | 6 +++---
9+ lib/libfdt/fdt.h | 6 +++---
10+ lib/libfdt/libfdt.h | 6 +++---
11+ lib/libfdt/libfdt_internal.h | 6 +++---
12+ tools/dtoc/fdt.py | 2 +-
13+ 5 files changed, 13 insertions(+), 13 deletions(-)
14+
15+diff --git a/include/libfdt_env.h b/include/libfdt_env.h
16+index 6c6845f76c..1fbcd0ef83 100644
17+--- a/include/libfdt_env.h
18++++ b/include/libfdt_env.h
19+@@ -6,8 +6,8 @@
20+ * SPDX-License-Identifier: LGPL-2.1+
21+ */
22+
23+-#ifndef _LIBFDT_ENV_H
24+-#define _LIBFDT_ENV_H
25++#ifndef LIBFDT_ENV_H
26++#define LIBFDT_ENV_H
27+
28+ #include "compiler.h"
29+ #include "linux/types.h"
30+@@ -32,4 +32,4 @@ typedef __be64 fdt64_t;
31+ /* adding a ramdisk needs 0x44 bytes in version 2008.10 */
32+ #define FDT_RAMDISK_OVERHEAD 0x80
33+
34+-#endif /* _LIBFDT_ENV_H */
35++#endif /* LIBFDT_ENV_H */
36+diff --git a/lib/libfdt/fdt.h b/lib/libfdt/fdt.h
37+index 3134d78332..38cc182739 100644
38+--- a/lib/libfdt/fdt.h
39++++ b/lib/libfdt/fdt.h
40+@@ -1,5 +1,5 @@
41+-#ifndef _FDT_H
42+-#define _FDT_H
43++#ifndef FDT_H
44++#define FDT_H
45+ /*
46+ * libfdt - Flat Device Tree manipulation
47+ * Copyright (C) 2006 David Gibson, IBM Corporation.
48+@@ -64,4 +64,4 @@ struct fdt_property {
49+ #define FDT_V16_SIZE FDT_V3_SIZE
50+ #define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(fdt32_t))
51+
52+-#endif /* _FDT_H */
53++#endif /* FDT_H */
54+diff --git a/lib/libfdt/libfdt.h b/lib/libfdt/libfdt.h
55+index cb533f4275..9345a59f05 100644
56+--- a/lib/libfdt/libfdt.h
57++++ b/lib/libfdt/libfdt.h
58+@@ -1,5 +1,5 @@
59+-#ifndef _LIBFDT_H
60+-#define _LIBFDT_H
61++#ifndef LIBFDT_H
62++#define LIBFDT_H
63+ /*
64+ * libfdt - Flat Device Tree manipulation
65+ * Copyright (C) 2006 David Gibson, IBM Corporation.
66+@@ -2189,4 +2189,4 @@ int fdt_device_is_available(const void *blob, int node);
67+ int fdt_node_offset_by_phandle_node(const void *fdt, int node, uint32_t phandle);
68+ #endif /* SWIG */
69+
70+-#endif /* _LIBFDT_H */
71++#endif /* LIBFDT_H */
72+diff --git a/lib/libfdt/libfdt_internal.h b/lib/libfdt/libfdt_internal.h
73+index 9a79fe85dd..8fdda7ee79 100644
74+--- a/lib/libfdt/libfdt_internal.h
75++++ b/lib/libfdt/libfdt_internal.h
76+@@ -1,5 +1,5 @@
77+-#ifndef _LIBFDT_INTERNAL_H
78+-#define _LIBFDT_INTERNAL_H
79++#ifndef LIBFDT_INTERNAL_H
80++#define LIBFDT_INTERNAL_H
81+ /*
82+ * libfdt - Flat Device Tree manipulation
83+ * Copyright (C) 2006 David Gibson, IBM Corporation.
84+@@ -47,4 +47,4 @@ static inline struct fdt_reserve_entry *_fdt_mem_rsv_w(void *fdt, int n)
85+
86+ #define FDT_SW_MAGIC (~FDT_MAGIC)
87+
88+-#endif /* _LIBFDT_INTERNAL_H */
89++#endif /* LIBFDT_INTERNAL_H */
90+diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
91+index dbc338653b..ac2191fb37 100644
92+--- a/tools/dtoc/fdt.py
93++++ b/tools/dtoc/fdt.py
94+@@ -360,7 +360,7 @@ class Fdt:
95+ poffset = libfdt.fdt_first_property_offset(self._fdt, node._offset)
96+ while poffset >= 0:
97+ p = self._fdt_obj.get_property_by_offset(poffset)
98+- prop = Prop(node, poffset, p.name, p.value)
99++ prop = Prop(node, poffset, p.name, p)
100+ props_dict[prop.name] = prop
101+
102+ poffset = libfdt.fdt_next_property_offset(self._fdt, poffset)
103+--
104+2.21.0
105+
pkgs/misc/uboot/rock64.nix+2
@@ -15,6 +15,8 @@ in buildUBoot rec {
1515 sha256 = "0gclcd034qfhfbabrdqmky08i0hlwmn63n0zg6mndplms5qpcx75";
1616 };
1717
18+ patches = [ ./rock64-fdt-dtc-compatibility.patch ];
19+
1820 extraMakeFlags = [ "BL31=${armTrustedFirmwareRK3328}/bl31.elf" "u-boot.itb" "all" ];
1921
2022 # Close to being blob free, but the U-Boot TPL causes the kernel to hang after a few minutes
pkgs/misc/uboot/rockpro64.nix+2
@@ -15,6 +15,8 @@ in buildUBoot rec {
1515 sha256 = "0gclcd034qfhfbabrdqmky08i0hlwmn63n0zg6mndplms5qpcx75";
1616 };
1717
18+ patches = [ ./rock64-fdt-dtc-compatibility.patch ];
19+
1820 # Upstream ATF hangs in SPL
1921 extraMakeFlags = [ "BL31=${rkbin}/rk33/rk3399_bl31_v1.17.elf" "u-boot.itb" "all" ];
2022
pkgs/top-level/all-packages.nix+2−28
@@ -15644,35 +15644,9 @@ in
1564415644 # Non-upstream U-Boots:
1564515645 ubootNanonote = callPackage ../misc/uboot/nanonote.nix { };
1564615646
15647− inherit (let
15648− dtc = buildPackages.dtc.overrideAttrs (old: rec {
15649− version = "1.4.5";
15650− src = fetchgit {
15651− url = "https://git.kernel.org/pub/scm/utils/dtc/dtc.git";
15652− rev = "refs/tags/v${version}";
15653− sha256 = "10y5pbkcj5gkijcgnlvrh6q2prpnvsgihb9asz3zfp66mcjwzsy3";
15654− };
15655− });
15656− # Newer dtc versions are incompatible with U-Boot 2017.09
15657− inherit (callPackage ../misc/uboot {
15658− inherit dtc;
15659− buildPackages = buildPackages // {
15660− python2 = buildPackages.python2.override (old: {
15661− packageOverrides = pySelf: pySuper: {
15662− libfdt = pySelf.toPythonModule dtc;
15663− };
15664− });
15665− };
15666− }) buildUBoot;
15667− in {
15668− ubootRock64 = callPackage ../misc/uboot/rock64.nix {
15669− inherit buildUBoot;
15670− };
15647+ ubootRock64 = callPackage ../misc/uboot/rock64.nix { };
1567115648
15672− ubootRockPro64 = callPackage ../misc/uboot/rockpro64.nix {
15673− inherit buildUBoot;
15674− };
15675− }) ubootRock64 ubootRockPro64;
15649+ ubootRockPro64 = callPackage ../misc/uboot/rockpro64.nix { };
1567615650
1567715651 uclibc = callPackage ../os-specific/linux/uclibc { };
1567815652