mc.c (9a38cb27668e275ed912e67388cf11f454a24cc6) | mc.c (e852af72a7f21f4d25994365af86a92438d68014) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved. 4 */ 5 6#include <linux/clk.h> 7#include <linux/delay.h> 8#include <linux/dma-mapping.h> --- 829 unchanged lines hidden (view full) --- 838 return 0; 839 840remove_nodes: 841 icc_nodes_remove(&mc->provider); 842 843 return err; 844} 845 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved. 4 */ 5 6#include <linux/clk.h> 7#include <linux/delay.h> 8#include <linux/dma-mapping.h> --- 829 unchanged lines hidden (view full) --- 838 return 0; 839 840remove_nodes: 841 icc_nodes_remove(&mc->provider); 842 843 return err; 844} 845 |
846static void tegra_mc_num_channel_enabled(struct tegra_mc *mc) 847{ 848 unsigned int i; 849 u32 value; 850 851 value = mc_ch_readl(mc, 0, MC_EMEM_ADR_CFG_CHANNEL_ENABLE); 852 if (value <= 0) { 853 mc->num_channels = mc->soc->num_channels; 854 return; 855 } 856 857 for (i = 0; i < 32; i++) { 858 if (value & BIT(i)) 859 mc->num_channels++; 860 } 861} 862 |
|
846static int tegra_mc_probe(struct platform_device *pdev) 847{ 848 struct tegra_mc *mc; 849 u64 mask; 850 int err; 851 852 mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL); 853 if (!mc) --- 22 unchanged lines hidden (view full) --- 876 mc->debugfs.root = debugfs_create_dir("mc", NULL); 877 878 if (mc->soc->ops && mc->soc->ops->probe) { 879 err = mc->soc->ops->probe(mc); 880 if (err < 0) 881 return err; 882 } 883 | 863static int tegra_mc_probe(struct platform_device *pdev) 864{ 865 struct tegra_mc *mc; 866 u64 mask; 867 int err; 868 869 mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL); 870 if (!mc) --- 22 unchanged lines hidden (view full) --- 893 mc->debugfs.root = debugfs_create_dir("mc", NULL); 894 895 if (mc->soc->ops && mc->soc->ops->probe) { 896 err = mc->soc->ops->probe(mc); 897 if (err < 0) 898 return err; 899 } 900 |
901 tegra_mc_num_channel_enabled(mc); 902 |
|
884 if (mc->soc->ops && mc->soc->ops->handle_irq) { 885 mc->irq = platform_get_irq(pdev, 0); 886 if (mc->irq < 0) 887 return mc->irq; 888 889 WARN(!mc->soc->client_id_mask, "missing client ID mask for this SoC\n"); 890 891 if (mc->soc->num_channels) --- 99 unchanged lines hidden --- | 903 if (mc->soc->ops && mc->soc->ops->handle_irq) { 904 mc->irq = platform_get_irq(pdev, 0); 905 if (mc->irq < 0) 906 return mc->irq; 907 908 WARN(!mc->soc->client_id_mask, "missing client ID mask for this SoC\n"); 909 910 if (mc->soc->num_channels) --- 99 unchanged lines hidden --- |