Re: [Patch v1 01/10] memory: tegra: add interconnect support for DRAM scaling in Tegra234

From: Sumit Gupta
Date: Fri Jan 13 2023 - 07:29:30 EST




On 21/12/22 22:24, Dmitry Osipenko wrote:
External email: Use caution opening links or attachments


20.12.2022 19:02, Sumit Gupta пишет:
static int tegra186_emc_probe(struct platform_device *pdev)
{
struct mrq_emc_dvfs_latency_response response;
struct tegra_bpmp_message msg;
struct tegra186_emc *emc;
+ struct tegra_mc *mc;
unsigned int i;
int err;

@@ -158,6 +307,9 @@ static int tegra186_emc_probe(struct platform_device *pdev)
if (!emc)
return -ENOMEM;

+ platform_set_drvdata(pdev, emc);
+ emc->dev = &pdev->dev;
+
emc->bpmp = tegra_bpmp_get(&pdev->dev);
if (IS_ERR(emc->bpmp))
return dev_err_probe(&pdev->dev, PTR_ERR(emc->bpmp), "failed to get BPMP\n");
@@ -236,6 +388,19 @@ static int tegra186_emc_probe(struct platform_device *pdev)
debugfs_create_file("max_rate", S_IRUGO | S_IWUSR, emc->debugfs.root,
emc, &tegra186_emc_debug_max_rate_fops);

+ mc = dev_get_drvdata(emc->dev->parent);
+ if (mc && mc->soc->icc_ops) {
+ if (tegra_bpmp_mrq_is_supported(emc->bpmp, MRQ_BWMGR_INT)) {
+ err = tegra_emc_interconnect_init(emc);
+ if (!err)
+ return err;
+ dev_err(&pdev->dev, "tegra_emc_interconnect_init failed:%d\n", err);
+ goto put_bpmp;
+ } else {
+ dev_info(&pdev->dev, "MRQ_BWMGR_INT not present\n");
+ }

If there is no MRQ_BWMGR_INT, then device drivers using ICC won't probe.
This is either a error condition, or ICC should inited and then ICC
changes should be skipped.


If the MRQ_BW_MGR is not supported by a BPMP-FW binary, then the MC & EMC drivers will still probe successfully and scaling will be disabled.