[FS#192] mips kernel patch problem

LEDE Bugs lede-bugs at lists.infradead.org
Sat Oct 1 07:58:09 PDT 2016


The following task has a new comment added:

FS#192 - mips kernel patch problem
User who did this - Giuseppe Lippolis (fidodido)

----------
Dear John,
Now It seems that I'm able to have an image with an embedded device tree without having the crash. But the process is not completely stable and at the end currently I have a different crash.
But Before to proceed I need to fix and consolidate the progress.

Basically I apply the following patch:

diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk
index be21ac4..7a62765 100644
--- a/target/linux/ramips/image/rt305x.mk
+++ b/target/linux/ramips/image/rt305x.mk
@@ -168,6 +168,15 @@ endef
 TARGET_DEVICES += dir-620-d1


+define Device/dwr-512-b
+  DTS := DWR-512-B
+  KERNEL := kernel-bin | patch-dtb
+  IMAGE_SIZE := $(ralink_default_fw_size_8M)
+  DEVICE_TITLE := D-Link DWR-512 B
+endef
+TARGET_DEVICES += dwr-512-b
+
+
 define Device/esr-9753
   DTS := ESR-9753
   BLOCKSIZE := 64k


At the end of the compiling process I get in
build_dir/target-mipsel_24kc_musl-1.1.15/linux-ramips_rt305x/
the following file:
 1) dwr-512-b-kernel.bin.dtb (device tree)
 2) vmlinux and vmlinux-initramfs
 
The two bin image doesn't embed the device tree:


00000400: c022 0008 0000 0000 4f57 5254 4454 423a  ."......OWRTDTB:
00000410: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000420: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000430: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000440: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000450: 0000 0000 0000 0000 0000 0000 0000 0000  ................


If I look in bin/targets/ramips/rt305x/ I can get the following files:
 1) lede-ramips-rt305x-vmlinux.bin
 2) lede-ramips-rt305x-vmlinux-initramfs.bin

The lede-ramips-rt305x-vmlinux.bin doesn't embed the device tree, the lede-ramips-rt305x-vmlinux-initramfs.bin have it:

00000400: c022 0008 0000 0000 4f57 5254 4454 423a  ."......OWRTDTB:
00000410: d00d feed 0000 19bc 0000 0038 0000 1788  ...........8....
00000420: 0000 0028 0000 0011 0000 0010 0000 0000  ...(............
00000430: 0000 0234 0000 1750 0000 0000 0000 0000  ...4...P........
00000440: 0000 0000 0000 0000 0000 0001 0000 0000  ................
00000450: 0000 0003 0000 0004 0000 0000 0000 0001  ................
00000460: 0000 0003 0000 0004 0000 000f 0000 0001  ................
00000470: 0000 0003 0000 0012 0000 001b 7261 6c69  ............rali
00000480: 6e6b 2c72 7435 3335 302d 736f 6300 0000  nk,rt5350-soc...
00000490: 0000 0003 0000 000f 0000 0026 442d 4c69  ...........&D-Li
000004a0: 6e6b 2044 5752 2d35 3132 0000 0000 0001  nk DWR-512......

Because to flash the device I need the vmlinux.bin without the initramfs I'm forced to run manually the following cmd to embed the device tree:

staging_dir/host/bin/patch-dtb bin/targets/ramips/rt305x/lede-ramips-rt305x-vmlinux.bin build_dir/target-mipsel_24kc_musl-1.1.15/linux-ramips_rt305x/dwr-512-b-kernel.bin.dtb

How shall I modify the target scripts in order to have the lede-ramips-rt305x-vmlinux.bin with the embedded device tree?

Thanks,
Bye.
----------

More information can be found at the following URL:
https://bugs.lede-project.org/index.php?do=details&task_id=192#comment535



More information about the lede-bugs mailing list