Skip to content

Commit 64de2cd

Browse files
committed
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>
2 parents c895251 + 94ca857 commit 64de2cd

7 files changed

Lines changed: 31 additions & 36 deletions

File tree

Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The hardware block diagram please check bindings/iommu/mediatek,iommu.txt
55
Mediatek SMI have two generations of HW architecture, here is the list
66
which generation the SoCs use:
77
generation 1: mt2701 and mt7623.
8-
generation 2: mt2712, mt6779, mt8173 and mt8183.
8+
generation 2: mt2712, mt6779, mt8167, mt8173 and mt8183.
99

1010
There's slight differences between the two SMI, for generation 2, the
1111
register which control the iommu port is at each larb's register base. But
@@ -20,6 +20,7 @@ Required properties:
2020
"mediatek,mt2712-smi-common"
2121
"mediatek,mt6779-smi-common"
2222
"mediatek,mt7623-smi-common", "mediatek,mt2701-smi-common"
23+
"mediatek,mt8167-smi-common"
2324
"mediatek,mt8173-smi-common"
2425
"mediatek,mt8183-smi-common"
2526
- reg : the register and size of the SMI block.

Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Required properties:
88
"mediatek,mt2712-smi-larb"
99
"mediatek,mt6779-smi-larb"
1010
"mediatek,mt7623-smi-larb", "mediatek,mt2701-smi-larb"
11+
"mediatek,mt8167-smi-larb"
1112
"mediatek,mt8173-smi-larb"
1213
"mediatek,mt8183-smi-larb"
1314
- reg : the register and size of this local arbiter.
@@ -22,7 +23,7 @@ Required properties:
2223
- "gals": the clock for GALS(Global Async Local Sync).
2324
Here is the list which has this GALS: mt8183.
2425

25-
Required property for mt2701, mt2712, mt6779 and mt7623:
26+
Required property for mt2701, mt2712, mt6779, mt7623 and mt8167:
2627
- mediatek,larb-id :the hardware id of this larb.
2728

2829
Example:

drivers/memory/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ config TI_EMIF
104104

105105
config OMAP_GPMC
106106
bool "Texas Instruments OMAP SoC GPMC driver" if COMPILE_TEST
107+
depends on OF_ADDRESS
107108
select GPIOLIB
108109
help
109110
This driver is for the General Purpose Memory Controller (GPMC)

drivers/memory/emif.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,7 @@ static int emif_regdump_show(struct seq_file *s, void *unused)
131131
return 0;
132132
}
133133

134-
static int emif_regdump_open(struct inode *inode, struct file *file)
135-
{
136-
return single_open(file, emif_regdump_show, inode->i_private);
137-
}
138-
139-
static const struct file_operations emif_regdump_fops = {
140-
.open = emif_regdump_open,
141-
.read = seq_read,
142-
.release = single_release,
143-
};
134+
DEFINE_SHOW_ATTRIBUTE(emif_regdump);
144135

145136
static int emif_mr4_show(struct seq_file *s, void *unused)
146137
{
@@ -150,16 +141,7 @@ static int emif_mr4_show(struct seq_file *s, void *unused)
150141
return 0;
151142
}
152143

153-
static int emif_mr4_open(struct inode *inode, struct file *file)
154-
{
155-
return single_open(file, emif_mr4_show, inode->i_private);
156-
}
157-
158-
static const struct file_operations emif_mr4_fops = {
159-
.open = emif_mr4_open,
160-
.read = seq_read,
161-
.release = single_release,
162-
};
144+
DEFINE_SHOW_ATTRIBUTE(emif_mr4);
163145

164146
static int __init_or_module emif_debugfs_init(struct emif_data *emif)
165147
{

drivers/memory/mtk-smi.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
/* mt8173 */
2020
#define SMI_LARB_MMU_EN 0xf00
2121

22+
/* mt8167 */
23+
#define MT8167_SMI_LARB_MMU_EN 0xfc0
24+
2225
/* mt2701 */
2326
#define REG_SMI_SECUR_CON_BASE 0x5c0
2427

@@ -179,6 +182,13 @@ static void mtk_smi_larb_config_port_mt8173(struct device *dev)
179182
writel(*larb->mmu, larb->base + SMI_LARB_MMU_EN);
180183
}
181184

