Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a863b366 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm-vidc: config UBWC for the sdmshrike target"

parents 0c749e4b d7ece12b
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ Required properties:
	- "qcom,sdm845-vidc" : Invokes driver specific data for SDM845.
	- "qcom,sdm670-vidc" : Invokes driver specific data for SDM670.
	- "qcom,atoll-vidc" : Invokes driver specific data for atoll.
	- "qcom,sdmshrike-vidc" : Invokes driver specific data for sdmshrike.

Optional properties:
- reg : offset and length of the register set for the device.
+139 −0
Original line number Diff line number Diff line
/* Copyright (c) 2018 - 2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/msm/msm-bus-ids.h>
#include <dt-bindings/clock/qcom,videocc-sm8150.h>

&soc {
	msm_vidc: qcom,vidc@aa00000 {
		compatible = "qcom,msm-vidc", "qcom,sdmshrike-vidc";
		status = "ok";
		reg = <0xaa00000 0x200000>;
		interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;

		/* LLCC Info */
		cache-slice-names = "vidsc0", "vidsc1";
		cache-slices = <&llcc 2>, <&llcc 3>;

		/* Supply */
		iris-ctl-supply = <&mvsc_gdsc>;
		vcodec-supply = <&mvs0_gdsc>;
		cvp-supply = <&mvs1_gdsc>;

		/* Clocks */
		clock-names =  "gcc_video_axic", "gcc_video_axi0",
			"gcc_video_axi1", "core_clk", "vcodec_clk",
			"cvp_clk";
		clocks = <&clock_gcc GCC_VIDEO_AXIC_CLK>,
			<&clock_gcc GCC_VIDEO_AXI0_CLK>,
			<&clock_gcc GCC_VIDEO_AXI1_CLK>,
			<&clock_videocc VIDEO_CC_MVSC_CORE_CLK>,
			<&clock_videocc VIDEO_CC_MVS0_CORE_CLK>,
			<&clock_videocc VIDEO_CC_MVS1_CORE_CLK>;
		qcom,proxy-clock-names = "gcc_video_axic",
			"gcc_video_axi0", "gcc_video_axi1",
			"core_clk", "vcodec_clk", "cvp_clk";

		resets = <&clock_gcc GCC_VIDEO_AXIC_CLK_BCR>,
			<&clock_videocc VIDEO_CC_MVSC_CORE_CLK_BCR>,
			<&clock_gcc GCC_VIDEO_AXI0_CLK_BCR>,
			<&clock_gcc GCC_VIDEO_AXI1_CLK_BCR>;
		reset-names = "video_axi_reset", "video_core_reset",
				"video_axi0_reset", "video_axi1_reset";

		qcom,clock-configs = <0x0 0x0 0x0 0x1 0x1 0x1>;
		qcom,allowed-clock-rates = <225000000 300000000
			365000000 432000000 480000000>;

		/* Buses */
		bus_cnoc {
			compatible = "qcom,msm-vidc,bus";
			label = "cnoc";
			qcom,bus-master = <MSM_BUS_MASTER_AMPSS_M0>;
			qcom,bus-slave = <MSM_BUS_SLAVE_VENUS_CFG>;
			qcom,bus-governor = "performance";
			qcom,bus-range-kbps = <1000 1000>;
		};

		venus_bus_ddr {
			compatible = "qcom,msm-vidc,bus";
			label = "venus-ddr";
			qcom,bus-master = <MSM_BUS_MASTER_LLCC>;
			qcom,bus-slave = <MSM_BUS_SLAVE_EBI_CH0>;
			qcom,bus-governor = "msm-vidc-ddr";
			qcom,bus-range-kbps = <1000 6533000>;
		};
		arm9_bus_ddr {
			compatible = "qcom,msm-vidc,bus";
			label = "venus-arm9-ddr";
			qcom,bus-master = <MSM_BUS_MASTER_VIDEO_P0>;
			qcom,bus-slave = <MSM_BUS_SLAVE_EBI_CH0>;
			qcom,bus-governor = "performance";
			qcom,bus-range-kbps = <1000 1000>;
		};
		venus_bus_llcc {
			compatible = "qcom,msm-vidc,bus";
			label = "venus-llcc";
			qcom,bus-master = <MSM_BUS_MASTER_VIDEO_P0>;
			qcom,bus-slave = <MSM_BUS_SLAVE_LLCC>;
			qcom,bus-governor = "msm-vidc-llcc";
			qcom,bus-range-kbps = <1000 6533000>;
		};

		/* MMUs */
		non_secure_cb {
			compatible = "qcom,msm-vidc,context-bank";
			label = "venus_ns";
			iommus =
				<&apps_smmu 0x1300 0x60>;
			buffer-types = <0xfff>;
			virtual-addr-pool = <0x25800000 0xba800000>;
		};

		secure_non_pixel_cb {
			compatible = "qcom,msm-vidc,context-bank";
			label = "venus_sec_non_pixel";
			iommus =
				<&apps_smmu 0x1304 0x60>;
			buffer-types = <0x480>;
			virtual-addr-pool = <0x1000000 0x24800000>;
			qcom,secure-context-bank;
		};

		secure_bitstream_cb {
			compatible = "qcom,msm-vidc,context-bank";
			label = "venus_sec_bitstream";
			iommus =
				<&apps_smmu 0x1301 0x4>;
			buffer-types = <0x241>;
			virtual-addr-pool = <0x500000 0xdfb00000>;
			qcom,secure-context-bank;
		};

		secure_pixel_cb {
			compatible = "qcom,msm-vidc,context-bank";
			label = "venus_sec_pixel";
			iommus =
				<&apps_smmu 0x1303 0x20>;
			buffer-types = <0x106>;
			virtual-addr-pool = <0x500000 0xdfb00000>;
			qcom,secure-context-bank;
		};

		/* Memory Heaps */
		qcom,msm-vidc,mem_cdsp {
			compatible = "qcom,msm-vidc,mem-cdsp";
			memory-region = <&cdsp_mem>;
		};
	};
};
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2620,7 +2620,7 @@
#include "sdmshrike-usb.dtsi"
#include "sdmshrike-qupv3.dtsi"
#include "sm8150-audio.dtsi"
#include "sm8150-vidc.dtsi"
#include "sdmshrike-vidc.dtsi"
#include "sdmshrike-pm.dtsi"
#include "sdmshrike-gpu.dtsi"
#include "sdmshrike-thermal.dtsi"
+19 −11
Original line number Diff line number Diff line
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2116,26 +2116,34 @@ int create_pkt_cmd_sys_image_version(
int create_pkt_cmd_sys_ubwc_config(struct hfi_cmd_sys_set_property_packet *pkt,
		struct msm_vidc_ubwc_config *config)
{
	struct msm_vidc_ubwc_config *hfi;

	if (!pkt) {
		dprintk(VIDC_ERR, "%s invalid param :%pK\n", __func__, pkt);
		return -EINVAL;
	}

	pkt->size = sizeof(struct hfi_cmd_sys_set_property_packet) +
		sizeof(struct msm_vidc_ubwc_config) + sizeof(u32);
		config->nSize + sizeof(u32);
	pkt->packet_type = HFI_CMD_SYS_SET_PROPERTY;
	pkt->num_properties = 1;
	pkt->rg_property_data[0] = HFI_PROPERTY_SYS_UBWC_CONFIG;
	hfi = (struct msm_vidc_ubwc_config *) &pkt->rg_property_data[1];
	hfi->sOverrideBitInfo.bMalLengthOverride =
			config->sOverrideBitInfo.bMalLengthOverride;
	hfi->nMalLength = config->nMalLength;

	if (config->nSize == sizeof(struct msm_vidc_ubwc_config))
		memcpy(&pkt->rg_property_data[1], config, config->nSize);
	else
		memcpy(&pkt->rg_property_data[1], &(config->v1), config->nSize);

	dprintk(VIDC_DBG,
		"UBWC config nSize: %u, MaxChannels: %u, MalLength: %u, %u, HBB: %u\n",
		config->nSize,
		config->v1.nMaxChannels,
		config->v1.nMalLength,
		config->v1.nHighestBankBit);
	dprintk(VIDC_DBG,
			"UBWC settings Mal Length Override : %u MalLength: %u",
			hfi->sOverrideBitInfo.bMalLengthOverride,
			hfi->nMalLength);
		"MaxChannelsOverride: %u, MalLengthOverride: %u, HBBOverride: %u\n",
		config->v1.sOverrideBitInfo.bMaxChannelsOverride,
		config->v1.sOverrideBitInfo.bMalLengthOverride,
		config->v1.sOverrideBitInfo.bHBBOverride);

	return 0;
}

