aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-mediatek/patches/100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2022-08-07 12:06:56 +0200
committerDaniel Golle <daniel@makrotopia.org>2022-08-28 20:33:15 +0100
commitd3a337a592bc26be374a70d1aca4aa20080527d4 (patch)
tree10e40ed6084c5e1ad063fbde7e95e5f4d680e067 /package/boot/uboot-mediatek/patches/100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch
parentc09eb08dadae341e7f68d34e9ec3f15afd86e469 (diff)
downloadupstream-d3a337a592bc26be374a70d1aca4aa20080527d4.tar.gz
upstream-d3a337a592bc26be374a70d1aca4aa20080527d4.tar.bz2
upstream-d3a337a592bc26be374a70d1aca4aa20080527d4.zip
uboot-mediatek: additions from MTK SDK
* updated SNAND/SNFI driver brings support for MT7981 * add support for MediaTek NAND Memory bad Block Management (NMBM) (not used for any boards atm, but could be useful in future) * wire up NMBM support for MT7622, MT7629, MT7981 and MT7986 * replace some local patches with updated version from SDK * bring some legacy precompiler symbols which haven't been converted into Kconfig symbols in U-Boot 2022.07, remove when bumbping to U-Boot 2022.10: 100-28-include-configs-mt7986-h-from-SDK.patch Source: https://github.com/mtk-openwrt/u-boot Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/boot/uboot-mediatek/patches/100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch')
-rw-r--r--package/boot/uboot-mediatek/patches/100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/package/boot/uboot-mediatek/patches/100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch b/package/boot/uboot-mediatek/patches/100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch
new file mode 100644
index 0000000000..ba32fa869d
--- /dev/null
+++ b/package/boot/uboot-mediatek/patches/100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch
@@ -0,0 +1,58 @@
+From dd66fc817f7ab7a4fcab9836a9251a8f64f329df Mon Sep 17 00:00:00 2001
+From: Weijie Gao <weijie.gao@mediatek.com>
+Date: Mon, 25 Jul 2022 16:58:36 +0800
+Subject: [PATCH 59/71] cmd: ubi: make volume find/create/remove APIs public
+
+Export ubi_create_vol/ubi_find_volume/ubi_remove_vol to public so that they
+can be used by other programs.
+
+Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
+---
+ cmd/ubi.c | 8 ++++----
+ include/ubi_uboot.h | 4 ++++
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+--- a/cmd/ubi.c
++++ b/cmd/ubi.c
+@@ -148,8 +148,8 @@ bad:
+ return err;
+ }
+
+-static int ubi_create_vol(char *volume, int64_t size, int dynamic, int vol_id,
+- bool skipcheck)
++int ubi_create_vol(char *volume, int64_t size, int dynamic, int vol_id,
++ bool skipcheck)
+ {
+ struct ubi_mkvol_req req;
+ int err;
+@@ -182,7 +182,7 @@ static int ubi_create_vol(char *volume,
+ return ubi_create_volume(ubi, &req);
+ }
+
+-static struct ubi_volume *ubi_find_volume(char *volume)
++struct ubi_volume *ubi_find_volume(char *volume)
+ {
+ struct ubi_volume *vol = NULL;
+ int i;
+@@ -197,7 +197,7 @@ static struct ubi_volume *ubi_find_volum
+ return NULL;
+ }
+
+-static int ubi_remove_vol(char *volume)
++int ubi_remove_vol(char *volume)
+ {
+ int err, reserved_pebs, i;
+ struct ubi_volume *vol;
+--- a/include/ubi_uboot.h
++++ b/include/ubi_uboot.h
+@@ -73,6 +73,10 @@ extern void ubi_exit(void);
+ extern int ubi_part(char *part_name, const char *vid_header_offset);
+ extern int ubi_volume_write(char *volume, void *buf, size_t size);
+ extern int ubi_volume_read(char *volume, char *buf, size_t size);
++extern int ubi_create_vol(char *volume, int64_t size, int dynamic, int vol_id,
++ bool skipcheck);
++extern struct ubi_volume *ubi_find_volume(char *volume);
++extern int ubi_remove_vol(char *volume);
+
+ extern struct ubi_device *ubi_devices[];
+ int cmd_ubifs_mount(char *vol_name);