mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-25 05:34:00 +08:00
44fb3026ad
This introduces the EMC driver that's required to scale the external memory frequency. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJVU1FHAAoJEN0jrNd/PrOhClAQAKDOt5OYvadTfmPogJiwxlQl 7NvVVsnIzHfScANP6B/pynoC8Gfx1owRdLzPPWKM860gtdtaA9pXOWRuxQV8NLcR 5WQO4Z4sNXyvA704MNFK+EqydCN2Iu/Z+2Ups8VHZ9VmukSNaCu/se6JvW+GJMm1 DHytjzHeckNUruNrZnXLA6ckwymDbMtCBV3W9hIeKe9aPjJrgjR7Rlhhu7cX9XGF XSCF9eigh4MsyLgf3cWMoVl2NIePCW3sbAQEKkiM5xzPo21VlpPyja7OWoytcQkC HEMmuICfwT8XEd7fTabW+WHxTnVhkL+OZ833p+LSBUCeXJ82N8vSV8HZlRHly9LZ diXoJ9+2l/C02FtnnB7BtLxnyQ2NF6LAP1CvYZ7eF/Z+lxthErs0bIXyjC0RTuBN 9y6t0/VhEGMv6ApOly1VrHLtU6LnQEbYryvlOjvP4NQVb6jQc165UdPZtXufgx9o VprQoOIHdBzMnThI7ndRWgZcayn+VmJy0TvjTGmhLcurwigbCjkqYdwhq2c7Z0F2 FpEOCqWMJ0mywQXoZadIk5ON51IVRin0otyKed14PY9QU6c6hJ6NCZQi1pQnB95W Ut7ZrdZnZMIjMui8EOzeJc82mjKL3agpbYTQqqiIV+kHY9dXpxSOOHd4DbMN5Kc2 3xvgkGtj61VOlGiGnp/W =QeY4 -----END PGP SIGNATURE----- Merge tag 'tegra-for-4.2-emc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/drivers Merge "ARM: tegra: Add EMC driver for v4.2-rc1" from Thierry Reding: This introduces the EMC driver that's required to scale the external memory frequency. * tag 'tegra-for-4.2-emc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: memory: tegra: Add EMC frequency debugfs entry memory: tegra: Add EMC (external memory controller) driver memory: tegra: Add API needed by the EMC driver of: Add Tegra124 EMC bindings of: Document timings subnode of nvidia,tegra-mc
126 lines
2.4 KiB
C
126 lines
2.4 KiB
C
/*
|
|
* Copyright (C) 2014 NVIDIA Corporation
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#ifndef __SOC_TEGRA_MC_H__
|
|
#define __SOC_TEGRA_MC_H__
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct clk;
|
|
struct device;
|
|
struct page;
|
|
|
|
struct tegra_smmu_enable {
|
|
unsigned int reg;
|
|
unsigned int bit;
|
|
};
|
|
|
|
struct tegra_mc_timing {
|
|
unsigned long rate;
|
|
|
|
u32 *emem_data;
|
|
};
|
|
|
|
/* latency allowance */
|
|
struct tegra_mc_la {
|
|
unsigned int reg;
|
|
unsigned int shift;
|
|
unsigned int mask;
|
|
unsigned int def;
|
|
};
|
|
|
|
struct tegra_mc_client {
|
|
unsigned int id;
|
|
const char *name;
|
|
unsigned int swgroup;
|
|
|
|
unsigned int fifo_size;
|
|
|
|
struct tegra_smmu_enable smmu;
|
|
struct tegra_mc_la la;
|
|
};
|
|
|
|
struct tegra_smmu_swgroup {
|
|
const char *name;
|
|
unsigned int swgroup;
|
|
unsigned int reg;
|
|
};
|
|
|
|
struct tegra_smmu_ops {
|
|
void (*flush_dcache)(struct page *page, unsigned long offset,
|
|
size_t size);
|
|
};
|
|
|
|
struct tegra_smmu_soc {
|
|
const struct tegra_mc_client *clients;
|
|
unsigned int num_clients;
|
|
|
|
const struct tegra_smmu_swgroup *swgroups;
|
|
unsigned int num_swgroups;
|
|
|
|
bool supports_round_robin_arbitration;
|
|
bool supports_request_limit;
|
|
|
|
unsigned int num_asids;
|
|
|
|
const struct tegra_smmu_ops *ops;
|
|
};
|
|
|
|
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)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
static inline void tegra_smmu_remove(struct tegra_smmu *smmu)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
struct tegra_mc_soc {
|
|
const struct tegra_mc_client *clients;
|
|
unsigned int num_clients;
|
|
|
|
const unsigned long *emem_regs;
|
|
unsigned int num_emem_regs;
|
|
|
|
unsigned int num_address_bits;
|
|
unsigned int atom_size;
|
|
|
|
const struct tegra_smmu_soc *smmu;
|
|
};
|
|
|
|
struct tegra_mc {
|
|
struct device *dev;
|
|
struct tegra_smmu *smmu;
|
|
void __iomem *regs;
|
|
struct clk *clk;
|
|
int irq;
|
|
|
|
const struct tegra_mc_soc *soc;
|
|
unsigned long tick;
|
|
|
|
struct tegra_mc_timing *timings;
|
|
unsigned int num_timings;
|
|
};
|
|
|
|
void tegra_mc_write_emem_configuration(struct tegra_mc *mc, unsigned long rate);
|
|
unsigned int tegra_mc_get_emem_device_count(struct tegra_mc *mc);
|
|
|
|
#endif /* __SOC_TEGRA_MC_H__ */
|