+40 −13
Original line number Diff line number Diff line
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -25,7 +25,7 @@
#include <linux/io.h>
#include "msm_vidc_internal.h"
#include "msm_vidc_debug.h"

#include "vidc_hfi_helper.h"

#define CODEC_ENTRY(n, p, vsp, vpp, lp) \
{	\
@@ -36,19 +36,20 @@
	.low_power_cycles = lp	\
}

#define UBWC_CONFIG(mco, mlo, hbbo, rs1, mc, ml, hbb, rs2) \
#define UBWC_CONFIG(sz, type, mco, mlo, hbbo, rs1, mc, ml, hbb, rs2) \
{	\
	.sOverrideBitInfo.bMaxChannelsOverride = mc,	\
	.sOverrideBitInfo.bMalLengthOverride = mlo,	\
	.sOverrideBitInfo.bHBBOverride = hbbo,	\
	.sOverrideBitInfo.reserved1 = rs1,	\
	.nMaxChannels = mc,	\
	.nMalLength = ml,	\
	.nHighestBankBit = hbb,	\
	.reserved2 = {rs2}	\
	.nSize = sz, \
	.ePacketType = type, \
	.v1.sOverrideBitInfo.bMaxChannelsOverride = mco,	\
	.v1.sOverrideBitInfo.bMalLengthOverride = mlo,	\
	.v1.sOverrideBitInfo.bHBBOverride = hbbo,	\
	.v1.sOverrideBitInfo.reserved1 = rs1,	\
	.v1.nMaxChannels = mc,	\
	.v1.nMalLength = ml,	\
	.v1.nHighestBankBit = hbb,	\
	.v1.reserved2 = {rs2}	\
}


