Merge commit 'f71c1d2992b05a67f0162c8dead1ca2d8c0925cf'

* commit 'f71c1d2992b05a67f0162c8dead1ca2d8c0925cf':
  arm64: dts: rockchip: add cam config for rk3576-test2
  drm/rockchip: dw-dp: limit color depth 8bit for hdr
  media: rockchip: isp: fix resource release if user crashes
  misc: rockchip: pcie-rkep: Add rk182a device id
  misc: rockchip: pcie-rkep: Enable 4MB rkep memory area for basic functions
  arm64: configs: rk3576_vehicle.config: enable CONFIG_PWM_R7F701
  arm64: dts: rockchip: rk3576-vehicle-evb: Add max96749+max96772 2560x1600 resolution case
  media: i2c: revise initcall for tb-sensors when ROCKCHIP_THUNDER_BOOT_ISP=y
  media: rockchip: cif/isp: subsys_initcall_sync as long as ROCKCHIP_THUNDER_BOOT_ISP=y
  phy: rockchip: csi2-dphy[-hw]: Revise initcall when ROCKCHIP_THUNDER_BOOT_ISP=y

Change-Id: I5ebb5f0236cd27e3d6920b0f2d751cde90134ba4
This commit is contained in:
Tao Huang
2025-07-01 19:30:26 +08:00
46 changed files with 2049 additions and 72 deletions

View File

@@ -0,0 +1,173 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2024 Rockchip Electronics Co., Ltd.
*
*/
&csi2_dcphy0 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
mipi_in_ucam5: endpoint@6 {
reg = <6>;
remote-endpoint = <&ov50c40_out>;
data-lanes = <1 2 3>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
csidcphy0_out: endpoint@0 {
reg = <0>;
remote-endpoint = <&mipi0_csi2_input>;
};
};
};
};
&i2c8 {
status = "okay";
pinctrl-0 = <&i2c8m3_xfer>;
aw8601: aw8601@c {
compatible = "awinic,aw8601";
status = "okay";
reg = <0x0c>;
rockchip,vcm-start-current = <56>;
rockchip,vcm-rated-current = <96>;
rockchip,vcm-step-mode = <4>;
rockchip,camera-module-index = <0>;
rockchip,camera-module-facing = "back";
};
ov50c40: ov50c40@36 {
compatible = "ovti,ov50c40";
status = "okay";
reg = <0x36>;
clocks = <&cru CLK_MIPI_CAMERAOUT_M0>;
clock-names = "xvclk";
pinctrl-names = "default";
pinctrl-0 = <&cam_clk0m0_clk0>;
power-domains = <&power RK3576_PD_VI>;
avdd-supply = <&vcc_mipicsi0>;
reset-gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>;
pwdn-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_LOW>;
rockchip,camera-module-index = <0>;
rockchip,camera-module-facing = "back";
rockchip,camera-module-name = "HZGA06";
rockchip,camera-module-lens-name = "ZE0082C1";
eeprom-ctrl = <&otp_eeprom>;
lens-focus = <&aw8601>;
port {
ov50c40_out: endpoint {
remote-endpoint = <&mipi_in_ucam5>;
bus-type = <1>;
data-lanes = <1 2 3>;
};
};
};
otp_eeprom: otp_eeprom@50 {
compatible = "rk,otp_eeprom";
status = "okay";
reg = <0x50>;
};
};
&mipidcphy0 {
status = "okay";
};
&mipi0_csi2 {
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
mipi0_csi2_input: endpoint@1 {
reg = <1>;
remote-endpoint = <&csidcphy0_out>;
};
};
port@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
mipi0_csi2_output: endpoint@0 {
reg = <0>;
remote-endpoint = <&cif_mipi_in0>;
};
};
};
};
&rkcif {
status = "okay";
};
&rkcif_mipi_lvds {
status = "okay";
port {
cif_mipi_in0: endpoint {
remote-endpoint = <&mipi0_csi2_output>;
};
};
};
&rkcif_mipi_lvds_sditf {
status = "okay";
port {
mipi_lvds_sditf: endpoint {
remote-endpoint = <&isp_vir0>;
};
};
};
&rkcif_mmu {
status = "okay";
};
&rkisp {
status = "okay";
};
&rkisp_mmu {
status = "okay";
};
&rkisp_vir0 {
status = "okay";
port {
#address-cells = <1>;
#size-cells = <0>;
isp_vir0: endpoint@0 {
reg = <0>;
remote-endpoint = <&mipi_lvds_sditf>;
};
};
};
&rkisp_vir0_sditf {
status = "okay";
};

