public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* RE: Power domain addition.
@ 2006-06-15 23:13 Woodruff, Richard
  2006-06-20 18:09 ` Tony Lindgren
  0 siblings, 1 reply; 11+ messages in thread
From: Woodruff, Richard @ 2006-06-15 23:13 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap-open-source, sampsa.fabritius

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]


> Do you have a patch for your changes?

Just the hack I did for booting yesterday which is attached.  I tried
quickly to make a MT_MEMORY_COHERENT so it could use page tables not
just section entries but that required some changes elsewhere and I just
made it a section entry.

Also the USB msuspend signal is hooked up else you won't sleep.

Regards,
Richard W.

[-- Attachment #2: 242x-git-power_hack.diff --]
[-- Type: application/octet-stream, Size: 15862 bytes --]

diff -purN linux-omap/arch/arm/configs/omap_h4_2420_defconfig linux-omap-git/arch/arm/configs/omap_h4_2420_defconfig
--- linux-omap/arch/arm/configs/omap_h4_2420_defconfig	2006-06-14 09:55:00.000000000 -0500
+++ linux-omap-git/arch/arm/configs/omap_h4_2420_defconfig	2006-06-14 11:02:05.000000000 -0500
@@ -1,12 +1,14 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.16-rc4-omap1
-# Wed Feb 22 02:25:55 2006
+# Linux kernel version: 2.6.17-rc6-omap1
+# Wed Jun 14 11:01:47 2006
 #
 CONFIG_ARM=y
 CONFIG_MMU=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_VECTORS_BASE=0xffff0000
 
 #
 # Code maturity level options
@@ -28,6 +30,7 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
+# CONFIG_RELAY is not set
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_UID16=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -43,10 +46,6 @@ CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
-CONFIG_CC_ALIGN_FUNCTIONS=0
-CONFIG_CC_ALIGN_LABELS=0
-CONFIG_CC_ALIGN_LOOPS=0
-CONFIG_CC_ALIGN_JUMPS=0
 CONFIG_SLAB=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
@@ -59,7 +58,6 @@ CONFIG_OBSOLETE_INTERMODULE=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
-CONFIG_OBSOLETE_MODPARM=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
 CONFIG_KMOD=y
@@ -67,6 +65,7 @@ CONFIG_KMOD=y
 #
 # Block layer
 #
+# CONFIG_BLK_DEV_IO_TRACE is not set
 
 #
 # IO Schedulers
@@ -88,11 +87,13 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # CONFIG_ARCH_CLPS711X is not set
 # CONFIG_ARCH_CO285 is not set
 # CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_IOP3XX is not set
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP23XX is not set
 # CONFIG_ARCH_L7200 is not set
 # CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
@@ -128,6 +129,7 @@ CONFIG_OMAP_MUX_WARNINGS=y
 # CONFIG_OMAP_STI is not set
 CONFIG_OMAP_MPU_TIMER=y
 # CONFIG_OMAP_32K_TIMER is not set
+CONFIG_OMAP_DM_TIMER=y
 CONFIG_OMAP_LL_DEBUG_UART1=y
 # CONFIG_OMAP_LL_DEBUG_UART2 is not set
 # CONFIG_OMAP_LL_DEBUG_UART3 is not set
@@ -182,6 +184,7 @@ CONFIG_ARM_THUMB=y
 #
 # CONFIG_PREEMPT is not set
 # CONFIG_NO_IDLE_HZ is not set
+CONFIG_HZ=100
 # CONFIG_AEABI is not set
 # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
 CONFIG_SELECT_MEMORY_MODEL=y
@@ -204,6 +207,11 @@ CONFIG_CMDLINE="root=/dev/ram0 rw consol
 # CONFIG_XIP_KERNEL is not set
 
 #
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+
+#
 # Floating point emulation
 #
 
@@ -213,7 +221,7 @@ CONFIG_CMDLINE="root=/dev/ram0 rw consol
 CONFIG_FPE_NWFPE=y
 # CONFIG_FPE_NWFPE_XP is not set
 # CONFIG_FPE_FASTFPE is not set
-# CONFIG_VFP is not set
+CONFIG_VFP=y
 
 #
 # Userspace binary formats
@@ -226,7 +234,9 @@ CONFIG_BINFMT_MISC=y
 #
 # Power management options
 #
-# CONFIG_PM is not set
+CONFIG_PM=y
+CONFIG_PM_LEGACY=y
+# CONFIG_PM_DEBUG is not set
 # CONFIG_APM is not set
 
 #
@@ -259,12 +269,15 @@ CONFIG_IP_PNP_DHCP=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
 # CONFIG_INET_TUNNEL is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_BIC=y
 # CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETFILTER is not set
 
 #
@@ -428,7 +441,6 @@ CONFIG_MTD_OMAP_NOR=y
 # CONFIG_MTD_SLRAM is not set
 # CONFIG_MTD_PHRAM is not set
 # CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLKMTD is not set
 # CONFIG_MTD_BLOCK2MTD is not set
 
 #
@@ -633,7 +645,6 @@ CONFIG_WATCHDOG_NOWAYOUT=y
 CONFIG_OMAP_WATCHDOG=y
 # CONFIG_OMAP_RNG is not set
 # CONFIG_NVRAM is not set
-# CONFIG_RTC is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 
@@ -678,13 +689,11 @@ CONFIG_I2C_OMAP=y
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_SENSORS_PCA9539 is not set
 # CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_SENSORS_RTC8564 is not set
 # CONFIG_TPS65010 is not set
 # CONFIG_SENSORS_TLV320AIC23 is not set
 CONFIG_GPIOEXPANDER_OMAP=y
 CONFIG_MENELAUS=y
 # CONFIG_SENSORS_MAX6875 is not set
-# CONFIG_RTC_X1205_I2C is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
@@ -697,6 +706,11 @@ CONFIG_MENELAUS=y
 # CONFIG_SPI_MASTER is not set
 
 #
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
 # Hardware Monitoring support
 #
 # CONFIG_HWMON is not set
@@ -707,13 +721,23 @@ CONFIG_MENELAUS=y
 #
 
 #
-# Multimedia Capabilities Port drivers
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
 #
 
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
+CONFIG_VIDEO_V4L2=y
 
 #
 # Digital Video Broadcasting Devices
@@ -728,6 +752,7 @@ CONFIG_FB=y
 # CONFIG_FB_CFB_COPYAREA is not set
 # CONFIG_FB_CFB_IMAGEBLIT is not set
 # CONFIG_FB_MACMODES is not set
+CONFIG_FB_FIRMWARE_EDID=y
 # CONFIG_FB_MODE_HELPERS is not set
 # CONFIG_FB_TILEBLITTING is not set
 # CONFIG_FB_S1D13XXX is not set
@@ -767,6 +792,7 @@ CONFIG_LOGO_LINUX_CLUT224=y
 #
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
 # CONFIG_USB is not set
 
 #
@@ -784,11 +810,15 @@ CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_MMC=y
 # CONFIG_MMC_DEBUG is not set
 CONFIG_MMC_BLOCK=y
-CONFIG_MMC_BLOCK_BROKEN_RFD=y
-CONFIG_MMC_BULKTRANSFER=y
 CONFIG_MMC_OMAP=y
 
 #
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+
+#
 # Synchronous Serial Interfaces (SSI)
 #
 # CONFIG_OMAP_TSC2101 is not set
@@ -849,7 +879,6 @@ CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
-# CONFIG_RELAYFS_FS is not set
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -991,6 +1020,7 @@ CONFIG_DEBUG_MUTEXES=y
 # CONFIG_DEBUG_FS is not set
 # CONFIG_DEBUG_VM is not set
 CONFIG_FRAME_POINTER=y
+# CONFIG_UNWIND_INFO is not set
 CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_DEBUG_USER is not set
diff -purN linux-omap/arch/arm/mach-omap2/irq.c linux-omap-git/arch/arm/mach-omap2/irq.c
--- linux-omap/arch/arm/mach-omap2/irq.c	2006-06-14 09:55:00.000000000 -0500
+++ linux-omap-git/arch/arm/mach-omap2/irq.c	2006-06-14 10:33:04.000000000 -0500
@@ -26,6 +26,11 @@
 #define INTC_MIR_CLEAR0	0x0088
 #define INTC_MIR_SET0	0x008c
 
+#define sync_p_port_write()	\
+	({ int dv = 0;	\
+		__asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" : : "r" (dv));	\
+	})
+
 /*
  * OMAP2 has a number of different interrupt controllers, each interrupt
  * controller is identified as its own "bank". Register definitions are
@@ -61,6 +66,7 @@ static struct omap_irq_bank {
 static void omap_ack_irq(unsigned int irq)
 {
 	omap_writel(0x1, irq_banks[0].base_reg + INTC_CONTROL);
+	sync_p_port_write();
 }
 
 static void omap_mask_irq(unsigned int irq)
@@ -74,6 +80,7 @@ static void omap_mask_irq(unsigned int i
 	}
 
 	omap_writel(1 << irq, irq_banks[0].base_reg + INTC_MIR_SET0 + offset);
+	sync_p_port_write();
 }
 
 static void omap_unmask_irq(unsigned int irq)
@@ -87,7 +94,8 @@ static void omap_unmask_irq(unsigned int
 	}
 
 	omap_writel(1 << irq, irq_banks[0].base_reg + INTC_MIR_CLEAR0 + offset);
-}
+	sync_p_port_write();
+ }
 
 static void omap_mask_ack_irq(unsigned int irq)
 {
diff -purN linux-omap/arch/arm/mach-omap2/pm.c linux-omap-git/arch/arm/mach-omap2/pm.c
--- linux-omap/arch/arm/mach-omap2/pm.c	2006-06-14 09:55:00.000000000 -0500
+++ linux-omap-git/arch/arm/mach-omap2/pm.c	2006-06-14 14:17:06.000000000 -0500
@@ -307,9 +307,9 @@ static int omap2_pm_suspend(void)
 	pmdomain_set_autoidle();
 
 	/* Clear old wake-up events */
-	PM_WKST1_CORE = 0;
-	PM_WKST2_CORE = 0;
-	PM_WKST_WKUP = 0;
+	PM_WKST1_CORE = 0xffffffff;  // need to be more careful, reserved bits can be evil
+	PM_WKST2_CORE = 0xffffffff;
+	PM_WKST_WKUP = 0xffffffff;
 
 	/* Enable wake-up events */
 	PM_WKEN1_CORE = (1 << 22) | (1 << 21);	/* UART1 & 2 */
@@ -324,7 +324,7 @@ static int omap2_pm_suspend(void)
 	CM_ICLKEN3_CORE = 0;
 	CM_ICLKEN4_CORE = 0;
 
-	omap2_pm_debug("Status before suspend");
+//	omap2_pm_debug("Status before suspend");
 
 	/* Must wait for serial buffers to clear */
 	mdelay(200);
@@ -406,3 +406,169 @@ int __init omap2_pm_init(void)
 }
 
 __initcall(omap2_pm_init);
+
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
+
+static void *pwr24xx_start(struct seq_file *m, loff_t *pos)
+{
+	return *pos < 1 ? (void *)1 : NULL;
+}
+
+static void *pwr24xx_next(struct seq_file *m, void *v, loff_t *pos)
+{
+	++*pos;
+	return NULL;
+}
+
+static void pwr24xx_stop(struct seq_file *m, void *v)
+{
+}
+
+int pwr24xx_show(struct seq_file *m, void *vv)
+{
+	char *s[4] = {"ON ", "RET", "ERR", "OFF"};
+	char *r[2] = {"RUNNING", "IN RESET"};
+	u32 n, c, p, v, i;
+
+	/* Current power domain state: Previous  Current  Next */
+	seq_printf(m,"\nPower Domain states:\n");
+	seq_printf(m,"Domain: Previous  Currrent  Next\n");
+	n = PM_PWSTCTRL_MPU; c = p = PM_PWSTST_MPU; p >>= 4;
+	seq_printf(m,"MPU:    %s       %s       %s\n", s[p&3], s[c&3], s[n&3]);
+	n = PM_PWSTCTRL_DSP; c = p = PM_PWSTST_DSP; p >>= 4;
+	seq_printf(m,"DSP:    %s       %s       %s\n", s[p&3], s[c&3], s[n&3]);
+	n = PM_PWSTCTRL_GFX; c = p = PM_PWSTST_GFX; p >>= 4;
+	seq_printf(m,"GFX:    %s       %s       %s\n", s[p&3], s[c&3], s[n&3]);
+	n = PM_PWSTCTRL_CORE; c = p = PM_PWSTST_CORE; p >>= 4;
+	seq_printf(m,"COR:    %s       %s       %s\n", s[p&3], s[c&3], s[n&3]);
+	if(cpu_is_omap2430()){
+		n = PM_PWSTCTRL_MDM; c = p = PM_PWSTST_MDM; p >>= 4;
+		seq_printf(m,"MDM:    %s       %s       %s\n", s[p&3], s[c&3], s[n&3]);
+	}
+	seq_printf(m,"WKP:    %s       %s       %s\n\n", s[0], s[0], s[0]);
+
+	/* Reset state of domains */
+	seq_printf(m,"Domain Reset state:\n");
+	v = RM_RSTCTRL_DSP;
+	i = (1 && (v & 3));
+	seq_printf(m,"DSP: %s\n", r[i]);
+	if(cpu_is_omap2420()){
+		i = (1 && (v & (1 << 8)));
+		seq_printf(m,"IVA: %s\n", r[i]);
+	} else {
+		i = (1 && (RM_RSTCTRL_MDM & 3));
+		seq_printf(m,"MDM: %s\n", r[i]);
+	}
+	i = (1 && (RM_RSTCTRL_GFX & 1));
+	seq_printf(m,"GFX: %s\n\n", r[i]);
+
+	/* Clock states of domains */
+	seq_printf(m,"Device Clocks:\n");
+
+	// CM_IDLEST_GFX ADD
+
+	v = CM_ICLKEN1_CORE;
+	seq_printf(m,"CM_ICLKEN1_CORE:   0x%08x\n", v);
+	v = CM_FCLKEN1_CORE;
+	seq_printf(m,"CM_FCLKEN1_CORE:   0x%08x\n", v);
+	v = CM_AUTOIDLE1_CORE;
+	seq_printf(m,"CM_AUTOIDLE1_CORE: 0x%08x\n", v);
+	v = CM_IDLEST1_CORE;
+	seq_printf(m,"CM_IDLEST1_CORE:   0x%08x\n\n", v);
+
+	v = CM_ICLKEN2_CORE;
+	seq_printf(m,"CM_ICLKEN2_CORE:   0x%08x\n", v);
+	v = CM_FCLKEN2_CORE;
+	seq_printf(m,"CM_FCLKEN2_CORE:   0x%08x\n", v);
+	v = CM_AUTOIDLE1_CORE;
+	seq_printf(m,"CM_AUTOIDLE2_CORE: 0x%08x\n", v);
+	v = CM_IDLEST2_CORE;
+	seq_printf(m,"CM_IDLEST2_CORE:   0x%08x\n\n", v);
+
+	v = CM_ICLKEN1_CORE;
+	seq_printf(m,"CM_ICLKEN4_CORE:   0x%08x\n", v);
+	v = CM_AUTOIDLE4_CORE;
+	seq_printf(m,"CM_AUTOIDLE4_CORE: 0x%08x\n", v);
+	v = CM_IDLEST4_CORE;
+	seq_printf(m,"CM_IDLEST4_CORE:   0x%08x\n\n", v);
+
+	v = CM_ICLKEN_DSP;
+	seq_printf(m,"CM_ICLKEN_DSP:   0x%08x\n", v);
+	v = CM_FCLKEN_DSP;
+	seq_printf(m,"CM_FCLKEN_DSP:   0x%08x\n", v);
+	v = CM_AUTOIDLE_DSP;
+	seq_printf(m,"CM_AUTOIDLE_DSP: 0x%08x\n", v);
+	v = CM_IDLEST_DSP;
+	seq_printf(m,"CM_IDLEST_DSP:   0x%08x\n\n", v);
+
+	v = CM_ICLKEN_GFX;
+	seq_printf(m,"CM_ICLKEN_GFX:   0x%08x\n", v);
+	v = CM_FCLKEN_GFX;
+	seq_printf(m,"CM_FCLKEN_GFX:   0x%08x\n", v);
+	v = CM_IDLEST_GFX;
+	seq_printf(m,"CM_IDLEST_GFX:   0x%08x\n\n", v);
+
+	if(cpu_is_omap2430()){
+		v = CM_ICLKEN_MDM;
+		seq_printf(m,"CM_ICLKEN_MDM:   0x%08x\n", v);
+		v = CM_FCLKEN_MDM;
+		seq_printf(m,"CM_FCLKEN_MDM:   0x%08x\n", v);
+		v = CM_AUTOIDLE_MDM;
+		seq_printf(m,"CM_AUTOIDLE_MDM: 0x%08x\n", v);
+		v = CM_IDLEST_MDM;
+		seq_printf(m,"CM_IDLEST_MDM:   0x%08x\n\n", v);
+	}
+
+	v = CM_ICLKEN_WKUP;
+	seq_printf(m,"CM_ICLKEN_WKUP:   0x%08x\n", v);
+	v = CM_FCLKEN_WKUP;
+	seq_printf(m,"CM_FCLKEN_WKUP:   0x%08x\n", v);
+	v = CM_AUTOIDLE_WKUP;
+	seq_printf(m,"CM_AUTOIDLE_WKUP: 0x%08x\n", v);
+	v = CM_IDLEST_WKUP;
+	seq_printf(m,"CM_IDLEST_WKUP:   0x%08x\n\n", v);
+
+	v = CM_CLKEN_PLL;
+	seq_printf(m,"CM_CLKEN_PLL:    0x%08x\n", v);
+	v = CM_AUTOIDLE_PLL;
+	seq_printf(m,"CM_AUTOIDLE_PLL: 0x%08x\n", v);
+	v = CM_IDLEST_CKGEN;
+	seq_printf(m,"CM_IDLEST_CKGEN: 0x%08x\n\n", v);
+
+	return 0;
+}
+
+static struct seq_operations pwr24xx_op = {
+	.start =	pwr24xx_start,
+	.next =		pwr24xx_next,
+	.stop =		pwr24xx_stop,
+	.show =		pwr24xx_show
+};
+
+static int pwr24xx_open(struct inode *inode, struct file *file)
+{
+	return seq_open(file, &pwr24xx_op);
+}
+
+static struct file_operations proc_pwr24xx_operations = {
+	.open		= pwr24xx_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= seq_release,
+};
+
+int __init omap_pwr24xx_init(void)
+{
+	struct proc_dir_entry *entry;
+
+	entry = create_proc_entry("pwromap24xx", 0, NULL);
+	if (entry)
+		entry->proc_fops = &proc_pwr24xx_operations;
+
+	return 0;
+
+}
+arch_initcall(omap_pwr24xx_init);
+
+
diff -purN linux-omap/arch/arm/mach-omap2/pm-domain.c linux-omap-git/arch/arm/mach-omap2/pm-domain.c
--- linux-omap/arch/arm/mach-omap2/pm-domain.c	2006-06-14 09:55:00.000000000 -0500
+++ linux-omap-git/arch/arm/mach-omap2/pm-domain.c	2006-06-14 14:34:03.000000000 -0500
@@ -19,6 +19,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/clk.h>
+#include <linux/delay.h>
 
 #include <asm/io.h>
 
@@ -240,12 +241,14 @@ void pmdomain_set_autoidle(void)
 	pmdomain_set_powerstate(FORCESTATE | POWERSTATE_OFF, PM_DSP_OFFSET);
 	pmdomain_set_powerstate(FORCESTATE | POWERSTATE_OFF, PM_GFX_OFFSET);
 
-#if 0
-	/* REVISIT: Internal USB needs special handling */
-	force_standby_usb();
-	if (cpu_is_omap2430())
-		force_hsmmc();
-	sdram_self_refresh_on_idle_req(1);
+#if 1
+ CM_FCLKEN2_CORE = 1;
+ CM_ICLKEN2_CORE = 1;
+ udelay(100);
+ CONTROL_DEVCONF |= 0x00008000;
+ CM_FCLKEN2_CORE = 0;
+ CM_ICLKEN2_CORE = 0;
+ 	//sdram_self_refresh_on_idle_req(1);
 #endif
 
 	/* Enable clock auto control for all domains.
diff -purN linux-omap/arch/arm/plat-omap/sram.c linux-omap-git/arch/arm/plat-omap/sram.c
--- linux-omap/arch/arm/plat-omap/sram.c	2006-06-14 13:21:08.000000000 -0500
+++ linux-omap-git/arch/arm/plat-omap/sram.c	2006-06-14 13:27:54.000000000 -0500
@@ -158,7 +158,7 @@ static struct map_desc omap_sram_io_desc
 	{	/* .length gets filled in at runtime */
 		.virtual	= OMAP1_SRAM_VA,
 		.pfn		= __phys_to_pfn(OMAP1_SRAM_PA),
-		.type		= MT_DEVICE
+		.type		= MT_MEMORY
 	}
 };
 
@@ -185,8 +185,10 @@ void __init omap_map_sram(void)
 		omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
 	}
 
-	omap_sram_io_desc[0].length = (omap_sram_size + PAGE_SIZE-1)/PAGE_SIZE;
-	omap_sram_io_desc[0].length *= PAGE_SIZE;
+//	omap_sram_io_desc[0].length = (omap_sram_size + PAGE_SIZE-1)/PAGE_SIZE;
+//	omap_sram_io_desc[0].length *= PAGE_SIZE;
+	omap_sram_io_desc[0].length = 1024*1024;  /* Make sure a section descritor is used */
+
 	iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc));
 
 	printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n",
diff -purN linux-omap/include/net/irda/irlmp.h linux-omap-git/include/net/irda/irlmp.h
--- linux-omap/include/net/irda/irlmp.h	2006-06-14 11:31:29.000000000 -0500
+++ linux-omap-git/include/net/irda/irlmp.h	2006-06-14 10:43:15.000000000 -0500
@@ -188,9 +188,11 @@ struct irlmp_cb {
 	hashbin_t *cachelog;	/* Current discovery log */
 
 	int running;
-	__u8 align;
-	__u16 align2;
-	__u16_host_order hints; /* Hint bits */
+
+	/* problem not GCC3.4 word aligned & causes alignment exception */
+	__u8 dummy;
+	__u16 dummy2;
+	__u16_host_order hints; /* Hint bits ? */
 };
 
 /* Prototype declarations */

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: Power domain addition.
@ 2006-06-21 15:24 Woodruff, Richard
  0 siblings, 0 replies; 11+ messages in thread
From: Woodruff, Richard @ 2006-06-21 15:24 UTC (permalink / raw)
  To: Komal Shah, Tony Lindgren; +Cc: linux-omap-open-source, sampsa.fabritius

> > a union structure of a u8 and u16 generating only byte aligned code
> > which is a no-no when used with a lrdh.
> 
> I can submit the patch for removing IrDA from the defconfig, but
before
> that I will build the latest omap git tree, with code-sourcery 2005Q1B
> release and will see that it stops at the same point or not.

One other possible bit which I didn't look for was how the structure
base address was assigned.  If it was automatic or if some had manually
assigned a pointer. If it was automatic then its likely a compiler bug,
if someone just assigned it with out aligning it that would be something
which could be fixed in code.

rkw

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: Power domain addition.
@ 2006-06-21 13:24 Woodruff, Richard
  2006-06-21 15:13 ` Komal Shah
  0 siblings, 1 reply; 11+ messages in thread
