0005-HACK-rockchip-Remove-binman-image-descriptions.patch 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. From b14bc4a5d8dc31294dde4ee9ce8008d763c695de Mon Sep 17 00:00:00 2001
  2. From: Alper Nebi Yasak <alpernebiyasak@gmail.com>
  3. Date: Fri, 13 Oct 2023 14:06:26 +0300
  4. Subject: [PATCH] HACK: rockchip: Remove binman image descriptions
  5. For Rockchip boards binman tries to build SPI and MMC images that
  6. require an externally built BL31 file to be provided, and the build
  7. fails otherwise. This is not really as configurable as it should be.
  8. Some downstreams only care about build outputs for U-Boot proper. As a
  9. hack to make sure they can do so without building BL31, remove the
  10. binman image descriptions from the device-tree sources. However,
  11. BINMAN_FDT expects these to be present and has to be disabled as well.
  12. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
  13. ---
  14. arch/arm/dts/rk3288-u-boot.dtsi | 24 ----
  15. arch/arm/dts/rk3399-gru-u-boot.dtsi | 6 -
  16. arch/arm/dts/rk3399-u-boot.dtsi | 25 ----
  17. arch/arm/dts/rockchip-u-boot.dtsi | 186 ----------------------------
  18. 4 files changed, 241 deletions(-)
  19. diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
  20. index c4c5a2d225c4..432ab92d97c9 100644
  21. --- a/arch/arm/dts/rk3288-u-boot.dtsi
  22. +++ b/arch/arm/dts/rk3288-u-boot.dtsi
  23. @@ -55,30 +55,6 @@ noc: syscon@ffac0000 {
  24. };
  25. };
  26. -#if defined(CONFIG_ROCKCHIP_SPI_IMAGE) && defined(CONFIG_HAS_ROM)
  27. -&binman {
  28. - rom {
  29. - filename = "u-boot.rom";
  30. - size = <0x400000>;
  31. - pad-byte = <0xff>;
  32. -
  33. - mkimage {
  34. - args = "-n rk3288 -T rkspi";
  35. - u-boot-spl {
  36. - };
  37. - };
  38. - u-boot-img {
  39. - offset = <0x20000>;
  40. - };
  41. - u-boot {
  42. - offset = <0x300000>;
  43. - };
  44. - fdtmap {
  45. - };
  46. - };
  47. -};
  48. -#endif
  49. -
  50. &bus_intmem {
  51. ddr_sram: ddr-sram@1000 {
  52. compatible = "rockchip,rk3288-ddr-sram";
  53. diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi b/arch/arm/dts/rk3399-gru-u-boot.dtsi
  54. index b1604a6872c0..54296b4d7a1c 100644
  55. --- a/arch/arm/dts/rk3399-gru-u-boot.dtsi
  56. +++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi
  57. @@ -15,12 +15,6 @@ config {
  58. };
  59. };
  60. -&binman {
  61. - rom {
  62. - size = <0x800000>;
  63. - };
  64. -};
  65. -
  66. &cros_ec {
  67. ec-interrupt = <&gpio0 RK_PA1 GPIO_ACTIVE_LOW>;
  68. };
  69. diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
  70. index 3423b882c437..0bf4c481b39a 100644
  71. --- a/arch/arm/dts/rk3399-u-boot.dtsi
  72. +++ b/arch/arm/dts/rk3399-u-boot.dtsi
  73. @@ -60,31 +60,6 @@ pmusgrf: syscon@ff330000 {
  74. };
  75. -#if defined(CONFIG_ROCKCHIP_SPI_IMAGE) && defined(CONFIG_HAS_ROM)
  76. -&binman {
  77. - multiple-images;
  78. - rom {
  79. - filename = "u-boot.rom";
  80. - size = <0x400000>;
  81. - pad-byte = <0xff>;
  82. -
  83. - mkimage {
  84. - args = "-n rk3399 -T rkspi";
  85. - u-boot-spl {
  86. - };
  87. - };
  88. - u-boot-img {
  89. - offset = <0x40000>;
  90. - };
  91. - u-boot {
  92. - offset = <0x300000>;
  93. - };
  94. - fdtmap {
  95. - };
  96. - };
  97. -};
  98. -#endif /* CONFIG_ROCKCHIP_SPI_IMAGE && CONFIG_HAS_ROM */
  99. -
  100. &cru {
  101. bootph-all;
  102. };
  103. diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
  104. index be2658e8ef18..3d55553e4401 100644
  105. --- a/arch/arm/dts/rockchip-u-boot.dtsi
  106. +++ b/arch/arm/dts/rockchip-u-boot.dtsi
  107. @@ -10,189 +10,3 @@ binman: binman {
  108. multiple-images;
  109. };
  110. };
  111. -
  112. -#ifdef CONFIG_SPL
  113. -&binman {
  114. - simple-bin {
  115. - filename = "u-boot-rockchip.bin";
  116. - pad-byte = <0xff>;
  117. -
  118. - mkimage {
  119. - filename = "idbloader.img";
  120. - args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
  121. - multiple-data-files;
  122. -
  123. -#ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL
  124. - rockchip-tpl {
  125. - };
  126. -#elif defined(CONFIG_TPL)
  127. - u-boot-tpl {
  128. - };
  129. -#endif
  130. - u-boot-spl {
  131. - };
  132. - };
  133. -
  134. -#if defined(CONFIG_SPL_FIT) && (defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE))
  135. - fit: fit {
  136. -#ifdef CONFIG_ARM64
  137. - description = "FIT image for U-Boot with bl31 (TF-A)";
  138. -#else
  139. - description = "FIT image with OP-TEE";
  140. -#endif
  141. - #address-cells = <1>;
  142. - fit,fdt-list = "of-list";
  143. - filename = "u-boot.itb";
  144. - fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
  145. - fit,align = <512>;
  146. - offset = <CONFIG_SPL_PAD_TO>;
  147. - images {
  148. - u-boot {
  149. - description = "U-Boot";
  150. - type = "standalone";
  151. - os = "U-Boot";
  152. -#ifdef CONFIG_ARM64
  153. - arch = "arm64";
  154. -#else
  155. - arch = "arm";
  156. -#endif
  157. - compression = "none";
  158. - load = <CONFIG_TEXT_BASE>;
  159. - entry = <CONFIG_TEXT_BASE>;
  160. - u-boot-nodtb {
  161. - };
  162. -#ifdef CONFIG_SPL_FIT_SIGNATURE
  163. - hash {
  164. - algo = "sha256";
  165. - };
  166. -#endif
  167. - };
  168. -
  169. -#ifdef CONFIG_ARM64
  170. - @atf-SEQ {
  171. - fit,operation = "split-elf";
  172. - description = "ARM Trusted Firmware";
  173. - type = "firmware";
  174. - arch = "arm64";
  175. - os = "arm-trusted-firmware";
  176. - compression = "none";
  177. - fit,load;
  178. - fit,entry;
  179. - fit,data;
  180. -
  181. - atf-bl31 {
  182. - };
  183. -#ifdef CONFIG_SPL_FIT_SIGNATURE
  184. - hash {
  185. - algo = "sha256";
  186. - };
  187. -#endif
  188. - };
  189. - @tee-SEQ {
  190. - fit,operation = "split-elf";
  191. - description = "TEE";
  192. - type = "tee";
  193. - arch = "arm64";
  194. - os = "tee";
  195. - compression = "none";
  196. - fit,load;
  197. - fit,entry;
  198. - fit,data;
  199. -
  200. - tee-os {
  201. - optional;
  202. - };
  203. -#ifdef CONFIG_SPL_FIT_SIGNATURE
  204. - hash {
  205. - algo = "sha256";
  206. - };
  207. -#endif
  208. - };
  209. -#else
  210. - op-tee {
  211. - description = "OP-TEE";
  212. - type = "tee";
  213. - arch = "arm";
  214. - os = "tee";
  215. - compression = "none";
  216. - load = <(CFG_SYS_SDRAM_BASE + 0x8400000)>;
  217. - entry = <(CFG_SYS_SDRAM_BASE + 0x8400000)>;
  218. -
  219. - tee-os {
  220. - };
  221. -#ifdef CONFIG_SPL_FIT_SIGNATURE
  222. - hash {
  223. - algo = "sha256";
  224. - };
  225. -#endif
  226. - };
  227. -#endif
  228. -
  229. - @fdt-SEQ {
  230. - description = "fdt-NAME";
  231. - compression = "none";
  232. - type = "flat_dt";
  233. -#ifdef CONFIG_SPL_FIT_SIGNATURE
  234. - hash {
  235. - algo = "sha256";
  236. - };
  237. -#endif
  238. - };
  239. - };
  240. -
  241. - configurations {
  242. - default = "@config-DEFAULT-SEQ";
  243. - @config-SEQ {
  244. - description = "NAME.dtb";
  245. - fdt = "fdt-SEQ";
  246. -#ifdef CONFIG_ARM64
  247. - fit,firmware = "atf-1", "u-boot";
  248. -#else
  249. - fit,firmware = "op-tee", "u-boot";
  250. -#endif
  251. - fit,loadables;
  252. - };
  253. - };
  254. - };
  255. -#else
  256. - u-boot-img {
  257. - offset = <CONFIG_SPL_PAD_TO>;
  258. - };
  259. -#endif
  260. - };
  261. -
  262. -#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
  263. - simple-bin-spi {
  264. - filename = "u-boot-rockchip-spi.bin";
  265. - pad-byte = <0xff>;
  266. -
  267. - mkimage {
  268. - filename = "idbloader-spi.img";
  269. - args = "-n", CONFIG_SYS_SOC, "-T", "rkspi";
  270. - multiple-data-files;
  271. -
  272. -#ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL
  273. - rockchip-tpl {
  274. - };
  275. -#elif defined(CONFIG_TPL)
  276. - u-boot-tpl {
  277. - };
  278. -#endif
  279. - u-boot-spl {
  280. - };
  281. - };
  282. -
  283. -#if defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE)
  284. - fit {
  285. - type = "blob";
  286. - filename = "u-boot.itb";
  287. -#else
  288. - u-boot-img {
  289. -#endif
  290. - /* Sync with u-boot,spl-payload-offset if present */
  291. - offset = <CONFIG_SYS_SPI_U_BOOT_OFFS>;
  292. - };
  293. - };
  294. -#endif /* CONFIG_ROCKCHIP_SPI_IMAGE */
  295. -};
  296. -#endif /* CONFIG_SPL */
  297. --
  298. 2.42.0