View File

@@ -9,6 +9,7 @@
#include "rk3576.dtsi"
#include "rk3576-test2.dtsi"
#include "rk3576-android.dtsi"
#include "rk3576-test2-cam-dcphy0.dtsi"
/ {
model = "Rockchip RK3576 TEST2 V10 Board";

View File

@@ -154,6 +154,16 @@
pinctrl-names = "default";
pinctrl-0 = <&usb_otg0_pwren>;
};
vcc_mipicsi0: vcc-mipicsi0-regulator {
compatible = "regulator-fixed";
gpio = <&gpio3 RK_PB6 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&mipicsi0_pwr>;
regulator-name = "vcc_mipicsi0";
enable-active-high;
regulator-boot-on;
};
};
&backlight {
@@ -806,6 +816,14 @@
};
&pinctrl {
cam {
mipicsi0_pwr: mipicsi0-pwr {
rockchip,pins =
/* camera power en */
<3 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
lcd {
lcd_rst_gpio: lcd-rst-gpio {
rockchip,pins = <0 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;

View File

@@ -48,6 +48,7 @@ CONFIG_MALI_BIFROST=y
# CONFIG_MFD_RKX110_X120 is not set
CONFIG_MFD_SERDES_DISPLAY=y
# CONFIG_PROXIMITY_DEVICE is not set
CONFIG_PWM_R7F701=y
# CONFIG_R8168 is not set
CONFIG_REALTEK_PHY=y
# CONFIG_REGULATOR_ACT8865 is not set
@@ -148,6 +149,7 @@ CONFIG_PAGE_MIGRATION_SUPPORT=y
# CONFIG_ROCKCHIP_DRM_SELF_TEST is not set
CONFIG_SERDES_DISPLAY_CHIP_MAXIM=y
CONFIG_SERDES_DISPLAY_CHIP_MAXIM_MAX96745=y
CONFIG_SERDES_DISPLAY_CHIP_MAXIM_MAX96749=y
CONFIG_SERDES_DISPLAY_CHIP_MAXIM_MAX96752=y
CONFIG_SERDES_DISPLAY_CHIP_MAXIM_MAX96755=y
CONFIG_SERDES_DISPLAY_CHIP_MAXIM_MAX96772=y

View File

@@ -4675,7 +4675,7 @@ static u32 *dw_dp_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
continue;
}
if (dw_dp_is_hdr_eotf(dp->eotf_type) && fmt->bpc < 10)
if (dw_dp_is_hdr_eotf(dp->eotf_type) && fmt->bpc < 8)
continue;
output_fmts[j++] = fmt->bus_format;

View File

@@ -1858,7 +1858,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&gc2093_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -2056,7 +2056,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&gc3003_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -1640,7 +1640,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&mis2031_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -2282,7 +2282,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&os02k10_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -1904,7 +1904,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&os04d10_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -2158,7 +2158,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&ps5458_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -1494,7 +1494,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc1346_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -2185,7 +2185,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc200ai_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -1869,7 +1869,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc223a_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -1888,7 +1888,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc230ai_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -1547,7 +1547,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc2336_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -2321,7 +2321,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc301iot_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -1723,7 +1723,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc3336_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -1910,7 +1910,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc3336p_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -716,7 +716,7 @@ static long sc3338_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
memcpy(&sc3338->cam_sw_inf->hdr_ae, (struct preisp_hdrae_exp_s *)(arg),
sizeof(struct preisp_hdrae_exp_s));
break;
case RKMODULE_SET_QUICK_STREAM:
case RKMODULE_SET_QUICK_STREAM:;
stream = *((u32 *)arg);
@@ -1591,7 +1591,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc3338_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -1761,7 +1761,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc401ai_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -1582,7 +1582,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc4336_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -1575,7 +1575,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc4336p_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -3139,7 +3139,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc450ai_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -1422,7 +1422,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc501ai_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -1595,7 +1595,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc5336_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -2964,7 +2964,7 @@ static void __exit sensor_mod_exit(void)
i2c_del_driver(&sc635hai_i2c_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(sensor_mod_init);
#else
device_initcall_sync(sensor_mod_init);

View File

@@ -2076,8 +2076,8 @@ static void __exit rk_cif_plat_drv_exit(void)
rkcif_csi2_hw_plat_drv_exit();
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
subsys_initcall(rk_cif_plat_drv_init);
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall_sync(rk_cif_plat_drv_init);
#else
#if !defined(CONFIG_VIDEO_REVERSE_IMAGE)
module_init(rk_cif_plat_drv_init);

View File

@@ -1682,8 +1682,8 @@ static void __exit rkisp_hw_drv_exit(void)
platform_driver_unregister(&rkisp_hw_drv);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
subsys_initcall(rkisp_hw_drv_init);
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall_sync(rkisp_hw_drv_init);
#else
module_init(rkisp_hw_drv_init);
#endif

View File

@@ -304,7 +304,6 @@ static void rkisp_params_vb2_stop_streaming(struct vb2_queue *vq)
params_vdev->first_cfg_params = true;
return;
}
rkisp_params_disable_isp(params_vdev);
/* clean module params */
params_vdev->ops->clear_first_param(params_vdev);
params_vdev->rdbk_times = 0;
@@ -566,9 +565,12 @@ void rkisp_params_meshbuf_free(struct rkisp_isp_params_vdev *params_vdev, u64 id
void rkisp_params_stream_stop(struct rkisp_isp_params_vdev *params_vdev)
{
rkisp_params_disable_isp(params_vdev);
/* isp stop to free buf */
if (params_vdev->ops->stream_stop)
params_vdev->ops->stream_stop(params_vdev);
if (!atomic_read(&params_vdev->open_cnt) && params_vdev->ops->fop_release)
params_vdev->ops->fop_release(params_vdev);
}
bool rkisp_params_check_bigmode(struct rkisp_isp_params_vdev *params_vdev)

View File

@@ -5066,9 +5066,9 @@ static int rkisp_init_mesh_buf(struct rkisp_isp_params_vdev *params_vdev,
rkisp_free_buffer(params_vdev->dev, buf);
} else {
is_alloc = false;
buf->dma_fd = dma_buf_fd(buf->dbuf, O_CLOEXEC);
if (buf->dma_fd < 0)
if (rkisp_buf_get_fd(ispdev, buf, false) < 0)
goto err;
mesh_head = (struct isp2x_mesh_head *)buf->vaddr;
}
}
if (is_alloc) {
@@ -5079,9 +5079,9 @@ static int rkisp_init_mesh_buf(struct rkisp_isp_params_vdev *params_vdev,
goto err;
}
mesh_head = (struct isp2x_mesh_head *)buf->vaddr;
mesh_head->stat = MESH_BUF_INIT;
mesh_head->data_oft = ALIGN(sizeof(struct isp2x_mesh_head), 16);
}
mesh_head->stat = MESH_BUF_INIT;
mesh_head->data_oft = ALIGN(sizeof(struct isp2x_mesh_head), 16);
buf++;
}

View File

@@ -4055,9 +4055,9 @@ static int rkisp_init_mesh_buf(struct rkisp_isp_params_vdev *params_vdev,
rkisp_free_buffer(params_vdev->dev, buf);
} else {
is_alloc = false;
buf->dma_fd = dma_buf_fd(buf->dbuf, O_CLOEXEC);
if (buf->dma_fd < 0)
if (rkisp_buf_get_fd(ispdev, buf, false) < 0)
goto err;
mesh_head = (struct isp2x_mesh_head *)buf->vaddr;
}
}
if (is_alloc) {
@@ -4068,9 +4068,9 @@ static int rkisp_init_mesh_buf(struct rkisp_isp_params_vdev *params_vdev,
goto err;
}
mesh_head = (struct isp2x_mesh_head *)buf->vaddr;
mesh_head->stat = MESH_BUF_INIT;
mesh_head->data_oft = ALIGN(sizeof(struct isp2x_mesh_head), 16);
}
mesh_head->stat = MESH_BUF_INIT;
mesh_head->data_oft = ALIGN(sizeof(struct isp2x_mesh_head), 16);
buf++;
}

View File

@@ -4988,9 +4988,9 @@ static int rkisp_init_mesh_buf(struct rkisp_isp_params_vdev *params_vdev,
rkisp_free_buffer(params_vdev->dev, buf);
} else {
is_alloc = false;
buf->dma_fd = dma_buf_fd(buf->dbuf, O_CLOEXEC);
if (buf->dma_fd < 0)
if (rkisp_buf_get_fd(ispdev, buf, false) < 0)
goto err;
mesh_head = (struct isp2x_mesh_head *)buf->vaddr;
}
}
if (is_alloc) {
@@ -5001,11 +5001,12 @@ static int rkisp_init_mesh_buf(struct rkisp_isp_params_vdev *params_vdev,
goto err;
}
mesh_head = (struct isp2x_mesh_head *)buf->vaddr;
mesh_head->stat = MESH_BUF_INIT;
mesh_head->data_oft = ALIGN(sizeof(struct isp2x_mesh_head), 16);
}
mesh_head->stat = MESH_BUF_INIT;
mesh_head->data_oft = ALIGN(sizeof(struct isp2x_mesh_head), 16);
if (meshsize->module_id == ISP35_MODULE_BAY3D)
mesh_head->data1_oft = mesh_head->data_oft +
ALIGN(priv->b3dldc_hsize * 4 * priv->b3dldch_vsize, 16);
}
buf++;
}

