summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJaehoon Chung <jh80.chung@samsung.com>2016-08-01 19:38:41 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:52:09 +0900
commite0b987196390ea414f687fd5c7beb1f961a057c2 (patch)
tree8b4e8d3b1dada63986048070cad97042d31bf1b2 /arch
parent6031f54d4b12dbf19fc4ad60b72d1a386cf4615e (diff)
ARM: exynos: pmu: support the reboot download mode
Support the reboot download mode functionality. It can get from device-treee which INFORM register will be used. If want to use this functionality, it also needs to implement something on bootloader side. Change-Id: Iae42f32d69b84ccdcb39fcfc8bc71f9cc8c42302 Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-exynos/pmu.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index e812c1c85624..611962478221 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -23,6 +23,10 @@
#define PMU_TABLE_END (-1U)
+#define REBOOT_MODE_PREFIX 0x12345670
+#define REBOOT_MODE_NONE 0
+#define REBOOT_MODE_DOWNLOAD 1
+
struct exynos_pmu_conf {
unsigned int offset;
u8 val[NUM_SYS_POWERDOWN];
@@ -40,6 +44,7 @@ struct exynos_pmu_data {
struct exynos_pmu_context {
struct device *dev;
const struct exynos_pmu_data *pmu_data;
+ u32 reboot_inform_reg;
};
static void __iomem *pmu_base_addr;
@@ -878,6 +883,19 @@ static void exynos5420_pmu_init(void)
static int pmu_restart_notify(struct notifier_block *this,
unsigned long code, void *unused)
{
+ char *cmd = (char *)unused;
+
+ if (pmu_context->reboot_inform_reg) {
+ if (cmd && !strncmp(cmd, "download", 8)) {
+ pmu_raw_writel(REBOOT_MODE_PREFIX |
+ REBOOT_MODE_DOWNLOAD,
+ pmu_context->reboot_inform_reg);
+ } else
+ pmu_raw_writel(REBOOT_MODE_PREFIX |
+ REBOOT_MODE_NONE,
+ pmu_context->reboot_inform_reg);
+ }
+
pmu_raw_writel(0x1, EXYNOS_SWRESET);
return NOTIFY_DONE;
@@ -952,7 +970,9 @@ static int exynos_pmu_probe(struct platform_device *pdev)
{
const struct of_device_id *match;
struct device *dev = &pdev->dev;
+ struct device_node *np = dev->of_node;
struct resource *res;
+ u32 inform_reg;
int ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -973,6 +993,10 @@ static int exynos_pmu_probe(struct platform_device *pdev)
pmu_context->pmu_data = match->data;
+ ret = of_property_read_u32(np, "reboot-inform", &inform_reg);
+ if (!ret)
+ pmu_context->reboot_inform_reg = inform_reg;
+
if (pmu_context->pmu_data->pmu_init)
pmu_context->pmu_data->pmu_init();