/* must specify in revers order of SCALER_VERSION(xyz) */
static const u32 sc_version_table[][2] = {
- { 0x02000100, SCALER_VERSION(5, 0, 0) }, /* SC_POLY */
+ { 0x02000100, SCALER_VERSION(5, 0, 1) }, /* SC_POLY */
{ 0x02000000, SCALER_VERSION(5, 0, 0) },
{ 0x80060007, SCALER_VERSION(4, 2, 0) }, /* SC_BI */
{ 0x0100000f, SCALER_VERSION(4, 0, 1) }, /* SC_POLY */
static const struct sc_variant sc_variant[] = {
{
+ .limit_input = {
+ .min_w = 16,
+ .min_h = 16,
+ .max_w = 8192,
+ .max_h = 8192,
+ },
+ .limit_output = {
+ .min_w = 4,
+ .min_h = 4,
+ .max_w = 8192,
+ .max_h = 8192,
+ },
+ .version = SCALER_VERSION(5, 0, 1),
+ .sc_up_max = SCALE_RATIO_CONST(1, 8),
+ .sc_down_min = SCALE_RATIO_CONST(4, 1),
+ .sc_up_swmax = SCALE_RATIO_CONST(1, 64),
+ .sc_down_swmin = SCALE_RATIO_CONST(16, 1),
+ .blending = 0,
+ .prescale = 0,
+ .ratio_20bit = 1,
+ .initphase = 1,
+ .pixfmt_10bit = 1,
+ .extra_buf = 1,
+ }, {
.limit_input = {
.min_w = 16,
.min_h = 16,
d_frame = &ctx->d_frame;
sc_hwset_init(sc);
+ sc_hwset_clk_request(sc, true);
if (ctx->i_frame) {
set_bit(CTX_INT_FRAME, &ctx->flags);
if (!SCALER_INT_OK(irq_status))
sc_hwset_soft_reset(sc);
+ sc_hwset_clk_request(sc, false);
+
clear_bit(DEV_RUN, &sc->state);
clear_bit(CTX_RUN, &ctx->flags);
#define SCALER_CFG_BURST_WR (1 << 8)
#define SCALER_CFG_BURST_RD (1 << 7)
#define SCALER_CFG_CSC_Y_OFFSET_DST (1 << 9)
+#define SCALER_CFG_STOP_REQ (1 << 3)
+#define SCALER_CFG_RESET_OKAY (1 << 2)
#define SCALER_CFG_SOFT_RST (1 << 1)
#define SCALER_CFG_START_CMD (1 << 0)
#define SCALER_TIMEOUT_CTRL 0x2c0
#define SCALER_TIMEOUT_CNT 0x2c4
+#define SCALER_CLK_REQ 0x2cc
#define SCALER_SRC_YH_INIT_PHASE 0x2d0
#define SCALER_SRC_YV_INIT_PHASE 0x2d4
#define SCALER_VAL_SRC_POS(l, t) (((l) & 0x3FFF) << 18) | (((t) & 0x3FFF) << 2)
#define SCALER_VAL_DST_POS(l, t) (((l) & 0x3FFF) << 16) | ((t) & 0x3FFF)
+static inline void sc_hwset_clk_request(struct sc_dev *sc, bool enable)
+{
+ if (sc->version == SCALER_VERSION(5, 0, 1))
+ __raw_writel(enable ? 1 : 0, sc->regs + SCALER_CLK_REQ);
+}
+
static inline void sc_hwset_src_pos(struct sc_dev *sc, __s32 left, __s32 top,
unsigned int chshift, unsigned int cvshift)
{
{
unsigned long cfg;
+ if (sc->version == SCALER_VERSION(5, 0, 1)) {
+ int cnt = 1000;
+
+ __raw_writel(SCALER_CFG_STOP_REQ, sc->regs + SCALER_CFG);
+
+ while (cnt-- > 0)
+ if (__raw_readl(sc->regs + SCALER_CFG)
+ & SCALER_CFG_RESET_OKAY)
+ break;
+
+ WARN_ON(cnt <= 0);
+ }
+
#ifdef SC_NO_SOFTRST
cfg = (SCALER_CFG_CSC_Y_OFFSET_SRC | SCALER_CFG_CSC_Y_OFFSET_DST);
#else