Skip to content

Commit 207b504

Browse files
committed
Merge tag 'imx-soc-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/soc
The i.MX SoC changes for 4.3: - Add i.MX6 Ultralite SoC support, which is the newest addition to i.MX6 family. It integrates a single Cortex-A7 core and a power management module that reduces the complexity of external power supply and simplifies power sequencing. - Change SNVS RTC driver to use syscon interface for register access, and add SNVS power key driver support. - Add a second clock for mxc rtc driver, and support device tree probe for the driver. - Add FEC MAC reference clock and phy fixup initialization for i.MX6UL platform. * tag 'imx-soc-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: rtc: snvs: select option REGMAP_MMIO ARM: imx6ul: add fec MAC refrence clock and phy fixup init ARM: imx6ul: add fec bits to GPR syscon definition rtc: mxc: add support of device tree dt-binding: document the binding for mxc rtc rtc: mxc: use a second rtc clock input: snvs_pwrkey: use "wakeup-source" as deivce tree property name Document: devicetree: input: imx: i.mx snvs power device tree bindings input: keyboard: imx: add snvs power key driver Document: dt: fsl: snvs: change support syscon rtc: snvs: use syscon to access register ARM: imx: add low-level debug support for i.mx6ul ARM: imx: add i.mx6ul msl support Signed-off-by: Olof Johansson <olof@lixom.net>
2 parents f9511a4 + 8a0fa18 commit 207b504

17 files changed

Lines changed: 592 additions & 92 deletions

File tree

‎Documentation/devicetree/bindings/crypto/fsl-sec4.txt‎

Lines changed: 78 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,13 @@ Secure Non-Volatile Storage (SNVS) Node
288288
Node defines address range and the associated
289289
interrupt for the SNVS function. This function
290290
monitors security state information & reports
291-
security violations.
291+
security violations. This also included rtc,
292+
system power off and ON/OFF key.
292293

293294
- compatible
294295
Usage: required
295296
Value type: <string>
296-
Definition: Must include "fsl,sec-v4.0-mon".
297+
Definition: Must include "fsl,sec-v4.0-mon" and "syscon".
297298

298299
- reg
299300
Usage: required
@@ -324,7 +325,7 @@ Secure Non-Volatile Storage (SNVS) Node
324325
the child address, parent address, & length.
325326

326327
- interrupts
327-
Usage: required
328+
Usage: optional
328329
Value type: <prop_encoded-array>
329330
Definition: Specifies the interrupts generated by this
330331
device. The value of the interrupts property
@@ -341,7 +342,7 @@ Secure Non-Volatile Storage (SNVS) Node
341342

