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:
@@ -11,8 +11,6 @@
|
||||
#include <linux/smp.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/seq_file.h>
|
||||
|
||||
/* The anchor node sits above the top of the usable address space */
|
||||
#define IOVA_ANCHOR ~0UL
|
||||
@@ -27,66 +25,6 @@ static void init_iova_rcaches(struct iova_domain *iovad);
|
||||
static void free_iova_rcaches(struct iova_domain *iovad);
|
||||
static void fq_destroy_all_entries(struct iova_domain *iovad);
|
||||
static void fq_flush_timeout(struct timer_list *t);
|
||||
static void iova_dump(struct iova_domain *iovad);
|
||||
|
||||
static int iova_used_show(struct seq_file *s, void *v)
|
||||
{
|
||||
struct iova_domain *iovad = s->private;
|
||||
struct iova *iova, *t;
|
||||
unsigned long flags;
|
||||
unsigned long used_pfn = 0;
|
||||
unsigned int cpu;
|
||||
int i = 0;
|
||||
|
||||
for_each_online_cpu(cpu)
|
||||
free_cpu_cached_iovas(cpu, iovad);
|
||||
free_global_cached_iovas(iovad);
|
||||
|
||||
spin_lock_irqsave(&iovad->iova_rbtree_lock, flags);
|
||||
rbtree_postorder_for_each_entry_safe(iova, t, &iovad->rbroot, node) {
|
||||
dma_addr_t start = iova->pfn_lo << iova_shift(iovad);
|
||||
dma_addr_t end = iova->pfn_hi << iova_shift(iovad);
|
||||
unsigned long pfn = iova->pfn_hi + 1 - iova->pfn_lo;
|
||||
|
||||
if ((iova->pfn_hi == IOVA_ANCHOR) || (iova->pfn_lo == IOVA_ANCHOR))
|
||||
continue;
|
||||
|
||||
seq_printf(s, "%4d: [%pad..%pad] %6luKiB (%4lu - %4lu)MiB\n",
|
||||
i++, &start, &end,
|
||||
pfn << (PAGE_SHIFT - 10),
|
||||
iova->pfn_lo >> (20 - PAGE_SHIFT),
|
||||
(iova->pfn_hi + 1) >> (20 - PAGE_SHIFT));
|
||||
used_pfn += pfn;
|
||||
}
|
||||
spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags);
|
||||
seq_printf(s, "used: %lu MiB\n", used_pfn >> (20 - PAGE_SHIFT));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct proc_dir_entry *iova_dir;
|
||||
|
||||
void init_iova_domain_procfs(struct iova_domain *iovad, const char *name)
|
||||
{
|
||||
struct proc_dir_entry *root;
|
||||
|
||||
remove_proc_subtree(name, iova_dir);
|
||||
root = proc_mkdir(name, iova_dir);
|
||||
if (!root)
|
||||
return;
|
||||
|
||||
proc_create_single_data("used", 0, root, iova_used_show, iovad);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(init_iova_domain_procfs);
|
||||
|
||||
static int __init iova_procfs_create(void)
|
||||
{
|
||||
if (!iova_dir)
|
||||
iova_dir = proc_mkdir("iova", NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
subsys_initcall(iova_procfs_create);
|
||||
|
||||
void
|
||||
init_iova_domain(struct iova_domain *iovad, unsigned long granule,
|
||||
@@ -280,7 +218,7 @@ static int __alloc_and_insert_iova_range(struct iova_domain *iovad,
|
||||
|
||||
curr = __get_cached_rbnode(iovad, limit_pfn);
|
||||
curr_iova = rb_entry(curr, struct iova, node);
|
||||
low_pfn_new = curr_iova->pfn_hi + 1;
|
||||
low_pfn_new = curr_iova->pfn_hi;
|
||||
|
||||
retry:
|
||||
do {
|
||||
@@ -294,7 +232,7 @@ retry:
|
||||
if (high_pfn < size || new_pfn < low_pfn) {
|
||||
if (low_pfn == iovad->start_pfn && low_pfn_new < limit_pfn) {
|
||||
high_pfn = limit_pfn;
|
||||
low_pfn = low_pfn_new;
|
||||
low_pfn = low_pfn_new + 1;
|
||||
curr = &iovad->anchor.node;
|
||||
curr_iova = rb_entry(curr, struct iova, node);
|
||||
goto retry;
|
||||
@@ -585,10 +523,8 @@ retry:
|
||||
if (!new_iova) {
|
||||
unsigned int cpu;
|
||||
|
||||
if (!flush_rcache) {
|
||||
iova_dump(iovad);
|
||||
if (!flush_rcache)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Try replenishing IOVAs by flushing rcache. */
|
||||
flush_rcache = false;
|
||||
@@ -951,32 +887,6 @@ struct iova_cpu_rcache {
|
||||
struct iova_magazine *prev;
|
||||
};
|
||||
|
||||
static void iova_dump(struct iova_domain *iovad)
|
||||
{
|
||||
struct iova *iova, *t;
|
||||
unsigned long flags;
|
||||
unsigned long used_pfn = 0;
|
||||
int i = 0;
|
||||
|
||||
spin_lock_irqsave(&iovad->iova_rbtree_lock, flags);
|
||||
rbtree_postorder_for_each_entry_safe(iova, t, &iovad->rbroot, node) {
|
||||
dma_addr_t start = iova->pfn_lo << iova_shift(iovad);
|
||||
dma_addr_t end = iova->pfn_hi << iova_shift(iovad);
|
||||
unsigned long pfn = iova->pfn_hi + 1 - iova->pfn_lo;
|
||||
|
||||
if (iova->pfn_lo == IOVA_ANCHOR)
|
||||
continue;
|
||||
|
||||
pr_info("%4d: [%pad..%pad] (%4lu - %4lu)MiB\n",
|
||||
i++, &start, &end,
|
||||
iova->pfn_lo >> (20 - PAGE_SHIFT),
|
||||
iova->pfn_hi >> (20 - PAGE_SHIFT));
|
||||
used_pfn += pfn;
|
||||
}
|
||||
spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags);
|
||||
pr_info("used: %lu MiB\n", used_pfn >> (20 - PAGE_SHIFT));
|
||||
}
|
||||
|
||||
static struct iova_magazine *iova_magazine_alloc(gfp_t flags)
|
||||
{
|
||||
return kzalloc(sizeof(struct iova_magazine), flags);
|
||||
|
||||
Reference in New Issue
Block a user