[LEDE-DEV] Adding support for dlink dwr-512

Mathias Kresin dev at kresin.me
Sun Oct 2 14:42:57 PDT 2016


02.10.2016 23:08, Giuseppe Lippolis:
> Dear Mathias,
> thanks for your info.
>
> Just a couple of question before to proceed.
>
> 1) From my understanding the append-dtb seems to append the dtb after the
> kernel. But in this way in my opinion the kernel cannot point to the dbt
> (remember that currently It seems that the oem bootloader cannot pass kernel
> parameter).
> In the
> build_dir/target-mipsel_24kc_musl-1.1.15/linux-ramips_rt305x/linux-4.4.23/ar
> ch/mips/ralink/of.c the __dt_setup_arch(&__image_dtb); point to the
> __image_dtb area embedded in the kernel. This area should be populated after
> the compilation process by the patch-dtb tool. Shall I use the "KERNEL :=
> kernel-bin | patch-dtb | lzma" config  instead?

Well, that is exactly the KERNEL line I've send in my last mail. Not 
sure if I get what you are asking here. But such a kernel works for most 
of the rt305x devices.

>
> 2) Currently I make this patch
>
> diff --git a/target/linux/ramips/image/rt305x.mk
> b/target/linux/ramips/image/rt305x.mk
> index be21ac4..f768785 100644
> --- a/target/linux/ramips/image/rt305x.mk
> +++ b/target/linux/ramips/image/rt305x.mk
> @@ -168,6 +168,17 @@ endef
>  TARGET_DEVICES += dir-620-d1
>
>
> +define Device/dwr-512-b
> +  DTS := DWR-512-B
> +  KERNEL := kernel-bin | patch-dtb | lzma
> +  IMAGES := factory.bin
> +  IMAGE/factory.bin := \
> +       append-kernel
> +  DEVICE_TITLE := D-Link DWR-512 B
> +endef
> +TARGET_DEVICES += dwr-512-b
>
> But If run the make script I get the same files I had before in the
> bin/targets/ramips/rt305x/
> lede-ramips-rt305x-dwr-512-b-initramfs-kernel.bin
> lede-ramips-rt305x-dwr-512-b-squashfs-factory.bin
> lede-ramips-rt305x-dwr-512-b-squashfs-sysupgrade.bin
> lede-ramips-rt305x-root.squashfs
> lede-ramips-rt305x-uImage-initramfs.bin
> lede-ramips-rt305x-uImage.bin
> lede-ramips-rt305x-vmlinux-initramfs.bin
> lede-ramips-rt305x-vmlinux-initramfs.elf
> lede-ramips-rt305x-vmlinux.bin
> lede-ramips-rt305x-vmlinux.elf
>
>
> what shall I do to propagate the change effect in the
> target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk?

The contents of the lede-ramips-rt305x-dwr-512-b* files should be 
different. Please ignore the remaining files in the directory. These are 
generic files which are generated due to the fact that some rt305x 
boards are still using the old build code. These files are _not_ 
specific for your board.

As written in my last mail. You will find the kernel generated for your 
board in build_dir/target-mipsel_24kc_musl-1.1.15/linux-ramips_rt305x/.

But at this point I would try to tftpboot the initramfs-kernel.bin from 
uboot to check if everything works. Most bootloader do not enforce a 
vendor specific header for images loaded via tftp.

> Currently the only way I found to apply a change in the target/linux/... is:
> Make distclean
> Make menuconfig
> Make

make target/linux/{clean,install} should work.




More information about the Lede-dev mailing list