Commit 64de2cd3 authored by Olof Johansson's avatar Olof Johansson
Browse files

Merge tag 'memory-controller-drv-5.10-2' of...

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: default avatarOlof Johansson <olof@lixom.net>
parents c8952516 94ca8573
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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
which generation the SoCs use:
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
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,mt6779-smi-common"
	"mediatek,mt7623-smi-common", "mediatek,mt2701-smi-common"
	"mediatek,mt8167-smi-common"
	"mediatek,mt8173-smi-common"
	"mediatek,mt8183-smi-common"
- reg : the register and size of the SMI block.
+2 −1
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ Required properties:
		"mediatek,mt2712-smi-larb"
		"mediatek,mt6779-smi-larb"
		"mediatek,mt7623-smi-larb", "mediatek,mt2701-smi-larb"
		"mediatek,mt8167-smi-larb"
		"mediatek,mt8173-smi-larb"
		"mediatek,mt8183-smi-larb"
- reg : the register and size of this local arbiter.
@@ -22,7 +23,7 @@ Required properties:
  - "gals": the clock for GALS(Global Async Local Sync).
  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.

Example:
+1 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ config TI_EMIF

config OMAP_GPMC
	bool "Texas Instruments OMAP SoC GPMC driver" if COMPILE_TEST
	depends on OF_ADDRESS
	select GPIOLIB
	help
	  This driver is for the General Purpose Memory Controller (GPMC)
+2 −20
Original line number Diff line number Diff line
@@ -131,16 +131,7 @@ static int emif_regdump_show(struct seq_file *s, void *unused)
	return 0;
}

static int emif_regdump_open(struct inode *inode, struct file *file)
{
	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,
};
DEFINE_SHOW_ATTRIBUTE(emif_regdump);

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;
}

static int emif_mr4_open(struct inode *inode, struct file *file)
{
	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,
};
DEFINE_SHOW_ATTRIBUTE(emif_mr4);

static int __init_or_module emif_debugfs_init(struct emif_data *emif)
{
+23 −0
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@
/* mt8173 */
#define SMI_LARB_MMU_EN		0xf00

/* mt8167 */
#define MT8167_SMI_LARB_MMU_EN	0xfc0

/* mt2701 */
#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);
}

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)
{
	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,
};

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 = {
	.port_in_larb = {
		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[] = {
	{
		.compatible = "mediatek,mt8167-smi-larb",
		.data = &mtk_smi_larb_mt8167
	},
	{
		.compatible = "mediatek,mt8173-smi-larb",
		.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",
		.data = &mtk_smi_common_gen2,
	},
	{
		.compatible = "mediatek,mt8167-smi-common",
		.data = &mtk_smi_common_gen2,
	},
	{
		.compatible = "mediatek,mt2701-smi-common",
		.data = &mtk_smi_common_gen1,
Loading