View File

@@ -4430,9 +4430,9 @@ static int rkisp_init_mesh_buf(struct rkisp_isp_params_vdev *params_vdev,
rkisp_free_buffer(params_vdev->dev, buf);
} else {
is_alloc = false;
buf->dma_fd = dma_buf_fd(buf->dbuf, O_CLOEXEC);
if (buf->dma_fd < 0)
if (rkisp_buf_get_fd(ispdev, buf, false) < 0)
goto err;
mesh_head = (struct isp2x_mesh_head *)buf->vaddr;
}
}
if (is_alloc) {
@@ -4443,9 +4443,9 @@ static int rkisp_init_mesh_buf(struct rkisp_isp_params_vdev *params_vdev,
goto err;
}
mesh_head = (struct isp2x_mesh_head *)buf->vaddr;
mesh_head->stat = MESH_BUF_INIT;
mesh_head->data_oft = ALIGN(sizeof(struct isp2x_mesh_head), 16);
}
mesh_head->stat = MESH_BUF_INIT;
mesh_head->data_oft = ALIGN(sizeof(struct isp2x_mesh_head), 16);
buf++;
}

View File

@@ -4497,6 +4497,7 @@ static int rkisp_init_mesh_buf(struct rkisp_isp_params_vdev *params_vdev,
u32 mesh_size, buf_size;
int i, ret, id = meshsize->unite_isp_id;
int buf_cnt = meshsize->buf_cnt;
bool is_alloc;
priv_val = params_vdev->priv_val;
if (!priv_val) {
@@ -4529,14 +4530,26 @@ static int rkisp_init_mesh_buf(struct rkisp_isp_params_vdev *params_vdev,
buf->is_need_vaddr = true;
buf->is_need_dbuf = true;
buf->is_need_dmafd = true;
buf->size = buf_size;
ret = rkisp_alloc_buffer(params_vdev->dev, buf);
if (ret) {
dev_err(dev, "%s failed\n", __func__);
goto err;
is_alloc = true;
if (buf->mem_priv) {
if (buf_size > buf->size) {
rkisp_free_buffer(params_vdev->dev, buf);
} else {
is_alloc = false;
if (rkisp_buf_get_fd(ispdev, buf, false) < 0)
goto err;
mesh_head = (struct isp2x_mesh_head *)buf->vaddr;
}
}
if (is_alloc) {
buf->size = buf_size;
ret = rkisp_alloc_buffer(params_vdev->dev, buf);
if (ret) {
dev_err(dev, "%s failed\n", __func__);
goto err;
}
mesh_head = (struct isp2x_mesh_head *)buf->vaddr;
}
mesh_head = (struct isp2x_mesh_head *)buf->vaddr;
mesh_head->stat = MESH_BUF_INIT;
mesh_head->data_oft = ALIGN(sizeof(struct isp2x_mesh_head), 16);
buf++;

View File

@@ -219,6 +219,8 @@ static void rkisp_stats_vb2_stop_streaming(struct vb2_queue *vq)
stats_vdev->ae_meas_done_next = false;
stats_vdev->af_meas_done_next = false;
if (stats_vdev->ops->stats_stop)
stats_vdev->ops->stats_stop(stats_vdev);
}
static int

View File

@@ -38,6 +38,7 @@ struct rkisp_isp_stats_ops {
void (*first_ddr_cfg)(struct rkisp_isp_stats_vdev *stats_vdev);
void (*next_ddr_cfg)(struct rkisp_isp_stats_vdev *stats_vdev);
int (*stats_tb)(struct rkisp_isp_stats_vdev *stats_vdev, struct rkisp_buffer *stats_buf);
void (*stats_stop)(struct rkisp_isp_stats_vdev *stats_vdev);
};
/*

View File

@@ -1146,6 +1146,21 @@ rkisp_stats_next_ddr_config_v32(struct rkisp_isp_stats_vdev *stats_vdev)
rkisp_stats_update_buf(stats_vdev);
}
static void rkisp_stats_stop_v32(struct rkisp_isp_stats_vdev *stats_vdev)
{
struct rkisp_device *dev = stats_vdev->dev;
u32 val, addr;
/* aiq crash or exit first */
if (dev->isp_state & ISP_START &&
stats_vdev->stats_buf[0].mem_priv) {
rkisp_stats_update_buf(stats_vdev);
addr = stats_vdev->stats_buf[0].dma_addr;
readl_poll_timeout(dev->hw_dev->base_addr + ISP3X_MI_3A_WR_BASE,
val, val == addr, 5000, 50000);
}
}
static struct rkisp_isp_stats_ops rkisp_isp_stats_ops_tbl = {
.isr_hdl = rkisp_stats_isr_v32,
.send_meas = rkisp_stats_send_meas_v32,
@@ -1154,6 +1169,7 @@ static struct rkisp_isp_stats_ops rkisp_isp_stats_ops_tbl = {
.stats_tb = rkisp_stats_tb_v32,
.first_ddr_cfg = rkisp_stats_first_ddr_config_v32,
.next_ddr_cfg = rkisp_stats_next_ddr_config_v32,
.stats_stop = rkisp_stats_stop_v32,
};
void rkisp_init_stats_vdev_v32(struct rkisp_isp_stats_vdev *stats_vdev)
@@ -1167,6 +1183,7 @@ void rkisp_init_stats_vdev_v32(struct rkisp_isp_stats_vdev *stats_vdev)
rkisp_isp_stats_ops_tbl.stats_tb = NULL;
rkisp_isp_stats_ops_tbl.first_ddr_cfg = NULL;
rkisp_isp_stats_ops_tbl.next_ddr_cfg = NULL;
rkisp_isp_stats_ops_tbl.stats_stop = NULL;
}
stats_vdev->ops = &rkisp_isp_stats_ops_tbl;
}

View File

@@ -568,6 +568,21 @@ rkisp_stats_next_ddr_config_v33(struct rkisp_isp_stats_vdev *stats_vdev)
rkisp_stats_update_buf(stats_vdev);
}
static void rkisp_stats_stop_v33(struct rkisp_isp_stats_vdev *stats_vdev)
{
struct rkisp_device *dev = stats_vdev->dev;
u32 val, addr;
/* aiq crash or exit first */
if (dev->isp_state & ISP_START &&
stats_vdev->stats_buf[0].mem_priv) {
rkisp_stats_update_buf(stats_vdev);
addr = stats_vdev->stats_buf[0].dma_addr;
readl_poll_timeout(dev->hw_dev->base_addr + ISP39_W3A_AEBIG_ADDR_SHD,
val, val == addr, 5000, 50000);
}
}
static struct rkisp_isp_stats_ops rkisp_isp_stats_ops_tbl = {
.isr_hdl = rkisp_stats_isr_v33,
.send_meas = rkisp_stats_send_meas_v33,
@@ -575,6 +590,7 @@ static struct rkisp_isp_stats_ops rkisp_isp_stats_ops_tbl = {
.stats_tb = rkisp_stats_tb_v33,
.first_ddr_cfg = rkisp_stats_first_ddr_config_v33,
.next_ddr_cfg = rkisp_stats_next_ddr_config_v33,
.stats_stop = rkisp_stats_stop_v33,
};
void rkisp_init_stats_vdev_v33(struct rkisp_isp_stats_vdev *stats_vdev)

View File

@@ -862,12 +862,28 @@ rkisp_stats_next_ddr_config_v35(struct rkisp_isp_stats_vdev *stats_vdev)
}
}
static void rkisp_stats_stop_v35(struct rkisp_isp_stats_vdev *stats_vdev)
{
struct rkisp_device *dev = stats_vdev->dev;
u32 val, addr;
/* aiq crash or exit first */
if (dev->isp_state & ISP_START &&
stats_vdev->stats_buf[0].mem_priv) {
rkisp_stats_update_buf(stats_vdev);
addr = stats_vdev->stats_buf[0].dma_addr;
readl_poll_timeout(dev->hw_dev->base_addr + ISP39_W3A_AEBIG_ADDR_SHD,
val, val == addr, 5000, 50000);
}
}
static struct rkisp_isp_stats_ops rkisp_isp_stats_ops_tbl = {
.isr_hdl = rkisp_stats_isr_v35,
.get_stat_size = rkisp_get_stat_size_v35,
.stats_tb = rkisp_stats_tb_v35,
.first_ddr_cfg = rkisp_stats_first_ddr_config_v35,
.next_ddr_cfg = rkisp_stats_next_ddr_config_v35,
.stats_stop = rkisp_stats_stop_v35,
};
void rkisp_init_stats_vdev_v35(struct rkisp_isp_stats_vdev *stats_vdev)

