Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4765499pxu; Tue, 13 Oct 2020 06:43:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHaOkbPhs6cuqXo+kfWF4928HaiLrFBauBYEjE9bQqarsb3dEjm4Mz1h+qv/4vYgljGn2T X-Received: by 2002:aa7:d3d0:: with SMTP id o16mr18187327edr.47.1602596588697; Tue, 13 Oct 2020 06:43:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602596588; cv=none; d=google.com; s=arc-20160816; b=wfAygSDbGMCCLHk7wiKxpMDlihfteYBnZd059klKOySPFHPMcOKbHil1TDYCrQVO1b de+4Ft94j/Oj//nI8Nk+2gFsSThcfO/p9g75bmX7rmIX2bpesl7w1f5DhkispRQqyFzd 9/rLcHEQEcXM326XAm0b5Guf+yWvFu4NYreCwmVrrsvzOaPO2+IB8ZSyUNfnjPak26ut 05ziXkhPWGsv+HyEX3OOrkzXgPdnp6wSqbxeAElUFfIz6fwx0eA2hYFJl+ZQacjwM0+h 8Mz32el20A4Q+Z7ZPD+wljkS1RZ0KDKfTv6W0IBJdvPUPBS/VQ2Fbk0oTq6xm5Y8rN/T k4ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=euNyQ3k0xK5JYURc+Nm+4Z68tVxhoeEbMU826jGDkJQ=; b=lruQ7TjwBOWT2Xg10wzimABUoLT06lO0A0iG0pRcvJ+duuZwakuV45SDGM9r3+3T13 ATn8hgQCsU7Cskq5ryKCrH3lDbwAypjiQfrLurGEtM06HqM1iuIPDa3DYCJi79Cvfs1n 4kWcULRHywJmx3pnFPniqgLTPXM/IoJ0AipQOeqBcndNNB6iiFCCCIjBhwdN7kcSlASX iLkwyoLwte2rcahwueBYIKPKv85HetrhHOUupzvRVesmyAKGu+ve8UbkY14GpMduWe3s QH9uo7QJstyQrORHXuo+wjGCWbZrDiYl/zANeSBSuFYnACBOwnj83C2VI6mODm7lBydV SIFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si15482373edn.512.2020.10.13.06.42.46; Tue, 13 Oct 2020 06:43:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731730AbgJLU7B (ORCPT + 99 others); Mon, 12 Oct 2020 16:59:01 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:49802 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730339AbgJLU64 (ORCPT ); Mon, 12 Oct 2020 16:58:56 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 984B81F44C2C From: Adrian Ratiu To: Ezequiel Garcia , Philipp Zabel Cc: Mark Brown , Mauro Carvalho Chehab , Fruehberger Peter , kuhanh.murugasen.krishnan@intel.com, Daniel Vetter , kernel@collabora.com, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/18] media: hantro: make G1_REG_SOFT_RESET Rockchip specific Date: Mon, 12 Oct 2020 23:59:42 +0300 Message-Id: <20201012205957.889185-4-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012205957.889185-1-adrian.ratiu@collabora.com> References: <20201012205957.889185-1-adrian.ratiu@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This register is not documented in either the G1 or VC8000D register maps and on VC8000D there is a conflict because at the same offset the VPU IP defines another register with a very different meaning. What likely happened is the HW integrator which uses only the G1 IP core added some reset/control logic at the end of the VPU map, so it makes sense to make this register RK-specific. Signed-off-by: Adrian Ratiu --- drivers/staging/media/hantro/hantro_g1_regs.h | 1 - drivers/staging/media/hantro/rk3288_vpu_hw.c | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/hantro/hantro_g1_regs.h b/drivers/staging/media/hantro/hantro_g1_regs.h index 073b64cbe295..a482a2ba6dfe 100644 --- a/drivers/staging/media/hantro/hantro_g1_regs.h +++ b/drivers/staging/media/hantro/hantro_g1_regs.h @@ -315,7 +315,6 @@ #define G1_REG_REF_BUF_CTRL2_REFBU2_THR(x) (((x) & 0xfff) << 19) #define G1_REG_REF_BUF_CTRL2_REFBU2_PICID(x) (((x) & 0x1f) << 14) #define G1_REG_REF_BUF_CTRL2_APF_THRESHOLD(x) (((x) & 0x3fff) << 0) -#define G1_REG_SOFT_RESET 0x194 /* Post-processor registers. */ #define G1_REG_PP_INTERRUPT G1_SWREG(60) diff --git a/drivers/staging/media/hantro/rk3288_vpu_hw.c b/drivers/staging/media/hantro/rk3288_vpu_hw.c index 7b299ee3e93d..4ad578b1236e 100644 --- a/drivers/staging/media/hantro/rk3288_vpu_hw.c +++ b/drivers/staging/media/hantro/rk3288_vpu_hw.c @@ -13,6 +13,8 @@ #include "hantro_g1_regs.h" #include "hantro_h1_regs.h" +#define VDPU_REG_SOFT_RESET 0x194 + #define RK3288_ACLK_MAX_FREQ (400 * 1000 * 1000) /* @@ -167,7 +169,7 @@ static void rk3288_vpu_dec_reset(struct hantro_ctx *ctx) vdpu_write(vpu, G1_REG_INTERRUPT_DEC_IRQ_DIS, G1_REG_INTERRUPT); vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG); - vdpu_write(vpu, 1, G1_REG_SOFT_RESET); + vdpu_write(vpu, 1, VDPU_REG_SOFT_RESET); } /* -- 2.28.0