X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=package%2Fboot%2Fkobs-ng%2Fpatches%2F002-add-init-size-param.patch;fp=package%2Fboot%2Fkobs-ng%2Fpatches%2F002-add-init-size-param.patch;h=e0e89b2aec989729b0682a44a611d851150499a2;hb=42e179aed9680aae4c41a4b3a112fcefc5315869;hp=0000000000000000000000000000000000000000;hpb=978076c67ed10c3c6484664ca6fb36f75acbbc66;p=openwrt.git diff --git a/package/boot/kobs-ng/patches/002-add-init-size-param.patch b/package/boot/kobs-ng/patches/002-add-init-size-param.patch new file mode 100644 index 0000000000..e0e89b2aec --- /dev/null +++ b/package/boot/kobs-ng/patches/002-add-init-size-param.patch @@ -0,0 +1,42 @@ +--- a/src/main.c ++++ b/src/main.c +@@ -94,6 +94,7 @@ void usage(void) + " [KOBS] boot structures config options\n" + " --chip_0_device_path= .......... Device of boot (default /dev/mtd0)\n" + " --chip_1_device_path= .......... The second chip in case of multichip NAND\n" ++ " --chip_0_size= ................. Override size of chip_0 device\n" + " --search_exponent= ............ NCB field (default 2)\n" + " --data_setup_time= ............ NCB field (default 80)\n" + " --data_hold_time= ............. NCB field (default 60)\n" +--- a/src/mtd.c ++++ b/src/mtd.c +@@ -716,6 +716,11 @@ struct mtd_data *mtd_open(const struct m + goto out; + } + ++ /* override MTD size */ ++ if (md->cfg.chip_0_size) { ++ miu->size = md->cfg.chip_0_size; ++ } ++ + /* verify it's a nand */ + if (miu->type != MTD_NANDFLASH) { + fprintf(stderr, "mtd: device %s not NAND\n", mp->name); +@@ -2914,7 +2919,7 @@ static const struct { + } mtd_int_args[] = { + ARG_IGNORE(chip_count), + ARG_IGNORE(chip_0_offset), +- ARG_IGNORE(chip_0_size), ++ ARG(chip_0_size), + ARG_IGNORE(chip_1_offset), + ARG_IGNORE(chip_1_size), + ARG(search_exponent), +@@ -3107,7 +3112,7 @@ void mtd_cfg_dump(struct mtd_config *cfg + // Pd(chip_count); + Ps(chip_0_device_path); + // Pd(chip_0_offset); +-// Pd(chip_0_size); ++ Pd(chip_0_size); + Ps(chip_1_device_path); + // Pd(chip_1_offset); + // Pd(chip_1_size);