Memory controller drivers for v5.10, part two

1. Add support for MT8167 to Mediatek SMI.
 2. Compile test fix (omap-gpmc) and duplicate code (tegra).
 3. Simplify code with DEFINE_SHOW_ATTRIBUTE.
 -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAl9uC2cQHGtyemtAa2Vy
 bmVsLm9yZwAKCRDBN2bmhouD16HKD/9rruVkVkUpc6HID6455zLVUBvqH0E3s01z
 0tvfprEPKr7xmyYsl7Lsu8fV1ZzKfDtrqPQkK/Fs/UVrZgOS/imYeSngNcGgmAuV
 w6YNJjpO4356h+p3rCydjsB18zdtjSiXb1nxVaxvo1Wv2dZ0Q4lX3/QhgvuirMMy
 MXvo8mNVZU3O7cb0+OiJlSb4HwNfv9lkY4AbH2EkAiw8iCaEjeCiIjOLTSrWoaD5
 cQh+meV9v7lwSl23Y6tXabDf0K9OwF3HysEbNcgZL5utdh4NWdNVTNou+AM2PJBo
 w/YIC2JIRSxGhJwvgOfGb/47Hsoh0rXUQ/W2Wi8gaZUZ/YWr5FnPP7J3I7JN4Oy8
 dPPeN3yxqfPUMWTyVpjN+yzKb+MhBFG2wwVFXwFyE6nZKPOc6J+VzTQTMpAAMRlF
 LlNOBfei8TjVVnfZrgmN1lZZYg82jgnvjfgnrFuANrn/oMqIh52PvWMhw1gtchhw
 FvtzJioJlgGgxUarjcnFaeDaqv/7y7qMsTMYsda+cK5p0JzFVjqWjuHUQtlFk8Hd
 7uEwPLn/bv6u5HcHeWLt6aXTSea+p/Bh6z+D0yACQb+XckhIMRhjgFUZw/w8L6SK
 98orgIPwt9FJ8K1Q9jrohbhbqU+eand0JOOosJQ8Hy0mQI+joozu7xbG+U8MKKgB
 osIP7TRiwA==
 =THqh
 -----END PGP SIGNATURE-----

Merge tag 'memory-controller-drv-5.10-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers

Memory controller drivers for v5.10, part two

1. Add support for MT8167 to Mediatek SMI.
2. Compile test fix (omap-gpmc) and duplicate code (tegra).
3. Simplify code with DEFINE_SHOW_ATTRIBUTE.

* tag 'memory-controller-drv-5.10-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
  memory: emif: Convert to DEFINE_SHOW_ATTRIBUTE
  memory: tegra: Convert to DEFINE_SHOW_ATTRIBUTE
  memory: omap-gpmc: Fix compile test on SPARC
  memory: mtk-smi: add support for MT8167
  dt-bindings: memory: mediatek: Add binding for MT8167 SMI
  memory: tegra: Delete duplicated argument to '|' in function tegra210_emc_r21021_periodic_compensation

Link: https://lore.kernel.org/r/20200925152523.14608-1-krzk@kernel.org
Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
Olof Johansson 2020-10-03 13:06:16 -07:00
commit 64de2cd335
7 changed files with 31 additions and 36 deletions

View File

@ -5,7 +5,7 @@ The hardware block diagram please check bindings/iommu/mediatek,iommu.txt
Mediatek SMI have two generations of HW architecture, here is the list Mediatek SMI have two generations of HW architecture, here is the list
which generation the SoCs use: which generation the SoCs use:
generation 1: mt2701 and mt7623. generation 1: mt2701 and mt7623.
generation 2: mt2712, mt6779, mt8173 and mt8183. generation 2: mt2712, mt6779, mt8167, mt8173 and mt8183.
There's slight differences between the two SMI, for generation 2, the There's slight differences between the two SMI, for generation 2, the
register which control the iommu port is at each larb's register base. But register which control the iommu port is at each larb's register base. But
@ -20,6 +20,7 @@ Required properties:
"mediatek,mt2712-smi-common" "mediatek,mt2712-smi-common"
"mediatek,mt6779-smi-common" "mediatek,mt6779-smi-common"
"mediatek,mt7623-smi-common", "mediatek,mt2701-smi-common" "mediatek,mt7623-smi-common", "mediatek,mt2701-smi-common"
"mediatek,mt8167-smi-common"
"mediatek,mt8173-smi-common" "mediatek,mt8173-smi-common"
"mediatek,mt8183-smi-common" "mediatek,mt8183-smi-common"
- reg : the register and size of the SMI block. - reg : the register and size of the SMI block.