View File

@@ -536,11 +536,27 @@ rkisp_stats_next_ddr_config_v39(struct rkisp_isp_stats_vdev *stats_vdev)
}
}
static void rkisp_stats_stop_v39(struct rkisp_isp_stats_vdev *stats_vdev)
{
struct rkisp_device *dev = stats_vdev->dev;
u32 val, addr;
/* aiq crash or exit first */
if (dev->isp_state & ISP_START &&
stats_vdev->stats_buf[0].mem_priv) {
rkisp_stats_update_buf(stats_vdev);
addr = stats_vdev->stats_buf[0].dma_addr;
readl_poll_timeout(dev->hw_dev->base_addr + ISP39_W3A_AEBIG_ADDR_SHD,
val, val == addr, 5000, 50000);
}
}
static struct rkisp_isp_stats_ops rkisp_isp_stats_ops_tbl = {
.isr_hdl = rkisp_stats_isr_v39,
.get_stat_size = rkisp_get_stat_size_v39,
.first_ddr_cfg = rkisp_stats_first_ddr_config_v39,
.next_ddr_cfg = rkisp_stats_next_ddr_config_v39,
.stats_stop = rkisp_stats_stop_v39,
};
void rkisp_init_stats_vdev_v39(struct rkisp_isp_stats_vdev *stats_vdev)

View File

@@ -10,10 +10,3 @@ config PCIE_FUNC_RKEP
help
Enable this configuration option to enable the host side function
driver for Rockchip's EP demo function driver.
config PCIE_FUNC_RKEP_USERPAGES
bool "EP function driver reserve continuous physical space for user layer"
depends on PCIE_FUNC_RKEP=y
help
Enable this configuration option to reserve continuous physical space
for user layer in Rockchip's EP demo function driver.

View File

@@ -89,7 +89,7 @@ static DEFINE_MUTEX(rkep_mutex);
#define PCIE_DMA_CHANEL_MAX_NUM 2
#define RKEP_USER_MEM_SIZE SZ_64M
#define RKEP_USER_MEM_SIZE SZ_4M
#define PCIE_CFG_ELBI_APP_OFFSET 0xe00
#define PCIE_CFG_ELBI_USER_DATA_OFF 0x10
@@ -1333,9 +1333,7 @@ static int pcie_rkep_probe(struct pci_dev *pdev, const struct pci_device_id *id)
}
}
#if IS_ENABLED(CONFIG_PCIE_FUNC_RKEP_USERPAGES)
pcie_rkep->user_pages =
alloc_contig_pages(RKEP_USER_MEM_SIZE >> PAGE_SHIFT, GFP_KERNEL, 0, NULL);
pcie_rkep->user_pages = alloc_pages(GFP_KERNEL, get_order(RKEP_USER_MEM_SIZE));
if (!pcie_rkep->user_pages) {
dev_err(&pcie_rkep->pdev->dev, "failed to allocate contiguous pages\n");
ret = -EINVAL;
@@ -1344,8 +1342,7 @@ static int pcie_rkep_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto err_register_obj;
}
pcie_rkep->cur_mmap_res = PCIE_EP_MMAP_RESOURCE_USER_MEM;
dev_err(&pdev->dev, "successfully allocate continuouse buffer for userspace\n");
#endif
dev_info(&pdev->dev, "successfully allocate continuouse buffer for userspace\n");
pci_read_config_word(pcie_rkep->pdev, PCI_VENDOR_ID, &val);
dev_info(&pdev->dev, "vid=%x\n", val);
@@ -1387,9 +1384,7 @@ static void pcie_rkep_remove(struct pci_dev *pdev)
pcie_dw_dmatest_unregister(pcie_rkep->dma_obj);
device_remove_file(&pdev->dev, &dev_attr_rkep);
#if IS_ENABLED(CONFIG_PCIE_FUNC_RKEP_USERPAGES)
free_contig_range(page_to_pfn(pcie_rkep->user_pages), RKEP_USER_MEM_SIZE >> PAGE_SHIFT);
#endif
__free_pages(pcie_rkep->user_pages, get_order(RKEP_USER_MEM_SIZE));
pcie_rkep_release_irq(pcie_rkep);
if (pcie_rkep->bar0)
@@ -1445,6 +1440,7 @@ static const struct pci_error_handlers pcie_rkep_err_handler = {
static const struct pci_device_id pcie_rkep_pcidev_id[] = {
{ PCI_VDEVICE(ROCKCHIP, 0x356a), 1, },
{ PCI_VDEVICE(ROCKCHIP, 0x182a), 1, },
{ }
};
MODULE_DEVICE_TABLE(pcie_rkep, pcie_rkep_pcidev_id);

View File

@@ -1394,7 +1394,7 @@ int rockchip_csi2_dphy_hw_init(void)
return platform_driver_register(&rockchip_csi2_dphy_hw_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall(rockchip_csi2_dphy_hw_init);
#else
#if !defined(CONFIG_VIDEO_REVERSE_IMAGE)

View File

@@ -1276,8 +1276,8 @@ int rockchip_csi2_dphy_init(void)
return platform_driver_register(&rockchip_csi2_dphy_driver);
}
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP) && !defined(CONFIG_INITCALL_ASYNC)
subsys_initcall(rockchip_csi2_dphy_init);
#if defined(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)
subsys_initcall_sync(rockchip_csi2_dphy_init);
#else
#if !defined(CONFIG_VIDEO_REVERSE_IMAGE)
module_platform_driver(rockchip_csi2_dphy_driver);