#define EFUSE_ENTRY(sa, s, m, sh, p) \
{	\
	.start_address = sa,		\
@@ -743,7 +744,13 @@ static struct msm_vidc_efuse_data sdmmagpie_efuse_data[] = {
};

static struct msm_vidc_ubwc_config trinket_ubwc_data[] = {
	UBWC_CONFIG(0, 1, 0, 0, 0, 64, 0, 0),
	UBWC_CONFIG(sizeof(struct msm_vidc_ubwc_config_v1),
		HFI_PROPERTY_SYS_UBWC_CONFIG, 0, 1, 0, 0, 0, 64, 0, 0),
};

static struct msm_vidc_ubwc_config sdmshrike_ubwc_data[] = {
	UBWC_CONFIG(sizeof(struct msm_vidc_ubwc_config),
		HFI_PROPERTY_SYS_UBWC_CONFIG, 1, 0, 1, 0, 8, 0, 16, 0),
};

static struct msm_vidc_platform_data default_data = {
@@ -826,6 +833,22 @@ static struct msm_vidc_platform_data sm8150_data = {
	.vpu_ver = VPU_VERSION_5,
};

static struct msm_vidc_platform_data sdmshrike_data = {
	.codec_data = sm8150_codec_data,
	.codec_data_length =  ARRAY_SIZE(sm8150_codec_data),
	.common_data = sm8150_common_data,
	.common_data_length =  ARRAY_SIZE(sm8150_common_data),
	.ubwc_config = sdmshrike_ubwc_data,
	.ubwc_config_length = ARRAY_SIZE(sdmshrike_ubwc_data),
	.csc_data.vpe_csc_custom_bias_coeff = vpe_csc_custom_bias_coeff,
	.csc_data.vpe_csc_custom_matrix_coeff = vpe_csc_custom_matrix_coeff,
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
	.efuse_data = NULL,
	.efuse_data_length = 0,
	.sku_version = 0,
	.vpu_ver = VPU_VERSION_5,
};

static struct msm_vidc_platform_data sdmmagpie_data = {
	.codec_data = sdmmagpie_codec_data,
	.codec_data_length =  ARRAY_SIZE(sdmmagpie_codec_data),
@@ -891,6 +914,10 @@ static const struct of_device_id msm_vidc_dt_match[] = {
		.compatible = "qcom,sm8150-vidc",
		.data = &sm8150_data,
	},
	{
		.compatible = "qcom,sdmshrike-vidc",
		.data = &sdmshrike_data,
	},
	{
		.compatible = "qcom,sdmmagpie-vidc",
		.data = &sdmmagpie_data,
Loading