[Armadeus-commitlog] armadeus branch, master, updated. release-3.4-196-g3567025
Brought to you by:
sszy
|
From: jorasse <jo...@us...> - 2011-06-19 21:24:51
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 35670252dedb8b6eafd5639e1cbf4b2a5cc9e63d (commit)
via 1df84d8889790b96898281a724eb7f655c48b9ce (commit)
via 98ef11ae9bc99177c260d50d09854570c07375d4 (commit)
via 15911f92214adbd18ca5c51a81b12af964aebbc4 (commit)
from 6ee9c481286823845961692b332a9774b455c321 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 35670252dedb8b6eafd5639e1cbf4b2a5cc9e63d
Merge: 1df84d8889790b96898281a724eb7f655c48b9ce 6ee9c481286823845961692b332a9774b455c321
Author: jorasse <jo...@ar...>
Date: Sun Jun 19 23:28:00 2011 +0200
[LINUX] apf51: Fix watchdog configuration
commit 1df84d8889790b96898281a724eb7f655c48b9ce
Author: jorasse <jo...@ar...>
Date: Sun Jun 19 23:23:40 2011 +0200
[LINUX] apf51: Fix watchdog configuration
commit 98ef11ae9bc99177c260d50d09854570c07375d4
Author: jorasse <jo...@ar...>
Date: Sun Jun 19 15:17:52 2011 +0200
[LINUX] apf51: Fix USB OTG & kernel config to support CPU sleep modes
commit 15911f92214adbd18ca5c51a81b12af964aebbc4
Author: jorasse <jo...@ar...>
Date: Sun Jun 19 15:12:52 2011 +0200
[LINUX] APF51: update power management
-----------------------------------------------------------------------
Summary of changes:
.../armadeus/apf51/apf51-linux-2.6.38.config | 50 ++++---
.../433-add_pm_mem_standby_modes_support.patch | 115 --------------
.../437-freescale-allow-mx51-to-enter-WFI.patch | 164 ++++++++++++++++++++
.../438-freescale-support-low-power-suspend.patch | 146 +++++++++++++++++
4 files changed, 339 insertions(+), 136 deletions(-)
delete mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/433-add_pm_mem_standby_modes_support.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/437-freescale-allow-mx51-to-enter-WFI.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/438-freescale-support-low-power-suspend.patch
diff --git a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
index 5e352d2..3541c43 100644
--- a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
+++ b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
@@ -1,9 +1,10 @@
#
# Automatically generated make config: don't edit
# Linux/arm 2.6.38.1 Kernel Configuration
-# Wed Jun 15 13:59:05 2011
+# Sun Jun 19 23:11:15 2011
#
CONFIG_ARM=y
+CONFIG_HAVE_PWM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_GENERIC_GPIO=y
# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
@@ -48,8 +49,7 @@ CONFIG_KERNEL_GZIP=y
# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_POSIX_MQUEUE_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
# CONFIG_AUDIT is not set
@@ -77,7 +77,8 @@ CONFIG_PREEMPT_RCU=y
CONFIG_RCU_FANOUT=32
# CONFIG_RCU_FANOUT_EXACT is not set
# CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_IKCONFIG is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_CGROUPS is not set
# CONFIG_NAMESPACES is not set
@@ -93,7 +94,7 @@ CONFIG_EMBEDDED=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
@@ -294,7 +295,7 @@ CONFIG_MACH_APF51_DEV=y
# CONFIG_MACH_APF51_PROTO is not set
# CONFIG_MXC_IRQ_PRIOR is not set
CONFIG_MXC_TZIC=y
-# CONFIG_MXC_PWM is not set
+CONFIG_MXC_PWM=y
# CONFIG_MXC_DEBUG_BOARD is not set
CONFIG_MXC_ULPI=y
CONFIG_ARCH_MXC_IOMUX_V3=y
@@ -455,8 +456,8 @@ CONFIG_PM_SLEEP=y
CONFIG_SUSPEND=y
# CONFIG_PM_TEST_SUSPEND is not set
CONFIG_SUSPEND_FREEZER=y
-# CONFIG_APM_EMULATION is not set
-# CONFIG_PM_RUNTIME is not set
+CONFIG_APM_EMULATION=y
+CONFIG_PM_RUNTIME=y
CONFIG_PM_OPS=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_NET=y
@@ -970,6 +971,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_JOYDEV=y
CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_EVBUG is not set
+# CONFIG_INPUT_APMPOWER is not set
#
# Input Device Drivers
@@ -1048,6 +1050,7 @@ CONFIG_INPUT_MISC=y
# CONFIG_INPUT_CM109 is not set
CONFIG_INPUT_UINPUT=m
# CONFIG_INPUT_PCF8574 is not set
+# CONFIG_INPUT_PWM_BEEPER is not set
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
CONFIG_INPUT_WM831X_ON=y
# CONFIG_INPUT_ADXL34X is not set
@@ -1217,6 +1220,7 @@ CONFIG_GPIO_WM831X=m
CONFIG_POWER_SUPPLY=m
# CONFIG_POWER_SUPPLY_DEBUG is not set
# CONFIG_PDA_POWER is not set
+# CONFIG_APM_POWER is not set
CONFIG_WM831X_BACKUP=m
CONFIG_WM831X_POWER=m
# CONFIG_TEST_POWER is not set
@@ -1225,7 +1229,6 @@ CONFIG_WM831X_POWER=m
# CONFIG_BATTERY_BQ27x00 is not set
# CONFIG_BATTERY_MAX17040 is not set
# CONFIG_BATTERY_MAX17042 is not set
-# CONFIG_CHARGER_ISP1704 is not set
# CONFIG_CHARGER_GPIO is not set
CONFIG_HWMON=m
# CONFIG_HWMON_VID is not set
@@ -1315,7 +1318,7 @@ CONFIG_SENSORS_WM831X=m
# CONFIG_SENSORS_LIS3_I2C is not set
# CONFIG_THERMAL is not set
CONFIG_WATCHDOG=y
-# CONFIG_WATCHDOG_NOWAYOUT is not set
+CONFIG_WATCHDOG_NOWAYOUT=y
#
# Watchdog Device Drivers
@@ -1323,7 +1326,7 @@ CONFIG_WATCHDOG=y
# CONFIG_SOFT_WATCHDOG is not set
CONFIG_WM831X_WATCHDOG=m
# CONFIG_MAX63XX_WATCHDOG is not set
-CONFIG_IMX2_WDT=m
+CONFIG_IMX2_WDT=y
#
# USB-based Watchdog Cards
@@ -1421,6 +1424,7 @@ CONFIG_LCD_CLASS_DEVICE=m
# CONFIG_LCD_S6E63M0 is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_BACKLIGHT_GENERIC=m
+# CONFIG_BACKLIGHT_PWM is not set
# CONFIG_BACKLIGHT_WM831X is not set
# CONFIG_BACKLIGHT_ADP8860 is not set
@@ -1564,9 +1568,11 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
#
# Miscellaneous USB options
#
-CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DEVICEFS is not set
# CONFIG_USB_DEVICE_CLASS is not set
# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+CONFIG_USB_OTG=y
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
CONFIG_USB_MON=y
@@ -1579,7 +1585,7 @@ CONFIG_USB_MON=y
# CONFIG_USB_C67X00_HCD is not set
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
-# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_MXC=y
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
@@ -1655,13 +1661,13 @@ CONFIG_USB_STORAGE=y
# CONFIG_USB_TEST is not set
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_YUREX is not set
-CONFIG_USB_GADGET=y
-# CONFIG_USB_GADGET_DEBUG_FILES is not set
-# CONFIG_USB_GADGET_DEBUG_FS is not set
+CONFIG_USB_GADGET=m
+CONFIG_USB_GADGET_DEBUG_FILES=y
+CONFIG_USB_GADGET_DEBUG_FS=y
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_SELECTED=y
CONFIG_USB_GADGET_FSL_USB2=y
-CONFIG_USB_FSL_USB2=y
+CONFIG_USB_FSL_USB2=m
# CONFIG_USB_GADGET_R8A66597 is not set
# CONFIG_USB_GADGET_PXA_U2O is not set
# CONFIG_USB_GADGET_M66592 is not set
@@ -1681,16 +1687,17 @@ CONFIG_USB_G_SERIAL=m
# CONFIG_USB_MIDI_GADGET is not set
# CONFIG_USB_G_PRINTER is not set
CONFIG_USB_CDC_COMPOSITE=m
-# CONFIG_USB_G_MULTI is not set
+CONFIG_USB_G_MULTI=m
+CONFIG_USB_G_MULTI_RNDIS=y
+CONFIG_USB_G_MULTI_CDC=y
CONFIG_USB_G_HID=m
# CONFIG_USB_G_DBGP is not set
#
# OTG and related infrastructure
#
-CONFIG_USB_OTG_UTILS=y
# CONFIG_USB_GPIO_VBUS is not set
-CONFIG_USB_ULPI=y
+# CONFIG_USB_ULPI is not set
# CONFIG_NOP_USB_XCEIV is not set
#
@@ -1786,6 +1793,7 @@ CONFIG_LEDS_GPIO_PLATFORM=y
# CONFIG_LEDS_PCA955X is not set
CONFIG_LEDS_WM831X_STATUS=m
# CONFIG_LEDS_DAC124S085 is not set
+# CONFIG_LEDS_PWM is not set
# CONFIG_LEDS_BD2802 is not set
# CONFIG_LEDS_LT3593 is not set
# CONFIG_LEDS_TRIGGERS is not set
@@ -1856,7 +1864,7 @@ CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_MSM6242 is not set
-CONFIG_RTC_MXC=m
+CONFIG_RTC_MXC=y
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_V3020 is not set
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/433-add_pm_mem_standby_modes_support.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/433-add_pm_mem_standby_modes_support.patch
deleted file mode 100644
index da45950..0000000
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/433-add_pm_mem_standby_modes_support.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From: Dinh Nguyen <Din...@fr...>
-Adds initial low power suspend functionality to MX51.
-Supports "mem" and "standby" modes.
-Signed-off-by: Dinh Nguyen <Din...@fr...>
----
- arch/arm/mach-mx5/Makefile      |   1 +
- arch/arm/mach-mx5/pm.c        |  75 ++++++++++++++++++++++++++++++++++
-Â arch/arm/plat-mxc/include/mach/mxc.h | Â Â 1 +
-Â 3 files changed, 77 insertions(+), 0 deletions(-)
-Â create mode 100644 arch/arm/mach-mx5/pm.c
-diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
-index 4f63048..7f9435d 100644
---- a/arch/arm/mach-mx5/Makefile
-+++ b/arch/arm/mach-mx5/Makefile
-@@ -6,6 +6,7 @@
- obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o
- obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
-+obj-$(CONFIG_PM) += pm.o
-
- obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
- obj-$(CONFIG_MACH_APF51) += board-apf51.o
- obj-$(CONFIG_MACH_APF51_DEV) += apf51dev-baseboard.o
-diff --git a/arch/arm/mach-mx5/pm.c b/arch/arm/mach-mx5/pm.c
-new file mode 100644
-index 0000000..137d204
---- /dev/null
-+++ b/arch/arm/mach-mx5/pm.c
-@@ -0,0 +1,75 @@
-+/*
-+ * Â Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
-+ *
-+ * 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/suspend.h>
-+#include <asm/mach/map.h>
-+#include <mach/system.h>
-+#include "crm_regs.h"
-+
-+static int mx5_suspend_enter(suspend_state_t state)
-+{
-+ u32 plat_lpc, arm_srpgcr, ccm_clpcr;
-+
-+ /* always allow platform to issue a deep sleep mode request */
-+ plat_lpc = __raw_readl(MXC_CORTEXA8_PLAT_LPC) &
-+ ~(MXC_CORTEXA8_PLAT_LPC_DSM);
-+ ccm_clpcr = __raw_readl(MXC_CCM_CLPCR) & ~(MXC_CCM_CLPCR_LPM_MASK);
-+ arm_srpgcr = __raw_readl(MXC_SRPG_ARM_SRPGCR) & ~(MXC_SRPGCR_PCR);
-+
-+ switch (state) {
-+ case PM_SUSPEND_MEM:
-+ ccm_clpcr |= (0x2 << MXC_CCM_CLPCR_LPM_OFFSET);
-+ ccm_clpcr |= (0x3 << MXC_CCM_CLPCR_STBY_COUNT_OFFSET);
-+ ccm_clpcr |= MXC_CCM_CLPCR_VSTBY;
-+ ccm_clpcr |= MXC_CCM_CLPCR_SBYOS;
-+ break;
-+ case PM_SUSPEND_STANDBY:
-+ ccm_clpcr |= (0x1 << MXC_CCM_CLPCR_LPM_OFFSET);
-+ ccm_clpcr &= ~MXC_CCM_CLPCR_VSTBY;
-+ ccm_clpcr &= ~MXC_CCM_CLPCR_SBYOS;
-+ break;
-+ default:
-+ return -EINVAL;
-+ }
-+
-+ plat_lpc |= MXC_CORTEXA8_PLAT_LPC_DSM
-+ | MXC_CORTEXA8_PLAT_LPC_DBG_DSM;
-+ arm_srpgcr |= MXC_SRPGCR_PCR;
-+
-+ __raw_writel(plat_lpc, MXC_CORTEXA8_PLAT_LPC);
-+ __raw_writel(ccm_clpcr, MXC_CCM_CLPCR);
-+ __raw_writel(arm_srpgcr, MXC_SRPG_ARM_SRPGCR);
-+ __raw_writel(arm_srpgcr, MXC_SRPG_NEON_SRPGCR);
-+
-+ if (tzic_enable_wake(0) != 0)
-+ return -EAGAIN;
-+
-+ cpu_do_idle();
-+ return 0;
-+}
-+
-+static int mx5_pm_valid(suspend_state_t state)
-+{
-+ return (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX);
-+}
-+
-+static const struct platform_suspend_ops mx5_suspend_ops = {
-+ .valid = mx5_pm_valid,
-+ .enter = mx5_suspend_enter,
-+};
-+
-+static int __init mx5_pm_init(void)
-+{
-+ if (cpu_is_mx51())
-+ suspend_set_ops(&mx5_suspend_ops);
-+
-+ return 0;
-+}
-+device_initcall(mx5_pm_init);
-diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/plat-mxc/include/mach/mxc.h
-index 04c7a26..a72839f 100644
---- a/arch/arm/plat-mxc/include/mach/mxc.h
-+++ b/arch/arm/plat-mxc/include/mach/mxc.h
-@@ -54,6 +54,7 @@
- #ifndef __ASSEMBLY__
- extern unsigned int __mxc_cpu_type;
-+int tzic_enable_wake(int is_idle);
- #endif
-
- #ifdef CONFIG_ARCH_MX1
-
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/437-freescale-allow-mx51-to-enter-WFI.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/437-freescale-allow-mx51-to-enter-WFI.patch
new file mode 100644
index 0000000..a5d0de3
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/437-freescale-allow-mx51-to-enter-WFI.patch
@@ -0,0 +1,164 @@
+From: Dinh Nguyen <Din...@fr...>
+Date: Mon, 21 Mar 2011 21:30:37 +0000 (-0500)
+Subject: ARM: mx51: Implement code to allow mx51 to enter WFI
+X-Git-Tag: v2.6.39-rc2~40^2^2^2~10
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fnext%2Flinux-next.git;a=commitdiff_plain;h=0adf882b6894cd150392400e9642787cf691016a
+
+ARM: mx51: Implement code to allow mx51 to enter WFI
+
+Implement code for MX51 that allows the SoC to enter WFI when
+arch_idle is called.
+
+This patch is also necessary for correctly suspending the system.
+
+Signed-off-by: Dinh Nguyen <Din...@fr...>
+Signed-off-by: Sascha Hauer <s....@pe...>
+---
+
+diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
+index 4f63048..0b9338c 100644
+--- a/arch/arm/mach-mx5/Makefile
++++ b/arch/arm/mach-mx5/Makefile
+@@ -3,7 +3,7 @@
+ #
+
+ # Object file lists.
+-obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o ehci.o
++obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o ehci.o system.o
+ obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
+
+ obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
+diff --git a/arch/arm/mach-mx5/system.c b/arch/arm/mach-mx5/system.c
+new file mode 100644
+index 0000000..76ae8dc
+--- /dev/null
++++ b/arch/arm/mach-mx5/system.c
+@@ -0,0 +1,84 @@
++/*
++ * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
++ */
++
++/*
++ * 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/platform_device.h>
++#include <linux/io.h>
++#include <mach/hardware.h>
++#include "crm_regs.h"
++
++/* set cpu low power mode before WFI instruction. This function is called
++ * mx5 because it can be used for mx50, mx51, and mx53.*/
++void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode)
++{
++ u32 plat_lpc, arm_srpgcr, ccm_clpcr;
++ u32 empgc0, empgc1;
++ int stop_mode = 0;
++
++ /* always allow platform to issue a deep sleep mode request */
++ plat_lpc = __raw_readl(MXC_CORTEXA8_PLAT_LPC) &
++ ~(MXC_CORTEXA8_PLAT_LPC_DSM);
++ ccm_clpcr = __raw_readl(MXC_CCM_CLPCR) & ~(MXC_CCM_CLPCR_LPM_MASK);
++ arm_srpgcr = __raw_readl(MXC_SRPG_ARM_SRPGCR) & ~(MXC_SRPGCR_PCR);
++ empgc0 = __raw_readl(MXC_SRPG_EMPGC0_SRPGCR) & ~(MXC_SRPGCR_PCR);
++ empgc1 = __raw_readl(MXC_SRPG_EMPGC1_SRPGCR) & ~(MXC_SRPGCR_PCR);
++
++ switch (mode) {
++ case WAIT_CLOCKED:
++ break;
++ case WAIT_UNCLOCKED:
++ ccm_clpcr |= 0x1 << MXC_CCM_CLPCR_LPM_OFFSET;
++ break;
++ case WAIT_UNCLOCKED_POWER_OFF:
++ case STOP_POWER_OFF:
++ plat_lpc |= MXC_CORTEXA8_PLAT_LPC_DSM
++ | MXC_CORTEXA8_PLAT_LPC_DBG_DSM;
++ if (mode == WAIT_UNCLOCKED_POWER_OFF) {
++ ccm_clpcr |= 0x1 << MXC_CCM_CLPCR_LPM_OFFSET;
++ ccm_clpcr &= ~MXC_CCM_CLPCR_VSTBY;
++ ccm_clpcr &= ~MXC_CCM_CLPCR_SBYOS;
++ stop_mode = 0;
++ } else {
++ ccm_clpcr |= 0x2 << MXC_CCM_CLPCR_LPM_OFFSET;
++ ccm_clpcr |= 0x3 << MXC_CCM_CLPCR_STBY_COUNT_OFFSET;
++ ccm_clpcr |= MXC_CCM_CLPCR_VSTBY;
++ ccm_clpcr |= MXC_CCM_CLPCR_SBYOS;
++ stop_mode = 1;
++ }
++ arm_srpgcr |= MXC_SRPGCR_PCR;
++
++ if (tzic_enable_wake(1) != 0)
++ return;
++ break;
++ case STOP_POWER_ON:
++ ccm_clpcr |= 0x2 << MXC_CCM_CLPCR_LPM_OFFSET;
++ break;
++ default:
++ printk(KERN_WARNING "UNKNOWN cpu power mode: %d\n", mode);
++ return;
++ }
++
++ __raw_writel(plat_lpc, MXC_CORTEXA8_PLAT_LPC);
++ __raw_writel(ccm_clpcr, MXC_CCM_CLPCR);
++ __raw_writel(arm_srpgcr, MXC_SRPG_ARM_SRPGCR);
++
++ /* Enable NEON SRPG for all but MX50TO1.0. */
++ /*if (mx50_revision() != IMX_CHIP_REVISION_1_0)
++ __raw_writel(arm_srpgcr, MXC_SRPG_NEON_SRPGCR);*/
++
++ if (stop_mode) {
++ empgc0 |= MXC_SRPGCR_PCR;
++ empgc1 |= MXC_SRPGCR_PCR;
++
++ __raw_writel(empgc0, MXC_SRPG_EMPGC0_SRPGCR);
++ __raw_writel(empgc1, MXC_SRPG_EMPGC1_SRPGCR);
++ }
++}
+diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/plat-mxc/include/mach/mxc.h
+index 3322c7a..1aea818 100644
+--- a/arch/arm/plat-mxc/include/mach/mxc.h
++++ b/arch/arm/plat-mxc/include/mach/mxc.h
+@@ -195,6 +195,15 @@ struct cpu_op {
+ u32 cpu_rate;
+ };
+
++int tzic_enable_wake(int is_idle);
++enum mxc_cpu_pwr_mode {
++ WAIT_CLOCKED, /* wfi only */
++ WAIT_UNCLOCKED, /* WAIT */
++ WAIT_UNCLOCKED_POWER_OFF, /* WAIT + SRPG */
++ STOP_POWER_ON, /* just STOP */
++ STOP_POWER_OFF, /* STOP + SRPG */
++};
++
+ extern struct cpu_op *(*get_cpu_op)(int *op);
+ #endif
+
+diff --git a/arch/arm/plat-mxc/include/mach/system.h b/arch/arm/plat-mxc/include/mach/system.h
+index 95be51b..0417da9 100644
+--- a/arch/arm/plat-mxc/include/mach/system.h
++++ b/arch/arm/plat-mxc/include/mach/system.h
+@@ -20,6 +20,8 @@
+ #include <mach/hardware.h>
+ #include <mach/common.h>
+
++extern void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode);
++
+ static inline void arch_idle(void)
+ {
+ #ifdef CONFIG_ARCH_MXC91231
+@@ -54,7 +56,9 @@ static inline void arch_idle(void)
+ "orr %0, %0, #0x00000004\n"
+ "mcr p15, 0, %0, c1, c0, 0\n"
+ : "=r" (reg));
+- } else
++ } else if (cpu_is_mx51())
++ mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
++ else
+ cpu_do_idle();
+ }
+
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/438-freescale-support-low-power-suspend.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/438-freescale-support-low-power-suspend.patch
new file mode 100644
index 0000000..c2e9d6b
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/438-freescale-support-low-power-suspend.patch
@@ -0,0 +1,146 @@
+From: Dinh Nguyen <Dinh.Nguyen@xxxxxxxxxxxxx>
+
+Adds initial low power suspend functionality to MX51.
+Supports "mem" and "standby" modes.
+
+Tested on mx51-babbage.
+
+Signed-off-by: Dinh Nguyen <Dinh.Nguyen@xxxxxxxxxxxxx>
+---
+ arch/arm/mach-mx5/Makefile | 1 +
+ arch/arm/mach-mx5/pm-imx5.c | 74 +++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 75 insertions(+), 0 deletions(-)
+ create mode 100644 arch/arm/mach-mx5/pm-imx5.c
+
+diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
+index 0b9338c..d646feb 100644
+--- a/arch/arm/mach-mx5/Makefile
++++ b/arch/arm/mach-mx5/Makefile
+@@ -6,6 +6,7 @@
+ obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o ehci.o system.o
+ obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
+
++obj-$(CONFIG_PM) += pm-imx5.o
+ obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
+ obj-$(CONFIG_MACH_APF51) += board-apf51.o
+ obj-$(CONFIG_MACH_APF51_DEV) += apf51dev-baseboard.odiff --git a/arch/arm/mach-mx5/pm-imx5.c b/arch/arm/mach-mx5/pm-imx5.c
+new file mode 100644
+index 0000000..2232d04
+--- /dev/null
++++ b/arch/arm/mach-mx5/pm-imx5.c
+@@ -0,0 +1,74 @@
++/*
++ * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
++ *
++ * 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/suspend.h>
++#include <linux/clk.h>
++#include <linux/io.h>
++#include <linux/err.h>
++#include <asm/cacheflush.h>
++#include <asm/tlbflush.h>
++#include <mach/system.h>
++#include "crm_regs.h"
++
++static struct clk *gpc_dvfs_clk;
++
++static int mx5_suspend_enter(suspend_state_t state)
++{
++ clk_enable(gpc_dvfs_clk);
++ switch (state) {
++ case PM_SUSPEND_MEM:
++ mx5_cpu_lp_set(STOP_POWER_OFF);
++ break;
++ case PM_SUSPEND_STANDBY:
++ mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ if (state == PM_SUSPEND_MEM) {
++ local_flush_tlb_all();
++ flush_cache_all();
++
++ /*clear the EMPGC0/1 bits */
++ __raw_writel(0, MXC_SRPG_EMPGC0_SRPGCR);
++ __raw_writel(0, MXC_SRPG_EMPGC1_SRPGCR);
++ }
++ cpu_do_idle();
++ clk_disable(gpc_dvfs_clk);
++
++ return 0;
++}
++
++static int mx5_pm_valid(suspend_state_t state)
++{
++ return (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX);
++}
++
++static const struct platform_suspend_ops mx5_suspend_ops = {
++ .valid = mx5_pm_valid,
++ .enter = mx5_suspend_enter,
++};
++
++static int __init mx5_pm_init(void)
++{
++ if (!cpu_is_mx51())
++ return 0;
++
++ gpc_dvfs_clk = clk_get(NULL, "gpc_dvfs");
++
++ if (IS_ERR(gpc_dvfs_clk))
++ printk(KERN_ERR "Cannot enter SRPG suspend -no gpc_dvfs clock!\n");
++ else
++ suspend_set_ops(&mx5_suspend_ops);
++
++ return 0;
++}
++device_initcall(mx5_pm_init);
+From b6e89b21824cc37ab19e0209a7754c74d237a123 Mon Sep 17 00:00:00 2001
+From: Dinh Nguyen <Din...@fr...>
+Date: Mon, 21 Mar 2011 16:30:36 -0500
+Subject: [PATCH] ARM: mx51: Add entry for gpc_dvfs_clk
+
+For MX51 SRPG, we need to turn on the GPC clock in order to set the
+SRPG registers.
+
+Signed-off-by: Dinh Nguyen <Din...@fr...>
+Signed-off-by: Sascha Hauer <s....@pe...>
+---
+ arch/arm/mach-mx5/clock-mx51-mx53.c | 8 ++++++++
+ 1 files changed, 8 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
+index cc6ad1c..fdbc05e 100644
+--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
++++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
+@@ -865,6 +865,13 @@ static struct clk aips_tz2_clk = {
+ .disable = _clk_ccgr_disable_inwait,
+ };
+
++static struct clk gpc_dvfs_clk = {
++ .enable_reg = MXC_CCM_CCGR5,
++ .enable_shift = MXC_CCM_CCGRx_CG12_OFFSET,
++ .enable = _clk_ccgr_enable,
++ .disable = _clk_ccgr_disable,
++};
++
+ static struct clk gpt_32k_clk = {
+ .id = 0,
+ .parent = &ckil_clk,
+@@ -1448,6 +1455,7 @@ static struct clk_lookup mx51_lookups[] = {
+ _REGISTER_CLOCK("imx-ipuv3", NULL, ipu_clk)
+ _REGISTER_CLOCK("imx-ipuv3", "di0", ipu_di0_clk)
+ _REGISTER_CLOCK("imx-ipuv3", "di1", ipu_di1_clk)
++ _REGISTER_CLOCK(NULL, "gpc_dvfs", gpc_dvfs_clk)
+ };
+
+ static struct clk_lookup mx53_lookups[] = {
+
hooks/post-receive
--
armadeus
|