mirror of
https://github.com/LuckfoxTECH/luckfox-pico.git
synced 2026-01-19 09:52:31 +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:
@@ -332,7 +332,7 @@ static int __init arc_rimi_init(void)
|
||||
dev->irq = 9;
|
||||
|
||||
if (arcrimi_probe(dev)) {
|
||||
free_netdev(dev);
|
||||
free_arcdev(dev);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ static void __exit arc_rimi_exit(void)
|
||||
iounmap(lp->mem_start);
|
||||
release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1);
|
||||
free_irq(dev->irq, dev);
|
||||
free_netdev(dev);
|
||||
free_arcdev(dev);
|
||||
}
|
||||
|
||||
#ifndef MODULE
|
||||
|
||||
@@ -298,6 +298,10 @@ struct arcnet_local {
|
||||
|
||||
int excnak_pending; /* We just got an excesive nak interrupt */
|
||||
|
||||
/* RESET flag handling */
|
||||
int reset_in_progress;
|
||||
struct work_struct reset_work;
|
||||
|
||||
struct {
|
||||
uint16_t sequence; /* sequence number (incs with each packet) */
|
||||
__be16 aborted_seq;
|
||||
@@ -350,7 +354,9 @@ void arcnet_dump_skb(struct net_device *dev, struct sk_buff *skb, char *desc)
|
||||
|
||||
void arcnet_unregister_proto(struct ArcProto *proto);
|
||||
irqreturn_t arcnet_interrupt(int irq, void *dev_id);
|
||||
|
||||
struct net_device *alloc_arcdev(const char *name);
|
||||
void free_arcdev(struct net_device *dev);
|
||||
|
||||
int arcnet_open(struct net_device *dev);
|
||||
int arcnet_close(struct net_device *dev);
|
||||
|
||||
@@ -387,10 +387,44 @@ static void arcnet_timer(struct timer_list *t)
|
||||
struct arcnet_local *lp = from_timer(lp, t, timer);
|
||||
struct net_device *dev = lp->dev;
|
||||
|
||||
if (!netif_carrier_ok(dev)) {
|
||||
spin_lock_irq(&lp->lock);
|
||||
|
||||
if (!lp->reset_in_progress && !netif_carrier_ok(dev)) {
|
||||
netif_carrier_on(dev);
|
||||
netdev_info(dev, "link up\n");
|
||||
}
|
||||
|
||||
spin_unlock_irq(&lp->lock);
|
||||
}
|
||||
|
||||
static void reset_device_work(struct work_struct *work)
|
||||
{
|
||||
struct arcnet_local *lp;
|
||||
struct net_device *dev;
|
||||
|
||||
lp = container_of(work, struct arcnet_local, reset_work);
|
||||
dev = lp->dev;
|
||||
|
||||
/* Do not bring the network interface back up if an ifdown
|
||||
* was already done.
|
||||
*/
|
||||
if (!netif_running(dev) || !lp->reset_in_progress)
|
||||
return;
|
||||
|
||||
rtnl_lock();
|
||||
|
||||
/* Do another check, in case of an ifdown that was triggered in
|
||||
* the small race window between the exit condition above and
|
||||
* acquiring RTNL.
|
||||
*/
|
||||
if (!netif_running(dev) || !lp->reset_in_progress)
|
||||
goto out;
|
||||
|
||||
dev_close(dev);
|
||||
dev_open(dev, NULL);
|
||||
|
||||
out:
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
||||
static void arcnet_reply_tasklet(unsigned long data)
|
||||
@@ -452,12 +486,25 @@ struct net_device *alloc_arcdev(const char *name)
|
||||
lp->dev = dev;
|
||||
spin_lock_init(&lp->lock);
|
||||
timer_setup(&lp->timer, arcnet_timer, 0);
|
||||
INIT_WORK(&lp->reset_work, reset_device_work);
|
||||
}
|
||||
|
||||
return dev;
|
||||
}
|
||||
EXPORT_SYMBOL(alloc_arcdev);
|
||||
|
||||
void free_arcdev(struct net_device *dev)
|
||||
{
|
||||
struct arcnet_local *lp = netdev_priv(dev);
|
||||
|
||||
/* Do not cancel this at ->ndo_close(), as the workqueue itself
|
||||
* indirectly calls the ifdown path through dev_close().
|
||||
*/
|
||||
cancel_work_sync(&lp->reset_work);
|
||||
free_netdev(dev);
|
||||
}
|
||||
EXPORT_SYMBOL(free_arcdev);
|
||||
|
||||
/* Open/initialize the board. This is called sometime after booting when
|
||||
* the 'ifconfig' program is run.
|
||||
*
|
||||
@@ -587,6 +634,10 @@ int arcnet_close(struct net_device *dev)
|
||||
|
||||
/* shut down the card */
|
||||
lp->hw.close(dev);
|
||||
|
||||
/* reset counters */
|
||||
lp->reset_in_progress = 0;
|
||||
|
||||
module_put(lp->hw.owner);
|
||||
return 0;
|
||||
}
|
||||
@@ -820,6 +871,9 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
|
||||
|
||||
spin_lock_irqsave(&lp->lock, flags);
|
||||
|
||||
if (lp->reset_in_progress)
|
||||
goto out;
|
||||
|
||||
/* RESET flag was enabled - if device is not running, we must
|
||||
* clear it right away (but nothing else).
|
||||
*/
|
||||
@@ -852,11 +906,14 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
|
||||
if (status & RESETflag) {
|
||||
arc_printk(D_NORMAL, dev, "spurious reset (status=%Xh)\n",
|
||||
status);
|
||||
arcnet_close(dev);
|
||||
arcnet_open(dev);
|
||||
|
||||
lp->reset_in_progress = 1;
|
||||
netif_stop_queue(dev);
|
||||
netif_carrier_off(dev);
|
||||
schedule_work(&lp->reset_work);
|
||||
|
||||
/* get out of the interrupt handler! */
|
||||
break;
|
||||
goto out;
|
||||
}
|
||||
/* RX is inhibited - we must have received something.
|
||||
* Prepare to receive into the next buffer.
|
||||
@@ -1052,6 +1109,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
|
||||
udelay(1);
|
||||
lp->hw.intmask(dev, lp->intmask);
|
||||
|
||||
out:
|
||||
spin_unlock_irqrestore(&lp->lock, flags);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ static int __init com20020_init(void)
|
||||
dev->irq = 9;
|
||||
|
||||
if (com20020isa_probe(dev)) {
|
||||
free_netdev(dev);
|
||||
free_arcdev(dev);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ static void __exit com20020_exit(void)
|
||||
unregister_netdev(my_dev);
|
||||
free_irq(my_dev->irq, my_dev);
|
||||
release_region(my_dev->base_addr, ARCNET_TOTAL_SIZE);
|
||||
free_netdev(my_dev);
|
||||
free_arcdev(my_dev);
|
||||
}
|
||||
|
||||
#ifndef MODULE
|
||||
|
||||
@@ -294,7 +294,7 @@ static void com20020pci_remove(struct pci_dev *pdev)
|
||||
|
||||
unregister_netdev(dev);
|
||||
free_irq(dev->irq, dev);
|
||||
free_netdev(dev);
|
||||
free_arcdev(dev);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,6 +113,7 @@ static int com20020_probe(struct pcmcia_device *p_dev)
|
||||
struct com20020_dev *info;
|
||||
struct net_device *dev;
|
||||
struct arcnet_local *lp;
|
||||
int ret = -ENOMEM;
|
||||
|
||||
dev_dbg(&p_dev->dev, "com20020_attach()\n");
|
||||
|
||||
@@ -142,12 +143,18 @@ static int com20020_probe(struct pcmcia_device *p_dev)
|
||||
info->dev = dev;
|
||||
p_dev->priv = info;
|
||||
|
||||
return com20020_config(p_dev);
|
||||
ret = com20020_config(p_dev);
|
||||
if (ret)
|
||||
goto fail_config;
|
||||
|
||||
return 0;
|
||||
|
||||
fail_config:
|
||||
free_arcdev(dev);
|
||||
fail_alloc_dev:
|
||||
kfree(info);
|
||||
fail_alloc_info:
|
||||
return -ENOMEM;
|
||||
return ret;
|
||||
} /* com20020_attach */
|
||||
|
||||
static void com20020_detach(struct pcmcia_device *link)
|
||||
@@ -177,7 +184,7 @@ static void com20020_detach(struct pcmcia_device *link)
|
||||
dev = info->dev;
|
||||
if (dev) {
|
||||
dev_dbg(&link->dev, "kfree...\n");
|
||||
free_netdev(dev);
|
||||
free_arcdev(dev);
|
||||
}
|
||||
dev_dbg(&link->dev, "kfree2...\n");
|
||||
kfree(info);
|
||||
|
||||
@@ -396,7 +396,7 @@ static int __init com90io_init(void)
|
||||
err = com90io_probe(dev);
|
||||
|
||||
if (err) {
|
||||
free_netdev(dev);
|
||||
free_arcdev(dev);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@ static void __exit com90io_exit(void)
|
||||
|
||||
free_irq(dev->irq, dev);
|
||||
release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
|
||||
free_netdev(dev);
|
||||
free_arcdev(dev);
|
||||
}
|
||||
|
||||
module_init(com90io_init)
|
||||
|
||||
@@ -554,7 +554,7 @@ err_free_irq:
|
||||
err_release_mem:
|
||||
release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1);
|
||||
err_free_dev:
|
||||
free_netdev(dev);
|
||||
free_arcdev(dev);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
@@ -672,7 +672,7 @@ static void __exit com90xx_exit(void)
|
||||
release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
|
||||
release_mem_region(dev->mem_start,
|
||||
dev->mem_end - dev->mem_start + 1);
|
||||
free_netdev(dev);
|
||||
free_arcdev(dev);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user