From: Woodruff, Richard @ 2006-06-21 13:24 UTC (permalink / raw)
  To: Komal Shah, Tony Lindgren; +Cc: linux-omap-open-source, sampsa.fabritius

Yes, see below for the reasons.  I guess the basic point is it still
won't boot with out an Irda fix up.  I only highlighted the problem and
supplied a rough hack.  Whoever looks after Irda should get it fixed, or
have it removed from the default configuration.  It is possible its just
a compiler bug which then make it a little less clear.  The bug is from
a union structure of a u8 and u16 generating only byte aligned code
which is a no-no when used with a lrdh.

> Well, I have tried the latest kernel, but with MT_MEMORY and no PM
> support kernel stops here:
> 
> ----------snip------------------
> <5>Linux version 2.6.17-omap1-gea5858eb-dirty (komal@everest) (gcc
> version 3.4.0
>  20040409 (CodeSourcery ARM Q1A 2004)) #49 Wed Jun 21 23:43:30 IST
2006
> CPU: Some Random V6 Processor [4107b362] revision 2 (ARMv6TEJ)
> Machine: OMAP2420 H4 board
> Memory policy: ECC disabled, Data cache writeback
> <7>On node 0 totalpages: 32768
> <7>  DMA zone: 32768 pages, LIFO batch:7
> <6>OMAP2420
> <4>BUG: map for 0x4020f000 at 0xd0000000 can not be mapped using
pages,
> ignoring
> .
> <6>SRAM: Mapped pa 0x4020f000 to va 0xd0000000 size: 0x100000

