From e58cd453d58b20c6a6f34d3591640aa19aa14d25 Mon Sep 17 00:00:00 2001 From: Claudiu Beznea Date: Fri, 4 Feb 2022 15:57:50 +0200 Subject: at91: add kernel support for sama7g5 soc Add kernel support for SAMA7G5 by back-porting mainline kernel patches. Among SAMA7G5 features could be remembered: - ARM Cortex-A7 - double data rate multi-port dynamic RAM controller supporting DDR2, DDR3, DDR3L, LPDDR2, LPDDR3 up to 533MHz - peripherals for audio, video processing - 1 gigabit + 1 megabit Ethernet controllers - 6 CAN controllers - trust zone support - DVFS for CPU - criptography IPs Signed-off-by: Claudiu Beznea --- ...-atmel-isc-create-callback-for-RLP-submod.patch | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 target/linux/at91/patches-5.10/179-media-atmel-atmel-isc-create-callback-for-RLP-submod.patch (limited to 'target/linux/at91/patches-5.10/179-media-atmel-atmel-isc-create-callback-for-RLP-submod.patch') diff --git a/target/linux/at91/patches-5.10/179-media-atmel-atmel-isc-create-callback-for-RLP-submod.patch b/target/linux/at91/patches-5.10/179-media-atmel-atmel-isc-create-callback-for-RLP-submod.patch new file mode 100644 index 0000000000..74a08b2209 --- /dev/null +++ b/target/linux/at91/patches-5.10/179-media-atmel-atmel-isc-create-callback-for-RLP-submod.patch @@ -0,0 +1,104 @@ +From ece1d7059731e31875e6eb464da4fb4a16465305 Mon Sep 17 00:00:00 2001 +From: Eugen Hristev +Date: Tue, 13 Apr 2021 12:57:21 +0200 +Subject: [PATCH 179/247] media: atmel: atmel-isc: create callback for RLP + submodule product specific + +The RLP submodule is a part of the atmel-isc pipeline, and stands for +Rounding,Limiting and Packaging. It used to extract specific data from the +ISC pipeline. For example if we want to output greyscale 8 bit, we would +use limiting to 8 bits, and packaging to Luma component only. + +Create a product specific callback for initializing the RLP submodule +of the pipeline + +[hverkuil: made isc_sama5d2_config_rlp static] + +Signed-off-by: Eugen Hristev +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +--- + drivers/media/platform/atmel/atmel-isc-base.c | 6 ++---- + drivers/media/platform/atmel/atmel-isc.h | 3 +++ + drivers/media/platform/atmel/atmel-sama5d2-isc.c | 10 ++++++++++ + 3 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c +index aef0d6570d39..67c16ca17672 100644 +--- a/drivers/media/platform/atmel/atmel-isc-base.c ++++ b/drivers/media/platform/atmel/atmel-isc-base.c +@@ -719,11 +719,10 @@ static void isc_set_histogram(struct isc_device *isc, bool enable) + static int isc_configure(struct isc_device *isc) + { + struct regmap *regmap = isc->regmap; +- u32 pfe_cfg0, rlp_mode, dcfg, mask, pipeline; ++ u32 pfe_cfg0, dcfg, mask, pipeline; + struct isc_subdev_entity *subdev = isc->current_subdev; + + pfe_cfg0 = isc->config.sd_format->pfe_cfg0_bps; +- rlp_mode = isc->config.rlp_cfg_mode; + pipeline = isc->config.bits_pipeline; + + dcfg = isc->config.dcfg_imode | isc->dcfg; +@@ -736,8 +735,7 @@ static int isc_configure(struct isc_device *isc) + + regmap_update_bits(regmap, ISC_PFE_CFG0, mask, pfe_cfg0); + +- regmap_update_bits(regmap, ISC_RLP_CFG + isc->offsets.rlp, +- ISC_RLP_CFG_MODE_MASK, rlp_mode); ++ isc->config_rlp(isc); + + regmap_write(regmap, ISC_DCFG + isc->offsets.dma, dcfg); + +diff --git a/drivers/media/platform/atmel/atmel-isc.h b/drivers/media/platform/atmel/atmel-isc.h +index 151997c11f56..24006327c5e4 100644 +--- a/drivers/media/platform/atmel/atmel-isc.h ++++ b/drivers/media/platform/atmel/atmel-isc.h +@@ -230,6 +230,8 @@ struct isc_reg_offsets { + * specific CC module + * @config_gam: pointer to a function that initializes product + * specific GAMMA module ++ * @config_rlp: pointer to a function that initializes product ++ * specific RLP module + * @config_ctrls: pointer to a functoin that initializes product + * specific v4l2 controls. + * +@@ -308,6 +310,7 @@ struct isc_device { + void (*config_cbc)(struct isc_device *isc); + void (*config_cc)(struct isc_device *isc); + void (*config_gam)(struct isc_device *isc); ++ void (*config_rlp)(struct isc_device *isc); + + void (*config_ctrls)(struct isc_device *isc, + const struct v4l2_ctrl_ops *ops); +diff --git a/drivers/media/platform/atmel/atmel-sama5d2-isc.c b/drivers/media/platform/atmel/atmel-sama5d2-isc.c +index b99849ecb8a1..86704a1a24b9 100644 +--- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c ++++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c +@@ -117,6 +117,15 @@ static void isc_sama5d2_config_gam(struct isc_device *isc) + /* No specific gamma configuration */ + } + ++static void isc_sama5d2_config_rlp(struct isc_device *isc) ++{ ++ struct regmap *regmap = isc->regmap; ++ u32 rlp_mode = isc->config.rlp_cfg_mode; ++ ++ regmap_update_bits(regmap, ISC_RLP_CFG + isc->offsets.rlp, ++ ISC_RLP_CFG_MODE_MASK, rlp_mode); ++} ++ + /* Gamma table with gamma 1/2.2 */ + static const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES] = { + /* 0 --> gamma 1/1.8 */ +@@ -288,6 +297,7 @@ static int atmel_isc_probe(struct platform_device *pdev) + isc->config_cbc = isc_sama5d2_config_cbc; + isc->config_cc = isc_sama5d2_config_cc; + isc->config_gam = isc_sama5d2_config_gam; ++ isc->config_rlp = isc_sama5d2_config_rlp; + isc->config_ctrls = isc_sama5d2_config_ctrls; + + isc->offsets.csc = ISC_SAMA5D2_CSC_OFFSET; +-- +2.32.0 + -- cgit v1.2.3