View File

@ -8,6 +8,7 @@ Required properties:
"mediatek,mt2712-smi-larb" "mediatek,mt2712-smi-larb"
"mediatek,mt6779-smi-larb" "mediatek,mt6779-smi-larb"
"mediatek,mt7623-smi-larb", "mediatek,mt2701-smi-larb" "mediatek,mt7623-smi-larb", "mediatek,mt2701-smi-larb"
"mediatek,mt8167-smi-larb"
"mediatek,mt8173-smi-larb" "mediatek,mt8173-smi-larb"
"mediatek,mt8183-smi-larb" "mediatek,mt8183-smi-larb"
- reg : the register and size of this local arbiter. - reg : the register and size of this local arbiter.
@ -22,7 +23,7 @@ Required properties:
- "gals": the clock for GALS(Global Async Local Sync). - "gals": the clock for GALS(Global Async Local Sync).
Here is the list which has this GALS: mt8183. Here is the list which has this GALS: mt8183.
Required property for mt2701, mt2712, mt6779 and mt7623: Required property for mt2701, mt2712, mt6779, mt7623 and mt8167:
- mediatek,larb-id :the hardware id of this larb. - mediatek,larb-id :the hardware id of this larb.
Example: Example:

View File

@ -104,6 +104,7 @@ config TI_EMIF
config OMAP_GPMC config OMAP_GPMC
bool "Texas Instruments OMAP SoC GPMC driver" if COMPILE_TEST bool "Texas Instruments OMAP SoC GPMC driver" if COMPILE_TEST
depends on OF_ADDRESS
select GPIOLIB select GPIOLIB
help help
This driver is for the General Purpose Memory Controller (GPMC) This driver is for the General Purpose Memory Controller (GPMC)

View File