This is because you can't just change MT_DEVICE to MT_MEMORY with out
changing the mapping size.  Templates are not given for PTE generation
only section entries.  That is why I changed the size to 1024*1024. As
indicated I tried a quick extension to make my own type but found it
must also change the code which sets the EXEC bit and didn't want to do
that, so just increased the to something which would generate what I
want.


> ----------snip------------------
> 
> And with MT_DEVICE and PM support, it stops after IrDA driver
> initialzing message:

This is due to the misalignment in the Irda structure.  Your root file
system must have a script which activates this path as mine does.

This is why I added the hack to the irlamp structure.  Else it would not
boot.

Regards,
Richard W.

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: Power domain addition.
@ 2006-06-14 19:52 Woodruff, Richard
  2006-06-15  1:46 ` Tony Lindgren
  2006-06-15  9:12 ` Amit Kucheria
  0 siblings, 2 replies; 11+ messages in thread
From: Woodruff, Richard @ 2006-06-14 19:52 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap-open-source, sampsa.fabritius

[-- Attachment #1: Type: text/plain, Size: 2964 bytes --]


Tony,

Ok, by changing the size (1MB) and the type (MT_MEMORY) of the SRAM it
now boots again with power enabled.  Apparently you must be developing
on an older version of the kernel than is in git.  It seems MT_DEVICE
results in a no execute mapping.  Giving it a try before committing
would have saved some time.

Getting into the code a bit I see at few simple errors straight off.

-- The clearing of PM_WKST1_CORE, PM_WKS2_CORE, PM_WKST_WKUP need to
have 1's written to clear bits not 0's.  This will defeat your sleep
right out.  The code in our example clearly does this.

-- The code is doing debug printks after knocking out the uart clocks,
this is strange.  I see that prior to attempted sleep that the UART3
Iclk is enabled.  Was this left on for printing purposed?  I don't
believe with the uart on the 48mhz can shut down, you never know when a
start bit from someone else is coming in...

-- It doesn't seem like a proper wake up event path is being setup.  The
PRCM side enables are being done but not at the module levels.  After I
hacked the code a bit I was able to put the MPU into retention/clockstop
but it would not wake up as no wakeup route was completely enabled.
Modules meaning function level registers like GPIO and interrupt
controller need to be setup also.

-- By connecting with a emulator I was able to wake back up and
continue.  I added the debug /proc/pwr24xx file from my code and it was
apparent that the DSP moved from OFF back to the ON state.  It is likely
not set up correctly.

-- In the example code I use the full auto method, I don't see auto
state settings being done here (CM_CLKSTCTRL_CORE for instance)...

I didn't go though the code in detail just traced though it.  Sticking
to the format of the working code I supplied would make it much easier
for me to give comments. It seems several more bits are necessary before
it will begin to work in this code tree.  As it was I spent a couple
hours making this boot and tracing it.  No more time to spend now.

Regards,
Richard W.


> Tony,
> 
> > Or put clock related PRCM registers to clock.c, power domain related
> > registers to pm-domain.c and so on. I have pm-domain.c somewhat
ready
> > here and will push it as soon as I can.
> 
> I thought I might try this out quickly to see if anything obvious was
> wrong with the flow.
> 
> I was surprised to find that when enabling power management the code
> infinite loops in calling into SRAM to do an idle-wfi.  It appears
that
> somehow the mapped SRAM does not have execute permission.  The pm code
> calls to SRAM and takes an exception, which resets (but not enough to
> execute) and restarts the fault, ... back to the exception.
> 
> How did you test the code which was put in?  I'm not sure if this is a
> timing thing which I hit or it wasn't tested against the latest kernel
> which comes with a git pull.
> 
> Regards,
> Richard W.

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Power domain addition.
@ 2006-06-14 17:20 Woodruff, Richard
  0 siblings, 0 replies; 11+ messages in thread
From: Woodruff, Richard @ 2006-06-14 17:20 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap-open-source

Tony,

> Or put clock related PRCM registers to clock.c, power domain related
> registers to pm-domain.c and so on. I have pm-domain.c somewhat ready
> here and will push it as soon as I can.

I thought I might try this out quickly to see if anything obvious was
wrong with the flow.

I was surprised to find that when enabling power management the code
infinite loops in calling into SRAM to do an idle-wfi.  It appears that
somehow the mapped SRAM does not have execute permission.  The pm code
calls to SRAM and takes an exception, which resets (but not enough to
execute) and restarts the fault, ... back to the exception.

How did you test the code which was put in?  I'm not sure if this is a
timing thing which I hit or it wasn't tested against the latest kernel
which comes with a git pull.

Regards,
Richard W.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-06-21 21:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-15 23:13 Power domain addition Woodruff, Richard
2006-06-20 18:09 ` Tony Lindgren
2006-06-21 13:15   ` Komal Shah
  -- strict thread matches above, loose matches on Subject: below --
2006-06-21 15:24 Woodruff, Richard
2006-06-21 13:24 Woodruff, Richard
2006-06-21 15:13 ` Komal Shah
2006-06-21 21:04   ` Tony Lindgren
2006-06-14 19:52 Woodruff, Richard
2006-06-15  1:46 ` Tony Lindgren
2006-06-15  9:12 ` Amit Kucheria
2006-06-14 17:20 Woodruff, Richard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox