Memory controller drivers for v5.12

1. Mediatek SMI: fix PM usage counter and make the driver modular.
 2. Renesas RPC-IF: add support for RZ/G2 series.
 3. Minor fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAmAW79UQHGtyemtAa2Vy
 bmVsLm9yZwAKCRDBN2bmhouD1xz2D/9IBQzptHGrRiY83pn+J/cLTaCdontM4NMU
 2f+ShaDWv8KHdG8156eP3ycvZI6lf01kCARhh1xbpvlPTXZU4sLpO6rsQFnyczc/
 JSW5Zfs/dXjkpLAAMFJKgTtw6aG4nIyep3x28WZMgIGf1JFGkiU8W3XMIOt+iv6D
 SivG611E+BFtQQouXIRmL5H7L29nLGnw5wXayhOLeGYdi6pMC3nHT/5TZx2Ld6BO
 5fguXVO5fWroVb6M1FvB8r/l6/JP8F99+dxzg9MZTQt8AHUaxtp/zojUUk0EjI1L
 3ziNqCLE3O7YdFIVD/Ib3u9SYF+GtOpMR0M1CVP2H6O2CaAUndQfyO1cMP5g+DnR
 Fq2D60qgl6RPRhuLui8V+jE24NvI3a4woakx0XTCh7NPWYmG9BLYM4Q4ty+ZPA+N
 ncQGYgCnodFWaCWmSb9wLAvEMHL8E9ja13nYGJo5hbtP34X984lKaDrS44jVllWk
 8y6Qp+qlsIwr8X+y33C5dv0s8txlOt9M1ckkK0GOvD3F+Yr4aR7/cPYyoVv22K7h
 KjcSrbkoRc2ySycBNUq79LOaq6DYcNFje+8M8cWF8BoPddXi1piW50YbDMsu8XKF
 HbuZYMKMVUUuxxENqi00f+WJKHzlLpupP5YYJz7r16B8Wqoa+aJMEr1/lDl8pSpC
 Yo2IIQwgxg==
 =S32T
 -----END PGP SIGNATURE-----

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

Memory controller drivers for v5.12

1. Mediatek SMI: fix PM usage counter and make the driver modular.
2. Renesas RPC-IF: add support for RZ/G2 series.
3. Minor fixes.

* tag 'memory-controller-drv-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
  memory: mtk-smi: Allow building as module
  memory: ti-aemif: Drop child node when jumping out loop
  memory: mtk-smi: Use platform_register_drivers
  memory: renesas-rpc-if: Add RZ/G2 to Kconfig description
  dt-bindings: memory: renesas,rpc-if: Add support for RZ/G2 Series
  memory: emif: Use DEFINE_SPINLOCK() for spinlock
  memory: mtk-smi: Fix PM usage counter unbalance in mtk_smi ops

Link: https://lore.kernel.org/r/20210131180109.11510-1-krzk@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2021-02-02 22:19:40 +01:00
commit 993fd7d6fe
6 changed files with 34 additions and 31 deletions

View File

@ -26,10 +26,14 @@ properties:
compatible:
items:
- enum:
- renesas,r8a774a1-rpc-if # RZ/G2M
- renesas,r8a774b1-rpc-if # RZ/G2N
- renesas,r8a774c0-rpc-if # RZ/G2E
- renesas,r8a774e1-rpc-if # RZ/G2H
- renesas,r8a77970-rpc-if # R-Car V3M
- renesas,r8a77980-rpc-if # R-Car V3H
- renesas,r8a77995-rpc-if # R-Car D3
- const: renesas,rcar-gen3-rpc-if # a generic R-Car gen3 device
- const: renesas,rcar-gen3-rpc-if # a generic R-Car gen3 or RZ/G2 device
reg:
items:

View File

