You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'imx/imx6q' into next/soc
Conflicts: Documentation/devicetree/bindings/arm/fsl.txt arch/arm/Kconfig arch/arm/Kconfig.debug arch/arm/plat-mxc/include/mach/common.h
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
Freescale i.MX Platforms Device Tree Bindings
|
||||
-----------------------------------------------
|
||||
|
||||
i.MX51 Babbage Board
|
||||
Required root node properties:
|
||||
- compatible = "fsl,imx51-babbage", "fsl,imx51";
|
||||
@@ -17,3 +20,7 @@ Required root node properties:
|
||||
i.MX53 Smart Mobile Reference Design Board
|
||||
Required root node properties:
|
||||
- compatible = "fsl,imx53-smd", "fsl,imx53";
|
||||
|
||||
i.MX6 Quad SABRE Automotive Board
|
||||
Required root node properties:
|
||||
- compatible = "fsl,imx6q-sabreauto", "fsl,imx6q";
|
||||
|
||||
@@ -793,6 +793,13 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
F: arch/arm/mach-mx5/
|
||||
|
||||
ARM/FREESCALE IMX6
|
||||
M: Shawn Guo <shawn.guo@linaro.org>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
T: git git://git.linaro.org/people/shawnguo/linux-2.6.git
|
||||
F: arch/arm/mach-imx/*imx6*
|
||||
|
||||
ARM/GLOMATION GESBC9312SX MACHINE SUPPORT
|
||||
M: Lennert Buytenhek <kernel@wantstofly.org>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
|
||||
+1
-1
@@ -1435,7 +1435,7 @@ config SMP
|
||||
depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \
|
||||
MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \
|
||||
ARCH_EXYNOS4 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || \
|
||||
ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE || ARCH_HIGHBANK
|
||||
ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE || ARCH_HIGHBANK || SOC_IMX6Q
|
||||
select USE_GENERIC_SMP_HELPERS
|
||||
select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP
|
||||
help
|
||||
|
||||
+112
-12
@@ -135,6 +135,118 @@ choice
|
||||
Say Y here if you want the debug print routines to direct
|
||||
their output to the UART on Highbank based devices.
|
||||
|
||||
config DEBUG_IMX1_UART
|
||||
bool "i.MX1 Debug UART"
|
||||
depends on SOC_IMX1
|
||||
help
|
||||
Say Y here if you want kernel low-level debugging support
|
||||
on i.MX1.
|
||||
|
||||
config DEBUG_IMX23_UART
|
||||
bool "i.MX23 Debug UART"
|
||||
depends on SOC_IMX23
|
||||
help
|
||||
Say Y here if you want kernel low-level debugging support
|
||||
on i.MX23.
|
||||
|
||||
config DEBUG_IMX25_UART
|
||||
bool "i.MX25 Debug UART"
|
||||
depends on SOC_IMX25
|
||||
help
|
||||
Say Y here if you want kernel low-level debugging support
|
||||
on i.MX25.
|
||||
|
||||
config DEBUG_IMX21_IMX27_UART
|
||||
bool "i.MX21 and i.MX27 Debug UART"
|
||||
depends on SOC_IMX21 || SOC_IMX27
|
||||
help
|
||||
Say Y here if you want kernel low-level debugging support
|
||||
on i.MX21 or i.MX27.
|
||||
|
||||
config DEBUG_IMX28_UART
|
||||
bool "i.MX28 Debug UART"
|
||||
depends on SOC_IMX28
|
||||
help
|
||||
Say Y here if you want kernel low-level debugging support
|
||||
on i.MX28.
|
||||
|
||||
config DEBUG_IMX31_IMX35_UART
|
||||
bool "i.MX31 and i.MX35 Debug UART"
|
||||
depends on SOC_IMX31 || SOC_IMX35
|
||||
help
|
||||
Say Y here if you want kernel low-level debugging support
|
||||
on i.MX31 or i.MX35.
|
||||
|
||||
config DEBUG_IMX51_UART
|
||||
bool "i.MX51 Debug UART"
|
||||
depends on SOC_IMX51
|
||||
help
|
||||
Say Y here if you want kernel low-level debugging support
|
||||
on i.MX51.
|
||||
|
||||
config DEBUG_IMX50_IMX53_UART
|
||||
bool "i.MX50 and i.MX53 Debug UART"
|
||||
depends on SOC_IMX50 || SOC_IMX53
|
||||
help
|
||||
Say Y here if you want kernel low-level debugging support
|
||||
on i.MX50 or i.MX53.
|
||||
|
||||
config DEBUG_IMX6Q_UART
|
||||
bool "i.MX6Q Debug UART"
|
||||
depends on SOC_IMX6Q
|
||||
help
|
||||
Say Y here if you want kernel low-level debugging support
|
||||
on i.MX6Q.
|
||||
|
||||
config DEBUG_S3C_UART0
|
||||
depends on PLAT_SAMSUNG
|
||||
bool "Use S3C UART 0 for low-level debug"
|
||||
help
|
||||
Say Y here if you want the debug print routines to direct
|
||||
their output to UART 0. The port must have been initialised
|
||||
by the boot-loader before use.
|
||||
|
||||
The uncompressor code port configuration is now handled
|
||||
by CONFIG_S3C_LOWLEVEL_UART_PORT.
|
||||
|
||||
config DEBUG_S3C_UART1
|
||||
depends on PLAT_SAMSUNG
|
||||
bool "Use S3C UART 1 for low-level debug"
|
||||
help
|
||||
Say Y here if you want the debug print routines to direct
|
||||
their output to UART 1. The port must have been initialised
|
||||
by the boot-loader before use.
|
||||
|
||||
The uncompressor code port configuration is now handled
|
||||
by CONFIG_S3C_LOWLEVEL_UART_PORT.
|
||||
|
||||
config DEBUG_S3C_UART2
|
||||
depends on PLAT_SAMSUNG
|
||||
bool "Use S3C UART 2 for low-level debug"
|
||||
help
|
||||
Say Y here if you want the debug print routines to direct
|
||||
their output to UART 2. The port must have been initialised
|
||||
by the boot-loader before use.
|
||||
|
||||
The uncompressor code port configuration is now handled
|
||||
by CONFIG_S3C_LOWLEVEL_UART_PORT.
|
||||
|
||||
config DEBUG_REALVIEW_STD_PORT
|
||||
bool "RealView Default UART"
|
||||
depends on ARCH_REALVIEW
|
||||
help
|
||||
Say Y here if you want the debug print routines to direct
|
||||
their output to the serial port on RealView EB, PB11MP, PBA8
|
||||
and PBX platforms.
|
||||
|
||||
config DEBUG_REALVIEW_PB1176_PORT
|
||||
bool "RealView PB1176 UART"
|
||||
depends on MACH_REALVIEW_PB1176
|
||||
help
|
||||
Say Y here if you want the debug print routines to direct
|
||||
their output to the standard serial port on the RealView
|
||||
PB1176 platform.
|
||||
|
||||
endchoice
|
||||
|
||||
config EARLY_PRINTK
|
||||
@@ -153,18 +265,6 @@ config OC_ETM
|
||||
buffer driver that will allow you to collect traces of the
|
||||
kernel code.
|
||||
|
||||
config DEBUG_S3C_UART
|
||||
depends on PLAT_SAMSUNG
|
||||
int "S3C UART to use for low-level debug"
|
||||
default "0"
|
||||
help
|
||||
Choice for UART for kernel low-level using S3C UARTS,
|
||||
should be between zero and two. The port must have been
|
||||
initialised by the boot-loader before use.
|
||||
|
||||
The uncompressor code port configuration is now handled
|
||||
by CONFIG_S3C_LOWLEVEL_UART_PORT.
|
||||
|
||||
config ARM_KPROBES_TEST
|
||||
tristate "Kprobes test module"
|
||||
depends on KPROBES && MODULES
|
||||
|
||||
+1
-1
@@ -159,7 +159,7 @@ machine-$(CONFIG_ARCH_MMP) := mmp
|
||||
machine-$(CONFIG_ARCH_MSM) := msm
|
||||
machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0
|
||||
machine-$(CONFIG_ARCH_IMX_V4_V5) := imx
|
||||
machine-$(CONFIG_ARCH_MX3) := imx
|
||||
machine-$(CONFIG_ARCH_IMX_V6_V7) := imx
|
||||
machine-$(CONFIG_ARCH_MX5) := mx5
|
||||
machine-$(CONFIG_ARCH_MXS) := mxs
|
||||
machine-$(CONFIG_ARCH_NETX) := netx
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2011 Freescale Semiconductor, Inc.
|
||||
* Copyright 2011 Linaro Ltd.
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/include/ "imx6q.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Freescale i.MX6 Quad SABRE Automotive Board";
|
||||
compatible = "fsl,imx6q-sabreauto", "fsl,imx6q";
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttymxc0,115200 root=/dev/mmcblk3p3 rootwait";
|
||||
};
|
||||
|
||||
memory {
|
||||
reg = <0x10000000 0x80000000>;
|
||||
};
|
||||
|
||||
soc {
|
||||
aips-bus@02100000 { /* AIPS2 */
|
||||
enet@02188000 {
|
||||
phy-mode = "rgmii";
|
||||
local-mac-address = [00 04 9F 01 1B 61];
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
usdhc@02198000 { /* uSDHC3 */
|
||||
cd-gpios = <&gpio5 11 0>; /* GPIO6_11 */
|
||||
wp-gpios = <&gpio5 14 0>; /* GPIO6_14 */
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
usdhc@0219c000 { /* uSDHC4 */
|
||||
fsl,card-wired;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
uart3: uart@021f0000 { /* UART4 */
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
debug-led {
|
||||
label = "Heartbeat";
|
||||
gpios = <&gpio2 25 0>; /* GPIO3_25 */
|
||||
linux,default-trigger = "heartbeat";
|
||||
};
|
||||
};
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,15 @@
|
||||
config IMX_HAVE_DMA_V1
|
||||
bool
|
||||
|
||||
config HAVE_IMX_GPC
|
||||
bool
|
||||
|
||||
config HAVE_IMX_MMDC
|
||||
bool
|
||||
|
||||
config HAVE_IMX_SRC
|
||||
bool
|
||||
|
||||
#
|
||||
# ARCH_MX31 and ARCH_MX35 are left for compatibility
|
||||
# Some usages assume that having one of them implies not having (e.g.) ARCH_MX2.
|
||||
@@ -64,6 +74,7 @@ config SOC_IMX31
|
||||
select ARCH_MXC_AUDMUX_V2
|
||||
select ARCH_MX31
|
||||
select MXC_AVIC
|
||||
select SMP_ON_UP if SMP
|
||||
|
||||
config SOC_IMX35
|
||||
bool
|
||||
@@ -73,6 +84,7 @@ config SOC_IMX35
|
||||
select HAVE_EPIT
|
||||
select ARCH_MX35
|
||||
select MXC_AVIC
|
||||
select SMP_ON_UP if SMP
|
||||
|
||||
|
||||
if ARCH_IMX_V4_V5
|
||||
@@ -341,7 +353,7 @@ config MACH_IMX27IPCAM
|
||||
|
||||
endif
|
||||
|
||||
if ARCH_MX3
|
||||
if ARCH_IMX_V6_V7
|
||||
|
||||
comment "MX31 platforms:"
|
||||
|
||||
@@ -591,4 +603,20 @@ config MACH_VPR200
|
||||
Include support for VPR200 platform. This includes specific
|
||||
configurations for the board and its peripherals.
|
||||
|
||||
comment "i.MX6 family:"
|
||||
|
||||
config SOC_IMX6Q
|
||||
bool "i.MX6 Quad support"
|
||||
select ARM_GIC
|
||||
select CACHE_L2X0
|
||||
select CPU_V7
|
||||
select HAVE_ARM_SCU
|
||||
select HAVE_IMX_GPC
|
||||
select HAVE_IMX_MMDC
|
||||
select HAVE_IMX_SRC
|
||||
select USE_OF
|
||||
|
||||
help
|
||||
This enables support for Freescale i.MX6 Quad processor.
|
||||
|
||||
endif
|
||||
|
||||
@@ -60,3 +60,14 @@ obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o
|
||||
obj-$(CONFIG_MACH_EUKREA_CPUIMX35) += mach-cpuimx35.o
|
||||
obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd35-baseboard.o
|
||||
obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o
|
||||
|
||||
obj-$(CONFIG_DEBUG_LL) += lluart.o
|
||||
obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o
|
||||
obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o
|
||||
obj-$(CONFIG_HAVE_IMX_SRC) += src.o
|
||||
obj-$(CONFIG_CPU_V7) += head-v7.o
|
||||
AFLAGS_head-v7.o :=-Wa,-march=armv7-a
|
||||
obj-$(CONFIG_SMP) += platsmp.o
|
||||
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
|
||||
obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
|
||||
obj-$(CONFIG_SOC_IMX6Q) += clock-imx6q.o mach-imx6q.o pm-imx6q.o
|
||||
|
||||
@@ -17,3 +17,7 @@ initrd_phys-$(CONFIG_MACH_MX27) := 0xA0800000
|
||||
zreladdr-$(CONFIG_ARCH_MX3) := 0x80008000
|
||||
params_phys-$(CONFIG_ARCH_MX3) := 0x80000100
|
||||
initrd_phys-$(CONFIG_ARCH_MX3) := 0x80800000
|
||||
|
||||
zreladdr-$(CONFIG_SOC_IMX6Q) += 0x10008000
|
||||
params_phys-$(CONFIG_SOC_IMX6Q) := 0x10000100
|
||||
initrd_phys-$(CONFIG_SOC_IMX6Q) := 0x10800000
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright 2011 Freescale Semiconductor, Inc.
|
||||
* Copyright 2011 Linaro Ltd.
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/io.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <asm/hardware/gic.h>
|
||||
|
||||
#define GPC_IMR1 0x008
|
||||
#define GPC_PGC_CPU_PDN 0x2a0
|
||||
|
||||
#define IMR_NUM 4
|
||||
|
||||
static void __iomem *gpc_base;
|
||||
static u32 gpc_wake_irqs[IMR_NUM];
|
||||
static u32 gpc_saved_imrs[IMR_NUM];
|
||||
|
||||
void imx_gpc_pre_suspend(void)
|
||||
{
|
||||
void __iomem *reg_imr1 = gpc_base + GPC_IMR1;
|
||||
int i;
|
||||
|
||||
/* Tell GPC to power off ARM core when suspend */
|
||||
writel_relaxed(0x1, gpc_base + GPC_PGC_CPU_PDN);
|
||||
|
||||
for (i = 0; i < IMR_NUM; i++) {
|
||||
gpc_saved_imrs[i] = readl_relaxed(reg_imr1 + i * 4);
|
||||
writel_relaxed(~gpc_wake_irqs[i], reg_imr1 + i * 4);
|
||||
}
|
||||
}
|
||||
|
||||
void imx_gpc_post_resume(void)
|
||||
{
|
||||
void __iomem *reg_imr1 = gpc_base + GPC_IMR1;
|
||||
int i;
|
||||
|
||||
/* Keep ARM core powered on for other low-power modes */
|
||||
writel_relaxed(0x0, gpc_base + GPC_PGC_CPU_PDN);
|
||||
|
||||
for (i = 0; i < IMR_NUM; i++)
|
||||
writel_relaxed(gpc_saved_imrs[i], reg_imr1 + i * 4);
|
||||
}
|
||||
|
||||
static int imx_gpc_irq_set_wake(struct irq_data *d, unsigned int on)
|
||||
{
|
||||
unsigned int idx = d->irq / 32 - 1;
|
||||
u32 mask;
|
||||
|
||||
/* Sanity check for SPI irq */
|
||||
if (d->irq < 32)
|
||||
return -EINVAL;
|
||||
|
||||
mask = 1 << d->irq % 32;
|
||||
gpc_wake_irqs[idx] = on ? gpc_wake_irqs[idx] | mask :
|
||||
gpc_wake_irqs[idx] & ~mask;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void imx_gpc_irq_unmask(struct irq_data *d)
|
||||
{
|
||||
void __iomem *reg;
|
||||
u32 val;
|
||||
|
||||
/* Sanity check for SPI irq */
|
||||
if (d->irq < 32)
|
||||
return;
|
||||
|
||||
reg = gpc_base + GPC_IMR1 + (d->irq / 32 - 1) * 4;
|
||||
val = readl_relaxed(reg);
|
||||
val &= ~(1 << d->irq % 32);
|
||||
writel_relaxed(val, reg);
|
||||
}
|
||||
|
||||
static void imx_gpc_irq_mask(struct irq_data *d)
|
||||
{
|
||||
void __iomem *reg;
|
||||
u32 val;
|
||||
|
||||
/* Sanity check for SPI irq */
|
||||
if (d->irq < 32)
|
||||
return;
|
||||
|
||||
reg = gpc_base + GPC_IMR1 + (d->irq / 32 - 1) * 4;
|
||||
val = readl_relaxed(reg);
|
||||
val |= 1 << (d->irq % 32);
|
||||
writel_relaxed(val, reg);
|
||||
}
|
||||
|
||||
void __init imx_gpc_init(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
|
||||
np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpc");
|
||||
gpc_base = of_iomap(np, 0);
|
||||
WARN_ON(!gpc_base);
|
||||
|
||||
/* Register GPC as the secondary interrupt controller behind GIC */
|
||||
gic_arch_extn.irq_mask = imx_gpc_irq_mask;
|
||||
gic_arch_extn.irq_unmask = imx_gpc_irq_unmask;
|
||||
gic_arch_extn.irq_set_wake = imx_gpc_irq_set_wake;
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright 2011 Freescale Semiconductor, Inc.
|
||||
* Copyright 2011 Linaro Ltd.
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/init.h>
|
||||
#include <asm/asm-offsets.h>
|
||||
#include <asm/hardware/cache-l2x0.h>
|
||||
|
||||
.section ".text.head", "ax"
|
||||
__CPUINIT
|
||||
|
||||
/*
|
||||
* The secondary kernel init calls v7_flush_dcache_all before it enables
|
||||
* the L1; however, the L1 comes out of reset in an undefined state, so
|
||||
* the clean + invalidate performed by v7_flush_dcache_all causes a bunch
|
||||
* of cache lines with uninitialized data and uninitialized tags to get
|
||||
* written out to memory, which does really unpleasant things to the main
|
||||
* processor. We fix this by performing an invalidate, rather than a
|
||||
* clean + invalidate, before jumping into the kernel.
|
||||
*
|
||||
* This funciton is cloned from arch/arm/mach-tegra/headsmp.S, and needs
|
||||
* to be called for both secondary cores startup and primary core resume
|
||||
* procedures. Ideally, it should be moved into arch/arm/mm/cache-v7.S.
|
||||
*/
|
||||
ENTRY(v7_invalidate_l1)
|
||||
mov r0, #0
|
||||
mcr p15, 2, r0, c0, c0, 0
|
||||
mrc p15, 1, r0, c0, c0, 0
|
||||
|
||||
ldr r1, =0x7fff
|
||||
and r2, r1, r0, lsr #13
|
||||
|
||||
ldr r1, =0x3ff
|
||||
|
||||
and r3, r1, r0, lsr #3 @ NumWays - 1
|
||||
add r2, r2, #1 @ NumSets
|
||||
|
||||
and r0, r0, #0x7
|
||||
add r0, r0, #4 @ SetShift
|
||||
|
||||
clz r1, r3 @ WayShift
|
||||
add r4, r3, #1 @ NumWays
|
||||
1: sub r2, r2, #1 @ NumSets--
|
||||
mov r3, r4 @ Temp = NumWays
|
||||
2: subs r3, r3, #1 @ Temp--
|
||||
mov r5, r3, lsl r1
|
||||
mov r6, r2, lsl r0
|
||||
orr r5, r5, r6 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift)
|
||||
mcr p15, 0, r5, c7, c6, 2
|
||||
bgt 2b
|
||||
cmp r2, #0
|
||||
bgt 1b
|
||||
dsb
|
||||
isb
|
||||
mov pc, lr
|
||||
ENDPROC(v7_invalidate_l1)
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
ENTRY(v7_secondary_startup)
|
||||
bl v7_invalidate_l1
|
||||
b secondary_startup
|
||||
ENDPROC(v7_secondary_startup)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following code is located into the .data section. This is to
|
||||
* allow phys_l2x0_saved_regs to be accessed with a relative load
|
||||
* as we are running on physical address here.
|
||||
*/
|
||||
.data
|
||||
.align
|
||||
|
||||
.macro pl310_resume
|
||||
ldr r2, phys_l2x0_saved_regs
|
||||
ldr r0, [r2, #L2X0_R_PHY_BASE] @ get physical base of l2x0
|
||||
ldr r1, [r2, #L2X0_R_AUX_CTRL] @ get aux_ctrl value
|
||||
str r1, [r0, #L2X0_AUX_CTRL] @ restore aux_ctrl
|
||||
mov r1, #0x1
|
||||
str r1, [r0, #L2X0_CTRL] @ re-enable L2
|
||||
.endm
|
||||
|
||||
ENTRY(v7_cpu_resume)
|
||||
bl v7_invalidate_l1
|
||||
pl310_resume
|
||||
b cpu_resume
|
||||
ENDPROC(v7_cpu_resume)
|
||||
|
||||
.globl phys_l2x0_saved_regs
|
||||
phys_l2x0_saved_regs:
|
||||
.long 0
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright 2011 Freescale Semiconductor, Inc.
|
||||
* Copyright 2011 Linaro Ltd.
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/errno.h>
|
||||
#include <asm/cacheflush.h>
|
||||
#include <mach/common.h>
|
||||
|
||||
int platform_cpu_kill(unsigned int cpu)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* platform-specific code to shutdown a CPU
|
||||
*
|
||||
* Called with IRQs disabled
|
||||
*/
|
||||
void platform_cpu_die(unsigned int cpu)
|
||||
{
|
||||
flush_cache_all();
|
||||
imx_enable_cpu(cpu, false);
|
||||
cpu_do_idle();
|
||||
|
||||
/* We should never return from idle */
|
||||
panic("cpu %d unexpectedly exit from shutdown\n", cpu);
|
||||
}
|
||||
|
||||
int platform_cpu_disable(unsigned int cpu)
|
||||
{
|
||||
/*
|
||||
* we don't allow CPU 0 to be shutdown (it is still too special
|
||||
* e.g. clock tick interrupts)
|
||||
*/
|
||||
return cpu == 0 ? -EPERM : 0;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2011 Freescale Semiconductor, Inc.
|
||||
* Copyright 2011 Linaro Ltd.
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/sizes.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <mach/hardware.h>
|
||||
|
||||
static struct map_desc imx_lluart_desc = {
|
||||
#ifdef CONFIG_DEBUG_IMX6Q_UART
|
||||
.virtual = MX6Q_IO_P2V(MX6Q_UART4_BASE_ADDR),
|
||||
.pfn = __phys_to_pfn(MX6Q_UART4_BASE_ADDR),
|
||||
.length = MX6Q_UART4_SIZE,
|
||||
.type = MT_DEVICE,
|
||||
#endif
|
||||
};
|
||||
|
||||
void __init imx_lluart_map_io(void)
|
||||
{
|
||||
if (imx_lluart_desc.virtual)
|
||||
iotable_init(&imx_lluart_desc, 1);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2011 Freescale Semiconductor, Inc.
|
||||
* Copyright 2011 Linaro Ltd.
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/clockchips.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <asm/smp_twd.h>
|
||||
|
||||
/*
|
||||
* Setup the local clock events for a CPU.
|
||||
*/
|
||||
int __cpuinit local_timer_setup(struct clock_event_device *evt)
|
||||
{
|
||||
struct device_node *np;
|
||||
|
||||
np = of_find_compatible_node(NULL, NULL, "arm,smp-twd");
|
||||
if (!twd_base) {
|
||||
twd_base = of_iomap(np, 0);
|
||||
WARN_ON(!twd_base);
|
||||
}
|
||||
evt->irq = irq_of_parse_and_map(np, 0);
|
||||
twd_timer_setup(evt);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2011 Freescale Semiconductor, Inc.
|
||||
* Copyright 2011 Linaro Ltd.
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/irqdomain.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <asm/hardware/cache-l2x0.h>
|
||||
#include <asm/hardware/gic.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/time.h>
|
||||
#include <mach/common.h>
|
||||
#include <mach/hardware.h>
|
||||
|
||||
static void __init imx6q_init_machine(void)
|
||||
{
|
||||
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
|
||||
|
||||
imx6q_pm_init();
|
||||
}
|
||||
|
||||
static void __init imx6q_map_io(void)
|
||||
{
|
||||
imx_lluart_map_io();
|
||||
imx_scu_map_io();
|
||||
}
|
||||
|
||||
static void __init imx6q_gpio_add_irq_domain(struct device_node *np,
|
||||
struct device_node *interrupt_parent)
|
||||
{
|
||||
static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS -
|
||||
32 * 7; /* imx6q gets 7 gpio ports */
|
||||
|
||||
irq_domain_add_simple(np, gpio_irq_base);
|
||||
gpio_irq_base += 32;
|
||||
}
|
||||
|
||||
static const struct of_device_id imx6q_irq_match[] __initconst = {
|
||||
{ .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
|
||||
{ .compatible = "fsl,imx6q-gpio", .data = imx6q_gpio_add_irq_domain, },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
static void __init imx6q_init_irq(void)
|
||||
{
|
||||
l2x0_of_init(0, ~0UL);
|
||||
imx_src_init();
|
||||
imx_gpc_init();
|
||||
of_irq_init(imx6q_irq_match);
|
||||
}
|
||||
|
||||
static void __init imx6q_timer_init(void)
|
||||
{
|
||||
mx6q_clocks_init();
|
||||
}
|
||||
|
||||
static struct sys_timer imx6q_timer = {
|
||||
.init = imx6q_timer_init,
|
||||
};
|
||||
|
||||
static const char *imx6q_dt_compat[] __initdata = {
|
||||
"fsl,imx6q-sabreauto",
|
||||
NULL,
|
||||
};
|
||||
|
||||
DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)")
|
||||
.map_io = imx6q_map_io,
|
||||
.init_irq = imx6q_init_irq,
|
||||
.handle_irq = imx6q_handle_irq,
|
||||
.timer = &imx6q_timer,
|
||||
.init_machine = imx6q_init_machine,
|
||||
.dt_compat = imx6q_dt_compat,
|
||||
MACHINE_END
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright 2011 Freescale Semiconductor, Inc.
|
||||
* Copyright 2011 Linaro Ltd.
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_device.h>
|
||||
|
||||
#define MMDC_MAPSR 0x404
|
||||
#define BP_MMDC_MAPSR_PSD 0
|
||||
#define BP_MMDC_MAPSR_PSS 4
|
||||
|
||||
static int __devinit imx_mmdc_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
void __iomem *mmdc_base, *reg;
|
||||
u32 val;
|
||||
int timeout = 0x400;
|
||||
|
||||
mmdc_base = of_iomap(np, 0);
|
||||
WARN_ON(!mmdc_base);
|
||||
|
||||
reg = mmdc_base + MMDC_MAPSR;
|
||||
|
||||
/* Enable automatic power saving */
|
||||
val = readl_relaxed(reg);
|
||||
val &= ~(1 << BP_MMDC_MAPSR_PSD);
|
||||
writel_relaxed(val, reg);
|
||||
|
||||
/* Ensure it's successfully enabled */
|
||||
while (!(readl_relaxed(reg) & 1 << BP_MMDC_MAPSR_PSS) && --timeout)
|
||||
cpu_relax();
|
||||
|
||||
if (unlikely(!timeout)) {
|
||||
pr_warn("%s: failed to enable automatic power saving\n",
|
||||
__func__);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct of_device_id imx_mmdc_dt_ids[] = {
|
||||
{ .compatible = "fsl,imx6q-mmdc", },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
static struct platform_driver imx_mmdc_driver = {
|
||||
.driver = {
|
||||
.name = "imx-mmdc",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = imx_mmdc_dt_ids,
|
||||
},
|
||||
.probe = imx_mmdc_probe,
|
||||
};
|
||||
|
||||
static int __init imx_mmdc_init(void)
|
||||
{
|
||||
return platform_driver_register(&imx_mmdc_driver);
|
||||
}
|
||||
postcore_initcall(imx_mmdc_init);
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright 2011 Freescale Semiconductor, Inc.
|
||||
* Copyright 2011 Linaro Ltd.
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/smp.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/smp_scu.h>
|
||||
#include <asm/hardware/gic.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <mach/common.h>
|
||||
#include <mach/hardware.h>
|
||||
|
||||
static void __iomem *scu_base;
|
||||
|
||||
static struct map_desc scu_io_desc __initdata = {
|
||||
/* .virtual and .pfn are run-time assigned */
|
||||
.length = SZ_4K,
|
||||
.type = MT_DEVICE,
|
||||
};
|
||||
|
||||
void __init imx_scu_map_io(void)
|
||||
{
|
||||
unsigned long base;
|
||||
|
||||
/* Get SCU base */
|
||||
asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base));
|
||||
|
||||
scu_io_desc.virtual = IMX_IO_P2V(base);
|
||||
scu_io_desc.pfn = __phys_to_pfn(base);
|
||||
iotable_init(&scu_io_desc, 1);
|
||||
|
||||
scu_base = IMX_IO_ADDRESS(base);
|
||||
}
|
||||
|
||||
void __cpuinit platform_secondary_init(unsigned int cpu)
|
||||
{
|
||||
/*
|
||||
* if any interrupts are already enabled for the primary
|
||||
* core (e.g. timer irq), then they will not have been enabled
|
||||
* for us: do so
|
||||
*/
|
||||
gic_secondary_init(0);
|
||||
}
|
||||
|
||||
int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
|
||||
{
|
||||
imx_set_cpu_jump(cpu, v7_secondary_startup);
|
||||
imx_enable_cpu(cpu, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialise the CPU possible map early - this describes the CPUs
|
||||
* which may be present or become present in the system.
|
||||
*/
|
||||
void __init smp_init_cpus(void)
|
||||
{
|
||||
int i, ncores;
|
||||
|
||||
ncores = scu_get_core_count(scu_base);
|
||||
|
||||
for (i = 0; i < ncores; i++)
|
||||
set_cpu_possible(i, true);
|
||||
|
||||
set_smp_cross_call(gic_raise_softirq);
|
||||
}
|
||||
|
||||
void imx_smp_prepare(void)
|
||||
{
|
||||
scu_enable(scu_base);
|
||||
}
|
||||
|
||||
void __init platform_smp_prepare_cpus(unsigned int max_cpus)
|
||||
{
|
||||
imx_smp_prepare();
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright 2011 Freescale Semiconductor, Inc.
|
||||
* Copyright 2011 Linaro Ltd.
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/proc-fns.h>
|
||||
#include <asm/suspend.h>
|
||||
#include <asm/hardware/cache-l2x0.h>
|
||||
#include <mach/common.h>
|
||||
#include <mach/hardware.h>
|
||||
|
||||
extern unsigned long phys_l2x0_saved_regs;
|
||||
|
||||
static int imx6q_suspend_finish(unsigned long val)
|
||||
{
|
||||
cpu_do_idle();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int imx6q_pm_enter(suspend_state_t state)
|
||||
{
|
||||
switch (state) {
|
||||
case PM_SUSPEND_MEM:
|
||||
imx6q_set_lpm(STOP_POWER_OFF);
|
||||
imx_gpc_pre_suspend();
|
||||
imx_set_cpu_jump(0, v7_cpu_resume);
|
||||
/* Zzz ... */
|
||||
cpu_suspend(0, imx6q_suspend_finish);
|
||||
imx_smp_prepare();
|
||||
imx_gpc_post_resume();
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct platform_suspend_ops imx6q_pm_ops = {
|
||||
.enter = imx6q_pm_enter,
|
||||
.valid = suspend_valid_only_mem,
|
||||
};
|
||||
|
||||
void __init imx6q_pm_init(void)
|
||||
{
|
||||
/*
|
||||
* The l2x0 core code provides an infrastucture to save and restore
|
||||
* l2x0 registers across suspend/resume cycle. But because imx6q
|
||||
* retains L2 content during suspend and needs to resume L2 before
|
||||
* MMU is enabled, it can only utilize register saving support and
|
||||
* have to take care of restoring on its own. So we save physical
|
||||
* address of the data structure used by l2x0 core to save registers,
|
||||
* and later restore the necessary ones in imx6q resume entry.
|
||||
*/
|
||||
phys_l2x0_saved_regs = __pa(&l2x0_saved_regs);
|
||||
|
||||
suspend_set_ops(&imx6q_pm_ops);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user