Loading arch/arm64/boot/dts/qcom/kona-camera.dtsi +4 −1 Original line number Diff line number Diff line Loading @@ -1088,7 +1088,10 @@ <400000000 0 600000000 0>; clock-cntl-level = "svs", "turbo"; fw_name = "CAMERA_ICP.elf"; ubwc-cfg = <0x7B 0x1EF>; ubwc-ipe-fetch-cfg = <0x707b 0x7083>; ubwc-ipe-write-cfg = <0x161ef 0x1620f>; ubwc-bps-fetch-cfg = <0x707b 0x7083>; ubwc-bps-write-cfg = <0x161ef 0x1620f>; status = "ok"; }; Loading drivers/media/platform/msm/camera/cam_icp/fw_inc/hfi_intf.h +10 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. */ #ifndef _HFI_INTF_H_ Loading Loading @@ -131,8 +131,17 @@ int hfi_set_fw_dump_level(uint32_t lvl); */ int hfi_enable_ipe_bps_pc(bool enable, uint32_t core_info); /** * hfi_cmd_ubwc_config_ext() - UBWC configuration to firmware * @ubwc_ipe_cfg: UBWC ipe fetch/write configuration params * @ubwc_bps_cfg: UBWC bps fetch/write configuration params */ int hfi_cmd_ubwc_config_ext(uint32_t *ubwc_ipe_cfg, uint32_t *ubwc_bps_cfg); /** * hfi_cmd_ubwc_config() - UBWC configuration to firmware * for older targets * @ubwc_cfg: UBWC configuration parameters */ int hfi_cmd_ubwc_config(uint32_t *ubwc_cfg); Loading drivers/media/platform/msm/camera/cam_icp/fw_inc/hfi_sys_defs.h +20 −8 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. */ #ifndef _HFI_DEFS_H_ Loading Loading @@ -154,6 +154,7 @@ #define HFI_PROP_SYS_SUPPORTED (HFI_PROPERTY_ICP_COMMON_START + 0x4) #define HFI_PROP_SYS_IPEBPS_PC (HFI_PROPERTY_ICP_COMMON_START + 0x5) #define HFI_PROP_SYS_FW_DUMP_CFG (HFI_PROPERTY_ICP_COMMON_START + 0x8) #define HFI_PROPERTY_SYS_UBWC_CONFIG_EX (HFI_PROPERTY_ICP_COMMON_START + 0x9) /* Capabilities reported at sys init */ #define HFI_CAPS_PLACEHOLDER_1 (HFI_COMMON_BASE + 0x1) Loading Loading @@ -274,7 +275,18 @@ struct hfi_ipe_bps_pc { struct hfi_cmd_ubwc_cfg { uint32_t ubwc_fetch_cfg; uint32_t ubwc_write_cfg; }; } __packed; /** * struct hfi_cmd_ubwc_cfg_ext * Payload structure to configure HFI_UBWC_CFG_TYPE_EXT * @bps: UBWC configuration for bps * @ipe: UBWC configuration for ipe */ struct hfi_cmd_ubwc_cfg_ext { struct hfi_cmd_ubwc_cfg bps; struct hfi_cmd_ubwc_cfg ipe; } __packed; /** * struct hfi_cmd_sys_init Loading drivers/media/platform/msm/camera/cam_icp/hfi.c +41 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. */ #include <linux/io.h> Loading Loading @@ -280,6 +280,10 @@ int hfi_cmd_ubwc_config(uint32_t *ubwc_cfg) size = sizeof(struct hfi_cmd_prop) + sizeof(struct hfi_cmd_ubwc_cfg); CAM_DBG(CAM_HFI, "size of ubwc %u, ubwc_cfg [rd-0x%x,wr-0x%x]", size, ubwc_cfg[0], ubwc_cfg[1]); prop = kzalloc(size, GFP_KERNEL); if (!prop) return -ENOMEM; Loading @@ -298,6 +302,42 @@ int hfi_cmd_ubwc_config(uint32_t *ubwc_cfg) return 0; } int hfi_cmd_ubwc_config_ext(uint32_t *ubwc_ipe_cfg, uint32_t *ubwc_bps_cfg) { uint8_t *prop; struct hfi_cmd_prop *dbg_prop; uint32_t size = 0; size = sizeof(struct hfi_cmd_prop) + sizeof(struct hfi_cmd_ubwc_cfg_ext); CAM_DBG(CAM_HFI, "size of ubwc %u, ubwc_ipe_cfg[rd-0x%x,wr-0x%x] ubwc_bps_cfg[rd-0x%x,wr-0x%x]", size, ubwc_ipe_cfg[0], ubwc_ipe_cfg[1], ubwc_bps_cfg[0], ubwc_bps_cfg[1]); prop = kzalloc(size, GFP_KERNEL); if (!prop) return -ENOMEM; dbg_prop = (struct hfi_cmd_prop *)prop; dbg_prop->size = size; dbg_prop->pkt_type = HFI_CMD_SYS_SET_PROPERTY; dbg_prop->num_prop = 1; dbg_prop->prop_data[0] = HFI_PROPERTY_SYS_UBWC_CONFIG_EX; dbg_prop->prop_data[1] = ubwc_bps_cfg[0]; dbg_prop->prop_data[2] = ubwc_bps_cfg[1]; dbg_prop->prop_data[3] = ubwc_ipe_cfg[0]; dbg_prop->prop_data[4] = ubwc_ipe_cfg[1]; hfi_write_cmd(prop); kfree(prop); return 0; } int hfi_enable_ipe_bps_pc(bool enable, uint32_t core_info) { uint8_t *prop; Loading drivers/media/platform/msm/camera/cam_icp/icp_hw/a5_hw/a5_core.c +29 −3 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. */ #include <linux/slab.h> Loading Loading @@ -365,6 +365,9 @@ int cam_a5_process_cmd(void *device_priv, uint32_t cmd_type, struct cam_a5_device_hw_info *hw_info = NULL; struct a5_soc_info *a5_soc = NULL; unsigned long flags; uint32_t ubwc_ipe_cfg[ICP_UBWC_MAX] = {0}; uint32_t ubwc_bps_cfg[ICP_UBWC_MAX] = {0}; uint32_t index = 0; int rc = 0; if (!device_priv) { Loading Loading @@ -460,14 +463,37 @@ int cam_a5_process_cmd(void *device_priv, uint32_t cmd_type, core_info->cpas_start = false; } break; case CAM_ICP_A5_CMD_UBWC_CFG: case CAM_ICP_A5_CMD_UBWC_CFG: { struct a5_ubwc_cfg_ext *ubwc_cfg_ext = NULL; a5_soc = soc_info->soc_private; if (!a5_soc) { CAM_ERR(CAM_ICP, "A5 private soc info is NULL"); return -EINVAL; } rc = hfi_cmd_ubwc_config(a5_soc->ubwc_cfg); if (a5_soc->ubwc_config_ext) { /* Invoke kernel API to determine DDR type */ if (of_fdt_get_ddrtype() == DDR_TYPE_LPDDR5) index = 1; ubwc_cfg_ext = &a5_soc->uconfig.ubwc_cfg_ext; ubwc_ipe_cfg[0] = ubwc_cfg_ext->ubwc_ipe_fetch_cfg[index]; ubwc_ipe_cfg[1] = ubwc_cfg_ext->ubwc_ipe_write_cfg[index]; ubwc_bps_cfg[0] = ubwc_cfg_ext->ubwc_bps_fetch_cfg[index]; ubwc_bps_cfg[1] = ubwc_cfg_ext->ubwc_bps_write_cfg[index]; rc = hfi_cmd_ubwc_config_ext(&ubwc_ipe_cfg[0], &ubwc_bps_cfg[0]); } else { rc = hfi_cmd_ubwc_config(a5_soc->uconfig.ubwc_cfg); } break; } default: break; } Loading Loading
arch/arm64/boot/dts/qcom/kona-camera.dtsi +4 −1 Original line number Diff line number Diff line Loading @@ -1088,7 +1088,10 @@ <400000000 0 600000000 0>; clock-cntl-level = "svs", "turbo"; fw_name = "CAMERA_ICP.elf"; ubwc-cfg = <0x7B 0x1EF>; ubwc-ipe-fetch-cfg = <0x707b 0x7083>; ubwc-ipe-write-cfg = <0x161ef 0x1620f>; ubwc-bps-fetch-cfg = <0x707b 0x7083>; ubwc-bps-write-cfg = <0x161ef 0x1620f>; status = "ok"; }; Loading
drivers/media/platform/msm/camera/cam_icp/fw_inc/hfi_intf.h +10 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. */ #ifndef _HFI_INTF_H_ Loading Loading @@ -131,8 +131,17 @@ int hfi_set_fw_dump_level(uint32_t lvl); */ int hfi_enable_ipe_bps_pc(bool enable, uint32_t core_info); /** * hfi_cmd_ubwc_config_ext() - UBWC configuration to firmware * @ubwc_ipe_cfg: UBWC ipe fetch/write configuration params * @ubwc_bps_cfg: UBWC bps fetch/write configuration params */ int hfi_cmd_ubwc_config_ext(uint32_t *ubwc_ipe_cfg, uint32_t *ubwc_bps_cfg); /** * hfi_cmd_ubwc_config() - UBWC configuration to firmware * for older targets * @ubwc_cfg: UBWC configuration parameters */ int hfi_cmd_ubwc_config(uint32_t *ubwc_cfg); Loading
drivers/media/platform/msm/camera/cam_icp/fw_inc/hfi_sys_defs.h +20 −8 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. */ #ifndef _HFI_DEFS_H_ Loading Loading @@ -154,6 +154,7 @@ #define HFI_PROP_SYS_SUPPORTED (HFI_PROPERTY_ICP_COMMON_START + 0x4) #define HFI_PROP_SYS_IPEBPS_PC (HFI_PROPERTY_ICP_COMMON_START + 0x5) #define HFI_PROP_SYS_FW_DUMP_CFG (HFI_PROPERTY_ICP_COMMON_START + 0x8) #define HFI_PROPERTY_SYS_UBWC_CONFIG_EX (HFI_PROPERTY_ICP_COMMON_START + 0x9) /* Capabilities reported at sys init */ #define HFI_CAPS_PLACEHOLDER_1 (HFI_COMMON_BASE + 0x1) Loading Loading @@ -274,7 +275,18 @@ struct hfi_ipe_bps_pc { struct hfi_cmd_ubwc_cfg { uint32_t ubwc_fetch_cfg; uint32_t ubwc_write_cfg; }; } __packed; /** * struct hfi_cmd_ubwc_cfg_ext * Payload structure to configure HFI_UBWC_CFG_TYPE_EXT * @bps: UBWC configuration for bps * @ipe: UBWC configuration for ipe */ struct hfi_cmd_ubwc_cfg_ext { struct hfi_cmd_ubwc_cfg bps; struct hfi_cmd_ubwc_cfg ipe; } __packed; /** * struct hfi_cmd_sys_init Loading
drivers/media/platform/msm/camera/cam_icp/hfi.c +41 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. */ #include <linux/io.h> Loading Loading @@ -280,6 +280,10 @@ int hfi_cmd_ubwc_config(uint32_t *ubwc_cfg) size = sizeof(struct hfi_cmd_prop) + sizeof(struct hfi_cmd_ubwc_cfg); CAM_DBG(CAM_HFI, "size of ubwc %u, ubwc_cfg [rd-0x%x,wr-0x%x]", size, ubwc_cfg[0], ubwc_cfg[1]); prop = kzalloc(size, GFP_KERNEL); if (!prop) return -ENOMEM; Loading @@ -298,6 +302,42 @@ int hfi_cmd_ubwc_config(uint32_t *ubwc_cfg) return 0; } int hfi_cmd_ubwc_config_ext(uint32_t *ubwc_ipe_cfg, uint32_t *ubwc_bps_cfg) { uint8_t *prop; struct hfi_cmd_prop *dbg_prop; uint32_t size = 0; size = sizeof(struct hfi_cmd_prop) + sizeof(struct hfi_cmd_ubwc_cfg_ext); CAM_DBG(CAM_HFI, "size of ubwc %u, ubwc_ipe_cfg[rd-0x%x,wr-0x%x] ubwc_bps_cfg[rd-0x%x,wr-0x%x]", size, ubwc_ipe_cfg[0], ubwc_ipe_cfg[1], ubwc_bps_cfg[0], ubwc_bps_cfg[1]); prop = kzalloc(size, GFP_KERNEL); if (!prop) return -ENOMEM; dbg_prop = (struct hfi_cmd_prop *)prop; dbg_prop->size = size; dbg_prop->pkt_type = HFI_CMD_SYS_SET_PROPERTY; dbg_prop->num_prop = 1; dbg_prop->prop_data[0] = HFI_PROPERTY_SYS_UBWC_CONFIG_EX; dbg_prop->prop_data[1] = ubwc_bps_cfg[0]; dbg_prop->prop_data[2] = ubwc_bps_cfg[1]; dbg_prop->prop_data[3] = ubwc_ipe_cfg[0]; dbg_prop->prop_data[4] = ubwc_ipe_cfg[1]; hfi_write_cmd(prop); kfree(prop); return 0; } int hfi_enable_ipe_bps_pc(bool enable, uint32_t core_info) { uint8_t *prop; Loading
drivers/media/platform/msm/camera/cam_icp/icp_hw/a5_hw/a5_core.c +29 −3 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. */ #include <linux/slab.h> Loading Loading @@ -365,6 +365,9 @@ int cam_a5_process_cmd(void *device_priv, uint32_t cmd_type, struct cam_a5_device_hw_info *hw_info = NULL; struct a5_soc_info *a5_soc = NULL; unsigned long flags; uint32_t ubwc_ipe_cfg[ICP_UBWC_MAX] = {0}; uint32_t ubwc_bps_cfg[ICP_UBWC_MAX] = {0}; uint32_t index = 0; int rc = 0; if (!device_priv) { Loading Loading @@ -460,14 +463,37 @@ int cam_a5_process_cmd(void *device_priv, uint32_t cmd_type, core_info->cpas_start = false; } break; case CAM_ICP_A5_CMD_UBWC_CFG: case CAM_ICP_A5_CMD_UBWC_CFG: { struct a5_ubwc_cfg_ext *ubwc_cfg_ext = NULL; a5_soc = soc_info->soc_private; if (!a5_soc) { CAM_ERR(CAM_ICP, "A5 private soc info is NULL"); return -EINVAL; } rc = hfi_cmd_ubwc_config(a5_soc->ubwc_cfg); if (a5_soc->ubwc_config_ext) { /* Invoke kernel API to determine DDR type */ if (of_fdt_get_ddrtype() == DDR_TYPE_LPDDR5) index = 1; ubwc_cfg_ext = &a5_soc->uconfig.ubwc_cfg_ext; ubwc_ipe_cfg[0] = ubwc_cfg_ext->ubwc_ipe_fetch_cfg[index]; ubwc_ipe_cfg[1] = ubwc_cfg_ext->ubwc_ipe_write_cfg[index]; ubwc_bps_cfg[0] = ubwc_cfg_ext->ubwc_bps_fetch_cfg[index]; ubwc_bps_cfg[1] = ubwc_cfg_ext->ubwc_bps_write_cfg[index]; rc = hfi_cmd_ubwc_config_ext(&ubwc_ipe_cfg[0], &ubwc_bps_cfg[0]); } else { rc = hfi_cmd_ubwc_config(a5_soc->uconfig.ubwc_cfg); } break; } default: break; } Loading