From f82936570778b6c2b5927f68f82e72092f2d09e1 Mon Sep 17 00:00:00 2001 From: Changhuang Liang Date: Fri, 12 Jan 2024 17:27:46 +0800 Subject: media: starfive: Update flush l2cache interface Improve l2cache flush performance. And adjust ISP sc buffer size in pixel format. Signed-off-by: Changhuang Liang --- drivers/media/platform/starfive/v4l2_driver/stf_video.c | 10 +++++----- drivers/media/platform/starfive/v4l2_driver/stf_vin.c | 13 ++++++++++--- drivers/media/platform/starfive/v4l2_driver/stf_vin.h | 3 +++ 3 files changed, 18 insertions(+), 8 deletions(-) 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); -- cgit v1.2.3 From 7b114bea7be5d1fc76ce44320c31dd4bd1bc9d9c Mon Sep 17 00:00:00 2001 From: "leo.lu" Date: Thu, 18 Jan 2024 15:32:01 +0800 Subject: binfmt: kernel support misc binaries debian enable systemd-binfmt service Signed-off-by: Leo Lu --- arch/riscv/configs/starfive_jh7110_defconfig | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v1.2.3 From c5d9e34f45ab37d8aa4df633b5c01f7946bbcfe5 Mon Sep 17 00:00:00 2001 From: Ziv Xu Date: Fri, 19 Jan 2024 15:22:55 +0800 Subject: drivers: mtd: gigadevice: add gd25lq256d 32M flash support add gd25lq256d 32M flash support Signed-off-by: Ziv Xu --- drivers/mtd/spi-nor/gigadevice.c | 4 ++++ 1 file changed, 4 insertions(+) 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) -- cgit v1.2.3