mirror of
https://github.com/LuckfoxTECH/luckfox-pico.git
synced 2026-01-19 17:59:18 +01:00
project:build.sh: Added fastboot support; custom modifications to U-Boot and kernel implemented using patches.
project:cfg:BoardConfig_IPC: Added fastboot BoardConfig file and firmware post-scripts, distinguishing between the BoardConfigs for Luckfox Pico Pro and Luckfox Pico Max. project:app: Added fastboot_client and rk_smart_door for quick boot applications; updated rkipc app to adapt to the latest media library. media:samples: Added more usage examples. media:rockit: Fixed bugs; removed support for retrieving data frames from VPSS. media:isp: Updated rkaiq library and related tools to support connection to RKISP_Tuner. sysdrv:Makefile: Added support for compiling drv_ko on Luckfox Pico Ultra W using Ubuntu; added support for custom root filesystem. sysdrv:tools:board: Updated Buildroot optional mirror sources, updated some software versions, and stored device tree files and configuration files that undergo multiple modifications for U-Boot and kernel separately. sysdrv:source:mcu: Used RISC-V MCU SDK with RT-Thread system, mainly for initializing camera AE during quick boot. sysdrv:source:uboot: Added support for fastboot; added high baud rate DDR bin for serial firmware upgrades. sysdrv:source:kernel: Upgraded to version 5.10.160; increased NPU frequency for RV1106G3; added support for fastboot. Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
@@ -166,40 +166,22 @@ struct ubifs_global_debug_info {
|
||||
dbg_snprintf_key(c, key, __tmp_key_buf, DBG_KEY_BUF_LEN)); \
|
||||
} while (0)
|
||||
#else
|
||||
#define ubifs_assert(expr) do { \
|
||||
if (unlikely(!(expr))) { \
|
||||
pr_debug("UBIFS assert failed in %s at %u\n", \
|
||||
__func__, __LINE__); \
|
||||
dump_stack(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define ubifs_assert_cmt_locked(c) do { \
|
||||
if (unlikely(down_write_trylock(&(c)->commit_sem))) { \
|
||||
up_write(&(c)->commit_sem); \
|
||||
pr_debug("commit lock is not locked!\n"); \
|
||||
ubifs_assert(0); \
|
||||
} \
|
||||
} while (0)
|
||||
#include <log.h>
|
||||
#define ubifs_assert(expr) assert(expr)
|
||||
#define ubifs_assert_cmt_locked(c) do { } while (0)
|
||||
|
||||
#define ubifs_dbg_msg(type, fmt, ...) \
|
||||
pr_debug("UBIFS DBG " type ": " fmt "\n", \
|
||||
##__VA_ARGS__)
|
||||
|
||||
#define DBG_KEY_BUF_LEN 48
|
||||
#if defined CONFIG_MTD_DEBUG
|
||||
#define ubifs_dbg_msg_key(type, key, fmt, ...) do { \
|
||||
char __tmp_key_buf[DBG_KEY_BUF_LEN]; \
|
||||
pr_debug("UBIFS DBG " type ": " fmt "%s\n", \
|
||||
##__VA_ARGS__, \
|
||||
dbg_snprintf_key(c, key, __tmp_key_buf, DBG_KEY_BUF_LEN)); \
|
||||
} while (0)
|
||||
#else
|
||||
#define ubifs_dbg_msg_key(type, key, fmt, ...) do { \
|
||||
pr_debug("UBIFS DBG\n"); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ int ubifs_leb_read(const struct ubifs_info *c, int lnum, void *buf, int offs,
|
||||
int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs,
|
||||
int len)
|
||||
{
|
||||
int err;
|
||||
int err = 0;
|
||||
|
||||
ubifs_assert(!c->ro_media && !c->ro_mount);
|
||||
if (c->ro_error)
|
||||
@@ -133,7 +133,7 @@ int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs,
|
||||
|
||||
int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len)
|
||||
{
|
||||
int err;
|
||||
int err = 0;
|
||||
|
||||
ubifs_assert(!c->ro_media && !c->ro_mount);
|
||||
if (c->ro_error)
|
||||
@@ -155,7 +155,7 @@ int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len)
|
||||
|
||||
int ubifs_leb_unmap(struct ubifs_info *c, int lnum)
|
||||
{
|
||||
int err;
|
||||
int err = 0;
|
||||
|
||||
ubifs_assert(!c->ro_media && !c->ro_mount);
|
||||
if (c->ro_error)
|
||||
@@ -176,7 +176,7 @@ int ubifs_leb_unmap(struct ubifs_info *c, int lnum)
|
||||
|
||||
int ubifs_leb_map(struct ubifs_info *c, int lnum)
|
||||
{
|
||||
int err;
|
||||
int err = 0;
|
||||
|
||||
ubifs_assert(!c->ro_media && !c->ro_mount);
|
||||
if (c->ro_error)
|
||||
|
||||
@@ -1749,6 +1749,8 @@ void ubifs_umount(struct ubifs_info *c)
|
||||
kfree(c->bottom_up_buf);
|
||||
ubifs_debugging_exit(c);
|
||||
#ifdef __UBOOT__
|
||||
ubi_close_volume(c->ubi);
|
||||
mutex_unlock(&c->umount_mutex);
|
||||
/* Finally free U-Boot's global copy of superblock */
|
||||
if (ubifs_sb != NULL) {
|
||||
free(ubifs_sb->s_fs_info);
|
||||
@@ -2050,9 +2052,9 @@ static void ubifs_put_super(struct super_block *sb)
|
||||
ubifs_umount(c);
|
||||
#ifndef __UBOOT__
|
||||
bdi_destroy(&c->bdi);
|
||||
#endif
|
||||
ubi_close_volume(c->ubi);
|
||||
mutex_unlock(&c->umount_mutex);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2319,6 +2321,9 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
|
||||
|
||||
out_umount:
|
||||
ubifs_umount(c);
|
||||
#ifdef __UBOOT__
|
||||
goto out;
|
||||
#endif
|
||||
out_unlock:
|
||||
mutex_unlock(&c->umount_mutex);
|
||||
#ifndef __UBOOT__
|
||||
@@ -2356,7 +2361,9 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags)
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
#ifndef __UBOOT__
|
||||
INIT_HLIST_NODE(&s->s_instances);
|
||||
#endif
|
||||
INIT_LIST_HEAD(&s->s_inodes);
|
||||
s->s_time_gran = 1000000000;
|
||||
s->s_flags = flags;
|
||||
@@ -2425,14 +2432,12 @@ retry:
|
||||
#ifndef __UBOOT__
|
||||
strlcpy(s->s_id, type->name, sizeof(s->s_id));
|
||||
list_add_tail(&s->s_list, &super_blocks);
|
||||
#else
|
||||
strncpy(s->s_id, type->name, sizeof(s->s_id));
|
||||
#endif
|
||||
hlist_add_head(&s->s_instances, &type->fs_supers);
|
||||
#ifndef __UBOOT__
|
||||
spin_unlock(&sb_lock);
|
||||
get_filesystem(type);
|
||||
register_shrinker(&s->s_shrink);
|
||||
#else
|
||||
strncpy(s->s_id, type->name, sizeof(s->s_id));
|
||||
#endif
|
||||
return s;
|
||||
}
|
||||
@@ -2457,7 +2462,7 @@ static struct dentry *ubifs_mount(struct file_system_type *fs_type, int flags,
|
||||
*/
|
||||
ubi = open_ubi(name, UBI_READONLY);
|
||||
if (IS_ERR(ubi)) {
|
||||
pr_err("UBIFS error (pid: %d): cannot open \"%s\", error %d",
|
||||
pr_err("UBIFS error (pid: %d): cannot open \"%s\", error %d\n",
|
||||
current->pid, name, (int)PTR_ERR(ubi));
|
||||
return ERR_CAST(ubi);
|
||||
}
|
||||
@@ -2599,7 +2604,7 @@ int ubifs_init(void)
|
||||
* UBIFS_BLOCK_SIZE. It is assumed that both are powers of 2.
|
||||
*/
|
||||
if (PAGE_CACHE_SIZE < UBIFS_BLOCK_SIZE) {
|
||||
pr_err("UBIFS error (pid %d): VFS page cache size is %u bytes, but UBIFS requires at least 4096 bytes",
|
||||
pr_err("UBIFS error (pid %d): VFS page cache size is %u bytes, but UBIFS requires at least 4096 bytes\n",
|
||||
current->pid, (unsigned int)PAGE_CACHE_SIZE);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -2628,7 +2633,7 @@ int ubifs_init(void)
|
||||
|
||||
err = register_filesystem(&ubifs_fs_type);
|
||||
if (err) {
|
||||
pr_err("UBIFS error (pid %d): cannot register file system, error %d",
|
||||
pr_err("UBIFS error (pid %d): cannot register file system, error %d\n",
|
||||
current->pid, err);
|
||||
goto out_dbg;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,11 @@ enum {
|
||||
NOT_ON_MEDIA = 3,
|
||||
};
|
||||
|
||||
static int try_read_node(const struct ubifs_info *c, void *buf, int type,
|
||||
int len, int lnum, int offs);
|
||||
static int fallible_read_node(struct ubifs_info *c, const union ubifs_key *key,
|
||||
struct ubifs_zbranch *zbr, void *node);
|
||||
|
||||
/**
|
||||
* insert_old_idx - record an index node obsoleted since the last commit start.
|
||||
* @c: UBIFS file-system description object
|
||||
@@ -398,7 +403,19 @@ static int tnc_read_node_nm(struct ubifs_info *c, struct ubifs_zbranch *zbr,
|
||||
return 0;
|
||||
}
|
||||
|
||||
err = ubifs_tnc_read_node(c, zbr, node);
|
||||
if (c->replaying) {
|
||||
err = fallible_read_node(c, &zbr->key, zbr, node);
|
||||
/*
|
||||
* When the node was not found, return -ENOENT, 0 otherwise.
|
||||
* Negative return codes stay as-is.
|
||||
*/
|
||||
if (err == 0)
|
||||
err = -ENOENT;
|
||||
else if (err == 1)
|
||||
err = 0;
|
||||
} else {
|
||||
err = ubifs_tnc_read_node(c, zbr, node);
|
||||
}
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -2766,7 +2783,11 @@ struct ubifs_dent_node *ubifs_tnc_next_ent(struct ubifs_info *c,
|
||||
if (nm->name) {
|
||||
if (err) {
|
||||
/* Handle collisions */
|
||||
err = resolve_collision(c, key, &znode, &n, nm);
|
||||
if (c->replaying)
|
||||
err = fallible_resolve_collision(c, key, &znode, &n,
|
||||
nm, 0);
|
||||
else
|
||||
err = resolve_collision(c, key, &znode, &n, nm);
|
||||
dbg_tnc("rc returned %d, znode %p, n %d",
|
||||
err, znode, n);
|
||||
if (unlikely(err < 0))
|
||||
|
||||
@@ -126,6 +126,7 @@ crypto_comp_decompress(const struct ubifs_info *c, struct crypto_comp *tfm,
|
||||
{
|
||||
struct ubifs_compressor *compr = ubifs_compressors[tfm->compressor];
|
||||
int err;
|
||||
size_t tmp_len = *dlen;
|
||||
|
||||
if (compr->compr_type == UBIFS_COMPR_NONE) {
|
||||
memcpy(dst, src, slen);
|
||||
@@ -133,11 +134,12 @@ crypto_comp_decompress(const struct ubifs_info *c, struct crypto_comp *tfm,
|
||||
return 0;
|
||||
}
|
||||
|
||||
err = compr->decompress(src, slen, dst, (size_t *)dlen);
|
||||
err = compr->decompress(src, slen, dst, &tmp_len);
|
||||
if (err)
|
||||
ubifs_err(c, "cannot decompress %d bytes, compressor %s, "
|
||||
"error %d", slen, compr->name, err);
|
||||
|
||||
*dlen = tmp_len;
|
||||
return err;
|
||||
|
||||
return 0;
|
||||
@@ -466,14 +468,10 @@ out:
|
||||
dbg_gen("cannot find next direntry, error %d", err);
|
||||
|
||||
out_free:
|
||||
if (file->private_data)
|
||||
kfree(file->private_data);
|
||||
if (file)
|
||||
free(file);
|
||||
if (dentry)
|
||||
free(dentry);
|
||||
if (dir)
|
||||
free(dir);
|
||||
kfree(file->private_data);
|
||||
free(file);
|
||||
free(dentry);
|
||||
free(dir);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -801,6 +799,8 @@ static int do_readpage(struct ubifs_info *c, struct inode *inode,
|
||||
|
||||
if (last_block_size)
|
||||
dlen = last_block_size;
|
||||
else if (ret)
|
||||
dlen = UBIFS_BLOCK_SIZE;
|
||||
else
|
||||
dlen = le32_to_cpu(dn->size);
|
||||
|
||||
|
||||
@@ -317,8 +317,8 @@ struct super_block {
|
||||
struct backing_dev_info *s_bdi;
|
||||
#endif
|
||||
struct mtd_info *s_mtd;
|
||||
struct hlist_node s_instances;
|
||||
#ifndef __UBOOT__
|
||||
struct hlist_node s_instances;
|
||||
struct quota_info s_dquot; /* Diskquota specific options */
|
||||
#endif
|
||||
|
||||
@@ -611,16 +611,20 @@ static inline ino_t parent_ino(struct dentry *dentry)
|
||||
/* misc.h */
|
||||
#define mutex_lock_nested(...)
|
||||
#define mutex_unlock_nested(...)
|
||||
#define mutex_is_locked(...) 0
|
||||
#define mutex_is_locked(...) 1
|
||||
#endif
|
||||
|
||||
/* Version of this UBIFS implementation */
|
||||
#define UBIFS_VERSION 1
|
||||
|
||||
/* Normal UBIFS messages */
|
||||
#ifdef CONFIG_UBIFS_SILENCE_MSG
|
||||
#define ubifs_msg(c, fmt, ...)
|
||||
#else
|
||||
#define ubifs_msg(c, fmt, ...) \
|
||||
pr_notice("UBIFS (ubi%d:%d): " fmt "\n", \
|
||||
(c)->vi.ubi_num, (c)->vi.vol_id, ##__VA_ARGS__)
|
||||
#endif
|
||||
/* UBIFS error messages */
|
||||
#ifndef __UBOOT__
|
||||
#define ubifs_err(c, fmt, ...) \
|
||||
|
||||
Reference in New Issue
Block a user