From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E6E61DDE1F for ; Thu, 3 Jul 2008 02:03:50 +1000 (EST) Message-Id: From: Kumar Gala To: Scott Wood In-Reply-To: <20080625215051.GA11784@loki.buserror.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v924) Subject: Re: [PATCH 1/3] mpc83xx: Power Management support Date: Wed, 2 Jul 2008 11:03:42 -0500 References: <20080625215051.GA11784@loki.buserror.net> Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , > diff --git a/arch/powerpc/platforms/83xx/suspend-asm.S b/arch/ > powerpc/platforms/83xx/suspend-asm.S > new file mode 100644 > index 0000000..03e29a2 > --- /dev/null > +++ b/arch/powerpc/platforms/83xx/suspend-asm.S > @@ -0,0 +1,539 @@ > +/* > + * Enter and leave sleep state on MPC83xx > + * > + * Author: Scott Wood > + * > + * Copyright (c) 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 version 2 as > published > + * by the Free Software Foundation. > + */ > + > +#include > +#include > +#include > +#include > + > +#define SS_MEMSAVE 0x00 > +#define SS_HID 0x08 /* 3 HIDs */ > +#define SS_IABR 0x14 /* 2 IABRs */ > +#define SS_IBCR 0x1c > +#define SS_DABR 0x20 /* 2 DABRs */ > +#define SS_DBCR 0x28 > +#define SS_SP 0x2c > +#define SS_SR 0x30 /* 16 segment registers */ > +#define SS_CURRENT 0x70 > +#define SS_MSR 0x74 > +#define SS_SDR1 0x78 > +#define SS_LR 0x7c > +#define SS_SPRG 0x80 /* 4 SPRGs */ > +#define SS_DBAT 0x90 /* 8 DBATs */ > +#define SS_IBAT 0xd0 /* 8 IBATs */ > +#define SS_TB 0x110 > +#define SS_CR 0x118 > +#define SS_GPREG 0x11c /* r12-r31 */ > +#define STATE_SAVE_SIZE 0x16c > + > + .section .data > + .align 5 > + > +mpc83xx_sleep_save_area: > + .space STATE_SAVE_SIZE > +immrbase: > + .long 0 If we are going to allocate space for save area like this, can't we do this in C code. Its less error prone and easier to extend over time. I know the powermac code does something similar but it places the save area on the stack. It also seems like the core register save/restore should be shared between 83xx and 5{1,2}xx but that would be a longer term goal. - k