Skip to content
Open
4 changes: 4 additions & 0 deletions arch/arm64/boot/dts/qcom/hamoa-iot-som.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@
&pcie3_phy {
vdda-phy-supply = <&vreg_l3c_0p8>;
vdda-pll-supply = <&vreg_l3e_1p2>;
vdda-qref-supply = <&vreg_l3j_0p8>;

status = "okay";
};
Expand All @@ -429,6 +430,7 @@
&pcie4_phy {
vdda-phy-supply = <&vreg_l3i_0p8>;
vdda-pll-supply = <&vreg_l3e_1p2>;
vdda-qref-supply = <&vreg_l3j_0p8>;

status = "okay";
};
Expand All @@ -443,6 +445,7 @@
&pcie5_phy {
vdda-phy-supply = <&vreg_l3i_0p8>;
vdda-pll-supply = <&vreg_l3e_1p2>;
vdda-qref-supply = <&vreg_l3j_0p8>;

status = "okay";
};
Expand All @@ -457,6 +460,7 @@
&pcie6a_phy {
vdda-phy-supply = <&vreg_l1d_0p8>;
vdda-pll-supply = <&vreg_l2j_1p2>;
vdda-qref-supply = <&vreg_l3j_0p8>;

status = "okay";
};
Expand Down
9 changes: 0 additions & 9 deletions arch/arm64/boot/dts/qcom/monaco-evk-emmc.dtso
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,3 @@

status = "okay";
};

&ufs_mem_hc {
status = "disabled";
};

&vreg_l8a {
regulator-min-microvolt = <2960000>;
regulator-max-microvolt = <2960000>;
};
16 changes: 8 additions & 8 deletions arch/arm64/boot/dts/qcom/monaco.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2935,14 +2935,6 @@
#address-cells = <1>;
#size-cells = <0>;

port@0 {
reg = <0>;

swao_rep_out0: endpoint {
remote-endpoint = <&qdss_rep_in>;
};
};

