summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Hu <andy.hu@starfivetech.com>2024-01-19 14:08:20 +0300
committerAndy Hu <andy.hu@starfivetech.com>2024-01-19 14:08:20 +0300
commit74e601c225acf225414be32ffa05b0104c8b34c1 (patch)
treec325356d23dbadb81fdef2a0f444cf071f6b7fb4
parent3f773693fa5924edc1b4014e33784f000c807fdc (diff)
parent62875c2a5d2ff08e3aed4b5f9de14ba2386a9dc8 (diff)
downloadlinux-74e601c225acf225414be32ffa05b0104c8b34c1.tar.xz
Merge tag 'JH7110_SDK_6.1_v5.10.6' into vf2-6.1.y-devel
-rw-r--r--arch/riscv/configs/starfive_jh7110_defconfig1
-rw-r--r--drivers/media/platform/starfive/v4l2_driver/stf_video.c10
-rw-r--r--drivers/media/platform/starfive/v4l2_driver/stf_vin.c13
-rw-r--r--drivers/media/platform/starfive/v4l2_driver/stf_vin.h3
-rw-r--r--drivers/mtd/spi-nor/gigadevice.c4
5 files changed, 23 insertions, 8 deletions
diff --git a/arch/riscv/configs/starfive_jh7110_defconfig b/arch/riscv/configs/starfive_jh7110_defconfig
index f7a0609c8540..bab77367e3af 100644
--- a/arch/riscv/configs/starfive_jh7110_defconfig
+++ b/arch/riscv/configs/starfive_jh7110_defconfig
@@ -47,6 +47,7 @@ CONFIG_KVM=m
CONFIG_JUMP_LABEL=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
+CONFIG_BINFMT_MISC=y
CONFIG_CMA=y
CONFIG_NET=y
CONFIG_PACKET=y
diff --git a/drivers/media/platform/starfive/v4l2_driver/stf_video.c b/drivers/media/platform/starfive/v4l2_driver/stf_video.c
index 603e9282d3eb..b6ef9899ae86 100644
--- a/drivers/media/platform/starfive/v4l2_driver/stf_video.c
+++ b/drivers/media/platform/starfive/v4l2_driver/stf_video.c
@@ -216,6 +216,11 @@ static int __video_try_fmt(struct stfcamss_video *video,
pix->height, fi->bpp[0]);
st_info(ST_VIDEO, "i = %d, s = 0x%x\n", i, pix->sizeimage);
}
+
+ if (stf_vin_map_isp_pad(video->id, STF_ISP_PAD_SRC)
+ == STF_ISP_PAD_SRC_SCD_Y)
+ pix->sizeimage = ISP_SCD_Y_BUFFER_SIZE;
+
return 0;
}
@@ -285,11 +290,6 @@ static int video_queue_setup(struct vb2_queue *q,
if (!sizes[0])
st_err(ST_VIDEO, "%s: error size is zero!!!\n", __func__);
}
- if ((stf_vin_map_isp_pad(video->id, STF_ISP_PAD_SRC)
- == STF_ISP_PAD_SRC_SCD_Y) &&
- sizes[0] < ISP_SCD_Y_BUFFER_SIZE) {
- sizes[0] = ISP_SCD_Y_BUFFER_SIZE;
- }
st_info(ST_VIDEO, "%s, planes = %d, size = %d\n",
__func__, *num_planes, sizes[0]);
diff --git a/drivers/media/platform/starfive/v4l2_driver/stf_vin.c b/drivers/media/platform/starfive/v4l2_driver/stf_vin.c
index 656096c94008..9cd0a5dc0296 100644
--- a/drivers/media/platform/starfive/v4l2_driver/stf_vin.c
+++ b/drivers/media/platform/starfive/v4l2_driver/stf_vin.c
@@ -362,7 +362,10 @@ static void vin_buf_l2cache_flush(struct vin_output *output)
if (!list_empty(&output->pending_bufs)) {
list_for_each_entry(buffer, &output->pending_bufs, queue) {
- sifive_l2_flush64_range(buffer->addr[0], buffer->sizeimage);
+ if (buffer->sizeimage > STF_VIN_CRITICAL_CACHE_SIZE)
+ sifive_ccache_flush_entire();
+ else
+ sifive_l2_flush64_range(buffer->addr[0], buffer->sizeimage);
}
}
}
@@ -1171,8 +1174,12 @@ static void vin_buffer_done(struct vin_line *line, struct vin_params *params)
* which will not update cache by default.
* Flush L2 cache to make sure data is updated.
*/
- if (ready_buf->vb.vb2_buf.memory == VB2_MEMORY_MMAP)
- sifive_l2_flush64_range(ready_buf->addr[0], ready_buf->sizeimage);
+ if (ready_buf->vb.vb2_buf.memory == VB2_MEMORY_MMAP) {
+ if (ready_buf->sizeimage > STF_VIN_CRITICAL_CACHE_SIZE)
+ sifive_ccache_flush_entire();
+ else
+ sifive_l2_flush64_range(ready_buf->addr[0], ready_buf->sizeimage);
+ }
vb2_buffer_done(&ready_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
}
diff --git a/drivers/media/platform/starfive/v4l2_driver/stf_vin.h b/drivers/media/platform/starfive/v4l2_driver/stf_vin.h
index 6b331b738440..812e7a91ed9f 100644
--- a/drivers/media/platform/starfive/v4l2_driver/stf_vin.h
+++ b/drivers/media/platform/starfive/v4l2_driver/stf_vin.h
@@ -21,6 +21,8 @@
#define STF_VIN_PAD_SRC 1
#define STF_VIN_PADS_NUM 2
+#define STF_VIN_CRITICAL_CACHE_SIZE 0x80000
+
struct vin2_format {
u32 code;
u8 bpp;
@@ -169,6 +171,7 @@ struct stf_vin2_dev {
};
extern void sifive_l2_flush64_range(unsigned long start, unsigned long len);
+extern void sifive_ccache_flush_entire(void);
extern int stf_vin_subdev_init(struct stfcamss *stfcamss);
extern int stf_vin_register(struct stf_vin2_dev *vin_dev,
struct v4l2_device *v4l2_dev);
diff --git a/drivers/mtd/spi-nor/gigadevice.c b/drivers/mtd/spi-nor/gigadevice.c
index d57ddaf1525b..4a593b72fbf8 100644
--- a/drivers/mtd/spi-nor/gigadevice.c
+++ b/drivers/mtd/spi-nor/gigadevice.c
@@ -62,6 +62,10 @@ static const struct flash_info gigadevice_nor_parts[] = {
FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
SPI_NOR_QUAD_READ) },
+ { "gd25lq256d", INFO(0xc86019, 0, 64 * 1024, 512)
+ FLAGS( SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_QUAD_PP)
+ NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
+ SPI_NOR_QUAD_READ) },
{ "gd25q256", INFO(0xc84019, 0, 64 * 1024, 512)
PARSE_SFDP
FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6)