* [PATCH v5 1/8] ARM: EXYNOS: remove unused static mapping of CMU for exynos5
2015-10-20 9:15 [PATCH v5 0/8] Add support for Exynos SROM Controller driver Pankaj Dubey
@ 2015-10-20 9:15 ` Pankaj Dubey
2015-10-20 9:15 ` [PATCH v5 2/8] ARM: EXYNOS: code cleanup in map.h Pankaj Dubey
` (7 subsequent siblings)
8 siblings, 0 replies; 19+ messages in thread
From: Pankaj Dubey @ 2015-10-20 9:15 UTC (permalink / raw)
To: linux-arm-kernel
Remove unused static mapping of exynos5 CMU and related code.
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
arch/arm/mach-exynos/exynos.c | 5 -----
arch/arm/mach-exynos/include/mach/map.h | 1 -
2 files changed, 6 deletions(-)
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 1c47aee..524aa6f 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -70,11 +70,6 @@ static struct map_desc exynos5_iodesc[] __initdata = {
.pfn = __phys_to_pfn(EXYNOS5_PA_SROMC),
.length = SZ_4K,
.type = MT_DEVICE,
- }, {
- .virtual = (unsigned long)S5P_VA_CMU,
- .pfn = __phys_to_pfn(EXYNOS5_PA_CMU),
- .length = 144 * SZ_1K,
- .type = MT_DEVICE,
},
};
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index de3ae59..a2acba3 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -25,7 +25,6 @@
#define EXYNOS_PA_CHIPID 0x10000000
#define EXYNOS4_PA_CMU 0x10030000
-#define EXYNOS5_PA_CMU 0x10010000
#define EXYNOS4_PA_DMC0 0x10400000
#define EXYNOS4_PA_DMC1 0x10410000
--
2.4.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 2/8] ARM: EXYNOS: code cleanup in map.h
2015-10-20 9:15 [PATCH v5 0/8] Add support for Exynos SROM Controller driver Pankaj Dubey
2015-10-20 9:15 ` [PATCH v5 1/8] ARM: EXYNOS: remove unused static mapping of CMU for exynos5 Pankaj Dubey
@ 2015-10-20 9:15 ` Pankaj Dubey
2015-10-20 9:15 ` [PATCH v5 3/8] Documentation: dt-bindings: add exynos-srom binding information Pankaj Dubey
` (6 subsequent siblings)
8 siblings, 0 replies; 19+ messages in thread
From: Pankaj Dubey @ 2015-10-20 9:15 UTC (permalink / raw)
To: linux-arm-kernel
Remove unused exynos5440 uart offset macro.
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
arch/arm/mach-exynos/include/mach/map.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index a2acba3..86d8085 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -35,8 +35,4 @@
#define EXYNOS4_PA_SROMC 0x12570000
#define EXYNOS5_PA_SROMC 0x12250000
-/* Compatibility UART */
-
-#define EXYNOS5440_PA_UART0 0x000B0000
-
#endif /* __ASM_ARCH_MAP_H */
--
2.4.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 3/8] Documentation: dt-bindings: add exynos-srom binding information
2015-10-20 9:15 [PATCH v5 0/8] Add support for Exynos SROM Controller driver Pankaj Dubey
2015-10-20 9:15 ` [PATCH v5 1/8] ARM: EXYNOS: remove unused static mapping of CMU for exynos5 Pankaj Dubey
2015-10-20 9:15 ` [PATCH v5 2/8] ARM: EXYNOS: code cleanup in map.h Pankaj Dubey
@ 2015-10-20 9:15 ` Pankaj Dubey
2015-10-20 9:15 ` [PATCH v5 4/8] ARM: dts: add SROM device node for exynos4 Pankaj Dubey
` (5 subsequent siblings)
8 siblings, 0 replies; 19+ messages in thread
From: Pankaj Dubey @ 2015-10-20 9:15 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds exynos-srom binding information for SROM Controller
driver on Exynos SoCs.
CC: Rob Herring <robh+dt@kernel.org>
CC: Mark Rutland <mark.rutland@arm.com>
CC: Ian Campbell <ijc+devicetree@hellion.org.uk>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
.../devicetree/bindings/arm/samsung/exynos-srom.txt | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt
diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt
new file mode 100644
index 0000000..33886d5
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt
@@ -0,0 +1,12 @@
+SAMSUNG Exynos SoCs SROM Controller driver.
+
+Required properties:
+- compatible : Should contain "samsung,exynos-srom".
+
+- reg: offset and length of the register set
+
+Example:
+ sromc at 12570000 {
+ compatible = "samsung,exynos-srom";
+ reg = <0x12570000 0x10>;
+ };
--
2.4.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 4/8] ARM: dts: add SROM device node for exynos4
2015-10-20 9:15 [PATCH v5 0/8] Add support for Exynos SROM Controller driver Pankaj Dubey
` (2 preceding siblings ...)
2015-10-20 9:15 ` [PATCH v5 3/8] Documentation: dt-bindings: add exynos-srom binding information Pankaj Dubey
@ 2015-10-20 9:15 ` Pankaj Dubey
2015-10-20 9:15 ` [PATCH v5 5/8] ARM: dts: add SROM device node for exynos5 Pankaj Dubey
` (4 subsequent siblings)
8 siblings, 0 replies; 19+ messages in thread
From: Pankaj Dubey @ 2015-10-20 9:15 UTC (permalink / raw)
To: linux-arm-kernel
Add device node of SROM controller for exynos4.
CC: Rob Herring <robh+dt@kernel.org>
CC: Mark Rutland <mark.rutland@arm.com>
CC: Ian Campbell <ijc+devicetree@hellion.org.uk>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
arch/arm/boot/dts/exynos4.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 3184e10..2f31f77 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -76,6 +76,11 @@
reg = <0x10000000 0x100>;
};
+ sromc at 12570000 {
+ compatible = "samsung,exynos-srom";
+ reg = <0x12570000 0x10>;
+ };
+
mipi_phy: video-phy at 10020710 {
compatible = "samsung,s5pv210-mipi-video-phy";
#phy-cells = <1>;
--
2.4.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 5/8] ARM: dts: add SROM device node for exynos5
2015-10-20 9:15 [PATCH v5 0/8] Add support for Exynos SROM Controller driver Pankaj Dubey
` (3 preceding siblings ...)
2015-10-20 9:15 ` [PATCH v5 4/8] ARM: dts: add SROM device node for exynos4 Pankaj Dubey
@ 2015-10-20 9:15 ` Pankaj Dubey
2015-10-20 9:15 ` [PATCH v5 6/8] drivers: soc: add support for exynos SROM driver Pankaj Dubey
` (3 subsequent siblings)
8 siblings, 0 replies; 19+ messages in thread
From: Pankaj Dubey @ 2015-10-20 9:15 UTC (permalink / raw)
To: linux-arm-kernel
Add SROM controller device node for exynos5.
CC: Rob Herring <robh+dt@kernel.org>
CC: Mark Rutland <mark.rutland@arm.com>
CC: Ian Campbell <ijc+devicetree@hellion.org.uk>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
arch/arm/boot/dts/exynos5.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
index 110dbd4..b5d3437 100644
--- a/arch/arm/boot/dts/exynos5.dtsi
+++ b/arch/arm/boot/dts/exynos5.dtsi
@@ -30,6 +30,11 @@
reg = <0x10000000 0x100>;
};
+ sromc at 12250000 {
+ compatible = "samsung,exynos-srom";
+ reg = <0x12250000 0x10>;
+ };
+
combiner: interrupt-controller at 10440000 {
compatible = "samsung,exynos4210-combiner";
#interrupt-cells = <2>;
--
2.4.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 6/8] drivers: soc: add support for exynos SROM driver
2015-10-20 9:15 [PATCH v5 0/8] Add support for Exynos SROM Controller driver Pankaj Dubey
` (4 preceding siblings ...)
2015-10-20 9:15 ` [PATCH v5 5/8] ARM: dts: add SROM device node for exynos5 Pankaj Dubey
@ 2015-10-20 9:15 ` Pankaj Dubey
2015-10-20 11:14 ` Andi Shyti
2015-10-20 12:37 ` Krzysztof Kozlowski
2015-10-20 9:15 ` [PATCH v5 7/8] MAINTAINERS: add maintainers entry for drivers/soc/samsung Pankaj Dubey
` (2 subsequent siblings)
8 siblings, 2 replies; 19+ messages in thread
From: Pankaj Dubey @ 2015-10-20 9:15 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds Exynos SROM controller driver which will handle
save restore of SROM registers during S2R.
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
drivers/soc/Kconfig | 1 +
drivers/soc/Makefile | 1 +
drivers/soc/samsung/Kconfig | 13 +++
drivers/soc/samsung/Makefile | 1 +
drivers/soc/samsung/exynos-srom.c | 175 ++++++++++++++++++++++++++++++++++++++
drivers/soc/samsung/exynos-srom.h | 51 +++++++++++
6 files changed, 242 insertions(+)
create mode 100644 drivers/soc/samsung/Kconfig
create mode 100644 drivers/soc/samsung/Makefile
create mode 100644 drivers/soc/samsung/exynos-srom.c
create mode 100644 drivers/soc/samsung/exynos-srom.h
diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
index 96ddecb..69107c9 100644
--- a/drivers/soc/Kconfig
+++ b/drivers/soc/Kconfig
@@ -2,6 +2,7 @@ menu "SOC (System On Chip) specific Drivers"
source "drivers/soc/mediatek/Kconfig"
source "drivers/soc/qcom/Kconfig"
+source "drivers/soc/samsung/Kconfig"
source "drivers/soc/sunxi/Kconfig"
source "drivers/soc/ti/Kconfig"
source "drivers/soc/versatile/Kconfig"
diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
index 0b12d77..a623616 100644
--- a/drivers/soc/Makefile
+++ b/drivers/soc/Makefile
@@ -5,6 +5,7 @@
obj-$(CONFIG_MACH_DOVE) += dove/
obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/
obj-$(CONFIG_ARCH_QCOM) += qcom/
+obj-$(CONFIG_SOC_SAMSUNG) += samsung/
obj-$(CONFIG_ARCH_SUNXI) += sunxi/
obj-$(CONFIG_ARCH_TEGRA) += tegra/
obj-$(CONFIG_SOC_TI) += ti/
diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig
new file mode 100644
index 0000000..2833b5b
--- /dev/null
+++ b/drivers/soc/samsung/Kconfig
@@ -0,0 +1,13 @@
+#
+# SAMSUNG SoC drivers
+#
+menu "Samsung SOC driver support"
+
+config SOC_SAMSUNG
+ bool
+
+config EXYNOS_SROM
+ bool
+ depends on ARM && ARCH_EXYNOS && PM
+
+endmenu
diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile
new file mode 100644
index 0000000..9c554d5
--- /dev/null
+++ b/drivers/soc/samsung/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_EXYNOS_SROM) += exynos-srom.o
diff --git a/drivers/soc/samsung/exynos-srom.c b/drivers/soc/samsung/exynos-srom.c
new file mode 100644
index 0000000..57a232d
--- /dev/null
+++ b/drivers/soc/samsung/exynos-srom.c
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * EXYNOS - SROM Controller support
+ * Author: Pankaj Dubey <pankaj.dubey@samsung.com>
+ *
+ * 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.
+ */
+
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+
+#include "exynos-srom.h"
+
+static const unsigned long exynos_srom_offsets[] = {
+ /* SROM side */
+ EXYNOS_SROM_BW,
+ EXYNOS_SROM_BC0,
+ EXYNOS_SROM_BC1,
+ EXYNOS_SROM_BC2,
+ EXYNOS_SROM_BC3,
+};
+
+/**
+ * struct exynos_srom_reg_dump: register dump of SROM Controller registers.
+ * @offset: srom register offset from the controller base address.
+ * @value: the value of register under the offset.
+ */
+struct exynos_srom_reg_dump {
+ u32 offset;
+ u32 value;
+};
+
+/**
+ * struct exynos_srom: platform data for exynos srom controller driver.
+ * @dev: platform device pointer
+ * @reg_base: srom base address
+ * @reg_offset: exynos_srom_reg_dump pointer to hold offset and its value.
+ */
+struct exynos_srom {
+ struct device *dev;
+ void __iomem *reg_base;
+ struct exynos_srom_reg_dump *reg_offset;
+};
+
+static struct exynos_srom_reg_dump *exynos_srom_alloc_reg_dump(
+ const unsigned long *rdump,
+ unsigned long nr_rdump)
+{
+ struct exynos_srom_reg_dump *rd;
+ unsigned int i;
+
+ rd = kcalloc(nr_rdump, sizeof(*rd), GFP_KERNEL);
+ if (!rd)
+ return NULL;
+
+ for (i = 0; i < nr_rdump; ++i)
+ rd[i].offset = rdump[i];
+
+ return rd;
+}
+
+static int exynos_srom_probe(struct platform_device *pdev)
+{
+ struct device_node *np;
+ struct exynos_srom *srom;
+ struct device *dev = &pdev->dev;
+
+ np = dev->of_node;
+ if (!np) {
+ dev_err(&pdev->dev, "could not find device info\n");
+ return -EINVAL;
+ }
+
+ srom = devm_kzalloc(&pdev->dev,
+ sizeof(struct exynos_srom), GFP_KERNEL);
+ if (!srom)
+ return -ENOMEM;
+
+ srom->dev = dev;
+ srom->reg_base = of_iomap(np, 0);
+ if (!srom->reg_base) {
+ dev_err(&pdev->dev, "iomap of exynos srom controller failed\n");
+ return -ENOMEM;
+ }
+
+ platform_set_drvdata(pdev, srom);
+
+ srom->reg_offset = exynos_srom_alloc_reg_dump(exynos_srom_offsets,
+ sizeof(exynos_srom_offsets));
+ if (!srom->reg_offset) {
+ iounmap(srom->reg_base);
+ return -ENOMEM;
+ }
+
+ return 0;
+}
+
+static int exynos_srom_remove(struct platform_device *pdev)
+{
+ struct exynos_srom *srom = platform_get_drvdata(pdev);
+
+ kfree(srom->reg_offset);
+ iounmap(srom->reg_base);
+
+ return 0;
+}
+
+#ifdef CONFIG_PM_SLEEP
+static void exynos_srom_save(void __iomem *base,
+ struct exynos_srom_reg_dump *rd,
+ unsigned int num_regs)
+{
+ for (; num_regs > 0; --num_regs, ++rd)
+ rd->value = readl(base + rd->offset);
+}
+
+static void exynos_srom_restore(void __iomem *base,
+ const struct exynos_srom_reg_dump *rd,
+ unsigned int num_regs)
+{
+ for (; num_regs > 0; --num_regs, ++rd)
+ writel(rd->value, base + rd->offset);
+}
+
+static int exynos_srom_suspend(struct device *dev)
+{
+ struct exynos_srom *srom = dev_get_drvdata(dev);
+
+ exynos_srom_save(srom->reg_base, srom->reg_offset,
+ ARRAY_SIZE(exynos_srom_offsets));
+ return 0;
+}
+
+static int exynos_srom_resume(struct device *dev)
+{
+ struct exynos_srom *srom = dev_get_drvdata(dev);
+
+ exynos_srom_restore(srom->reg_base, srom->reg_offset,
+ ARRAY_SIZE(exynos_srom_offsets));
+ return 0;
+}
+#endif
+
+static const struct of_device_id of_exynos_srom_ids[] = {
+ {
+ .compatible = "samsung,exynos-srom",
+ },
+ {},
+};
+MODULE_DEVICE_TABLE(of, of_exynos_srom_ids);
+
+static SIMPLE_DEV_PM_OPS(exynos_srom_pm_ops, exynos_srom_suspend, exynos_srom_resume);
+
+static struct platform_driver exynos_srom_driver = {
+ .probe = exynos_srom_probe,
+ .remove = exynos_srom_remove,
+ .driver = {
+ .name = "exynos-srom",
+ .of_match_table = of_exynos_srom_ids,
+ .pm = &exynos_srom_pm_ops,
+ },
+};
+module_platform_driver(exynos_srom_driver);
+
+MODULE_AUTHOR("Pankaj Dubey <pankaj.dubey@samsung.com>");
+MODULE_DESCRIPTION("Exynos SROM Controller Driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/soc/samsung/exynos-srom.h b/drivers/soc/samsung/exynos-srom.h
new file mode 100644
index 0000000..34660c6
--- /dev/null
+++ b/drivers/soc/samsung/exynos-srom.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * Exynos SROMC register definitions
+ *
+ * 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 __EXYNOS_SROM_H
+#define __EXYNOS_SROM_H __FILE__
+
+#define EXYNOS_SROMREG(x) (x)
+
+#define EXYNOS_SROM_BW EXYNOS_SROMREG(0x0)
+#define EXYNOS_SROM_BC0 EXYNOS_SROMREG(0x4)
+#define EXYNOS_SROM_BC1 EXYNOS_SROMREG(0x8)
+#define EXYNOS_SROM_BC2 EXYNOS_SROMREG(0xc)
+#define EXYNOS_SROM_BC3 EXYNOS_SROMREG(0x10)
+#define EXYNOS_SROM_BC4 EXYNOS_SROMREG(0x14)
+#define EXYNOS_SROM_BC5 EXYNOS_SROMREG(0x18)
+
+/* one register BW holds 4 x 4-bit packed settings for NCS0 - NCS3 */
+
+#define EXYNOS_SROM_BW__DATAWIDTH__SHIFT 0
+#define EXYNOS_SROM_BW__ADDRMODE__SHIFT 1
+#define EXYNOS_SROM_BW__WAITENABLE__SHIFT 2
+#define EXYNOS_SROM_BW__BYTEENABLE__SHIFT 3
+
+#define EXYNOS_SROM_BW__CS_MASK 0xf
+
+#define EXYNOS_SROM_BW__NCS0__SHIFT 0
+#define EXYNOS_SROM_BW__NCS1__SHIFT 4
+#define EXYNOS_SROM_BW__NCS2__SHIFT 8
+#define EXYNOS_SROM_BW__NCS3__SHIFT 12
+#define EXYNOS_SROM_BW__NCS4__SHIFT 16
+#define EXYNOS_SROM_BW__NCS5__SHIFT 20
+
+/* applies to same to BCS0 - BCS3 */
+
+#define EXYNOS_SROM_BCX__PMC__SHIFT 0
+#define EXYNOS_SROM_BCX__TACP__SHIFT 4
+#define EXYNOS_SROM_BCX__TCAH__SHIFT 8
+#define EXYNOS_SROM_BCX__TCOH__SHIFT 12
+#define EXYNOS_SROM_BCX__TACC__SHIFT 16
+#define EXYNOS_SROM_BCX__TCOS__SHIFT 24
+#define EXYNOS_SROM_BCX__TACS__SHIFT 28
+
+#endif /* __EXYNOS_SROM_H */
--
2.4.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 6/8] drivers: soc: add support for exynos SROM driver
2015-10-20 9:15 ` [PATCH v5 6/8] drivers: soc: add support for exynos SROM driver Pankaj Dubey
@ 2015-10-20 11:14 ` Andi Shyti
2015-10-20 12:37 ` Krzysztof Kozlowski
1 sibling, 0 replies; 19+ messages in thread
From: Andi Shyti @ 2015-10-20 11:14 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Oct 20, 2015 at 02:45:37PM +0530, Pankaj Dubey wrote:
> This patch adds Exynos SROM controller driver which will handle
> save restore of SROM registers during S2R.
>
> Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
...
> +config EXYNOS_SROM
> + bool
> + depends on ARM && ARCH_EXYNOS && PM
Cool, thanks! If you want you can add my review.
Andi
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v5 6/8] drivers: soc: add support for exynos SROM driver
2015-10-20 9:15 ` [PATCH v5 6/8] drivers: soc: add support for exynos SROM driver Pankaj Dubey
2015-10-20 11:14 ` Andi Shyti
@ 2015-10-20 12:37 ` Krzysztof Kozlowski
1 sibling, 0 replies; 19+ messages in thread
From: Krzysztof Kozlowski @ 2015-10-20 12:37 UTC (permalink / raw)
To: linux-arm-kernel
W dniu 20.10.2015 o 18:15, Pankaj Dubey pisze:
> This patch adds Exynos SROM controller driver which will handle
> save restore of SROM registers during S2R.
>
> Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
> ---
> drivers/soc/Kconfig | 1 +
> drivers/soc/Makefile | 1 +
> drivers/soc/samsung/Kconfig | 13 +++
> drivers/soc/samsung/Makefile | 1 +
> drivers/soc/samsung/exynos-srom.c | 175 ++++++++++++++++++++++++++++++++++++++
> drivers/soc/samsung/exynos-srom.h | 51 +++++++++++
> 6 files changed, 242 insertions(+)
> create mode 100644 drivers/soc/samsung/Kconfig
> create mode 100644 drivers/soc/samsung/Makefile
> create mode 100644 drivers/soc/samsung/exynos-srom.c
> create mode 100644 drivers/soc/samsung/exynos-srom.h
>
Looks good to me, thanks:
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v5 7/8] MAINTAINERS: add maintainers entry for drivers/soc/samsung
2015-10-20 9:15 [PATCH v5 0/8] Add support for Exynos SROM Controller driver Pankaj Dubey
` (5 preceding siblings ...)
2015-10-20 9:15 ` [PATCH v5 6/8] drivers: soc: add support for exynos SROM driver Pankaj Dubey
@ 2015-10-20 9:15 ` Pankaj Dubey
2015-10-20 9:15 ` [PATCH v5 8/8] ARM: EXYNOS: Remove SROM related register settings from mach-exynos Pankaj Dubey
2015-10-21 0:34 ` [PATCH v5 0/8] Add support for Exynos SROM Controller driver Krzysztof Kozlowski
8 siblings, 0 replies; 19+ messages in thread
From: Pankaj Dubey @ 2015-10-20 9:15 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds maintainers entry for new driver folder
drivers/soc/samsung
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 7ba7ab7..262bba6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1438,6 +1438,7 @@ F: arch/arm/mach-exynos*/
F: drivers/*/*s3c2410*
F: drivers/*/*/*s3c2410*
F: drivers/spi/spi-s3c*
+F: drivers/soc/samsung/*
F: sound/soc/samsung/*
N: exynos
--
2.4.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 8/8] ARM: EXYNOS: Remove SROM related register settings from mach-exynos
2015-10-20 9:15 [PATCH v5 0/8] Add support for Exynos SROM Controller driver Pankaj Dubey
` (6 preceding siblings ...)
2015-10-20 9:15 ` [PATCH v5 7/8] MAINTAINERS: add maintainers entry for drivers/soc/samsung Pankaj Dubey
@ 2015-10-20 9:15 ` Pankaj Dubey
2015-10-23 18:34 ` Kukjin Kim
2015-10-21 0:34 ` [PATCH v5 0/8] Add support for Exynos SROM Controller driver Krzysztof Kozlowski
8 siblings, 1 reply; 19+ messages in thread
From: Pankaj Dubey @ 2015-10-20 9:15 UTC (permalink / raw)
To: linux-arm-kernel
As now we have dedicated driver for SROM controller, it will take care
of saving register banks during S2R so we can safely remove these
settings from mach-exynos.
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
arch/arm/mach-exynos/Kconfig | 2 ++
arch/arm/mach-exynos/exynos.c | 17 ---------
arch/arm/mach-exynos/include/mach/map.h | 3 --
arch/arm/mach-exynos/regs-srom.h | 53 ----------------------------
arch/arm/mach-exynos/suspend.c | 20 ++---------
arch/arm/plat-samsung/include/plat/map-s5p.h | 1 -
6 files changed, 4 insertions(+), 92 deletions(-)
delete mode 100644 arch/arm/mach-exynos/regs-srom.h
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 3a10f1a..62c3139 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -27,6 +27,8 @@ menuconfig ARCH_EXYNOS
select SRAM
select THERMAL
select MFD_SYSCON
+ select SOC_SAMSUNG
+ select EXYNOS_SROM if PM
help
Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5)
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 524aa6f..4ffb90e 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -37,11 +37,6 @@ void __iomem *pmu_base_addr;
static struct map_desc exynos4_iodesc[] __initdata = {
{
- .virtual = (unsigned long)S5P_VA_SROMC,
- .pfn = __phys_to_pfn(EXYNOS4_PA_SROMC),
- .length = SZ_4K,
- .type = MT_DEVICE,
- }, {
.virtual = (unsigned long)S5P_VA_CMU,
.pfn = __phys_to_pfn(EXYNOS4_PA_CMU),
.length = SZ_128K,
@@ -64,15 +59,6 @@ static struct map_desc exynos4_iodesc[] __initdata = {
},
};
-static struct map_desc exynos5_iodesc[] __initdata = {
- {
- .virtual = (unsigned long)S5P_VA_SROMC,
- .pfn = __phys_to_pfn(EXYNOS5_PA_SROMC),
- .length = SZ_4K,
- .type = MT_DEVICE,
- },
-};
-
static struct platform_device exynos_cpuidle = {
.name = "exynos_cpuidle",
#ifdef CONFIG_ARM_EXYNOS_CPUIDLE
@@ -144,9 +130,6 @@ static void __init exynos_map_io(void)
{
if (soc_is_exynos4())
iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc));
-
- if (soc_is_exynos5())
- iotable_init(exynos5_iodesc, ARRAY_SIZE(exynos5_iodesc));
}
static void __init exynos_init_io(void)
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index 86d8085..351e839 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -32,7 +32,4 @@
#define EXYNOS4_PA_COREPERI 0x10500000
#define EXYNOS4_PA_L2CC 0x10502000
-#define EXYNOS4_PA_SROMC 0x12570000
-#define EXYNOS5_PA_SROMC 0x12250000
-
#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-exynos/regs-srom.h b/arch/arm/mach-exynos/regs-srom.h
deleted file mode 100644
index 5c4d442..0000000
--- a/arch/arm/mach-exynos/regs-srom.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2010 Samsung Electronics Co., Ltd.
- * http://www.samsung.com
- *
- * S5P SROMC register definitions
- *
- * 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 __PLAT_SAMSUNG_REGS_SROM_H
-#define __PLAT_SAMSUNG_REGS_SROM_H __FILE__
-
-#include <mach/map.h>
-
-#define S5P_SROMREG(x) (S5P_VA_SROMC + (x))
-
-#define S5P_SROM_BW S5P_SROMREG(0x0)
-#define S5P_SROM_BC0 S5P_SROMREG(0x4)
-#define S5P_SROM_BC1 S5P_SROMREG(0x8)
-#define S5P_SROM_BC2 S5P_SROMREG(0xc)
-#define S5P_SROM_BC3 S5P_SROMREG(0x10)
-#define S5P_SROM_BC4 S5P_SROMREG(0x14)
-#define S5P_SROM_BC5 S5P_SROMREG(0x18)
-
-/* one register BW holds 4 x 4-bit packed settings for NCS0 - NCS3 */
-
-#define S5P_SROM_BW__DATAWIDTH__SHIFT 0
-#define S5P_SROM_BW__ADDRMODE__SHIFT 1
-#define S5P_SROM_BW__WAITENABLE__SHIFT 2
-#define S5P_SROM_BW__BYTEENABLE__SHIFT 3
-
-#define S5P_SROM_BW__CS_MASK 0xf
-
-#define S5P_SROM_BW__NCS0__SHIFT 0
-#define S5P_SROM_BW__NCS1__SHIFT 4
-#define S5P_SROM_BW__NCS2__SHIFT 8
-#define S5P_SROM_BW__NCS3__SHIFT 12
-#define S5P_SROM_BW__NCS4__SHIFT 16
-#define S5P_SROM_BW__NCS5__SHIFT 20
-
-/* applies to same to BCS0 - BCS3 */
-
-#define S5P_SROM_BCX__PMC__SHIFT 0
-#define S5P_SROM_BCX__TACP__SHIFT 4
-#define S5P_SROM_BCX__TCAH__SHIFT 8
-#define S5P_SROM_BCX__TCOH__SHIFT 12
-#define S5P_SROM_BCX__TACC__SHIFT 16
-#define S5P_SROM_BCX__TCOS__SHIFT 24
-#define S5P_SROM_BCX__TACS__SHIFT 28
-
-#endif /* __PLAT_SAMSUNG_REGS_SROM_H */
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
index e00eb39..21abd9b 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -31,12 +31,13 @@
#include <asm/smp_scu.h>
#include <asm/suspend.h>
+#include <mach/map.h>
+
#include <plat/pm-common.h>
#include "common.h"
#include "exynos-pmu.h"
#include "regs-pmu.h"
-#include "regs-srom.h"
#define REG_TABLE_END (-1U)
@@ -52,15 +53,6 @@ struct exynos_wkup_irq {
u32 mask;
};
-static struct sleep_save exynos_core_save[] = {
- /* SROM side */
- SAVE_ITEM(S5P_SROM_BW),
- SAVE_ITEM(S5P_SROM_BC0),
- SAVE_ITEM(S5P_SROM_BC1),
- SAVE_ITEM(S5P_SROM_BC2),
- SAVE_ITEM(S5P_SROM_BC3),
-};
-
struct exynos_pm_data {
const struct exynos_wkup_irq *wkup_irq;
unsigned int wake_disable_mask;
@@ -339,8 +331,6 @@ static void exynos_pm_prepare(void)
/* Set wake-up mask registers */
exynos_pm_set_wakeup_mask();
- s3c_pm_do_save(exynos_core_save, ARRAY_SIZE(exynos_core_save));
-
exynos_pm_enter_sleep_mode();
/* ensure at least INFORM0 has the resume address */
@@ -371,8 +361,6 @@ static void exynos5420_pm_prepare(void)
/* Set wake-up mask registers */
exynos_pm_set_wakeup_mask();
- s3c_pm_do_save(exynos_core_save, ARRAY_SIZE(exynos_core_save));
-
exynos_pmu_spare3 = pmu_raw_readl(S5P_PMU_SPARE3);
/*
* The cpu state needs to be saved and restored so that the
@@ -463,8 +451,6 @@ static void exynos_pm_resume(void)
/* For release retention */
exynos_pm_release_retention();
- s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save));
-
if (cpuid == ARM_CPU_PART_CORTEX_A9)
scu_enable(S5P_VA_SCU);
@@ -531,8 +517,6 @@ static void exynos5420_pm_resume(void)
pmu_raw_writel(exynos_pmu_spare3, S5P_PMU_SPARE3);
- s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save));
-
early_wakeup:
tmp = pmu_raw_readl(EXYNOS5420_SFR_AXI_CGDIS1);
diff --git a/arch/arm/plat-samsung/include/plat/map-s5p.h b/arch/arm/plat-samsung/include/plat/map-s5p.h
index f5cf2bd..e555769 100644
--- a/arch/arm/plat-samsung/include/plat/map-s5p.h
+++ b/arch/arm/plat-samsung/include/plat/map-s5p.h
@@ -18,7 +18,6 @@
#define S5P_VA_DMC0 S3C_ADDR(0x02440000)
#define S5P_VA_DMC1 S3C_ADDR(0x02480000)
-#define S5P_VA_SROMC S3C_ADDR(0x024C0000)
#define S5P_VA_COREPERI_BASE S3C_ADDR(0x02800000)
#define S5P_VA_COREPERI(x) (S5P_VA_COREPERI_BASE + (x))
--
2.4.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v5 8/8] ARM: EXYNOS: Remove SROM related register settings from mach-exynos
2015-10-20 9:15 ` [PATCH v5 8/8] ARM: EXYNOS: Remove SROM related register settings from mach-exynos Pankaj Dubey
@ 2015-10-23 18:34 ` Kukjin Kim
0 siblings, 0 replies; 19+ messages in thread
From: Kukjin Kim @ 2015-10-23 18:34 UTC (permalink / raw)
To: linux-arm-kernel
On 10/20/15 18:15, Pankaj Dubey wrote:
> As now we have dedicated driver for SROM controller, it will take care
> of saving register banks during S2R so we can safely remove these
> settings from mach-exynos.
>
> Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> ---
> arch/arm/mach-exynos/Kconfig | 2 ++
> arch/arm/mach-exynos/exynos.c | 17 ---------
> arch/arm/mach-exynos/include/mach/map.h | 3 --
> arch/arm/mach-exynos/regs-srom.h | 53 ----------------------------
> arch/arm/mach-exynos/suspend.c | 20 ++---------
> arch/arm/plat-samsung/include/plat/map-s5p.h | 1 -
> 6 files changed, 4 insertions(+), 92 deletions(-)
> delete mode 100644 arch/arm/mach-exynos/regs-srom.h
>
> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
> index 3a10f1a..62c3139 100644
> --- a/arch/arm/mach-exynos/Kconfig
> +++ b/arch/arm/mach-exynos/Kconfig
> @@ -27,6 +27,8 @@ menuconfig ARCH_EXYNOS
> select SRAM
> select THERMAL
> select MFD_SYSCON
> + select SOC_SAMSUNG
> + select EXYNOS_SROM if PM
Please add them in alphabetical next time...I've changed the order in
this time.
Thanks,
Kukjin
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v5 0/8] Add support for Exynos SROM Controller driver
2015-10-20 9:15 [PATCH v5 0/8] Add support for Exynos SROM Controller driver Pankaj Dubey
` (7 preceding siblings ...)
2015-10-20 9:15 ` [PATCH v5 8/8] ARM: EXYNOS: Remove SROM related register settings from mach-exynos Pankaj Dubey
@ 2015-10-21 0:34 ` Krzysztof Kozlowski
2015-10-23 9:49 ` Pavel Fedin
8 siblings, 1 reply; 19+ messages in thread
From: Krzysztof Kozlowski @ 2015-10-21 0:34 UTC (permalink / raw)
To: linux-arm-kernel
On 20.10.2015 18:15, Pankaj Dubey wrote:
> This patch set adds support for Exynos SROM controller DT based driver.
> Currently SROM register sets are used only during S2R, so driver
> basically added for taking care of S2R. It will help us in removing
> static mapping from exynos.c and other extra code handline during S2R.
>
> This patch set also updated exynos4 and exynos5 dtsi files for with device
> node for srom, and added binding documentation for the same.
>
> First two patches are some minor cleanup in mach-exynos.
>
> Patchset v1 was posted here[1]
> [1]: https://lkml.org/lkml/2015/4/29/98
> Patchset v2 was posted here[2]
> [2]: https://lkml.org/lkml/2015/8/24/125
> Patchset v3 was posted here[3]
> [3]: https://lkml.org/lkml/2015/10/13/392
> Patchset v3 was posted here[4]
> [4]: https://lkml.org/lkml/2015/10/19/278
>
> This patchset, I have tested on Peach-Pi (Exynos5880) based chromebook for boot
> and S2R functionality.
>
Entire patchset tested on Trats2 (Exynos4412) board. Unless Kukjin picks
it also, I plan to take it for v4.5.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v5 0/8] Add support for Exynos SROM Controller driver
2015-10-21 0:34 ` [PATCH v5 0/8] Add support for Exynos SROM Controller driver Krzysztof Kozlowski
@ 2015-10-23 9:49 ` Pavel Fedin
2015-10-23 18:18 ` Kukjin Kim
0 siblings, 1 reply; 19+ messages in thread
From: Pavel Fedin @ 2015-10-23 9:49 UTC (permalink / raw)
To: linux-arm-kernel
Hello!
> > This patchset, I have tested on Peach-Pi (Exynos5880) based chromebook for boot
> > and S2R functionality.
> >
>
> Entire patchset tested on Trats2 (Exynos4412) board. Unless Kukjin picks
> it also, I plan to take it for v4.5.
Tested on SMDK5410. By the way, what is current status? If this is final revision, can i post my Ethernet support patchset on top
of it?
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v5 0/8] Add support for Exynos SROM Controller driver
2015-10-23 9:49 ` Pavel Fedin
@ 2015-10-23 18:18 ` Kukjin Kim
2015-10-26 6:45 ` Pavel Fedin
2015-11-17 4:59 ` pankaj.dubey
0 siblings, 2 replies; 19+ messages in thread
From: Kukjin Kim @ 2015-10-23 18:18 UTC (permalink / raw)
To: linux-arm-kernel
On 10/23/15 18:49, Pavel Fedin wrote:
> Hello!
>
>>> This patchset, I have tested on Peach-Pi (Exynos5880) based chromebook for boot
>>> and S2R functionality.
>>>
>>
>> Entire patchset tested on Trats2 (Exynos4412) board. Unless Kukjin picks
>> it also, I plan to take it for v4.5.
>
> Tested on SMDK5410. By the way, what is current status? If this is final revision, can i post my Ethernet support patchset on top
> of it?
>
> Tested-by: Pavel Fedin <p.fedin@samsung.com>
>
Applied, this whole series.
Thanks,
Kukjin
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v5 0/8] Add support for Exynos SROM Controller driver
2015-10-23 18:18 ` Kukjin Kim
@ 2015-10-26 6:45 ` Pavel Fedin
2015-10-27 2:15 ` Kukjin Kim
2015-11-17 4:59 ` pankaj.dubey
1 sibling, 1 reply; 19+ messages in thread
From: Pavel Fedin @ 2015-10-26 6:45 UTC (permalink / raw)
To: linux-arm-kernel
Hello!
> Applied, this whole series.
Where can i find the recent code to base my series on? I looked at linux-samsung.git but was unable to find it there.
Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v5 0/8] Add support for Exynos SROM Controller driver
2015-10-23 18:18 ` Kukjin Kim
2015-10-26 6:45 ` Pavel Fedin
@ 2015-11-17 4:59 ` pankaj.dubey
1 sibling, 0 replies; 19+ messages in thread
From: pankaj.dubey @ 2015-11-17 4:59 UTC (permalink / raw)
To: linux-arm-kernel
Hi Kukjin
On Friday 23 October 2015 11:48 PM, Kukjin Kim wrote:
> On 10/23/15 18:49, Pavel Fedin wrote:
>> Hello!
>>
>>>> This patchset, I have tested on Peach-Pi (Exynos5880) based chromebook for boot
>>>> and S2R functionality.
>>>>
>>>
>>> Entire patchset tested on Trats2 (Exynos4412) board. Unless Kukjin picks
>>> it also, I plan to take it for v4.5.
>>
>> Tested on SMDK5410. By the way, what is current status? If this is final revision, can i post my Ethernet support patchset on top
>> of it?
>>
>> Tested-by: Pavel Fedin <p.fedin@samsung.com>
>>
> Applied, this whole series.
>
I just pulled your tree, and I can't find these SROM patches in for-next
(earlier they were present). Also I can see samsung for-next is pointing
to linus/master branch. As this series not landed in linus tree due last
moment changes, So do I need to rebase SROM patches on top of latest
for-next, and send it once again?
Thanks,
Pankaj Dubey
> Thanks,
> Kukjin
>
^ permalink raw reply [flat|nested] 19+ messages in thread