Lines Matching +full:tegra186 +full:- +full:mc
1 // SPDX-License-Identifier: GPL-2.0-only
8 #include <linux/dma-mapping.h>
18 #include <linux/tegra-icc.h>
22 #include "mc.h"
26 { .compatible = "nvidia,tegra20-mc-gart", .data = &tegra20_mc_soc },
29 { .compatible = "nvidia,tegra30-mc", .data = &tegra30_mc_soc },
32 { .compatible = "nvidia,tegra114-mc", .data = &tegra114_mc_soc },
35 { .compatible = "nvidia,tegra124-mc", .data = &tegra124_mc_soc },
38 { .compatible = "nvidia,tegra132-mc", .data = &tegra132_mc_soc },
41 { .compatible = "nvidia,tegra210-mc", .data = &tegra210_mc_soc },
44 { .compatible = "nvidia,tegra186-mc", .data = &tegra186_mc_soc },
47 { .compatible = "nvidia,tegra194-mc", .data = &tegra194_mc_soc },
50 { .compatible = "nvidia,tegra234-mc", .data = &tegra234_mc_soc },
58 struct tegra_mc *mc = data; in tegra_mc_devm_action_put_device() local
60 put_device(mc->dev); in tegra_mc_devm_action_put_device()
64 * devm_tegra_memory_controller_get() - get Tegra Memory Controller handle
67 * This function will search for the Memory Controller node in a device-tree
76 struct tegra_mc *mc; in devm_tegra_memory_controller_get() local
79 np = of_parse_phandle(dev->of_node, "nvidia,memory-controller", 0); in devm_tegra_memory_controller_get()
81 return ERR_PTR(-ENOENT); in devm_tegra_memory_controller_get()
86 return ERR_PTR(-ENODEV); in devm_tegra_memory_controller_get()
88 mc = platform_get_drvdata(pdev); in devm_tegra_memory_controller_get()
89 if (!mc) { in devm_tegra_memory_controller_get()
90 put_device(&pdev->dev); in devm_tegra_memory_controller_get()
91 return ERR_PTR(-EPROBE_DEFER); in devm_tegra_memory_controller_get()
94 err = devm_add_action_or_reset(dev, tegra_mc_devm_action_put_device, mc); in devm_tegra_memory_controller_get()
98 return mc; in devm_tegra_memory_controller_get()
102 int tegra_mc_probe_device(struct tegra_mc *mc, struct device *dev) in tegra_mc_probe_device() argument
104 if (mc->soc->ops && mc->soc->ops->probe_device) in tegra_mc_probe_device()
105 return mc->soc->ops->probe_device(mc, dev); in tegra_mc_probe_device()
111 int tegra_mc_get_carveout_info(struct tegra_mc *mc, unsigned int id, in tegra_mc_get_carveout_info() argument
116 if (id < 1 || id >= mc->soc->num_carveouts) in tegra_mc_get_carveout_info()
117 return -EINVAL; in tegra_mc_get_carveout_info()
120 offset = 0xc0c + 0x50 * (id - 1); in tegra_mc_get_carveout_info()
122 offset = 0x2004 + 0x50 * (id - 6); in tegra_mc_get_carveout_info()
124 *base = mc_ch_readl(mc, MC_BROADCAST_CHANNEL, offset + 0x0); in tegra_mc_get_carveout_info()
126 *base |= (phys_addr_t)mc_ch_readl(mc, MC_BROADCAST_CHANNEL, offset + 0x4) << 32; in tegra_mc_get_carveout_info()
130 *size = mc_ch_readl(mc, MC_BROADCAST_CHANNEL, offset + 0x8) << 17; in tegra_mc_get_carveout_info()
136 static int tegra_mc_block_dma_common(struct tegra_mc *mc, in tegra_mc_block_dma_common() argument
142 spin_lock_irqsave(&mc->lock, flags); in tegra_mc_block_dma_common()
144 value = mc_readl(mc, rst->control) | BIT(rst->bit); in tegra_mc_block_dma_common()
145 mc_writel(mc, value, rst->control); in tegra_mc_block_dma_common()
147 spin_unlock_irqrestore(&mc->lock, flags); in tegra_mc_block_dma_common()
152 static bool tegra_mc_dma_idling_common(struct tegra_mc *mc, in tegra_mc_dma_idling_common() argument
155 return (mc_readl(mc, rst->status) & BIT(rst->bit)) != 0; in tegra_mc_dma_idling_common()
158 static int tegra_mc_unblock_dma_common(struct tegra_mc *mc, in tegra_mc_unblock_dma_common() argument
164 spin_lock_irqsave(&mc->lock, flags); in tegra_mc_unblock_dma_common()
166 value = mc_readl(mc, rst->control) & ~BIT(rst->bit); in tegra_mc_unblock_dma_common()
167 mc_writel(mc, value, rst->control); in tegra_mc_unblock_dma_common()
169 spin_unlock_irqrestore(&mc->lock, flags); in tegra_mc_unblock_dma_common()
174 static int tegra_mc_reset_status_common(struct tegra_mc *mc, in tegra_mc_reset_status_common() argument
177 return (mc_readl(mc, rst->control) & BIT(rst->bit)) != 0; in tegra_mc_reset_status_common()
192 static const struct tegra_mc_reset *tegra_mc_reset_find(struct tegra_mc *mc, in tegra_mc_reset_find() argument
197 for (i = 0; i < mc->soc->num_resets; i++) in tegra_mc_reset_find()
198 if (mc->soc->resets[i].id == id) in tegra_mc_reset_find()
199 return &mc->soc->resets[i]; in tegra_mc_reset_find()
207 struct tegra_mc *mc = reset_to_mc(rcdev); in tegra_mc_hotreset_assert() local
213 rst = tegra_mc_reset_find(mc, id); in tegra_mc_hotreset_assert()
215 return -ENODEV; in tegra_mc_hotreset_assert()
217 rst_ops = mc->soc->reset_ops; in tegra_mc_hotreset_assert()
219 return -ENODEV; in tegra_mc_hotreset_assert()
222 if (rst_ops->reset_status) { in tegra_mc_hotreset_assert()
224 if (rst_ops->reset_status(mc, rst)) in tegra_mc_hotreset_assert()
228 if (rst_ops->block_dma) { in tegra_mc_hotreset_assert()
230 err = rst_ops->block_dma(mc, rst); in tegra_mc_hotreset_assert()
232 dev_err(mc->dev, "failed to block %s DMA: %d\n", in tegra_mc_hotreset_assert()
233 rst->name, err); in tegra_mc_hotreset_assert()
238 if (rst_ops->dma_idling) { in tegra_mc_hotreset_assert()
240 while (!rst_ops->dma_idling(mc, rst)) { in tegra_mc_hotreset_assert()
241 if (!retries--) { in tegra_mc_hotreset_assert()
242 dev_err(mc->dev, "failed to flush %s DMA\n", in tegra_mc_hotreset_assert()
243 rst->name); in tegra_mc_hotreset_assert()
244 return -EBUSY; in tegra_mc_hotreset_assert()
251 if (rst_ops->hotreset_assert) { in tegra_mc_hotreset_assert()
253 err = rst_ops->hotreset_assert(mc, rst); in tegra_mc_hotreset_assert()
255 dev_err(mc->dev, "failed to hot reset %s: %d\n", in tegra_mc_hotreset_assert()
256 rst->name, err); in tegra_mc_hotreset_assert()
267 struct tegra_mc *mc = reset_to_mc(rcdev); in tegra_mc_hotreset_deassert() local
272 rst = tegra_mc_reset_find(mc, id); in tegra_mc_hotreset_deassert()
274 return -ENODEV; in tegra_mc_hotreset_deassert()
276 rst_ops = mc->soc->reset_ops; in tegra_mc_hotreset_deassert()
278 return -ENODEV; in tegra_mc_hotreset_deassert()
280 if (rst_ops->hotreset_deassert) { in tegra_mc_hotreset_deassert()
282 err = rst_ops->hotreset_deassert(mc, rst); in tegra_mc_hotreset_deassert()
284 dev_err(mc->dev, "failed to deassert hot reset %s: %d\n", in tegra_mc_hotreset_deassert()
285 rst->name, err); in tegra_mc_hotreset_deassert()
290 if (rst_ops->unblock_dma) { in tegra_mc_hotreset_deassert()
292 err = rst_ops->unblock_dma(mc, rst); in tegra_mc_hotreset_deassert()
294 dev_err(mc->dev, "failed to unblock %s DMA : %d\n", in tegra_mc_hotreset_deassert()
295 rst->name, err); in tegra_mc_hotreset_deassert()
306 struct tegra_mc *mc = reset_to_mc(rcdev); in tegra_mc_hotreset_status() local
310 rst = tegra_mc_reset_find(mc, id); in tegra_mc_hotreset_status()
312 return -ENODEV; in tegra_mc_hotreset_status()
314 rst_ops = mc->soc->reset_ops; in tegra_mc_hotreset_status()
316 return -ENODEV; in tegra_mc_hotreset_status()
318 return rst_ops->reset_status(mc, rst); in tegra_mc_hotreset_status()
327 static int tegra_mc_reset_setup(struct tegra_mc *mc) in tegra_mc_reset_setup() argument
331 mc->reset.ops = &tegra_mc_reset_ops; in tegra_mc_reset_setup()
332 mc->reset.owner = THIS_MODULE; in tegra_mc_reset_setup()
333 mc->reset.of_node = mc->dev->of_node; in tegra_mc_reset_setup()
334 mc->reset.of_reset_n_cells = 1; in tegra_mc_reset_setup()
335 mc->reset.nr_resets = mc->soc->num_resets; in tegra_mc_reset_setup()
337 err = reset_controller_register(&mc->reset); in tegra_mc_reset_setup()
344 int tegra_mc_write_emem_configuration(struct tegra_mc *mc, unsigned long rate) in tegra_mc_write_emem_configuration() argument
349 for (i = 0; i < mc->num_timings; i++) { in tegra_mc_write_emem_configuration()
350 if (mc->timings[i].rate == rate) { in tegra_mc_write_emem_configuration()
351 timing = &mc->timings[i]; in tegra_mc_write_emem_configuration()
357 dev_err(mc->dev, "no memory timing registered for rate %lu\n", in tegra_mc_write_emem_configuration()
359 return -EINVAL; in tegra_mc_write_emem_configuration()
362 for (i = 0; i < mc->soc->num_emem_regs; ++i) in tegra_mc_write_emem_configuration()
363 mc_writel(mc, timing->emem_data[i], mc->soc->emem_regs[i]); in tegra_mc_write_emem_configuration()
369 unsigned int tegra_mc_get_emem_device_count(struct tegra_mc *mc) in tegra_mc_get_emem_device_count() argument
373 dram_count = mc_readl(mc, MC_EMEM_ADR_CFG); in tegra_mc_get_emem_device_count()
386 static int tegra_mc_setup_latency_allowance(struct tegra_mc *mc) in tegra_mc_setup_latency_allowance() argument
392 /* compute the number of MC clock cycles per tick */ in tegra_mc_setup_latency_allowance()
393 tick = (unsigned long long)mc->tick * clk_get_rate(mc->clk); in tegra_mc_setup_latency_allowance()
396 value = mc_readl(mc, MC_EMEM_ARB_CFG); in tegra_mc_setup_latency_allowance()
399 mc_writel(mc, value, MC_EMEM_ARB_CFG); in tegra_mc_setup_latency_allowance()
402 for (i = 0; i < mc->soc->num_clients; i++) { in tegra_mc_setup_latency_allowance()
403 const struct tegra_mc_client *client = &mc->soc->clients[i]; in tegra_mc_setup_latency_allowance()
406 value = mc_readl(mc, client->regs.la.reg); in tegra_mc_setup_latency_allowance()
407 value &= ~(client->regs.la.mask << client->regs.la.shift); in tegra_mc_setup_latency_allowance()
408 value |= (client->regs.la.def & client->regs.la.mask) << client->regs.la.shift; in tegra_mc_setup_latency_allowance()
409 mc_writel(mc, value, client->regs.la.reg); in tegra_mc_setup_latency_allowance()
413 mc_writel(mc, MC_TIMING_UPDATE, MC_TIMING_CONTROL); in tegra_mc_setup_latency_allowance()
418 static int load_one_timing(struct tegra_mc *mc, in load_one_timing() argument
425 err = of_property_read_u32(node, "clock-frequency", &tmp); in load_one_timing()
427 dev_err(mc->dev, in load_one_timing()
432 timing->rate = tmp; in load_one_timing()
433 timing->emem_data = devm_kcalloc(mc->dev, mc->soc->num_emem_regs, in load_one_timing()
435 if (!timing->emem_data) in load_one_timing()
436 return -ENOMEM; in load_one_timing()
438 err = of_property_read_u32_array(node, "nvidia,emem-configuration", in load_one_timing()
439 timing->emem_data, in load_one_timing()
440 mc->soc->num_emem_regs); in load_one_timing()
442 dev_err(mc->dev, in load_one_timing()
451 static int load_timings(struct tegra_mc *mc, struct device_node *node) in load_timings() argument
458 mc->timings = devm_kcalloc(mc->dev, child_count, sizeof(*timing), in load_timings()
460 if (!mc->timings) in load_timings()
461 return -ENOMEM; in load_timings()
463 mc->num_timings = child_count; in load_timings()
466 timing = &mc->timings[i++]; in load_timings()
468 err = load_one_timing(mc, timing, child); in load_timings()
478 static int tegra_mc_setup_timings(struct tegra_mc *mc) in tegra_mc_setup_timings() argument
486 mc->num_timings = 0; in tegra_mc_setup_timings()
488 for_each_child_of_node(mc->dev->of_node, node) { in tegra_mc_setup_timings()
489 err = of_property_read_u32(node, "nvidia,ram-code", in tegra_mc_setup_timings()
494 err = load_timings(mc, node); in tegra_mc_setup_timings()
501 if (mc->num_timings == 0) in tegra_mc_setup_timings()
502 dev_warn(mc->dev, in tegra_mc_setup_timings()
509 int tegra30_mc_probe(struct tegra_mc *mc) in tegra30_mc_probe() argument
513 mc->clk = devm_clk_get_optional(mc->dev, "mc"); in tegra30_mc_probe()
514 if (IS_ERR(mc->clk)) { in tegra30_mc_probe()
515 dev_err(mc->dev, "failed to get MC clock: %ld\n", PTR_ERR(mc->clk)); in tegra30_mc_probe()
516 return PTR_ERR(mc->clk); in tegra30_mc_probe()
520 mc_writel(mc, 0x00000000, MC_TIMING_CONTROL_DBG); in tegra30_mc_probe()
522 err = tegra_mc_setup_latency_allowance(mc); in tegra30_mc_probe()
524 dev_err(mc->dev, "failed to setup latency allowance: %d\n", err); in tegra30_mc_probe()
528 err = tegra_mc_setup_timings(mc); in tegra30_mc_probe()
530 dev_err(mc->dev, "failed to setup timings: %d\n", err); in tegra30_mc_probe()
543 static int mc_global_intstatus_to_channel(const struct tegra_mc *mc, u32 status, in mc_global_intstatus_to_channel() argument
546 if ((status & mc->soc->ch_intmask) == 0) in mc_global_intstatus_to_channel()
547 return -EINVAL; in mc_global_intstatus_to_channel()
549 *mc_channel = __ffs((status & mc->soc->ch_intmask) >> in mc_global_intstatus_to_channel()
550 mc->soc->global_intstatus_channel_shift); in mc_global_intstatus_to_channel()
555 static u32 mc_channel_to_global_intstatus(const struct tegra_mc *mc, in mc_channel_to_global_intstatus() argument
558 return BIT(channel) << mc->soc->global_intstatus_channel_shift; in mc_channel_to_global_intstatus()
563 struct tegra_mc *mc = data; in tegra30_mc_handle_irq() local
567 if (mc->soc->num_channels) { in tegra30_mc_handle_irq()
571 global_status = mc_ch_readl(mc, MC_BROADCAST_CHANNEL, MC_GLOBAL_INTSTATUS); in tegra30_mc_handle_irq()
572 err = mc_global_intstatus_to_channel(mc, global_status, &channel); in tegra30_mc_handle_irq()
574 dev_err_ratelimited(mc->dev, "unknown interrupt channel 0x%08x\n", in tegra30_mc_handle_irq()
580 status = mc_ch_readl(mc, channel, MC_INTSTATUS) & mc->soc->intmask; in tegra30_mc_handle_irq()
582 status = mc_readl(mc, MC_INTSTATUS) & mc->soc->intmask; in tegra30_mc_handle_irq()
634 if (mc->soc->has_addr_hi_reg) in tegra30_mc_handle_irq()
640 if (mc->soc->num_channels) in tegra30_mc_handle_irq()
641 value = mc_ch_readl(mc, channel, status_reg); in tegra30_mc_handle_irq()
643 value = mc_readl(mc, status_reg); in tegra30_mc_handle_irq()
646 if (mc->soc->num_address_bits > 32) { in tegra30_mc_handle_irq()
648 if (mc->soc->num_channels) in tegra30_mc_handle_irq()
649 addr = mc_ch_readl(mc, channel, addr_hi_reg); in tegra30_mc_handle_irq()
651 addr = mc_readl(mc, addr_hi_reg); in tegra30_mc_handle_irq()
670 id = value & mc->soc->client_id_mask; in tegra30_mc_handle_irq()
672 for (i = 0; i < mc->soc->num_clients; i++) { in tegra30_mc_handle_irq()
673 if (mc->soc->clients[i].id == id) { in tegra30_mc_handle_irq()
674 client = mc->soc->clients[i].name; in tegra30_mc_handle_irq()
691 perm[2] = '-'; in tegra30_mc_handle_irq()
696 perm[3] = '-'; in tegra30_mc_handle_irq()
699 perm[4] = '-'; in tegra30_mc_handle_irq()
712 if (mc->soc->num_channels) in tegra30_mc_handle_irq()
713 value = mc_ch_readl(mc, channel, addr_reg); in tegra30_mc_handle_irq()
715 value = mc_readl(mc, addr_reg); in tegra30_mc_handle_irq()
718 dev_err_ratelimited(mc->dev, "%s: %s%s @%pa: %s (%s%s)\n", in tegra30_mc_handle_irq()
724 if (mc->soc->num_channels) { in tegra30_mc_handle_irq()
725 mc_ch_writel(mc, channel, status, MC_INTSTATUS); in tegra30_mc_handle_irq()
726 mc_ch_writel(mc, MC_BROADCAST_CHANNEL, in tegra30_mc_handle_irq()
727 mc_channel_to_global_intstatus(mc, channel), in tegra30_mc_handle_irq()
730 mc_writel(mc, status, MC_INTSTATUS); in tegra30_mc_handle_irq()
760 struct tegra_mc *mc = icc_provider_to_tegra_mc(data); in tegra_mc_icc_xlate() local
763 list_for_each_entry(node, &mc->provider.nodes, node_list) { in tegra_mc_icc_xlate()
764 if (node->id == spec->args[0]) in tegra_mc_icc_xlate()
769 * If a client driver calls devm_of_icc_get() before the MC driver in tegra_mc_icc_xlate()
772 return ERR_PTR(-EPROBE_DEFER); in tegra_mc_icc_xlate()
796 * Memory Controller (MC) has few Memory Clients that are issuing memory
797 * bandwidth allocation requests to the MC interconnect provider. The MC
800 * re-configures hardware interface to External Memory (EMEM) in accordance
801 * to the required bandwidth. Each MC interconnect node represents an
806 * +----+
807 * +--------+ | |
808 * | TEXSRD +--->+ |
809 * +--------+ | |
810 * | | +-----+ +------+
811 * ... | MC +--->+ EMC +--->+ EMEM |
812 * | | +-----+ +------+
813 * +--------+ | |
814 * | DISP.. +--->+ |
815 * +--------+ | |
816 * +----+
818 static int tegra_mc_interconnect_setup(struct tegra_mc *mc) in tegra_mc_interconnect_setup() argument
824 /* older device-trees don't have interconnect properties */ in tegra_mc_interconnect_setup()
825 if (!device_property_present(mc->dev, "#interconnect-cells") || in tegra_mc_interconnect_setup()
826 !mc->soc->icc_ops) in tegra_mc_interconnect_setup()
829 mc->provider.dev = mc->dev; in tegra_mc_interconnect_setup()
830 mc->provider.data = &mc->provider; in tegra_mc_interconnect_setup()
831 mc->provider.set = mc->soc->icc_ops->set; in tegra_mc_interconnect_setup()
832 mc->provider.aggregate = mc->soc->icc_ops->aggregate; in tegra_mc_interconnect_setup()
833 mc->provider.get_bw = mc->soc->icc_ops->get_bw; in tegra_mc_interconnect_setup()
834 mc->provider.xlate = mc->soc->icc_ops->xlate; in tegra_mc_interconnect_setup()
835 mc->provider.xlate_extended = mc->soc->icc_ops->xlate_extended; in tegra_mc_interconnect_setup()
837 icc_provider_init(&mc->provider); in tegra_mc_interconnect_setup()
844 node->name = "Memory Controller"; in tegra_mc_interconnect_setup()
845 icc_node_add(node, &mc->provider); in tegra_mc_interconnect_setup()
852 for (i = 0; i < mc->soc->num_clients; i++) { in tegra_mc_interconnect_setup()
853 /* create MC client node */ in tegra_mc_interconnect_setup()
854 node = icc_node_create(mc->soc->clients[i].id); in tegra_mc_interconnect_setup()
860 node->name = mc->soc->clients[i].name; in tegra_mc_interconnect_setup()
861 icc_node_add(node, &mc->provider); in tegra_mc_interconnect_setup()
868 node->data = (struct tegra_mc_client *)&(mc->soc->clients[i]); in tegra_mc_interconnect_setup()
871 err = icc_provider_register(&mc->provider); in tegra_mc_interconnect_setup()
878 icc_nodes_remove(&mc->provider); in tegra_mc_interconnect_setup()
883 static void tegra_mc_num_channel_enabled(struct tegra_mc *mc) in tegra_mc_num_channel_enabled() argument
888 value = mc_ch_readl(mc, 0, MC_EMEM_ADR_CFG_CHANNEL_ENABLE); in tegra_mc_num_channel_enabled()
890 mc->num_channels = mc->soc->num_channels; in tegra_mc_num_channel_enabled()
896 mc->num_channels++; in tegra_mc_num_channel_enabled()
902 struct tegra_mc *mc; in tegra_mc_probe() local
906 mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL); in tegra_mc_probe()
907 if (!mc) in tegra_mc_probe()
908 return -ENOMEM; in tegra_mc_probe()
910 platform_set_drvdata(pdev, mc); in tegra_mc_probe()
911 spin_lock_init(&mc->lock); in tegra_mc_probe()
912 mc->soc = of_device_get_match_data(&pdev->dev); in tegra_mc_probe()
913 mc->dev = &pdev->dev; in tegra_mc_probe()
915 mask = DMA_BIT_MASK(mc->soc->num_address_bits); in tegra_mc_probe()
917 err = dma_coerce_mask_and_coherent(&pdev->dev, mask); in tegra_mc_probe()
919 dev_err(&pdev->dev, "failed to set DMA mask: %d\n", err); in tegra_mc_probe()
923 /* length of MC tick in nanoseconds */ in tegra_mc_probe()
924 mc->tick = 30; in tegra_mc_probe()
926 mc->regs = devm_platform_ioremap_resource(pdev, 0); in tegra_mc_probe()
927 if (IS_ERR(mc->regs)) in tegra_mc_probe()
928 return PTR_ERR(mc->regs); in tegra_mc_probe()
930 mc->debugfs.root = debugfs_create_dir("mc", NULL); in tegra_mc_probe()
932 if (mc->soc->ops && mc->soc->ops->probe) { in tegra_mc_probe()
933 err = mc->soc->ops->probe(mc); in tegra_mc_probe()
938 tegra_mc_num_channel_enabled(mc); in tegra_mc_probe()
940 if (mc->soc->ops && mc->soc->ops->handle_irq) { in tegra_mc_probe()
941 mc->irq = platform_get_irq(pdev, 0); in tegra_mc_probe()
942 if (mc->irq < 0) in tegra_mc_probe()
943 return mc->irq; in tegra_mc_probe()
945 WARN(!mc->soc->client_id_mask, "missing client ID mask for this SoC\n"); in tegra_mc_probe()
947 if (mc->soc->num_channels) in tegra_mc_probe()
948 mc_ch_writel(mc, MC_BROADCAST_CHANNEL, mc->soc->intmask, in tegra_mc_probe()
951 mc_writel(mc, mc->soc->intmask, MC_INTMASK); in tegra_mc_probe()
953 err = devm_request_irq(&pdev->dev, mc->irq, mc->soc->ops->handle_irq, 0, in tegra_mc_probe()
954 dev_name(&pdev->dev), mc); in tegra_mc_probe()
956 dev_err(&pdev->dev, "failed to request IRQ#%u: %d\n", mc->irq, in tegra_mc_probe()
962 if (mc->soc->reset_ops) { in tegra_mc_probe()
963 err = tegra_mc_reset_setup(mc); in tegra_mc_probe()
965 dev_err(&pdev->dev, "failed to register reset controller: %d\n", err); in tegra_mc_probe()
968 err = tegra_mc_interconnect_setup(mc); in tegra_mc_probe()
970 dev_err(&pdev->dev, "failed to initialize interconnect: %d\n", in tegra_mc_probe()
973 if (IS_ENABLED(CONFIG_TEGRA_IOMMU_SMMU) && mc->soc->smmu) { in tegra_mc_probe()
974 mc->smmu = tegra_smmu_probe(&pdev->dev, mc->soc->smmu, mc); in tegra_mc_probe()
975 if (IS_ERR(mc->smmu)) { in tegra_mc_probe()
976 dev_err(&pdev->dev, "failed to probe SMMU: %ld\n", in tegra_mc_probe()
977 PTR_ERR(mc->smmu)); in tegra_mc_probe()
978 mc->smmu = NULL; in tegra_mc_probe()
982 if (IS_ENABLED(CONFIG_TEGRA_IOMMU_GART) && !mc->soc->smmu) { in tegra_mc_probe()
983 mc->gart = tegra_gart_probe(&pdev->dev, mc); in tegra_mc_probe()
984 if (IS_ERR(mc->gart)) { in tegra_mc_probe()
985 dev_err(&pdev->dev, "failed to probe GART: %ld\n", in tegra_mc_probe()
986 PTR_ERR(mc->gart)); in tegra_mc_probe()
987 mc->gart = NULL; in tegra_mc_probe()
996 struct tegra_mc *mc = dev_get_drvdata(dev); in tegra_mc_suspend() local
998 if (mc->soc->ops && mc->soc->ops->suspend) in tegra_mc_suspend()
999 return mc->soc->ops->suspend(mc); in tegra_mc_suspend()
1006 struct tegra_mc *mc = dev_get_drvdata(dev); in tegra_mc_resume() local
1008 if (mc->soc->ops && mc->soc->ops->resume) in tegra_mc_resume()
1009 return mc->soc->ops->resume(mc); in tegra_mc_resume()
1016 struct tegra_mc *mc = dev_get_drvdata(dev); in tegra_mc_sync_state() local
1019 if (mc->provider.dev == dev) in tegra_mc_sync_state()
1029 .name = "tegra-mc",