summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/pm-imx7ulp.c
blob: cf6a380c2b8d523fc77db9e329118027b63a9955 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (C) 2016 Freescale Semiconductor, Inc.
 * Copyright 2017-2018 NXP
 *   Author: Dong Aisheng <aisheng.dong@nxp.com>
 */

#include <linux/io.h>
#include <linux/of.h>
#include <linux/of_address.h>

#define SMC_PMCTRL		0x10
#define BP_PMCTRL_PSTOPO        16
#define PSTOPO_PSTOP3		0x3

void __init imx7ulp_pm_init(void)
{
	struct device_node *np;
	void __iomem *smc1_base;

	np = of_find_compatible_node(NULL, NULL, "fsl,imx7ulp-smc1");
	smc1_base = of_iomap(np, 0);
	WARN_ON(!smc1_base);

	/* Partial Stop mode 3 with system/bus clock enabled */
	writel_relaxed(PSTOPO_PSTOP3 << BP_PMCTRL_PSTOPO,
		       smc1_base + SMC_PMCTRL);
	iounmap(smc1_base);
}
OpenPOWER on IntegriCloud