* Re: [PATCH 3/5] treewide: Remove useless NORET_TYPE macro and uses
From: Ralf Baechle @ 2011-11-10 11:41 UTC (permalink / raw)
To: Joe Perches
Cc: Andrew Morton, Fenghua Yu, linux-m68k, Tony Luck, linux-ia64,
linux-mips, Peter Zijlstra, linux-s390, Heiko Carstens,
linux-kernel, Chris Metcalf, Geert Uytterhoeven, linux390,
Martin Schwidefsky, Paul Mackerras, Ingo Molnar,
Haavard Skinnemoen, linuxppc-dev, Hans-Christian Egtvedt
In-Reply-To: <e69163f6245513b05d5d21c2f57b916931ad5bff.1320917557.git.joe@perches.com>
On Thu, Nov 10, 2011 at 01:41:44AM -0800, Joe Perches wrote:
> arch/mips/include/asm/ptrace.h | 2 +-
> arch/mips/kernel/traps.c | 2 +-
For the MIPS bits:
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Ralf
^ permalink raw reply
* right way to get interrupt controller register
From: Andreas Friesen @ 2011-11-10 11:31 UTC (permalink / raw)
To: linuxppc-dev
Hello people,
I have a little problem with the isr routine. The interrupt handler
is installed and working fine, but I can not clear the interrupt flag in
ICTL-Register.
Is that right way to get interrupt controller register ?
Thanks in advance,
Andreas Friesen
Hier is my ISR-Handler and probe functions :
static irqreturn_t mess_isr (int irq, void *data)
{
struct qxcpld_drvdata *drvdata ;
drvdata =3D (struct qxcpld_drvdata *)data ;
struct mpc52xx_intr __iomem *intr;
int i ;
u32 intr_ctrl;
=A0 =A0 =A0 =A0intr =3D drvdata->intr
=A0 =A0 =A0 =A0intr_ctrl =3D intr->ctrl ;
intr_ctrl =3D in_be32(&intr->ctrl);
intr_ctrl |=3D =A00x04000000;
out_be32 (&intr->ctrl,intr_ctrl);
=A0 =A0 =A0 // set gpio
=A0 =A0 =A0 ....
return IRQ_HANDLED;
}
/* MPC5200 device tree match tables */
static struct of_device_id mpc52xx_pic_ids[] __initdata =3D {
{ .compatible =3D "fsl,mpc5200b-pic", },
{ .compatible =3D "mpc5200-pic", },
{}
};
static int __devinit qxcpld_of_probe (struct platform_device *ofdev)
{
.....
/* Remap the necessary zones */
np =3D of_find_matching_node(NULL, mpc52xx_pic_ids);
drvdata->intr =3D of_iomap(np, 0);
if (!drvdata->intr)
panic(__FILE__ =A0": find_and_map failed on 'mpc5200-pic'. "
=A0 =A0 =A0"Check node !");
of_node_put (np);
....
/* request irq */
drvdata->mess_irq =3D irq_of_parse_and_map(ofdev->dev.of_node,0);
if (drvdata->mess_irq =3D=3D NO_IRQ ) {
dev_err (&ofdev->dev, "failed to attach interrupt\n");
goto reg_unmap ;
}
....
if ( request_irq( drvdata->mess_irq,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0qxcpld_mess_isr,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0IRQF_DISABLED|IRQF_SHARED,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"qxcpld-mess-irq",
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(void *)drvdata
=A0 =A0 ) ) {
dev_err(&ofdev->dev, "Can't request irq\n") ;
goto reg_unmap ;
}
...
}
^ permalink raw reply
* Re: [RFC PATCH v4 02/10] fadump: Reserve the memory for firmware assisted dump.
From: Mahesh J Salgaonkar @ 2011-11-10 10:43 UTC (permalink / raw)
To: Cong Wang
Cc: linuxppc-dev, Eric W. Biederman, Linux Kernel, Milton Miller,
Anton Blanchard
In-Reply-To: <4EBB9FEE.9090905@redhat.com>
On 2011-11-10 17:57:02 Thu, Cong Wang wrote:
> Hi, Mahesh,
>
> Your patch seems have some style problems... checkpatch.pl complains,
>
> total: 330 errors, 1 warnings, 355 lines checked
>
> NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or
> scripts/cleanfile
>
> Could use scripts/checkpatch.pl to check your patch?
I do run the checkpatch.pl before sending patches out. I am not sure how
I missed this one. Will do better job next time.
Thanks,
--
Mahesh J Salgaonkar
^ permalink raw reply
* Re: [RFC PATCH v4 01/10] fadump: Add documentation for firmware-assisted dump.
From: Mahesh J Salgaonkar @ 2011-11-10 10:40 UTC (permalink / raw)
To: Cong Wang
Cc: Linux Kernel, Milton Miller, linuxppc-dev, Anton Blanchard,
Eric W. Biederman
In-Reply-To: <4EBB9D76.80601@redhat.com>
On 2011-11-10 17:46:30 Thu, Cong Wang wrote:
> 于 2011年11月07日 17:55, Mahesh J Salgaonkar 写道:
> >From: Mahesh Salgaonkar<mahesh@linux.vnet.ibm.com>
> >
> >Documentation for firmware-assisted dump. This document is based on the
> >original documentation written for phyp assisted dump by Linas Vepstas
> >and Manish Ahuja, with few changes to reflect the current implementation.
> >
> >Change in v3:
> >- Modified the documentation to reflect introdunction of fadump_registered
> > sysfs file and few minor changes.
> >
> >Change in v2:
> >- Modified the documentation to reflect the change of fadump_region
> > file under debugfs filesystem.
> >
> >Signed-off-by: Mahesh Salgaonkar<mahesh@linux.vnet.ibm.com>
>
>
> Please Cc Randy Dunlap <rdunlap@xenotime.net> for kernel documentation
> patch.
>
> I have some inline comments below.
>
Thanks for your review. I will incorporate all your comments.
<...>
> >+with minor modifications. The kdump script requires following
> >+modifications:
> >+-- During service kdump start if /proc/vmcore entry is not present,
> >+ look for the existence of /sys/kernel/fadump_enabled and read
> >+ value exported by it. If value is set to '0' then fallback to
> >+ existing kexec based kdump. If value is set to '1' then check the
> >+ value exported by /sys/kernel/fadump_registered. If value it set
> >+ to '1' then print success otherwise register for fadump by
> >+ echo'ing 1> /sys/kernel/fadump_registered file.
> >+
> >+-- During service kdump start if /proc/vmcore entry is present,
> >+ execute the existing routine to save the dump. Once the dump
> >+ is saved, echo 1> /sys/kernel/fadump_release_mem (if the
> >+ file exists) to release the reserved memory for general use
> >+ and continue without rebooting. At this point the memory
> >+ reservation map will look like as shown in Fig. 1. If the file
> >+ /sys/kernel/fadump_release_mem is not present then follow
> >+ the existing routine to reboot into new kernel.
> >+
> >+-- During service kdump stop echo 0> /sys/kernel/fadump_registered
> >+ to un-register the fadump.
> >+
>
> I don't think you need to document kdump script changes in a kernel
> doc.
>
Agree. I will remove it.
> >+
> >+TODO:
> >+-----
> >+ o Need to come up with the better approach to find out more
> >+ accurate boot memory size that is required for a kernel to
> >+ boot successfully when booted with restricted memory.
> >+ o The fadump implementation introduces a fadump crash info structure
> >+ in the scratch area before the ELF core header. The idea of introducing
> >+ this structure is to pass some important crash info data to the second
> >+ kernel which will help second kernel to populate ELF core header with
> >+ correct data before it gets exported through /proc/vmcore. The current
> >+ design implementation does not address a possibility of introducing
> >+ additional fields (in future) to this structure without affecting
> >+ compatibility. Need to come up with the better approach to address this.
> >+ The possible approaches are:
> >+ 1. Introduce version field for version tracking, bump up the version
> >+ whenever a new field is added to the structure in future. The version
> >+ field can be used to find out what fields are valid for the current
> >+ version of the structure.
> >+ 2. Reserve the area of predefined size (say PAGE_SIZE) for this
> >+ structure and have unused area as reserved (initialized to zero)
> >+ for future field additions.
> >+ The advantage of approach 1 over 2 is we don't need to reserve extra space.
> >+---
>
> Why do we keep TODO in this doc?
>
I see most of the kernel doc do contain TODO, hence I added it here.
Thanks,
-Mahesh.
--
Mahesh J Salgaonkar
^ permalink raw reply
* Re: [RFC PATCH v4 06/10] fadump: Add PT_NOTE program header for vmcoreinfo
From: Cong Wang @ 2011-11-10 10:11 UTC (permalink / raw)
To: Mahesh J Salgaonkar
Cc: Linux Kernel, Milton Miller, linuxppc-dev, Anton Blanchard,
Eric W. Biederman
In-Reply-To: <20111107095603.1997.39898.stgit@mars.in.ibm.com>
于 2011年11月07日 17:56, Mahesh J Salgaonkar 写道:
> From: Mahesh Salgaonkar<mahesh@linux.vnet.ibm.com>
>
> Introduce a PT_NOTE program header that points to physical address of
> vmcoreinfo_note buffer declared in kernel/kexec.c. The vmcoreinfo
> note buffer is populated during crash_fadump() at the time of system
> crash.
>
> Signed-off-by: Mahesh Salgaonkar<mahesh@linux.vnet.ibm.com>
> ---
> arch/powerpc/kernel/fadump.c | 29 +++++++++++++++++++++++++++++
> 1 files changed, 29 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
> index 70d6287..e68ee3a 100644
> --- a/arch/powerpc/kernel/fadump.c
> +++ b/arch/powerpc/kernel/fadump.c
> @@ -816,6 +816,19 @@ static void setup_crash_memory_ranges(void)
> }
> }
>
> +/*
> + * If the given physical address falls within the boot memory region then
> + * return the relocated address that points to the dump region reserved
> + * for saving initial boot memory contents.
> + */
> +static inline unsigned long relocate(unsigned long paddr)
> +{
> + if (paddr> RMR_START&& paddr< fw_dump.boot_memory_size)
> + return fdm.rmr_region.destination_address + paddr;
> + else
> + return paddr;
> +}
Although they are static functions, it is still better to name them
with "fadump_" prefix...
Thanks.
^ permalink raw reply
* Re: [RFC PATCH v4 10/10] fadump: Introduce config option for firmware assisted dump feature
From: Cong Wang @ 2011-11-10 10:10 UTC (permalink / raw)
To: Mahesh J Salgaonkar
Cc: Linux Kernel, Milton Miller, linuxppc-dev, Anton Blanchard,
Eric W. Biederman
In-Reply-To: <20111107095630.1997.54984.stgit@mars.in.ibm.com>
于 2011年11月07日 17:56, Mahesh J Salgaonkar 写道:
> From: Mahesh Salgaonkar<mahesh@linux.vnet.ibm.com>
>
> This patch introduces a new config option CONFIG_FA_DUMP for firmware
> assisted dump feature on Powerpc (ppc64) architecture.
>
I think this patch can be folded into the 02/10, as this config
is already used there.
Thanks.
^ permalink raw reply
* Re: [RFC PATCH v4 05/10] fadump: Convert firmware-assisted cpu state dump data into elf notes.
From: Cong Wang @ 2011-11-10 10:08 UTC (permalink / raw)
To: Mahesh J Salgaonkar
Cc: Linux Kernel, Milton Miller, linuxppc-dev, Anton Blanchard,
Eric W. Biederman
In-Reply-To: <20111107095553.1997.68645.stgit@mars.in.ibm.com>
于 2011年11月07日 17:55, Mahesh J Salgaonkar 写道:
> +#ifdef CONFIG_FA_DUMP
> + crash_fadump(regs, str);
> +#endif
> +
Please make it a nop for !CONFIG_FA_DUMP.
^ permalink raw reply
* Re: [RFC PATCH v4 02/10] fadump: Reserve the memory for firmware assisted dump.
From: Cong Wang @ 2011-11-10 9:57 UTC (permalink / raw)
To: Mahesh J Salgaonkar
Cc: Linux Kernel, Milton Miller, linuxppc-dev, Anton Blanchard,
Eric W. Biederman
In-Reply-To: <20111107095527.1997.79902.stgit@mars.in.ibm.com>
Hi, Mahesh,
Your patch seems have some style problems... checkpatch.pl complains,
total: 330 errors, 1 warnings, 355 lines checked
NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or
scripts/cleanfile
Could use scripts/checkpatch.pl to check your patch?
Thanks.
^ permalink raw reply
* Re: [RFC PATCH v4 01/10] fadump: Add documentation for firmware-assisted dump.
From: Cong Wang @ 2011-11-10 9:46 UTC (permalink / raw)
To: Mahesh J Salgaonkar
Cc: Linux Kernel, Milton Miller, linuxppc-dev, Anton Blanchard,
Eric W. Biederman
In-Reply-To: <20111107095521.1997.34844.stgit@mars.in.ibm.com>
于 2011年11月07日 17:55, Mahesh J Salgaonkar 写道:
> From: Mahesh Salgaonkar<mahesh@linux.vnet.ibm.com>
>
> Documentation for firmware-assisted dump. This document is based on the
> original documentation written for phyp assisted dump by Linas Vepstas
> and Manish Ahuja, with few changes to reflect the current implementation.
>
> Change in v3:
> - Modified the documentation to reflect introdunction of fadump_registered
> sysfs file and few minor changes.
>
> Change in v2:
> - Modified the documentation to reflect the change of fadump_region
> file under debugfs filesystem.
>
> Signed-off-by: Mahesh Salgaonkar<mahesh@linux.vnet.ibm.com>
Please Cc Randy Dunlap <rdunlap@xenotime.net> for kernel documentation
patch.
I have some inline comments below.
> ---
> Documentation/powerpc/firmware-assisted-dump.txt | 262 ++++++++++++++++++++++
> 1 files changed, 262 insertions(+), 0 deletions(-)
> create mode 100644 Documentation/powerpc/firmware-assisted-dump.txt
>
> diff --git a/Documentation/powerpc/firmware-assisted-dump.txt b/Documentation/powerpc/firmware-assisted-dump.txt
> new file mode 100644
> index 0000000..ba6724a
> --- /dev/null
> +++ b/Documentation/powerpc/firmware-assisted-dump.txt
> @@ -0,0 +1,262 @@
> +
> + Firmware-Assisted Dump
> + ------------------------
> + July 2011
> +
> +The goal of firmware-assisted dump is to enable the dump of
> +a crashed system, and to do so from a fully-reset system, and
> +to minimize the total elapsed time until the system is back
> +in production use.
> +
> +As compared to kdump or other strategies, firmware-assisted
> +dump offers several strong, practical advantages:
Comparing with kdump or...
> +
> +-- Unlike kdump, the system has been reset, and loaded
> + with a fresh copy of the kernel. In particular,
> + PCI and I/O devices have been reinitialized and are
> + in a clean, consistent state.
> +-- Once the dump is copied out, the memory that held the dump
> + is immediately available to the running kernel. A further
> + reboot isn't required.
> +
> +The above can only be accomplished by coordination with,
> +and assistance from the Power firmware. The procedure is
> +as follows:
> +
> +-- The first kernel registers the sections of memory with the
> + Power firmware for dump preservation during OS initialization.
> + This registered sections of memory is reserved by the first
These registered sections of memory are...
> + kernel during early boot.
> +
> +-- When a system crashes, the Power firmware will save
> + the low memory (boot memory of size larger of 5% of system RAM
> + or 256MB) of RAM to a previously registered save region. It
...to the previous registered region...
> + will also save system registers, and hardware PTE's.
> +
> + NOTE: The term 'boot memory' means size of the low memory chunk
> + that is required for a kernel to boot successfully when
> + booted with restricted memory. By default, the boot memory
> + size will be calculated to larger of 5% of system RAM or
will be the larger of...
> + 256MB. Alternatively, user can also specify boot memory
> + size through boot parameter 'fadump_reserve_mem=' which
> + will override the default calculated size.
> +
> +-- After the low memory (boot memory) area has been saved, the
> + firmware will reset PCI and other hardware state. It will
> + *not* clear the RAM. It will then launch the bootloader, as
> + normal.
> +
> +-- The freshly booted kernel will notice that there is a new
> + node (ibm,dump-kernel) in the device tree, indicating that
> + there is crash data available from a previous boot. During
> + the early boot OS will reserve rest of the memory above
> + boot memory size effectively booting with restricted memory
> + size. This will make sure that the second kernel will not
> + touch any of the dump memory area.
> +
> +-- Userspace tools will read /proc/vmcore to obtain the contents
> + of memory, which holds the previous crashed kernel dump in ELF
> + format. The userspace tools may copy this info to disk, or
> + network, nas, san, iscsi, etc. as desired.
s/Userspace/User-space/
> +
> +-- Once the userspace tool is done saving dump, it will echo
> + '1' to /sys/kernel/fadump_release_mem to release the reserved
> + memory back to general use, except the memory required for
> + next firmware-assisted dump registration.
> +
> + e.g.
> + # echo 1> /sys/kernel/fadump_release_mem
> +
> +Please note that the firmware-assisted dump feature
> +is only available on Power6 and above systems with recent
> +firmware versions.
> +
> +Implementation details:
> +----------------------
> +
> +During boot, a check is made to see if firmware supports
> +this feature on that particular machine. If it does, then
> +we check to see if an active dump is waiting for us. If yes
> +then everything but boot memory size of RAM is reserved during
> +early boot (See Fig. 2). This area is released once we collect a
> +dump from user land scripts (kdump scripts) that are run. If
This area is released once we finish collecting the dump
from user land scripts (e.g. kdump scripts).
> +there is dump data, then the /sys/kernel/fadump_release_mem
> +file is created, and the reserved memory is held.
> +
> +If there is no waiting dump data, then only the memory required
> +to hold CPU state, HPTE region, boot memory dump and elfcore
> +header, is reserved at the top of memory (see Fig. 1). This area
> +is *not* released: this region will be kept permanently reserved,
> +so that it can act as a receptacle for a copy of the boot memory
> +content in addition to CPU state and HPTE region, in the case a
> +crash does occur.
> +
> + o Memory Reservation during first kernel
> +
> + Low memory Top of memory
> + 0 boot memory size |
> + | | |<--Reserved dump area -->|
> + V V | Permanent Reservation V
> + +-----------+----------/ /----------+---+----+-----------+----+
> + | | |CPU|HPTE| DUMP |ELF |
> + +-----------+----------/ /----------+---+----+-----------+----+
> + | ^
> + | |
> + \ /
> + -------------------------------------------
> + Boot memory content gets transferred to
> + reserved area by firmware at the time of
> + crash
> + Fig. 1
> +
> + o Memory Reservation during second kernel after crash
> +
> + Low memory Top of memory
> + 0 boot memory size |
> + | |<------------- Reserved dump area ----------- -->|
> + V V V
> + +-----------+----------/ /----------+---+----+-----------+----+
> + | | |CPU|HPTE| DUMP |ELF |
> + +-----------+----------/ /----------+---+----+-----------+----+
> + | |
> + V V
> + Used by second /proc/vmcore
> + kernel to boot
> + Fig. 2
> +
> +Currently the dump will be copied from /proc/vmcore to a
> +a new file upon user intervention. The dump data available through
> +/proc/vmcore will be in ELF format. Hence the existing kdump
> +infrastructure (kdump scripts) to save the dump works fine
> +with minor modifications. The kdump script requires following
> +modifications:
> +-- During service kdump start if /proc/vmcore entry is not present,
> + look for the existence of /sys/kernel/fadump_enabled and read
> + value exported by it. If value is set to '0' then fallback to
> + existing kexec based kdump. If value is set to '1' then check the
> + value exported by /sys/kernel/fadump_registered. If value it set
> + to '1' then print success otherwise register for fadump by
> + echo'ing 1> /sys/kernel/fadump_registered file.
> +
> +-- During service kdump start if /proc/vmcore entry is present,
> + execute the existing routine to save the dump. Once the dump
> + is saved, echo 1> /sys/kernel/fadump_release_mem (if the
> + file exists) to release the reserved memory for general use
> + and continue without rebooting. At this point the memory
> + reservation map will look like as shown in Fig. 1. If the file
> + /sys/kernel/fadump_release_mem is not present then follow
> + the existing routine to reboot into new kernel.
> +
> +-- During service kdump stop echo 0> /sys/kernel/fadump_registered
> + to un-register the fadump.
> +
I don't think you need to document kdump script changes in a kernel
doc.
> +The tools to examine the dump will be same as the ones
> +used for kdump.
> +
> +How to enable firmware-assisted dump (fadump):
> +-------------------------------------
> +
> +1. Set config option CONFIG_FA_DUMP=y and build kernel.
> +2. Boot into linux kernel with 'fadump=1' kernel cmdline option.
> +3. Optionally, user can also set 'fadump_reserve_mem=' kernel cmdline
> + to specify size of the memory to reserve for boot memory dump
> + preservation.
> +
> +NOTE: If firmware-assisted dump fails to reserve memory then it will
> + fallback to existing kdump mechanism if 'crashkernel=' option
> + is set at kernel cmdline.
> +
> +Sysfs/debugfs files:
> +------------
> +
> +Firmware-assisted dump feature uses sysfs file system to hold
> +the control files and debugfs file to display memory reserved region.
> +
> +Here is the list of files under kernel sysfs:
> +
> + /sys/kernel/fadump_enabled
> +
> + This is used to display the fadump status.
> + 0 = fadump is disabled
> + 1 = fadump is enabled
> +
> + /sys/kernel/fadump_registered
> +
> + This is used to display the fadump registration status as well
> + as to control (start/stop) the fadump registration.
> + 0 = fadump is not registered.
> + 1 = fadump is registered and ready to handle system crash.
> +
> + To register fadump echo 1> /sys/kernel/fadump_registered and
> + echo 0> /sys/kernel/fadump_registered for un-register and stop the
> + fadump. Once the fadump is un-registered, the system crash will not
> + be handled and vmcore will not be captured.
> +
> + /sys/kernel/fadump_release_mem
> +
> + This file is available only when fadump is active during
> + second kernel. This is used to release the reserved memory
> + region that are held for saving crash dump. To release the
> + reserved memory echo 1 to it:
> +
> + echo 1> /sys/kernel/fadump_release_mem
> +
> + After echo 1, the content of the /sys/kernel/debug/powerpc/fadump_region
> + file will change to reflect the new memory reservations.
> +
> +Here is the list of files under powerpc debugfs:
> +(Assuming debugfs is mounted on /sys/kernel/debug directory.)
> +
> + /sys/kernel/debug/powerpc/fadump_region
> +
> + This file shows the reserved memory regions if fadump is
> + enabled otherwise this file is empty. The output format
> + is:
> +<region>: [<start>-<end>]<reserved-size> bytes, Dumped:<dump-size>
> +
> + e.g.
> + Contents when fadump is registered during first kernel
> +
> + # cat /sys/kernel/debug/powerpc/fadump_region
> + CPU : [0x0000006ffb0000-0x0000006fff001f] 0x40020 bytes, Dumped: 0x0
> + HPTE: [0x0000006fff0020-0x0000006fff101f] 0x1000 bytes, Dumped: 0x0
> + DUMP: [0x0000006fff1020-0x0000007fff101f] 0x10000000 bytes, Dumped: 0x0
> +
> + Contents when fadump is active during second kernel
> +
> + # cat /sys/kernel/debug/powerpc/fadump_region
> + CPU : [0x0000006ffb0000-0x0000006fff001f] 0x40020 bytes, Dumped: 0x40020
> + HPTE: [0x0000006fff0020-0x0000006fff101f] 0x1000 bytes, Dumped: 0x1000
> + DUMP: [0x0000006fff1020-0x0000007fff101f] 0x10000000 bytes, Dumped: 0x10000000
> + : [0x00000010000000-0x0000006ffaffff] 0x5ffb0000 bytes, Dumped: 0x5ffb0000
> +
> +NOTE: Please refer to debugfs documentation on how to mount the debugfs
> + filesystem.
> +
That is Documentation/filesystems/debugfs.txt.
> +
> +TODO:
> +-----
> + o Need to come up with the better approach to find out more
> + accurate boot memory size that is required for a kernel to
> + boot successfully when booted with restricted memory.
> + o The fadump implementation introduces a fadump crash info structure
> + in the scratch area before the ELF core header. The idea of introducing
> + this structure is to pass some important crash info data to the second
> + kernel which will help second kernel to populate ELF core header with
> + correct data before it gets exported through /proc/vmcore. The current
> + design implementation does not address a possibility of introducing
> + additional fields (in future) to this structure without affecting
> + compatibility. Need to come up with the better approach to address this.
> + The possible approaches are:
> + 1. Introduce version field for version tracking, bump up the version
> + whenever a new field is added to the structure in future. The version
> + field can be used to find out what fields are valid for the current
> + version of the structure.
> + 2. Reserve the area of predefined size (say PAGE_SIZE) for this
> + structure and have unused area as reserved (initialized to zero)
> + for future field additions.
> + The advantage of approach 1 over 2 is we don't need to reserve extra space.
> +---
Why do we keep TODO in this doc?
Thanks!
^ permalink raw reply
* Re: [RFC PATCH v4 00/10] fadump: Firmware-assisted dump support for Powerpc.
From: Cong Wang @ 2011-11-10 9:24 UTC (permalink / raw)
To: Mahesh J Salgaonkar
Cc: Linux Kernel, Milton Miller, linuxppc-dev, Anton Blanchard,
Eric W. Biederman
In-Reply-To: <20111107095215.1997.14866.stgit@mars.in.ibm.com>
Hi, Mahesh,
Could you please also add kexec@lists.infradead.org and Vivek into your
Cc list when you send your patchset next time?
Thanks!
^ permalink raw reply
* RE: [PATCH v2 1/5] [ppc] Process dynamic relocations for kernel
From: David Laight @ 2011-11-10 9:15 UTC (permalink / raw)
To: Suzuki Poulose, Josh Poimboeuf
Cc: Nathan Miller, Josh Poimboeuf, Dave Hansen, Alan Modra,
Scott Wood, Paul Mackerras, linuxppc-dev
In-Reply-To: <4EBB3794.9050309@in.ibm.com>
=20
> >> How about using clean_dcache_range() to flush the range runtime
> >> address range [ _stext, _end ] ? That would flush the entire
> >> instructions.
> >
> > Wouldn't that result in more cache flushing than the original
solution?
> >
> > For example, my kernel is 3.5MB. Assuming a 32 byte cache line
size,
> > clean_dcache_range(_stext, _end) would result in about 115,000
dcbst's
> > (3.5MB / 32).
>=20
> Oops ! You are right. We could go back to the=20
> clean_dcache_all() or the
> initial approach that you suggested. (dcbst).
Maybe clean_dcache_range() itself should limit the range
to the size of the cache?
I suspect that code can easily know the cache size.
David
^ permalink raw reply
* Re: [PATCH] powerpc: Export PIR data through sysfs
From: Ananth N Mavinakayanahalli @ 2011-11-10 8:48 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, Anton Blanchard, mahesh
In-Reply-To: <20111109154825.GB7839@schlenkerla.am.freescale.net>
On Wed, Nov 09, 2011 at 09:48:25AM -0600, Scott Wood wrote:
> On Wed, Nov 09, 2011 at 10:11:24AM +0530, Ananth N Mavinakayanahalli wrote:
> > On Tue, Nov 08, 2011 at 10:59:46AM -0600, Scott Wood wrote:
> > > On 11/08/2011 12:58 AM, Ananth N Mavinakayanahalli wrote:
> > > > On Mon, Nov 07, 2011 at 11:18:32AM -0600, Scott Wood wrote:
> > > >> What use does userspace have for this? If you want to return the
> > > >> currently executing CPU (which unless you're pinned could change as soon
> > > >> as the value is read...), why not just return smp_processor_id() or
> > > >> hard_smp_processor_id()?
> > > >
> > > > Its not just the current cpu. Decoding PIR can tell you the core id,
> > > > thread id in case of SMT, and this information can be used by userspace
> > > > apps to set affinities, etc.
> > >
> > > Wouldn't it make more sense to expose the thread to core mappings in a
> > > general way, not tied to hardware or what thread we're currently running on?
> >
> > AFAIK, the information encoding in PIR is platform dependent. There is
> > no general way to expose this information unless you want have a
> > per-platform ifdef. Even then, I am not sure if that information will
> > generally be available or provided.
> >
> > > What's the use case for knowing this information only about the current
> > > thread (or rather the state the current thread was in a few moments ago)?
> >
> > Its not information about the thread but about the cpu. Unless you have
> > a shared LPAR environment, the data will be consistent and can be used
> > by applications with knowledge of the platform.
>
> I'm not sure what a "shared LPAR environment" is, but unless you're
> pinned there's no guarantee the CPU you're running on once the read()
> syscall returns is the same as the one that PIR was read on. Do you mean
> you're expecting this to be run from inside a partition that runs only on
> one CPU, and thus whichever thread you'll be migrated to will have the
> other data remain the same?
This will be used from a partition with a dedicated set of cpus and so
the data will remain consistent.
> > I think this calls for a CPU_FTR_PIR. What do you suggest?
>
> Unless someone wants to test what actually happens when you read PIR on
> all these CPUs...
>
> What platform is this meant to be useful for? Perhaps it could just be a
> platform-specific sysfs entry?
Currently I only care about pseries and have tested the following patch
on them. I've therefore made the code similar to what currently exists
for other features unique to POWER.
Ananth
---
From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
The Processor Identification Register (PIR) on some powerpc platforms
provides information to decode the processor identification tag.
Decoding this information is platform specific.
We currently need this information for POWERx processors and hence
follows a similar model as adopted for the other POWERx specific
features.
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
---
arch/powerpc/include/asm/cputable.h | 9 +++++----
arch/powerpc/kernel/sysfs.c | 8 ++++++++
2 files changed, 13 insertions(+), 4 deletions(-)
Index: linux-3.2-rc1/arch/powerpc/include/asm/cputable.h
===================================================================
--- linux-3.2-rc1.orig/arch/powerpc/include/asm/cputable.h
+++ linux-3.2-rc1/arch/powerpc/include/asm/cputable.h
@@ -201,6 +201,7 @@ extern const char *powerpc_base_platform
#define CPU_FTR_POPCNTB LONG_ASM_CONST(0x0400000000000000)
#define CPU_FTR_POPCNTD LONG_ASM_CONST(0x0800000000000000)
#define CPU_FTR_ICSWX LONG_ASM_CONST(0x1000000000000000)
+#define CPU_FTR_PIR LONG_ASM_CONST(0x2000000000000000)
#ifndef __ASSEMBLY__
@@ -400,7 +401,7 @@ extern const char *powerpc_base_platform
#define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
CPU_FTR_MMCRA | CPU_FTR_CP_USE_DCBTZ | \
- CPU_FTR_STCX_CHECKS_ADDRESS)
+ CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_PIR)
#define CPU_FTRS_PPC970 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_201 | \
CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA | \
@@ -408,19 +409,19 @@ extern const char *powerpc_base_platform
CPU_FTR_HVMODE)
#define CPU_FTRS_POWER5 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
- CPU_FTR_MMCRA | CPU_FTR_SMT | \
+ CPU_FTR_MMCRA | CPU_FTR_SMT | CPU_FTR_PIR | \
CPU_FTR_COHERENT_ICACHE | CPU_FTR_PURR | \
CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB)
#define CPU_FTRS_POWER6 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
- CPU_FTR_MMCRA | CPU_FTR_SMT | \
+ CPU_FTR_MMCRA | CPU_FTR_SMT | CPU_FTR_PIR | \
CPU_FTR_COHERENT_ICACHE | \
CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
CPU_FTR_DSCR | CPU_FTR_UNALIGNED_LD_STD | \
CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_CFAR)
#define CPU_FTRS_POWER7 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\
- CPU_FTR_MMCRA | CPU_FTR_SMT | \
+ CPU_FTR_MMCRA | CPU_FTR_SMT | CPU_FTR_PIR | \
CPU_FTR_COHERENT_ICACHE | \
CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT | \
Index: linux-3.2-rc1/arch/powerpc/kernel/sysfs.c
===================================================================
--- linux-3.2-rc1.orig/arch/powerpc/kernel/sysfs.c
+++ linux-3.2-rc1/arch/powerpc/kernel/sysfs.c
@@ -177,11 +177,13 @@ SYSFS_PMCSETUP(mmcra, SPRN_MMCRA);
SYSFS_PMCSETUP(purr, SPRN_PURR);
SYSFS_PMCSETUP(spurr, SPRN_SPURR);
SYSFS_PMCSETUP(dscr, SPRN_DSCR);
+SYSFS_PMCSETUP(pir, SPRN_PIR);
static SYSDEV_ATTR(mmcra, 0600, show_mmcra, store_mmcra);
static SYSDEV_ATTR(spurr, 0600, show_spurr, NULL);
static SYSDEV_ATTR(dscr, 0600, show_dscr, store_dscr);
static SYSDEV_ATTR(purr, 0600, show_purr, store_purr);
+static SYSDEV_ATTR(pir, 0400, show_pir, NULL);
unsigned long dscr_default = 0;
EXPORT_SYMBOL(dscr_default);
@@ -392,6 +394,9 @@ static void __cpuinit register_cpu_onlin
if (cpu_has_feature(CPU_FTR_DSCR))
sysdev_create_file(s, &attr_dscr);
+
+ if (cpu_has_feature(CPU_FTR_PIR))
+ sysdev_create_file(s, &attr_pir);
#endif /* CONFIG_PPC64 */
cacheinfo_cpu_online(cpu);
@@ -462,6 +467,9 @@ static void unregister_cpu_online(unsign
if (cpu_has_feature(CPU_FTR_DSCR))
sysdev_remove_file(s, &attr_dscr);
+
+ if (cpu_has_feature(CPU_FTR_PIR))
+ sysdev_remove_file(s, &attr_pir);
#endif /* CONFIG_PPC64 */
cacheinfo_cpu_offline(cpu);
^ permalink raw reply
* [PATCH] powerpc: add hvcall.h include to book3s_hv.c
From: Michael Neuling @ 2011-11-10 6:39 UTC (permalink / raw)
To: Paul Mackerras, benh; +Cc: linuxppc-dev, stable
If you build with KVM and UP it fails with the following due to a
missing include.
/arch/powerpc/kvm/book3s_hv.c: In function 'do_h_register_vpa':
arch/powerpc/kvm/book3s_hv.c:156:10: error: 'H_PARAMETER' undeclared (first use in this function)
arch/powerpc/kvm/book3s_hv.c:156:10: note: each undeclared identifier is reported only once for each function it appears in
arch/powerpc/kvm/book3s_hv.c:192:12: error: 'H_RESOURCE' undeclared (first use in this function)
arch/powerpc/kvm/book3s_hv.c:222:9: error: 'H_SUCCESS' undeclared (first use in this function)
arch/powerpc/kvm/book3s_hv.c: In function 'kvmppc_pseries_do_hcall':
arch/powerpc/kvm/book3s_hv.c:228:30: error: 'H_SUCCESS' undeclared (first use in this function)
arch/powerpc/kvm/book3s_hv.c:232:7: error: 'H_CEDE' undeclared (first use in this function)
arch/powerpc/kvm/book3s_hv.c:234:7: error: 'H_PROD' undeclared (first use in this function)
arch/powerpc/kvm/book3s_hv.c:238:10: error: 'H_PARAMETER' undeclared (first use in this function)
arch/powerpc/kvm/book3s_hv.c:250:7: error: 'H_CONFER' undeclared (first use in this function)
arch/powerpc/kvm/book3s_hv.c:252:7: error: 'H_REGISTER_VPA' undeclared (first use in this function)
make[2]: *** [arch/powerpc/kvm/book3s_hv.o] Error 1
Signed-off-by: Michael Neuling <mikey@neuling.org>
cc: stable@kernel.org (3.1 only)
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 0cdbc07..0cb137a 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -44,6 +44,7 @@
#include <asm/processor.h>
#include <asm/cputhreads.h>
#include <asm/page.h>
+#include <asm/hvcall.h>
#include <linux/gfp.h>
#include <linux/sched.h>
#include <linux/vmalloc.h>
^ permalink raw reply related
* Re: [PATCH v2 1/5] [ppc] Process dynamic relocations for kernel
From: Suzuki Poulose @ 2011-11-10 2:31 UTC (permalink / raw)
To: Josh Poimboeuf
Cc: Nathan Miller, Josh Poimboeuf, Dave Hansen, Paul Mackerras,
Scott Wood, Alan Modra, linuxppc-dev
In-Reply-To: <1320850388.3259.18.camel@treble>
On 11/09/11 20:23, Josh Poimboeuf wrote:
> On Wed, 2011-11-09 at 12:03 +0530, Suzuki Poulose wrote:
>> On Tue, 08 Nov 2011 10:19:05 -0600
>> Josh Poimboeuf<jpoimboe@linux.vnet.ibm.com> wrote:
>>
>>> On Tue, 2011-11-08 at 12:41 +0530, Suzuki Poulose wrote:
>>>> What I was suggesting is, instead of flushing the cache in
>>>> relocate(), lets do it like:
>>>>
>>>> for e.g, on 440x, (in head_44x.S :)
>>>>
>>>> #ifdef CONFIG_RELOCATABLE
>>>> ...
>>>> bl relocate
>>>>
>>>> #Flush the d-cache and invalidate the i-cache here
>>>> #endif
>>>>
>>>>
>>>> This would let the different platforms do the the cache
>>>> invalidation in their own way.
>>>>
>>>> Btw, I didn't find an instruction to flush the entire d-cache in
>>>> PPC440 manual. We have instructions to flush only a block
>>>> corresponding to an address.
>>>>
>>>> However, we have 'iccci' which would invalidate the entire i-cache
>>>> which, which I think is better than 80,000 i-cache invalidates.
>>>
>>> In misc_32.S there are already some platform-independent cache
>>> management functions. If we use those, then relocate() could simply
>>> call them. Then the different platforms calling relocate() wouldn't
>>> have to worry about flushing/invalidating caches.
>>>
>>> For example, there's a clean_dcache_range() function. Given any range
>>> twice the size of the d-cache, it should flush the entire d-cache.
>>> But the only drawback is that it would require the caller to know the
>>> size of the d-cache.
>>>
>>> Instead, I think it would be preferable to create a new clean_dcache()
>>> (or clean_dcache_all()?) function in misc_32.S, which could call
>>> clean_dcache_range() with the appropriate args for flushing the entire
>>> d-cache. relocate() could then call the platform-independent
>>> clean_dcache().
>>>
>>
>>
>> How about using clean_dcache_range() to flush the range runtime
>> address range [ _stext, _end ] ? That would flush the entire
>> instructions.
>
> Wouldn't that result in more cache flushing than the original solution?
>
> For example, my kernel is 3.5MB. Assuming a 32 byte cache line size,
> clean_dcache_range(_stext, _end) would result in about 115,000 dcbst's
> (3.5MB / 32).
Oops ! You are right. We could go back to the clean_dcache_all() or the
initial approach that you suggested. (dcbst).
I am not sure how do we flush the entire dcache(only). Could you post a
patch which does the same ?
Another option is to, change the current mapping to 'Write Through' before
calling the relocate() and revert back to the original setting after relocate().
>
>
>>
>>
>>> For i-cache invalidation there's already the (incorrectly named?)
>>> flush_instruction_cache(). It uses the appropriate platform-specific
>>> methods (e.g. iccci for 44x) to invalidate the entire i-cache.
>>
>> Agreed. The only thing that worries me is the use of KERNELBASE in the
>> flush_instruction_cache() for CONFIG_4xx. Can we safely assume all 4xx
>> implementations ignore the arguments passed to iccci ?
>
> Good question. I don't know the answer. :-)
>
> That also may suggest a bigger can of worms. A grep of the powerpc code
> shows many uses of KERNELBASE. For a relocatable kernel, nobody should
> be relying on KERNELBASE except for the early relocation code. Are we
> sure that all the other usages of KERNELBASE are "safe"?
>
I think we could simply replace the occurrences of KERNELBASE (after the relocate())
with '_stext' which would give the virtual start address of the kernel.
Thanks
Suzuki
^ permalink raw reply
* [RFC PATCH 17/17] powerpc/e500: Finally remove "CONFIG_E500"
From: Kyle Moffett @ 2011-11-10 0:07 UTC (permalink / raw)
To: linuxppc-dev
Cc: Baruch Siach, Sonny Rao, Timur Tabi, linux-kernel, Paul Gortmaker,
Paul Mackerras, Kyle Moffett, Scott Wood, Paul Bolle
In-Reply-To: <4E42AB6F.1050900@freescale.com>
This ambiguous config option is now only present as a Kconfig stub.
Remove it and fix up the users.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
arch/powerpc/platforms/Kconfig.cputype | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 22df19d..d4faa6f 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -32,14 +32,16 @@ config FSL_E200
config FSL_E500_V1_V2
bool "Freescale e500v1/e500v2 (also known as MPC85xx)"
select PHYS_64BIT_SUPPORTED
- select E500
+ select FSL_EMB_PERFMON
+ select PPC_FSL_BOOK3E
select PPC_85xx
config FSL_E500MC
bool "Freescale e500mc (also e5500 in 32-bit mode)"
select PHYS_64BIT_SUPPORTED
select PPC_FPU
- select E500
+ select FSL_EMB_PERFMON
+ select PPC_FSL_BOOK3E
select PPC_85xx
config PPC_8xx
@@ -146,12 +148,8 @@ config PPC_85xx
config FSL_E5500
bool
- select E500
-
-config E500
select FSL_EMB_PERFMON
select PPC_FSL_BOOK3E
- bool
config PPC_FPU
bool
--
1.7.2.5
^ permalink raw reply related
* [RFC PATCH 16/17] powerpc/e500: Make __setup_cpu_{e200, e500, e500mc, e5500} optional
From: Kyle Moffett @ 2011-11-10 0:07 UTC (permalink / raw)
To: linuxppc-dev
Cc: Baruch Siach, Shaohui Xie, Alexandre Bounine, Timur Tabi,
linux-kernel, Paul Gortmaker, Paul Mackerras, Kyle Moffett,
Scott Wood, Andrew Morton
In-Reply-To: <4E42AB6F.1050900@freescale.com>
Only build the setup functions when the corresponding entries are
included in the CPU table.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
arch/powerpc/kernel/cpu_setup_fsl_booke.S | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
index 8053db0..77721b2 100644
--- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S
+++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
@@ -17,6 +17,8 @@
#include <asm/cputable.h>
#include <asm/ppc_asm.h>
+#if defined(CONFIG_FSL_E500_V1_V2) || defined(CONFIG_FSL_E500MC) \
+ || defined(CONFIG_FSL_E5500)
_GLOBAL(__e500_icache_setup)
mfspr r0, SPRN_L1CSR1
andi. r3, r0, L1CSR1_ICE
@@ -50,14 +52,18 @@ _GLOBAL(__e500_dcache_setup)
mtspr SPRN_L1CSR0, r0 /* Enable */
isync
blr
+#endif /* CONFIG_FSL_E500_V1_V2 || CONFIG_FSL_E500MC || CONFIG_FSL_E5500 */
-#ifdef CONFIG_PPC32
+#ifdef CONFIG_FSL_E200
_GLOBAL(__setup_cpu_e200)
/* enable dedicated debug exception handling resources (Debug APU) */
mfspr r3,SPRN_HID0
ori r3,r3,HID0_DAPUEN@l
mtspr SPRN_HID0,r3
b __setup_e200_ivors
+#endif
+
+#ifdef CONFIG_FSL_E500_V1_V2
_GLOBAL(__setup_cpu_e500v1)
_GLOBAL(__setup_cpu_e500v2)
mflr r4
@@ -72,6 +78,9 @@ _GLOBAL(__setup_cpu_e500v2)
#endif
mtlr r4
blr
+#endif
+
+#ifdef CONFIG_FSL_E500MC
_GLOBAL(__setup_cpu_e500mc)
mflr r4
bl __e500_icache_setup
@@ -80,7 +89,9 @@ _GLOBAL(__setup_cpu_e500mc)
mtlr r4
blr
#endif
+
/* Right now, restore and setup are the same thing */
+#ifdef CONFIG_FSL_E5500
_GLOBAL(__restore_cpu_e5500)
_GLOBAL(__setup_cpu_e5500)
mflr r4
@@ -96,3 +107,4 @@ _GLOBAL(__setup_cpu_e5500)
#endif
mtlr r4
blr
+#endif
--
1.7.2.5
^ permalink raw reply related
* [RFC PATCH 15/17] powerpc/e500: Fix up all remaining code uses of CONFIG_E500
From: Kyle Moffett @ 2011-11-10 0:07 UTC (permalink / raw)
To: linuxppc-dev
Cc: kvm-ppc, Alexander Graf, Baruch Siach, kvm, Stephen Rothwell,
Sonny Rao, Marcelo Tosatti, Timur Tabi, linux-kernel,
Steven Rostedt, Paul Gortmaker, Michael Neuling, Paul Mackerras,
Avi Kivity, Kyle Moffett, Scott Wood, Paul Bolle
In-Reply-To: <4E42AB6F.1050900@freescale.com>
The CONFIG_E500 config option is ambiguous and used incorrectly in many
places to refer to some combination of e500v1/v2, e500mc, and e5500.
Fix up each reference to use the correct combinations of the following
config options:
CONFIG_FSL_E500_V1_V2
CONFIG_FSL_E500MC
CONFIG_FSL_E5500
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
arch/powerpc/Kconfig | 2 +-
arch/powerpc/include/asm/reg_booke.h | 17 ++++++++++-------
arch/powerpc/kernel/cputable.c | 8 ++++----
arch/powerpc/kernel/entry_32.S | 8 +++++---
arch/powerpc/kvm/Kconfig | 3 ++-
arch/powerpc/platforms/Kconfig.cputype | 22 ++++++++++------------
6 files changed, 32 insertions(+), 28 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index e3412a1..53c5acf 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -288,7 +288,7 @@ config HUGETLB_PAGE_SIZE_VARIABLE
config MATH_EMULATION
bool "Math emulation"
- depends on 4xx || 8xx || FSL_E200 || PPC_MPC832x || E500
+ depends on 4xx || 8xx || FSL_E200 || PPC_MPC832x || FSL_E500_V1_V2
---help---
Some PowerPC chips designed for embedded applications do not have
a floating-point unit and therefore do not implement the
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h
index 81cd987..845a069 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -206,12 +206,10 @@
#define PPC47x_MCSR_FPR 0x00800000 /* FPR parity error */
#define PPC47x_MCSR_IPR 0x00400000 /* Imprecise Machine Check Exception */
-#ifdef CONFIG_E500
-/* All e500 */
-#define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */
-#define MCSR_ICPERR 0x40000000UL /* I-Cache Parity Error */
-
/* e500v1/v2 */
+#ifdef CONFIG_FSL_E500_V1_V2
+#define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */
+#define MCSR_ICPERR 0x40000000UL /* I-Cache Parity Error */
#define MCSR_DCP_PERR 0x20000000UL /* D-Cache Push Parity Error */
#define MCSR_DCPERR 0x10000000UL /* D-Cache Parity Error */
#define MCSR_BUS_IAERR 0x00000080UL /* Instruction Address Error */
@@ -222,8 +220,12 @@
#define MCSR_BUS_WBERR 0x00000004UL /* Write Data Bus Error */
#define MCSR_BUS_IPERR 0x00000002UL /* Instruction parity Error */
#define MCSR_BUS_RPERR 0x00000001UL /* Read parity Error */
+#endif
-/* e500mc */
+/* e500mc/e5500 */
+#if defined(CONFIG_FSL_E500MC) || defined(CONFIG_FSL_E5500)
+#define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */
+#define MCSR_ICPERR 0x40000000UL /* I-Cache Parity Error */
#define MCSR_DCPERR_MC 0x20000000UL /* D-Cache Parity Error */
#define MCSR_L2MMU_MHIT 0x04000000UL /* Hit on multiple TLB entries */
#define MCSR_NMI 0x00100000UL /* Non-Maskable Interrupt */
@@ -250,7 +252,8 @@
#endif
/* Bit definitions for the HID1 */
-#ifdef CONFIG_E500
+#if defined(CONFIG_FSL_E500_V1_V2) || defined(CONFIG_FSL_E500MC) \
+ || defined(CONFIG_FSL_E5500)
/* e500v1/v2 */
#define HID1_PLL_CFG_MASK 0xfc000000 /* PLL_CFG input pins */
#define HID1_RFXE 0x00020000 /* Read fault exception enable */
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index a6f2544..3fd01ca 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -69,10 +69,10 @@ extern void __setup_cpu_power7(unsigned long offset, struct cpu_spec* spec);
extern void __restore_cpu_power7(void);
extern void __restore_cpu_a2(void);
#endif /* CONFIG_PPC64 */
-#if defined(CONFIG_E500)
+#ifdef CONFIG_FSL_E5500
extern void __setup_cpu_e5500(unsigned long offset, struct cpu_spec* spec);
extern void __restore_cpu_e5500(void);
-#endif /* CONFIG_E500 */
+#endif /* CONFIG_FSL_E5500 */
/* This table only contains "desktop" CPUs, it need to be filled with embedded
* ones as well...
@@ -1975,7 +1975,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
.platform = "ppce500mc",
},
#endif /* CONFIG_FSL_E500MC */
-#ifdef CONFIG_E500 /* FIXME */
+#ifdef CONFIG_FSL_E5500
{ /* e5500 */
.pvr_mask = 0xffff0000,
.pvr_value = 0x80240000,
@@ -1994,7 +1994,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
.machine_check = machine_check_e500mc,
.platform = "ppce5500",
},
-#endif /* CONFIG_E500 */
+#endif /* CONFIG_FSL_E5500 */
#ifdef CONFIG_PPC_A2
{ /* Standard A2 (>= DD2) + FPU core */
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 56212bc..373cdc4 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -178,14 +178,15 @@ transfer_to_handler:
cmplw r1,r9 /* if r1 <= ksp_limit */
ble- stack_ovf /* then the kernel stack overflowed */
5:
-#if defined(CONFIG_6xx) || defined(CONFIG_E500)
+#if defined(CONFIG_6xx) || defined(CONFIG_FSL_E500_V1_V2) \
+ || defined(CONFIG_FSL_E500MC)
rlwinm r9,r1,0,0,31-THREAD_SHIFT
tophys(r9,r9) /* check local flags */
lwz r12,TI_LOCAL_FLAGS(r9)
mtcrf 0x01,r12
bt- 31-TLF_NAPPING,4f
bt- 31-TLF_SLEEPING,7f
-#endif /* CONFIG_6xx || CONFIG_E500 */
+#endif
.globl transfer_to_handler_cont
transfer_to_handler_cont:
3:
@@ -236,7 +237,8 @@ reenable_mmu: /* re-enable mmu so we can */
RFI /* jump to handler, enable MMU */
#endif /* CONFIG_TRACE_IRQFLAGS */
-#if defined (CONFIG_6xx) || defined(CONFIG_E500)
+#if defined (CONFIG_6xx) || defined(CONFIG_FSL_E500_V1_V2) \
+ || defined(CONFIG_FSL_E500MC)
4: rlwinm r12,r12,0,~_TLF_NAPPING
stw r12,TI_LOCAL_FLAGS(r9)
b power_save_ppc32_restore
diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig
index 78133de..3f608bf 100644
--- a/arch/powerpc/kvm/Kconfig
+++ b/arch/powerpc/kvm/Kconfig
@@ -116,7 +116,8 @@ config KVM_EXIT_TIMING
config KVM_E500
bool "KVM support for PowerPC E500 processors"
- depends on EXPERIMENTAL && E500
+ depends on EXPERIMENTAL
+ depends on FSL_E500_V1_V2 || FSL_E500MC || FSL_E5500
select KVM
select KVM_MMIO
---help---
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index cff45e3..22df19d 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -159,7 +159,7 @@ config PPC_FPU
config FSL_EMB_PERFMON
bool "Freescale Embedded Perfmon"
- depends on E500 || PPC_83xx
+ depends on PPC_83xx || FSL_E500_V1_V2 || FSL_E500MC || FSL_E5500
help
This is the Performance Monitor support found on the e500 core
and some e300 cores (c3 and c4). Select this only if your
@@ -171,25 +171,23 @@ config FSL_EMB_PERF_EVENT
default y
config FSL_EMB_PERF_EVENT_E500
- bool
- depends on FSL_EMB_PERF_EVENT && E500
- default y
+ def_bool y
+ depends on FSL_EMB_PERF_EVENT
+ depends on FSL_E500_V1_V2 || FSL_E500MC || FSL_E5500
config 4xx
bool
depends on 40x || 44x
default y
-config BOOKE
- bool
- depends on FSL_E200 || E500 || 44x || PPC_BOOK3E
- default y
-
config FSL_BOOKE
- bool
- depends on FSL_E200 || (E500 && PPC32)
+ def_bool y
+ depends on FSL_E200 || FSL_E500_V1_V2 || FSL_E500MC
select SYS_SUPPORTS_HUGETLBFS if PHYS_64BIT
- default y
+
+config BOOKE
+ def_bool y
+ depends on FSL_BOOKE || 44x || PPC_BOOK3E
config FSL_CORENET
bool
--
1.7.2.5
^ permalink raw reply related
* [RFC PATCH 14/17] powerpc/e500: Don't make kgdb use e500v1/e500v2 registers on e500mc
From: Kyle Moffett @ 2011-11-10 0:07 UTC (permalink / raw)
To: linuxppc-dev
Cc: Baruch Siach, Timur Tabi, linux-kernel, Paul Gortmaker,
Paul Mackerras, Kyle Moffett, Scott Wood
In-Reply-To: <4E42AB6F.1050900@freescale.com>
The only systems which need the sparse PowerPC register map are the
e500v1/e500v2.
NOTE: The kgdb code does not otherwise use CONFIG_E500, so this support
is probably still buggy on e500v1/e500v2, but I don't know kgdb enough
to fix it.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
arch/powerpc/include/asm/kgdb.h | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/include/asm/kgdb.h b/arch/powerpc/include/asm/kgdb.h
index 9db24e7..4dea066 100644
--- a/arch/powerpc/include/asm/kgdb.h
+++ b/arch/powerpc/include/asm/kgdb.h
@@ -46,14 +46,17 @@ static inline void arch_kgdb_breakpoint(void)
#define NUMREGBYTES ((68 * 8) + (3 * 4))
#define NUMCRITREGBYTES 184
#else /* CONFIG_PPC32 */
-/* On non-E500 family PPC32 we determine the size by picking the last
- * register we need, but on E500 we skip sections so we list what we
- * need to store, and add it up. */
-#ifndef CONFIG_E500
-#define MAXREG (PT_FPSCR+1)
-#else
+/*
+ * On FreeScale e500v1 or e500v2 processors we need to skip some register
+ * sections, so just add up a list of what we need to store.
+ *
+ * On all other 32-bit PowerPC we can just pick the last needed register.
+ */
+#ifdef CONFIG_FSL_E500_V1_V2
/* 32 GPRs (8 bytes), nip, msr, ccr, link, ctr, xer, acc (8 bytes), spefscr*/
-#define MAXREG ((32*2)+6+2+1)
+#define MAXREG ((32*2)+6+2+1)
+#else
+#define MAXREG (PT_FPSCR+1)
#endif
#define NUMREGBYTES (MAXREG * sizeof(int))
/* CR/LR, R1, R2, R13-R31 inclusive. */
--
1.7.2.5
^ permalink raw reply related
* [RFC PATCH 13/17] powerpc/e500: Add a new CONFIG_FSL_E5500 option for the e5500
From: Kyle Moffett @ 2011-11-10 0:07 UTC (permalink / raw)
To: linuxppc-dev
Cc: Baruch Siach, Sonny Rao, Timur Tabi, linux-kernel, Paul Gortmaker,
Paul Mackerras, Kyle Moffett, Scott Wood, Paul Bolle
In-Reply-To: <4E42AB6F.1050900@freescale.com>
As part of splitting CONFIG_E500 into separate options for e500v1/v2 and
e500mc/e5500, some code only needs to be built when e5500 support is
required.
This adds a new internal-use config option for both 32-bit and 64-bit
builds that enables only the e5500 support code.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
arch/powerpc/platforms/85xx/Kconfig | 2 +-
arch/powerpc/platforms/Kconfig.cputype | 4 ++++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 248f87c..72488d4 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -231,8 +231,8 @@ endif # PPC32
config P5020_DS
bool "Freescale P5020 DS"
depends on FSL_E500MC || PPC_BOOK3E_64
+ select FSL_E5500
select DEFAULT_UIMAGE
- select E500
select PHYS_64BIT_DT_REQUIRED
select SWIOTLB
select ARCH_REQUIRE_GPIOLIB
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index fd37bb2..cff45e3 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -144,6 +144,10 @@ config 8xx
config PPC_85xx
bool
+config FSL_E5500
+ bool
+ select E500
+
config E500
select FSL_EMB_PERFMON
select PPC_FSL_BOOK3E
--
1.7.2.5
^ permalink raw reply related
* [RFC PATCH 12/17] powerpc/e500: Separate e500mc CPU table entries from e500v1/e500v2
From: Kyle Moffett @ 2011-11-10 0:07 UTC (permalink / raw)
To: linuxppc-dev
Cc: Baruch Siach, Timur Tabi, linux-kernel, Paul Gortmaker,
Michael Neuling, Paul Mackerras, Anton Blanchard, Kyle Moffett,
Scott Wood
In-Reply-To: <4E42AB6F.1050900@freescale.com>
The e500mc CPUs have a classic FPU and are not compatible with e500v1 or
e500v2. This patch fixes the 32-bit CPU feature tables so that e500mc
entries are not present on e500v1/e500v2 systems and vice versa.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
arch/powerpc/include/asm/cputable.h | 16 ++++++++++------
arch/powerpc/kernel/cputable.c | 8 +++++---
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index b69f255..c7c2582 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -480,9 +480,11 @@ enum {
#ifdef CONFIG_E200
CPU_FTRS_E200 |
#endif
-#ifdef CONFIG_E500
- CPU_FTRS_E500 | CPU_FTRS_E500_2 | CPU_FTRS_E500MC |
- CPU_FTRS_E5500 |
+#ifdef CONFIG_FSL_E500_V1_V2
+ CPU_FTRS_E500 | CPU_FTRS_E500_2 |
+#endif
+#ifdef CONFIG_FSL_E500MC
+ CPU_FTRS_E500MC | CPU_FTRS_E5500 |
#endif
0,
};
@@ -525,9 +527,11 @@ enum {
#ifdef CONFIG_FSL_E200
CPU_FTRS_E200 &
#endif
-#ifdef CONFIG_E500
- CPU_FTRS_E500 & CPU_FTRS_E500_2 & CPU_FTRS_E500MC &
- CPU_FTRS_E5500 &
+#ifdef CONFIG_FSL_E500_V1_V2
+ CPU_FTRS_E500 & CPU_FTRS_E500_2 &
+#endif
+#ifdef CONFIG_FSL_E500MC
+ CPU_FTRS_E500MC & CPU_FTRS_E5500 &
#endif
CPU_FTRS_POSSIBLE,
};
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index e5b142c..a6f2544 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1917,8 +1917,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
}
#endif /* CONFIG_FSL_E200 */
#endif /* CONFIG_PPC32 */
-#ifdef CONFIG_E500
-#ifdef CONFIG_PPC32
+#ifdef CONFIG_FSL_E500_V1_V2
{ /* e500 */
.pvr_mask = 0xffff0000,
.pvr_value = 0x80200000,
@@ -1956,6 +1955,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
.machine_check = machine_check_e500,
.platform = "ppc8548",
},
+#endif /* CONFIG_FSL_E500_V1_V2 */
+#ifdef CONFIG_FSL_E500MC
{ /* e500mc */
.pvr_mask = 0xffff0000,
.pvr_value = 0x80230000,
@@ -1973,7 +1974,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
.machine_check = machine_check_e500mc,
.platform = "ppce500mc",
},
-#endif /* CONFIG_PPC32 */
+#endif /* CONFIG_FSL_E500MC */
+#ifdef CONFIG_E500 /* FIXME */
{ /* e5500 */
.pvr_mask = 0xffff0000,
.pvr_value = 0x80240000,
--
1.7.2.5
^ permalink raw reply related
* [RFC PATCH 11/17] powerpc/e500: Use the correct assembler flags for e500mc and e5500
From: Kyle Moffett @ 2011-11-10 0:07 UTC (permalink / raw)
To: linuxppc-dev
Cc: Baruch Siach, Timur Tabi, linux-kernel, Paul Gortmaker,
Paul Mackerras, Kyle Moffett, Scott Wood
In-Reply-To: <4E42AB6F.1050900@freescale.com>
The "-me500" assembler option is intended only for use on e500v1 or
e500v2 systems. On modern binutils it will refuse to assemble standard
floating point opcodes, and it will translate "lwsync" into "sync".
This fixes the e500mc/e5500 kernel build on recent binutils.
For e500mc/e5500 with standard PowerPC floating point, the assembler
options "-me500mc" or "-me500mc64" should be used, although they are not
strictly necessary depending on which opcodes are in use.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
arch/powerpc/Makefile | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index c17bc29..bd443ee2 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -133,7 +133,8 @@ endif
cpu-as-$(CONFIG_4xx) += -Wa,-m405
cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
-cpu-as-$(CONFIG_E500) += -Wa,-me500
+cpu-as-$(CONFIG_FSL_E500_V1_V2) += -Wa,-me500
+cpu-as-$(CONFIG_FSL_E500MC) += -Wa,-me500mc
cpu-as-$(CONFIG_FSL_E200) += -Wa,-me200
KBUILD_AFLAGS += $(cpu-as-y)
--
1.7.2.5
^ permalink raw reply related
* [RFC PATCH 10/17] powerpc/e500: Fix up the last references to CONFIG_PPC_E500MC
From: Kyle Moffett @ 2011-11-10 0:07 UTC (permalink / raw)
To: linuxppc-dev
Cc: Baruch Siach, Sonny Rao, Timur Tabi, linux-kernel, Paul Gortmaker,
Paul Mackerras, Kyle Moffett, Scott Wood, Paul Bolle
In-Reply-To: <4E42AB6F.1050900@freescale.com>
This moves the "select PPC_FPU" from PPC_E500MC to the new FSL_E500MC
processor selection, where it belongs.
The only actual difference that this patch introduces is the P5020DS
board (FreeScale e5500 CPU) will not set FSL_E500MC when building in
64-bit mode.
This is OK as all of the existing code that the 64-bit P5020DS needs is
still conditional on CONFIG_E500 or CONFIG_PPC_FPU, which are both set
properly on the P5020DS (PPC_FPU is always enabled on 64-bit).
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
arch/powerpc/include/asm/cache.h | 2 +-
arch/powerpc/platforms/85xx/Kconfig | 10 +++++-----
arch/powerpc/platforms/Kconfig.cputype | 8 ++------
3 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h
index 4b50941..10988a2 100644
--- a/arch/powerpc/include/asm/cache.h
+++ b/arch/powerpc/include/asm/cache.h
@@ -8,7 +8,7 @@
#if defined(CONFIG_8xx) || defined(CONFIG_403GCX)
#define L1_CACHE_SHIFT 4
#define MAX_COPY_PREFETCH 1
-#elif defined(CONFIG_PPC_E500MC)
+#elif defined(CONFIG_FSL_E500MC)
#define L1_CACHE_SHIFT 6
#define MAX_COPY_PREFETCH 4
#elif defined(CONFIG_PPC32)
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 37f9de7..248f87c 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -173,8 +173,8 @@ config SBC8560
config P2041_RDB
bool "Freescale P2041 RDB"
+ depends on FSL_E500MC
select DEFAULT_UIMAGE
- select PPC_E500MC
select PHYS_64BIT_DT_REQUIRED
select SWIOTLB
select ARCH_REQUIRE_GPIOLIB
@@ -187,8 +187,8 @@ config P2041_RDB
config P3041_DS
bool "Freescale P3041 DS"
+ depends on FSL_E500MC
select DEFAULT_UIMAGE
- select PPC_E500MC
select PHYS_64BIT_DT_REQUIRED
select SWIOTLB
select ARCH_REQUIRE_GPIOLIB
@@ -201,8 +201,8 @@ config P3041_DS
config P3060_QDS
bool "Freescale P3060 QDS"
+ depends on FSL_E500MC
select DEFAULT_UIMAGE
- select PPC_E500MC
select PHYS_64BIT_DT_REQUIRED
select SWIOTLB
select MPC8xxx_GPIO
@@ -214,8 +214,8 @@ config P3060_QDS
config P4080_DS
bool "Freescale P4080 DS"
+ depends on FSL_E500MC
select DEFAULT_UIMAGE
- select PPC_E500MC
select PHYS_64BIT_DT_REQUIRED
select SWIOTLB
select ARCH_REQUIRE_GPIOLIB
@@ -230,9 +230,9 @@ endif # PPC32
config P5020_DS
bool "Freescale P5020 DS"
+ depends on FSL_E500MC || PPC_BOOK3E_64
select DEFAULT_UIMAGE
select E500
- select PPC_E500MC
select PHYS_64BIT_DT_REQUIRED
select SWIOTLB
select ARCH_REQUIRE_GPIOLIB
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 9770564..fd37bb2 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -38,6 +38,7 @@ config FSL_E500_V1_V2
config FSL_E500MC
bool "Freescale e500mc (also e5500 in 32-bit mode)"
select PHYS_64BIT_SUPPORTED
+ select PPC_FPU
select E500
select PPC_85xx
@@ -148,11 +149,6 @@ config E500
select PPC_FSL_BOOK3E
bool
-config PPC_E500MC
- bool "e500mc Support"
- select PPC_FPU
- depends on E500
-
config PPC_FPU
bool
default y if PPC64
@@ -280,7 +276,7 @@ config PPC_ICSWX
config SPE
bool "SPE Support"
- depends on FSL_E200 || (E500 && !PPC_E500MC)
+ depends on FSL_E200 || FSL_E500_V1_V2
default y
---help---
This option enables kernel support for the Signal Processing
--
1.7.2.5
^ permalink raw reply related
* [RFC PATCH 09/17] powerpc/e500: Split idle handlers for e500v1/v2 and e500mc
From: Kyle Moffett @ 2011-11-10 0:07 UTC (permalink / raw)
To: linuxppc-dev
Cc: Bharat Bhushan, Baruch Siach, Andrew Gabbasov, Dave Kleikamp,
Justin P. Mattock, Sonny Rao, Timur Tabi, linux-kernel,
Milton Miller, Michael Ellerman, Paul Gortmaker, Paul Mackerras,
Anton Blanchard, Kyle Moffett, Scott Wood, Josh Boyer, Vakul Garg,
Ian Munsie
In-Reply-To: <4E42AB6F.1050900@freescale.com>
These are totally different (more so in fact than 6xx vs. e500v1/v2), so
there isn't really a good reason to keep them in the same file.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
arch/powerpc/include/asm/machdep.h | 1 +
arch/powerpc/kernel/Makefile | 3 +-
arch/powerpc/kernel/idle_e500.S | 12 -------
arch/powerpc/kernel/idle_e500mc.S | 56 +++++++++++++++++++++++++++++++
arch/powerpc/kernel/setup_32.c | 2 +-
arch/powerpc/platforms/85xx/p2041_rdb.c | 2 +-
arch/powerpc/platforms/85xx/p3041_ds.c | 2 +-
arch/powerpc/platforms/85xx/p3060_qds.c | 2 +-
arch/powerpc/platforms/85xx/p4080_ds.c | 2 +-
arch/powerpc/platforms/85xx/p5020_ds.c | 2 +-
10 files changed, 65 insertions(+), 19 deletions(-)
create mode 100644 arch/powerpc/kernel/idle_e500mc.S
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index b540d6f..995a2ec 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -253,6 +253,7 @@ struct machdep_calls {
};
extern void e500_idle(void);
+extern void e500mc_idle(void);
extern void power4_idle(void);
extern void power7_idle(void);
extern void ppc6xx_idle(void);
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index ce4f7f1..8627dda 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -61,7 +61,8 @@ obj-$(CONFIG_IBMEBUS) += ibmebus.o
obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
ifeq ($(CONFIG_PPC32),y)
-obj-$(CONFIG_E500) += idle_e500.o
+obj-$(CONFIG_FSL_E500_V1_V2) += idle_e500.o
+obj-$(CONFIG_FSL_E500MC) += idle_e500mc.o
endif
obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
obj-$(CONFIG_TAU) += tau_6xx.o
diff --git a/arch/powerpc/kernel/idle_e500.S b/arch/powerpc/kernel/idle_e500.S
index 4f0ab85..47a1a98 100644
--- a/arch/powerpc/kernel/idle_e500.S
+++ b/arch/powerpc/kernel/idle_e500.S
@@ -26,17 +26,6 @@ _GLOBAL(e500_idle)
ori r4,r4,_TLF_NAPPING /* so when we take an exception */
stw r4,TI_LOCAL_FLAGS(r3) /* it will return to our caller */
-#ifdef CONFIG_PPC_E500MC
- wrteei 1
-1: wait
-
- /*
- * Guard against spurious wakeups (e.g. from a hypervisor) --
- * any real interrupt will cause us to return to LR due to
- * _TLF_NAPPING.
- */
- b 1b
-#else
/* Check if we can nap or doze, put HID0 mask in r3 */
lis r3,0
BEGIN_FTR_SECTION
@@ -83,7 +72,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_L2CSR|CPU_FTR_CAN_NAP)
mtmsr r7
isync
2: b 2b
-#endif /* !E500MC */
/*
* Return from NAP/DOZE mode, restore some CPU specific registers,
diff --git a/arch/powerpc/kernel/idle_e500mc.S b/arch/powerpc/kernel/idle_e500mc.S
new file mode 100644
index 0000000..4806942
--- /dev/null
+++ b/arch/powerpc/kernel/idle_e500mc.S
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved.
+ * Dave Liu <daveliu@freescale.com>
+ * copy from idle_6xx.S and modify for e500 based processor,
+ * implement the power_save function in idle.
+ *
+ * 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.
+ */
+
+#include <linux/threads.h>
+#include <asm/reg.h>
+#include <asm/page.h>
+#include <asm/cputable.h>
+#include <asm/thread_info.h>
+#include <asm/ppc_asm.h>
+#include <asm/asm-offsets.h>
+
+ .text
+
+_GLOBAL(e500mc_idle)
+ rlwinm r3,r1,0,0,31-THREAD_SHIFT /* current thread_info */
+ lwz r4,TI_LOCAL_FLAGS(r3) /* set napping bit */
+ ori r4,r4,_TLF_NAPPING /* so when we take an exception */
+ stw r4,TI_LOCAL_FLAGS(r3) /* it will return to our caller */
+ wrteei 1
+1: wait
+
+ /*
+ * Guard against spurious wakeups (e.g. from a hypervisor) --
+ * any real interrupt will cause us to return to LR due to
+ * _TLF_NAPPING.
+ */
+ b 1b
+
+/*
+ * Return from NAP/DOZE mode, restore some CPU specific registers,
+ * r2 containing physical address of current.
+ * r11 points to the exception frame (physical address).
+ * We have to preserve r10.
+ */
+_GLOBAL(power_save_ppc32_restore)
+ lwz r9,_LINK(r11) /* interrupted in e500mc_idle */
+ stw r9,_NIP(r11) /* make it do a blr */
+
+#ifdef CONFIG_SMP
+ rlwinm r12,r1,0,0,31-THREAD_SHIFT
+ lwz r11,TI_CPU(r12) /* get cpu number * 4 */
+ slwi r11,r11,2
+#else
+ li r11,0
+#endif
+
+ b transfer_to_handler_cont
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index c1ce863..b14aabd 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -139,7 +139,7 @@ notrace void __init machine_init(u64 dt_ptr)
ppc_md.power_save = ppc6xx_idle;
#endif
-#ifdef CONFIG_E500
+#ifdef CONFIG_FSL_E500_V1_V2
if (cpu_has_feature(CPU_FTR_CAN_DOZE) ||
cpu_has_feature(CPU_FTR_CAN_NAP))
ppc_md.power_save = e500_idle;
diff --git a/arch/powerpc/platforms/85xx/p2041_rdb.c b/arch/powerpc/platforms/85xx/p2041_rdb.c
index eda6ed5..43ca79d 100644
--- a/arch/powerpc/platforms/85xx/p2041_rdb.c
+++ b/arch/powerpc/platforms/85xx/p2041_rdb.c
@@ -78,7 +78,7 @@ define_machine(p2041_rdb) {
.restart = fsl_rstcr_restart,
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
- .power_save = e500_idle,
+ .power_save = e500mc_idle,
};
machine_device_initcall(p2041_rdb, corenet_ds_publish_devices);
diff --git a/arch/powerpc/platforms/85xx/p3041_ds.c b/arch/powerpc/platforms/85xx/p3041_ds.c
index 96d99a3..4abf6ef 100644
--- a/arch/powerpc/platforms/85xx/p3041_ds.c
+++ b/arch/powerpc/platforms/85xx/p3041_ds.c
@@ -80,7 +80,7 @@ define_machine(p3041_ds) {
.restart = fsl_rstcr_restart,
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
- .power_save = e500_idle,
+ .power_save = e500mc_idle,
};
machine_device_initcall(p3041_ds, corenet_ds_publish_devices);
diff --git a/arch/powerpc/platforms/85xx/p3060_qds.c b/arch/powerpc/platforms/85xx/p3060_qds.c
index 01dcf44..6f66776 100644
--- a/arch/powerpc/platforms/85xx/p3060_qds.c
+++ b/arch/powerpc/platforms/85xx/p3060_qds.c
@@ -67,7 +67,7 @@ define_machine(p3060_qds) {
.restart = fsl_rstcr_restart,
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
- .power_save = e500_idle,
+ .power_save = e500mc_idle,
};
machine_device_initcall(p3060_qds, declare_of_platform_devices);
diff --git a/arch/powerpc/platforms/85xx/p4080_ds.c b/arch/powerpc/platforms/85xx/p4080_ds.c
index d1b21d7..3589961 100644
--- a/arch/powerpc/platforms/85xx/p4080_ds.c
+++ b/arch/powerpc/platforms/85xx/p4080_ds.c
@@ -79,7 +79,7 @@ define_machine(p4080_ds) {
.restart = fsl_rstcr_restart,
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
- .power_save = e500_idle,
+ .power_save = e500mc_idle,
};
machine_device_initcall(p4080_ds, corenet_ds_publish_devices);
diff --git a/arch/powerpc/platforms/85xx/p5020_ds.c b/arch/powerpc/platforms/85xx/p5020_ds.c
index e8cba50..2e38748 100644
--- a/arch/powerpc/platforms/85xx/p5020_ds.c
+++ b/arch/powerpc/platforms/85xx/p5020_ds.c
@@ -88,7 +88,7 @@ define_machine(p5020_ds) {
#ifdef CONFIG_PPC64
.power_save = book3e_idle,
#else
- .power_save = e500_idle,
+ .power_save = e500mc_idle,
#endif
};
--
1.7.2.5
^ permalink raw reply related
* [RFC PATCH 08/17] powerpc/e500: Remove conditional "lwsync" substitution
From: Kyle Moffett @ 2011-11-10 0:07 UTC (permalink / raw)
To: linuxppc-dev
Cc: Baruch Siach, Timur Tabi, linux-kernel, Paul Gortmaker,
Paul Mackerras, Kyle Moffett, Scott Wood
In-Reply-To: <4E42AB6F.1050900@freescale.com>
As FreeScale e500 systems have different cacheline sizes from e500mc, it
is basically impossible for the kernel to support both in a single
system image at present.
Given that one is SPE-float and the other is classic-float, they are not
generally userspace-compatible either.
This patch updates the conditional to depend on whether the system is
actually targetting an "e500" or "e500mc" core and entirely removes the
unused sync-to-lwsync-replacement on e500v1/e500v2 systems.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
arch/powerpc/include/asm/synch.h | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/arch/powerpc/include/asm/synch.h b/arch/powerpc/include/asm/synch.h
index d7cab44..3d518b6 100644
--- a/arch/powerpc/include/asm/synch.h
+++ b/arch/powerpc/include/asm/synch.h
@@ -5,8 +5,11 @@
#include <linux/stringify.h>
#include <asm/feature-fixups.h>
-#if defined(__powerpc64__) || defined(CONFIG_PPC_E500MC)
+#if defined(__powerpc64__) || defined(CONFIG_FSL_E500MC)
#define __SUBARCH_HAS_LWSYNC
+#define LWSYNC lwsync
+#else
+#define LWSYNC sync
#endif
#ifndef __ASSEMBLY__
@@ -25,17 +28,6 @@ static inline void isync(void)
}
#endif /* __ASSEMBLY__ */
-#if defined(__powerpc64__)
-# define LWSYNC lwsync
-#elif defined(CONFIG_E500)
-# define LWSYNC \
- START_LWSYNC_SECTION(96); \
- sync; \
- MAKE_LWSYNC_SECTION_ENTRY(96, __lwsync_fixup);
-#else
-# define LWSYNC sync
-#endif
-
#ifdef CONFIG_SMP
#define __PPC_ACQUIRE_BARRIER \
START_LWSYNC_SECTION(97); \
--
1.7.2.5
^ permalink raw reply related
* [RFC PATCH 07/17] powerpc/e200: Rename CONFIG_E200 => CONFIG_FSL_E200
From: Kyle Moffett @ 2011-11-10 0:07 UTC (permalink / raw)
To: linuxppc-dev
Cc: Alexander Graf, Baruch Siach, Lucas De Marchi, Timur Tabi,
linux-kernel, Paul Gortmaker, Michael Neuling, Paul Mackerras,
Anton Blanchard, Kyle Moffett, Scott Wood, Paul Bolle, Sonny Rao,
David Gibson
In-Reply-To: <4E42AB6F.1050900@freescale.com>
Match the config symbols for FreeScale e500/e5500 chips by using "FSL"
in the name of the config symbol.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
arch/powerpc/Kconfig | 2 +-
arch/powerpc/Makefile | 2 +-
arch/powerpc/include/asm/cputable.h | 2 +-
arch/powerpc/include/asm/reg.h | 2 +-
arch/powerpc/include/asm/reg_booke.h | 2 +-
arch/powerpc/kernel/cputable.c | 4 ++--
arch/powerpc/kernel/head_fsl_booke.S | 10 +++++-----
arch/powerpc/kernel/traps.c | 2 +-
arch/powerpc/platforms/Kconfig.cputype | 12 ++++--------
9 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 27e31c5..e3412a1 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -288,7 +288,7 @@ config HUGETLB_PAGE_SIZE_VARIABLE
config MATH_EMULATION
bool "Math emulation"
- depends on 4xx || 8xx || E200 || PPC_MPC832x || E500
+ depends on 4xx || 8xx || FSL_E200 || PPC_MPC832x || E500
---help---
Some PowerPC chips designed for embedded applications do not have
a floating-point unit and therefore do not implement the
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 57af16e..c17bc29 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -134,7 +134,7 @@ cpu-as-$(CONFIG_4xx) += -Wa,-m405
cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
cpu-as-$(CONFIG_E500) += -Wa,-me500
-cpu-as-$(CONFIG_E200) += -Wa,-me200
+cpu-as-$(CONFIG_FSL_E200) += -Wa,-me200
KBUILD_AFLAGS += $(cpu-as-y)
KBUILD_CFLAGS += $(cpu-as-y)
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index e30442c..b69f255 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -522,7 +522,7 @@ enum {
#ifdef CONFIG_44x
CPU_FTRS_44X & CPU_FTRS_440x6 &
#endif
-#ifdef CONFIG_E200
+#ifdef CONFIG_FSL_E200
CPU_FTRS_E200 &
#endif
#ifdef CONFIG_E500
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 559da19..f5b4f457 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -893,7 +893,7 @@
#define SPRN_SPRG_WSCRATCH_MC SPRN_SPRG1
#define SPRN_SPRG_RSCRATCH4 SPRN_SPRG7R
#define SPRN_SPRG_WSCRATCH4 SPRN_SPRG7W
-#ifdef CONFIG_E200
+#ifdef CONFIG_FSL_E200
#define SPRN_SPRG_RSCRATCH_DBG SPRN_SPRG6R
#define SPRN_SPRG_WSCRATCH_DBG SPRN_SPRG6W
#else
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h
index 28cdbd9..81cd987 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -237,7 +237,7 @@
#define MCSR_BSL2_ERR 0x00000001UL /* Backside L2 cache error */
#endif
-#ifdef CONFIG_E200
+#ifdef CONFIG_FSL_E200
#define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */
#define MCSR_CP_PERR 0x20000000UL /* Cache Push Parity Error */
#define MCSR_CPERR 0x10000000UL /* Cache Parity Error */
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index e35f4fb..e5b142c 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1871,7 +1871,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
.platform = "ppc440",
}
#endif /* CONFIG_44x */
-#ifdef CONFIG_E200
+#ifdef CONFIG_FSL_E200
{ /* e200z5 */
.pvr_mask = 0xfff00000,
.pvr_value = 0x81000000,
@@ -1915,7 +1915,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
.machine_check = machine_check_e200,
.platform = "ppc5554",
}
-#endif /* CONFIG_E200 */
+#endif /* CONFIG_FSL_E200 */
#endif /* CONFIG_PPC32 */
#ifdef CONFIG_E500
#ifdef CONFIG_PPC32
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 9f5d210..134b2b8 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -137,7 +137,7 @@ _ENTRY(__early_start)
/* Setup the defaults for TLB entries */
li r2,(MAS4_TSIZED(BOOK3E_PAGESZ_4K))@l
-#ifdef CONFIG_E200
+#ifdef CONFIG_FSL_E200
oris r2,r2,MAS4_TLBSELD(1)@h
#endif
mtspr SPRN_MAS4, r2
@@ -304,7 +304,7 @@ interrupt_base:
CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
/* Machine Check Interrupt */
-#ifdef CONFIG_E200
+#ifdef CONFIG_FSL_E200
/* no RFMCI, MCSRRs on E200 */
CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
#else
@@ -340,7 +340,7 @@ interrupt_base:
#ifdef CONFIG_PPC_FPU
FP_UNAVAILABLE_EXCEPTION
#else
-#ifdef CONFIG_E200
+#ifdef CONFIG_FSL_E200
/* E200 treats 'normal' floating point instructions as FP Unavail exception */
EXCEPTION(0x0800, FloatingPointUnavailable, program_check_exception, EXC_XFER_EE)
#else
@@ -694,7 +694,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS)
#endif
3: mtspr SPRN_MAS2, r12
-#ifdef CONFIG_E200
+#ifdef CONFIG_FSL_E200
/* Round robin TLB1 entries assignment */
mfspr r12, SPRN_MAS0
@@ -717,7 +717,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS)
rlwimi r12, r13, 0, 20, 31
7:
mtspr SPRN_MAS0,r12
-#endif /* CONFIG_E200 */
+#endif /* CONFIG_FSL_E200 */
tlb_write_entry:
tlbwe
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index e3113341..81b6afd 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -560,7 +560,7 @@ int machine_check_e500(struct pt_regs *regs)
return 0;
}
#endif
-#ifdef CONFIG_E200
+#ifdef CONFIG_FSL_E200
int machine_check_e200(struct pt_regs *regs)
{
unsigned long reason = get_mc_reason(regs);
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 1108586..9770564 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -28,7 +28,6 @@ config PPC_BOOK3S_32
config FSL_E200
bool "Freescale e200 (also known as MPC5xx/MPC55xx)"
- select E200
config FSL_E500_V1_V2
bool "Freescale e500v1/e500v2 (also known as MPC85xx)"
@@ -141,9 +140,6 @@ config TUNE_CELL
config 8xx
bool
-config E200
- bool
-
config PPC_85xx
bool
@@ -186,12 +182,12 @@ config 4xx
config BOOKE
bool
- depends on E200 || E500 || 44x || PPC_BOOK3E
+ depends on FSL_E200 || E500 || 44x || PPC_BOOK3E
default y
config FSL_BOOKE
bool
- depends on (E200 || E500) && PPC32
+ depends on FSL_E200 || (E500 && PPC32)
select SYS_SUPPORTS_HUGETLBFS if PHYS_64BIT
default y
@@ -284,7 +280,7 @@ config PPC_ICSWX
config SPE
bool "SPE Support"
- depends on E200 || (E500 && !PPC_E500MC)
+ depends on FSL_E200 || (E500 && !PPC_E500MC)
default y
---help---
This option enables kernel support for the Signal Processing
@@ -375,7 +371,7 @@ config NR_CPUS
config NOT_COHERENT_CACHE
bool
- depends on 4xx || 8xx || E200 || PPC_MPC512x || GAMECUBE_COMMON
+ depends on 4xx || 8xx || FSL_E200 || PPC_MPC512x || GAMECUBE_COMMON
default n if PPC_47x
default y
--
1.7.2.5
^ permalink raw reply related
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