#
DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION \
- DLINK_ROM_ID DLINK_FAMILY_MEMBER DLINK_FIRMWARE_SIZE
+ DLINK_ROM_ID DLINK_FAMILY_MEMBER DLINK_FIRMWARE_SIZE DLINK_IMAGE_OFFSET
define Build/elecom-header
cp $@ $(KDIR)/v_0.0.0.bin
endef
TARGET_DEVICES += alfa-network_tube-e4g
+define Device/amit_jboot
+ DLINK_IMAGE_OFFSET := 0x10000
+ KERNEL := $(KERNEL_DTB)
+ IMAGES += factory.bin
+ IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata
+ IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory
+ DEVICE_PACKAGES := jboot-tools kmod-usb2 kmod-usb-ohci
+endef
+
define Device/Archer
TPLINK_HWREVADD := 0
TPLINK_HVERSION := 3
TARGET_DEVICES += dir-810l
define Device/dlink_dwr-116-a1
+ $(Device/amit_jboot)
DTS := DWR-116-A1
DEVICE_TITLE := D-Link DWR-116 A1/A2
- DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci jboot-tools
DLINK_ROM_ID := DLK6E3803001
DLINK_FAMILY_MEMBER := 0x6E38
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 += dlink_dwr-116-a1
define Device/dlink_dwr-118-a1
+ $(Device/amit_jboot)
DTS := DWR-118-A1
DEVICE_TITLE := D-Link DWR-118 A1
- DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci jboot-tools kmod-mt76x0e
+ DEVICE_PACKAGES += kmod-mt76x0e
DLINK_ROM_ID := DLK6E3811001
DLINK_FAMILY_MEMBER := 0x6E38
DLINK_FIRMWARE_SIZE := 0xFE0000
- 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 += dlink_dwr-118-a1
define Device/dlink_dwr-118-a2
+ $(Device/amit_jboot)
DTS := DWR-118-A2
DEVICE_TITLE := D-Link DWR-118 A2
- DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci jboot-tools
+ DEVICE_PACKAGES += kmod-mt76x2
DLINK_ROM_ID := DLK6E3814001
DLINK_FAMILY_MEMBER := 0x6E38
DLINK_FIRMWARE_SIZE := 0xFE0000
- 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 += dlink_dwr-118-a2
define Device/dlink_dwr-921-c1
+ $(Device/amit_jboot)
DTS := DWR-921-C1
IMAGE_SIZE := $(ralink_default_fw_size_16M)
DEVICE_TITLE := D-Link DWR-921 C1
DLINK_ROM_ID := DLK6E2414001
DLINK_FAMILY_MEMBER := 0x6E24
DLINK_FIRMWARE_SIZE := 0xFE0000
- KERNEL := $(KERNEL_DTB)
- IMAGES += factory.bin
- IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata
- IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory
- DEVICE_PACKAGES := jboot-tools \
- kmod-usb2 kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
+ DEVICE_PACKAGES += kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
endef
TARGET_DEVICES += dlink_dwr-921-c1
TARGET_DEVICES += dlink_dwr-921-c3
define Device/dlink_dwr-922-e2
+ $(Device/amit_jboot)
DTS := DWR-922-E2
IMAGE_SIZE := $(ralink_default_fw_size_16M)
DEVICE_TITLE := D-Link DWR-922 E2
DLINK_ROM_ID := DLK6E2414005
DLINK_FAMILY_MEMBER := 0x6E24
DLINK_FIRMWARE_SIZE := 0xFE0000
- KERNEL := $(KERNEL_DTB)
- IMAGES += factory.bin
- IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata
- IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory
- DEVICE_PACKAGES := jboot-tools \
- kmod-usb2 kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
+ DEVICE_PACKAGES += kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
endef
TARGET_DEVICES += dlink_dwr-922-e2
TARGET_DEVICES += microwrt
define Device/lava_lr-25g001
+ $(Device/amit_jboot)
DTS := LR-25G001
DEVICE_TITLE := LAVA LR-25G001
DLINK_ROM_ID := LVA6E3804001
DLINK_FAMILY_MEMBER := 0x6E38
DLINK_FIRMWARE_SIZE := 0xFE0000
- KERNEL := $(KERNEL_DTB)
- IMAGES += factory.bin
- IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata
- IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory
- DEVICE_PACKAGES := jboot-tools kmod-usb2 kmod-usb-ohci kmod-mt76x0e
+ DEVICE_PACKAGES += kmod-mt76x0e
endef
TARGET_DEVICES += lava_lr-25g001
char *ofname;
char *progname;
uint32_t firmware_size;
+uint32_t image_offset;
uint16_t family_member;
char *rom_id[12] = { 0 };
char image_type;
header->image_crc32 = crc32(0, (uint8_t *) kernel_ptr, kernel_info.file_size);
header->start_addr = RAM_ENTRY_ADDR;
header->rootfs_addr =
- JBOOT_SIZE + STAG_SIZE + SCH2_SIZE + kernel_info.file_size;
+ image_offset + STAG_SIZE + SCH2_SIZE + kernel_info.file_size;
header->rootfs_len = rootfs_info.file_size;
header->rootfs_crc32 = crc32(0, (uint8_t *) rootfs_ptr, rootfs_info.file_size);
header->header_crc32 = 0;
header->lpvs = AUH_LVPS;
header->mbz = 0;
header->time_stamp = jboot_timestamp();
- header->erase_start = JBOOT_SIZE;
+ header->erase_start = image_offset;
header->erase_length = firmware_size;
- header->data_offset = JBOOT_SIZE;
+ header->data_offset = image_offset;
header->data_length = length;
header->space4 = 0;
header->space5 = 0;
image_type = SYSUPGRADE;
family_member = 0;
firmware_size = 0;
+ image_offset = JBOOT_SIZE;
while (1) {
int c;
- c = getopt(argc, argv, "f:F:i:hk:m:o:r:s:");
+ c = getopt(argc, argv, "f:F:i:hk:m:o:O:r:s:");
if (c == -1)
break;
case 'r':
rootfs_info.file_name = optarg;
break;
+ case 'O':
+ sscanf(optarg, "0x%x", &image_offset);
+ break;
case 'o':
ofname = optarg;
break;