Skip to content

Commit c873039

Browse files
committed
Merge tag 'imx-soc-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/soc
i.MX SoC changes for 4.21: - An improvement on i.MX debugging options that only defines DEBUG_IMX_UART_PORT if needed, so that the option will not be present in the kernel config when DEBUG_LL is disabled. - Adds the necessary platform support for i.MX7ULP SoC and configures power mode to Partial Stop mode 3 with system/bus clock enabled. Otherwise the default STOP mode will gate off system/bus clock when WFI gets executed on i.MX7ULP. - A fix from Arnd on SOC_IMX7ULP option dependency. * tag 'imx-soc-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: imx: fix dependencies on imx7ulp ARM: imx: add initial support for imx7ulp ARM: debug-imx: only define DEBUG_IMX_UART_PORT if needed Signed-off-by: Olof Johansson <olof@lixom.net>
2 parents 3aab540 + 167e637 commit c873039

8 files changed

Lines changed: 89 additions & 14 deletions

File tree

‎arch/arm/Kconfig.debug‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,21 +1469,21 @@ config DEBUG_OMAP2PLUS_UART
14691469
depends on ARCH_OMAP2PLUS
14701470

14711471
config DEBUG_IMX_UART_PORT
1472-
int "i.MX Debug UART Port Selection" if DEBUG_IMX1_UART || \
1473-
DEBUG_IMX25_UART || \
1474-
DEBUG_IMX21_IMX27_UART || \
1475-
DEBUG_IMX31_UART || \
1476-
DEBUG_IMX35_UART || \
1477-
DEBUG_IMX50_UART || \
1478-
DEBUG_IMX51_UART || \
1479-
DEBUG_IMX53_UART || \
1480-
DEBUG_IMX6Q_UART || \
1481-
DEBUG_IMX6SL_UART || \
1482-
DEBUG_IMX6SX_UART || \
1483-
DEBUG_IMX6UL_UART || \
1484-
DEBUG_IMX7D_UART
1472+
int "i.MX Debug UART Port Selection"
1473+
depends on DEBUG_IMX1_UART || \
1474+
DEBUG_IMX25_UART || \
1475+
DEBUG_IMX21_IMX27_UART || \
1476+
DEBUG_IMX31_UART || \
1477+
DEBUG_IMX35_UART || \
1478+
DEBUG_IMX50_UART || \
1479+
DEBUG_IMX51_UART || \
1480+
DEBUG_IMX53_UART || \
1481+
DEBUG_IMX6Q_UART || \
1482+
DEBUG_IMX6SL_UART || \
1483+
DEBUG_IMX6SX_UART || \
1484+
DEBUG_IMX6UL_UART || \
1485+
DEBUG_IMX7D_UART
14851486
default 1
1486-
depends on ARCH_MXC
14871487
help
14881488
Choose UART port on which kernel low-level debug messages
14891489
should be output.

‎arch/arm/mach-imx/Kconfig‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,15 @@ config SOC_IMX7D
558558
help
559559
This enables support for Freescale i.MX7 Dual processor.
560560

561+
config SOC_IMX7ULP
562+
bool "i.MX7ULP support"
563+
select CLKSRC_IMX_TPM
564+
select PINCTRL_IMX7ULP
565+
select SOC_IMX7D_CA7 if ARCH_MULTI_V7
566+
select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
567+
help
568+
This enables support for Freescale i.MX7 Ultra Low Power processor.
569+
561570
config SOC_VF610
562571
bool "Vybrid Family VF610 support"
563572
select ARM_GIC if ARCH_MULTI_V7

‎arch/arm/mach-imx/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
8383
obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o
8484
obj-$(CONFIG_SOC_IMX7D_CA7) += mach-imx7d.o
8585
obj-$(CONFIG_SOC_IMX7D_CM4) += mach-imx7d-cm4.o
86+
obj-$(CONFIG_SOC_IMX7ULP) += mach-imx7ulp.o pm-imx7ulp.o
8687

