Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
538b0ba2
Commit
538b0ba2
authored
Jan 10, 2023
by
Bjorn Andersson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '20230109130523.298971-3-konrad.dybcio@linaro.org' into drivers-for-6.3
parents
5b8db5b4
45ca30eb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
13 deletions
+44
-13
Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
...n/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
+4
-2
drivers/soc/qcom/rmtfs_mem.c
drivers/soc/qcom/rmtfs_mem.c
+22
-7
include/dt-bindings/firmware/qcom,scm.h
include/dt-bindings/firmware/qcom,scm.h
+16
-0
include/linux/qcom_scm.h
include/linux/qcom_scm.h
+2
-4
No files found.
Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
View file @
538b0ba2
...
...
@@ -27,9 +27,11 @@ properties:
identifier of the client to use this region for buffers
qcom,vmid
:
$ref
:
/schemas/types.yaml#/definitions/uint32
$ref
:
/schemas/types.yaml#/definitions/uint32
-array
description
:
>
vmid of the remote processor, to set up memory protection
Array of vmids of the remote processors, to set up memory protection
minItems
:
1
maxItems
:
2
required
:
-
qcom,client-id
...
...
drivers/soc/qcom/rmtfs_mem.c
View file @
538b0ba2
...
...
@@ -17,6 +17,7 @@
#include <linux/qcom_scm.h>
#define QCOM_RMTFS_MEM_DEV_MAX (MINORMASK + 1)
#define NUM_MAX_VMIDS 2
static
dev_t
qcom_rmtfs_mem_major
;
...
...
@@ -171,12 +172,12 @@ static void qcom_rmtfs_mem_release_device(struct device *dev)
static
int
qcom_rmtfs_mem_probe
(
struct
platform_device
*
pdev
)
{
struct
device_node
*
node
=
pdev
->
dev
.
of_node
;
struct
qcom_scm_vmperm
perms
[
2
];
struct
qcom_scm_vmperm
perms
[
NUM_MAX_VMIDS
+
1
];
struct
reserved_mem
*
rmem
;
struct
qcom_rmtfs_mem
*
rmtfs_mem
;
u32
client_id
;
u32
vmid
;
int
ret
;
u32
num_vmids
,
vmid
[
NUM_MAX_VMIDS
]
;
int
ret
,
i
;
rmem
=
of_reserved_mem_lookup
(
node
);
if
(
!
rmem
)
{
...
...
@@ -226,7 +227,18 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
goto
put_device
;
}
ret
=
of_property_read_u32
(
node
,
"qcom,vmid"
,
&
vmid
);
num_vmids
=
of_property_count_u32_elems
(
node
,
"qcom,vmid"
);
if
(
num_vmids
<
0
)
{
dev_err
(
&
pdev
->
dev
,
"failed to count qcom,vmid elements: %d
\n
"
,
ret
);
goto
remove_cdev
;
}
else
if
(
num_vmids
>
NUM_MAX_VMIDS
)
{
dev_warn
(
&
pdev
->
dev
,
"too many VMIDs (%d) specified! Only mapping first %d entries
\n
"
,
num_vmids
,
NUM_MAX_VMIDS
);
num_vmids
=
NUM_MAX_VMIDS
;
}
ret
=
of_property_read_u32_array
(
node
,
"qcom,vmid"
,
vmid
,
num_vmids
);
if
(
ret
<
0
&&
ret
!=
-
EINVAL
)
{
dev_err
(
&
pdev
->
dev
,
"failed to parse qcom,vmid
\n
"
);
goto
remove_cdev
;
...
...
@@ -238,12 +250,15 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
perms
[
0
].
vmid
=
QCOM_SCM_VMID_HLOS
;
perms
[
0
].
perm
=
QCOM_SCM_PERM_RW
;
perms
[
1
].
vmid
=
vmid
;
perms
[
1
].
perm
=
QCOM_SCM_PERM_RW
;
for
(
i
=
0
;
i
<
num_vmids
;
i
++
)
{
perms
[
i
+
1
].
vmid
=
vmid
[
i
];
perms
[
i
+
1
].
perm
=
QCOM_SCM_PERM_RW
;
}
rmtfs_mem
->
perms
=
BIT
(
QCOM_SCM_VMID_HLOS
);
ret
=
qcom_scm_assign_mem
(
rmtfs_mem
->
addr
,
rmtfs_mem
->
size
,
&
rmtfs_mem
->
perms
,
perms
,
2
);
&
rmtfs_mem
->
perms
,
perms
,
num_vmids
+
1
);
if
(
ret
<
0
)
{
dev_err
(
&
pdev
->
dev
,
"assign memory failed
\n
"
);
goto
remove_cdev
;
...
...
include/dt-bindings/firmware/qcom,scm.h
0 → 100644
View file @
538b0ba2
/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
/*
* Copyright (c) 2010-2015, 2018-2019 The Linux Foundation. All rights reserved.
* Copyright (C) 2015 Linaro Ltd.
*/
#ifndef _DT_BINDINGS_FIRMWARE_QCOM_SCM_H
#define _DT_BINDINGS_FIRMWARE_QCOM_SCM_H
#define QCOM_SCM_VMID_HLOS 0x3
#define QCOM_SCM_VMID_MSS_MSA 0xF
#define QCOM_SCM_VMID_WLAN 0x18
#define QCOM_SCM_VMID_WLAN_CE 0x19
#define QCOM_SCM_VMID_NAV 0x2B
#endif
include/linux/qcom_scm.h
View file @
538b0ba2
...
...
@@ -9,6 +9,8 @@
#include <linux/types.h>
#include <linux/cpumask.h>
#include <dt-bindings/firmware/qcom,scm.h>
#define QCOM_SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF))
#define QCOM_SCM_CPU_PWR_DOWN_L2_ON 0x0
#define QCOM_SCM_CPU_PWR_DOWN_L2_OFF 0x1
...
...
@@ -51,10 +53,6 @@ enum qcom_scm_ice_cipher {
QCOM_SCM_ICE_CIPHER_AES_256_CBC
=
4
,
};
#define QCOM_SCM_VMID_HLOS 0x3
#define QCOM_SCM_VMID_MSS_MSA 0xF
#define QCOM_SCM_VMID_WLAN 0x18
#define QCOM_SCM_VMID_WLAN_CE 0x19
#define QCOM_SCM_PERM_READ 0x4
#define QCOM_SCM_PERM_WRITE 0x2
#define QCOM_SCM_PERM_EXEC 0x1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment