From patchwork Thu Nov 21 10:14:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11256039 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C19E14DB for ; Thu, 21 Nov 2019 10:15:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B5E99206CB for ; Thu, 21 Nov 2019 10:15:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nf+w4nWX"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="gYhCPNg9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5E99206CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YHNnKLWuMljbXVsxPiwMFrJ4kEjRIwn88LWDjUbqujA=; b=nf+w4nWXPqETUN JcmwN/vmNIKSr5mhyWLOf2NTXI1E3FOIYcnGsE+VaUSltLFqbVIgonqwCLPv4fT6SKZTe/Raz6s0x lLAZo9praEpz6EDI6U4QUDOYKiAQ87AcsgXNGQNbMHARFhCKCfnbNwTQj/Ixszdv03NvxQ9i/TgE1 ehR+OdevmeZoqFMGuFq2PCujVQ84C6X1clKx8VxjdooveGiDxa6ucPdITzLgpEdA4P5Rn98dviEZa 2XQVf9e5vinuy1fVxeQnXlv+c2ovziDegz6HVLEcmKMACXLsXA0dXF0CA6zbpfamu5UOUvVk9uEbU w3B1CUD8I83+pzjqF2HQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXjUn-0004rS-O2; Thu, 21 Nov 2019 10:15:29 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXjTx-00040g-0W for linux-arm-kernel@lists.infradead.org; Thu, 21 Nov 2019 10:14:42 +0000 Received: by mail-wm1-x341.google.com with SMTP id l1so3052083wme.2 for ; Thu, 21 Nov 2019 02:14:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FduBAwwMEHW84QfHh6b1tdX58pVww+y/7cRWB+UMkbY=; b=gYhCPNg9B4NLAQ6K7VLo0nzzDQaInJM7Hf864FAuXqZfI2Jc1yLh9PMQiTaLmNB+mV EqT7xwT8uNA1ntizSXNTpAnY/17baf4nfFyRH1jHSYu4nNpsy0nZ/rWyrX4HbdwvXqLM sH6VOkZNct+q1ZT2V5TDE1zLeVuuGlrzP3CCifoDSNgCrhVNyHOgs4w9VaL6jdFATevZ BkYePMw7gyVJ62maxFfsNFBQiRdxH5VZGKPaAqU527vISy8VTa1HYfES4DwNdbGutEe1 /QMpVdOXWkV0U48snGckdcUmiuUye7GRqbqyM+Nq4K1NBdj2P9nb6OBH46AZ3hvYi4PR en9A== 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=FduBAwwMEHW84QfHh6b1tdX58pVww+y/7cRWB+UMkbY=; b=d8o/qjCNX1HuqdevdHygnWGmWl2UfrivKIWibh+BtQ2mWHLJc/kYCZMOxCpwbrOujK 1bAKYahKxvDOxohpQsWt/HhQ1rw/YHbGiLoltK8vz6W+viF+Db9h+MGC2y9kqvGT91tr uU1LfiqkfIz1TlAI17LsxKbRQnsK+RQ7kp104pzpfsxZ9IlPOB5VpJfF31IJoISJLCPv Bo4nFVKmyVE70WxtzBX8WzBrAcfNPtWupaeRMbggbfkPMhYQ3pH8/D566mSl8Li1LyoN rPQhsWKHo+SIzQklAh54i1IwjcjfXIk6Atqz0Kw7aQHt+bTytnYgOHfutkEHGyEi6grD k/7w== X-Gm-Message-State: APjAAAWGBZrwoGCfkiS1bThbtQLCxMF6RtMhiQfJOw3rxHqtApZGeOu1 bcKw508zvxxGa7qYM7wxJPgixA== X-Google-Smtp-Source: APXvYqzdsV8tU3MpgnNLOKLPCEPdCdfdteZK2zsom+LUvNxzOUhXlYOv4B+zASrT6qXl8f+2fDeuiA== X-Received: by 2002:a05:600c:296:: with SMTP id 22mr8886475wmk.155.1574331272221; Thu, 21 Nov 2019 02:14:32 -0800 (PST) Received: from bender.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id o21sm1289932wmc.17.2019.11.21.02.14.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 02:14:31 -0800 (PST) From: Neil Armstrong To: mjourdan@baylibre.com, devicetree@vger.kernel.org Subject: [PATCH 1/3] dt-bindings: media: amlogic, gx-vdec: add bindings for SM1 family Date: Thu, 21 Nov 2019 11:14:27 +0100 Message-Id: <20191121101429.23831-2-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20191121101429.23831-1-narmstrong@baylibre.com> References: <20191121101429.23831-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191121_021437_076029_701FD709 X-CRM114-Status: GOOD ( 10.12 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:341 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neil Armstrong Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add bindings to support the Amlogic Video Decoder on the Amlogic SM1 family. SM1 has a slightly different power management handling, thus needing a separate compatible. Signed-off-by: Neil Armstrong Acked-by: Rob Herring --- Documentation/devicetree/bindings/media/amlogic,gx-vdec.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/media/amlogic,gx-vdec.yaml b/Documentation/devicetree/bindings/media/amlogic,gx-vdec.yaml index 8ea979bb97e6..a7ef69d02336 100644 --- a/Documentation/devicetree/bindings/media/amlogic,gx-vdec.yaml +++ b/Documentation/devicetree/bindings/media/amlogic,gx-vdec.yaml @@ -36,6 +36,7 @@ properties: - const: amlogic,gx-vdec - enum: - amlogic,g12a-vdec # G12A (S905X2, S905D2) + - amlogic,sm1-vdec # SM1 (S905X3, S905D3) interrupts: minItems: 2 @@ -100,6 +101,7 @@ allOf: contains: enum: - amlogic,g12a-vdec + - amlogic,sm1-vdec then: properties: From patchwork Thu Nov 21 10:14:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11256033 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 23FBA112B for ; Thu, 21 Nov 2019 10:15:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA89D206CB for ; Thu, 21 Nov 2019 10:15:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YkLNvb59"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="sgQbSuyR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA89D206CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5HbSt24e8R57Ape+Ywg9qqZ5HzEYcNPpT05i83QMR6w=; b=YkLNvb59z2UHgy H/QylUmefYmthj78u/2CYNEL2KwqIZk5cz1+4pwkUdmS/3UxJYLY8za9zy6qMBv5zsd2IOnsIIOVx xDTZBWnj1FsFJ/0mLVUKCvilswc0eA3MfDiQAICCGrbBd4XuCORvx6pYV4Atv1hYs/MKbcSWhJX7B Jk0mU67k4iC0H7kJ44z+jKheCuj2k6krKvA+Gur6trO2Cb+Smb1NmOoRHvaBNxksO3QqgwI/EbRtj Z2+SxZl4MbBkUN37LgOKr/8HvHg88s5bST4Bnw/S3RPSCnEgsqDjCNc6yfOqlP5DZ5fg2CBtlXXcQ qP3HKbnV1um6EcVzIuVg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXjUJ-0004MP-DR; Thu, 21 Nov 2019 10:14:59 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXjTw-000413-Sw for linux-arm-kernel@lists.infradead.org; Thu, 21 Nov 2019 10:14:40 +0000 Received: by mail-wr1-x443.google.com with SMTP id s5so3676995wrw.2 for ; Thu, 21 Nov 2019 02:14:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9Uj/OJizfCMV+pm8Bm80+o6nYf9xOidEjQZOmhbw7Tk=; b=sgQbSuyRaTjHtb50b5Ns8I+KWD74RpH72vWeYkSEw5qOkc4dTlhWmfpSKp2d9KBo1R 5lIpurfOlRUpmLLsGEbbwEH1Mklf7Attq2+b3KkSJqZvwIqOlmMMLkYyjIEDmZuvb5a5 c3N2ZchOyTXhU0rCSD39k31tKb46cpMWRTA8jLS57lpw0qa8LfujBe6PdpfodQxamnrQ 6AnHGvfUWPCcAmK3kW/k+9GMZnS9UB/l0sUWlAfICUGyq33D5M2xt2DenAamLzr7FEt1 qPEt1mN5TLHesyMZQMrVEWsR5UqUt0efpdBbkyH9i/awhCWFxMaAlnIQWbF5r+iFPauy zZSw== 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=9Uj/OJizfCMV+pm8Bm80+o6nYf9xOidEjQZOmhbw7Tk=; b=T8CGZD2Pfa0o9DJVZyjNLnzj2yDwx17+tklyd7RpCrZGYR31NFGW+piZF7jVnk7Gef LSUHerZTVmH6nxWJ/pYkqRXGFq1W+snS6XtzQA+TAQi05i+SUod03VIYUJN+KRc9q7hA AQSnTYGlPs4dF6Hjhpb6ko0H7qaYPRM9c63+1ChIXD9BcerivFyaYL412Ny5iOgw1UBQ 3X2F83ZEkQXIYx9p3AYnt/58eQ56XOZC+kBFuHxYOxq/ZIODktyp56iyli7HiScZzsyl xGwcstNIh40b0mLhv0V4U/Y1z60ZuSpJ4/OERrljTBRx4P0RdFJn9qM99fPHaOqO1e+a t9uA== X-Gm-Message-State: APjAAAUX1ZjmRmoRiajpErEFH6bxq+UjXeAu8gAcb685lrZhChm0nuFq ZCMMiWhMIFKLwrDsOAC6sf47gw== X-Google-Smtp-Source: APXvYqyH/ovyemEL/zz1cttC+sZ2PiFUJwPCumuv2fNDV5bChB+c10N4Ys6A9Lzh7HcYx+2s+N1h5g== X-Received: by 2002:adf:fc0a:: with SMTP id i10mr9942497wrr.105.1574331272916; Thu, 21 Nov 2019 02:14:32 -0800 (PST) Received: from bender.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id o21sm1289932wmc.17.2019.11.21.02.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 02:14:32 -0800 (PST) From: Neil Armstrong To: mjourdan@baylibre.com Subject: [PATCH 2/3] media: meson: vdec: add sm1 platform Date: Thu, 21 Nov 2019 11:14:28 +0100 Message-Id: <20191121101429.23831-3-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20191121101429.23831-1-narmstrong@baylibre.com> References: <20191121101429.23831-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191121_021436_980137_40AE96DC X-CRM114-Status: GOOD ( 14.75 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neil Armstrong Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add support for the Amlogic SM1 platform for the current MPEG1 & MPEG2 support. The SM1 family, very close to the G12A SoCs, has a slighly different power management control, thus needing a separate compatible and family id. Signed-off-by: Neil Armstrong --- drivers/staging/media/meson/vdec/vdec.c | 5 +++- drivers/staging/media/meson/vdec/vdec_1.c | 29 ++++++++++++++---- .../staging/media/meson/vdec/vdec_platform.c | 30 +++++++++++++++++++ .../staging/media/meson/vdec/vdec_platform.h | 2 ++ 4 files changed, 59 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c index 875a12be9c9e..a8a4c380ccc9 100644 --- a/drivers/staging/media/meson/vdec/vdec.c +++ b/drivers/staging/media/meson/vdec/vdec.c @@ -958,6 +958,8 @@ static const struct of_device_id vdec_dt_match[] = { .data = &vdec_platform_gxl }, { .compatible = "amlogic,g12a-vdec", .data = &vdec_platform_g12a }, + { .compatible = "amlogic,sm1-vdec", + .data = &vdec_platform_sm1 }, {} }; MODULE_DEVICE_TABLE(of, vdec_dt_match); @@ -1008,7 +1010,8 @@ static int vdec_probe(struct platform_device *pdev) of_id = of_match_node(vdec_dt_match, dev->of_node); core->platform = of_id->data; - if (core->platform->revision == VDEC_REVISION_G12A) { + if (core->platform->revision == VDEC_REVISION_G12A || + core->platform->revision == VDEC_REVISION_SM1) { core->vdec_hevcf_clk = devm_clk_get(dev, "vdec_hevcf"); if (IS_ERR(core->vdec_hevcf_clk)) return -EPROBE_DEFER; diff --git a/drivers/staging/media/meson/vdec/vdec_1.c b/drivers/staging/media/meson/vdec/vdec_1.c index 3a15c6fc0567..3fe2de0c9331 100644 --- a/drivers/staging/media/meson/vdec/vdec_1.c +++ b/drivers/staging/media/meson/vdec/vdec_1.c @@ -18,6 +18,7 @@ #define AO_RTI_GEN_PWR_SLEEP0 0xe8 #define AO_RTI_GEN_PWR_ISO0 0xec #define GEN_PWR_VDEC_1 (BIT(3) | BIT(2)) + #define GEN_PWR_VDEC_1_SM1 (BIT(1)) #define MC_SIZE (4096 * 4) @@ -142,12 +143,20 @@ static int vdec_1_stop(struct amvdec_session *sess) amvdec_read_dos(core, DOS_SW_RESET0); /* enable vdec1 isolation */ - regmap_write(core->regmap_ao, AO_RTI_GEN_PWR_ISO0, 0xc0); + if (core->platform->revision == VDEC_REVISION_SM1) + regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_ISO0, + GEN_PWR_VDEC_1_SM1, GEN_PWR_VDEC_1_SM1); + else + regmap_write(core->regmap_ao, AO_RTI_GEN_PWR_ISO0, 0xc0); /* power off vdec1 memories */ amvdec_write_dos(core, DOS_MEM_PD_VDEC, 0xffffffff); /* power off vdec1 */ - regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, - GEN_PWR_VDEC_1, GEN_PWR_VDEC_1); + if (core->platform->revision == VDEC_REVISION_SM1) + regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, + GEN_PWR_VDEC_1_SM1, GEN_PWR_VDEC_1_SM1); + else + regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, + GEN_PWR_VDEC_1, GEN_PWR_VDEC_1); clk_disable_unprepare(core->vdec_1_clk); @@ -170,8 +179,12 @@ static int vdec_1_start(struct amvdec_session *sess) return ret; /* Enable power for VDEC_1 */ - regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, - GEN_PWR_VDEC_1, 0); + if (core->platform->revision == VDEC_REVISION_SM1) + regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, + GEN_PWR_VDEC_1_SM1, 0); + else + regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, + GEN_PWR_VDEC_1, 0); usleep_range(10, 20); /* Reset VDEC1 */ @@ -183,7 +196,11 @@ static int vdec_1_start(struct amvdec_session *sess) /* enable VDEC Memories */ amvdec_write_dos(core, DOS_MEM_PD_VDEC, 0); /* Remove VDEC1 Isolation */ - regmap_write(core->regmap_ao, AO_RTI_GEN_PWR_ISO0, 0); + if (core->platform->revision == VDEC_REVISION_SM1) + regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_ISO0, + GEN_PWR_VDEC_1_SM1, 0); + else + regmap_write(core->regmap_ao, AO_RTI_GEN_PWR_ISO0, 0); /* Reset DOS top registers */ amvdec_write_dos(core, DOS_VDEC_MCRCC_STALL_CTRL, 0); diff --git a/drivers/staging/media/meson/vdec/vdec_platform.c b/drivers/staging/media/meson/vdec/vdec_platform.c index 7845a889ce24..ea39f8209ec7 100644 --- a/drivers/staging/media/meson/vdec/vdec_platform.c +++ b/drivers/staging/media/meson/vdec/vdec_platform.c @@ -106,6 +106,30 @@ static const struct amvdec_format vdec_formats_g12a[] = { }, }; +static const struct amvdec_format vdec_formats_sm1[] = { + { + .pixfmt = V4L2_PIX_FMT_MPEG1, + .min_buffers = 8, + .max_buffers = 8, + .max_width = 1920, + .max_height = 1080, + .vdec_ops = &vdec_1_ops, + .codec_ops = &codec_mpeg12_ops, + .firmware_path = "meson/vdec/gxl_mpeg12.bin", + .pixfmts_cap = { V4L2_PIX_FMT_NV12M, V4L2_PIX_FMT_YUV420M, 0 }, + }, { + .pixfmt = V4L2_PIX_FMT_MPEG2, + .min_buffers = 8, + .max_buffers = 8, + .max_width = 1920, + .max_height = 1080, + .vdec_ops = &vdec_1_ops, + .codec_ops = &codec_mpeg12_ops, + .firmware_path = "meson/vdec/gxl_mpeg12.bin", + .pixfmts_cap = { V4L2_PIX_FMT_NV12M, V4L2_PIX_FMT_YUV420M, 0 }, + }, +}; + const struct vdec_platform vdec_platform_gxbb = { .formats = vdec_formats_gxbb, .num_formats = ARRAY_SIZE(vdec_formats_gxbb), @@ -129,3 +153,9 @@ const struct vdec_platform vdec_platform_g12a = { .num_formats = ARRAY_SIZE(vdec_formats_g12a), .revision = VDEC_REVISION_G12A, }; + +const struct vdec_platform vdec_platform_sm1 = { + .formats = vdec_formats_sm1, + .num_formats = ARRAY_SIZE(vdec_formats_sm1), + .revision = VDEC_REVISION_SM1, +}; diff --git a/drivers/staging/media/meson/vdec/vdec_platform.h b/drivers/staging/media/meson/vdec/vdec_platform.h index 7c61b941b39f..731877a771f4 100644 --- a/drivers/staging/media/meson/vdec/vdec_platform.h +++ b/drivers/staging/media/meson/vdec/vdec_platform.h @@ -16,6 +16,7 @@ enum vdec_revision { VDEC_REVISION_GXL, VDEC_REVISION_GXM, VDEC_REVISION_G12A, + VDEC_REVISION_SM1, }; struct vdec_platform { @@ -28,5 +29,6 @@ extern const struct vdec_platform vdec_platform_gxbb; extern const struct vdec_platform vdec_platform_gxm; extern const struct vdec_platform vdec_platform_gxl; extern const struct vdec_platform vdec_platform_g12a; +extern const struct vdec_platform vdec_platform_sm1; #endif From patchwork Thu Nov 21 10:14:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11256021 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C6A196C1 for ; Thu, 21 Nov 2019 10:14:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A22D8206CB for ; Thu, 21 Nov 2019 10:14:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GeDTeLU8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="lFzeH9x5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A22D8206CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YFmCfRB683zIXPvyF4RJwc6Rtv4HU8yy05MSe79dlkY=; b=GeDTeLU8Xnvkyv 9ofPG5SxoxrdvRjpKAgp5tLNLfMriwHZ/cbGuMgQmfEiwde7B+9SOFI4Rl0Sa7JiEwIe0Q/EXLEif XjbqzJ321JoOzxcGVSvkzZ1ekLwxghPUChtII0NBNmzcJgfUY2j/YPepyEl80/meMivq20e2CEpmO gA3DBrc+n66lbnbgWNMmQ6/XV8MKm/ISvc23IevqK++IoVTPzNMOB41+S6ac3oEgOtfyLdL/0Pjy8 0Ek4ZhVRtkgH1Igmf7J0hg2UFN1QN/S/6r5WNum55U8tHbaUH9HEHGsocAln0tPf+2mBdxOFEuiTD BFIu4YCV8Q9ueSuHUPiA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXjU3-00046Y-57; Thu, 21 Nov 2019 10:14:43 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXjTw-000418-T2 for linux-arm-kernel@lists.infradead.org; Thu, 21 Nov 2019 10:14:40 +0000 Received: by mail-wr1-x442.google.com with SMTP id t2so3686091wrr.1 for ; Thu, 21 Nov 2019 02:14:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0wg42Ie2oicewNtAQ2/KQD6s/n4R5PzVImaC+y7L2/I=; b=lFzeH9x56IU0xzBmSWRZ6DcwLxw1LdGEIJ5MlxSDkIZqsb0vFRQ5uS/KuSKEhv4Rpe zXtQOFjQ5v/kTiNdmSeeMdIpd/tLUgDYdIlHZJY++DJQqDyXRl+O2emaVMMdfEMYpbXS lPPASwiAaZXdpBiEx8xmrla3280an3xZAkQlbeDlAHyRTMheWJ1BWs1RBZaPlkYk5ZyR zGBc4uGluDTwDdqqFLevoP1HfKsU1jK4h2lDg+opAN/Rlpuf7/yfRyLVCalk44pvBFjL Q3Uo0kH1qvOW1GrBmhdrITJLvv8OKVb0Z4+4oPyHHtRSxHaUFITEv1aOgLAmvTvJhIBF 5OEw== 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=0wg42Ie2oicewNtAQ2/KQD6s/n4R5PzVImaC+y7L2/I=; b=CH6GwDfdCFuFEze4Etv3x+HSE4zwPc5pxlrr5JXOu/zoHM3EvKBvKqB4p2V+Jzu9EO Tl01afQq6gkx7GbX+2JLMgSwuJF3kzH728qejN4ifzfxbzwYmr8SoDjxRLecUZ0FhOJc +m+uRiCP33kHNZF6j29zSHslOninHrvPex+7V1Qc0UCU3nSkJb3A6nko07PWytHI8WHI wCajv7/7R+sq0H5jGmv0E4ggmU5D1snWaWecKLkgbSuAXweIjunVe3Fk+68/8Enmb4iW JJHdRUytp0J9iJAKIEdqMmug2yuievddP1Pfuu2WqlW3fYPLtnPhBBxgoSfzN2mZAx7g oXMw== X-Gm-Message-State: APjAAAUWsgnNRZvFC55i8rVDghigaM4MCjvFdEI3VFwSDUxCxhwvUoMw ICJAGu9DUf7tfcjn8pNAVSVoHA== X-Google-Smtp-Source: APXvYqxaDVnzGeg++beFGsQYq3Z9at9EOfwRlpJHiF3RSAfp90GcgPYTGGemHS3Jb/bwbNGcDgkpQA== X-Received: by 2002:a5d:4608:: with SMTP id t8mr9739630wrq.91.1574331273780; Thu, 21 Nov 2019 02:14:33 -0800 (PST) Received: from bender.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id o21sm1289932wmc.17.2019.11.21.02.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 02:14:33 -0800 (PST) From: Neil Armstrong To: mjourdan@baylibre.com Subject: [PATCH 3/3] arm64: dts: meson-sm1: add video decoder compatible Date: Thu, 21 Nov 2019 11:14:29 +0100 Message-Id: <20191121101429.23831-4-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20191121101429.23831-1-narmstrong@baylibre.com> References: <20191121101429.23831-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191121_021436_967371_BC5ADD81 X-CRM114-Status: UNSURE ( 9.20 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neil Armstrong Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add the video decoder specific compatible for Amlogic SM1 SoC. Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi index 521573f3a5ba..b94a4eae973f 100644 --- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi @@ -138,6 +138,10 @@ compatible = "amlogic,meson-sm1-pwrc"; }; +&vdec { + compatible = "amlogic,sm1-vdec"; +}; + &vpu { power-domains = <&pwrc PWRC_SM1_VPU_ID>; };