8788
ifeq ($(CONFIG_SUSPEND),y)
8889
AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a

‎arch/arm/mach-imx/common.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ void imx6dl_pm_init(void);
120120
void imx6sl_pm_init(void);
121121
void imx6sx_pm_init(void);
122122
void imx6ul_pm_init(void);
123+
void imx7ulp_pm_init(void);
123124

124125
#ifdef CONFIG_PM
125126
void imx51_pm_init(void);

‎arch/arm/mach-imx/cpu.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ struct device * __init imx_soc_device_init(void)
145145
case MXC_CPU_IMX7D:
146146
soc_id = "i.MX7D";
147147
break;
148+
case MXC_CPU_IMX7ULP:
149+
soc_id = "i.MX7ULP";
150+
break;
148151
default:
149152
soc_id = "Unknown";
150153
}

‎arch/arm/mach-imx/mach-imx7ulp.c‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// SPDX-License-Identifier: GPL-2.0+
2+
/*
3+
* Copyright (C) 2016 Freescale Semiconductor, Inc.
4+
* Copyright 2017-2018 NXP
5+
* Author: Dong Aisheng <aisheng.dong@nxp.com>
6+
*/
7+
8+
#include <linux/irqchip.h>
9+
#include <linux/of_platform.h>
10+
#include <asm/mach/arch.h>
11+
12+
#include "common.h"
13+
#include "hardware.h"
14+
15+
static void __init imx7ulp_init_machine(void)
16+
{
17+
imx7ulp_pm_init();
18+
19+
mxc_set_cpu_type(MXC_CPU_IMX7ULP);
20+
of_platform_default_populate(NULL, NULL, imx_soc_device_init());
21+
}
22+
23+
static const char *const imx7ulp_dt_compat[] __initconst = {
24+
"fsl,imx7ulp",
25+
NULL,
26+
};
27+
28+
DT_MACHINE_START(IMX7ulp, "Freescale i.MX7ULP (Device Tree)")
29+
.init_machine = imx7ulp_init_machine,
30+
.dt_compat = imx7ulp_dt_compat,
31+
MACHINE_END

‎arch/arm/mach-imx/mxc.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#define MXC_CPU_IMX6ULZ 0x6b
4545
#define MXC_CPU_IMX6SLL 0x67
4646
#define MXC_CPU_IMX7D 0x72
47+
#define MXC_CPU_IMX7ULP 0xff
4748

4849
#define IMX_DDR_TYPE_LPDDR2 1
4950

‎arch/arm/mach-imx/pm-imx7ulp.c‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// SPDX-License-Identifier: GPL-2.0+
2+
/*
3+
* Copyright (C) 2016 Freescale Semiconductor, Inc.
4+
* Copyright 2017-2018 NXP
5+
* Author: Dong Aisheng <aisheng.dong@nxp.com>
6+
*/
7+
8+
#include <linux/io.h>
9+
#include <linux/of.h>
10+
#include <linux/of_address.h>
11+
12+
#define SMC_PMCTRL 0x10
13+
#define BP_PMCTRL_PSTOPO 16
14+
#define PSTOPO_PSTOP3 0x3
15+
16+
void __init imx7ulp_pm_init(void)
17+
{
18+
struct device_node *np;
19+
void __iomem *smc1_base;
20+
21+
np = of_find_compatible_node(NULL, NULL, "fsl,imx7ulp-smc1");
22+
smc1_base = of_iomap(np, 0);
23+
WARN_ON(!smc1_base);
24+
25+
/* Partial Stop mode 3 with system/bus clock enabled */
26+
writel_relaxed(PSTOPO_PSTOP3 << BP_PMCTRL_PSTOPO,
27+
smc1_base + SMC_PMCTRL);
28+
iounmap(smc1_base);
29+
}

0 commit comments

Comments
 (0)