@ -131,16 +131,7 @@ static int emif_regdump_show(struct seq_file *s, void *unused)
return 0; return 0;
} }
static int emif_regdump_open(struct inode *inode, struct file *file) DEFINE_SHOW_ATTRIBUTE(emif_regdump);
{
return single_open(file, emif_regdump_show, inode->i_private);
}
static const struct file_operations emif_regdump_fops = {
.open = emif_regdump_open,
.read = seq_read,
.release = single_release,
};
static int emif_mr4_show(struct seq_file *s, void *unused) static int emif_mr4_show(struct seq_file *s, void *unused)
{ {
@ -150,16 +141,7 @@ static int emif_mr4_show(struct seq_file *s, void *unused)
return 0; return 0;
} }
static int emif_mr4_open(struct inode *inode, struct file *file) DEFINE_SHOW_ATTRIBUTE(emif_mr4);
{
return single_open(file, emif_mr4_show, inode->i_private);
}
static const struct file_operations emif_mr4_fops = {
.open = emif_mr4_open,
.read = seq_read,
.release = single_release,
};
static int __init_or_module emif_debugfs_init(struct emif_data *emif) static int __init_or_module emif_debugfs_init(struct emif_data *emif)
{ {

View File

@ -19,6 +19,9 @@
/* mt8173 */ /* mt8173 */
#define SMI_LARB_MMU_EN 0xf00 #define SMI_LARB_MMU_EN 0xf00
/* mt8167 */
#define MT8167_SMI_LARB_MMU_EN 0xfc0
/* mt2701 */ /* mt2701 */
#define REG_SMI_SECUR_CON_BASE 0x5c0 #define REG_SMI_SECUR_CON_BASE 0x5c0
@ -179,6 +182,13 @@ static void mtk_smi_larb_config_port_mt8173(struct device *dev)
writel(*larb->mmu, larb->base + SMI_LARB_MMU_EN); writel(*larb->mmu, larb->base + SMI_LARB_MMU_EN);
} }
static void mtk_smi_larb_config_port_mt8167(struct device *dev)
{
struct mtk_smi_larb *larb = dev_get_drvdata(dev);
writel(*larb->mmu, larb->base + MT8167_SMI_LARB_MMU_EN);
}
static void mtk_smi_larb_config_port_gen1(struct device *dev) static void mtk_smi_larb_config_port_gen1(struct device *dev)
{ {
struct mtk_smi_larb *larb = dev_get_drvdata(dev); struct mtk_smi_larb *larb = dev_get_drvdata(dev);
@ -226,6 +236,11 @@ static const struct mtk_smi_larb_gen mtk_smi_larb_mt8173 = {
.config_port = mtk_smi_larb_config_port_mt8173, .config_port = mtk_smi_larb_config_port_mt8173,
}; };
static const struct mtk_smi_larb_gen mtk_smi_larb_mt8167 = {
/* mt8167 do not need the port in larb */
.config_port = mtk_smi_larb_config_port_mt8167,
};
static const struct mtk_smi_larb_gen mtk_smi_larb_mt2701 = { static const struct mtk_smi_larb_gen mtk_smi_larb_mt2701 = {
.port_in_larb = { .port_in_larb = {
LARB0_PORT_OFFSET, LARB1_PORT_OFFSET, LARB0_PORT_OFFSET, LARB1_PORT_OFFSET,
@ -254,6 +269,10 @@ static const struct mtk_smi_larb_gen mtk_smi_larb_mt8183 = {
}; };
static const struct of_device_id mtk_smi_larb_of_ids[] = { static const struct of_device_id mtk_smi_larb_of_ids[] = {
{
.compatible = "mediatek,mt8167-smi-larb",
.data = &mtk_smi_larb_mt8167
},
{ {
.compatible = "mediatek,mt8173-smi-larb", .compatible = "mediatek,mt8173-smi-larb",
.data = &mtk_smi_larb_mt8173 .data = &mtk_smi_larb_mt8173
@ -418,6 +437,10 @@ static const struct of_device_id mtk_smi_common_of_ids[] = {
.compatible = "mediatek,mt8173-smi-common", .compatible = "mediatek,mt8173-smi-common",
.data = &mtk_smi_common_gen2, .data = &mtk_smi_common_gen2,
}, },
{
.compatible = "mediatek,mt8167-smi-common",
.data = &mtk_smi_common_gen2,
},
{ {
.compatible = "mediatek,mt2701-smi-common", .compatible = "mediatek,mt2701-smi-common",
.data = &mtk_smi_common_gen1, .data = &mtk_smi_common_gen1,

View File

@ -1060,19 +1060,7 @@ static int tegra_emc_debug_available_rates_show(struct seq_file *s,
return 0; return 0;
} }
static int tegra_emc_debug_available_rates_open(struct inode *inode, DEFINE_SHOW_ATTRIBUTE(tegra_emc_debug_available_rates);
struct file *file)
{
return single_open(file, tegra_emc_debug_available_rates_show,
inode->i_private);
}
static const struct file_operations tegra_emc_debug_available_rates_fops = {
.open = tegra_emc_debug_available_rates_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static int tegra_emc_debug_min_rate_get(void *data, u64 *rate) static int tegra_emc_debug_min_rate_get(void *data, u64 *rate)
{ {

View File

@ -501,7 +501,6 @@ static u32 tegra210_emc_r21021_periodic_compensation(struct tegra210_emc *emc)
emc_cfg_o = emc_readl(emc, EMC_CFG); emc_cfg_o = emc_readl(emc, EMC_CFG);
emc_cfg = emc_cfg_o & ~(EMC_CFG_DYN_SELF_REF | emc_cfg = emc_cfg_o & ~(EMC_CFG_DYN_SELF_REF |
EMC_CFG_DRAM_ACPD | EMC_CFG_DRAM_ACPD |
EMC_CFG_DRAM_CLKSTOP_PD |
EMC_CFG_DRAM_CLKSTOP_PD); EMC_CFG_DRAM_CLKSTOP_PD);