From patchwork Fri May 1 20:35:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 11523223 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 F1C4514B4 for ; Fri, 1 May 2020 20:35:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DAD0721924 for ; Fri, 1 May 2020 20:35:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O8lOsLcO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726673AbgEAUff (ORCPT ); Fri, 1 May 2020 16:35:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726564AbgEAUfe (ORCPT ); Fri, 1 May 2020 16:35:34 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90A47C061A0C; Fri, 1 May 2020 13:35:34 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id h9so2566283wrt.0; Fri, 01 May 2020 13:35:34 -0700 (PDT) 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=2jbjKpiLuW8C9Df3qn3Yi0fFmfGmKUbsyy8So15/ZHA=; b=O8lOsLcOi+I/G/TaTcDzAv0Q7WpBaa7BM3FW40aLRFSXPVQzhu6+BfIFAzWxOuyFxc vq/DHvndbK0xPv2Hthpp3ljhdQg2Lqm/QUclhj3fuzewsidoOK0FzQ0NzueCHJoqZIKE RR2ILY6qt0YQytX8cDPpgozmrmGjKqpG4oEnNBEuQVDtsX2iqVLEt5ldHzcXnBt+iMnv jh7I4VvKMDLtCtL+LrSHQIE+yzZ72hdK+j33j71B06XvqrH/w9xuP6vwaAP2hVQrMy9a LpSVwM5Ud6FNoCggDlnVDqYWwZf7AbaumskRl5oPbi5ogIhpNsOHzOjTWfArpukoG2aI xgYQ== 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=2jbjKpiLuW8C9Df3qn3Yi0fFmfGmKUbsyy8So15/ZHA=; b=EEu+CdNQwJk0tvtsLkCVMefPwM+6ozUsCwPa4IwUKTEhp7ZFlf4L3AogmewHqZjmgV dFKBmWCvJojuJd1eL7tJhJhF/qPxXFMZiJ3Mp78WxXcS1rQiPmvV7sLFqrs4uBNNFCe1 SmW7zlxoZjb+b9fDYXaB+0eysPtQ/HP2SzdlI8K8yV+KWdRiAg/ohsTfgMQBMoupzm4i sflUc+njD4uBrmvSIXh59GfkrN/+uuFY4XGiBMfDLJwvhGHrkeiRdKz/jcSoynvS0qBw LOyzkHxBzED80VgsmD4GAUz91k2RrAc4YL6PH0FKk67pbfrC4/StF7G34N9of7NsLjJ0 RV2Q== X-Gm-Message-State: AGi0Pua3Kg7BuZV7BdU4/DRyrlilXAkIZpfJWpwdxcNTOlWh4T0oMd8E TuxkzpbQq2bHABY1jHj1qWI= X-Google-Smtp-Source: APiQypKY3uxA/v45wSk1cgjs3sbXvBwxrlXGwNnvMwC1F7Ck0MgaAa/yKe7n9eQVC9rZjvsFRXNbSw== X-Received: by 2002:adf:ec09:: with SMTP id x9mr5818692wrn.364.1588365333338; Fri, 01 May 2020 13:35:33 -0700 (PDT) Received: from localhost.localdomain (abag125.neoplus.adsl.tpnet.pl. [83.6.170.125]) by smtp.googlemail.com with ESMTPSA id s12sm1021981wmc.7.2020.05.01.13.35.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2020 13:35:32 -0700 (PDT) From: Konrad Dybcio To: skrzynka@konradybcio.pl Cc: Konrad Dybcio , Andy Gross , Bjorn Andersson , Stanimir Varbanov , Mauro Carvalho Chehab , Rob Herring , linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] media: venus: Add support for MSM8939 Date: Fri, 1 May 2020 22:35:02 +0200 Message-Id: <20200501203505.144362-2-konradybcio@gmail.com> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200501203505.144362-1-konradybcio@gmail.com> References: <20200501203505.144362-1-konradybcio@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 194b10b987672..f3a15991ac763 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -405,6 +405,38 @@ static const struct venus_resources msm8916_res = { .fwname = "qcom/venus-1.8/venus.mdt", }; +static const struct freq_tbl msm8939_freq_table[] = { + { 489600, 266670000 }, /* 1080p @ 60 */ + { 244800, 200000000 }, /* 1080p @ 30 */ + { 244800, 133330000 }, /* 1080p @ 30 (decode only) */ + { 220800, 133330000 }, /* 720p @ 60 (decode only?) */ + { 108000, 133330000 }, /* 720p @ 30*/ + { 72000, 133330000 }, /* VGA @ 60 */ + { 36000, 133330000 }, /* VGA @ 30 */ +}; + +static const struct reg_val msm8939_reg_preset[] = { + { 0xe0020, 0x0aaaaaaa }, + { 0xe0024, 0x0aaaaaaa }, + { 0x80124, 0x00000003 }, +}; + +static const struct venus_resources msm8939_res = { + .freq_tbl = msm8939_freq_table, + .freq_tbl_size = ARRAY_SIZE(msm8939_freq_table), + .reg_tbl = msm8939_reg_preset, + .reg_tbl_size = ARRAY_SIZE(msm8939_reg_preset), + .clks = { "core", "iface", "bus", }, + .clks_num = 3, + .max_load = 489600, /* 1080p @ 60 */ + .hfi_version = HFI_VERSION_1XX, + .vmem_id = VIDC_RESOURCE_NONE, + .vmem_size = 0, + .vmem_addr = 0, + .dma_mask = 0xddc00000 - 1, + .fwname = "qcom/venus-1.8/venus.mdt", +}; + static const struct freq_tbl msm8996_freq_table[] = { { 1944000, 520000000 }, /* 4k UHD @ 60 (decode only) */ { 972000, 520000000 }, /* 4k UHD @ 30 */ @@ -567,6 +599,7 @@ static const struct venus_resources sc7180_res = { static const struct of_device_id venus_dt_match[] = { { .compatible = "qcom,msm8916-venus", .data = &msm8916_res, }, + { .compatible = "qcom,msm8939-venus", .data = &msm8939_res, }, { .compatible = "qcom,msm8996-venus", .data = &msm8996_res, }, { .compatible = "qcom,sdm845-venus", .data = &sdm845_res, }, { .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, }, From patchwork Fri May 1 20:35:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 11523229 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 136AB14B4 for ; Fri, 1 May 2020 20:35:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F12152495D for ; Fri, 1 May 2020 20:35:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Tlrjk1dH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726788AbgEAUfj (ORCPT ); Fri, 1 May 2020 16:35:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726564AbgEAUfi (ORCPT ); Fri, 1 May 2020 16:35:38 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36867C061A0C; Fri, 1 May 2020 13:35:38 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id k1so12903528wrx.4; Fri, 01 May 2020 13:35:38 -0700 (PDT) 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=4CV2/aVsWZ0J7YHV9S4W9vWVSAHIz1DaEhX17Sy8Wz4=; b=Tlrjk1dH8to4PfLXys+3mHm6CjCbaZV/J43dAGlgcHkGXSi1KQpbWvo1YvteX9WKrn Xf4daL6/ODr0zMKAzvwDmT24kpaD6rP4lHHuVZ97MrHjSKkvq2cZJTGkBIt2KGZBJMkg SZELEIm75FMbnpwhZCgPeRRH8bg8pI3oSbgax5bjUiLJ6500qgkKdfIQZNpEvNsocwRT TavhlFdn3namQI7yJLI2zvdYbHBYoU+m80ZSYZOaBXd5Zj3smpwI+TS9qosuSDUmztG0 HM9TqSK4ipAOtfxDzTmHhPnhtpnOPKZsamcKqKlEMI3Mj6pPlNEWBW4wxNjqJ+GBgNPi fkbg== 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=4CV2/aVsWZ0J7YHV9S4W9vWVSAHIz1DaEhX17Sy8Wz4=; b=KBOof0Y9v/Ud6s/jqQTMyoD4yFkMBXQ/qCgfJqXBBaUBF4vkhEq/1b+ShgNZk2lYoy 8xCZte+u4gI3FlnM50vEGsOHU/H1c2bI+BMJrZTYRgrhY1cUrlBfsodbp+FN6VxkO/aV XHDPIFZyIwLcJpQQuLyllv46WE36pUfkQg7vsRJcAeskh2l4WTTSr0zywld7GWjuEnDq FfhJErcC5Not1nwA23tom9FSqXfT8CYhOQBGNzP/N8u2K0/QC3wxyzoxilEY3B7q0d61 RSZogZfwc3qAx3vROspBd1octrl1nidoPP87YvXPmOnpcacBhfFQNu6rCnfDBb9DeiSd Pm4g== X-Gm-Message-State: AGi0PuZTEB/ZG3KL9ihaHqfcFWkUD0luChwFxZptco24wfWzV47xzWBj fyESPAkt843tWhEpjUMod+g= X-Google-Smtp-Source: APiQypKs56QSSRikbo8kH00yOgGcPJYKeqjXs3piSV6FSIJYIeDDQcn6iPsk7GoyRUrMCNPKoX69gw== X-Received: by 2002:adf:9d8d:: with SMTP id p13mr5689847wre.17.1588365336726; Fri, 01 May 2020 13:35:36 -0700 (PDT) Received: from localhost.localdomain (abag125.neoplus.adsl.tpnet.pl. [83.6.170.125]) by smtp.googlemail.com with ESMTPSA id s12sm1021981wmc.7.2020.05.01.13.35.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2020 13:35:36 -0700 (PDT) From: Konrad Dybcio To: skrzynka@konradybcio.pl Cc: Konrad Dybcio , Andy Gross , Bjorn Andersson , Stanimir Varbanov , Mauro Carvalho Chehab , Rob Herring , linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] dt-bindings: media: Document MSM8939 Venus Date: Fri, 1 May 2020 22:35:03 +0200 Message-Id: <20200501203505.144362-3-konradybcio@gmail.com> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200501203505.144362-1-konradybcio@gmail.com> References: <20200501203505.144362-1-konradybcio@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Signed-off-by: Konrad Dybcio --- .../bindings/media/qcom,msm8939-venus.yaml | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/qcom,msm8939-venus.yaml diff --git a/Documentation/devicetree/bindings/media/qcom,msm8939-venus.yaml b/Documentation/devicetree/bindings/media/qcom,msm8939-venus.yaml new file mode 100644 index 0000000000000..8cc0002d10163 --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,msm8939-venus.yaml @@ -0,0 +1,119 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) + +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/media/qcom,msm8939-venus.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcomm Venus video encode and decode accelerators + +maintainers: + - Stanimir Varbanov + +description: | + The Venus IP is a video encode and decode accelerator present + on Qualcomm platforms + +properties: + compatible: + const: qcom,msm8939-venus + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + power-domains: + maxItems: 1 + + clocks: + maxItems: 3 + + clock-names: + items: + - const: core + - const: iface + - const: bus + + iommus: + maxItems: 1 + + memory-region: + maxItems: 1 + + video-decoder: + type: object + + properties: + compatible: + const: "venus-decoder" + + required: + - compatible + + additionalProperties: false + + video-encoder: + type: object + + properties: + compatible: + const: "venus-encoder" + + required: + - compatible + + additionalProperties: false + + video-firmware: + type: object + + description: | + Firmware subnode is needed when the platform does not + have TrustZone. + + properties: + iommus: + maxItems: 1 + + required: + - iommus + +required: + - compatible + - reg + - interrupts + - power-domains + - clocks + - clock-names + - iommus + - memory-region + - video-decoder + - video-encoder + +examples: + - | + #include + #include + + video-codec@1d00000 { + compatible = "qcom,msm8939-venus"; + reg = <0x01d00000 0xff000>; + interrupts = ; + clocks = <&gcc GCC_VENUS0_VCODEC0_CLK>, + <&gcc GCC_VENUS0_AHB_CLK>, + <&gcc GCC_VENUS0_AXI_CLK>; + clock-names = "core", "iface", "bus"; + power-domains = <&gcc VENUS_GDSC>; + iommus = <&apps_iommu 5>; + memory-region = <&venus_mem>; + + video-decoder { + compatible = "venus-decoder"; + }; + + video-encoder { + compatible = "venus-encoder"; + }; + };