342343
EXAMPLE
343344
sec_mon@314000 {
344-
compatible = "fsl,sec-v4.0-mon";
345+
compatible = "fsl,sec-v4.0-mon", "syscon";
345346
reg = <0x314000 0x1000>;
346347
ranges = <0 0x314000 0x1000>;
347348
interrupt-parent = <&mpic>;
@@ -358,16 +359,72 @@ Secure Non-Volatile Storage (SNVS) Low Power (LP) RTC Node
358359
Value type: <string>
359360
Definition: Must include "fsl,sec-v4.0-mon-rtc-lp".
360361

361-
- reg
362+
- interrupts
362363
Usage: required
363-
Value type: <prop-encoded-array>
364-
Definition: A standard property. Specifies the physical
365-
address and length of the SNVS LP configuration registers.
364+
Value type: <prop_encoded-array>
365+
Definition: Specifies the interrupts generated by this
366+
device. The value of the interrupts property
367+
consists of one interrupt specifier. The format
368+
of the specifier is defined by the binding document
369+
describing the node's interrupt parent.
370+
371+
- regmap
372+
Usage: required
373+
Value type: <phandle>
374+
Definition: this is phandle to the register map node.
375+
376+
- offset
377+
Usage: option
378+
value type: <u32>
379+
Definition: LP register offset. default it is 0x34.
366380

367381
EXAMPLE
368-
sec_mon_rtc_lp@314000 {
382+
sec_mon_rtc_lp@1 {
369383
compatible = "fsl,sec-v4.0-mon-rtc-lp";
370-
reg = <0x34 0x58>;
384+
interrupts = <93 2>;
385+
regmap = <&snvs>;
386+
offset = <0x34>;
387+
};
388+
389+
=====================================================================
390+
System ON/OFF key driver
391+
392+
The snvs-pwrkey is designed to enable POWER key function which controlled
393+
by SNVS ONOFF, the driver can report the status of POWER key and wakeup
394+
system if pressed after system suspend.
395+
396+
- compatible:
397+
Usage: required
398+
Value type: <string>
399+
Definition: Mush include "fsl,sec-v4.0-pwrkey".
400+
401+
- interrupts:
402+
Usage: required
403+
Value type: <prop_encoded-array>
404+
Definition: The SNVS ON/OFF interrupt number to the CPU(s).
405+
406+
- linux,keycode:
407+
Usage: option
408+
Value type: <int>
409+
Definition: Keycode to emit, KEY_POWER by default.
410+
411+
- wakeup-source:
412+
Usage: option
413+
Value type: <boo>
414+
Definition: Button can wake-up the system.
415+
416+
- regmap:
417+
Usage: required:
418+
Value type: <phandle>
419+
Definition: this is phandle to the register map node.
420+
421+
EXAMPLE:
422+
snvs-pwrkey@0x020cc000 {
423+
compatible = "fsl,sec-v4.0-pwrkey";
424+
regmap = <&snvs>;
425+
interrupts = <0 4 0x4>
426+
linux,keycode = <116>; /* KEY_POWER */
427+
wakeup;
371428
};
372429

373430
=====================================================================
@@ -443,12 +500,20 @@ FULL EXAMPLE
443500
compatible = "fsl,sec-v4.0-mon";
444501
reg = <0x314000 0x1000>;
445502
ranges = <0 0x314000 0x1000>;
446-
interrupt-parent = <&mpic>;
447-
interrupts = <93 2>;
448503

449504
sec_mon_rtc_lp@34 {
450505
compatible = "fsl,sec-v4.0-mon-rtc-lp";
451-
reg = <0x34 0x58>;
506+
regmap = <&sec_mon>;
507+
offset = <0x34>;
508+
interrupts = <93 2>;
509+
};
510+
511+
snvs-pwrkey@0x020cc000 {
512+
compatible = "fsl,sec-v4.0-pwrkey";
513+
regmap = <&sec_mon>;
514+
interrupts = <0 4 0x4>;
515+
linux,keycode = <116>; /* KEY_POWER */
516+
wakeup;
452517
};
453518
};
454519

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See Documentation/devicetree/bindings/crypto/fsl-sec4.txt
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
* Real Time Clock of the i.MX SoCs
2+
3+
RTC controller for the i.MX SoCs
4+
5+
Required properties:
6+
- compatible: Should be "fsl,imx1-rtc" or "fsl,imx21-rtc".
7+
- reg: physical base address of the controller and length of memory mapped
8+
region.
9+
- interrupts: IRQ line for the RTC.
10+
- clocks: should contain two entries:
11+
* one for the input reference
12+
* one for the the SoC RTC
13+
- clock-names: should contain:
14+
* "ref" for the input reference clock
15+
* "ipg" for the SoC RTC clock
16+
17+
Example:
18+
19+
rtc@10007000 {
20+
compatible = "fsl,imx21-rtc";
21+
reg = <0x10007000 0x1000>;
22+
interrupts = <22>;
23+
clocks = <&clks IMX27_CLK_CKIL>,
24+
<&clks IMX27_CLK_RTC_IPG_GATE>;
25+
clock-names = "ref", "ipg";
26+
};

‎arch/arm/Kconfig.debug‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,13 @@ choice
417417
Say Y here if you want kernel low-level debugging support
418418
on i.MX6SX.
419419

420+
config DEBUG_IMX6UL_UART
421+
bool "i.MX6UL Debug UART"
422+
depends on SOC_IMX6UL
423+
help
424+
Say Y here if you want kernel low-level debugging support
425+
on i.MX6UL.
426+
420427
config DEBUG_IMX7D_UART
421428
bool "i.MX7D Debug UART"
422429
depends on SOC_IMX7D
@@ -1275,6 +1282,7 @@ config DEBUG_IMX_UART_PORT
12751282
DEBUG_IMX6Q_UART || \
12761283
DEBUG_IMX6SL_UART || \
12771284
DEBUG_IMX6SX_UART || \
1285+
DEBUG_IMX6UL_UART || \
12781286
DEBUG_IMX7D_UART
12791287
default 1
12801288
depends on ARCH_MXC
@@ -1326,6 +1334,7 @@ config DEBUG_LL_INCLUDE
13261334
DEBUG_IMX6Q_UART || \
13271335
DEBUG_IMX6SL_UART || \
13281336
DEBUG_IMX6SX_UART || \
1337+
DEBUG_IMX6UL_UART || \
13291338
DEBUG_IMX7D_UART
13301339
default "debug/ks8695.S" if DEBUG_KS8695_UART
13311340
default "debug/msm.S" if DEBUG_QCOM_UARTDM

‎arch/arm/include/debug/imx-uart.h‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@
9090
#define IMX6SX_UART_BASE_ADDR(n) IMX6SX_UART##n##_BASE_ADDR
9191
#define IMX6SX_UART_BASE(n) IMX6SX_UART_BASE_ADDR(n)
9292

93+
#define IMX6UL_UART1_BASE_ADDR 0x02020000
94+
#define IMX6UL_UART2_BASE_ADDR 0x021e8000
95+
#define IMX6UL_UART3_BASE_ADDR 0x021ec000
96+
#define IMX6UL_UART4_BASE_ADDR 0x021f0000
97+
#define IMX6UL_UART5_BASE_ADDR 0x021f4000
98+
#define IMX6UL_UART6_BASE_ADDR 0x021fc000
99+
#define IMX6UL_UART7_BASE_ADDR 0x02018000
100+
#define IMX6UL_UART8_BASE_ADDR 0x02024000
101+
#define IMX6UL_UART_BASE_ADDR(n) IMX6UL_UART##n##_BASE_ADDR
102+
#define IMX6UL_UART_BASE(n) IMX6UL_UART_BASE_ADDR(n)
103+
93104
#define IMX7D_UART1_BASE_ADDR 0x30860000
94105
#define IMX7D_UART2_BASE_ADDR 0x30890000
95106
#define IMX7D_UART3_BASE_ADDR 0x30880000
@@ -124,6 +135,8 @@
124135
#define UART_PADDR IMX_DEBUG_UART_BASE(IMX6SL)
125136
#elif defined(CONFIG_DEBUG_IMX6SX_UART)
126137
#define UART_PADDR IMX_DEBUG_UART_BASE(IMX6SX)
138+
#elif defined(CONFIG_DEBUG_IMX6UL_UART)
139+
#define UART_PADDR IMX_DEBUG_UART_BASE(IMX6UL)
127140
#elif defined(CONFIG_DEBUG_IMX7D_UART)
128141
#define UART_PADDR IMX_DEBUG_UART_BASE(IMX7D)
129142

‎arch/arm/mach-imx/Kconfig‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,14 @@ config SOC_IMX6SX
548548
help
549549
This enables support for Freescale i.MX6 SoloX processor.
550550

551+
config SOC_IMX6UL
552+
bool "i.MX6 UltraLite support"
553+
select PINCTRL_IMX6UL
554+
select SOC_IMX6
555+
556+
help
557+
This enables support for Freescale i.MX6 UltraLite processor.
558+
551559
config SOC_IMX7D
552560
bool "i.MX7 Dual support"
553561
select PINCTRL_IMX7D

‎arch/arm/mach-imx/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ endif
8383
obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o
8484
obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
8585
obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
86+
obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o
8687
obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
8788

8889
ifeq ($(CONFIG_SUSPEND),y)

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ struct device * __init imx_soc_device_init(void)
130130
case MXC_CPU_IMX6Q:
131131
soc_id = "i.MX6Q";
132132
break;
133+
case MXC_CPU_IMX6UL:
134+
soc_id = "i.MX6UL";
135+
break;
133136
case MXC_CPU_IMX7D:
134137
soc_id = "i.MX7D";
135138
break;

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

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* Copyright (C) 2015 Freescale Semiconductor, Inc.
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License version 2 as
6+
* published by the Free Software Foundation.
7+
*/
8+
#include <linux/irqchip.h>
9+
#include <linux/mfd/syscon.h>
10+
#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
11+
#include <linux/micrel_phy.h>
12+
#include <linux/of_platform.h>
13+
#include <linux/phy.h>
14+
#include <linux/regmap.h>
15+
#include <asm/mach/arch.h>
16+
#include <asm/mach/map.h>
17+
18+
#include "common.h"
19+
20+
static void __init imx6ul_enet_clk_init(void)
21+
{
22+
struct regmap *gpr;
23+
24+
gpr = syscon_regmap_lookup_by_compatible("fsl,imx6ul-iomuxc-gpr");
25+
if (!IS_ERR(gpr))
26+
regmap_update_bits(gpr, IOMUXC_GPR1, IMX6UL_GPR1_ENET_CLK_DIR,
27+
IMX6UL_GPR1_ENET_CLK_OUTPUT);
28+
else
29+
pr_err("failed to find fsl,imx6ul-iomux-gpr regmap\n");
30+
31+
}
32+
33+
static int ksz8081_phy_fixup(struct phy_device *dev)
34+
{
35+
if (dev && dev->interface == PHY_INTERFACE_MODE_MII) {
36+
phy_write(dev, 0x1f, 0x8110);
37+
phy_write(dev, 0x16, 0x201);
38+
} else if (dev && dev->interface == PHY_INTERFACE_MODE_RMII) {
39+
phy_write(dev, 0x1f, 0x8190);
40+
phy_write(dev, 0x16, 0x202);
41+
}
42+
43+
return 0;
44+
}
45+
46+
static void __init imx6ul_enet_phy_init(void)
47+
{
48+
phy_register_fixup_for_uid(PHY_ID_KSZ8081, 0xffffffff, ksz8081_phy_fixup);
49+
}
50+
51+
static inline void imx6ul_enet_init(void)
52+
{
53+
imx6ul_enet_clk_init();
54+
imx6ul_enet_phy_init();
55+
}
56+
57+
static void __init imx6ul_init_machine(void)
58+
{
59+
struct device *parent;
60+
61+
parent = imx_soc_device_init();
62+
if (parent == NULL)
63+
pr_warn("failed to initialize soc device\n");
64+
65+
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
66+
imx6ul_enet_init();
67+
imx_anatop_init();
68+
}
69+
70+
static void __init imx6ul_init_irq(void)
71+
{
72+
imx_init_revision_from_anatop();
73+
imx_src_init();
74+
irqchip_init();
75+
}
76+
77+
static const char *imx6ul_dt_compat[] __initconst = {
78+
"fsl,imx6ul",
79+
NULL,
80+
};
81+
82+
DT_MACHINE_START(IMX6UL, "Freescale i.MX6 Ultralite (Device Tree)")
83+
.init_irq = imx6ul_init_irq,
84+
.init_machine = imx6ul_init_machine,
85+
.dt_compat = imx6ul_dt_compat,
86+
MACHINE_END

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#define MXC_CPU_IMX6DL 0x61
3939
#define MXC_CPU_IMX6SX 0x62
4040
#define MXC_CPU_IMX6Q 0x63
41+
#define MXC_CPU_IMX6UL 0x64
4142
#define MXC_CPU_IMX7D 0x72
4243

4344
#define IMX_DDR_TYPE_LPDDR2 1
@@ -165,6 +166,11 @@ static inline bool cpu_is_imx6sx(void)
165166
return __mxc_cpu_type == MXC_CPU_IMX6SX;
166167
}
167168

169+
static inline bool cpu_is_imx6ul(void)
170+
{
171+
return __mxc_cpu_type == MXC_CPU_IMX6UL;
172+
}
173+
168174
static inline bool cpu_is_imx6q(void)
169175
{
170176
return __mxc_cpu_type == MXC_CPU_IMX6Q;

0 commit comments

Comments
 (0)