* Re: 8641 open nits
From: Kumar Gala @ 2006-06-23 18:12 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev@ozlabs.org list
In-Reply-To: <E1Ftncn-0008Kb-PT@jdl.com>
On Jun 23, 2006, at 10:31 AM, Jon Loeliger wrote:
> So, like, the other day Kumar Gala mumbled:
>> Jon,
>>
>> Any update on the following nits:
>> * duplication of entry in cputable
>
> Earlier, we discussed it internally, and there are a few
> issues differentiating the cores, so the sentiment was to
> leave it as is for now.
Can this be explained, I dont like the idea of having an entry to
matches on specific version and does have any differences with the
generic match. Why not remove it now and when you have something
that is special for 864x that we add it then.
>> * include of <platforms/86xx/mpc8641_hpcn.h> in asm-powerpc/mpc86xx.h
>
> That has to stay unless the IRQ patch is applied first.
> Ben said "No" to that one so far. The include stays for now.
I dont follow, what IRQ information is in mpc8641_hpcn.h that is
needed by mpc86xx.h?
>> * mpc86xx_exclude_device cleanup and movement to pci.c
>> * fixing up mpc86xx_hpcn_probe()
>
> Those are all going to be cleaned up pending Ben's IRQ rewrite.
What does probe have to do with Ben's IRQ rewrite?
- kumar
^ permalink raw reply
* "merge" branch reset in powerpc.git tree
From: Dave C Boutcher @ 2006-06-23 16:48 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17563.54330.600099.894958@cargo.ozlabs.ibm.com>
On Fri, 23 Jun 2006 21:44:58 +1000, Paul Mackerras <paulus@samba.org> said:
>
> If you are following the powerpc.git tree, and you pull the "merge"
> branch, you will need to reset it to have commit ID
> 5fa21d821f6972e70942f2c555ec29dde962bdb2 as its head. That's also the
> head of the "master" branch and of Linus' linux-2.6 tree at the
> moment.
At risk of appearing like a git ignoramous...could you post the
command to perform such a reset?
Thanks
Dave B
^ permalink raw reply
* Re: 8641 open nits
From: Jon Loeliger @ 2006-06-23 15:31 UTC (permalink / raw)
To: linuxppc-dev@ozlabs.org list
In-Reply-To: <6C66805F-22DD-4EC2-B852-101BF1E84612@kernel.crashing.org>
So, like, the other day Kumar Gala mumbled:
> Jon,
>
> Any update on the following nits:
> * duplication of entry in cputable
Earlier, we discussed it internally, and there are a few
issues differentiating the cores, so the sentiment was to
leave it as is for now.
> * include of <platforms/86xx/mpc8641_hpcn.h> in asm-powerpc/mpc86xx.h
That has to stay unless the IRQ patch is applied first.
Ben said "No" to that one so far. The include stays for now.
> * mpc86xx_exclude_device cleanup and movement to pci.c
> * fixing up mpc86xx_hpcn_probe()
Those are all going to be cleaned up pending Ben's IRQ rewrite.
Thanks,
jdl
^ permalink raw reply
* Re: [PATCH] powerpc: Extra sanity check in EEH code
From: Linas Vepstas @ 2006-06-23 15:13 UTC (permalink / raw)
To: Anton Blanchard; +Cc: linuxppc-dev, paulus
In-Reply-To: <20060620080158.GB30974@krispykreme>
As nominal maintainer of the EEH code, I'll add
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
On Tue, Jun 20, 2006 at 06:01:58PM +1000, Anton Blanchard wrote:
>
> From: Nathan Lynch <ntl@pobox.com>
>
> Don't dereference a device node that isn't there. A "shouldn't
> happen" case, but someone ran into it with a possibly misconfigured
> device tree.
>
> Signed-off-by: Nathan Lynch <ntl@pobox.com>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> Index: build/arch/powerpc/platforms/pseries/eeh_cache.c
> ===================================================================
> --- build.orig/arch/powerpc/platforms/pseries/eeh_cache.c 2006-06-08 10:57:36.000000000 +1000
> +++ build/arch/powerpc/platforms/pseries/eeh_cache.c 2006-06-20 12:01:49.000000000 +1000
> @@ -304,6 +304,8 @@ void __init pci_addr_cache_build(void)
> pci_addr_cache_insert_device(dev);
>
> dn = pci_device_to_OF_node(dev);
> + if (!dn)
> + continue;
> pci_dev_get (dev); /* matching put is in eeh_remove_device() */
> PCI_DN(dn)->pcidev = dev;
> }
^ permalink raw reply
* 8641 open nits
From: Kumar Gala @ 2006-06-23 15:11 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev@ozlabs.org list
In-Reply-To: <D9D3C577-D46A-47BA-A1E0-844B95061F57@kernel.crashing.org>
Jon,
Any update on the following nits:
* duplication of entry in cputable
* include of <platforms/86xx/mpc8641_hpcn.h> in asm-powerpc/mpc86xx.h
* mpc86xx_exclude_device cleanup and movement to pci.c
* fixing up mpc86xx_hpcn_probe()
- kumar
^ permalink raw reply
* Re: cpu power "management" for non-dfs chips with no pmu (for instance, 750cxe and mpc7447 in pegasos)
From: Raquel Velasco and Bill Buck @ 2006-06-23 14:38 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev
In-Reply-To: <E1Ftmcb-0007rG-QS@jdl.com>
Jon, we appreciate the effort that you, Kate and Becky are making. ;-)
R&B
On Jun 23, 2006, at 9:26 AM, Jon Loeliger wrote:
> So, like, the other day "Matt Sealey" mumbled:
>>
>> I have nothing real to contribute other than I would like to see
>> it :)
>
> Disbelief. :-)
>
>> Before I asked I checked Google (as is expected of anyone these days)
>> and found some discussions on debian-powerpc from 2002 but nobody
>> really did anything and nothing really came of it. I know 4 years
>> later
>> all we have is powernowd which pokes up cpufreq which only supports
>> DFS and certain kinds of Mac PMU.
>
> Which is why it is all being revitalized now... :-)
> There was a mini symposium a couple months ago that started
> a few working groups to help kick start this back into viability.
>
>> ICTC is such a simple thing to support and you can slow down the CPU
>> pretty comprehensively (from halving to 255x in theory) with an on
>> and
>> off flag. I am surprised nobody implemented a cpufreq governer
>> even if
>> it is totally useless and gives no perceivable benefits..
>
> See? You _are_ contributing already. I encourage
> you to hit the linux-pm@lists.osdl.org list for a spell!
>
> You could start here:
> https://lists.osdl.org/mailman/listinfo/linux-pm
>
> Thanks,
> jdl
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* RE: cpu power "management" for non-dfs chips with no pmu (for instance, 750cxe and mpc7447 in pegasos)
From: Matt Sealey @ 2006-06-23 14:31 UTC (permalink / raw)
To: 'Jon Loeliger'; +Cc: linuxppc-dev
In-Reply-To: <E1Ftmcb-0007rG-QS@jdl.com>
> You could start here:
> https://lists.osdl.org/mailman/listinfo/linux-pm
Hmm it says the certificate isn't valid :3
Maybe on Monday..
--
Matt Sealey <matt@genesi-usa.com>
Manager, Genesi, Developer Relations
^ permalink raw reply
* Re: cpu power "management" for non-dfs chips with no pmu (for instance, 750cxe and mpc7447 in pegasos)
From: Jon Loeliger @ 2006-06-23 14:26 UTC (permalink / raw)
To: matt; +Cc: linuxppc-dev
In-Reply-To: <01ca01c696cd$2e453f30$99dfdfdf@bakuhatsu.net>
So, like, the other day "Matt Sealey" mumbled:
>
> I have nothing real to contribute other than I would like to see it :)
Disbelief. :-)
> Before I asked I checked Google (as is expected of anyone these days)
> and found some discussions on debian-powerpc from 2002 but nobody
> really did anything and nothing really came of it. I know 4 years later
> all we have is powernowd which pokes up cpufreq which only supports
> DFS and certain kinds of Mac PMU.
Which is why it is all being revitalized now... :-)
There was a mini symposium a couple months ago that started
a few working groups to help kick start this back into viability.
> ICTC is such a simple thing to support and you can slow down the CPU
> pretty comprehensively (from halving to 255x in theory) with an on and
> off flag. I am surprised nobody implemented a cpufreq governer even if
> it is totally useless and gives no perceivable benefits..
See? You _are_ contributing already. I encourage
you to hit the linux-pm@lists.osdl.org list for a spell!
You could start here:
https://lists.osdl.org/mailman/listinfo/linux-pm
Thanks,
jdl
^ permalink raw reply
* release early... powermac g5 suspend to disk
From: Johannes Berg @ 2006-06-23 10:16 UTC (permalink / raw)
To: linuxppc-dev list; +Cc: linux-pm
Wow. 2 days and a mostly destroyed XFS filesystem (it's still running
but I better not touch some directories or it goes belly up, xfs_repair
craps out too) I actually suspended my quad powermac a few times.
Half of the time I'll be told by the softlockup watchdog that it locked
up, but sometimes it actually works, that is, it suspends and resumes.
Issues: I don't save MPIC state. Hence, anything that is compiled in as
modules will no longer get IRQs after resume. Like USB on my system. So
I only ohci_hcd and ehci_hcd before suspend, reload later (from a
script) and I can still use the keyboard after ;)
Same goes for tg3 even though it is built-in. Well, I held off looking
at the MPIC because Ben said he was rewriting the whole interrupt stuff
anyway.
Other issues: yeah, this is extremely ugly. If you like your machine,
don't take a look.
There must be dozens of bad and undocumented assumptions too. Like
running with the same hashtables while copying back as before, etc. Not
restoring the MSR because, well, it crashes then ;) Very strange code to
flush caches, not sure it's even correct. Etc. etc. Oh and yes, I really
am that clueless and don't see the bigger issues ;)
Oh and as you can see in the first hunk here, I had to modify the
generic code too...
--- linux-2.6-git.orig/kernel/power/snapshot.c 2006-06-23 11:37:23.433885225 +0200
+++ linux-2.6-git/kernel/power/snapshot.c 2006-06-23 11:39:03.352985945 +0200
@@ -177,7 +177,13 @@
return 0;
page = pfn_to_page(pfn);
+/*
+ I currently mark the physical memory that we reserve
+ and _don't_ map for kernel access as Nosave so we won't
+ try to save it... Not sure what to do.
+
BUG_ON(PageReserved(page) && PageNosave(page));
+*/
if (PageNosave(page))
return 0;
if (PageReserved(page) && pfn_is_nosave(pfn))
@@ -185,7 +191,8 @@
if (PageNosaveFree(page))
return 0;
- return 1;
+ /* we have a memory hole for PCI accesses! */
+ return page_is_ram(pfn);
}
unsigned int count_data_pages(void)
--- linux-2.6-git.orig/arch/powerpc/kernel/Makefile 2006-06-23 11:37:23.108888150 +0200
+++ linux-2.6-git/arch/powerpc/kernel/Makefile 2006-06-23 11:39:03.333986116 +0200
@@ -37,6 +37,7 @@
obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
obj-$(CONFIG_TAU) += tau_6xx.o
obj32-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_32.o
+obj64-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_64.o swsusp_asm64.o
obj32-$(CONFIG_MODULES) += module_32.o
obj-$(CONFIG_E500) += perfmon_fsl_booke.o
--- linux-2.6-git.orig/kernel/power/Kconfig 2006-06-23 11:37:23.391885603 +0200
+++ linux-2.6-git/kernel/power/Kconfig 2006-06-23 11:39:03.335986098 +0200
@@ -38,7 +38,7 @@
config SOFTWARE_SUSPEND
bool "Software Suspend"
- depends on PM && SWAP && (X86 && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP)
+ depends on PM && SWAP && ((X86 || PPC64) && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP)
---help---
Enable the possibility of suspending the machine.
It doesn't need ACPI or APM.
@@ -96,5 +96,5 @@
config SUSPEND_SMP
bool
- depends on HOTPLUG_CPU && X86 && PM
+ depends on HOTPLUG_CPU && (X86 || PPC64) && PM
default y
--- linux-2.6-git.orig/arch/powerpc/platforms/powermac/setup.c 2006-06-23 11:38:31.484272766 +0200
+++ linux-2.6-git/arch/powerpc/platforms/powermac/setup.c 2006-06-23 11:39:16.652866245 +0200
@@ -457,8 +457,10 @@
{
printk(KERN_DEBUG "%s(%d)\n", __FUNCTION__, state);
+#ifdef CONFIG_PPC32
/* Restore userland MMU context */
set_context(current->active_mm->context, current->active_mm->pgd);
+#endif
return 0;
}
@@ -490,6 +492,7 @@
{
initializing = 0;
#ifdef CONFIG_SOFTWARE_SUSPEND
+ iommu_init_late();
pm_set_ops(&pmac_pm_ops);
#endif /* CONFIG_SOFTWARE_SUSPEND */
/* this is udbg (which is __init) and we can later use it during
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6-git/include/asm/suspend.h 2006-06-23 11:39:03.341986044 +0200
@@ -0,0 +1,9 @@
+#ifndef __ASM_POWERPC_SUSPEND_H
+#define __ASM_POWERPC_SUSPEND_H
+
+static inline int arch_prepare_suspend(void)
+{
+ return 0;
+}
+
+#endif /* __ASM_POWERPC_SUSPEND_H */
Index: linux-2.6-git/include/linux/suspend.h
===================================================================
--- linux-2.6-git.orig/include/linux/suspend.h 2006-06-23 11:37:23.502884604 +0200
+++ linux-2.6-git/include/linux/suspend.h 2006-06-23 11:39:03.343986026 +0200
@@ -1,7 +1,7 @@
#ifndef _LINUX_SWSUSP_H
#define _LINUX_SWSUSP_H
-#if defined(CONFIG_X86) || defined(CONFIG_FRV) || defined(CONFIG_PPC32)
+#if defined(CONFIG_X86) || defined(CONFIG_FRV) || defined(CONFIG_PPC32) || defined(CONFIG_PPC64)
#include <asm/suspend.h>
#endif
#include <linux/swap.h>
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6-git/arch/powerpc/kernel/swsusp_64.c 2006-06-23 11:39:03.345986008 +0200
@@ -0,0 +1,37 @@
+/*
+ * PowerPC 64-bit swsusp implementation
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPLv2
+ */
+
+#include <asm/system.h>
+
+void save_processor_state(void)
+{
+}
+
+void restore_processor_state(void)
+{
+}
+
+static int set_up_temporary_mappings(void)
+{
+ /* uh oh. we should do something here! */
+ return 0;
+}
+
+/* in swsusp_asm64.S */
+extern int restore_image(void);
+
+int swsusp_arch_resume(void)
+{
+ int err;
+
+ err = set_up_temporary_mappings();
+ if (err)
+ return err;
+ /* well, in reality, restore_image() won't return (to here) */
+ return restore_image();
+}
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6-git/arch/powerpc/kernel/swsusp_asm64.S 2006-06-23 11:39:03.348985981 +0200
@@ -0,0 +1,218 @@
+/*
+ * PowerPC 64-bit swsusp implementation
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * GPLv2
+ */
+
+#include <linux/config.h>
+#include <linux/threads.h>
+#include <asm/processor.h>
+#include <asm/page.h>
+#include <asm/cputable.h>
+#include <asm/thread_info.h>
+#include <asm/ppc_asm.h>
+#include <asm/asm-offsets.h>
+
+/*
+ * Structure for storing CPU registers on the save area.
+ */
+#define SL_r1 0x00 /* stack pointer */
+#define SL_PC 0x08
+#define SL_MSR 0x10
+#define SL_SDR1 0x18
+#define SL_XER 0x20
+#define SL_TB 0x40
+#define SL_r2 0x48 /* 'current' (I think) */
+#define SL_CR 0x50
+#define SL_LR 0x58
+#define SL_r12 0x60
+#define SL_r13 0x68
+#define SL_r14 0x70
+#define SL_r15 0x78
+#define SL_r16 0x80
+#define SL_r17 0x88
+#define SL_r18 0x90
+#define SL_r19 0x98
+#define SL_r20 0xa0
+#define SL_r21 0xa8
+#define SL_r22 0xb0
+#define SL_r23 0xb8
+#define SL_r24 0xc0
+#define SL_r25 0xc8
+#define SL_r26 0xd0
+#define SL_r27 0xd8
+#define SL_r28 0xe0
+#define SL_r29 0xe8
+#define SL_r30 0xf0
+#define SL_r31 0xf8
+#define SL_SIZE SL_r31+8
+
+/* these macros rely on the save area being
+ * pointed to by r11 */
+#define SAVE_SPECIAL(special) \
+ mf##special r0 ;\
+ std r0, SL_##special(r11)
+#define RESTORE_SPECIAL(special) \
+ ld r0, SL_##special(r11) ;\
+ mt##special r0
+#define SAVE_REGISTER(reg) \
+ std reg, SL_##reg(r11)
+#define RESTORE_REGISTER(reg) \
+ ld reg, SL_##reg(r11)
+
+/* space for storing cpu state */
+ .section .data
+ .align 5
+swsusp_save_area:
+ .space SL_SIZE
+
+ .section ".toc","aw"
+swsusp_save_area_ptr:
+ .tc swsusp_save_area[TC],swsusp_save_area
+pagedir_nosave_ptr:
+ .tc pagedir_nosave[TC],pagedir_nosave
+
+ .section .text
+ .align 5
+_GLOBAL(swsusp_arch_suspend)
+ ld r11,swsusp_save_area_ptr@toc(r2)
+ SAVE_SPECIAL(LR)
+ SAVE_REGISTER(r1)
+ SAVE_SPECIAL(CR)
+ SAVE_SPECIAL(TB)
+ SAVE_REGISTER(r2)
+ SAVE_REGISTER(r12)
+ SAVE_REGISTER(r13)
+ SAVE_REGISTER(r14)
+ SAVE_REGISTER(r15)
+ SAVE_REGISTER(r16)
+ SAVE_REGISTER(r17)
+ SAVE_REGISTER(r18)
+ SAVE_REGISTER(r19)
+ SAVE_REGISTER(r20)
+ SAVE_REGISTER(r21)
+ SAVE_REGISTER(r22)
+ SAVE_REGISTER(r23)
+ SAVE_REGISTER(r24)
+ SAVE_REGISTER(r25)
+ SAVE_REGISTER(r26)
+ SAVE_REGISTER(r27)
+ SAVE_REGISTER(r28)
+ SAVE_REGISTER(r29)
+ SAVE_REGISTER(r30)
+ SAVE_REGISTER(r31)
+ SAVE_SPECIAL(MSR)
+ SAVE_SPECIAL(SDR1)
+ SAVE_SPECIAL(XER)
+
+ /* we push the stack up 128 bytes but don't store the
+ * stack pointer on the stack like a real stackframe */
+ addi r1,r1,-128
+
+#ifdef CONFIG_U3_DART
+ bl dart_save
+#endif
+
+ bl swsusp_save
+
+ /* restore LR */
+ ld r11,swsusp_save_area_ptr@toc(r2)
+ RESTORE_SPECIAL(LR)
+ addi r1,r1,128
+
+ blr
+
+/* Resume code */
+_GLOBAL(restore_image)
+ /* Stop pending alitvec streams and memory accesses */
+BEGIN_FTR_SECTION
+ DSSALL
+END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
+ sync
+
+ ld r12,pagedir_nosave_ptr@toc(r2)
+ ld r12,0(r12)
+
+ cmpdi r12,0
+ beq- nothing_to_copy
+ li r15,512
+copyloop:
+ ld r13,pbe_address(r12)
+ ld r14,pbe_orig_address(r12)
+
+ mtctr r15
+ li r10,0
+copy_page_loop:
+ ldx r0,r10,r13
+ stdx r0,r10,r14
+ addi r10,r10,8
+ bdnz copy_page_loop
+
+ ld r12,pbe_next(r12)
+ cmpdi r12,0
+ bne+ copyloop
+nothing_to_copy:
+
+#if 1
+ /* flush caches */
+ lis r3, 0x10
+ mtctr r3
+ li r3, 0
+ ori r3, r3, CONFIG_KERNEL_START>>48
+ li r0, 48
+ sld r3, r3, r0
+ li r0, 0
+1:
+ dcbf r0,r3
+ addi r3,r3,0x20
+ bdnz 1b
+#endif
+ sync
+
+ tlbia
+
+ ld r11,swsusp_save_area_ptr@toc(r2)
+
+ RESTORE_SPECIAL(CR)
+ ld r0, SL_TB(r11)
+ mttbl r0
+ RESTORE_REGISTER(r1)
+ RESTORE_REGISTER(r2)
+ RESTORE_REGISTER(r12)
+ RESTORE_REGISTER(r13)
+ RESTORE_REGISTER(r14)
+ RESTORE_REGISTER(r15)
+ RESTORE_REGISTER(r16)
+ RESTORE_REGISTER(r17)
+ RESTORE_REGISTER(r18)
+ RESTORE_REGISTER(r19)
+ RESTORE_REGISTER(r20)
+ RESTORE_REGISTER(r21)
+ RESTORE_REGISTER(r22)
+ RESTORE_REGISTER(r23)
+ RESTORE_REGISTER(r24)
+ RESTORE_REGISTER(r25)
+ RESTORE_REGISTER(r26)
+ RESTORE_REGISTER(r27)
+ RESTORE_REGISTER(r28)
+ RESTORE_REGISTER(r29)
+ RESTORE_REGISTER(r30)
+ RESTORE_REGISTER(r31)
+ /* can't use RESTORE_SPECIAL(MSR) */
+// ld r0, SL_MSR(r11)
+// mtmsrd r0,0
+ RESTORE_SPECIAL(SDR1)
+ RESTORE_SPECIAL(XER)
+
+ addi r1,r1,-128
+ bl dart_restore
+ bl touch_softlockup_watchdog
+ addi r1,r1,128
+
+ ld r11,swsusp_save_area_ptr@toc(r2)
+ RESTORE_SPECIAL(LR)
+
+ li r3, 0
+ blr
--- linux-2.6-git.orig/arch/powerpc/sysdev/dart_iommu.c 2006-06-23 11:37:23.357885909 +0200
+++ linux-2.6-git/arch/powerpc/sysdev/dart_iommu.c 2006-06-23 11:39:03.350985963 +0200
@@ -58,6 +58,9 @@
/* Virtual base address of the DART table */
static u32 *dart_vbase;
+#ifdef CONFIG_SOFTWARE_SUSPEND
+static u32 *dart_copy;
+#endif
/* Mapped base address for the dart */
static unsigned int __iomem *dart;
@@ -368,6 +371,45 @@
pci_direct_iommu_init();
}
+#ifdef CONFIG_SOFTWARE_SUSPEND
+void iommu_init_late(void)
+{
+ unsigned long i;
+ struct page *p;
+
+ /* phew. suckers. this 16MB area is left unmapped
+ * at another place but they don't bother to mark it so */
+ for (i = 0; i < (1<<24); i+= PAGE_SIZE)
+ SetPageNosave(virt_to_page((void*)((unsigned long)dart_tablebase + i)));
+
+ if (dart_tablebase == 0 || dart_tablesize == 0)
+ return;
+
+ p = alloc_pages(GFP_KERNEL, 9);
+ BUG_ON(!p);
+ dart_copy = page_address(p);
+}
+
+void dart_save(void)
+{
+ if (dart_tablebase == 0 || dart_tablesize == 0)
+ return;
+
+ memcpy(dart_copy, dart_vbase, 2*1024*1024);
+ printk(KERN_INFO "dart copied\n");
+}
+
+void dart_restore(void)
+{
+ if (dart_tablebase == 0 || dart_tablesize == 0)
+ return;
+
+ printk("going to restore dart\n");
+ memcpy(dart_vbase, dart_copy, 2*1024*1024);
+ printk("copied over dart entries\n");
+ dart_tlb_invalidate_all();
+}
+#endif
void __init alloc_dart_table(void)
{
--- linux-2.6-git.orig/include/asm-powerpc/iommu.h 2006-06-23 11:37:23.548884190 +0200
+++ linux-2.6-git/include/asm-powerpc/iommu.h 2006-06-23 11:39:03.354985927 +0200
@@ -97,6 +97,9 @@
#endif
extern void alloc_dart_table(void);
+#ifdef CONFIG_SOFTWARE_SUSPEND
+extern void iommu_init_late(void);
+#endif
#endif /* __KERNEL__ */
#endif /* _ASM_IOMMU_H */
--- linux-2.6-git.orig/arch/powerpc/kernel/asm-offsets.c 2006-06-23 11:37:23.197887349 +0200
+++ linux-2.6-git/arch/powerpc/kernel/asm-offsets.c 2006-06-23 11:39:03.356985909 +0200
@@ -22,12 +22,12 @@
#include <linux/types.h>
#include <linux/mman.h>
#include <linux/mm.h>
+#include <linux/suspend.h>
#ifdef CONFIG_PPC64
#include <linux/time.h>
#include <linux/hardirq.h>
#else
#include <linux/ptrace.h>
-#include <linux/suspend.h>
#endif
#include <asm/io.h>
@@ -243,11 +243,11 @@
DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features));
DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
-#ifndef CONFIG_PPC64
DEFINE(pbe_address, offsetof(struct pbe, address));
DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
DEFINE(pbe_next, offsetof(struct pbe, next));
+#ifndef CONFIG_PPC64
DEFINE(TASK_SIZE, TASK_SIZE);
DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
#endif /* ! CONFIG_PPC64 */
--- linux-2.6-git.orig/arch/powerpc/kernel/idle.c 2006-06-23 11:37:23.234887016 +0200
+++ linux-2.6-git/arch/powerpc/kernel/idle.c 2006-06-23 11:39:03.357985900 +0200
@@ -34,8 +34,11 @@
#include <asm/smp.h>
#ifdef CONFIG_HOTPLUG_CPU
+/* this is used for software suspend, and that shuts down
+ * CPUs even while the system is still booting... */
#define cpu_should_die() (cpu_is_offline(smp_processor_id()) && \
- system_state == SYSTEM_RUNNING)
+ (system_state == SYSTEM_RUNNING \
+ || system_state == SYSTEM_BOOTING))
#else
#define cpu_should_die() 0
#endif
^ permalink raw reply
* [PATCH] windfarm: proper try_to_freeze / signal_pending handling
From: Johannes Berg @ 2006-06-23 10:05 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, linux-pm
In-Reply-To: <1150847482.16662.13.camel@johannes>
This seems to work for me:
---
This patch makes windfarm handle signal_pending()/try_to_freeze()
better.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
--- linux-2.6-git.orig/drivers/macintosh/windfarm_core.c 2006-06-22 16:41:18.182172154 +0200
+++ linux-2.6-git/drivers/macintosh/windfarm_core.c 2006-06-22 16:42:49.045354378 +0200
@@ -93,8 +93,6 @@ static int wf_thread_func(void *data)
DBG("wf: thread started\n");
while(!kthread_should_stop()) {
- try_to_freeze();
-
if (time_after_eq(jiffies, next)) {
wf_notify(WF_EVENT_TICK, NULL);
if (wf_overtemp) {
@@ -117,8 +115,8 @@ static int wf_thread_func(void *data)
if (delay <= HZ)
schedule_timeout_interruptible(delay);
- /* there should be no signal, but oh well */
- if (signal_pending(current)) {
+ /* there should be no non-suspend signal, but oh well */
+ if (signal_pending(current) && !try_to_freeze()) {
printk(KERN_WARNING "windfarm: thread got sigl !\n");
break;
}
^ permalink raw reply
* [RFC] cpu hotplug in powermac g5
From: Johannes Berg @ 2006-06-23 10:03 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Michael Buesch
In-Reply-To: <1150845770.16662.7.camel@johannes>
Never mind the previous patch :) This one works much better.
Note that for software suspend, the generic cpu hotplug are not usable
because they don't re-sync timebase etc. Hence, I here only use the
generic die routines but the loop in which offline processors are is
custom, and we use the regular CPU bring-up sequence instead of just
exiting the loop.
---
This patch makes CPU hotplug work on my pm11,2. It works by reusing the
normal smp_core99_kick_cpu routine for wakeup, and introducing a new
routine that offline CPUs idle in, which is modeled after the idle loop
but has no way out (except for taking the soft reset exception triggered
by kick_cpu). This is required because the generic cpu hotplug code
doesn't completely re-initialise the CPU when bringing it online again,
which is required for software suspend.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
--- linux-2.6-git.orig/arch/powerpc/platforms/powermac/smp.c 2006-06-23 11:32:49.254352863 +0200
+++ linux-2.6-git/arch/powerpc/platforms/powermac/smp.c 2006-06-23 11:37:23.311886323 +0200
@@ -895,7 +895,7 @@
cpu_dead[cpu] = 0;
}
-#endif
+#endif /* CONFIG_HOTPLUG_CPU && CONFIG_PP32 */
/* Core99 Macs (dual G4s and G5s) */
struct smp_ops_t core99_smp_ops = {
@@ -905,8 +905,16 @@
.setup_cpu = smp_core99_setup_cpu,
.give_timebase = smp_core99_give_timebase,
.take_timebase = smp_core99_take_timebase,
-#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32)
+#if defined(CONFIG_HOTPLUG_CPU)
+# if defined(CONFIG_PPC32)
.cpu_disable = smp_core99_cpu_disable,
.cpu_die = smp_core99_cpu_die,
+# endif
+# if defined(CONFIG_PPC64)
+ .cpu_disable = generic_cpu_disable,
+ .cpu_die = generic_cpu_die,
+ /* intentionally do *NOT* assign cpu_enable,
+ * the generic code will use kick_cpu then! */
+# endif
#endif
};
--- linux-2.6-git.orig/arch/powerpc/platforms/powermac/setup.c 2006-06-23 11:32:49.309352368 +0200
+++ linux-2.6-git/arch/powerpc/platforms/powermac/setup.c 2006-06-23 11:38:31.484272766 +0200
@@ -492,6 +492,9 @@
#ifdef CONFIG_SOFTWARE_SUSPEND
pm_set_ops(&pmac_pm_ops);
#endif /* CONFIG_SOFTWARE_SUSPEND */
+ /* this is udbg (which is __init) and we can later use it during
+ * cpu hotplug (in smp_core99_kick_cpu) */
+ ppc_md.progress = NULL;
return 0;
}
@@ -728,6 +731,32 @@
return PCI_PROBE_NORMAL;
return PCI_PROBE_DEVTREE;
}
+
+#ifdef CONFIG_HOTPLUG_CPU
+/* access per cpu vars from generic smp.c */
+DECLARE_PER_CPU(int, cpu_state);
+
+static void pmac_cpu_die(void)
+{
+ /* turn off as much as possible, we'll be
+ * kicked out as this will only be invoked
+ * on core99 platforms for now ... */
+ local_irq_disable();
+ printk(KERN_DEBUG "CPU#%d offline\n", smp_processor_id());
+ __get_cpu_var(cpu_state) = CPU_DEAD;
+ smp_wmb();
+ while (1) {
+ ppc64_runlatch_off();
+ if (ppc_md.power_save) {
+ ppc_md.power_save();
+ } else {
+ HMT_low();
+ HMT_very_low();
+ }
+ }
+}
+#endif
+
#endif
define_machine(powermac) {
@@ -766,6 +795,6 @@
.phys_mem_access_prot = pci_phys_mem_access_prot,
#endif
#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64)
- .cpu_die = generic_mach_cpu_die,
+ .cpu_die = pmac_cpu_die,
#endif
};
^ permalink raw reply
* 8641 HPCN Flat Device Tree (was: [PATCH] Use IRQ and senses from OF-tree on 8641hpcn.)
From: Jon Loeliger @ 2006-06-23 14:11 UTC (permalink / raw)
To: linuxppc-dev@ozlabs.org
In-Reply-To: <1151021497.4046.79.camel@localhost.localdomain>
Folks,
For reference, here is the complete MPC8641 HPCN Device Tree Source
file that we have been using. Please feel free to comment on it.
(And yes, I know we need to change the ethernet "address" property
names -- that's on the Big To Do List still (for all the FSL boards)).
Thanks!
jdl
PS -- This version matches up with assuming the
"Use IRQ and senses from OF-tree on 8641hpcn"
patch has been applied.
/*
* MPC8641 HPCN Device Tree Source
*
* Copyright 2006 Freescale Semiconductor Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
/ {
model = "MPC8641HPCN";
compatible = "mpc86xx";
#address-cells = <1>;
#size-cells = <1>;
linux,phandle = <100>;
cpus {
#cpus = <2>;
#address-cells = <1>;
#size-cells = <0>;
linux,phandle = <200>;
PowerPC,8641@0 {
device_type = "cpu";
reg = <0>;
d-cache-line-size = <20>; // 32 bytes
i-cache-line-size = <20>; // 32 bytes
d-cache-size = <8000>; // L1, 32K
i-cache-size = <8000>; // L1, 32K
timebase-frequency = <0>; // 33 MHz, from uboot
bus-frequency = <0>; // From uboot
clock-frequency = <0>; // From uboot
32-bit;
linux,phandle = <201>;
linux,boot-cpu;
};
PowerPC,8641@1 {
device_type = "cpu";
reg = <1>;
d-cache-line-size = <20>; // 32 bytes
i-cache-line-size = <20>; // 32 bytes
d-cache-size = <8000>; // L1, 32K
i-cache-size = <8000>; // L1, 32K
timebase-frequency = <0>; // 33 MHz, from uboot
bus-frequency = <0>; // From uboot
clock-frequency = <0>; // From uboot
32-bit;
linux,phandle = <202>;
};
};
memory {
device_type = "memory";
linux,phandle = <300>;
reg = <00000000 40000000>; // 1G at 0x0
};
soc8641@f8000000 {
#address-cells = <1>;
#size-cells = <1>;
#interrupt-cells = <2>;
device_type = "soc";
ranges = <0 f8000000 00100000>;
reg = <f8000000 00100000>; // CCSRBAR 1M
bus-frequency = <0>;
i2c@3000 {
device_type = "i2c";
compatible = "fsl-i2c";
reg = <3000 100>;
interrupts = <2b 2>;
interrupt-parent = <40000>;
dfsrr;
};
i2c@3100 {
device_type = "i2c";
compatible = "fsl-i2c";
reg = <3100 100>;
interrupts = <2b 2>;
interrupt-parent = <40000>;
dfsrr;
};
mdio@24520 {
#address-cells = <1>;
#size-cells = <0>;
device_type = "mdio";
compatible = "gianfar";
reg = <24520 20>;
linux,phandle = <24520>;
ethernet-phy@0 {
linux,phandle = <2452000>;
interrupt-parent = <40000>;
interrupts = <4a 1>;
reg = <0>;
device_type = "ethernet-phy";
};
ethernet-phy@1 {
linux,phandle = <2452001>;
interrupt-parent = <40000>;
interrupts = <4a 1>;
reg = <1>;
device_type = "ethernet-phy";
};
ethernet-phy@2 {
linux,phandle = <2452002>;
interrupt-parent = <40000>;
interrupts = <4a 1>;
reg = <2>;
device_type = "ethernet-phy";
};
ethernet-phy@3 {
linux,phandle = <2452003>;
interrupt-parent = <40000>;
interrupts = <4a 1>;
reg = <3>;
device_type = "ethernet-phy";
};
};
ethernet@24000 {
#address-cells = <1>;
#size-cells = <0>;
device_type = "network";
model = "TSEC";
compatible = "gianfar";
reg = <24000 1000>;
address = [ 00 E0 0C 00 73 00 ];
interrupts = <1d 2 1e 2 22 2>;
interrupt-parent = <40000>;
phy-handle = <2452000>;
};
ethernet@25000 {
#address-cells = <1>;
#size-cells = <0>;
device_type = "network";
model = "TSEC";
compatible = "gianfar";
reg = <25000 1000>;
address = [ 00 E0 0C 00 73 01 ];
interrupts = <23 2 24 2 28 2>;
interrupt-parent = <40000>;
phy-handle = <2452001>;
};
ethernet@26000 {
#address-cells = <1>;
#size-cells = <0>;
device_type = "network";
model = "TSEC";
compatible = "gianfar";
reg = <26000 1000>;
address = [ 00 E0 0C 00 02 FD ];
interrupts = <1F 2 20 2 21 2>;
interrupt-parent = <40000>;
phy-handle = <2452002>;
};
ethernet@27000 {
#address-cells = <1>;
#size-cells = <0>;
device_type = "network";
model = "TSEC";
compatible = "gianfar";
reg = <27000 1000>;
address = [ 00 E0 0C 00 03 FD ];
interrupts = <25 2 26 2 27 2>;
interrupt-parent = <40000>;
phy-handle = <2452003>;
};
serial@4500 {
device_type = "serial";
compatible = "ns16550";
reg = <4500 100>;
clock-frequency = <0>;
interrupts = <2a 2>;
interrupt-parent = <40000>;
};
serial@4600 {
device_type = "serial";
compatible = "ns16550";
reg = <4600 100>;
clock-frequency = <0>;
interrupts = <2a 2>;
interrupt-parent = <40000>;
};
pci@8000 {
compatible = "86xx";
device_type = "pci";
linux,phandle = <8000>;
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
reg = <8000 1000>;
bus-range = <0 fe>;
ranges = <02000000 0 80000000 80000000 0 20000000
01000000 0 00000000 e2000000 0 00100000>;
clock-frequency = <1fca055>;
interrupt-parent = <40000>;
interrupts = <18 2>;
interrupt-map-mask = <f800 0 0 f>;
interrupt-map = <
/* IDSEL 0x11 */
8800 0 0 1 40000 3 0
8800 0 0 2 40000 4 0
8800 0 0 3 40000 5 0
8800 0 0 4 40000 6 0
/* IDSEL 0x12 */
9000 0 0 1 40000 4 0
9000 0 0 2 40000 5 0
9000 0 0 3 40000 6 0
9000 0 0 4 40000 3 0
/* IDSEL 0x13 */
9800 0 0 1 40000 0 0
9800 0 0 2 40000 0 0
9800 0 0 3 40000 0 0
9800 0 0 4 40000 0 0
/* IDSEL 0x14 */
a000 0 0 1 40000 0 0
a000 0 0 2 40000 0 0
a000 0 0 3 40000 0 0
a000 0 0 4 40000 0 0
/* IDSEL 0x15 */
a800 0 0 1 40000 0 0
a800 0 0 2 40000 0 0
a800 0 0 3 40000 0 0
a800 0 0 4 40000 0 0
/* IDSEL 0x16 */
b000 0 0 1 40000 0 0
b000 0 0 2 40000 0 0
b000 0 0 3 40000 0 0
b000 0 0 4 40000 0 0
/* IDSEL 0x17 */
b800 0 0 1 40000 0 0
b800 0 0 2 40000 0 0
b800 0 0 3 40000 0 0
b800 0 0 4 40000 0 0
/* IDSEL 0x18 */
c000 0 0 1 40000 0 0
c000 0 0 2 40000 0 0
c000 0 0 3 40000 0 0
c000 0 0 4 40000 0 0
/* IDSEL 0x19 */
c800 0 0 1 40000 0 0
c800 0 0 2 40000 0 0
c800 0 0 3 40000 0 0
c800 0 0 4 40000 0 0
/* IDSEL 0x1a */
d000 0 0 1 40000 6 0
d000 0 0 2 40000 3 0
d000 0 0 3 40000 4 0
d000 0 0 4 40000 5 0
/* IDSEL 0x1b */
d800 0 0 1 40000 5 0
d800 0 0 2 40000 0 0
d800 0 0 3 40000 0 0
d800 0 0 4 40000 0 0
/* IDSEL 0x1c */
e000 0 0 1 40000 9 0
e000 0 0 2 40000 a 0
e000 0 0 3 40000 c 0
e000 0 0 4 40000 7 0
/* IDSEL 0x1d */
e800 0 0 1 40000 9 0
e800 0 0 2 40000 a 0
e800 0 0 3 40000 b 0
e800 0 0 4 40000 0 0
/* IDSEL 0x1e */
f000 0 0 1 40000 c 0
f000 0 0 2 40000 0 0
f000 0 0 3 40000 0 0
f000 0 0 4 40000 0 0
/* IDSEL 0x1f */
f800 0 0 1 40000 6 0
f800 0 0 2 40000 0 0
f800 0 0 3 40000 0 0
f800 0 0 4 40000 0 0
>;
};
pic@40000 {
linux,phandle = <40000>;
clock-frequency = <0>;
interrupt-controller;
#address-cells = <0>;
#interrupt-cells = <2>;
reg = <40000 40000>;
built-in;
compatible = "chrp,open-pic";
device_type = "open-pic";
big-endian;
interrupts = <
10 2 11 2 12 2 13 2
14 2 15 2 16 2 17 2
18 2 19 2 1a 2 1b 2
1c 2 1d 2 1e 2 1f 2
20 2 21 2 22 2 23 2
24 2 25 2 26 2 27 2
28 2 29 2 2a 2 2b 2
2c 2 2d 2 2e 2 2f 2
30 2 31 2 32 2 33 2
34 2 35 2 36 2 37 2
38 2 39 2 2a 2 3b 2
3c 2 3d 2 3e 2 3f 2
48 1 49 2 4a 1
>;
interrupt-parent = <40000>;
};
};
};
^ permalink raw reply
* Re: [PATCH] Use IRQ and senses from OF-tree on 8641hpcn.
From: Jon Loeliger @ 2006-06-23 14:06 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <1151021497.4046.79.camel@localhost.localdomain>
So, like, the other day Benjamin Herrenschmidt mumbled:
>
> > + shift = __ilog2((~interrupt_mask[0] + 1) & 0xffff);
>
> Nice hack :)
We aim to please. :-)
> But not something mergeable as it strictly relies on the specific format
> of the interrupt map on that platform :)
Hrm.
> I have a generic parser on the way, it's hot and will be released for
> public consumption later today or this week-end along with the rest of
> the irq patches.
Chomp, chomp.
> I'll need you guys to help porting the few embedded boards already in
> arch/powerpc.
Of course. We've also lined Andy Fleming up to help
with some 85xx parts, and Kim Phillips to help with
some 83xx parts. (Hi guys!)
BTW and for (your) references, I will follow up with
the complete MPC8641 HPCN DTS file here!
Thanks,
jdl
^ permalink raw reply
* RE: cpu power "management" for non-dfs chips with no pmu (for instance, 750cxe and mpc7447 in pegasos)
From: Matt Sealey @ 2006-06-23 13:58 UTC (permalink / raw)
To: 'Jon Loeliger'; +Cc: linuxppc-dev
In-Reply-To: <E1FtlnK-0007Zt-Tx@jdl.com>
I have nothing real to contribute other than I would like to see it :)
Before I asked I checked Google (as is expected of anyone these days)
and found some discussions on debian-powerpc from 2002 but nobody
really did anything and nothing really came of it. I know 4 years later
all we have is powernowd which pokes up cpufreq which only supports
DFS and certain kinds of Mac PMU.
ICTC is such a simple thing to support and you can slow down the CPU
pretty comprehensively (from halving to 255x in theory) with an on and
off flag. I am surprised nobody implemented a cpufreq governer even if
it is totally useless and gives no perceivable benefits..
--
Matt Sealey <matt@genesi-usa.com>
Manager, Genesi, Developer Relations
> -----Original Message-----
> From: Jon Loeliger [mailto:jdl@jdl.com]
> Sent: Friday, June 23, 2006 8:34 AM
> To: matt@genesi-usa.com
> Cc: linuxppc-dev@ozlabs.org
> Subject: Re: cpu power "management" for non-dfs chips with no
> pmu (for instance, 750cxe and mpc7447 in pegasos)
>
> So, like, the other day "Matt Sealey" mumbled:
> >
> > I am basically trying to evaluate if we can do ANYTHING to reduce
> > power consumption of systems which are idle, as I have noticed that
> > ...
> >
> > Comments? :)
>
> Hi Matt,
>
> There is an effort afoot to revitalize some of the Linux
> Power Management issues, erm, currently going on over on the
> linux-pm list these days. No immediate results (yet), but
> there is some concerted effort. It should include some
> PowerPC presence.
>
> Please feel free to contribute, of course. :-)
>
> jdl
>
^ permalink raw reply
* Re: cpu power "management" for non-dfs chips with no pmu (for instance, 750cxe and mpc7447 in pegasos)
From: Jon Loeliger @ 2006-06-23 13:33 UTC (permalink / raw)
To: matt; +Cc: linuxppc-dev
In-Reply-To: <018201c696b1$e942ba40$99dfdfdf@bakuhatsu.net>
So, like, the other day "Matt Sealey" mumbled:
>
> I am basically trying to evaluate if we can do ANYTHING to reduce
> power consumption of systems which are idle, as I have noticed that
> ...
>
> Comments? :)
Hi Matt,
There is an effort afoot to revitalize some of the Linux Power
Management issues, erm, currently going on over on the linux-pm
list these days. No immediate results (yet), but there is some
concerted effort. It should include some PowerPC presence.
Please feel free to contribute, of course. :-)
jdl
^ permalink raw reply
* Reg RISC timers in MPC 8260
From: Jagan @ 2006-06-23 13:16 UTC (permalink / raw)
To: linuxppc-embedded
Hi
We have a requirement of starting a 1 millisecond
periodic timer in kernel space . The OS is monta vista
linux kernel version 2.4 and
Target is MPC 8260 . We are planning to use the RISC
timers in CPM
module. Can anyone send some sample reference code for
starting a
periodic timer for 1 millisecond using the RISC
timers?
Thanks in Advance
Morphics
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply
* "merge" branch reset in powerpc.git tree
From: Paul Mackerras @ 2006-06-23 11:44 UTC (permalink / raw)
To: linuxppc-dev
If you are following the powerpc.git tree, and you pull the "merge"
branch, you will need to reset it to have commit ID
5fa21d821f6972e70942f2c555ec29dde962bdb2 as its head. That's also the
head of the "master" branch and of Linus' linux-2.6 tree at the
moment.
This is because there was a merge between the "master" branch and the
linux-2.6 tree which Linus didn't pull - instead he did a new merge.
The merge I did is now redundant, and needs to be removed to keep the
powerpc and linux-2.6 trees in sync.
Paul.
^ permalink raw reply
* cpu power "management" for non-dfs chips with no pmu (for instance, 750cxe and mpc7447 in pegasos)
From: Matt Sealey @ 2006-06-23 10:43 UTC (permalink / raw)
To: linuxppc-dev
Is there any support for using the ICTC to reduce CPU power and so on
for PowerPC currently, in absense of a real PMU like on Macs, or the
dual-PLL/DFS/DFS4 stuff in newer G3 and G4 chips?
I was wondering if there were any definitive performance benchmarks
to see if the setting had any appreciable effect in the first place.
If it doesn't do much more than kill a couple of milliwatts and the
switch between ICTC settings has too high a latency, it would make
no sense in a desktop system.
I am basically trying to evaluate if we can do ANYTHING to reduce
power consumption of systems which are idle, as I have noticed that
for running firmware (sitting at a Forth prompt) and booting a
Linux kernel and doing some work (for instance a simple benchmark),
power consumption barely changes at all. The difference between an
idle G4 and a running G4 is negligible. RC5 makes a big difference
but it is heavily tuned. Most people won't run RC5 all the time to
stress the CPU to the level that it wants to draw a couple extra
watts, I think.
Comments? :)
--
Matt Sealey <matt@genesi-usa.com>
Manager, Genesi, Developer Relations
^ permalink raw reply
* Re: entry point of kernel in RAM at 0x0c--linux tree file name
From: Laurent Pinchart @ 2006-06-23 10:18 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: Arun Kumar
In-Reply-To: <edd12c050606230253u5842ea5bvd78d06f0354cb4bd@mail.gmail.com>
Hi Arun,
please keep the list posted when you reply.
> Thanks for the response .I would also like to ask another query hoever
> naive it might sound .I am using a Linux 2.4.1
That's very old. Can't you upgrade to 2.6 ?
> wherein my entry point
> code at 0x0c expects at R3 ,R4,R5,R6 some parameters which I strongly
> suspect to be residual record bi_rec *,start of initrd and end of initrd
> sections as my kernel is crashing immediately after MMU_init and I
> suspect that machine _init that is done prior to MMU_init expects __res
> in R3 as a input parameter .Please confirm .
Depending on your platform and boot loader, r3 to r7 are initialized with
different values. If you're using ppcboot, the kernel expects r3 to be
initialized with the residual record, right.
> I am using ppcboot2..0.0 as my bootloader .
That' very old too. You should upgrade to U-Boot.
> Also I would like to know how can i enable serial console in these early
> kernel initialsaiotns process. I am using a CONFIG_SANDPOINT(8260) on a
> MPC 8245 platform and trying to port the code on MPC8245 platform .the
> board has a very similar config as a SANDPOINT board .
If I'm not mistaken, you can't enable a serial console that early. Do you have
a hardware debugger (BDI2000) ? If not, you could try LED debugging.
Best regards,
Laurent Pinchart
^ permalink raw reply
* Re: [PATCH 2/8] Assume we're on cpu 0 in early boot
From: Jimi Xenidis @ 2006-06-23 10:03 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, Paul Mackerras, Arnd Bergmann
In-Reply-To: <20060623082007.34A9867A79@ozlabs.org>
On Jun 23, 2006, at 4:20 AM, Michael Ellerman wrote:
> + /* Assume we're on cpu for now, we don't actually know yet.
oops :( "Assume we're on cpu _0_ for now"
-JX
^ permalink raw reply
* [PATCH 8/8] Enable XMON in cell_defconfig
From: Michael Ellerman @ 2006-06-23 8:20 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, Arnd Bergmann
Now that we have the udbg callbacks we can enable XMON by default.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/configs/cell_defconfig | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: to-merge/arch/powerpc/configs/cell_defconfig
===================================================================
--- to-merge.orig/arch/powerpc/configs/cell_defconfig
+++ to-merge/arch/powerpc/configs/cell_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17
-# Mon Jun 19 17:23:03 2006
+# Linux kernel version: 2.6.17-rc6
+# Thu Jun 22 15:28:36 2006
#
CONFIG_PPC64=y
CONFIG_64BIT=y
@@ -1063,7 +1063,8 @@ CONFIG_DEBUG_FS=y
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_DEBUG_STACK_USAGE is not set
CONFIG_DEBUGGER=y
-# CONFIG_XMON is not set
+CONFIG_XMON=y
+CONFIG_XMON_DEFAULT=y
CONFIG_IRQSTACKS=y
# CONFIG_BOOTX_TEXT is not set
# CONFIG_PPC_EARLY_DEBUG is not set
^ permalink raw reply
* [PATCH 7/8] Enable the RTAS udbg console on IBM Cell Blade
From: Michael Ellerman @ 2006-06-23 8:20 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, Arnd Bergmann
Enable the RTAS udbg console on IBM Cell Blade, this allows xmon
to work.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/platforms/cell/setup.c | 4 ++++
2 files changed, 5 insertions(+)
Index: to-merge/arch/powerpc/Kconfig
===================================================================
--- to-merge.orig/arch/powerpc/Kconfig
+++ to-merge/arch/powerpc/Kconfig
@@ -419,6 +419,7 @@ config PPC_IBM_CELL_BLADE
select PPC_RTAS
select MMIO_NVRAM
select PPC_UDBG_16550
+ select UDBG_RTAS_CONSOLE
config UDBG_RTAS_CONSOLE
bool
Index: to-merge/arch/powerpc/platforms/cell/setup.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/cell/setup.c
+++ to-merge/arch/powerpc/platforms/cell/setup.c
@@ -141,6 +141,10 @@ static int __init cell_probe(void)
!of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
return 0;
+#ifdef CONFIG_UDBG_RTAS_CONSOLE
+ udbg_init_rtas_console();
+#endif
+
hpte_init_native();
return 1;
^ permalink raw reply
* [PATCH 6/8] Add udbg support for RTAS console
From: Michael Ellerman @ 2006-06-23 8:20 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, Arnd Bergmann
Add udbg hooks for the RTAS console, based on the RTAS put-term-char
and get-term-char calls. Along with my previous patches, this should
enable debugging as soon as early_init_dt_scan_rtas() is called.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/Kconfig | 4 ++
arch/powerpc/Kconfig.debug | 9 +++++
arch/powerpc/kernel/rtas.c | 72 ++++++++++++++++++++++++++++++++++++++++++++-
arch/powerpc/kernel/udbg.c | 7 +++-
include/asm-powerpc/udbg.h | 3 +
5 files changed, 90 insertions(+), 5 deletions(-)
Index: to-merge/arch/powerpc/Kconfig
===================================================================
--- to-merge.orig/arch/powerpc/Kconfig
+++ to-merge/arch/powerpc/Kconfig
@@ -420,6 +420,10 @@ config PPC_IBM_CELL_BLADE
select MMIO_NVRAM
select PPC_UDBG_16550
+config UDBG_RTAS_CONSOLE
+ bool
+ default n
+
config XICS
depends on PPC_PSERIES
bool
Index: to-merge/arch/powerpc/Kconfig.debug
===================================================================
--- to-merge.orig/arch/powerpc/Kconfig.debug
+++ to-merge/arch/powerpc/Kconfig.debug
@@ -134,12 +134,19 @@ config PPC_EARLY_DEBUG_G5
help
Select this to enable early debugging for Apple G5 machines.
-config PPC_EARLY_DEBUG_RTAS
+config PPC_EARLY_DEBUG_RTAS_PANEL
bool "RTAS Panel"
depends on PPC_RTAS
help
Select this to enable early debugging via the RTAS panel.
+config PPC_EARLY_DEBUG_RTAS_CONSOLE
+ bool "RTAS Console"
+ depends on PPC_RTAS
+ select UDBG_RTAS_CONSOLE
+ help
+ Select this to enable early debugging via the RTAS console.
+
config PPC_EARLY_DEBUG_MAPLE
bool "Maple real mode"
depends on PPC_MAPLE
Index: to-merge/arch/powerpc/kernel/rtas.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/rtas.c
+++ to-merge/arch/powerpc/kernel/rtas.c
@@ -109,11 +109,71 @@ static void call_rtas_display_status_del
}
}
-void __init udbg_init_rtas(void)
+void __init udbg_init_rtas_panel(void)
{
udbg_putc = call_rtas_display_status_delay;
}
+#ifdef CONFIG_UDBG_RTAS_CONSOLE
+
+/* If you think you're dying before early_init_dt_scan_rtas() does its
+ * work, you can hard code the token values for your firmware here and
+ * hardcode rtas.base/entry etc.
+ */
+static unsigned int rtas_putchar_token = RTAS_UNKNOWN_SERVICE;
+static unsigned int rtas_getchar_token = RTAS_UNKNOWN_SERVICE;
+
+static void udbg_rtascon_putc(char c)
+{
+ int tries;
+
+ if (!rtas.base)
+ return;
+
+ /* Add CRs before LFs */
+ if (c == '\n')
+ udbg_rtascon_putc('\r');
+
+ /* if there is more than one character to be displayed, wait a bit */
+ for (tries = 0; tries < 16; tries++) {
+ if (rtas_call(rtas_putchar_token, 1, 1, NULL, c) == 0)
+ break;
+ udelay(1000);
+ }
+}
+
+static int udbg_rtascon_getc_poll(void)
+{
+ int c;
+
+ if (!rtas.base)
+ return -1;
+
+ if (rtas_call(rtas_getchar_token, 0, 2, &c))
+ return -1;
+
+ return c;
+}
+
+static int udbg_rtascon_getc(void)
+{
+ int c;
+
+ while ((c = udbg_rtascon_getc_poll()) == -1)
+ ;
+
+ return c;
+}
+
+
+void __init udbg_init_rtas_console(void)
+{
+ udbg_putc = udbg_rtascon_putc;
+ udbg_getc = udbg_rtascon_getc;
+ udbg_getc_poll = udbg_rtascon_getc_poll;
+}
+#endif /* CONFIG_UDBG_RTAS_CONSOLE */
+
void rtas_progress(char *s, unsigned short hex)
{
struct device_node *root;
@@ -820,6 +880,16 @@ int __init early_init_dt_scan_rtas(unsig
rtas.size = *sizep;
}
+#ifdef CONFIG_UDBG_RTAS_CONSOLE
+ basep = of_get_flat_dt_prop(node, "put-term-char", NULL);
+ if (basep)
+ rtas_putchar_token = *basep;
+
+ basep = of_get_flat_dt_prop(node, "get-term-char", NULL);
+ if (basep)
+ rtas_getchar_token = *basep;
+#endif
+
/* break now */
return 1;
}
Index: to-merge/arch/powerpc/kernel/udbg.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/udbg.c
+++ to-merge/arch/powerpc/kernel/udbg.c
@@ -34,9 +34,12 @@ void __init udbg_early_init(void)
#elif defined(CONFIG_PPC_EARLY_DEBUG_G5)
/* For use on Apple G5 machines */
udbg_init_pmac_realmode();
-#elif defined(CONFIG_PPC_EARLY_DEBUG_RTAS)
+#elif defined(CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL)
/* RTAS panel debug */
- udbg_init_rtas();
+ udbg_init_rtas_panel();
+#elif defined(CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE)
+ /* RTAS console debug */
+ udbg_init_rtas_console();
#elif defined(CONFIG_PPC_EARLY_DEBUG_MAPLE)
/* Maple real mode debug */
udbg_init_maple_realmode();
Index: to-merge/include/asm-powerpc/udbg.h
===================================================================
--- to-merge.orig/include/asm-powerpc/udbg.h
+++ to-merge/include/asm-powerpc/udbg.h
@@ -42,7 +42,8 @@ extern void __init udbg_init_debug_lpar(
extern void __init udbg_init_pmac_realmode(void);
extern void __init udbg_init_maple_realmode(void);
extern void __init udbg_init_iseries(void);
-extern void __init udbg_init_rtas(void);
+extern void __init udbg_init_rtas_panel(void);
+extern void __init udbg_init_rtas_console(void);
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_UDBG_H */
^ permalink raw reply
* [PATCH 5/8] Setup RTAS values earlier, to enable rtas_call() earlier
From: Michael Ellerman @ 2006-06-23 8:20 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, Arnd Bergmann
Althought RTAS is instantiated when we enter the kernel, we can't actually
call into it until we know its entry point address. Currently we grab that
in rtas_initialize(), however that's quite late in the boot sequence.
To enable rtas_call() earlier, we can grab the RTAS entry etc. values while
we're scanning the flattened device tree. There's existing code to retrieve
the values from /chosen, however we don't store them there anymore, so remove
that code.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/kernel/prom.c | 23 +++++------------------
arch/powerpc/kernel/rtas.c | 22 ++++++++++++++++++++++
include/asm-powerpc/rtas.h | 3 +++
3 files changed, 30 insertions(+), 18 deletions(-)
Index: to-merge/arch/powerpc/kernel/prom.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/prom.c
+++ to-merge/arch/powerpc/kernel/prom.c
@@ -1125,24 +1125,6 @@ static int __init early_init_dt_scan_cho
tce_alloc_end = *lprop;
#endif
-#ifdef CONFIG_PPC_RTAS
- /* To help early debugging via the front panel, we retrieve a minimal
- * set of RTAS infos now if available
- */
- {
- u64 *basep, *entryp, *sizep;
-
- basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL);
- entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL);
- sizep = of_get_flat_dt_prop(node, "linux,rtas-size", NULL);
- if (basep && entryp && sizep) {
- rtas.base = *basep;
- rtas.entry = *entryp;
- rtas.size = *sizep;
- }
- }
-#endif /* CONFIG_PPC_RTAS */
-
#ifdef CONFIG_KEXEC
lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL);
if (lprop)
@@ -1327,6 +1309,11 @@ void __init early_init_devtree(void *par
/* Setup flat device-tree pointer */
initial_boot_params = params;
+#ifdef CONFIG_PPC_RTAS
+ /* Some machines might need RTAS info for debugging, grab it now. */
+ of_scan_flat_dt(early_init_dt_scan_rtas, NULL);
+#endif
+
/* Retrieve various informations from the /chosen node of the
* device-tree, including the platform type, initrd location and
* size, TCE reserve, and more ...
Index: to-merge/arch/powerpc/kernel/rtas.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/rtas.c
+++ to-merge/arch/powerpc/kernel/rtas.c
@@ -801,3 +801,25 @@ void __init rtas_initialize(void)
rtas_last_error_token = rtas_token("rtas-last-error");
#endif
}
+
+int __init early_init_dt_scan_rtas(unsigned long node,
+ const char *uname, int depth, void *data)
+{
+ u32 *basep, *entryp, *sizep;
+
+ if (depth != 1 || strcmp(uname, "rtas") != 0)
+ return 0;
+
+ basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL);
+ entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL);
+ sizep = of_get_flat_dt_prop(node, "rtas-size", NULL);
+
+ if (basep && entryp && sizep) {
+ rtas.base = *basep;
+ rtas.entry = *entryp;
+ rtas.size = *sizep;
+ }
+
+ /* break now */
+ return 1;
+}
Index: to-merge/include/asm-powerpc/rtas.h
===================================================================
--- to-merge.orig/include/asm-powerpc/rtas.h
+++ to-merge/include/asm-powerpc/rtas.h
@@ -181,6 +181,9 @@ extern int rtas_set_rtc_time(struct rtc_
extern unsigned int rtas_busy_delay_time(int status);
extern unsigned int rtas_busy_delay(int status);
+extern int early_init_dt_scan_rtas(unsigned long node,
+ const char *uname, int depth, void *data);
+
extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
/* Error types logged. */
^ permalink raw reply
* [PATCH 4/8] Move RTAS exports next to their declarations
From: Michael Ellerman @ 2006-06-23 8:20 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, Arnd Bergmann
Move RTAS exports next to their declarations.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/kernel/rtas.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
Index: to-merge/arch/powerpc/kernel/rtas.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/rtas.c
+++ to-merge/arch/powerpc/kernel/rtas.c
@@ -38,16 +38,19 @@
struct rtas_t rtas = {
.lock = SPIN_LOCK_UNLOCKED
};
+EXPORT_SYMBOL(rtas);
struct rtas_suspend_me_data {
long waiting;
struct rtas_args *args;
};
-EXPORT_SYMBOL(rtas);
-
DEFINE_SPINLOCK(rtas_data_buf_lock);
+EXPORT_SYMBOL(rtas_data_buf_lock);
+
char rtas_data_buf[RTAS_DATA_BUF_SIZE] __cacheline_aligned;
+EXPORT_SYMBOL(rtas_data_buf);
+
unsigned long rtas_rmo_buf;
/*
@@ -236,6 +239,7 @@ int rtas_token(const char *service)
tokp = (int *) get_property(rtas.dev, service, NULL);
return tokp ? *tokp : RTAS_UNKNOWN_SERVICE;
}
+EXPORT_SYMBOL(rtas_token);
#ifdef CONFIG_RTAS_ERROR_LOGGING
/*
@@ -369,6 +373,7 @@ int rtas_call(int token, int nargs, int
}
return ret;
}
+EXPORT_SYMBOL(rtas_call);
/* For RTAS_BUSY (-2), delay for 1 millisecond. For an extended busy status
* code of 990n, perform the hinted delay of 10^n (last digit) milliseconds.
@@ -388,6 +393,7 @@ unsigned int rtas_busy_delay_time(int st
return ms;
}
+EXPORT_SYMBOL(rtas_busy_delay_time);
/* For an RTAS busy status code, perform the hinted delay. */
unsigned int rtas_busy_delay(int status)
@@ -401,6 +407,7 @@ unsigned int rtas_busy_delay(int status)
return ms;
}
+EXPORT_SYMBOL(rtas_busy_delay);
int rtas_error_rc(int rtas_rc)
{
@@ -446,6 +453,7 @@ int rtas_get_power_level(int powerdomain
return rtas_error_rc(rc);
return rc;
}
+EXPORT_SYMBOL(rtas_get_power_level);
int rtas_set_power_level(int powerdomain, int level, int *setlevel)
{
@@ -463,6 +471,7 @@ int rtas_set_power_level(int powerdomain
return rtas_error_rc(rc);
return rc;
}
+EXPORT_SYMBOL(rtas_set_power_level);
int rtas_get_sensor(int sensor, int index, int *state)
{
@@ -480,6 +489,7 @@ int rtas_get_sensor(int sensor, int inde
return rtas_error_rc(rc);
return rc;
}
+EXPORT_SYMBOL(rtas_get_sensor);
int rtas_set_indicator(int indicator, int index, int new_value)
{
@@ -497,6 +507,7 @@ int rtas_set_indicator(int indicator, in
return rtas_error_rc(rc);
return rc;
}
+EXPORT_SYMBOL(rtas_set_indicator);
void rtas_restart(char *cmd)
{
@@ -790,15 +801,3 @@ void __init rtas_initialize(void)
rtas_last_error_token = rtas_token("rtas-last-error");
#endif
}
-
-
-EXPORT_SYMBOL(rtas_token);
-EXPORT_SYMBOL(rtas_call);
-EXPORT_SYMBOL(rtas_data_buf);
-EXPORT_SYMBOL(rtas_data_buf_lock);
-EXPORT_SYMBOL(rtas_busy_delay_time);
-EXPORT_SYMBOL(rtas_busy_delay);
-EXPORT_SYMBOL(rtas_get_sensor);
-EXPORT_SYMBOL(rtas_get_power_level);
-EXPORT_SYMBOL(rtas_set_power_level);
-EXPORT_SYMBOL(rtas_set_indicator);
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox