linux/include/soc/tegra/mc.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (C) 2014 NVIDIA Corporation
 */

#ifndef __SOC_TEGRA_MC_H__
#define __SOC_TEGRA_MC_H__

#include <linux/bits.h>
#include <linux/debugfs.h>
#include <linux/err.h>
#include <linux/interconnect-provider.h>
#include <linux/irq.h>
#include <linux/reset-controller.h>
#include <linux/types.h>
#include <linux/tegra-icc.h>

struct clk;
struct device;
struct page;

struct tegra_mc_timing {};

struct tegra_mc_client {};

struct tegra_smmu_swgroup {};

struct tegra_smmu_group_soc {};

struct tegra_smmu_soc {};

struct tegra_mc;
struct tegra_smmu;

#ifdef CONFIG_TEGRA_IOMMU_SMMU
struct tegra_smmu *tegra_smmu_probe(struct device *dev,
				    const struct tegra_smmu_soc *soc,
				    struct tegra_mc *mc);
void tegra_smmu_remove(struct tegra_smmu *smmu);
#else
static inline struct tegra_smmu *
tegra_smmu_probe(struct device *dev, const struct tegra_smmu_soc *soc,
		 struct tegra_mc *mc)
{}

static inline void tegra_smmu_remove(struct tegra_smmu *smmu)
{}
#endif

struct tegra_mc_reset {};

struct tegra_mc_reset_ops {};

#define TEGRA_MC_ICC_TAG_DEFAULT
#define TEGRA_MC_ICC_TAG_ISO

struct tegra_mc_icc_ops {};

struct icc_node *tegra_mc_icc_xlate(const struct of_phandle_args *spec,
				    void *data);
extern const struct tegra_mc_icc_ops tegra_mc_icc_ops;

struct tegra_mc_ops {};

struct tegra_mc_soc {};

struct tegra_mc {};

int tegra_mc_write_emem_configuration(struct tegra_mc *mc, unsigned long rate);
unsigned int tegra_mc_get_emem_device_count(struct tegra_mc *mc);

#ifdef CONFIG_TEGRA_MC
struct tegra_mc *devm_tegra_memory_controller_get(struct device *dev);
int tegra_mc_probe_device(struct tegra_mc *mc, struct device *dev);
int tegra_mc_get_carveout_info(struct tegra_mc *mc, unsigned int id,
                               phys_addr_t *base, u64 *size);
#else
static inline struct tegra_mc *
devm_tegra_memory_controller_get(struct device *dev)
{
	return ERR_PTR(-ENODEV);
}

static inline int
tegra_mc_probe_device(struct tegra_mc *mc, struct device *dev)
{
	return -ENODEV;
}

static inline int
tegra_mc_get_carveout_info(struct tegra_mc *mc, unsigned int id,
                           phys_addr_t *base, u64 *size)
{
	return -ENODEV;
}
#endif

#endif /* __SOC_TEGRA_MC_H__ */