Skip to content

Commit 88c1e94

Browse files
masneybrobclark
authored andcommitted
soc: qcom: add OCMEM driver
The OCMEM driver handles allocation and configuration of the On Chip MEMory that is present on some Snapdragon SoCs. Devices which have OCMEM do not have GMEM inside the GPU core, so the GPU must instead use OCMEM to be functional. Since the GPU is currently the only OCMEM user with an upstream driver, this is just a minimal implementation sufficient for statically allocating to the GPU it's chunk of OCMEM. This driver currently does not read the gmu-sram node that is described in the device tree bindings. The starting memory address of the GPU's reserved memory region is hardcoded to zero to match what the hardware expects. The driver can be updated to read the reserved memory regions from device tree once other users of OCMEM are added upstream. Signed-off-by: Brian Masney <masneyb@onstation.org> Co-developed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Tested-by: Gabriel Francisco <frc.gabrielgmail.com> Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent 0434a40 commit 88c1e94

4 files changed

Lines changed: 506 additions & 0 deletions

File tree

‎drivers/soc/qcom/Kconfig‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ config QCOM_MDT_LOADER
7474
tristate
7575
select QCOM_SCM
7676

77+
config QCOM_OCMEM
78+
tristate "Qualcomm On Chip Memory (OCMEM) driver"
79+
depends on ARCH_QCOM
80+
select QCOM_SCM
81+
help
82+
The On Chip Memory (OCMEM) allocator allows various clients to
83+
allocate memory from OCMEM based on performance, latency and power
84+
requirements. This is typically used by the GPU, camera/video, and
85+
audio components on some Snapdragon SoCs.
86+
7787
config QCOM_PM
7888
bool "Qualcomm Power Management"
7989
depends on ARCH_QCOM && !ARM64

‎drivers/soc/qcom/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ obj-$(CONFIG_QCOM_COMMAND_DB) += cmd-db.o
66
obj-$(CONFIG_QCOM_GLINK_SSR) += glink_ssr.o
77
obj-$(CONFIG_QCOM_GSBI) += qcom_gsbi.o
88
obj-$(CONFIG_QCOM_MDT_LOADER) += mdt_loader.o
9+
obj-$(CONFIG_QCOM_OCMEM) += ocmem.o
910
obj-$(CONFIG_QCOM_PM) += spm.o
1011
obj-$(CONFIG_QCOM_QMI_HELPERS) += qmi_helpers.o
1112
qmi_helpers-y += qmi_encdec.o qmi_interface.o

0 commit comments

Comments
 (0)