.. | .. |
---|
302 | 302 | #define ISP_GAMMA_OUT_Y39 (ISP_GAMMA_OUT_BASE + 0x000ac) |
---|
303 | 303 | #define ISP_GAMMA_OUT_Y40 (ISP_GAMMA_OUT_BASE + 0x000b0) |
---|
304 | 304 | |
---|
305 | | -#define SELF_RESIZE_BASE 0x00000C00 |
---|
306 | | -#define SELF_RESIZE_CTRL (SELF_RESIZE_BASE + 0x00000) |
---|
307 | | -#define SELF_RESIZE_SCALE_HY (SELF_RESIZE_BASE + 0x00004) |
---|
308 | | -#define SELF_RESIZE_SCALE_HCB (SELF_RESIZE_BASE + 0x00008) |
---|
309 | | -#define SELF_RESIZE_SCALE_HCR (SELF_RESIZE_BASE + 0x0000c) |
---|
310 | | -#define SELF_RESIZE_SCALE_VY (SELF_RESIZE_BASE + 0x00010) |
---|
311 | | -#define SELF_RESIZE_SCALE_VC (SELF_RESIZE_BASE + 0x00014) |
---|
312 | | -#define SELF_RESIZE_PHASE_HY (SELF_RESIZE_BASE + 0x00018) |
---|
313 | | -#define SELF_RESIZE_PHASE_HC (SELF_RESIZE_BASE + 0x0001c) |
---|
314 | | -#define SELF_RESIZE_PHASE_VY (SELF_RESIZE_BASE + 0x00020) |
---|
315 | | -#define SELF_RESIZE_PHASE_VC (SELF_RESIZE_BASE + 0x00024) |
---|
316 | | -#define SELF_RESIZE_SCALE_LUT_ADDR (SELF_RESIZE_BASE + 0x00028) |
---|
317 | | -#define SELF_RESIZE_SCALE_LUT (SELF_RESIZE_BASE + 0x0002c) |
---|
318 | | -#define SELF_RESIZE_CTRL_SHD (SELF_RESIZE_BASE + 0x00030) |
---|
319 | | -#define SELF_RESIZE_SCALE_HY_SHD (SELF_RESIZE_BASE + 0x00034) |
---|
320 | | -#define SELF_RESIZE_SCALE_HCB_SHD (SELF_RESIZE_BASE + 0x00038) |
---|
321 | | -#define SELF_RESIZE_SCALE_HCR_SHD (SELF_RESIZE_BASE + 0x0003c) |
---|
322 | | -#define SELF_RESIZE_SCALE_VY_SHD (SELF_RESIZE_BASE + 0x00040) |
---|
323 | | -#define SELF_RESIZE_SCALE_VC_SHD (SELF_RESIZE_BASE + 0x00044) |
---|
324 | | -#define SELF_RESIZE_PHASE_HY_SHD (SELF_RESIZE_BASE + 0x00048) |
---|
325 | | -#define SELF_RESIZE_PHASE_HC_SHD (SELF_RESIZE_BASE + 0x0004c) |
---|
326 | | -#define SELF_RESIZE_PHASE_VY_SHD (SELF_RESIZE_BASE + 0x00050) |
---|
327 | | -#define SELF_RESIZE_PHASE_VC_SHD (SELF_RESIZE_BASE + 0x00054) |
---|
328 | | - |
---|
329 | | -#define MAIN_RESIZE_BASE 0x00001000 |
---|
| 305 | +#define MAIN_RESIZE_BASE 0x00000C00 |
---|
330 | 306 | #define MAIN_RESIZE_CTRL (MAIN_RESIZE_BASE + 0x00000) |
---|
331 | 307 | #define MAIN_RESIZE_SCALE_HY (MAIN_RESIZE_BASE + 0x00004) |
---|
332 | 308 | #define MAIN_RESIZE_SCALE_HCB (MAIN_RESIZE_BASE + 0x00008) |
---|
.. | .. |
---|
349 | 325 | #define MAIN_RESIZE_PHASE_HC_SHD (MAIN_RESIZE_BASE + 0x0004c) |
---|
350 | 326 | #define MAIN_RESIZE_PHASE_VY_SHD (MAIN_RESIZE_BASE + 0x00050) |
---|
351 | 327 | #define MAIN_RESIZE_PHASE_VC_SHD (MAIN_RESIZE_BASE + 0x00054) |
---|
| 328 | + |
---|
| 329 | +#define SELF_RESIZE_BASE 0x00001000 |
---|
| 330 | +#define SELF_RESIZE_CTRL (SELF_RESIZE_BASE + 0x00000) |
---|
| 331 | +#define SELF_RESIZE_SCALE_HY (SELF_RESIZE_BASE + 0x00004) |
---|
| 332 | +#define SELF_RESIZE_SCALE_HCB (SELF_RESIZE_BASE + 0x00008) |
---|
| 333 | +#define SELF_RESIZE_SCALE_HCR (SELF_RESIZE_BASE + 0x0000c) |
---|
| 334 | +#define SELF_RESIZE_SCALE_VY (SELF_RESIZE_BASE + 0x00010) |
---|
| 335 | +#define SELF_RESIZE_SCALE_VC (SELF_RESIZE_BASE + 0x00014) |
---|
| 336 | +#define SELF_RESIZE_PHASE_HY (SELF_RESIZE_BASE + 0x00018) |
---|
| 337 | +#define SELF_RESIZE_PHASE_HC (SELF_RESIZE_BASE + 0x0001c) |
---|
| 338 | +#define SELF_RESIZE_PHASE_VY (SELF_RESIZE_BASE + 0x00020) |
---|
| 339 | +#define SELF_RESIZE_PHASE_VC (SELF_RESIZE_BASE + 0x00024) |
---|
| 340 | +#define SELF_RESIZE_SCALE_LUT_ADDR (SELF_RESIZE_BASE + 0x00028) |
---|
| 341 | +#define SELF_RESIZE_SCALE_LUT (SELF_RESIZE_BASE + 0x0002c) |
---|
| 342 | +#define SELF_RESIZE_CTRL_SHD (SELF_RESIZE_BASE + 0x00030) |
---|
| 343 | +#define SELF_RESIZE_SCALE_HY_SHD (SELF_RESIZE_BASE + 0x00034) |
---|
| 344 | +#define SELF_RESIZE_SCALE_HCB_SHD (SELF_RESIZE_BASE + 0x00038) |
---|
| 345 | +#define SELF_RESIZE_SCALE_HCR_SHD (SELF_RESIZE_BASE + 0x0003c) |
---|
| 346 | +#define SELF_RESIZE_SCALE_VY_SHD (SELF_RESIZE_BASE + 0x00040) |
---|
| 347 | +#define SELF_RESIZE_SCALE_VC_SHD (SELF_RESIZE_BASE + 0x00044) |
---|
| 348 | +#define SELF_RESIZE_PHASE_HY_SHD (SELF_RESIZE_BASE + 0x00048) |
---|
| 349 | +#define SELF_RESIZE_PHASE_HC_SHD (SELF_RESIZE_BASE + 0x0004c) |
---|
| 350 | +#define SELF_RESIZE_PHASE_VY_SHD (SELF_RESIZE_BASE + 0x00050) |
---|
| 351 | +#define SELF_RESIZE_PHASE_VC_SHD (SELF_RESIZE_BASE + 0x00054) |
---|
352 | 352 | |
---|
353 | 353 | #define MI_BASE 0x00001400 |
---|
354 | 354 | #define MI_WR_CTRL (MI_BASE + 0x00000) |
---|
.. | .. |
---|
2492 | 2492 | |
---|
2493 | 2493 | /* HDRMGE */ |
---|
2494 | 2494 | /* ISP_HDRMGE_CTRL */ |
---|
| 2495 | +#define ISP_HDRMGE_MODE_MASK GENMASK(3, 2) |
---|
2495 | 2496 | #define ISP_HDRMGE_EN BIT(0) |
---|
2496 | 2497 | |
---|
2497 | 2498 | /* RAWNR */ |
---|
.. | .. |
---|
2577 | 2578 | /* ISP21 DHAZ/DRC/BAY3D */ |
---|
2578 | 2579 | #define ISP21_SELF_FORCE_UPD BIT(31) |
---|
2579 | 2580 | |
---|
2580 | | -static inline bool dmatx0_is_stream_stopped(void __iomem *base) |
---|
| 2581 | +static inline bool dmatx0_is_stream_stopped(struct rkisp_stream *stream) |
---|
2581 | 2582 | { |
---|
2582 | | - u32 ret = readl(base + CSI2RX_RAW0_WR_CTRL); |
---|
| 2583 | + u32 ret = rkisp_read(stream->ispdev, CSI2RX_RAW0_WR_CTRL, true); |
---|
2583 | 2584 | |
---|
2584 | 2585 | return !(ret & SW_CSI_RAW_WR_EN_SHD); |
---|
2585 | 2586 | } |
---|
2586 | 2587 | |
---|
2587 | | -static inline bool dmatx1_is_stream_stopped(void __iomem *base) |
---|
| 2588 | +static inline bool dmatx1_is_stream_stopped(struct rkisp_stream *stream) |
---|
2588 | 2589 | { |
---|
2589 | | - u32 ret = readl(base + CSI2RX_RAW1_WR_CTRL); |
---|
| 2590 | + u32 ret = rkisp_read(stream->ispdev, CSI2RX_RAW1_WR_CTRL, true); |
---|
2590 | 2591 | |
---|
2591 | 2592 | return !(ret & SW_CSI_RAW_WR_EN_SHD); |
---|
2592 | 2593 | } |
---|
2593 | 2594 | |
---|
2594 | | -static inline bool dmatx2_is_stream_stopped(void __iomem *base) |
---|
| 2595 | +static inline bool dmatx2_is_stream_stopped(struct rkisp_stream *stream) |
---|
2595 | 2596 | { |
---|
2596 | | - u32 ret = readl(base + CSI2RX_RAW2_WR_CTRL); |
---|
| 2597 | + u32 ret = rkisp_read(stream->ispdev, CSI2RX_RAW2_WR_CTRL, true); |
---|
2597 | 2598 | |
---|
2598 | 2599 | return !(ret & SW_CSI_RAW_WR_EN_SHD); |
---|
2599 | 2600 | } |
---|
2600 | 2601 | |
---|
2601 | | -static inline bool dmatx3_is_stream_stopped(void __iomem *base) |
---|
| 2602 | +static inline bool dmatx3_is_stream_stopped(struct rkisp_stream *stream) |
---|
2602 | 2603 | { |
---|
2603 | | - u32 ret = readl(base + CSI2RX_RAW3_WR_CTRL); |
---|
| 2604 | + u32 ret = rkisp_read(stream->ispdev, CSI2RX_RAW3_WR_CTRL, true); |
---|
2604 | 2605 | |
---|
2605 | 2606 | return !(ret & SW_CSI_RAW_WR_EN_SHD); |
---|
2606 | 2607 | } |
---|
.. | .. |
---|
2697 | 2698 | is_direct = false; |
---|
2698 | 2699 | rkisp_write(stream->ispdev, stream->config->mi.length, |
---|
2699 | 2700 | stream->out_fmt.plane_fmt[0].bytesperline, is_direct); |
---|
| 2701 | + if (stream->ispdev->isp_ver == ISP_V21 || stream->ispdev->isp_ver == ISP_V30) |
---|
| 2702 | + rkisp_set_bits(stream->ispdev, MI_RD_CTRL2, 0, BIT(30), false); |
---|
| 2703 | + if (stream->ispdev->hw_dev->is_unite) { |
---|
| 2704 | + rkisp_next_write(stream->ispdev, stream->config->mi.length, |
---|
| 2705 | + stream->out_fmt.plane_fmt[0].bytesperline, is_direct); |
---|
| 2706 | + rkisp_next_set_bits(stream->ispdev, MI_RD_CTRL2, 0, BIT(30), false); |
---|
| 2707 | + } |
---|
2700 | 2708 | } |
---|
2701 | 2709 | |
---|
2702 | 2710 | static inline void rx_force_upd(void __iomem *base) |
---|