[openwrt/openwrt] ramips: add dwr-512 jboot firmware configuration

LEDE Commits lede-commits at lists.infradead.org
Sun Apr 8 13:03:28 PDT 2018


mkresin pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/1680ae7eae2602dd85463a71f88d0012b236bff7

commit 1680ae7eae2602dd85463a71f88d0012b236bff7
Author: Giuseppe Lippolis <giu.lippolis at gmail.com>
AuthorDate: Thu Apr 5 18:01:41 2018 +0200

    ramips: add dwr-512 jboot firmware configuration
    
    The previous fw version require the replacement of the stock bootloader
    with u-boot. This prevent an easy stock restore of the original fw.
    
    Now a proper fw util has been developed to manage the stock jboot
    bootloader. Therefore make sense have a fw image for the stock
    bootloader.
    
    The old fw configuration (u-boot) is not compatible with the new one
    and will not be supported anymore.
    
    So at the end 2 image can be generated:
    
    1) factory image with jboot bootloader
         openwrt-ramips-rt305x-dwr-512-b-squashfs-factory.bin
    2) sysupgrade image with jboot bootloader
         openwrt-ramips-rt305x-dwr-512-b-squashfs-sysupgrade.bin
    
    Signed-off-by: Giuseppe Lippolis <giu.lippolis at gmail.com>
---
 target/linux/ramips/base-files/lib/upgrade/platform.sh |  4 ++--
 target/linux/ramips/dts/DWR-512-B.dts                  | 14 ++++----------
 target/linux/ramips/image/rt305x.mk                    | 14 +++++++++++---
 target/linux/ramips/rt305x/config-4.14                 |  1 +
 target/linux/ramips/rt3883/config-4.14                 |  1 +
 5 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 44be484..c58102c 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -52,7 +52,6 @@ platform_check_image() {
 	dir-620-d1|\
 	dir-810l|\
 	duzun-dm06|\
-	dwr-512-b|\
 	e1700|\
 	esr-9753|\
 	ew1200|\
@@ -272,7 +271,8 @@ platform_check_image() {
 		return 0
 		;;
 	dlink,dwr-116-a1|\
-	dlink,dwr-921-c1)
+	dlink,dwr-921-c1|\
+	dwr-512-b)
 		[ "$magic" != "0404242b" ] && {
 			echo "Invalid image type."
 			return 1
diff --git a/target/linux/ramips/dts/DWR-512-B.dts b/target/linux/ramips/dts/DWR-512-B.dts
index afcac21..74a33e1 100644
--- a/target/linux/ramips/dts/DWR-512-B.dts
+++ b/target/linux/ramips/dts/DWR-512-B.dts
@@ -85,20 +85,14 @@
 		m25p,fast-read;
 
 		partition at 0 {
-			label = "u-boot";
-			reg = <0x0 0x30000>;
+			label = "jboot";
+			reg = <0x0 0x10000>;
 			read-only;
 		};
 
-		partition at 30000 {
-			label = "u-boot-env";
-			reg = <0x30000 0x20000>;
-			read-only;
-		};
-
-		partition at 50000 {
+		partition at 10000 {
 			label = "firmware";
-			reg = <0x50000 0x7a0000>;
+			reg = <0x10000 0x7e0000>;
 		};
 
 		config: partition at 7f0000 {
diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk
index dbf15bc..5a4ca73 100644
--- a/target/linux/ramips/image/rt305x.mk
+++ b/target/linux/ramips/image/rt305x.mk
@@ -302,10 +302,18 @@ TARGET_DEVICES += dir-620-d1
 
 define Device/dwr-512-b
   DTS := DWR-512-B
-  IMAGE_SIZE := 7700k
+  IMAGE_SIZE := 7800k
   DEVICE_TITLE := D-Link DWR-512 B
-  DEVICE_PACKAGES := kmod-usb2 kmod-spi-dev kmod-usb-serial kmod-usb-serial-option \
-			kmod-usb-net kmod-usb-net-cdc-ether comgt-ncm
+  DEVICE_PACKAGES := jboot-tools kmod-usb2 kmod-spi-dev kmod-usb-serial \
+			kmod-usb-serial-option kmod-usb-net kmod-usb-net-cdc-ether \
+			comgt-ncm
+  DLINK_ROM_ID := DLK6E2412001
+  DLINK_FAMILY_MEMBER := 0x6E24
+  DLINK_FIRMWARE_SIZE := 0x7E0000
+  KERNEL := $(KERNEL_DTB)
+  IMAGES += factory.bin
+  IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata
+  IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory
 endef
 TARGET_DEVICES += dwr-512-b
 
diff --git a/target/linux/ramips/rt305x/config-4.14 b/target/linux/ramips/rt305x/config-4.14
index 33be391..dadf88e 100644
--- a/target/linux/ramips/rt305x/config-4.14
+++ b/target/linux/ramips/rt305x/config-4.14
@@ -138,6 +138,7 @@ CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
 CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384
 CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_JIMAGE_FW=y
 CONFIG_MTD_SPLIT_SEAMA_FW=y
 CONFIG_MTD_SPLIT_UIMAGE_FW=y
 CONFIG_NEED_DMA_MAP_STATE=y
diff --git a/target/linux/ramips/rt3883/config-4.14 b/target/linux/ramips/rt3883/config-4.14
index 6a0386f..0c0a840 100644
--- a/target/linux/ramips/rt3883/config-4.14
+++ b/target/linux/ramips/rt3883/config-4.14
@@ -158,6 +158,7 @@ CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
 CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384
 CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_JIMAGE_FW=y
 CONFIG_MTD_SPLIT_SEAMA_FW=y
 CONFIG_MTD_SPLIT_UIMAGE_FW=y
 CONFIG_NEED_DMA_MAP_STATE=y



More information about the lede-commits mailing list