185+
static void mtk_smi_larb_config_port_mt8167(struct device *dev)
186+
{
187+
struct mtk_smi_larb *larb = dev_get_drvdata(dev);
188+
189+
writel(*larb->mmu, larb->base + MT8167_SMI_LARB_MMU_EN);
190+
}
191+
182192
static void mtk_smi_larb_config_port_gen1(struct device *dev)
183193
{
184194
struct mtk_smi_larb *larb = dev_get_drvdata(dev);
@@ -226,6 +236,11 @@ static const struct mtk_smi_larb_gen mtk_smi_larb_mt8173 = {
226236
.config_port = mtk_smi_larb_config_port_mt8173,
227237
};
228238

239+
static const struct mtk_smi_larb_gen mtk_smi_larb_mt8167 = {
240+
/* mt8167 do not need the port in larb */
241+
.config_port = mtk_smi_larb_config_port_mt8167,
242+
};
243+
229244
static const struct mtk_smi_larb_gen mtk_smi_larb_mt2701 = {
230245
.port_in_larb = {
231246
LARB0_PORT_OFFSET, LARB1_PORT_OFFSET,
@@ -254,6 +269,10 @@ static const struct mtk_smi_larb_gen mtk_smi_larb_mt8183 = {
254269
};
255270

256271
static const struct of_device_id mtk_smi_larb_of_ids[] = {
272+
{
273+
.compatible = "mediatek,mt8167-smi-larb",
274+
.data = &mtk_smi_larb_mt8167
275+
},
257276
{
258277
.compatible = "mediatek,mt8173-smi-larb",
259278
.data = &mtk_smi_larb_mt8173
@@ -418,6 +437,10 @@ static const struct of_device_id mtk_smi_common_of_ids[] = {
418437
.compatible = "mediatek,mt8173-smi-common",
419438
.data = &mtk_smi_common_gen2,
420439
},
440+
{
441+
.compatible = "mediatek,mt8167-smi-common",
442+
.data = &mtk_smi_common_gen2,
443+
},
421444
{
422445
.compatible = "mediatek,mt2701-smi-common",
423446
.data = &mtk_smi_common_gen1,

drivers/memory/tegra/tegra124-emc.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,19 +1060,7 @@ static int tegra_emc_debug_available_rates_show(struct seq_file *s,
10601060
return 0;
10611061
}
10621062

1063-
static int tegra_emc_debug_available_rates_open(struct inode *inode,
1064-
struct file *file)
1065-
{
1066-
return single_open(file, tegra_emc_debug_available_rates_show,
1067-
inode->i_private);
1068-
}
1069-
1070-
static const struct file_operations tegra_emc_debug_available_rates_fops = {
1071-
.open = tegra_emc_debug_available_rates_open,
1072-
.read = seq_read,
1073-
.llseek = seq_lseek,
1074-
.release = single_release,
1075-
};
1063+
DEFINE_SHOW_ATTRIBUTE(tegra_emc_debug_available_rates);
10761064

10771065
static int tegra_emc_debug_min_rate_get(void *data, u64 *rate)
10781066
{

drivers/memory/tegra/tegra210-emc-cc-r21021.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ static u32 tegra210_emc_r21021_periodic_compensation(struct tegra210_emc *emc)
501501
emc_cfg_o = emc_readl(emc, EMC_CFG);
502502
emc_cfg = emc_cfg_o & ~(EMC_CFG_DYN_SELF_REF |
503503
EMC_CFG_DRAM_ACPD |
504-
EMC_CFG_DRAM_CLKSTOP_PD |
505504
EMC_CFG_DRAM_CLKSTOP_PD);
506505

507506

0 commit comments

Comments
 (0)