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

Commit 94c9a550 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: qcom: Read command DB address/size from shared location" into msm-4.9

parents f293f508 d65a35e9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -24,10 +24,12 @@ PROPERTIES:
	Value type: <prop-encoded-array>
	Definition: First element is the base address of shared memory
		Second element is the size of the shared memory region
		Points to the dictionary address that houses the command DB
		start address and the size of the command DB region

Example:

qcom,cmd-db@861e0000 {
	compatible = "qcom,cmd-db";
	reg = <0x861e0000 0x4000>;
	reg = <0xc3f000c 0x8>;
}
+1 −1
Original line number Diff line number Diff line
@@ -2359,7 +2359,7 @@

	cmd_db: qcom,cmd-db@861e0000 {
		compatible = "qcom,cmd-db";
		reg = <0x861e0000 0x4000>;
		reg = <0xc3f000c 8>;
	};

	dcc: dcc_v2@10a2000 {
+16 −6
Original line number Diff line number Diff line
@@ -241,18 +241,28 @@ int cmd_db_get_slave_id(const char *resource_id)

static int cmd_db_dev_probe(struct platform_device *pdev)
{
	struct resource *res;
	struct resource res;
	void __iomem *dict;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res) {
	dict = of_iomap(pdev->dev.of_node, 0);
	if (!dict) {
		cmd_db_status = -ENOMEM;
		goto failed;
	}

	start_addr = devm_ioremap_resource(&pdev->dev, res);
	/*
	 * Read start address and size of the command DB address from
	 * shared dictionary location
	 */
	res.start = readl_relaxed(dict);
	res.end = res.start + readl_relaxed(dict + 0x4);
	res.flags = IORESOURCE_MEM;
	iounmap(dict);

	start_addr = devm_ioremap_resource(&pdev->dev, &res);

	cmd_db_header = devm_kzalloc(&pdev->dev, sizeof(*cmd_db_header),
			GFP_KERNEL);
	cmd_db_header = devm_kzalloc(&pdev->dev,
			sizeof(*cmd_db_header), GFP_KERNEL);

	if (!cmd_db_header) {
		cmd_db_status = -ENOMEM;