From patchwork Thu Mar 11 15:40:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 397963 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 632EDC433DB for ; Thu, 11 Mar 2021 15:41:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07FC164FE0 for ; Thu, 11 Mar 2021 15:41:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234208AbhCKPlX (ORCPT ); Thu, 11 Mar 2021 10:41:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234237AbhCKPlF (ORCPT ); Thu, 11 Mar 2021 10:41:05 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 369E4C061574 for ; Thu, 11 Mar 2021 07:41:05 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id f12so2378181wrx.8 for ; Thu, 11 Mar 2021 07:41:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A9gilAFWqX+sAkYfLFghCBaHM+ZlkbP8jMbwAPT3w7E=; b=pektPEun0KxdsEnbuwQz9hjNCrAy48V2ZNCQIjBl8zQKyJmPRrOr08idB06H8UqfO8 9vwUJAEaHuSJyBg89IHWMNkBvx8Mwo7YTkY5nlcVXbXxKwzXwv/V5AgBnW04fCDIrxj/ HGiXtvnpCBoQeiIx6ef6DU3Gdt59i9ugc7OCZF1JfnB/JFixmoY2dmBKGRVrnjsDi1R7 NpvOUzJxgw+QCRi9M33+WSkb+Dm3L3pttaRgGATOt4ojG61iC5KzRLj6Qe6l2S3xG57F +1N/6iwOgZ8R1BR2n99gE2TW7767qemdnUZAQAZRefY0Ak/7dVYp5YYmjTtmwd+wWZzB DBuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A9gilAFWqX+sAkYfLFghCBaHM+ZlkbP8jMbwAPT3w7E=; b=qxuiyB94GDh96QkGqYLV+PpI5yxg5ozfJoZVybotwb/+mR3MxQG0Xi7Ro6DITVpniT t5iO8I3upZohGbKq3T7Yj4TuvIFf3rAaxh1VmSlq2ZoN87TTanT5K+oqV/mOYVeLZp6Y fKu+XXJlBkwG/iS1855NBCxWpIp/4MIViCQqg++ya7MicfgAr2xLHx7zL1kzpIC/CNTO 2H8kl5uWLHxv1ZTDACbesztnUm8pMQ+IFCG6INA+IspW6wxSoLMgl6QaK28Tw2EkV3Ss 6Mq14uwWjQRtOTC7r6hnjlRGUbuEO1zWXwDHq5gZwoaDeEV47jKO5bHRdje/1XCp41cf 9vbQ== X-Gm-Message-State: AOAM530qTAvsA6ias3RHc4FrBT15s896srhkN8pZx4vvwfQL316q55XU rmaHYKV/FeSp0XuTPRUd0GDSHhFr+od+/w== X-Google-Smtp-Source: ABdhPJxgud3NIWFBRry4m06fLMiqJrSLDu4S+lxYccZpRNN/gnJmAyCbf6lWujooctTG6oQNOz4cNA== X-Received: by 2002:adf:f351:: with SMTP id e17mr9282127wrp.416.1615477263932; Thu, 11 Mar 2021 07:41:03 -0800 (PST) Received: from arch-x1c3.. ([2a00:5f00:102:0:b16d:9752:8f38:7d6b]) by smtp.gmail.com with ESMTPSA id a17sm4008547wmj.9.2021.03.11.07.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 07:41:03 -0800 (PST) From: Emil Velikov To: Ezequiel Garcia , Philipp Zabel , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, Nicolas Ferre Cc: emil.l.velikov@gmail.com Subject: [PATCH v2 01/10] media: hantro: use G1_REG_INTERRUPT directly for the mpeg2 Date: Thu, 11 Mar 2021 15:40:46 +0000 Message-Id: <20210311154055.3496076-2-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210311154055.3496076-1-emil.l.velikov@gmail.com> References: <20210311154055.3496076-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Emil Velikov Use the register directly over the existing SWREG(). Ideally we'll port the driver away from the local registers, but for now this is enough. For context - I was reading through the IRQ register handling across the variants. Signed-off-by: Emil Velikov --- drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c b/drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c index 6386a3989bfe..0fd306806f16 100644 --- a/drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c +++ b/drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c @@ -10,6 +10,7 @@ #include #include "hantro.h" #include "hantro_hw.h" +#include "hantro_g1_regs.h" #define G1_SWREG(nr) ((nr) * 4) @@ -20,7 +21,6 @@ #define G1_REG_REFER2_BASE G1_SWREG(16) #define G1_REG_REFER3_BASE G1_SWREG(17) #define G1_REG_QTABLE_BASE G1_SWREG(40) -#define G1_REG_DEC_E(v) ((v) ? BIT(0) : 0) #define G1_REG_DEC_AXI_RD_ID(v) (((v) << 24) & GENMASK(31, 24)) #define G1_REG_DEC_TIMEOUT_E(v) ((v) ? BIT(23) : 0) @@ -246,6 +246,5 @@ void hantro_g1_mpeg2_dec_run(struct hantro_ctx *ctx) hantro_end_prepare_run(ctx); - reg = G1_REG_DEC_E(1); - vdpu_write(vpu, reg, G1_SWREG(1)); + vdpu_write(vpu, G1_REG_INTERRUPT_DEC_E, G1_REG_INTERRUPT); } From patchwork Thu Mar 11 15:40:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 397959 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 993E4C28E85 for ; Thu, 11 Mar 2021 15:41:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E19F64F99 for ; Thu, 11 Mar 2021 15:41:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234223AbhCKPlY (ORCPT ); Thu, 11 Mar 2021 10:41:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234238AbhCKPlG (ORCPT ); Thu, 11 Mar 2021 10:41:06 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28C81C061574 for ; Thu, 11 Mar 2021 07:41:06 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id g25so1581062wmh.0 for ; Thu, 11 Mar 2021 07:41:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kKmhv2Y0oUyyi/VXeYaxzp9JGOustNOwjC5/Ra6ht2Q=; b=qgnAy80K0P4ESBNv8l3gm6xQ52lXJ5JFgOP6sl9KO4Cuha2cLxIireMBCSbdQ7egGf mT5mSjE3JbBjRYkVyknxVYZgcm8N+UmsoYuLA+NrBD+LVItCeI1vcQ6HHG0Id6xke8XU bTacpY5cbA9wjhzMWmm0/dWCxeJMP6FSn85I3Bwh7TmVnJb90698r31mc31SsmIcbsW5 MG6QJFPAD2ORQE4+hzQzEV81XkfOWsNjqtxlhNbAtANCPx8vYL8Yttn6jsBQ0Q9FY+Bf Kdv67OSQ7lr26cOgy8RhOtwtaSIYeHIvMhQ+wJI7Wm/Ilm/ZB+I+C3YiUKMTMwghOE3z RHzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kKmhv2Y0oUyyi/VXeYaxzp9JGOustNOwjC5/Ra6ht2Q=; b=B8xgM41V7e0nPckA23E4YFCCuzvlTn0YokkBMysGjxP7WWQ/V6CPOuVO2Bx5c6+oo9 gOGj7LshMvN+VEhqkm2HI8YuhkYZ6z/WITCdFLbJy+DkOn+2vrNk6rJaDoqgwfIFTMaB KI3Z8sm1pVmKG2kkaJpbHh5kW7fW2mAaYe+/f1VtGLnKvPb+VmUfholyydwGl2oOyKQv rNER+Q2VnZcGICc74sMArcOcoAzrxzVostslMSjm5Z+nUgEXNOxGxDpdtiquFRb4Ituy 387XMRsDkExWC32SnyQY4yKGhHpfmMSB0Sbg0tdXUH7Y3LJP1uXex51DVF61iBNjVfVR OvSw== X-Gm-Message-State: AOAM533sFlQdhoKf7n0jqhVnySmNi3ISqu4yGsvv6iPcPci1ud6YwQZE ZJz/7cR3nG9meJ9nK8DgAuI= X-Google-Smtp-Source: ABdhPJwgR89QBqoRghUCewrCWayclTBmXDuP7KmBhKWoB55wtpWDGR4+HiegDvgrfhvj7ywLxPIrEw== X-Received: by 2002:a1c:498b:: with SMTP id w133mr9146215wma.134.1615477264937; Thu, 11 Mar 2021 07:41:04 -0800 (PST) Received: from arch-x1c3.. ([2a00:5f00:102:0:b16d:9752:8f38:7d6b]) by smtp.gmail.com with ESMTPSA id a17sm4008547wmj.9.2021.03.11.07.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 07:41:04 -0800 (PST) From: Emil Velikov To: Ezequiel Garcia , Philipp Zabel , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, Nicolas Ferre Cc: emil.l.velikov@gmail.com Subject: [PATCH v2 02/10] media: hantro: imx: reuse MB_DIM define Date: Thu, 11 Mar 2021 15:40:47 +0000 Message-Id: <20210311154055.3496076-3-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210311154055.3496076-1-emil.l.velikov@gmail.com> References: <20210311154055.3496076-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Emil Velikov Swap the hardcoded 16 with MB_DIM define. Fixes: 8e4aaa687863 ("media: hantro: add initial i.MX8MQ support") Reviewed-by: Philipp Zabel Signed-off-by: Emil Velikov --- drivers/staging/media/hantro/imx8m_vpu_hw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c index c222de075ef4..1f48c1956cd2 100644 --- a/drivers/staging/media/hantro/imx8m_vpu_hw.c +++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c @@ -109,10 +109,10 @@ static const struct hantro_fmt imx8m_vpu_dec_fmts[] = { .frmsize = { .min_width = 48, .max_width = 3840, - .step_width = 16, + .step_width = MB_DIM, .min_height = 48, .max_height = 2160, - .step_height = 16, + .step_height = MB_DIM, }, }, { From patchwork Thu Mar 11 15:40:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 397962 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 952D8C4332B for ; Thu, 11 Mar 2021 15:41:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDAF564FF7 for ; Thu, 11 Mar 2021 15:41:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234308AbhCKPlZ (ORCPT ); Thu, 11 Mar 2021 10:41:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233943AbhCKPlH (ORCPT ); Thu, 11 Mar 2021 10:41:07 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A8B5C061574 for ; Thu, 11 Mar 2021 07:41:07 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id v15so2394321wrx.4 for ; Thu, 11 Mar 2021 07:41:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ssl1iA7M+yjQgL0tdJM6ww1IB2abRHT8PVziTs2Mluc=; b=uV0pMhDzaz1GVXPWhNOl4ltw/m0ib3QSPlmU13jsCAD8j6S3lXnGvfQ3eAZyyPWSvs MZf7igUMPMyehp6+5cD6v0XPVuQkjMta4RMSEWyq+3EtU0Y67Ruhi7hiQdXKSYfvFcWE qQk4sShgwwtyLz3koVtF7pOqfSv82Ds1bRNbHGFHzGnjDjTZcRLdWIov1YOK40/S/PAJ DAq50hONyoJBazW7n+ByyIklAD4ZFqntEDTbMQzp7ktvcJRnbUSjCT/qc8ug3bJt31XN SDb8c5VBi2xTTIxzQI1eFWTPpGJwaZpeGhkgZqfM3CKk9PYU/ihJAcN+2xg4QL5IRrVw uiaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ssl1iA7M+yjQgL0tdJM6ww1IB2abRHT8PVziTs2Mluc=; b=UmvPlu1H4IwuD4/DF6K8kpbthe/oOBkRrmaTbWihVb3st8f9EvZitjVd4dztgdsuLn YApwEcHLX2HfMIoNe/yM3Z2J2WOmLwmGRUYv0Zx0hpNpAAI26qEnDZT0u6Tc6CHn/phN rB8ZWtXFdRoOhyJR2rjc73FmGbvAnNKgSFeSMvOGHGv0xEqMGZIQKMlYqA5Xvy96jrXq Zv+85jLcB/Awrxkjq8bRTO0KLSpmnnGz0p5J4DJCE/AUTt9Edidzh5w1oVrdJ59b105M tFHk7jWE9L+7wJ2iqApOtMd34XyCNU2YlBMRrtPyO5oBkO3mn/wcZVGAgqCgzizQhRE7 cvjw== X-Gm-Message-State: AOAM5316oxs+lX5Qp6EqmXCuiyKO0MYJBQPzySxFARNzhykjMyQ5fntE 4fOYzhJmOP08MZ1BBK90kWA= X-Google-Smtp-Source: ABdhPJykA0Zp7nDR2YtIXj7sKTeSrV/YQpNVe+k/BleazGZ0VeBDADL8vXMQnpYVTVzI+rrkLkkD/Q== X-Received: by 2002:adf:ce8a:: with SMTP id r10mr9340135wrn.17.1615477265973; Thu, 11 Mar 2021 07:41:05 -0800 (PST) Received: from arch-x1c3.. ([2a00:5f00:102:0:b16d:9752:8f38:7d6b]) by smtp.gmail.com with ESMTPSA id a17sm4008547wmj.9.2021.03.11.07.41.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 07:41:05 -0800 (PST) From: Emil Velikov To: Ezequiel Garcia , Philipp Zabel , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, Nicolas Ferre Cc: emil.l.velikov@gmail.com Subject: [PATCH v2 03/10] media: hantro: imx: remove duplicate dec_base init Date: Thu, 11 Mar 2021 15:40:48 +0000 Message-Id: <20210311154055.3496076-4-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210311154055.3496076-1-emil.l.velikov@gmail.com> References: <20210311154055.3496076-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Emil Velikov The vpu->dec_base is already set by the hantro driver itself. Fixes: 8e4aaa687863 ("media: hantro: add initial i.MX8MQ support") Reviewed-by: Philipp Zabel Signed-off-by: Emil Velikov --- drivers/staging/media/hantro/imx8m_vpu_hw.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c index 1f48c1956cd2..cb1ac02c03d2 100644 --- a/drivers/staging/media/hantro/imx8m_vpu_hw.c +++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c @@ -150,7 +150,6 @@ static irqreturn_t imx8m_vpu_g1_irq(int irq, void *dev_id) static int imx8mq_vpu_hw_init(struct hantro_dev *vpu) { - vpu->dec_base = vpu->reg_bases[0]; vpu->ctrl_base = vpu->reg_bases[vpu->variant->num_regs - 1]; return 0; From patchwork Thu Mar 11 15:40:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 399164 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BED6C433E9 for ; Thu, 11 Mar 2021 15:41:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9944A64FFA for ; Thu, 11 Mar 2021 15:41:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234315AbhCKPlZ (ORCPT ); Thu, 11 Mar 2021 10:41:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234118AbhCKPlI (ORCPT ); Thu, 11 Mar 2021 10:41:08 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23C70C061574 for ; Thu, 11 Mar 2021 07:41:08 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id b2-20020a7bc2420000b029010be1081172so13067349wmj.1 for ; Thu, 11 Mar 2021 07:41:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/r3aZbcoQSdd2XlNz/UGKekZlF4ttbt76qWK9B/aFNk=; b=UqPLiW74XyVzX+/8i1wFG4KYZv4JtNlR+POcaYks2dw73DeibmIKY+eAfxocTv4QAh m9w9FOgQIXx2pUE9rEwweK+GY755VQKjBGotptkRCyy8y/l3JDsvEICCZy0is/lshXts 25Fkooa49fmVuLkqtZO/QxcRnmnBLdeEstgwA4AStWv8aLNj2GsICxNApRrUPj0+BrSt TUJWmeRncmVYDie3V5+U9UuCLewznQfsnKDauWAqvXyMVM6VvPoobxp6YVC6aAw/TqVN Xh6IMh1C+9cxKO47tOV9FxhK2NTLgubFMJiYVQEju+0SA+LVZ/6gljVO2LMjljWhksl7 3lbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/r3aZbcoQSdd2XlNz/UGKekZlF4ttbt76qWK9B/aFNk=; b=dAMETHGW7tkP0+3UgsQZln1ArkUwgKqTR2Lv4nnKloZPxXieDXIfMWj09vdj+lGV86 Kc1iZsOF0TBV2i3dsSrse8iigqY7Dld8rdGY/8BCrI3ie/KB+cHocDG648+q/6u4Nya9 ahzUdblixEXEBndddfCCcWfYgp8vi73vFeYgRv2m+fWHHMPCaBqvGW1eXZpJzRZtRsJJ t5wL3cBOra7u2eN0zyV8lKIxGrYmFM+iLnqAcdcpViOyLJ2OZhUACC7BLxjJ5RsTjb4s bbIDH5sqXs/pSNcbEvSVtTP1yCOWC61Hw99+odlSpTf+2/9HarUTC2/LNApddfg3Znz5 bvpg== X-Gm-Message-State: AOAM531RY5YH//kvdjGlHf8F8YnhpMI9IggN+PAwD8U1OKeTYoXVdoLr AQN8lvInMjvtCiYtvmVxQiA= X-Google-Smtp-Source: ABdhPJwZaFjAOAqytix5m62/UG9vW5dE/VZ2CndcnxU4JL0UkXJxjs5A40JB6/bpCXjBwhvuJunELw== X-Received: by 2002:a1c:a306:: with SMTP id m6mr8517880wme.13.1615477266868; Thu, 11 Mar 2021 07:41:06 -0800 (PST) Received: from arch-x1c3.. ([2a00:5f00:102:0:b16d:9752:8f38:7d6b]) by smtp.gmail.com with ESMTPSA id a17sm4008547wmj.9.2021.03.11.07.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 07:41:06 -0800 (PST) From: Emil Velikov To: Ezequiel Garcia , Philipp Zabel , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, Nicolas Ferre Cc: emil.l.velikov@gmail.com Subject: [PATCH v2 04/10] media: hantro: imx: remove unused include Date: Thu, 11 Mar 2021 15:40:49 +0000 Message-Id: <20210311154055.3496076-5-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210311154055.3496076-1-emil.l.velikov@gmail.com> References: <20210311154055.3496076-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Emil Velikov The current imx8 code does not use the jpeg encoder. Remove the unnecessary include. Fixes: 8e4aaa687863 ("media: hantro: add initial i.MX8MQ support") Reviewed-by: Philipp Zabel Signed-off-by: Emil Velikov --- drivers/staging/media/hantro/imx8m_vpu_hw.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c index cb1ac02c03d2..f36c1bd681ba 100644 --- a/drivers/staging/media/hantro/imx8m_vpu_hw.c +++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c @@ -9,7 +9,6 @@ #include #include "hantro.h" -#include "hantro_jpeg.h" #include "hantro_g1_regs.h" #define CTRL_SOFT_RESET 0x00 From patchwork Thu Mar 11 15:40:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 397960 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCC51C4321A for ; Thu, 11 Mar 2021 15:41:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D1B865000 for ; Thu, 11 Mar 2021 15:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234326AbhCKPl2 (ORCPT ); Thu, 11 Mar 2021 10:41:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234239AbhCKPlJ (ORCPT ); Thu, 11 Mar 2021 10:41:09 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87877C061574 for ; Thu, 11 Mar 2021 07:41:09 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id y124-20020a1c32820000b029010c93864955so13484011wmy.5 for ; Thu, 11 Mar 2021 07:41:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rZ+UT/0DYLpJdWHcgpT9su7amjefBZUCNnN6zoLBwO4=; b=WvxGEE2SB/V9cLac6+iZMUPtoKQ5HXuGo/57HrU68Uo/rKPCfOgTVJ6dqERuPNCRFD nkwe/cNqEtQhXc/2H9YgXEc/5zCJIwelkj8LAxtoy85wrZdQgfxiFQnbeKHxJGArPfIu zqDdpB5hHMehX1Ur8MKrbiLgpRq0kl7VxwqAYF/QX8so6fqTxHRk9Y9MCbvup29ZKvsR /i2LZLHjFa06J9WjCV1TfZfxFPBgh3W5SwsGGypwB6rJVhxE1aXWaOI+P4SmbEesqYJP mJgHztbV+qXqD30Gg94FPtfDxwEf/Pcmrvmr9QdygeYfOUZLbJlwWOEHEkAqL6ApdIW6 EX6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rZ+UT/0DYLpJdWHcgpT9su7amjefBZUCNnN6zoLBwO4=; b=XQoHDeiHqRCNsrBNIJFtWAiu057hYtIzYPmhECUmX6qKUpdon3r0QHRzvpxziGNXRo +XYNvI09FjiFx16MUhNik9UREFZXHO/qJUGZE63T1WHSKsn/qnzoeYSgR6PdQDQW4xvX ZxClv27wXI1btVa1HCynH2WMovuVU8vDeLbdTKF9ahzNqjNICw3RLLCd6zb6qH84qyNL 1ZfbWy71HRtWGoyk0sXJvUIfDeKgtmHfVOgsH7rZVCseXvBDrL2EwwCiQTka9s0jJmUE mYHsCMRT7y0IgAE99BXPekE3PD5jyPlTQVw6g84lkRuUgVPfJgXApYuWAdm7O8svXl8p qWDA== X-Gm-Message-State: AOAM533aHQf3NadwN0GwcILqfmEVKOirVHSjkCfPgKQ+bQTM5mMzXrZU EBFfPxnAtf4NsB/sWpkC/CI3Zopx8MT03w== X-Google-Smtp-Source: ABdhPJxrq/gB+g5WtQNkF+vq9GerPLUREkB99UrEXcmY45OE3zj4lkDdkeOKqiwN9BjIqB/MbdxgLQ== X-Received: by 2002:a05:600c:26d2:: with SMTP id 18mr8800081wmv.41.1615477268247; Thu, 11 Mar 2021 07:41:08 -0800 (PST) Received: from arch-x1c3.. ([2a00:5f00:102:0:b16d:9752:8f38:7d6b]) by smtp.gmail.com with ESMTPSA id a17sm4008547wmj.9.2021.03.11.07.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 07:41:07 -0800 (PST) From: Emil Velikov To: Ezequiel Garcia , Philipp Zabel , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, Nicolas Ferre Cc: emil.l.velikov@gmail.com Subject: [PATCH v2 05/10] media: hantro: introduce hantro_g1.c for common API Date: Thu, 11 Mar 2021 15:40:50 +0000 Message-Id: <20210311154055.3496076-6-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210311154055.3496076-1-emil.l.velikov@gmail.com> References: <20210311154055.3496076-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Emil Velikov The Hantro G1 IRQ and reset handling it pretty standard. I was this close to duplicating it, yet again, before reconsidering and refactoring it to a separate file. Reviewed-by: Philipp Zabel Signed-off-by: Emil Velikov --- drivers/staging/media/hantro/Makefile | 1 + drivers/staging/media/hantro/hantro_g1.c | 39 ++++++++++++++++++++ drivers/staging/media/hantro/hantro_hw.h | 3 ++ drivers/staging/media/hantro/imx8m_vpu_hw.c | 21 +---------- drivers/staging/media/hantro/rk3288_vpu_hw.c | 36 ++---------------- 5 files changed, 48 insertions(+), 52 deletions(-) create mode 100644 drivers/staging/media/hantro/hantro_g1.c diff --git a/drivers/staging/media/hantro/Makefile b/drivers/staging/media/hantro/Makefile index 743ce08eb184..3747a32799b2 100644 --- a/drivers/staging/media/hantro/Makefile +++ b/drivers/staging/media/hantro/Makefile @@ -7,6 +7,7 @@ hantro-vpu-y += \ hantro_v4l2.o \ hantro_postproc.o \ hantro_h1_jpeg_enc.o \ + hantro_g1.o \ hantro_g1_h264_dec.o \ hantro_g1_mpeg2_dec.o \ hantro_g1_vp8_dec.o \ diff --git a/drivers/staging/media/hantro/hantro_g1.c b/drivers/staging/media/hantro/hantro_g1.c new file mode 100644 index 000000000000..0ab1cee62218 --- /dev/null +++ b/drivers/staging/media/hantro/hantro_g1.c @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Hantro VPU codec driver + * + * Copyright (C) 2018 Rockchip Electronics Co., Ltd. + * Jeffy Chen + * Copyright (C) 2019 Pengutronix, Philipp Zabel + * Copyright (C) 2021 Collabora Ltd, Emil Velikov + */ + +#include "hantro.h" +#include "hantro_g1_regs.h" + +irqreturn_t hantro_g1_irq(int irq, void *dev_id) +{ + struct hantro_dev *vpu = dev_id; + enum vb2_buffer_state state; + u32 status; + + status = vdpu_read(vpu, G1_REG_INTERRUPT); + state = (status & G1_REG_INTERRUPT_DEC_RDY_INT) ? + VB2_BUF_STATE_DONE : VB2_BUF_STATE_ERROR; + + vdpu_write(vpu, 0, G1_REG_INTERRUPT); + vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG); + + hantro_irq_done(vpu, state); + + return IRQ_HANDLED; +} + +void hantro_g1_reset(struct hantro_ctx *ctx) +{ + struct hantro_dev *vpu = ctx->dev; + + 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); +} diff --git a/drivers/staging/media/hantro/hantro_hw.h b/drivers/staging/media/hantro/hantro_hw.h index 34c9e4649a25..73c71bb2320c 100644 --- a/drivers/staging/media/hantro/hantro_hw.h +++ b/drivers/staging/media/hantro/hantro_hw.h @@ -164,6 +164,9 @@ void hantro_irq_done(struct hantro_dev *vpu, void hantro_start_prepare_run(struct hantro_ctx *ctx); void hantro_end_prepare_run(struct hantro_ctx *ctx); +irqreturn_t hantro_g1_irq(int irq, void *dev_id); +void hantro_g1_reset(struct hantro_ctx *ctx); + void hantro_h1_jpeg_enc_run(struct hantro_ctx *ctx); void rk3399_vpu_jpeg_enc_run(struct hantro_ctx *ctx); int hantro_jpeg_enc_init(struct hantro_ctx *ctx); diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c index f36c1bd681ba..9eb556460e52 100644 --- a/drivers/staging/media/hantro/imx8m_vpu_hw.c +++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c @@ -9,7 +9,6 @@ #include #include "hantro.h" -#include "hantro_g1_regs.h" #define CTRL_SOFT_RESET 0x00 #define RESET_G1 BIT(1) @@ -129,24 +128,6 @@ static const struct hantro_fmt imx8m_vpu_dec_fmts[] = { }, }; -static irqreturn_t imx8m_vpu_g1_irq(int irq, void *dev_id) -{ - struct hantro_dev *vpu = dev_id; - enum vb2_buffer_state state; - u32 status; - - status = vdpu_read(vpu, G1_REG_INTERRUPT); - state = (status & G1_REG_INTERRUPT_DEC_RDY_INT) ? - VB2_BUF_STATE_DONE : VB2_BUF_STATE_ERROR; - - vdpu_write(vpu, 0, G1_REG_INTERRUPT); - vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG); - - hantro_irq_done(vpu, state); - - return IRQ_HANDLED; -} - static int imx8mq_vpu_hw_init(struct hantro_dev *vpu) { vpu->ctrl_base = vpu->reg_bases[vpu->variant->num_regs - 1]; @@ -191,7 +172,7 @@ static const struct hantro_codec_ops imx8mq_vpu_codec_ops[] = { */ static const struct hantro_irq imx8mq_irqs[] = { - { "g1", imx8m_vpu_g1_irq }, + { "g1", hantro_g1_irq }, { "g2", NULL /* TODO: imx8m_vpu_g2_irq */ }, }; diff --git a/drivers/staging/media/hantro/rk3288_vpu_hw.c b/drivers/staging/media/hantro/rk3288_vpu_hw.c index 7b299ee3e93d..fefd45269e52 100644 --- a/drivers/staging/media/hantro/rk3288_vpu_hw.c +++ b/drivers/staging/media/hantro/rk3288_vpu_hw.c @@ -10,7 +10,6 @@ #include "hantro.h" #include "hantro_jpeg.h" -#include "hantro_g1_regs.h" #include "hantro_h1_regs.h" #define RK3288_ACLK_MAX_FREQ (400 * 1000 * 1000) @@ -127,24 +126,6 @@ static irqreturn_t rk3288_vepu_irq(int irq, void *dev_id) return IRQ_HANDLED; } -static irqreturn_t rk3288_vdpu_irq(int irq, void *dev_id) -{ - struct hantro_dev *vpu = dev_id; - enum vb2_buffer_state state; - u32 status; - - status = vdpu_read(vpu, G1_REG_INTERRUPT); - state = (status & G1_REG_INTERRUPT_DEC_RDY_INT) ? - VB2_BUF_STATE_DONE : VB2_BUF_STATE_ERROR; - - vdpu_write(vpu, 0, G1_REG_INTERRUPT); - vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG); - - hantro_irq_done(vpu, state); - - return IRQ_HANDLED; -} - static int rk3288_vpu_hw_init(struct hantro_dev *vpu) { /* Bump ACLK to max. possible freq. to improve performance. */ @@ -161,15 +142,6 @@ static void rk3288_vpu_enc_reset(struct hantro_ctx *ctx) vepu_write(vpu, 0, H1_REG_AXI_CTRL); } -static void rk3288_vpu_dec_reset(struct hantro_ctx *ctx) -{ - struct hantro_dev *vpu = ctx->dev; - - 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); -} - /* * Supported codec ops. */ @@ -184,19 +156,19 @@ static const struct hantro_codec_ops rk3288_vpu_codec_ops[] = { }, [HANTRO_MODE_H264_DEC] = { .run = hantro_g1_h264_dec_run, - .reset = rk3288_vpu_dec_reset, + .reset = hantro_g1_reset, .init = hantro_h264_dec_init, .exit = hantro_h264_dec_exit, }, [HANTRO_MODE_MPEG2_DEC] = { .run = hantro_g1_mpeg2_dec_run, - .reset = rk3288_vpu_dec_reset, + .reset = hantro_g1_reset, .init = hantro_mpeg2_dec_init, .exit = hantro_mpeg2_dec_exit, }, [HANTRO_MODE_VP8_DEC] = { .run = hantro_g1_vp8_dec_run, - .reset = rk3288_vpu_dec_reset, + .reset = hantro_g1_reset, .init = hantro_vp8_dec_init, .exit = hantro_vp8_dec_exit, }, @@ -208,7 +180,7 @@ static const struct hantro_codec_ops rk3288_vpu_codec_ops[] = { static const struct hantro_irq rk3288_irqs[] = { { "vepu", rk3288_vepu_irq }, - { "vdpu", rk3288_vdpu_irq }, + { "vdpu", hantro_g1_irq }, }; static const char * const rk3288_clk_names[] = { From patchwork Thu Mar 11 15:40:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 399163 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A36A1C43332 for ; Thu, 11 Mar 2021 15:41:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 654976500C for ; Thu, 11 Mar 2021 15:41:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234322AbhCKPl0 (ORCPT ); Thu, 11 Mar 2021 10:41:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234241AbhCKPlK (ORCPT ); Thu, 11 Mar 2021 10:41:10 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F906C061574; Thu, 11 Mar 2021 07:41:10 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id c76-20020a1c9a4f0000b029010c94499aedso13484830wme.0; Thu, 11 Mar 2021 07:41:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JAdbjBxh26QNVrsqvgxFW6fvmPfYqMNJOexCayrJvA0=; b=uuybCdyj+rOshkXU3o4qNqYMwBcqtV3lj/6PDOQyuRHZ48YZTr9k5oCCOqjBU/c6Z1 5xgWkzqgYAfI0mJmUDkpKlv/8V4Kc9VsJ1woX20xOOT7hjIs1booPCi8Ub1ksYQm7QB3 kZft9+79hFe7g0xMDEUKgek+9VHc4l8x26FL0di3BcAbsWrHFL/KdwCj1LgtFrtr5O4e 0uf7pLSUfedXmF/eifRJB4qEp2aibPOLJ/RMf/KVP2vicuUcny04om5qBWOqitXPbLJ+ VoIK8gg1NdeLdN7QlvXAiczLFqkNbx75NNwDszOJdOfBXYm3IOW6EfdDJm/n4tDVjMOG tu2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JAdbjBxh26QNVrsqvgxFW6fvmPfYqMNJOexCayrJvA0=; b=a3TuqWjWhIr9eWNK5nG7bpSBmV3Jt4BAGnV80UgIb/XNWG/IP7D+tP5o6YWbdguCxT T9L9YewhKei1V0Os4eD6efXYfPsWKOR0LXXVXrWER0ovdRpkiGFhkINkS8AK2VShRSbe ngRd5hs3pI1wOQFBwgKuAyldl9pcU8rWJxGr0n94D9JjCg5BxZzUv7AQCruifPx8vx5F sXkzOLuuYZnp3l60vDUgWY67rD4mhVwS3wwLibqZeWcs9wgbCP1qwdeF7N+FKfGC2ew2 Xue3geP3sPNDDgkQcScjtXT0IR69tS2NTh2bbRwSDnJWe52msn+EAtUrCdCsahabc+Wj F+JQ== X-Gm-Message-State: AOAM530l8OfEckXBGvbzNRmypkDzHhndezTYuK8lZEAkdJlictjL8EP3 Nh1lAluktdz9+Pl7c7f+rzM= X-Google-Smtp-Source: ABdhPJx5nbz+p6EpPXuNactxgx8F8NdBvmhgFLIsXilxrXXL05ZdvxkShyrzRVGKm1nAUScJBhLF2Q== X-Received: by 2002:a1c:6605:: with SMTP id a5mr9029615wmc.85.1615477269074; Thu, 11 Mar 2021 07:41:09 -0800 (PST) Received: from arch-x1c3.. ([2a00:5f00:102:0:b16d:9752:8f38:7d6b]) by smtp.gmail.com with ESMTPSA id a17sm4008547wmj.9.2021.03.11.07.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 07:41:08 -0800 (PST) From: Emil Velikov To: Ezequiel Garcia , Philipp Zabel , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, Nicolas Ferre Cc: emil.l.velikov@gmail.com, Rob Herring , Frank Rowand , devicetree@vger.kernel.org Subject: [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings Date: Thu, 11 Mar 2021 15:40:51 +0000 Message-Id: <20210311154055.3496076-7-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210311154055.3496076-1-emil.l.velikov@gmail.com> References: <20210311154055.3496076-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Emil Velikov Add devicetree binding documentation for the Hantro G1/G2 VDEC on the Microchip SAMAS5D4 SoC. Cc: Rob Herring Cc: Frank Rowand Cc: devicetree@vger.kernel.org> Signed-off-by: Emil Velikov --- v2 - Newly introduced - s/Atmel/Microchip/ (Nicolas) - Drop leading 0 in node name/address --- .../media/microchip,sama5d4-vdec.yaml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml diff --git a/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml new file mode 100644 index 000000000000..9cb2c0295d54 --- /dev/null +++ b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml @@ -0,0 +1,59 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) + +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs + +maintainers: + - Emil Velikov + +description: + Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs. + +properties: + compatible: + const: microchip,sama5d4-vdec + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + interrupt-names: + items: + - const: vdec + + clocks: + maxItems: 1 + + clock-names: + items: + - const: vdec_clk + +required: + - compatible + - reg + - interrupts + - interrupt-names + - clocks + - clock-names + +additionalProperties: false + +examples: + - | + #include + #include + + vdec0: vdec@300000 { + compatible = "microchip,sama5d4-vdec"; + reg = <0x00300000 0x100000>; + interrupts = <19 IRQ_TYPE_LEVEL_HIGH 4>; + interrupt-names = "vdec"; + clocks = <&pmc PMC_TYPE_PERIPHERAL 19>; + clock-names = "vdec_clk"; + }; From patchwork Thu Mar 11 15:40:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 399161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C48FEC43603 for ; Thu, 11 Mar 2021 15:41:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96F1564FE0 for ; Thu, 11 Mar 2021 15:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234331AbhCKPl3 (ORCPT ); Thu, 11 Mar 2021 10:41:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234245AbhCKPlL (ORCPT ); Thu, 11 Mar 2021 10:41:11 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 409BDC061760; Thu, 11 Mar 2021 07:41:11 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id d139-20020a1c1d910000b029010b895cb6f2so13062973wmd.5; Thu, 11 Mar 2021 07:41:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xAXG6ZA5Y2HE3m+oHpL1iaPFBMdmoorVW3rcbcNGpAc=; b=QI2RhaXaXoLThUOBvp6jXj/Nqah5umuf6W4X4J5HIGNNTPn3Jz5i8eHtW0EMAxfH53 T57rt98KDm9PM0+OdlQNwRwH0Wh18SxdReu+RmJga1uJX0yZ6e4RJtLDVS5G8xrrOZXp LtboAqLpz1BRq4cC27OWQsdb+DnkSGk2wdoOdlJilybsY9Mxg2B2JXZGxcYmkghyaDQp xfLL5jWptdc6IKvRQjXMTHDY9sx+RuyclOrp/tZ1V5JtibQY7B7Im1x94JvHjGHQnmpH T/bNxOI8haKo1qXu2OODdiA6AcG/+F8LdZf0hKvbkngUW0J0eBPA38mOB/XQpncFZQ/1 d1Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xAXG6ZA5Y2HE3m+oHpL1iaPFBMdmoorVW3rcbcNGpAc=; b=Eq4nlQR1XmeHiIowNAMmXVvaiGMZTM5aXaptHSKv7zW96tWIan51HnshpISAyIL8cp BB7XV/Eq90MvlZt91VRtYpOO8mHPo5h0HKSWKK7UWpgBtMmCCLDiotEkONgo0egIU0CE 9hX5oDaPfeXAeN68kWkzWexqnSnYTY2/U9pG8uchV4a21z5LDux7ZbyiE480D1Nor2gz NcASqTH2FgZJyZmQ/bIBwVjBOF4QWTvgeLewxNUHq+42jibLOuU1vQQHdx3VaHwNb305 r8Ko7H/8IdhlriO+AvWwO1xIUam4RwlylsnipMCXdXkiuiY2eFmMJH+Rzsc+fw1MvCGF wT1A== X-Gm-Message-State: AOAM533cIGeWocvF8Ae47FbZ/fD28m1BzUMcV0iyvXjIi/XHDikJ8MRO x4UHuIgj3799DjCqdN3IiCw= X-Google-Smtp-Source: ABdhPJwuz3nP2YREPz0nQBizO+XbjVBcsDxYKqYIiux+SwS/8io3xaehqemQUS9UUA6hAuNztk8KKQ== X-Received: by 2002:a7b:c34a:: with SMTP id l10mr8824624wmj.46.1615477269969; Thu, 11 Mar 2021 07:41:09 -0800 (PST) Received: from arch-x1c3.. ([2a00:5f00:102:0:b16d:9752:8f38:7d6b]) by smtp.gmail.com with ESMTPSA id a17sm4008547wmj.9.2021.03.11.07.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 07:41:09 -0800 (PST) From: Emil Velikov To: Ezequiel Garcia , Philipp Zabel , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, Nicolas Ferre Cc: emil.l.velikov@gmail.com, Rob Herring , Frank Rowand , devicetree@vger.kernel.org Subject: [PATCH v2 07/10] media: hantro: add initial SAMA5D4 support Date: Thu, 11 Mar 2021 15:40:52 +0000 Message-Id: <20210311154055.3496076-8-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210311154055.3496076-1-emil.l.velikov@gmail.com> References: <20210311154055.3496076-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Emil Velikov The SoC features a Hantro G1 compatible video decoder, supporting the MPEG-2, VP8 and H264 codecs with resolutions up-to 1280x720. Post-processing core is also available on the SoC. Cc: Rob Herring Cc: Frank Rowand Cc: devicetree@vger.kernel.org> Signed-off-by: Emil Velikov --- v2 - Split DT and defconfig changes to separate patches (Eze) - s/Atmel/Microchip/ (Nicolas) --- drivers/staging/media/hantro/Kconfig | 10 +- drivers/staging/media/hantro/Makefile | 3 + drivers/staging/media/hantro/hantro_drv.c | 3 + drivers/staging/media/hantro/hantro_hw.h | 1 + .../staging/media/hantro/sama5d4_vdec_hw.c | 117 ++++++++++++++++++ 5 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 drivers/staging/media/hantro/sama5d4_vdec_hw.c diff --git a/drivers/staging/media/hantro/Kconfig b/drivers/staging/media/hantro/Kconfig index 5b6cf9f62b1a..20b1f6d7b69c 100644 --- a/drivers/staging/media/hantro/Kconfig +++ b/drivers/staging/media/hantro/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 config VIDEO_HANTRO tristate "Hantro VPU driver" - depends on ARCH_MXC || ARCH_ROCKCHIP || COMPILE_TEST + depends on ARCH_MXC || ARCH_ROCKCHIP || ARCH_AT91 || COMPILE_TEST depends on VIDEO_DEV && VIDEO_V4L2 select MEDIA_CONTROLLER select MEDIA_CONTROLLER_REQUEST_API @@ -24,6 +24,14 @@ config VIDEO_HANTRO_IMX8M help Enable support for i.MX8M SoCs. +config VIDEO_HANTRO_SAMA5D4 + bool "Hantro VDEC SAMA5D4 support" + depends on VIDEO_HANTRO + depends on ARCH_AT91 || COMPILE_TEST + default y + help + Enable support for Microchip SAMA5D4 SoCs. + config VIDEO_HANTRO_ROCKCHIP bool "Hantro VPU Rockchip support" depends on VIDEO_HANTRO diff --git a/drivers/staging/media/hantro/Makefile b/drivers/staging/media/hantro/Makefile index 3747a32799b2..f4b99901eeee 100644 --- a/drivers/staging/media/hantro/Makefile +++ b/drivers/staging/media/hantro/Makefile @@ -22,6 +22,9 @@ hantro-vpu-y += \ hantro-vpu-$(CONFIG_VIDEO_HANTRO_IMX8M) += \ imx8m_vpu_hw.o +hantro-vpu-$(CONFIG_VIDEO_HANTRO_SAMA5D4) += \ + sama5d4_vdec_hw.o + hantro-vpu-$(CONFIG_VIDEO_HANTRO_ROCKCHIP) += \ rk3288_vpu_hw.o \ rk3399_vpu_hw.o diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c index e5f200e64993..a530c0eda595 100644 --- a/drivers/staging/media/hantro/hantro_drv.c +++ b/drivers/staging/media/hantro/hantro_drv.c @@ -478,6 +478,9 @@ static const struct of_device_id of_hantro_match[] = { #endif #ifdef CONFIG_VIDEO_HANTRO_IMX8M { .compatible = "nxp,imx8mq-vpu", .data = &imx8mq_vpu_variant, }, +#endif +#ifdef CONFIG_VIDEO_HANTRO_SAMA5D4 + { .compatible = "microchip,sama5d4-vdec", .data = &sama5d4_vdec_variant, }, #endif { /* sentinel */ } }; diff --git a/drivers/staging/media/hantro/hantro_hw.h b/drivers/staging/media/hantro/hantro_hw.h index 73c71bb2320c..4d39da1d1581 100644 --- a/drivers/staging/media/hantro/hantro_hw.h +++ b/drivers/staging/media/hantro/hantro_hw.h @@ -152,6 +152,7 @@ extern const struct hantro_variant rk3399_vpu_variant; extern const struct hantro_variant rk3328_vpu_variant; extern const struct hantro_variant rk3288_vpu_variant; extern const struct hantro_variant imx8mq_vpu_variant; +extern const struct hantro_variant sama5d4_vdec_variant; extern const struct hantro_postproc_regs hantro_g1_postproc_regs; diff --git a/drivers/staging/media/hantro/sama5d4_vdec_hw.c b/drivers/staging/media/hantro/sama5d4_vdec_hw.c new file mode 100644 index 000000000000..58ae72c2b723 --- /dev/null +++ b/drivers/staging/media/hantro/sama5d4_vdec_hw.c @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Hantro VDEC driver + * + * Copyright (C) 2021 Collabora Ltd, Emil Velikov + */ + +#include "hantro.h" + +/* + * Supported formats. + */ + +static const struct hantro_fmt sama5d4_vdec_postproc_fmts[] = { + { + .fourcc = V4L2_PIX_FMT_YUYV, + .codec_mode = HANTRO_MODE_NONE, + }, +}; + +static const struct hantro_fmt sama5d4_vdec_fmts[] = { + { + .fourcc = V4L2_PIX_FMT_NV12, + .codec_mode = HANTRO_MODE_NONE, + }, + { + .fourcc = V4L2_PIX_FMT_MPEG2_SLICE, + .codec_mode = HANTRO_MODE_MPEG2_DEC, + .max_depth = 2, + .frmsize = { + .min_width = 48, + .max_width = 1280, + .step_width = MB_DIM, + .min_height = 48, + .max_height = 720, + .step_height = MB_DIM, + }, + }, + { + .fourcc = V4L2_PIX_FMT_VP8_FRAME, + .codec_mode = HANTRO_MODE_VP8_DEC, + .max_depth = 2, + .frmsize = { + .min_width = 48, + .max_width = 1280, + .step_width = MB_DIM, + .min_height = 48, + .max_height = 720, + .step_height = MB_DIM, + }, + }, + { + .fourcc = V4L2_PIX_FMT_H264_SLICE, + .codec_mode = HANTRO_MODE_H264_DEC, + .max_depth = 2, + .frmsize = { + .min_width = 48, + .max_width = 1280, + .step_width = MB_DIM, + .min_height = 48, + .max_height = 720, + .step_height = MB_DIM, + }, + }, +}; + +static int sama5d4_hw_init(struct hantro_dev *vpu) +{ + return 0; +} + +/* + * Supported codec ops. + */ + +static const struct hantro_codec_ops sama5d4_vdec_codec_ops[] = { + [HANTRO_MODE_MPEG2_DEC] = { + .run = hantro_g1_mpeg2_dec_run, + .reset = hantro_g1_reset, + .init = hantro_mpeg2_dec_init, + .exit = hantro_mpeg2_dec_exit, + }, + [HANTRO_MODE_VP8_DEC] = { + .run = hantro_g1_vp8_dec_run, + .reset = hantro_g1_reset, + .init = hantro_vp8_dec_init, + .exit = hantro_vp8_dec_exit, + }, + [HANTRO_MODE_H264_DEC] = { + .run = hantro_g1_h264_dec_run, + .reset = hantro_g1_reset, + .init = hantro_h264_dec_init, + .exit = hantro_h264_dec_exit, + }, +}; + +static const struct hantro_irq sama5d4_irqs[] = { + { "vdec", hantro_g1_irq }, +}; + +static const char * const sama5d4_clk_names[] = { "vdec_clk" }; + +const struct hantro_variant sama5d4_vdec_variant = { + .dec_fmts = sama5d4_vdec_fmts, + .num_dec_fmts = ARRAY_SIZE(sama5d4_vdec_fmts), + .postproc_fmts = sama5d4_vdec_postproc_fmts, + .num_postproc_fmts = ARRAY_SIZE(sama5d4_vdec_postproc_fmts), + .postproc_regs = &hantro_g1_postproc_regs, + .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER | + HANTRO_H264_DECODER, + .codec_ops = sama5d4_vdec_codec_ops, + .init = sama5d4_hw_init, + .irqs = sama5d4_irqs, + .num_irqs = ARRAY_SIZE(sama5d4_irqs), + .clk_names = sama5d4_clk_names, + .num_clocks = ARRAY_SIZE(sama5d4_clk_names), +}; From patchwork Thu Mar 11 15:40:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 397961 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C31DC43619 for ; Thu, 11 Mar 2021 15:41:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD80564FDE for ; Thu, 11 Mar 2021 15:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234339AbhCKPl3 (ORCPT ); Thu, 11 Mar 2021 10:41:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234246AbhCKPlM (ORCPT ); Thu, 11 Mar 2021 10:41:12 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09F0BC061574; Thu, 11 Mar 2021 07:41:12 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id l11so2386712wrp.7; Thu, 11 Mar 2021 07:41:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2LSJdNzI10Uzadt8Nfbff+p/pjnmY6eCoDYVHbZS0BI=; b=jk4TUDGTRQb0WrtAIBIrDEGB+N+EHoOx/CWb1rrpdeCt9/+QQflENTvHgSGb4cCidG 45D5yr7yxWIDSvPnNksRdGovpxpIpXyzJBazRLXF9y0xZBdLdYWYTNOP/ER07fgNJl4z a70DcFB+R6uwCyEMM6QDo4iXZ348n63WaDmx2A9ZwutNi1ScGXomGHen+GJSEJv836jC WzzjuiM2UL2ZbxW9ZIOw275PCQsofz5BKkcW15plxb9F3mNi6jXYruO34wM47Am8VJMZ pC86kmi/7jj0Thw76590R6mByJ1KSwR+nwqCHtbQO9tRS1KYQGq1jzlHl/kDn7vbLusw qKHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2LSJdNzI10Uzadt8Nfbff+p/pjnmY6eCoDYVHbZS0BI=; b=fREJO2kEj2h3THTU0KtOAQG8+Zt7ovvOAOV7HaGj22z21QFo3SaLeUl3WItVc72IJj lB1EMI6Mfz3qPpzJoC5uigxEQ3jHc+XSnIgvlCuOsCw4O+YTDVtiVg0exlCYN+boraTZ 6wXoqYdqgMkbRswBaEFZ0TAC6R9+Je+pnVMBLX9KqNPa2rgqrTynatrh0ZphuD2URY04 99bvj7WXXwiI5nT9/iiYkfTMh8OSVwBqEa5pg32EWfk7YcT/XAWQmFtoIYBhewT+slml oMnSY5ERoePmK6dtbnPTKkpe1jGEr/PRDzr1Y7CWgqN6ZVn/fJAZW0iHr1yE07Vy59yM s/Lg== X-Gm-Message-State: AOAM532M1xnq4N+aV4UsbgIqqhpYEfF+MrTNNdYohCde0gP69Zh4z9mM y32eCzRsFa/JhFsEIgJRJ64= X-Google-Smtp-Source: ABdhPJx85w5D5mT/Nq0DQGWDwzHjyIlxwrp8M2xgn2lGZFx7xp6QayXKc3+tZBKXpfRtukgCNlNfrQ== X-Received: by 2002:a5d:4445:: with SMTP id x5mr9570311wrr.30.1615477270720; Thu, 11 Mar 2021 07:41:10 -0800 (PST) Received: from arch-x1c3.. ([2a00:5f00:102:0:b16d:9752:8f38:7d6b]) by smtp.gmail.com with ESMTPSA id a17sm4008547wmj.9.2021.03.11.07.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 07:41:10 -0800 (PST) From: Emil Velikov To: Ezequiel Garcia , Philipp Zabel , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, Nicolas Ferre Cc: emil.l.velikov@gmail.com, devicetree@vger.kernel.org Subject: [PATCH v2 08/10] ARM: dts: sama5d4: enable Hantro G1 VDEC Date: Thu, 11 Mar 2021 15:40:53 +0000 Message-Id: <20210311154055.3496076-9-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210311154055.3496076-1-emil.l.velikov@gmail.com> References: <20210311154055.3496076-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Emil Velikov Add the SAMA5D4 VDEC module which comprises Hantro G1 video decoder core. Cc: Rob Herring --- v2 - Split out of larger patch (Eze) - s/Atmel/Microchip/ (Nicolas) - Drop leading 0 in node name/address --- arch/arm/boot/dts/sama5d4.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/boot/dts/sama5d4.dtsi b/arch/arm/boot/dts/sama5d4.dtsi index 05c55875835d..88284f60feb1 100644 --- a/arch/arm/boot/dts/sama5d4.dtsi +++ b/arch/arm/boot/dts/sama5d4.dtsi @@ -101,6 +101,15 @@ nfc_sram: sram@100000 { ranges = <0 0x100000 0x2400>; }; + vdec0: vdec@300000 { + compatible = "microchip,sama5d4-vdec"; + reg = <0x00300000 0x100000>; + interrupts = <19 IRQ_TYPE_LEVEL_HIGH 4>; + interrupt-names = "vdec"; + clocks = <&pmc PMC_TYPE_PERIPHERAL 19>; + clock-names = "vdec_clk"; + }; + usb0: gadget@400000 { compatible = "atmel,sama5d3-udc"; reg = <0x00400000 0x100000 From patchwork Thu Mar 11 15:40:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 399162 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, UPPERCASE_50_75, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51CA2C4361A for ; Thu, 11 Mar 2021 15:41:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04ADD64FEF for ; Thu, 11 Mar 2021 15:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234342AbhCKPla (ORCPT ); Thu, 11 Mar 2021 10:41:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234248AbhCKPlN (ORCPT ); Thu, 11 Mar 2021 10:41:13 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDA6DC061574 for ; Thu, 11 Mar 2021 07:41:12 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id v15so2394658wrx.4 for ; Thu, 11 Mar 2021 07:41:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3vDMN3dUIFWvZiCPoMmxvm3WWN6G8eQyiB18ua9S658=; b=YoZPNNpj+9Rrh+2g/y5CqinTkt7wlHWlptnD/O/kDrkKoZrwlq4caljUwegN4ifDii ieEDviQyS7BEkyCKf9+TVY1PgTDkq6K4DyYFIuSbl92xqj1FD/3On8RnOoDwqoc8pJCT DmyOcdR82yWPSanXKnGCzRgE1ZQjDqgdJFzT+2fg714WSZnsccLTFUwuyMia3Du8yiaA 3MkF+aNCKCvIx2pJnGo0xD6Cylpxfnv5idar3LCyip2dq8ykzXgCJP8imHZwmzy4Tr/J nJn00MUBWiGNmx5H4G+TbUVC7OLJkndphZ5QyKBJqszvEZA1E5cYMFhbix4AMVVWpwrQ EZmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3vDMN3dUIFWvZiCPoMmxvm3WWN6G8eQyiB18ua9S658=; b=dDceSyPa9eXHLTxN380oxgc1GkI75GIDiTCKsviCVT7Wb74MXxbBmy5BsfX7Tyl36A oWve3E1UKyB9xBQkx1XDH8V85ujW9tbe2nb1romsMkajm7xwsSbiDaRDKy6+odSwoutM lG+kKXmCxqHfYYktueU97VKPDWMaiYbbAjMh4JRSGJsqhRqML6HqKgA6lAJyFg+VkAj0 DG7TW05U8pizCQxUOpewfHrqv1npGHH454ohgy3MfGcNGU8v9P64ywR9EjcP+HM4N9ma 7Q9aNRw1a7lDxujtdLYr7Ys0JMYtfs5/iR3PS4ZaSjKGqakZtsJlLYYm4GitEcL1k9PC AZRg== X-Gm-Message-State: AOAM532AE20Sa86PUuxGC4YKnrfWJHbgT1eDOYS4ZOfPOkU9GAp5Qi97 95tMHjHePTmsnjQO9pisrBg= X-Google-Smtp-Source: ABdhPJz5M0aZLrhuiW8AWBhDO2S0qjhxoZST9+8sGd43VrPXQ65ZsfzapkIfK9oXkbB9QUGDiqlouw== X-Received: by 2002:a5d:68cd:: with SMTP id p13mr9776682wrw.247.1615477271641; Thu, 11 Mar 2021 07:41:11 -0800 (PST) Received: from arch-x1c3.. ([2a00:5f00:102:0:b16d:9752:8f38:7d6b]) by smtp.gmail.com with ESMTPSA id a17sm4008547wmj.9.2021.03.11.07.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 07:41:11 -0800 (PST) From: Emil Velikov To: Ezequiel Garcia , Philipp Zabel , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, Nicolas Ferre Cc: emil.l.velikov@gmail.com, Alexandre Belloni , Ludovic Desroches , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 09/10] ARM: configs: at91: sama5: update with savedefconfig Date: Thu, 11 Mar 2021 15:40:54 +0000 Message-Id: <20210311154055.3496076-10-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210311154055.3496076-1-emil.l.velikov@gmail.com> References: <20210311154055.3496076-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Emil Velikov While enabling an extra config, I've noticed that savedefconfig produced a notable delta. Split out the no-op changes for clarity sake. Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Ludovic Desroches Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Emil Velikov --- arch/arm/configs/sama5_defconfig | 37 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig index f4c3c0652432..a5f274e39753 100644 --- a/arch/arm/configs/sama5_defconfig +++ b/arch/arm/configs/sama5_defconfig @@ -8,11 +8,6 @@ CONFIG_CGROUPS=y CONFIG_BLK_DEV_INITRD=y CONFIG_EMBEDDED=y CONFIG_SLAB=y -CONFIG_MODULES=y -CONFIG_MODULE_FORCE_LOAD=y -CONFIG_MODULE_UNLOAD=y -CONFIG_MODULE_FORCE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set CONFIG_ARCH_AT91=y CONFIG_SOC_SAMA5D2=y CONFIG_SOC_SAMA5D3=y @@ -25,9 +20,14 @@ CONFIG_KEXEC=y CONFIG_VFP=y CONFIG_NEON=y CONFIG_KERNEL_MODE_NEON=y -# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set CONFIG_PM_DEBUG=y CONFIG_PM_ADVANCED_DEBUG=y +CONFIG_MODULES=y +CONFIG_MODULE_FORCE_LOAD=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set CONFIG_NET=y CONFIG_PACKET=y CONFIG_UNIX=y @@ -75,8 +75,8 @@ CONFIG_BLK_DEV_SD=y CONFIG_NETDEVICES=y CONFIG_NET_DSA_MICROCHIP_KSZ9477=m CONFIG_NET_DSA_MICROCHIP_KSZ9477_SPI=m -CONFIG_MACB=y # CONFIG_NET_VENDOR_BROADCOM is not set +CONFIG_MACB=y # CONFIG_NET_VENDOR_CIRRUS is not set # CONFIG_NET_VENDOR_FARADAY is not set # CONFIG_NET_VENDOR_INTEL is not set @@ -91,7 +91,9 @@ CONFIG_MACB=y CONFIG_MICREL_PHY=y CONFIG_LIBERTAS_THINFIRM=m CONFIG_LIBERTAS_THINFIRM_USB=m -CONFIG_RTL8187=m +CONFIG_MWIFIEX=m +CONFIG_MWIFIEX_SDIO=m +CONFIG_MWIFIEX_USB=m CONFIG_RT2X00=m CONFIG_RT2500USB=m CONFIG_RT73USB=m @@ -99,10 +101,7 @@ CONFIG_RT2800USB=m CONFIG_RT2800USB_RT53XX=y CONFIG_RT2800USB_RT55XX=y CONFIG_RT2800USB_UNKNOWN=y -CONFIG_MWIFIEX=m -CONFIG_MWIFIEX_SDIO=m -CONFIG_MWIFIEX_USB=m -# CONFIG_INPUT_MOUSEDEV is not set +CONFIG_RTL8187=m CONFIG_INPUT_EVDEV=y # CONFIG_KEYBOARD_ATKBD is not set CONFIG_KEYBOARD_QT1070=y @@ -125,9 +124,9 @@ CONFIG_SPI_ATMEL_QUADSPI=y CONFIG_SPI_GPIO=y CONFIG_GPIO_SYSFS=y CONFIG_GPIO_SAMA5D2_PIOBU=m +CONFIG_POWER_RESET=y CONFIG_POWER_SUPPLY=y CONFIG_BATTERY_ACT8945A=y -CONFIG_POWER_RESET=y CONFIG_SENSORS_JC42=m CONFIG_WATCHDOG=y CONFIG_AT91SAM9X_WATCHDOG=y @@ -166,11 +165,11 @@ CONFIG_SND=y CONFIG_SND_SOC=y CONFIG_SND_ATMEL_SOC=y CONFIG_SND_ATMEL_SOC_WM8904=y -# CONFIG_HID_GENERIC is not set CONFIG_SND_ATMEL_SOC_CLASSD=y CONFIG_SND_ATMEL_SOC_PDMIC=y CONFIG_SND_ATMEL_SOC_TSE850_PCM5142=m CONFIG_SND_ATMEL_SOC_I2S=y +# CONFIG_HID_GENERIC is not set CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_EHCI_HCD=y @@ -224,14 +223,14 @@ CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_850=y CONFIG_NLS_ISO8859_1=y CONFIG_NLS_UTF8=y +CONFIG_CRYPTO_USER_API_HASH=m +CONFIG_CRYPTO_USER_API_SKCIPHER=m +CONFIG_CRYPTO_DEV_ATMEL_AES=y +CONFIG_CRYPTO_DEV_ATMEL_TDES=y +CONFIG_CRYPTO_DEV_ATMEL_SHA=y CONFIG_STRIP_ASM_SYMS=y CONFIG_DEBUG_FS=y CONFIG_DEBUG_MEMORY_INIT=y # CONFIG_SCHED_DEBUG is not set # CONFIG_FTRACE is not set CONFIG_DEBUG_USER=y -CONFIG_CRYPTO_USER_API_HASH=m -CONFIG_CRYPTO_USER_API_SKCIPHER=m -CONFIG_CRYPTO_DEV_ATMEL_AES=y -CONFIG_CRYPTO_DEV_ATMEL_TDES=y -CONFIG_CRYPTO_DEV_ATMEL_SHA=y From patchwork Thu Mar 11 15:40:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 399160 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 882BBC4360C for ; Thu, 11 Mar 2021 15:41:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5C3FA64FFD for ; Thu, 11 Mar 2021 15:41:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234122AbhCKPlb (ORCPT ); Thu, 11 Mar 2021 10:41:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234249AbhCKPlO (ORCPT ); Thu, 11 Mar 2021 10:41:14 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE385C061760 for ; Thu, 11 Mar 2021 07:41:13 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id d139-20020a1c1d910000b029010b895cb6f2so13063045wmd.5 for ; Thu, 11 Mar 2021 07:41:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MLfi50uYgnTaoRAwVdM8rA06MiTyx2y/gOOhlp7gAUM=; b=mElIjjBS5Gwjfkc14YbmdXNf9qs87wJ08dzZObe5fEyfu0me0PGjGxeJriDc/LxJAx aZhvoX4Jjzk+ElUgr3rZR4iEMxYhbjK77G5WaPa3j6ekfFBXflFj2uPVj8HZeePjtfGt cV+5Qh00VDY9mhPo4zY+/c/rigmRJgH2ZW2N9yL5+BCaSlBtYqBTMNz47ZKG6TDGSJRj u2gYxNoAfgI4LUNmsfDqa/OAlCSgk1yN2l7DbEK756jaRk3TXOGiGbjVDBXaxTRlhvE9 wIoJOF9SXRQk+Wc9uTryeQKg18VW3UyfNKQxrI62YKBgeu2PFOCgodCjnnSN/DpKEWHW GkVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MLfi50uYgnTaoRAwVdM8rA06MiTyx2y/gOOhlp7gAUM=; b=mQtWxccfYbKhnDtUgk5MxbpNmKOsSrNmH+Q5OW2L5J/JxsoMOudKcqntMcHzVWSGcD SN1035BiDW7m0eZkSPC/Ytvj/gN5ImZlDPnqIjdZCPIHHQ1l7cRkwul4/PVquvoAOtwT xUw8RIk/C78b3vQgW3+A6dT2n8JF6M4Zb7HLvNmTgAcxHeYMP8EZy1EV4btHTRPGIubi SWVfaUchpspwA8xeQQJkMIelpZngxZIO8vJk2yMivkECwF5TGjx81P5Cb/hqV6KeuC7t lXlPGq0eLM6A3glfdFvh155A8TXmj2yOh8M+Bon15BaDQSWUFVyQFkcsgCFpF0QOwdzf w0oQ== X-Gm-Message-State: AOAM533JYBNgeH284dYuPdSAcaq+V2hWsQSjwswVcyOmY6lkYi9BtM+w FUaQl7zsMJGcyxDkC4XQjbM= X-Google-Smtp-Source: ABdhPJylGQtM/x2x9fB8CpajlovzBFYcjziolbH7jjBKfsNn5FDHoIgzRKDtgrT22KZ4yv/3YPHtag== X-Received: by 2002:a1c:5f89:: with SMTP id t131mr8527466wmb.173.1615477272567; Thu, 11 Mar 2021 07:41:12 -0800 (PST) Received: from arch-x1c3.. ([2a00:5f00:102:0:b16d:9752:8f38:7d6b]) by smtp.gmail.com with ESMTPSA id a17sm4008547wmj.9.2021.03.11.07.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 07:41:12 -0800 (PST) From: Emil Velikov To: Ezequiel Garcia , Philipp Zabel , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, Nicolas Ferre Cc: emil.l.velikov@gmail.com, Alexandre Belloni , Ludovic Desroches , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 10/10] ARM: configs: at91: sama5: enable the Hantro G1 engine Date: Thu, 11 Mar 2021 15:40:55 +0000 Message-Id: <20210311154055.3496076-11-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210311154055.3496076-1-emil.l.velikov@gmail.com> References: <20210311154055.3496076-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Emil Velikov The SoC features a Hantro G1 compatible engine. Enable it by default, so people can make use of it. Keep it a module, as suggested by Nicolas Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Ludovic Desroches Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Emil Velikov --- v2 - Split out of larger patch (Eze) - Build it as module (Nicolas) --- arch/arm/configs/sama5_defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig index a5f274e39753..5bcf16aecf2f 100644 --- a/arch/arm/configs/sama5_defconfig +++ b/arch/arm/configs/sama5_defconfig @@ -200,6 +200,9 @@ CONFIG_RTC_DRV_AT91RM9200=y CONFIG_DMADEVICES=y CONFIG_AT_HDMAC=y CONFIG_AT_XDMAC=y +CONFIG_STAGING=y +CONFIG_STAGING_MEDIA=y +CONFIG_VIDEO_HANTRO=m # CONFIG_IOMMU_SUPPORT is not set CONFIG_IIO=y CONFIG_AT91_ADC=y