mirror of
https://github.com/LuckfoxTECH/luckfox-pico.git
synced 2026-01-18 11:38: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:
@@ -136,6 +136,7 @@ struct gc1084 {
|
||||
const char *module_facing;
|
||||
const char *module_name;
|
||||
const char *len_name;
|
||||
enum rkmodule_sync_mode sync_mode;
|
||||
u32 cur_vts;
|
||||
|
||||
bool has_init_exp;
|
||||
@@ -152,6 +153,27 @@ static const s64 link_freq_menu_items[] = {
|
||||
MIPI_FREQ_400M,
|
||||
};
|
||||
|
||||
static const struct reg_sequence gc1084_master_mode_regs[] = {
|
||||
{0x0068, 0x85},
|
||||
{0x0d6a, 0x80},
|
||||
{0x0069, 0x00},
|
||||
{0x006a, 0x02},
|
||||
{0x0d69, 0x04},
|
||||
};
|
||||
|
||||
static const struct reg_sequence gc1084_slave_mode_regs[] = {
|
||||
{0x0d67, 0x00},
|
||||
{0x0d69, 0x03},
|
||||
{0x0d6a, 0x08},
|
||||
{0x0d6b, 0x50},
|
||||
{0x0d6c, 0x00},
|
||||
{0x0d6d, 0x53},
|
||||
{0x0d6e, 0x00},
|
||||
{0x0d6f, 0x10},
|
||||
{0x0d70, 0x00},
|
||||
{0x0d71, 0x12},
|
||||
};
|
||||
|
||||
/*
|
||||
* window size=1280*720 mipi@1lane
|
||||
* mclk=27M mipi_clk=400Mbps
|
||||
@@ -629,6 +651,7 @@ static long gc1084_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
|
||||
u32 stream = 0;
|
||||
u64 delay_us = 0;
|
||||
u32 fps = 0;
|
||||
u32 *sync_mode = NULL;
|
||||
|
||||
switch (cmd) {
|
||||
case RKMODULE_GET_HDR_CFG:
|
||||
@@ -655,6 +678,14 @@ static long gc1084_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
|
||||
usleep_range(delay_us, delay_us + 2000);
|
||||
}
|
||||
break;
|
||||
case RKMODULE_GET_SYNC_MODE:
|
||||
sync_mode = (u32 *)arg;
|
||||
*sync_mode = gc1084->sync_mode;
|
||||
break;
|
||||
case RKMODULE_SET_SYNC_MODE:
|
||||
sync_mode = (u32 *)arg;
|
||||
gc1084->sync_mode = *sync_mode;
|
||||
break;
|
||||
default:
|
||||
ret = -ENOIOCTLCMD;
|
||||
break;
|
||||
@@ -686,6 +717,25 @@ static int __gc1084_start_stream(struct gc1084 *gc1084)
|
||||
}
|
||||
}
|
||||
|
||||
if (gc1084->sync_mode == INTERNAL_MASTER_MODE) {
|
||||
ret = regmap_multi_reg_write(gc1084->regmap, gc1084_master_mode_regs,
|
||||
ARRAY_SIZE(gc1084_master_mode_regs));
|
||||
if (ret)
|
||||
dev_err(gc1084->dev,
|
||||
"write internal master mode reg failed %d\n", ret);
|
||||
} else if (gc1084->sync_mode == EXTERNAL_MASTER_MODE) {
|
||||
ret = regmap_multi_reg_write(gc1084->regmap, gc1084_slave_mode_regs,
|
||||
ARRAY_SIZE(gc1084_slave_mode_regs));
|
||||
if (ret)
|
||||
dev_err(gc1084->dev,
|
||||
"write external master mode reg failed %d\n", ret);
|
||||
} else if (gc1084->sync_mode == SLAVE_MODE) {
|
||||
ret = regmap_multi_reg_write(gc1084->regmap, gc1084_slave_mode_regs,
|
||||
ARRAY_SIZE(gc1084_slave_mode_regs));
|
||||
if (ret)
|
||||
dev_err(gc1084->dev, "write slave mode reg failed %d\n", ret);
|
||||
}
|
||||
|
||||
return gc1084_write_reg(gc1084, GC1084_REG_CTRL_MODE,
|
||||
GC1084_MODE_STREAMING);
|
||||
}
|
||||
@@ -707,6 +757,7 @@ static long gc1084_compat_ioctl32(struct v4l2_subdev *sd,
|
||||
struct preisp_hdrae_exp_s *hdrae;
|
||||
long ret = 0;
|
||||
u32 stream = 0;
|
||||
u32 sync_mode;
|
||||
|
||||
switch (cmd) {
|
||||
case RKMODULE_GET_MODULE_INFO:
|
||||
@@ -774,6 +825,21 @@ static long gc1084_compat_ioctl32(struct v4l2_subdev *sd,
|
||||
else
|
||||
ret = -EFAULT;
|
||||
break;
|
||||
case RKMODULE_GET_SYNC_MODE:
|
||||
ret = gc1084_ioctl(sd, cmd, &sync_mode);
|
||||
if (!ret) {
|
||||
ret = copy_to_user(up, &sync_mode, sizeof(u32));
|
||||
if (ret)
|
||||
ret = -EFAULT;
|
||||
}
|
||||
break;
|
||||
case RKMODULE_SET_SYNC_MODE:
|
||||
ret = copy_from_user(&sync_mode, up, sizeof(u32));
|
||||
if (!ret)
|
||||
ret = gc1084_ioctl(sd, cmd, &sync_mode);
|
||||
else
|
||||
ret = -EFAULT;
|
||||
break;
|
||||
default:
|
||||
ret = -ENOIOCTLCMD;
|
||||
break;
|
||||
@@ -839,9 +905,7 @@ static int gc1084_g_frame_interval(struct v4l2_subdev *sd,
|
||||
struct gc1084 *gc1084 = to_gc1084(sd);
|
||||
const struct gc1084_mode *mode = gc1084->cur_mode;
|
||||
|
||||
mutex_lock(&gc1084->lock);
|
||||
fi->interval = mode->max_fps;
|
||||
mutex_unlock(&gc1084->lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1098,6 +1162,7 @@ static int gc1084_probe(struct i2c_client *client,
|
||||
struct v4l2_subdev *sd;
|
||||
char facing[2];
|
||||
int ret;
|
||||
const char *sync_mode_name = NULL;
|
||||
|
||||
dev_info(dev, "driver version: %02x.%02x.%02x",
|
||||
DRIVER_VERSION >> 16,
|
||||
@@ -1128,6 +1193,20 @@ static int gc1084_probe(struct i2c_client *client,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = of_property_read_string(node, RKMODULE_CAMERA_SYNC_MODE,
|
||||
&sync_mode_name);
|
||||
if (ret) {
|
||||
gc1084->sync_mode = NO_SYNC_MODE;
|
||||
dev_err(dev, "could not get sync mode!\n");
|
||||
} else {
|
||||
if (strcmp(sync_mode_name, RKMODULE_EXTERNAL_MASTER_MODE) == 0)
|
||||
gc1084->sync_mode = EXTERNAL_MASTER_MODE;
|
||||
else if (strcmp(sync_mode_name, RKMODULE_INTERNAL_MASTER_MODE) == 0)
|
||||
gc1084->sync_mode = INTERNAL_MASTER_MODE;
|
||||
else if (strcmp(sync_mode_name, RKMODULE_SLAVE_MODE) == 0)
|
||||
gc1084->sync_mode = SLAVE_MODE;
|
||||
}
|
||||
|
||||
gc1084->xvclk = devm_clk_get(gc1084->dev, "xvclk");
|
||||
if (IS_ERR(gc1084->xvclk)) {
|
||||
dev_err(gc1084->dev, "Failed to get xvclk\n");
|
||||
|
||||
Reference in New Issue
Block a user