port@1 {
reg = <1>;

Expand Down Expand Up @@ -3652,6 +3644,14 @@
#address-cells = <1>;
#size-cells = <0>;

port@0 {
reg = <0>;

swao_rep_out0: endpoint {
remote-endpoint = <&qdss_rep_in>;
};
};

port@1 {
reg = <1>;

Expand Down
57 changes: 57 additions & 0 deletions arch/arm64/boot/dts/qcom/talos-camera-sensor.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,63 @@
#include <dt-bindings/camera/msm-camera.h>

&cam_cci {
/* GMSL deserializer 0 - max9296a */
qcom,cam-gmsl-deserializer0 {
cell-index = <2>;
csiphy-sd-index = <1>;
sensor-position-roll = <0>;
sensor-position-pitch = <0>;
sensor-position-yaw = <180>;
cam_vio-supply = <&vreg_s4a>;
regulator-names = "cam_vio";
power-domains = <&camcc TITAN_TOP_GDSC>;
rgltr-cntrl-support;
pwm-switch;
rgltr-min-voltage = <1800000>;
rgltr-max-voltage = <1800000>;
rgltr-load-current = <120000>;
gpio-no-mux = <0>;
pinctrl-names = "cam_default", "cam_suspend";
pinctrl-0 = <&cam_sensor_mclk2_active>;
pinctrl-1 = <&cam_sensor_mclk2_suspend>;
gpios = <&tlmm 29 0>;
gpio-reset = <0>;
gpio-req-tbl-num = <0>;
gpio-req-tbl-flags = <0>;
gpio-req-tbl-label = "CAM_RESET0";
cci-master = <1>;
clocks = <&camcc CAM_CC_MCLK0_CLK>;
clock-names = "cam_clk";
clock-cntl-level = "nominal";
clock-rates = <24000000>;
status = "ok";

ranges;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
deser0_port0: endpoint {
remote-endpoint = <&gmsl_sensor0_ep>;
};
};
};

/* GMSL deserializer 0 sensor 0 */
qcom,cam-gmsl-sensor0 {
cell-index = <3>;
compatible = "qcom,cam-gmsl-sensor";

csiphy-sd-index = <1>;
status = "ok";

ranges;
port {
gmsl_sensor0_ep: endpoint {
remote-endpoint = <&deser0_port0>;
};
};
};
/*cam0-imx577*/
tl_slot0: qcom,cam-sensor0 {
compatible = "qcom,cam-sensor";
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/configs/qcom.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ CONFIG_GUNYAH_WATCHDOG=y
CONFIG_I6300ESB_WDT=y
CONFIG_IDLE_INJECT=y
CONFIG_INPUT_UINPUT=y
CONFIG_IXGBE=m
CONFIG_IXGBEVF=m
CONFIG_KPROBES=y
CONFIG_MACVLAN=y
CONFIG_MACVTAP=y
Expand Down
136 changes: 114 additions & 22 deletions drivers/misc/fastrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/slab.h>
#include <linux/firmware/qcom/qcom_scm.h>
#include <uapi/misc/fastrpc.h>
#include <linux/iommu.h>
#include <linux/of_reserved_mem.h>
#include <linux/bitops.h>
#include <linux/compiler.h>
Expand Down Expand Up @@ -300,6 +301,8 @@ struct fastrpc_channel_ctx {
struct fastrpc_buf *remote_heap;
bool secure;
bool unsigned_support;
/* set when remoteproc has an IOMMU; use iommu_map instead of hyp_assign */
bool has_iommu;
bool poll_mode_supported;
u64 dma_mask;
};
Expand Down Expand Up @@ -2538,10 +2541,65 @@ static const char *const fastrpc_poll_supported_machines[] = {
"qcom,x1e80100", "qcom,x1p42100", NULL,
};

static int fastrpc_remote_heap_map(struct device *rdev,
struct device_node *rproc_node,
struct fastrpc_buf *heap)
{
struct platform_device *rproc_pdev;
struct iommu_domain *domain;
int ret;

rproc_pdev = of_find_device_by_node(rproc_node);
if (!rproc_pdev) {
dev_err(rdev, "failed to find remoteproc platform device\n");
return -ENODEV;
}

domain = iommu_get_domain_for_dev(&rproc_pdev->dev);
if (!domain) {
put_device(&rproc_pdev->dev);
dev_err(rdev, "no IOMMU domain for remoteproc\n");
return -ENODEV;
}

ret = iommu_map(domain, heap->phys, heap->phys, heap->size,
IOMMU_READ | IOMMU_WRITE, GFP_KERNEL);
if (ret)
dev_err(rdev, "failed to map remote heap phys=0x%llx size=0x%llx err=%d\n",
heap->phys, heap->size, ret);

put_device(&rproc_pdev->dev);
return ret;
}

static void fastrpc_remote_heap_unmap(struct rpmsg_device *rpdev,
struct fastrpc_buf *heap)
{
struct device_node *rproc_node;
struct platform_device *rproc_pdev;
struct iommu_domain *domain;

rproc_node = of_get_parent(of_get_parent(rpdev->dev.of_node));
if (!rproc_node)
return;

rproc_pdev = of_find_device_by_node(rproc_node);
of_node_put(rproc_node);
if (!rproc_pdev)
return;

domain = iommu_get_domain_for_dev(&rproc_pdev->dev);
if (domain)
iommu_unmap(domain, heap->phys, heap->size);

put_device(&rproc_pdev->dev);
}

static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
{
struct device *rdev = &rpdev->dev;
struct fastrpc_channel_ctx *data;
struct device_node *rproc_node;
int i, err, domain_id = -1, vmcount;
const char *domain;
bool secure_dsp;
Expand Down Expand Up @@ -2582,30 +2640,55 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
}
}

rproc_node = of_get_parent(of_get_parent(rdev->of_node));
if (rproc_node)
data->has_iommu = of_property_present(rproc_node, "iommus");

if (domain_id == SDSP_DOMAIN_ID || domain_id == ADSP_DOMAIN_ID) {
struct resource res;
u64 src_perms;

err = of_reserved_mem_region_to_resource(rdev->of_node, 0, &res);
if (!err) {
if (domain_id == ADSP_DOMAIN_ID) {
data->remote_heap =
kzalloc(sizeof(*data->remote_heap), GFP_KERNEL);
if (!data->remote_heap)
return -ENOMEM;
if (!data->remote_heap) {
err = -ENOMEM;
goto err_put_node;
}

data->remote_heap->phys = res.start;
data->remote_heap->size = resource_size(&res);

if (data->has_iommu) {
err = fastrpc_remote_heap_map(rdev,
rproc_node,
data->remote_heap);
if (err) {
kfree(data->remote_heap);
data->remote_heap = NULL;
goto err_put_node;
}
}
}
src_perms = BIT(QCOM_SCM_VMID_HLOS);

err = qcom_scm_assign_mem(res.start, resource_size(&res), &src_perms,
data->vmperms, data->vmcount);
if (err)
goto err_free_data;
if (!data->has_iommu) {
u64 src_perms = BIT(QCOM_SCM_VMID_HLOS);

err = qcom_scm_assign_mem(res.start,
resource_size(&res),
&src_perms,
data->vmperms,
data->vmcount);
if (err)
goto err_put_node;
}
}
}

of_node_put(rproc_node);
rproc_node = NULL;

secure_dsp = !(of_property_read_bool(rdev->of_node, "qcom,non-secure-domain"));
data->secure = secure_dsp;

Expand Down Expand Up @@ -2662,6 +2745,9 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
if (data->secure_fdevice)
misc_deregister(&data->secure_fdevice->miscdev);

err_put_node:
of_node_put(rproc_node);

err_free_data:
kfree(data);
return err;
Expand Down Expand Up @@ -2703,21 +2789,27 @@ static void fastrpc_rpmsg_remove(struct rpmsg_device *rpdev)
if (cctx->secure_fdevice)
misc_deregister(&cctx->secure_fdevice->miscdev);

if (cctx->remote_heap && cctx->vmcount) {
u64 src_perms = 0;
struct qcom_scm_vmperm dst_perms;

for (u32 i = 0; i < cctx->vmcount; i++)
src_perms |= BIT(cctx->vmperms[i].vmid);

dst_perms.vmid = QCOM_SCM_VMID_HLOS;
dst_perms.perm = QCOM_SCM_PERM_RWX;

err = qcom_scm_assign_mem(cctx->remote_heap->phys,
cctx->remote_heap->size, &src_perms,
&dst_perms, 1);
if (!err)
if (cctx->remote_heap) {
if (cctx->has_iommu) {
fastrpc_remote_heap_unmap(rpdev, cctx->remote_heap);
kfree(cctx->remote_heap);
cctx->remote_heap = NULL;
} else if (cctx->vmcount) {
u64 src_perms = 0;
struct qcom_scm_vmperm dst_perms;

for (u32 i = 0; i < cctx->vmcount; i++)
src_perms |= BIT(cctx->vmperms[i].vmid);

dst_perms.vmid = QCOM_SCM_VMID_HLOS;
dst_perms.perm = QCOM_SCM_PERM_RWX;

err = qcom_scm_assign_mem(cctx->remote_heap->phys,
cctx->remote_heap->size,
&src_perms, &dst_perms, 1);
if (!err)
kfree(cctx->remote_heap);
}
}

of_platform_depopulate(&rpdev->dev);
Expand Down
18 changes: 0 additions & 18 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,23 +740,6 @@ static void ethqos_clks_disable(void *data)
ethqos_clks_config(data, false);
}

static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv)
{
struct plat_stmmacenet_data *plat_dat = priv->plat;
int err;

if (!plat_dat->clk_ptp_ref)
return;

/* Max the PTP ref clock out to get the best resolution possible */
err = clk_set_rate(plat_dat->clk_ptp_ref, ULONG_MAX);
if (err)
netdev_err(priv->dev, "Failed to max out clk_ptp_ref: %d\n", err);
plat_dat->clk_ptp_rate = clk_get_rate(plat_dat->clk_ptp_ref);

netdev_dbg(priv->dev, "PTP rate %lu\n", plat_dat->clk_ptp_rate);
}

static int qcom_ethqos_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
Expand Down Expand Up @@ -849,7 +832,6 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
plat_dat->bsp_priv = ethqos;
plat_dat->fix_mac_speed = ethqos_fix_mac_speed;
plat_dat->dump_debug_regs = rgmii_dump;
plat_dat->ptp_clk_freq_config = ethqos_ptp_clk_freq_config;
plat_dat->core_type = DWMAC_CORE_GMAC4;
if (ethqos->has_emac_ge_3)
plat_dat->dwmac4_addrs = &data->dwmac4_addrs;
Expand Down
Loading