Revert "msm: camera: isp: Add support for BUS driver version 175"

This reverts commit 7ef5d12446.
The change being reverted was made to add support for new DISP
ports on newer targets. These ports are not present on sdm845
and older targets. Therefore that change is not needed on 4.9
branch.

Change-Id: I766feded6e4d30227a0bad572d5133899d3abc55
Signed-off-by: Vishalsingh Hajeri <vhajeri@codeaurora.org>
This commit is contained in:
Vishalsingh Hajeri 2018-05-17 12:19:39 -07:00
commit 8f6e1ddfa1
13 changed files with 28 additions and 1050 deletions

View file

@ -17,7 +17,7 @@ Required properties:
Usage: required
Value type: <string>
Definition: Should specify the compatibility string for matching the
driver. e.g. "qcom,vfe175", "qcom,vfe170", "qcom,vfe-lite175", "qcom,vfe-lite170".
driver. e.g. "qcom,vfe170", "qcom,vfe-lite170".
- cell-index
Usage: required

View file

@ -23,9 +23,9 @@
/*
* Maximum hw resource - This number is based on the maximum
* output port resource. The current maximum resource number
* is 24.
* is 20.
*/
#define CAM_ISP_CTX_RES_MAX 24
#define CAM_ISP_CTX_RES_MAX 20
/*
* Maximum configuration entry size - This is based on the

View file

@ -12,4 +12,4 @@ ccflags-y += -Idrivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_h
obj-$(CONFIG_SPECTRA_CAMERA) += cam_vfe_soc.o cam_vfe_dev.o cam_vfe_core.o
obj-$(CONFIG_SPECTRA_CAMERA) += vfe_bus/ vfe_top/ vfe17x/
obj-$(CONFIG_SPECTRA_CAMERA) += vfe_bus/ vfe_top/ vfe170/

View file

@ -38,7 +38,7 @@ static uint32_t camif_irq_reg_mask[CAM_IFE_IRQ_REGISTERS_MAX] = {
static uint32_t camif_irq_err_reg_mask[CAM_IFE_IRQ_REGISTERS_MAX] = {
0x0003FC00,
0xEFFF7EBC,
0x0FFF7EBC,
};
static uint32_t rdi_irq_reg_mask[CAM_IFE_IRQ_REGISTERS_MAX] = {

View file

@ -0,0 +1,14 @@
ccflags-y += -Idrivers/media/platform/msm/camera/cam_utils
ccflags-y += -Idrivers/media/platform/msm/camera/cam_core
ccflags-y += -Idrivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/include
ccflags-y += -Idrivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/include
ccflags-y += -Idrivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/hw_utils/include
ccflags-y += -Idrivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/hw_utils/irq_controller
ccflags-y += -Idrivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/include
ccflags-y += -Idrivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/include
ccflags-y += -Idrivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/include
ccflags-y += -Idrivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top
ccflags-y += -Idrivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus
ccflags-y += -Idrivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw
obj-$(CONFIG_SPECTRA_CAMERA) += cam_vfe170.o cam_vfe_lite170.o

View file

@ -0,0 +1,51 @@
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/module.h>
#include "cam_vfe170.h"
#include "cam_vfe_hw_intf.h"
#include "cam_vfe_core.h"
#include "cam_vfe_dev.h"
static const struct of_device_id cam_vfe170_dt_match[] = {
{
.compatible = "qcom,vfe170",
.data = &cam_vfe170_hw_info,
},
{}
};
MODULE_DEVICE_TABLE(of, cam_vfe170_dt_match);
static struct platform_driver cam_vfe170_driver = {
.probe = cam_vfe_probe,
.remove = cam_vfe_remove,
.driver = {
.name = "cam_vfe170",
.owner = THIS_MODULE,
.of_match_table = cam_vfe170_dt_match,
},
};
static int __init cam_vfe170_init_module(void)
{
return platform_driver_register(&cam_vfe170_driver);
}
static void __exit cam_vfe170_exit_module(void)
{
platform_driver_unregister(&cam_vfe170_driver);
}
module_init(cam_vfe170_init_module);
module_exit(cam_vfe170_exit_module);
MODULE_DESCRIPTION("CAM VFE170 driver");
MODULE_LICENSE("GPL v2");

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -10,8 +10,8 @@
* GNU General Public License for more details.
*/
#ifndef _CAM_VFE175_H_
#define _CAM_VFE175_H_
#ifndef _CAM_VFE170_H_
#define _CAM_VFE170_H_
#include "cam_vfe_camif_ver2.h"
#include "cam_vfe_bus_ver2.h"
@ -19,7 +19,7 @@
#include "cam_vfe_top_ver2.h"
#include "cam_vfe_core.h"
static struct cam_irq_register_set vfe175_top_irq_reg_set[2] = {
static struct cam_irq_register_set vfe170_top_irq_reg_set[2] = {
{
.mask_reg_offset = 0x0000005C,
.clear_reg_offset = 0x00000064,
@ -32,14 +32,14 @@ static struct cam_irq_register_set vfe175_top_irq_reg_set[2] = {
},
};
static struct cam_irq_controller_reg_info vfe175_top_irq_reg_info = {
static struct cam_irq_controller_reg_info vfe170_top_irq_reg_info = {
.num_registers = 2,
.irq_reg_set = vfe175_top_irq_reg_set,
.irq_reg_set = vfe170_top_irq_reg_set,
.global_clear_offset = 0x00000058,
.global_clear_bitmask = 0x00000001,
};
static struct cam_vfe_camif_ver2_reg vfe175_camif_reg = {
static struct cam_vfe_camif_ver2_reg vfe170_camif_reg = {
.camif_cmd = 0x00000478,
.camif_config = 0x0000047C,
.line_skip_pattern = 0x00000488,
@ -52,7 +52,7 @@ static struct cam_vfe_camif_ver2_reg vfe175_camif_reg = {
.reg_update_cmd = 0x000004AC,
};
static struct cam_vfe_camif_reg_data vfe_175_camif_reg_data = {
static struct cam_vfe_camif_reg_data vfe_170_camif_reg_data = {
.raw_crop_first_pixel_shift = 16,
.raw_crop_first_pixel_mask = 0xFFFF,
.raw_crop_last_pixel_shift = 0x0,
@ -78,34 +78,34 @@ static struct cam_vfe_camif_reg_data vfe_175_camif_reg_data = {
.reg_update_irq_mask = 0x00000010,
.eof_irq_mask = 0x00000002,
.error_irq_mask0 = 0x0003FC00,
.error_irq_mask1 = 0xEFFF7E80,
.error_irq_mask1 = 0x0FFF7E80,
};
static struct cam_vfe_top_ver2_reg_offset_module_ctrl lens_175_reg = {
struct cam_vfe_top_ver2_reg_offset_module_ctrl lens_170_reg = {
.reset = 0x0000001C,
.cgc_ovd = 0x0000002C,
.enable = 0x00000040,
};
static struct cam_vfe_top_ver2_reg_offset_module_ctrl stats_175_reg = {
struct cam_vfe_top_ver2_reg_offset_module_ctrl stats_170_reg = {
.reset = 0x00000020,
.cgc_ovd = 0x00000030,
.enable = 0x00000044,
};
static struct cam_vfe_top_ver2_reg_offset_module_ctrl color_175_reg = {
struct cam_vfe_top_ver2_reg_offset_module_ctrl color_170_reg = {
.reset = 0x00000024,
.cgc_ovd = 0x00000034,
.enable = 0x00000048,
};
static struct cam_vfe_top_ver2_reg_offset_module_ctrl zoom_175_reg = {
struct cam_vfe_top_ver2_reg_offset_module_ctrl zoom_170_reg = {
.reset = 0x00000028,
.cgc_ovd = 0x00000038,
.enable = 0x0000004C,
};
static struct cam_vfe_top_ver2_reg_offset_common vfe175_top_common_reg = {
static struct cam_vfe_top_ver2_reg_offset_common vfe170_top_common_reg = {
.hw_version = 0x00000000,
.hw_capability = 0x00000004,
.lens_feature = 0x00000008,
@ -114,10 +114,10 @@ static struct cam_vfe_top_ver2_reg_offset_common vfe175_top_common_reg = {
.zoom_feature = 0x00000014,
.global_reset_cmd = 0x00000018,
.module_ctrl = {
&lens_175_reg,
&stats_175_reg,
&color_175_reg,
&zoom_175_reg,
&lens_170_reg,
&stats_170_reg,
&color_170_reg,
&zoom_170_reg,
},
.bus_cgc_ovd = 0x0000003C,
.core_cfg = 0x00000050,
@ -126,42 +126,42 @@ static struct cam_vfe_top_ver2_reg_offset_common vfe175_top_common_reg = {
.reg_update_cmd = 0x000004AC,
};
static struct cam_vfe_rdi_ver2_reg vfe175_rdi_reg = {
static struct cam_vfe_rdi_ver2_reg vfe170_rdi_reg = {
.reg_update_cmd = 0x000004AC,
};
static struct cam_vfe_rdi_reg_data vfe_175_rdi_0_data = {
static struct cam_vfe_rdi_reg_data vfe_170_rdi_0_data = {
.reg_update_cmd_data = 0x2,
.sof_irq_mask = 0x8000000,
.reg_update_irq_mask = 0x20,
};
static struct cam_vfe_rdi_reg_data vfe_175_rdi_1_data = {
static struct cam_vfe_rdi_reg_data vfe_170_rdi_1_data = {
.reg_update_cmd_data = 0x4,
.sof_irq_mask = 0x10000000,
.reg_update_irq_mask = 0x40,
};
static struct cam_vfe_rdi_reg_data vfe_175_rdi_2_data = {
static struct cam_vfe_rdi_reg_data vfe_170_rdi_2_data = {
.reg_update_cmd_data = 0x8,
.sof_irq_mask = 0x20000000,
.reg_update_irq_mask = 0x80,
};
static struct cam_vfe_top_ver2_hw_info vfe175_top_hw_info = {
.common_reg = &vfe175_top_common_reg,
static struct cam_vfe_top_ver2_hw_info vfe170_top_hw_info = {
.common_reg = &vfe170_top_common_reg,
.camif_hw_info = {
.common_reg = &vfe175_top_common_reg,
.camif_reg = &vfe175_camif_reg,
.reg_data = &vfe_175_camif_reg_data,
.common_reg = &vfe170_top_common_reg,
.camif_reg = &vfe170_camif_reg,
.reg_data = &vfe_170_camif_reg_data,
},
.rdi_hw_info = {
.common_reg = &vfe175_top_common_reg,
.rdi_reg = &vfe175_rdi_reg,
.common_reg = &vfe170_top_common_reg,
.rdi_reg = &vfe170_rdi_reg,
.reg_data = {
&vfe_175_rdi_0_data,
&vfe_175_rdi_1_data,
&vfe_175_rdi_2_data,
&vfe_170_rdi_0_data,
&vfe_170_rdi_1_data,
&vfe_170_rdi_2_data,
NULL,
},
},
@ -173,7 +173,7 @@ static struct cam_vfe_top_ver2_hw_info vfe175_top_hw_info = {
},
};
static struct cam_irq_register_set vfe175_bus_irq_reg[3] = {
static struct cam_irq_register_set vfe170_bus_irq_reg[3] = {
{
.mask_reg_offset = 0x00002044,
.clear_reg_offset = 0x00002050,
@ -191,8 +191,7 @@ static struct cam_irq_register_set vfe175_bus_irq_reg[3] = {
},
};
static struct cam_vfe_bus_ver2_reg_offset_ubwc_client
vfe175_ubwc_regs_client_3 = {
static struct cam_vfe_bus_ver2_reg_offset_ubwc_client ubwc_regs_client_3 = {
.tile_cfg = 0x0000252C,
.h_init = 0x00002530,
.v_init = 0x00002534,
@ -203,8 +202,7 @@ static struct cam_vfe_bus_ver2_reg_offset_ubwc_client
.bw_limit = 0x000025A0,
};
static struct cam_vfe_bus_ver2_reg_offset_ubwc_client
vfe175_ubwc_regs_client_4 = {
static struct cam_vfe_bus_ver2_reg_offset_ubwc_client ubwc_regs_client_4 = {
.tile_cfg = 0x0000262C,
.h_init = 0x00002630,
.v_init = 0x00002634,
@ -215,31 +213,7 @@ static struct cam_vfe_bus_ver2_reg_offset_ubwc_client
.bw_limit = 0x000026A0,
};
static struct cam_vfe_bus_ver2_reg_offset_ubwc_client
vfe175_ubwc_regs_client_20 = {
.tile_cfg = 0x0000362C,
.h_init = 0x00003630,
.v_init = 0x00003634,
.meta_addr = 0x00003638,
.meta_offset = 0x0000363C,
.meta_stride = 0x00003640,
.mode_cfg = 0x00003644,
.bw_limit = 0x000036A0,
};
static struct cam_vfe_bus_ver2_reg_offset_ubwc_client
vfe175_ubwc_regs_client_21 = {
.tile_cfg = 0x0000372C,
.h_init = 0x00003730,
.v_init = 0x00003734,
.meta_addr = 0x00003738,
.meta_offset = 0x0000373C,
.meta_stride = 0x00003740,
.mode_cfg = 0x00003744,
.bw_limit = 0x000037A0,
};
static struct cam_vfe_bus_ver2_hw_info vfe175_bus_hw_info = {
static struct cam_vfe_bus_ver2_hw_info vfe170_bus_hw_info = {
.common_reg = {
.hw_version = 0x00002000,
.hw_capability = 0x00002004,
@ -249,7 +223,7 @@ static struct cam_vfe_bus_ver2_hw_info vfe175_bus_hw_info = {
.dual_master_comp_cfg = 0x00002028,
.irq_reg_info = {
.num_registers = 3,
.irq_reg_set = vfe175_bus_irq_reg,
.irq_reg_set = vfe170_bus_irq_reg,
.global_clear_offset = 0x00002068,
.global_clear_bitmask = 0x00000001,
},
@ -261,7 +235,7 @@ static struct cam_vfe_bus_ver2_hw_info vfe175_bus_hw_info = {
.addr_sync_frame_hdr = 0x00002080,
.addr_sync_no_sync = 0x00002084,
},
.num_client = 24,
.num_client = 20,
.bus_client_reg = {
/* BUS Client 0 */
{
@ -345,7 +319,7 @@ static struct cam_vfe_bus_ver2_hw_info vfe175_bus_hw_info = {
.framedrop_pattern = 0x00002554,
.frame_inc = 0x00002558,
.burst_limit = 0x0000255C,
.ubwc_regs = &vfe175_ubwc_regs_client_3,
.ubwc_regs = &ubwc_regs_client_3,
},
/* BUS Client 4 */
{
@ -366,7 +340,7 @@ static struct cam_vfe_bus_ver2_hw_info vfe175_bus_hw_info = {
.framedrop_pattern = 0x00002654,
.frame_inc = 0x00002658,
.burst_limit = 0x0000265C,
.ubwc_regs = &vfe175_ubwc_regs_client_4,
.ubwc_regs = &ubwc_regs_client_4,
},
/* BUS Client 5 */
{
@ -683,90 +657,6 @@ static struct cam_vfe_bus_ver2_hw_info vfe175_bus_hw_info = {
.burst_limit = 0x0000355C,
.ubwc_regs = NULL,
},
/* BUS Client 20 */
{
.status0 = 0x00003600,
.status1 = 0x00003604,
.cfg = 0x00003608,
.header_addr = 0x0000360C,
.header_cfg = 0x00003610,
.image_addr = 0x00003614,
.image_addr_offset = 0x00003618,
.buffer_width_cfg = 0x0000361C,
.buffer_height_cfg = 0x00003620,
.packer_cfg = 0x00003624,
.stride = 0x00003628,
.irq_subsample_period = 0x00003648,
.irq_subsample_pattern = 0x0000364C,
.framedrop_period = 0x00003650,
.framedrop_pattern = 0x00003654,
.frame_inc = 0x00003658,
.burst_limit = 0x0000365C,
.ubwc_regs = &vfe175_ubwc_regs_client_20,
},
/* BUS Client 21 */
{
.status0 = 0x00003700,
.status1 = 0x00003704,
.cfg = 0x00003708,
.header_addr = 0x0000370C,
.header_cfg = 0x00003710,
.image_addr = 0x00003714,
.image_addr_offset = 0x00003718,
.buffer_width_cfg = 0x0000371C,
.buffer_height_cfg = 0x00003720,
.packer_cfg = 0x00003724,
.stride = 0x00003728,
.irq_subsample_period = 0x00003748,
.irq_subsample_pattern = 0x0000374C,
.framedrop_period = 0x00003750,
.framedrop_pattern = 0x00003754,
.frame_inc = 0x00003758,
.burst_limit = 0x0000375C,
.ubwc_regs = &vfe175_ubwc_regs_client_21,
},
/* BUS Client 22 */
{
.status0 = 0x00003800,
.status1 = 0x00003804,
.cfg = 0x00003808,
.header_addr = 0x0000380C,
.header_cfg = 0x00003810,
.image_addr = 0x00003814,
.image_addr_offset = 0x00003818,
.buffer_width_cfg = 0x0000381C,
.buffer_height_cfg = 0x00003820,
.packer_cfg = 0x00003824,
.stride = 0x00003828,
.irq_subsample_period = 0x00003848,
.irq_subsample_pattern = 0x0000384C,
.framedrop_period = 0x00003850,
.framedrop_pattern = 0x00003854,
.frame_inc = 0x00003858,
.burst_limit = 0x0000385C,
.ubwc_regs = NULL,
},
/* BUS Client 23 */
{
.status0 = 0x00003900,
.status1 = 0x00003904,
.cfg = 0x00003908,
.header_addr = 0x0000390C,
.header_cfg = 0x00003910,
.image_addr = 0x00003914,
.image_addr_offset = 0x00003918,
.buffer_width_cfg = 0x0000391C,
.buffer_height_cfg = 0x00003920,
.packer_cfg = 0x00003924,
.stride = 0x00003928,
.irq_subsample_period = 0x00003948,
.irq_subsample_pattern = 0x0000394C,
.framedrop_period = 0x00003950,
.framedrop_pattern = 0x00003954,
.frame_inc = 0x00003958,
.burst_limit = 0x0000395C,
.ubwc_regs = NULL,
},
},
.comp_grp_reg = {
/* CAM_VFE_BUS_VER2_COMP_GRP_0 */
@ -826,7 +716,7 @@ static struct cam_vfe_bus_ver2_hw_info vfe175_bus_hw_info = {
.addr_sync_mask = 0x0000209C,
},
},
.num_out = 21,
.num_out = 18,
.vfe_out_hw_info = {
{
.vfe_out_type = CAM_VFE_BUS_VER2_VFE_OUT_RDI0,
@ -927,36 +817,21 @@ static struct cam_vfe_bus_ver2_hw_info vfe175_bus_hw_info = {
.max_width = -1,
.max_height = -1,
},
{
.vfe_out_type = CAM_VFE_BUS_VER2_VFE_OUT_FULL_DISP,
.max_width = 4096,
.max_height = 4096,
},
{
.vfe_out_type = CAM_VFE_BUS_VER2_VFE_OUT_DS4_DISP,
.max_width = 1920,
.max_height = 1080,
},
{
.vfe_out_type = CAM_VFE_BUS_VER2_VFE_OUT_DS16_DISP,
.max_width = 1920,
.max_height = 1080,
},
},
};
static struct cam_vfe_hw_info cam_vfe175_hw_info = {
.irq_reg_info = &vfe175_top_irq_reg_info,
struct cam_vfe_hw_info cam_vfe170_hw_info = {
.irq_reg_info = &vfe170_top_irq_reg_info,
.bus_version = CAM_VFE_BUS_VER_2_0,
.bus_hw_info = &vfe175_bus_hw_info,
.bus_hw_info = &vfe170_bus_hw_info,
.top_version = CAM_VFE_TOP_VER_2_0,
.top_hw_info = &vfe175_top_hw_info,
.top_hw_info = &vfe170_top_hw_info,
.camif_version = CAM_VFE_CAMIF_VER_2_0,
.camif_reg = &vfe175_camif_reg,
.camif_reg = &vfe170_camif_reg,
};
#endif /* _CAM_VFE175_H_ */
#endif /* _CAM_VFE170_H_ */

View file

@ -0,0 +1,51 @@
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/module.h>
#include "cam_vfe_lite170.h"
#include "cam_vfe_hw_intf.h"
#include "cam_vfe_core.h"
#include "cam_vfe_dev.h"
static const struct of_device_id cam_vfe170_dt_match[] = {
{
.compatible = "qcom,vfe-lite170",
.data = &cam_vfe_lite170_hw_info,
},
{}
};
MODULE_DEVICE_TABLE(of, cam_vfe170_dt_match);
static struct platform_driver cam_vfe170_driver = {
.probe = cam_vfe_probe,
.remove = cam_vfe_remove,
.driver = {
.name = "cam_vfe_lite170",
.owner = THIS_MODULE,
.of_match_table = cam_vfe170_dt_match,
},
};
static int __init cam_vfe170_init_module(void)
{
return platform_driver_register(&cam_vfe170_driver);
}
static void __exit cam_vfe170_exit_module(void)
{
platform_driver_unregister(&cam_vfe170_driver);
}
module_init(cam_vfe170_init_module);
module_exit(cam_vfe170_exit_module);
MODULE_DESCRIPTION("CAM VFE170 driver");
MODULE_LICENSE("GPL v2");

View file

@ -0,0 +1,336 @@
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _CAM_VFE_LITE170_H_
#define _CAM_VFE_LITE170_H_
#include "cam_vfe_bus_ver2.h"
#include "cam_irq_controller.h"
#include "cam_vfe_top_ver2.h"
#include "cam_vfe_core.h"
static struct cam_irq_register_set vfe170_top_irq_reg_set[2] = {
{
.mask_reg_offset = 0x0000005C,
.clear_reg_offset = 0x00000064,
.status_reg_offset = 0x0000006C,
},
{
.mask_reg_offset = 0x00000060,
.clear_reg_offset = 0x00000068,
.status_reg_offset = 0x00000070,
},
};
static struct cam_irq_controller_reg_info vfe170_top_irq_reg_info = {
.num_registers = 2,
.irq_reg_set = vfe170_top_irq_reg_set,
.global_clear_offset = 0x00000058,
.global_clear_bitmask = 0x00000001,
};
static struct cam_vfe_top_ver2_reg_offset_common vfe170_top_common_reg = {
.hw_version = 0x00000000,
.hw_capability = 0x00000004,
.lens_feature = 0x00000008,
.stats_feature = 0x0000000C,
.color_feature = 0x00000010,
.zoom_feature = 0x00000014,
.global_reset_cmd = 0x00000018,
.module_ctrl = {
NULL,
NULL,
NULL,
NULL,
},
.bus_cgc_ovd = 0x0000003C,
.core_cfg = 0x00000000,
.three_D_cfg = 0x00000000,
.violation_status = 0x0000007C,
.reg_update_cmd = 0x000004AC,
};
static struct cam_vfe_rdi_ver2_reg vfe170_rdi_reg = {
.reg_update_cmd = 0x000004AC,
};
static struct cam_vfe_rdi_reg_data vfe170_rdi_0_data = {
.reg_update_cmd_data = 0x2,
.sof_irq_mask = 0x8000000,
.reg_update_irq_mask = 0x20,
};
static struct cam_vfe_rdi_reg_data vfe170_rdi_1_data = {
.reg_update_cmd_data = 0x4,
.sof_irq_mask = 0x10000000,
.reg_update_irq_mask = 0x40,
};
static struct cam_vfe_rdi_reg_data vfe170_rdi_2_data = {
.reg_update_cmd_data = 0x8,
.sof_irq_mask = 0x20000000,
.reg_update_irq_mask = 0x80,
};
static struct cam_vfe_rdi_reg_data vfe170_rdi_3_data = {
.reg_update_cmd_data = 0x10,
.sof_irq_mask = 0x40000000,
.reg_update_irq_mask = 0x100,
};
static struct cam_vfe_top_ver2_hw_info vfe170_top_hw_info = {
.common_reg = &vfe170_top_common_reg,
.camif_hw_info = {
.common_reg = NULL,
.camif_reg = NULL,
.reg_data = NULL,
},
.rdi_hw_info = {
.common_reg = &vfe170_top_common_reg,
.rdi_reg = &vfe170_rdi_reg,
.reg_data = {
&vfe170_rdi_0_data,
&vfe170_rdi_1_data,
&vfe170_rdi_2_data,
&vfe170_rdi_3_data,
},
},
.mux_type = {
CAM_VFE_RDI_VER_1_0,
CAM_VFE_RDI_VER_1_0,
CAM_VFE_RDI_VER_1_0,
CAM_VFE_RDI_VER_1_0,
},
};
static struct cam_irq_register_set vfe170_bus_irq_reg[3] = {
{
.mask_reg_offset = 0x00002044,
.clear_reg_offset = 0x00002050,
.status_reg_offset = 0x0000205C,
},
{
.mask_reg_offset = 0x00002048,
.clear_reg_offset = 0x00002054,
.status_reg_offset = 0x00002060,
},
{
.mask_reg_offset = 0x0000204C,
.clear_reg_offset = 0x00002058,
.status_reg_offset = 0x00002064,
},
};
static struct cam_vfe_bus_ver2_hw_info vfe170_bus_hw_info = {
.common_reg = {
.hw_version = 0x00002000,
.hw_capability = 0x00002004,
.sw_reset = 0x00002008,
.cgc_ovd = 0x0000200C,
.pwr_iso_cfg = 0x000020CC,
.dual_master_comp_cfg = 0x00002028,
.irq_reg_info = {
.num_registers = 3,
.irq_reg_set = vfe170_bus_irq_reg,
.global_clear_offset = 0x00002068,
.global_clear_bitmask = 0x00000001,
},
.comp_error_status = 0x0000206C,
.comp_ovrwr_status = 0x00002070,
.dual_comp_error_status = 0x00002074,
.dual_comp_ovrwr_status = 0x00002078,
.addr_sync_cfg = 0x0000207C,
.addr_sync_frame_hdr = 0x00002080,
.addr_sync_no_sync = 0x00002084,
},
.num_client = 4,
.bus_client_reg = {
/* BUS Client 0 */
{
.status0 = 0x00002200,
.status1 = 0x00002204,
.cfg = 0x00002208,
.header_addr = 0x0000220C,
.header_cfg = 0x00002210,
.image_addr = 0x00002214,
.image_addr_offset = 0x00002218,
.buffer_width_cfg = 0x0000221C,
.buffer_height_cfg = 0x00002220,
.packer_cfg = 0x00002224,
.stride = 0x00002228,
.irq_subsample_period = 0x00002248,
.irq_subsample_pattern = 0x0000224C,
.framedrop_period = 0x00002250,
.framedrop_pattern = 0x00002254,
.frame_inc = 0x00002258,
.burst_limit = 0x0000225C,
.ubwc_regs = NULL,
},
/* BUS Client 1 */
{
.status0 = 0x00002300,
.status1 = 0x00002304,
.cfg = 0x00002308,
.header_addr = 0x0000230C,
.header_cfg = 0x00002310,
.image_addr = 0x00002314,
.image_addr_offset = 0x00002318,
.buffer_width_cfg = 0x0000231C,
.buffer_height_cfg = 0x00002320,
.packer_cfg = 0x00002324,
.stride = 0x00002328,
.irq_subsample_period = 0x00002348,
.irq_subsample_pattern = 0x0000234C,
.framedrop_period = 0x00002350,
.framedrop_pattern = 0x00002354,
.frame_inc = 0x00002358,
.burst_limit = 0x0000235C,
.ubwc_regs = NULL,
},
/* BUS Client 2 */
{
.status0 = 0x00002400,
.status1 = 0x00002404,
.cfg = 0x00002408,
.header_addr = 0x0000240C,
.header_cfg = 0x00002410,
.image_addr = 0x00002414,
.image_addr_offset = 0x00002418,
.buffer_width_cfg = 0x0000241C,
.buffer_height_cfg = 0x00002420,
.packer_cfg = 0x00002424,
.stride = 0x00002428,
.irq_subsample_period = 0x00002448,
.irq_subsample_pattern = 0x0000244C,
.framedrop_period = 0x00002450,
.framedrop_pattern = 0x00002454,
.frame_inc = 0x00002458,
.burst_limit = 0x0000245C,
.ubwc_regs = NULL,
},
/* BUS Client 3 */
{
.status0 = 0x00002500,
.status1 = 0x00002504,
.cfg = 0x00002508,
.header_addr = 0x0000250C,
.header_cfg = 0x00002510,
.image_addr = 0x00002514,
.image_addr_offset = 0x00002518,
.buffer_width_cfg = 0x0000251C,
.buffer_height_cfg = 0x00002520,
.packer_cfg = 0x00002524,
.stride = 0x00002528,
.irq_subsample_period = 0x00002548,
.irq_subsample_pattern = 0x0000254C,
.framedrop_period = 0x00002550,
.framedrop_pattern = 0x00002554,
.frame_inc = 0x00002558,
.burst_limit = 0x0000255C,
.ubwc_regs = NULL,
},
},
.comp_grp_reg = {
/* CAM_VFE_BUS_VER2_COMP_GRP_0 */
{
.comp_mask = 0x00002010,
},
/* CAM_VFE_BUS_VER2_COMP_GRP_1 */
{
.comp_mask = 0x00002014,
},
/* CAM_VFE_BUS_VER2_COMP_GRP_2 */
{
.comp_mask = 0x00002018,
},
/* CAM_VFE_BUS_VER2_COMP_GRP_3 */
{
.comp_mask = 0x0000201C,
},
/* CAM_VFE_BUS_VER2_COMP_GRP_4 */
{
.comp_mask = 0x00002020,
},
/* CAM_VFE_BUS_VER2_COMP_GRP_5 */
{
.comp_mask = 0x00002024,
},
/* CAM_VFE_BUS_VER2_COMP_GRP_DUAL_0 */
{
.comp_mask = 0x0000202C,
.addr_sync_mask = 0x00002088,
},
/* CAM_VFE_BUS_VER2_COMP_GRP_DUAL_1 */
{
.comp_mask = 0x00002030,
.addr_sync_mask = 0x0000208C,
},
/* CAM_VFE_BUS_VER2_COMP_GRP_DUAL_2 */
{
.comp_mask = 0x00002034,
.addr_sync_mask = 0x00002090,
},
/* CAM_VFE_BUS_VER2_COMP_GRP_DUAL_3 */
{
.comp_mask = 0x00002038,
.addr_sync_mask = 0x00002094,
},
/* CAM_VFE_BUS_VER2_COMP_GRP_DUAL_4 */
{
.comp_mask = 0x0000203C,
.addr_sync_mask = 0x00002098,
},
/* CAM_VFE_BUS_VER2_COMP_GRP_DUAL_5 */
{
.comp_mask = 0x00002040,
.addr_sync_mask = 0x0000209C,
},
},
.num_out = 4,
.vfe_out_hw_info = {
{
.vfe_out_type = CAM_VFE_BUS_VER2_VFE_OUT_RDI0,
.max_width = -1,
.max_height = -1,
},
{
.vfe_out_type = CAM_VFE_BUS_VER2_VFE_OUT_RDI1,
.max_width = -1,
.max_height = -1,
},
{
.vfe_out_type = CAM_VFE_BUS_VER2_VFE_OUT_RDI2,
.max_width = -1,
.max_height = -1,
},
{
.vfe_out_type = CAM_VFE_BUS_VER2_VFE_OUT_RDI3,
.max_width = -1,
.max_height = -1,
},
},
};
static struct cam_vfe_hw_info cam_vfe_lite170_hw_info = {
.irq_reg_info = &vfe170_top_irq_reg_info,
.bus_version = CAM_VFE_BUS_VER_2_0,
.bus_hw_info = &vfe170_bus_hw_info,
.top_version = CAM_VFE_TOP_VER_2_0,
.top_hw_info = &vfe170_top_hw_info,
};
#endif /* _CAM_VFE_LITE170_H_ */

View file

@ -40,8 +40,7 @@ static const char drv_name[] = "vfe_bus";
#define CAM_VFE_RDI_BUS_DEFAULT_STRIDE 0xFF01
#define CAM_VFE_BUS_INTRA_CLIENT_MASK 0x3
#define CAM_VFE_BUS_ADDR_SYNC_INTRA_CLIENT_SHIFT 8
#define CAM_VFE_BUS_ADDR_NO_SYNC_DEFAULT_VAL \
((1 << CAM_VFE_BUS_VER2_MAX_CLIENTS) - 1)
#define CAM_VFE_BUS_ADDR_NO_SYNC_DEFAULT_VAL 0xFFFFF
#define ALIGNUP(value, alignment) \
((value + alignment - 1) / alignment * alignment)
@ -376,9 +375,6 @@ static bool cam_vfe_bus_can_be_secure(uint32_t out_type)
case CAM_VFE_BUS_VER2_VFE_OUT_RDI0:
case CAM_VFE_BUS_VER2_VFE_OUT_RDI1:
case CAM_VFE_BUS_VER2_VFE_OUT_RDI2:
case CAM_VFE_BUS_VER2_VFE_OUT_FULL_DISP:
case CAM_VFE_BUS_VER2_VFE_OUT_DS4_DISP:
case CAM_VFE_BUS_VER2_VFE_OUT_DS16_DISP:
return true;
case CAM_VFE_BUS_VER2_VFE_OUT_PDAF:
@ -438,12 +434,6 @@ static enum cam_vfe_bus_ver2_vfe_out_type
return CAM_VFE_BUS_VER2_VFE_OUT_STATS_CS;
case CAM_ISP_IFE_OUT_RES_STATS_IHIST:
return CAM_VFE_BUS_VER2_VFE_OUT_STATS_IHIST;
case CAM_ISP_IFE_OUT_RES_FULL_DISP:
return CAM_VFE_BUS_VER2_VFE_OUT_FULL_DISP;
case CAM_ISP_IFE_OUT_RES_DS4_DISP:
return CAM_VFE_BUS_VER2_VFE_OUT_DS4_DISP;
case CAM_ISP_IFE_OUT_RES_DS16_DISP:
return CAM_VFE_BUS_VER2_VFE_OUT_DS16_DISP;
default:
return CAM_VFE_BUS_VER2_VFE_OUT_MAX;
}
@ -484,7 +474,6 @@ static int cam_vfe_bus_get_num_wm(
}
break;
case CAM_VFE_BUS_VER2_VFE_OUT_FULL:
case CAM_VFE_BUS_VER2_VFE_OUT_FULL_DISP:
switch (format) {
case CAM_FORMAT_NV21:
case CAM_FORMAT_NV12:
@ -514,9 +503,7 @@ static int cam_vfe_bus_get_num_wm(
}
break;
case CAM_VFE_BUS_VER2_VFE_OUT_DS4:
case CAM_VFE_BUS_VER2_VFE_OUT_DS4_DISP:
case CAM_VFE_BUS_VER2_VFE_OUT_DS16:
case CAM_VFE_BUS_VER2_VFE_OUT_DS16_DISP:
switch (format) {
case CAM_FORMAT_PD8:
case CAM_FORMAT_PD10:
@ -765,37 +752,6 @@ static int cam_vfe_bus_get_wm_idx(
break;
}
break;
case CAM_VFE_BUS_VER2_VFE_OUT_FULL_DISP:
switch (plane) {
case PLANE_Y:
wm_idx = 20;
break;
case PLANE_C:
wm_idx = 21;
break;
default:
break;
}
break;
case CAM_VFE_BUS_VER2_VFE_OUT_DS4_DISP:
switch (plane) {
case PLANE_Y:
wm_idx = 22;
break;
default:
break;
}
break;
case CAM_VFE_BUS_VER2_VFE_OUT_DS16_DISP:
switch (plane) {
case PLANE_Y:
wm_idx = 23;
break;
default:
break;
}
break;
default:
break;
}
@ -808,7 +764,7 @@ static enum cam_vfe_bus_packer_format
{
switch (out_fmt) {
case CAM_FORMAT_NV21:
if ((wm_index == 4) || (wm_index == 6) || (wm_index == 21))
if (wm_index == 4 || wm_index == 6)
return PACKER_FMT_PLAIN_8_LSB_MSB_10_ODD_EVEN;
case CAM_FORMAT_NV12:
case CAM_FORMAT_UBWC_NV12:
@ -939,13 +895,9 @@ static int cam_vfe_bus_acquire_wm(
rsrc_data->format);
return -EINVAL;
}
} else if ((rsrc_data->index < 5) ||
(rsrc_data->index == 7) || (rsrc_data->index == 8) ||
(rsrc_data->index == 20) || (rsrc_data->index == 21)) {
/*
* Write master 3, 4 - for Full OUT , 7-8 FD OUT,
* WM 20-21 = FULL_DISP
*/
} else if (rsrc_data->index < 5 ||
rsrc_data->index == 7 || rsrc_data->index == 8) {
/* Write master 3, 4 - for Full OUT , 7-8 FD OUT */
switch (rsrc_data->format) {
case CAM_FORMAT_UBWC_NV12_4R:
rsrc_data->en_ubwc = 1;
@ -1025,7 +977,7 @@ static int cam_vfe_bus_acquire_wm(
return -EINVAL;
}
rsrc_data->en_cfg = 0x1;
} else if ((rsrc_data->index >= 11) && (rsrc_data->index < 20)) {
} else if (rsrc_data->index >= 11) {
/* Write master 11-19 stats */
rsrc_data->width = 0;
rsrc_data->height = 0;

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -16,7 +16,7 @@
#include "cam_irq_controller.h"
#include "cam_vfe_bus.h"
#define CAM_VFE_BUS_VER2_MAX_CLIENTS 24
#define CAM_VFE_BUS_VER2_MAX_CLIENTS 20
enum cam_vfe_bus_ver2_vfe_core_id {
CAM_VFE_BUS_VER2_VFE_CORE_0,
@ -60,9 +60,6 @@ enum cam_vfe_bus_ver2_vfe_out_type {
CAM_VFE_BUS_VER2_VFE_OUT_STATS_RS,
CAM_VFE_BUS_VER2_VFE_OUT_STATS_CS,
CAM_VFE_BUS_VER2_VFE_OUT_STATS_IHIST,
CAM_VFE_BUS_VER2_VFE_OUT_FULL_DISP,
CAM_VFE_BUS_VER2_VFE_OUT_DS4_DISP,
CAM_VFE_BUS_VER2_VFE_OUT_DS16_DISP,
CAM_VFE_BUS_VER2_VFE_OUT_MAX,
};

View file

@ -23,11 +23,7 @@
#define CAM_ISP_IFE_OUT_RES_STATS_RS (CAM_ISP_IFE_OUT_RES_BASE + 16)
#define CAM_ISP_IFE_OUT_RES_STATS_CS (CAM_ISP_IFE_OUT_RES_BASE + 17)
#define CAM_ISP_IFE_OUT_RES_STATS_IHIST (CAM_ISP_IFE_OUT_RES_BASE + 18)
#define CAM_ISP_IFE_OUT_RES_FULL_DISP (CAM_ISP_IFE_OUT_RES_BASE + 19)
#define CAM_ISP_IFE_OUT_RES_DS4_DISP (CAM_ISP_IFE_OUT_RES_BASE + 20)
#define CAM_ISP_IFE_OUT_RES_DS16_DISP (CAM_ISP_IFE_OUT_RES_BASE + 21)
#define CAM_ISP_IFE_OUT_RES_MAX (CAM_ISP_IFE_OUT_RES_BASE + 22)
#define CAM_ISP_IFE_OUT_RES_MAX (CAM_ISP_IFE_OUT_RES_BASE + 19)
/* IFE input port resource type (global unique) */