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

Commit 2893192a authored by Chinmay Sawarkar's avatar Chinmay Sawarkar
Browse files

msm: vidc: Remove non secure firmware loading



Non secure loading of firmware is not supported, hence removing
the support.

CRs-Fixed: 2358497
Change-Id: I1da79824deefd48f42570051be352de7649f1855
Signed-off-by: default avatarChinmay Sawarkar <chinmays@codeaurora.org>
parent ce2d64b7
Loading
Loading
Loading
Loading
+10 −39
Original line number Diff line number Diff line
@@ -6,11 +6,7 @@ Venus
Required properties:
- compatible : one of:
	- "qcom,msm-vidc"
	- "qcom,sm6150-vidc" : Invokes driver specific data for SM6150.
        - "qcom,sm8150-vidc" : Invokes driver specific data for SM8150.
        - "qcom,sm6150-vidc" : Invokes driver specific data for SM6150.
        - "qcom,sdm845-vidc" : Invokes driver specific data for SDM845.
        - "qcom,sdm670-vidc" : Invokes driver specific data for SDM670.
        - "qcom,kona-vidc" : Invokes driver specific data for KONA.

Optional properties:
- reg : offset and length of the register set for the device.
@@ -60,9 +56,6 @@ Optional properties:
       macro block in low power mode.
       the required frequency to get the final frequency, the factor is
       represented in Q16 format.
- qcom,use-non-secure-pil = A bool indicating which type of pil to use to load
  the fw.
- qcom,fw-bias = The address at which venus fw is loaded (manually).
- qcom,vidc-iommu-domains = node containing individual domain nodes, each with:
     - a unique domain name for the domain node (e.g vidc,domain-ns)
     - qcom,vidc-domain-phandle: phandle for the domain as defined in
@@ -113,7 +106,6 @@ Optional properties:
          internal persist1 = 0x400
          internal cmd queue = 0x800
- virtual-addr-pool : offset and length of virtual address pool.
- qcom,fw-context-bank : bool indicating firmware context bank.
- qcom,secure-context-bank : bool indicating secure context bank.

Buses
@@ -165,25 +157,7 @@ Example:
		qcom,clock-configs = <0x3 0x1 0x0>;
		qcom,buffer-type-tz-usage-table = <0x1 0x1>,
						<0x1fe 0x2>;
		qcom,fw-bias = <0xe000000>;
		qcom,allowed-clock-rates = <200000000 300000000 400000000>;
		msm_vidc_cb1: msm_vidc_cb1 {
			compatible = "qcom,msm-vidc,context-bank";
			label = "venus_ns";
			iommus = <&venus_smmu 0x0a>,
				<&venus_smmu 0x0b>,
				<&venus_smmu 0x0c>;
			buffer-types = <0xfff>;
			virtual-addr-pool = <0x5dc00000 0x80000000>;
			qcom,secure-context-bank;
		};

		msm_vidc_cb2: msm_vidc_cb2 {
			compatible = "qcom,msm-vidc,context-bank";
			qcom,fw-context-bank;
			iommus = <&venus_smmu 0x100>,
				<&venus_smmu 0x106>;
		};

		bus_cnoc {
			compatible = "qcom,msm-vidc,bus";
@@ -202,17 +176,14 @@ Example:
			qcom,bus-governor = "msm-vidc-ddr";
			qcom,bus-range-kbps = <1000 3388000>;
		};
		qcom,profile-dec-ubwc-10bit {
			qcom,codec-mask = <0xffffffff>;
			qcom,ubwc-10bit;
			qcom,load-busfreq-tbl =
				<979200 2446336>,  /* UHD30D     */
				<864000 2108416>,  /* 720p240D   */
				<489600 1207296>,  /* 1080p60D   */
				<432000 1058816>,  /* 720p120D   */
				<244800 616448>,   /* 1080p30D   */
				<216000 534528>,   /* 720p60D    */
				<108000 271360>,   /* 720p30D    */
				<0 0>;

		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>;
		};

	};
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ msm-vidc-objs := msm_v4l2_vidc.o \
                hfi_response_handler.o \
                hfi_packetization.o \
                vidc_hfi.o \
                venus_boot.o \
                msm_vidc_clocks.o \
                msm_vidc_ar50_dyn_gov.o \
                msm_vidc_dyn_gov.o
+0 −4
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@
#include "msm_vidc_internal.h"
#include "msm_vidc_res_parse.h"
#include "msm_vidc_resources.h"
#include "venus_boot.h"
#include "vidc_hfi_api.h"
#include "msm_v4l2_private.h"
#include "msm_vidc_clocks.h"
@@ -706,9 +705,6 @@ static int msm_vidc_remove(struct platform_device *pdev)
		return -EINVAL;
	}

	if (core->resources.use_non_secure_pil)
		venus_boot_deinit();

	vidc_hfi_deinitialize(core->hfi_type, core->device);
	if (core->resources.domain_cvp) {
		device_remove_file(&core->vdev[MSM_VIDC_CVP].vdev.dev,
+5 −35
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@
#include "msm_vidc_debug.h"
#include "msm_vidc_resources.h"
#include "msm_vidc_res_parse.h"
#include "venus_boot.h"
#include "soc/qcom/secure_buffer.h"

enum clock_properties {
@@ -873,17 +872,6 @@ int read_platform_resources_from_dt(
		goto err_setup_legacy_cb;
	}

	res->use_non_secure_pil = of_property_read_bool(pdev->dev.of_node,
			"qcom,use-non-secure-pil");

	if (res->use_non_secure_pil || !is_iommu_present(res)) {
		of_property_read_u32(pdev->dev.of_node, "qcom,fw-bias",
				&firmware_base);
		res->firmware_base = (phys_addr_t)firmware_base;
		dprintk(VIDC_DBG,
				"Using fw-bias : %pa", &res->firmware_base);
	}

return rc;

err_setup_legacy_cb:
@@ -1237,30 +1225,12 @@ int read_context_bank_resources_from_dt(struct platform_device *pdev)
		return -EINVAL;
	}

	if (of_property_read_bool(pdev->dev.of_node, "qcom,fw-context-bank")) {
		if (core->resources.use_non_secure_pil) {
			struct context_bank_info *cb;

			cb = devm_kzalloc(&pdev->dev, sizeof(*cb), GFP_KERNEL);
			if (!cb) {
				dprintk(VIDC_ERR, "alloc venus cb failed\n");
				return -ENOMEM;
			}

			cb->dev = &pdev->dev;
			rc = venus_boot_init(&core->resources, cb);
			if (rc) {
				dprintk(VIDC_ERR,
				"Failed to init non-secure PIL %d\n", rc);
			}
		}
	} else {
	rc = msm_vidc_populate_context_bank(&pdev->dev, core);
	if (rc)
		dprintk(VIDC_ERR, "Failed to probe context bank\n");
	else
		dprintk(VIDC_DBG, "Successfully probed context bank\n");
	}

	return rc;
}

+0 −1
Original line number Diff line number Diff line
@@ -166,7 +166,6 @@ struct msm_vidc_platform_resources {
	struct regulator_set regulator_set;
	struct clock_set clock_set;
	struct bus_set bus_set;
	bool use_non_secure_pil;
	bool sw_power_collapsible;
	bool slave_side_cp;
	struct list_head context_banks;
Loading