@ -173,7 +173,7 @@ config JZ4780_NEMC
memory devices such as NAND and SRAM.
config MTK_SMI
bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
tristate "MediaTek SoC Memory Controller driver" if COMPILE_TEST
depends on ARCH_MEDIATEK || COMPILE_TEST
help
This driver is for the Memory Controller module in MediaTek SoCs,
@ -202,9 +202,9 @@ config RENESAS_RPCIF
depends on ARCH_RENESAS || COMPILE_TEST
select REGMAP_MMIO
help
This supports Renesas R-Car Gen3 RPC-IF which provides either SPI
host or HyperFlash. You'll have to select individual components
under the corresponding menu.
This supports Renesas R-Car Gen3 or RZ/G2 RPC-IF which provides
either SPI host or HyperFlash. You'll have to select individual
components under the corresponding menu.
config STM32_FMC2_EBI
tristate "Support for FMC2 External Bus Interface on STM32MP SoCs"

View File

@ -70,7 +70,7 @@ struct emif_data {
};
static struct emif_data *emif1;
static spinlock_t emif_lock;
static DEFINE_SPINLOCK(emif_lock);
static unsigned long irq_state;
static u32 t_ck; /* DDR clock period in ps */
static LIST_HEAD(device_list);
@ -1531,7 +1531,6 @@ static int __init_or_module emif_probe(struct platform_device *pdev)
/* One-time actions taken on probing the first device */
if (!emif1) {
emif1 = emif;
spin_lock_init(&emif_lock);
/*
* TODO: register notifiers for frequency and voltage

View File

@ -130,7 +130,7 @@ static void mtk_smi_clk_disable(const struct mtk_smi *smi)
int mtk_smi_larb_get(struct device *larbdev)
{
int ret = pm_runtime_get_sync(larbdev);
int ret = pm_runtime_resume_and_get(larbdev);
return (ret < 0) ? ret : 0;
}
@ -374,7 +374,7 @@ static int __maybe_unused mtk_smi_larb_resume(struct device *dev)
int ret;
/* Power on smi-common. */
ret = pm_runtime_get_sync(larb->smi_common_dev);
ret = pm_runtime_resume_and_get(larb->smi_common_dev);
if (ret < 0) {
dev_err(dev, "Failed to pm get for smi-common(%d).\n", ret);
return ret;
@ -587,26 +587,22 @@ static struct platform_driver mtk_smi_common_driver = {
}
};
static struct platform_driver * const smidrivers[] = {
&mtk_smi_common_driver,
&mtk_smi_larb_driver,
};
static int __init mtk_smi_init(void)
{
int ret;
ret = platform_driver_register(&mtk_smi_common_driver);
if (ret != 0) {
pr_err("Failed to register SMI driver\n");
return ret;
}
ret = platform_driver_register(&mtk_smi_larb_driver);
if (ret != 0) {
pr_err("Failed to register SMI-LARB driver\n");
goto err_unreg_smi;
}
return ret;
err_unreg_smi:
platform_driver_unregister(&mtk_smi_common_driver);
return ret;
return platform_register_drivers(smidrivers, ARRAY_SIZE(smidrivers));
}
module_init(mtk_smi_init);
static void __exit mtk_smi_exit(void)
{
platform_unregister_drivers(smidrivers, ARRAY_SIZE(smidrivers));
}
module_exit(mtk_smi_exit);
MODULE_DESCRIPTION("MediaTek SMI driver");
MODULE_LICENSE("GPL v2");

View File

@ -378,8 +378,10 @@ static int aemif_probe(struct platform_device *pdev)
*/
for_each_available_child_of_node(np, child_np) {
ret = of_aemif_parse_abus_config(pdev, child_np);
if (ret < 0)
if (ret < 0) {
of_node_put(child_np);
goto error;
}
}
} else if (pdata && pdata->num_abus_data > 0) {
for (i = 0; i < pdata->num_abus_data; i++, aemif->num_cs++) {
@ -405,8 +407,10 @@ static int aemif_probe(struct platform_device *pdev)
for_each_available_child_of_node(np, child_np) {
ret = of_platform_populate(child_np, NULL,
dev_lookup, dev);
if (ret < 0)
if (ret < 0) {
of_node_put(child_np);
goto error;
}
}
} else if (pdata) {
for (i = 0; i < pdata->num_sub_devices; i++) {

View File

@ -9,7 +9,7 @@
#include <linux/bitops.h>
#include <linux/device.h>
#ifdef CONFIG_MTK_SMI
#if IS_ENABLED(CONFIG_MTK_SMI)
#define MTK_LARB_NR_MAX 16