From d9fb91881ce645255bc49227d5b8430348d48569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91=E7=8C=AB?= <133520@live.cn> Date: Thu, 11 May 2023 15:47:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ipq6018/config.xml | 160 +++++ ipq6018/flash_partition/nand-4k-partition.xml | 220 ++++++ .../nand-audio-4k-partition.xml | 210 ++++++ .../flash_partition/nand-audio-partition.xml | 210 ++++++ ipq6018/flash_partition/nand-partition.xml | 158 +++++ .../flash_partition/nand-partition.xml.bak | 220 ++++++ ipq6018/in/partition_tool | Bin 0 -> 30601 bytes prepareSingleImage.py | 368 ++++++++++ scripts/gen_flash_partition_bin.py | 668 ++++++++++++++++++ scripts/nand_mbn_generator.py | 178 +++++ 命令.txt | 1 + 说明.txt | 3 + 12 files changed, 2396 insertions(+) create mode 100644 ipq6018/config.xml create mode 100644 ipq6018/flash_partition/nand-4k-partition.xml create mode 100644 ipq6018/flash_partition/nand-audio-4k-partition.xml create mode 100644 ipq6018/flash_partition/nand-audio-partition.xml create mode 100644 ipq6018/flash_partition/nand-partition.xml create mode 100644 ipq6018/flash_partition/nand-partition.xml.bak create mode 100644 ipq6018/in/partition_tool create mode 100644 prepareSingleImage.py create mode 100644 scripts/gen_flash_partition_bin.py create mode 100644 scripts/nand_mbn_generator.py create mode 100644 命令.txt create mode 100644 说明.txt diff --git a/ipq6018/config.xml b/ipq6018/config.xml new file mode 100644 index 0000000..b03fe67 --- /dev/null +++ b/ipq6018/config.xml @@ -0,0 +1,160 @@ + + + + + + ipq6018 + + + + 256 + 256 + 256 + + + + + 2048 + 64 + 4096 + + + 2048 + 64 + 4096 + + + 4096 + 64 + 4096 + + + 4096 + 64 + 4096 + + + + + + 7634944 + gpt_main0.bin + gpt_backup0.bin + + + + 256 + 256 + 256 + + + + 256 + 512 + 256 + 256 + gpt_main1.bin + gpt_backup1.bin + + + + + 0x8030000 + AP-CP01-C1 + false + 256M32_DDR3 + + + 0x8030001 + AP-CP01-C2 + false + 256M32_DDR3 + + + 0x8030002 + AP-CP01-C3 + false + 256M32_DDR3 + + + 0x8030003 + AP-CP01-C4 + false + 256M32_DDR3 + true + + + 0x8030100 + AP-CP02-C1 + false + 256M32_DDR4 + + + 0x8030200 + AP-CP03-C1 + false + 256M16_DDR3 + + + 0x1030000 + DB-CP01 + false + 256M32_DDR3 + + + 0x1030100 + DB-CP02 + false + 1024M32_DDR4 + + + 0xF030000 + CP-EMU + false + 256M32_DDR3 + + + + + + /boot_images/build/ms/bin/8074/nor/sbl1_nor.mbn + /boot_images/build/ms/bin/8074/nand/sbl1_nand.mbn + /boot_images/build/ms/bin/8074/emmc/sbl1_emmc.mbn + /boot_images/build/ms/bin/8074/flashless/sbl1_flashless.mbn + /boot_images/core/bsp/tools/flash/partition_tool_exe/build/partition_tool + /boot_images/core/bsp/tools/flash/bootconfig_exe/build/bootconfig_tool + + + /trustzone_images/build/ms/bin/SANAANAA/tz.mbn + /trustzone_images/build/ms/bin/SANAANAA/devcfg_noac.mbn + /trustzone_images/build/ms/bin/SANAANAA/devcfg_nosmmu.mbn + + + /apss_proc/out/ipq807x/openwrt-ipq807x-u-boot.elf + /apss_proc/out/ipq807x/openwrt-ipq-ipq807x-squashfs-root.img + /apss_proc/out/ipq807x/openwrt-ipq-ipq807x-qcom-ipq807x-hkxx-fit-uImage.itb + /apss_proc/out/ipq807x/openwrt-ipq-ipq807x-ubi-root.img + /apss_proc/out/pack.py + + + /apss_proc/out/ipq807x/openwrt-ipq807x-u-boot.elf + /apss_proc/out/ipq807x_64/openwrt-ipq-ipq807x_64-squashfs-root.img + /apss_proc/out/ipq807x_64/openwrt-ipq-ipq807x_64-qcom-ipq807x-hkxx-fit-uImage.itb + /apss_proc/out/ipq807x_64/openwrt-ipq-ipq807x_64-ubi-root.img + /apss_proc/out/pack.py + + + /rpm_proc/build/ms/bin/8074/rpm.mbn + + + /wlan_proc/build/ms/bin/wifi_fw_squashfs.img + /wlan_proc/build/ms/bin/wifi_fw_ubi.img + + + diff --git a/ipq6018/flash_partition/nand-4k-partition.xml b/ipq6018/flash_partition/nand-4k-partition.xml new file mode 100644 index 0000000..3d20fc4 --- /dev/null +++ b/ipq6018/flash_partition/nand-4k-partition.xml @@ -0,0 +1,220 @@ + + + + + + 0xAA7D1B9A + 0x1F7D48BC + + 0x4 + + + 0:SBL1 + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + xbl_nand.elf + + + 0:MIBIB + 512 + 512 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + nand-system-partition-ipq6018-m4096-p256KiB.bin + + + 0:BOOTCONFIG + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + bootconfig.bin + + + 0:BOOTCONFIG1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + bootconfig.bin + + + 0:QSEE + 1792 + 1792 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + tz.mbn + + + 0:QSEE_1 + 1792 + 1792 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:DEVCFG + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + devcfg.mbn + + + 0:DEVCFG_1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:RPM + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + rpm.mbn + + + 0:RPM_1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:CDT + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + cdt.bin + + + 0:CDT_1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:APPSBLENV + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:APPSBL + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + openwrt-ipq6018-u-boot.mbn + + + 0:APPSBL_1 + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:ART + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + rootfs + 85504 + 1024 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + openwrt-ipq-ipq60xx-ubi-root-m4096-p256KiB.img + openwrt-ipq-ipq60xx_64-ubi-root-m4096-p256KiB.img + + + rootfs_1 + 85504 + 1024 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:ETHPHYFW + 2048 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + + diff --git a/ipq6018/flash_partition/nand-audio-4k-partition.xml b/ipq6018/flash_partition/nand-audio-4k-partition.xml new file mode 100644 index 0000000..8fea8ba --- /dev/null +++ b/ipq6018/flash_partition/nand-audio-4k-partition.xml @@ -0,0 +1,210 @@ + + + + + + 0xAA7D1B9A + 0x1F7D48BC + + 0x4 + + + 0:SBL1 + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + xbl_nand.elf + + + 0:MIBIB + 512 + 512 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + nand-audio-system-partition-ipq6018-m4096-p256KiB.bin + + + 0:BOOTCONFIG + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + bootconfig-audio.bin + + + 0:BOOTCONFIG1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + bootconfig-audio.bin + + + 0:QSEE + 1792 + 1792 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + tz.mbn + + + 0:QSEE_1 + 1792 + 1792 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:DEVCFG + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + devcfg_noac.mbn + + + 0:DEVCFG_1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:RPM + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + rpm.mbn + + + 0:RPM_1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:CDT + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + cdt.bin + + + 0:CDT_1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:APPSBLENV + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:APPSBL + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + openwrt-ipq6018-u-boot.mbn + + + 0:APPSBL_1 + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:ART + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + rootfs + 197120 + 1024 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + openwrt-ipq-ipq60xx-ubi-root-m4096-p256KiB.img + openwrt-ipq-ipq60xx_64-ubi-root-m4096-p256KiB.img + + + 0:ETHPHYFW + 2048 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + + diff --git a/ipq6018/flash_partition/nand-audio-partition.xml b/ipq6018/flash_partition/nand-audio-partition.xml new file mode 100644 index 0000000..adb44b0 --- /dev/null +++ b/ipq6018/flash_partition/nand-audio-partition.xml @@ -0,0 +1,210 @@ + + + + + + 0xAA7D1B9A + 0x1F7D48BC + + 0x4 + + + 0:SBL1 + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + xbl_nand.elf + + + 0:MIBIB + 512 + 512 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + nand-audio-system-partition-ipq6018-m2048-p128KiB.bin + + + 0:BOOTCONFIG + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + bootconfig-audio.bin + + + 0:BOOTCONFIG1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + bootconfig-audio.bin + + + 0:QSEE + 1792 + 1792 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + tz.mbn + + + 0:QSEE_1 + 1792 + 1792 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:DEVCFG + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + devcfg_noac.mbn + + + 0:DEVCFG_1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:RPM + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + rpm.mbn + + + 0:RPM_1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:CDT + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + cdt.bin + + + 0:CDT_1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:APPSBLENV + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:APPSBL + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + openwrt-ipq6018-u-boot.mbn + + + 0:APPSBL_1 + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:ART + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + rootfs + 108544 + 1024 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + openwrt-ipq-ipq60xx-ubi-root.img + openwrt-ipq-ipq60xx_64-ubi-root.img + + + 0:ETHPHYFW + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + + diff --git a/ipq6018/flash_partition/nand-partition.xml b/ipq6018/flash_partition/nand-partition.xml new file mode 100644 index 0000000..5497e1c --- /dev/null +++ b/ipq6018/flash_partition/nand-partition.xml @@ -0,0 +1,158 @@ + + + + + + 0xAA7D1B9A + 0x1F7D48BC + + 0x4 + + + 0:SBL1 + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + xbl_nand.elf + + + 0:MIBIB + 512 + 512 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + nand-system-partition-ipq6018.bin + + + 0:QSEE + 1792 + 1792 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + tz.mbn + + + 0:DEVCFG + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + devcfg.mbn + + + 0:RPM + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + rpm.mbn + + + 0:CDT + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + cdt.bin + + + 0:APPSBLENV + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:APPSBL + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + openwrt-ipq6018-u-boot.mbn + + + 0:ART + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + bdata + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + crash + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + crash_syslog + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + rootfs + 113664 + 1024 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + openwrt-ipq-ipq60xx-ubi-root.img + openwrt-ipq-ipq60xx_64-ubi-root.img + + + + diff --git a/ipq6018/flash_partition/nand-partition.xml.bak b/ipq6018/flash_partition/nand-partition.xml.bak new file mode 100644 index 0000000..805987d --- /dev/null +++ b/ipq6018/flash_partition/nand-partition.xml.bak @@ -0,0 +1,220 @@ + + + + + + 0xAA7D1B9A + 0x1F7D48BC + + 0x4 + + + 0:SBL1 + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + xbl_nand.elf + + + 0:MIBIB + 512 + 512 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + nand-system-partition-ipq6018.bin + + + 0:BOOTCONFIG + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + bootconfig.bin + + + 0:BOOTCONFIG1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + bootconfig.bin + + + 0:QSEE + 1792 + 1792 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + tz.mbn + + + 0:QSEE_1 + 1792 + 1792 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:DEVCFG + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + devcfg.mbn + + + 0:DEVCFG_1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:RPM + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + rpm.mbn + + + 0:RPM_1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:CDT + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + cdt.bin + + + 0:CDT_1 + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:APPSBLENV + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:APPSBL + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + openwrt-ipq6018-u-boot.mbn + + + 0:APPSBL_1 + 768 + 768 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:ART + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + rootfs + 53760 + 1024 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + openwrt-ipq-ipq60xx-ubi-root.img + openwrt-ipq-ipq60xx_64-ubi-root.img + + + rootfs_1 + 53760 + 1024 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + 0:ETHPHYFW + 256 + 256 + 0 + 0xFF + 0xFF + 0x00 + 0xFF + + + + diff --git a/ipq6018/in/partition_tool b/ipq6018/in/partition_tool new file mode 100644 index 0000000000000000000000000000000000000000..df46f67011dc48f51f0732afb4df268e9e0f6ceb GIT binary patch literal 30601 zcmeHwd0Z4n^Y_f|f&;7^f(VMb93mc^A|Z$hDxRps`(BP+Sd>fH#XDl~B0MHuQ4=+a zMx#-piSbC(1Wz=^1mhhwYP?W9qfrx&eZSQ+vn)iP-}8Gv&-?kje`H{`ySl2Ys;jGe zdV0ENrpCp0<$0cy4+W>>2uhfx62cM2>qSgBr{V0l0L~YoEs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1vRYezFiH1{Fi+H194`^EN- z)5c*+S}WC?9Is(2Ox$-F+9wusi=eW?h*RX+Zt;CP#l~y$b5tAR zX9MMFkPK;RMEty9OpN?3!4PS_%sPd>J!lP!A33y6(dt=!i=RELMqt*CO)!wvt7nA7 z4)yd|y#HU2HzEEjRE;)fVHAib0Cue5!ba=>^msitA7|R-;p|objK6q)JpzWEj z?I(3toiUf2hrWtxUY;DJZ(Y`)*TQq<)8(kD5sGfGUE+TxQGYb \n" + + print "--arch \t\tArch(e.g ipq40xx/ipq807x/ipq807x_64/ipq6018/ipq6018_64/ipq5018/ipq5018_64/ipq9048/ipq9048_64)\n" + print " \t\te.g python prepareSingleImage.py --arch ipq807x\n\n" + + print "--fltype \tFlash Type (nor/nand/emmc/norplusnand/norplusemmc)" + print " \t\tMultiple flashtypes can be passed by a comma separated string" + print " \t\tDefault is all. i.e If \"--fltype\" is not passed image for all the flash-type will be created.\n" + print " \t\te.g python prepareSingleImage.py --fltype nor,nand,norplusnand\n\n" + + print "--in \t\tGenerated binaries and images needed for singleimage will be copied to this location" + print "\t\tDefault path: .//in/\n" + print "\t\te.g python prepareSingleImage.py --gencdt --in ./\n\n" + + print "--bootimg \tBoot image path" + print "\t\tIf specified the boot images available at will be copied to the directory provided with \"--in\"\n" + print "\t\te.g python prepareSingleImage.py --bootimg \n\n" + + print "--tzimg \tTZ image path" + print "\t\tIf specified the TZ images available at will be copied to the directory provided with \"--in\"\n" + print "\t\te.g python prepareSingleImage.py --tzimg \n\n" + + print "--nhssimg \tNHSS image path" + print "\t\tIf specified the NHSS images available at will be copied to the directory provided with \"--in\"\n" + print "\t\te.g python prepareSingleImage.py --nhssimg \n\n" + + print "--rpmimg \tRPM image path" + print "\t\tIf specified the RPM images available at will be copied to the directory provided with \"--in\"\n" + print "\t\te.g python prepareSingleImage.py --rpmimg \n\n" + + print "--gencdt \tWhether CDT binaries to be generated" + print "\t\tIf not specified CDT binary will not be generated" + print "\t\tThis Argument does not take any value\n" + print "\t\te.g python prepareSingleImage.py --gencdt\n\n" + + print "--memory \tWhether to use Low Memory Profiles for cdt binaries to be generated" + print "\t\tThis option depends on '--gencdt'\n" + print "\t\tIf specified the is taken as memory size in generating cdt binaries\n" + print "\t\te.g python prepareSingleImage.py --gencdt --memory \n\n" + + print "--genpart \tWhether flash partition table(s) to be generated" + print "\t\tIf not specified partition table(s) will not be generated" + print "\t\tThis Argument does not take any value\n" + print "\t\te.g python prepareSingleImage.py --genpart\n\n" + + print "--genbootconf \tWhether bootconfig binaries to be generated" + print "\t\tIf not specified bootconfig binaries will not be generated" + print "\t\tThis Argument does not take any value\n" + print "\t\te.g python prepareSingleImage.py --genbootconf\n\n" + + print "--genmbn \tWhether u-boot.elf to be converted to u-boot.mbn" + print "\t\tIf not specified u-boot.mbn will not be generated" + print "\t\tThis is currently used/needed only for IPQ807x, IPQ6018, IPQ5018" + print "\t\tThis Argument does not take any value\n" + print "\t\te.g python prepareSingleImage.py --genmbn\n\n" + + print "--lk \t\tWhether lkboot.elf to be converted to lkboot.mbn" + print "\t\tIf not specified lkboot.mbn will not be generated" + print "\t\tThis is currently used/needed only for IPQ807x" + print "\t\tThis Argument does not take any value" + print "\t\tThis option depends on '--genmbn'\n" + print "\t\te.g python prepareSingleImage.py --genmbn --lk\n\n" + + print "--genbootldr \tWhether bootldr binaries to be generated" + print "\t\tIf not specified bootldr binaries will not be generated" + print "\t\tThis Argument does not take any value\n" + print "\t\te.g python prepareSingleImage.py --genbootldr\n\n" + + print "--help \t\tPrint This Message\n\n" + + print "\t\t\t\t <<<<<<<<<<<<< A Sample Run >>>>>>>>>>>>>\n" + print "python prepareSingleImage.py --arch ipq40xx --fltype nor,nand,norplusnand --gencdt --genbootconf --genpart --in ./in_put/\n\n\n" + + +def copy_images(image_type, build_dir): + global arch + global configDir + + tree = ET.parse(configDir) + root = tree.getroot() + + entries = root.findall("./data[@type='COPY_IMAGES']/image[@type='" + image_type + "']/entry") + for entry in entries: + image_path = entry.find(".//image_path") + image_path.text = build_dir.rstrip() + image_path.text + print "image_path.text:" + image_path.text + print "cp " + image_path.text + " " + inDir + os.system("cp " + image_path.text + " " + inDir) + +def gen_cdt(): + global srcDir + global configDir + global memory + + cdt_path = srcDir + '/gen_cdt_bin.py' + prc = subprocess.Popen(['python', cdt_path, '-c', configDir, '-o', inDir, '-m', memory], cwd=cdir) + prc.wait() + + if prc.returncode != 0: + print 'ERROR: unable to create CDT binary' + return prc.returncode + return 0 + +def gen_part(flash): + global srcDir + global configDir + + flash_partition_path = srcDir + '/gen_flash_partition_bin.py' + for flash_type in flash.split(","): + prc = subprocess.Popen(['python', flash_partition_path, '-c', configDir, '-f', flash_type, '-o', inDir], cwd=cdir) + prc.wait() + + if prc.returncode != 0: + print 'ERROR: unable to generate partition table for ' + flash_type + return prc.returncode + return 0 + +def gen_bootconfig(): + global srcDir + global configDir + + bootconfig_path = srcDir + '/gen_bootconfig_bin.py' + print "Creating Bootconfig" + prc = subprocess.Popen(['python', bootconfig_path, '-c', configDir, '-o', inDir], cwd=cdir) + prc.wait() + + if prc.returncode != 0: + print 'ERROR: unable to create bootconfig binary' + return prc.returncode + return 0 + +def gen_bootldr(): + global srcDir + global configDir + global memory + + bootldr_path = srcDir + '/gen_bootldr_bin.py' + print "Creating bootldr" + prc = subprocess.Popen(['python', bootldr_path, '-c', configDir, '-o', inDir, '-m', memory], cwd=cdir) + prc.wait() + + if prc.returncode != 0: + print 'ERROR: unable to create bootldr binary' + return prc.returncode + return 0 + +def gen_mbn(): + global srcDir + global mbn_v6 + + bootconfig_path = srcDir + '/elftombn.py' + print "Converting u-boot elf to mbn ..." + tiny_path=inDir + "/openwrt-" + arch + "_tiny" + "-u-boot.elf" + + if mbn_v6 != "true": + prc = subprocess.Popen(['python', bootconfig_path, '-f', inDir + "/openwrt-" + arch + "-u-boot.elf", '-o', inDir + "/openwrt-" + arch + "-u-boot.mbn"], cwd=cdir) + if os.path.exists(tiny_path): + prc = subprocess.Popen(['python', bootconfig_path, '-f', inDir + "/openwrt-" + arch + "_tiny" + "-u-boot.elf", '-o', inDir + "/openwrt-" + arch + "_tiny" + "-u-boot.mbn"], cwd=cdir) + + else: + prc = subprocess.Popen(['python', bootconfig_path, '-f', inDir + "/openwrt-" + arch + "-u-boot.elf", '-o', inDir + "/openwrt-" + arch + "-u-boot.mbn", '-v', "6"], cwd=cdir) + + if os.path.exists(tiny_path): + prc = subprocess.Popen(['python', bootconfig_path, '-f', inDir + "/openwrt-" + arch + "_tiny" + "-u-boot.elf", '-o', inDir + "/openwrt-" + arch + "_tiny" + "-u-boot.mbn", '-v', "6"], cwd=cdir) + + prc.wait() + + if prc.returncode != 0: + print 'ERROR: unable to convert U-Boot .elf to .mbn' + return prc.returncode + else: + print "U-Boot .mbn file is created" + return 0 + +def gen_lk_mbn(): + global srcDir + + bootconfig_path = srcDir + '/elftombn.py' + print "Converting LK elf to mbn ..." + if mbn_v6 != "true": + prc = subprocess.Popen(['python', bootconfig_path, '-f', inDir + "/openwrt-" + arch + "-lkboot.elf", '-o', inDir + "/openwrt-" + arch + "-lkboot.mbn"], cwd=cdir) + else: + prc = subprocess.Popen(['python', bootconfig_path, '-f', inDir + "/openwrt-" + arch + "-lkboot.elf", '-o', inDir + "/openwrt-" + arch + "-lkboot.mbn", '-v', "6"], cwd=cdir) + prc.wait() + + if prc.returncode != 0: + print 'ERROR: unable to convert LK .elf to .mbn' + return prc.returncode + else: + print "LK .mbn file is created" + return 0 + +def main(): + global flash + global arch + global bootImgDir + global tzImgDir + global nhssImgDir + global rpmImgDir + global wififwImgDir + global srcDir + global configDir + global inDir + global mode + global mbn_v6 + global memory + + to_generate_cdt = "false" + to_generate_part = "false" + to_generate_bootconf = "false" + to_generate_mbn = "false" + to_generate_lk_mbn = "false" + to_generate_bootldr = "false" + memory = "default" + + if len(sys.argv) > 1: + try: + opts, args = getopt(sys.argv[1:], "h", ["arch=", "fltype=", "in=", "bootimg=", "tzimg=", "nhssimg=", "rpmimg=", "wififwimg", "gencdt", "memory=", "genpart", "genbootconf", "genmbn", "lk", "genbootldr", "help"]) + except GetoptError, e: + print_help() + raise + + for option, value in opts: + if option == "--arch": + arch = value + if arch not in ["ipq40xx", "ipq806x", "ipq807x", "ipq807x_64", "ipq6018", "ipq6018_64", "ipq5018", "ipq5018_64", "ipq9048", "ipq9048_64"]: + print "Invalid arch type: " + arch + print_help() + return -1 + if arch == "ipq807x" or arch == "ipq5018" or arch == "ipq9048": + mode = "32" + elif arch == "ipq807x_64" or arch == "ipq5018_64" or arch == "ipq9048_64": + mode = "64" + arch = arch[:-3] + + if arch == "ipq6018": + mode = "32" + elif arch == "ipq6018_64": + mode = "64" + arch = "ipq6018" + + elif option == "--fltype": + flash = value + for flash_type in flash.split(","): + if flash_type not in ["nor", "tiny-nor", "nand", "norplusnand", "emmc", "norplusemmc", "tiny-nor-debug"]: + print "Invalid flash type: " + flash_type + print_help() + return -1 + elif option == "--in": + inDir = value + elif option == "--bootimg": + bootImgDir = value + elif option == "--tzimg": + tzImgDir = value + elif option == "--nhssimg": + nhssImgDir = value + elif option == "--rpmimg": + rpmImgDir = value + elif option == "--wififwimg": + wififwImgDir = value + elif option == "--gencdt": + to_generate_cdt = "true" + elif option == "--memory": + memory = value + elif option == "--genbootconf": + to_generate_bootconf = "true" + elif option == "--genpart": + to_generate_part = "true" + elif option == "--genmbn": + to_generate_mbn = "true" + elif option == "--lk": + to_generate_lk_mbn = "true" + elif option == "--genbootldr": + to_generate_bootldr = "true" + + elif (option == "-h" or option == "--help"): + print_help() + return 0 + + srcDir="$$/scripts" + srcDir = srcDir.replace('$$', cdir) + configDir="$$/" + arch + "/config.xml" + configDir = configDir.replace('$$', cdir) + + if inDir == "": + inDir="$$/" + arch + "/in" + inDir = inDir.replace('$$', cdir) + + inDir = os.path.abspath(inDir + "/") + + if not os.path.exists(inDir): + os.makedirs(inDir) + + if bootImgDir != "": + copy_images("BOOT", bootImgDir) + if tzImgDir != "": + copy_images("TZ", tzImgDir) + if nhssImgDir != "": + copy_images("NHSS" + mode, nhssImgDir) + if rpmImgDir != "": + copy_images("RPM", rpmImgDir) + if wififwImgDir != "": + copy_images("WIFIFW", wififwImgDir) + + if to_generate_cdt == "true": + if gen_cdt() != 0: + return -1 + + if to_generate_bootconf == "true": + if gen_bootconfig() != 0: + return -1 + + if to_generate_part == "true": + if gen_part(flash) != 0: + return -1 + + if to_generate_bootldr == "true": + if gen_bootldr() != 0: + return -1 + + if to_generate_mbn == "true": + if arch == "ipq807x" or arch == "ipq6018" or arch == "ipq5018" or arch == "ipq9048": + if arch == "ipq6018": + mbn_v6 = "true" + if gen_mbn() != 0: + return -1 + if to_generate_lk_mbn == "true" and gen_lk_mbn() != 0: + return -1 + else: + print "Invalid arch \"" + arch + "\" for mbn conversion" + print "--genmbn is needed/used only for ipq807x, ipq6018, ipq5018 and ipq9048 type" + return 0 + else: + print_help() + return 0 + +if __name__ == '__main__': + main() + diff --git a/scripts/gen_flash_partition_bin.py b/scripts/gen_flash_partition_bin.py new file mode 100644 index 0000000..c4c471d --- /dev/null +++ b/scripts/gen_flash_partition_bin.py @@ -0,0 +1,668 @@ +# =========================================================================== +#Copyright (c) 2017 Qualcomm Technologies, Inc. +#All Rights Reserved. +#Confidential and Proprietary - Qualcomm Technologies, Inc. +# =========================================================================== + +from collections import namedtuple + +import xml.etree.ElementTree as ET +import os +import subprocess +import sys +from getopt import getopt +from getopt import GetoptError + +cdir = os.path.dirname("") +cdir = os.path.abspath(cdir) +Nor_Params = namedtuple("Nor_Params", "pagesize pages_per_block total_blocks") +Nand_Params = namedtuple("nand_Params", "pagesize pages_per_block total_blocks") +outputdir = "" + +def process_nand_device(pagesize, pages_per_block, total_blocks, entry, nand_type): + + global mbn_gen + global nandsyspartition + global partition_tool + global cdir + global ARCH_NAME + global outputdir + global QCN9000 + + nand_pagesize = pagesize + nand_pages_per_block = pages_per_block + nand_total_blocks = total_blocks + + if nand_type == "audio-4k": + nand_partition = "$$/" + ARCH_NAME + "/flash_partition/nand-audio-4k-partition.xml" + elif nand_type == "audio-2k": + nand_partition = "$$/" + ARCH_NAME + "/flash_partition/nand-audio-partition.xml" + elif nand_type == "4k": + nand_partition = "$$/" + ARCH_NAME + "/flash_partition/nand-4k-partition.xml" + elif nand_type == "2k": + if QCN9000: + nand_partition = "$$/" + ARCH_NAME + "/flash_partition/nand-partition-qcn9000.xml" + else: + nand_partition = "$$/" + ARCH_NAME + "/flash_partition/nand-partition.xml" + + nand_partition = nand_partition.replace('$$', cdir) + + nand_parts = Nand_Params(nand_pagesize, nand_pages_per_block, nand_total_blocks) + + mbn_gen = '$$/scripts/nand_mbn_generator.py' + mbn_gen = mbn_gen.replace('$$', cdir) + + if ARCH_NAME == "ipq806x": + partition_tool = outputdir + '/nor_tool' + else: + partition_tool = outputdir + '/partition_tool' + os.chmod(partition_tool, 0744) + + if entry == False or (entry == True and nand_pagesize == 2048 and nand_type == '2k'): + if QCN9000: + nandsyspartition = outputdir + '/nand-system-partition-' + ARCH_NAME + '-qcn9000.bin' + nanduserpartition = 'nand-user-partition-qcn9000.bin' + else: + nandsyspartition = outputdir + '/nand-system-partition-' + ARCH_NAME + '.bin' + nanduserpartition = 'nand-user-partition.bin' + else: + nand_blocksize = (nand_pagesize * nand_pages_per_block) / 1024 + if nand_type == "audio-2k" or nand_type == "audio-4k": + nand_type = "audio-" + elif nand_type == "4k": + nand_type = "" + nandsyspartition = outputdir + '/nand-' + nand_type + 'system-partition-' + ARCH_NAME + '-m' + str(nand_pagesize) + '-p' + str(nand_blocksize) + 'KiB.bin' + nanduserpartition = 'nand-' + nand_type + 'user-partition-m' + str(nand_pagesize) + '-p' + str(nand_blocksize) + 'KiB.bin' + + nanduserbin= os.path.splitext(nanduserpartition)[0] + ".bin" + + print '\tNand page size: ' + str(nand_parts.pagesize) + ', pages/block: ' \ + + str(nand_parts.pages_per_block) + ', total blocks: ' \ + + str(nand_parts.total_blocks) + print '\tPartition info: ' + nand_partition + + print '\tCreating user partition', + prc = subprocess.Popen(['python', mbn_gen, nand_partition, + nanduserbin], cwd=outputdir) + prc.wait() + if prc.returncode != 0: + print 'ERROR: unable to create user partition' + return prc.returncode + else: + print '...User partition created' + userpart_path = os.path.join(outputdir, nanduserbin) + + print '\tCreating system partition' + prc = subprocess.Popen([ + partition_tool, + '-s', + str(nand_parts.pagesize), + '-p', + str(nand_parts.pages_per_block), + '-b', + str(nand_parts.total_blocks), + '-u', + userpart_path, + '-o', + nandsyspartition, + ], cwd=outputdir) + prc.wait() + if prc.returncode != 0: + print 'ERROR: unable to create system partition' + return prc.returncode + else: + print '...System partition created' + return 0 + + +def process_nand(config_path, flash_type): + global mbn_gen + global nandsyspartition + global partition_tool + global cdir + global ARCH_NAME + global outputdir + global QCN9000 + + tree = ET.parse(config_path) + root = tree.getroot() + + arch = root.find(".//data[@type='ARCH']/SOC") + ARCH_NAME = str(arch.text) + entry = False + QCN9000 = False + + if ARCH_NAME == "ipq807x": + QCN9000 = True + + if root.find(".//data[@type='NAND_PARAMETER']/entry") != None: + + entry = True + entries = root.findall("./data[@type='NAND_PARAMETER']/entry") + for nand_param in entries: + nand_pagesize = int(nand_param.find(".//page_size").text) + nand_pages_per_block = int(nand_param.find(".//pages_per_block").text) + nand_total_blocks = int(nand_param.find(".//total_block").text) + nand_type = nand_param.get('type') + + if QCN9000: + if process_nand_device(nand_pagesize, nand_pages_per_block, nand_total_blocks, entry, nand_type) != 0: + return -1 + QCN9000 = False + + if process_nand_device(nand_pagesize, nand_pages_per_block, nand_total_blocks, entry, nand_type) != 0: + return -1 + else: + nand_param = root.find(".//data[@type='NAND_PARAMETER']") + nand_pagesize = int(nand_param.find('page_size').text) + nand_pages_per_block = int(nand_param.find('pages_per_block').text) + nand_total_blocks = int(nand_param.find('total_block').text) + + if QCN9000: + if process_nand_device(nand_pagesize, nand_pages_per_block, nand_total_blocks, entry, "2k") != 0: + return -1 + QCN9000 = False + + if process_nand_device(nand_pagesize, nand_pages_per_block, nand_total_blocks, entry, "2k") != 0: + return -1 + + return 0 + + +def process_nor(config_path, flash_type): + global mbn_gen + global syspart + global partition_tool + global cdir + global ARCH_NAME + global outputdir + + tree = ET.parse(config_path) + root = tree.getroot() + + arch = root.find(".//data[@type='ARCH']/SOC") + ARCH_NAME = str(arch.text) + + nor_param = root.find(".//data[@type='NOR_PARAMETER']") + nor_pagesize = int(nor_param.find('page_size').text) + nor_pages_per_block = int(nor_param.find('pages_per_block').text) + nor_total_blocks = int(nor_param.find('total_block').text) + block_size = (nor_pagesize * nor_pages_per_block) / 1024 + density = (block_size * nor_total_blocks) / 1024 + + nor_partition = "$$/" + ARCH_NAME + "/flash_partition/" + flash_type + "-partition.xml" + nor_partition = nor_partition.replace('$$', cdir) + + if ARCH_NAME != "ipq806x": + root_part = ET.parse(nor_partition) + part = root_part.find(".//partitions/partition[2]") + part[5].text = str(block_size) + part[6].text = str(density) + root_part.write(nor_partition) + + nor_parts = Nor_Params(nor_pagesize, nor_pages_per_block, nor_total_blocks) + + mbn_gen = '$$/scripts/nand_mbn_generator.py' + mbn_gen = mbn_gen.replace('$$', cdir) + + if ARCH_NAME == "ipq806x": + partition_tool = outputdir + '/nor_tool' + else: + partition_tool = outputdir + '/partition_tool' + os.chmod(partition_tool, 0744) + + syspart = outputdir + '/' + flash_type + '-system-partition-' + ARCH_NAME + '.bin' + userpart = flash_type + '-user-partition.bin' + noruserbin= os.path.splitext(userpart)[0] + ".bin" + + print '\tNor page size: ' + str(nor_parts.pagesize) + ', pages/block: ' \ + + str(nor_parts.pages_per_block) + ', total blocks: ' \ + + str(nor_parts.total_blocks) + ', partition info: ' + nor_partition + + print '\tCreating user partition', + prc = subprocess.Popen(['python', mbn_gen, nor_partition, + noruserbin], cwd=outputdir) + prc.wait() + if prc.returncode != 0: + print 'ERROR: unable to create user partition' + return prc.returncode + else: + print '...User partition created' + + userpart_path = os.path.join(outputdir, noruserbin) + + print '\tCreating system partition' + prc = subprocess.Popen([ + partition_tool, + '-s', + str(nor_parts.pagesize), + '-p', + str(nor_parts.pages_per_block), + '-b', + str(nor_parts.total_blocks), + '-c', + str(1), + '-u', + userpart_path, + '-o', + syspart, + ], cwd=outputdir) + prc.wait() + if prc.returncode != 0: + print 'ERROR: unable to create system partition' + return prc.returncode + else: + print '...System partition created' + + return 0 + + +def process_norplusnand_device(nor_pagesize, nor_pages_per_block, nor_total_blocks, + nand_pagesize, nand_pages_per_block, nand_total_blocks, entry): + global mbn_gen + global norplusnandsyspartition + global partition_tool + global cdir + global ARCH_NAME + global outputdir + global QCN9000 + + if nand_pagesize == 2048: + if QCN9000: + norplusnand_partition = "$$/" + ARCH_NAME + "/flash_partition/norplusnand-partition-qcn9000.xml" + else: + norplusnand_partition = "$$/" + ARCH_NAME + "/flash_partition/norplusnand-partition.xml" + else: + norplusnand_partition = "$$/" + ARCH_NAME + "/flash_partition/norplusnand-4k-partition.xml" + + norplusnand_partition = norplusnand_partition.replace('$$', cdir) + nand_parts = Nand_Params(nand_pagesize, nand_pages_per_block, nand_total_blocks) + nor_parts = Nor_Params(nor_pagesize, nor_pages_per_block, nor_total_blocks) + + mbn_gen = '$$/scripts/nand_mbn_generator.py' + mbn_gen = mbn_gen.replace('$$', cdir) + + if ARCH_NAME == "ipq806x": + partition_tool = outputdir + '/nor_tool' + else: + partition_tool = outputdir + '/partition_tool' + os.chmod(partition_tool, 0744) + + if entry == False or (entry == True and nand_pagesize == 2048): + if QCN9000: + norplusnandsyspartition = outputdir + '/norplusnand-system-partition-' + ARCH_NAME + '-qcn9000.bin' + userpart = 'norplusnand-user-partition-qcn9000.bin' + else: + norplusnandsyspartition = outputdir + '/norplusnand-system-partition-' + ARCH_NAME + '.bin' + userpart = 'norplusnand-user-partition.bin' + else: + nand_blocksize = (nand_pagesize * nand_pages_per_block) / 1024 + norplusnandsyspartition = outputdir + '/norplusnand-system-partition-' + ARCH_NAME + '-m' + str(nand_pagesize) + '-p' + str(nand_blocksize) + 'KiB.bin' + userpart = 'norplusnand-user-partition-m' + str(nand_pagesize) + '-p' + str(nand_blocksize) + 'KiB.bin' + + norplusnanduserbin= os.path.splitext(userpart)[0] +".bin" + + print '\tNor page size: ' + str(nor_parts.pagesize) + ', pages/block: ' \ + + str(nor_parts.pages_per_block) + ', total blocks: ' \ + + str(nor_parts.total_blocks) + print '\tPartition info: ' + norplusnand_partition + + print '\tCreating user partition', + prc = subprocess.Popen(['python', mbn_gen, norplusnand_partition, + norplusnanduserbin], cwd=outputdir) + prc.wait() + if prc.returncode != 0: + print 'ERROR: unable to create user partition' + return prc.returncode + else: + print '...User partition created' + + userpart_path = os.path.join(outputdir, norplusnanduserbin) + + print '\tCreating system partition' + prc = subprocess.Popen([ + partition_tool, + '-s', + str(nor_parts.pagesize), + '-p', + str(nor_parts.pages_per_block), + '-b', + str(nor_parts.total_blocks), + '-x', + str(nand_parts.pagesize), + '-y', + str(nand_parts.pages_per_block), + '-z', + str(nand_parts.total_blocks), + '-c', + str(1), + '-u', + userpart_path, + '-o', + norplusnandsyspartition, + ], cwd=outputdir) + prc.wait() + if prc.returncode != 0: + print 'ERROR: unable to create system partition' + return prc.returncode + else: + print '...System partition created' + return 0 + + +def process_norplusnand(config_path, flash_type): + global mbn_gen + global norplusnandsyspartition + global partition_tool + global cdir + global ARCH_NAME + global outputdir + global QCN9000 + + tree = ET.parse(config_path) + root = tree.getroot() + + arch = root.find(".//data[@type='ARCH']/SOC") + ARCH_NAME = str(arch.text) + + nor_param = root.find(".//data[@type='NOR_PARAMETER']") + nor_pagesize = int(nor_param.find('page_size').text) + nor_pages_per_block = int(nor_param.find('pages_per_block').text) + nor_total_blocks = int(nor_param.find('total_block').text) + + norplusnand_partition = "$$/" + ARCH_NAME + "/flash_partition/norplusnand-partition.xml" + norplusnand_partition = norplusnand_partition.replace('$$', cdir) + + if ARCH_NAME != "ipq806x": + root_part = ET.parse(norplusnand_partition) + part = root_part.find(".//partitions/partition[2]") + block_size = (nor_pagesize * nor_pages_per_block) / 1024 + density = (block_size * nor_total_blocks) / 1024 + part[5].text = str(block_size) + part[6].text = str(density) + root_part.write(norplusnand_partition) + + entry = False + QCN9000 = False + + if ARCH_NAME == "ipq807x": + QCN9000 = True + + if root.find(".//data[@type='NAND_PARAMETER']/entry") != None: + + entry = True + entries = root.findall("./data[@type='NAND_PARAMETER']/entry") + for nand_param in entries: + nand_pagesize = int(nand_param.find(".//page_size").text) + nand_pages_per_block = int(nand_param.find(".//pages_per_block").text) + nand_total_blocks = int(nand_param.find(".//total_block").text) + + if QCN9000: + if process_norplusnand_device(nor_pagesize, + nor_pages_per_block, nor_total_blocks, nand_pagesize, + nand_pages_per_block, nand_total_blocks, entry) != 0: + return -1 + QCN9000 = False + + if process_norplusnand_device(nor_pagesize, + nor_pages_per_block, nor_total_blocks, nand_pagesize, + nand_pages_per_block, nand_total_blocks, entry) != 0: + return -1 + + else: + nand_param = root.find(".//data[@type='NAND_PARAMETER']") + nand_pagesize = int(nand_param.find('page_size').text) + nand_pages_per_block = int(nand_param.find('pages_per_block').text) + nand_total_blocks = int(nand_param.find('total_block').text) + + if QCN9000: + if process_norplusnand_device(nor_pagesize, + nor_pages_per_block, nor_total_blocks, nand_pagesize, + nand_pages_per_block, nand_total_blocks, entry) != 0: + return -1 + QCN9000 = False + + if process_norplusnand_device(nor_pagesize, + nor_pages_per_block, nor_total_blocks, nand_pagesize, + nand_pages_per_block, nand_total_blocks, entry) != 0: + return -1 + return 0 + + +def process_emmc(config_path, flash_type): + global ptool + global msp + global ARCH_NAME + global outputdir + + tree = ET.parse(config_path) + root = tree.getroot() + + arch = root.find(".//data[@type='ARCH']/SOC") + ARCH_NAME = str(arch.text) + emmc_partition = "$$/" + ARCH_NAME + "/flash_partition/emmc-partition.xml" + emmc_partition = emmc_partition.replace('$$', cdir) + + emmc_total_blocks = None + + emmc_entry = root.find(".//data[@type='EMMC_PARAMETER']/total_block") + total_blocks = int(emmc_entry.text) + + ptool = '$$/scripts/ptool.py' + ptool = ptool.replace('$$', cdir) + msp = '$$/scripts/msp.py' + msp = msp.replace('$$', cdir) + + emmc_total_blocks = total_blocks + + print '\tTotal blocks: ' + str(emmc_total_blocks) + print '\tPartition info: ' + emmc_partition + print '\temmc path: ' + outputdir + + print '\tCreating rawprogram0.xml and patch0.xml', + prc = subprocess.Popen(['python', ptool, '-x', emmc_partition], cwd=outputdir) + prc.wait() + if prc.returncode != 0: + print 'ERROR: unable to create rawprogram0.xml and patch0.xml' + return prc.returncode + else: + print '...rawprogram0.xml and patch0.xml created' + + rawprogram_path = os.path.join(outputdir, 'rawprogram0.xml') + patch_path = os.path.join(outputdir, 'patch0.xml') + + print '\t rawprogram' + rawprogram_path + print '\t patch' + patch_path + + print '\tRunning msp.py to update gpt_main0.bin partition' + prc = subprocess.Popen([ + 'python', + msp, + '-r', + rawprogram_path, + '-p', + patch_path, + '-d', + str(emmc_total_blocks), + '-n', + ], cwd=outputdir) + prc.wait() + + if prc.returncode != 0: + print 'ERROR: unable to create system partition' + return prc.returncode + else: + print '...System partition created' + return 0 + + +def process_norplusemmc(config_path, flash_type): + global mbn_gen + global syspart + global partition_tool + global cdir + global ptool + global msp + global ARCH_NAME + global outputdir + + tree = ET.parse(config_path) + root = tree.getroot() + + arch = root.find(".//data[@type='ARCH']/SOC") + ARCH_NAME = str(arch.text) + + blocks = root.find(".//data[@type='EMMC_PARAMETER']") + emmc_total_blocks = int(blocks.find('total_block').text) + + nor_param = root.find(".//data[@type='NORPLUSEMMC_PARAMETER']") + nor_pagesize = int(nor_param.find('page_size').text) + nor_pages_per_block = int(nor_param.find('pages_per_block').text) + nor_total_blocks = int(nor_param.find('total_block').text) + norplusemmc_partition = "$$/" + ARCH_NAME + "/flash_partition/norplusemmc-partition.xml" + emmc_partition = "$$/" + ARCH_NAME + "/flash_partition/emmc-partition.xml" + norplusemmc_partition = norplusemmc_partition.replace('$$', cdir) + emmc_partition = emmc_partition.replace('$$', cdir) + + if ARCH_NAME != "ipq806x": + root_part = ET.parse(norplusemmc_partition) + part = root_part.find(".//partitions/partition[2]") + block_size = (nor_pagesize * nor_pages_per_block) / 1024 + density = (block_size * nor_total_blocks) / 1024 + part[5].text = str(block_size) + part[6].text = str(density) + root_part.write(norplusemmc_partition) + + nor_parts = Nor_Params(nor_pagesize, nor_pages_per_block, nor_total_blocks) + + mbn_gen = '$$/scripts/nand_mbn_generator.py' + mbn_gen = mbn_gen.replace('$$', cdir) + + ptool = '$$/scripts/ptool.py' + ptool = ptool.replace('$$', cdir) + msp = '$$/scripts/msp.py' + msp = msp.replace('$$', cdir) + + if ARCH_NAME == "ipq806x": + partition_tool = outputdir + '/nor_tool' + else: + partition_tool = outputdir + '/partition_tool' + os.chmod(partition_tool, 0744) + + syspart = outputdir + '/norplusemmc-system-partition-' + ARCH_NAME + '.bin' + userpart = 'norplusemmc-user-partition.bin' + norplusemmcuserbin= os.path.splitext(userpart)[0] + ".bin" + + print '\tNor page size: ' + str(nor_parts.pagesize) + ', pages/block: ' \ + + str(nor_parts.pages_per_block) + ', total blocks: ' \ + + str(nor_parts.total_blocks) + ', partition info: ' + norplusemmc_partition + + print '\tCreating user partition', + prc = subprocess.Popen(['python', mbn_gen, norplusemmc_partition, + norplusemmcuserbin], cwd=outputdir) + prc.wait() + if prc.returncode != 0: + print 'ERROR: unable to create user partition' + return prc.returncode + else: + print '...User partition created' + + userpart_path = os.path.join(outputdir, norplusemmcuserbin) + + print '\tCreating system partition' + prc = subprocess.Popen([ + partition_tool, + '-s', + str(nor_parts.pagesize), + '-p', + str(nor_parts.pages_per_block), + '-b', + str(nor_parts.total_blocks), + '-c', + str(1), + '-u', + userpart_path, + '-o', + syspart, + ], cwd=outputdir) + prc.wait() + if prc.returncode != 0: + print 'ERROR: unable to create system partition' + return prc.returncode + else: + print '...System partition created' + + print '\tCreating rawprogram1.xml and patch1.xml', + prc = subprocess.Popen(['python', ptool, '-x', emmc_partition, '-p', '1'], cwd=outputdir) + prc.wait() + if prc.returncode != 0: + print 'ERROR: unable to create rawprogram1.xml and patch1.xml' + return prc.returncode + else: + print '...rawprogram1.xml and patch1.xml created' + + rawprogram_path = os.path.join(outputdir, 'rawprogram1.xml') + patch_path = os.path.join(outputdir, 'patch1.xml') + + print '\t rawprogram' + rawprogram_path + print '\t patch' + patch_path + + print '\tRunning msp.py to update gpt_main0.bin partition', + prc = subprocess.Popen([ + 'python', + msp, + '-r', + rawprogram_path, + '-p', + patch_path, + '-d', + str(emmc_total_blocks), + '-n', + ], cwd=outputdir) + prc.wait() + if prc.returncode != 0: + print 'ERROR: unable to create system partition' + return prc.returncode + else: + print '...System partition created' + return 0 + +def main(): + + global cdir + global ARCH_NAME + global outputdir + + funcdict = { + 'nor': process_nor, + 'tiny-nor': process_nor, + 'nand': process_nand, + 'norplusnand': process_norplusnand, + 'emmc': process_emmc, + 'norplusemmc': process_norplusemmc, + 'tiny-nor-debug': process_nor + } + + if len(sys.argv) > 1: + try: + opts, args = getopt(sys.argv[1:], "c:f:o:") + except GetoptError, e: + print "Configuration xml, flash type and output path are needed to generate cdt files" + raise + + for option, value in opts: + if option == "-c": + config_path = value + if option == "-o": + outputdir = value + if option == "-f": + flash_type = value + print flash_type + else: + print "Configuration xml, flash type and output path are needed to generate cdt files" + + if funcdict[flash_type](config_path, flash_type) < 0: + return -1 + +if __name__ == '__main__': + main() diff --git a/scripts/nand_mbn_generator.py b/scripts/nand_mbn_generator.py new file mode 100644 index 0000000..afdda09 --- /dev/null +++ b/scripts/nand_mbn_generator.py @@ -0,0 +1,178 @@ +# =========================================================================== +#Copyright (c) 2017 Qualcomm Technologies, Inc. +#All Rights Reserved. +#Confidential and Proprietary - Qualcomm Technologies, Inc. +# =========================================================================== + +import re +import sys + +c_file_name = "boot_cdt_array.c" +debug = True + +if len(sys.argv) < 3: + print "Usage: cdt_generator.py filename.xml binfile.bin" + sys.exit(1); + +filename = sys.argv[1] +bin_file_name = sys.argv[2] +token_stack = [] +ignore_tags = ['comment', 'img_name', 'layout'] +xml_comment_tag = '!--' +partitions_parent_tag_name = "partition" +partition_table_header_size = 16 +partition_entry_size = 28 +num_partition_entries = 32 +full_file_length = (partition_table_header_size + (partition_entry_size * num_partition_entries)) +header = [] +metadata = [] +blockdata = [] +footer = [] +all_data = [] + +def clean_string(some_string): + from string import printable + some_string = "".join([ ch for ch in some_string if ch in printable ]) + some_string = some_string.replace("\n", "") + some_string = some_string.replace("\r", "") + return some_string + +def strip_hex(hex_string): + if len(hex_string) < 3 or not (hex_string[:2] == "0x" or hex_string[:2] == "0X"): + return hex_string + return hex_string[2:] + +def little_endian(hex_string): + if len(hex_string) % 2 != 0: + print "%s is an invalid value to convert to little endian!" % (hex_string) + return + swap_list = [] + for i in range(0, len(hex_string), 2): + swap_list.insert(0, hex_string[i:i+2]) + return ''.join(swap_list) + +def get_attribute(token, att_name): + tag = get_tag_name(token) + tag_att_list = re.split('\s+', strip_tags(token)) + tag_att_list.remove(tag) + for att in tag_att_list: + att_val = att.split("=") + if len(att_val) == 2 and att_val[0] == att_name: + return att_val[1].strip('"').strip("'") + return None + +def pad_string(token, length, rightjust=True): + if len(token) >= length: + return token + else: + return (rightjust and token.rjust(length, '0') or token.ljust(length, '0')) + +def is_tag(token): + return (len(token) > 2 and token[0] == '<' and token[-1] == '>') + +def strip_tags(token): + if is_tag(token): + return token[1:-1] + +def is_closing_tag(token): + return (is_tag(token) and token[1] == '/') + +def get_tag_name(tag): + if is_closing_tag(tag): + return tag[2:-1] + else: + tag_split = re.split('\s+', tag[1:-1]) + return tag_split[0] + +def process_tag(tag): + tag_name = get_tag_name(tag) + parent_tag_name = len(token_stack) >= 2 and get_tag_name(token_stack[-2]) or "" + + if is_closing_tag(tag): + if tag_name == partitions_parent_tag_name: + if len(metadata) == 0: + metadata.append(1) + else: + metadata[0] = metadata[0] + 1 + +def process_data(data, token_stack): + tag = token_stack[-1] + tag_name = get_tag_name(tag) + parent_tag_name = len(token_stack) >= 2 and get_tag_name(token_stack[-2]) or "" + + if tag_name in ignore_tags: + return + + clean_data = data + data_length = get_attribute(tag, "length") + data_type = get_attribute(tag, "type") + if not data_type == "string": + clean_data = "%02X" % eval(clean_data) + else: + clean_data = "".join(["%02x" % ord(x) for x in clean_data]) + if not data_length is None: + data_length = int(data_length) + clean_data = pad_string(clean_data, data_length * 2, data_type != "string") + + data_endianness = get_attribute(tag, "endian") + # assuming big-endian by default + # assuming 'string's need to be converted to little endian + if not data_type == "string" or ((not data_endianness is None) and data_endianness.lower() == "little"): + clean_data = little_endian(clean_data) + + if not parent_tag_name == partitions_parent_tag_name: + header.append(clean_data) + else: + blockdata.append(clean_data) + +def generate_metadata(): + if len(metadata) > 0: + metadata[0] = little_endian(pad_string("%02X" % metadata[0], 4*2)) + +def generate_footer(): + current_file_len = 0 + for x in all_data: + current_file_len = current_file_len + len(x)/2 + footer.append("0" * 2 * (full_file_length - current_file_len)) + +def write_bin_file(filename, data): + fp = open(filename, 'wb') + for i in range(0, len(data), 2): + data_item = data[i:i+2] + fp.write(chr(int(data_item, 16))) + fp.close() + +file_string = open(filename, 'r').read() +file_string = re.sub(r'>\s+', ">", file_string) +file_string = re.sub(r'\s+<', "<", file_string) +file_string = clean_string(file_string) + +# A token is either a tag i.e. <[^>\s]*> or it is a (non-tag) value i.e. [^<>]+ +#splitter = re.compile('(<\/?\S+[^>]*>|[^<>]+)') +splitter = re.compile('(<[^>]*>|[^<>]+)') +token_list = splitter.findall(file_string) + +for token in token_list: + #print "Processing", token + if is_tag(token): + if get_tag_name(token) == xml_comment_tag or get_tag_name(token) == "?xml": + continue + if is_closing_tag(token): + token_stack.pop() + else: + token_stack.append(token) + process_tag(token) + else: + process_data(token, token_stack) + +generate_metadata() + +all_data.extend(header) +all_data.extend(metadata) +all_data.extend(blockdata) + +generate_footer() + +all_data.extend(footer) +all_data = "".join(all_data) +write_bin_file(bin_file_name, all_data) diff --git a/命令.txt b/命令.txt new file mode 100644 index 0000000..210e296 --- /dev/null +++ b/命令.txt @@ -0,0 +1 @@ +python prepareSingleImage.py --arch ipq6018 --fltype nand --genpart \ No newline at end of file diff --git a/说明.txt b/说明.txt new file mode 100644 index 0000000..97132c6 --- /dev/null +++ b/说明.txt @@ -0,0 +1,3 @@ +修改nand-partition.xml +运行命令 +找到nand-system-partition-ipq6018.bin \ No newline at end of file