* [RFC/PATCH 14/14] powerpc: Add PCI to Walnut platform
From: Benjamin Herrenschmidt @ 2007-11-21 6:16 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1195625777.579001.269266058699.qpush@grosgo>
This wires up the 4xx PCI support & device-tree bits for the
405GP based Walnut platform.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
This one is untested, haven't had time to dig my walnut and put it
back into working condition. Josh, can you verify that IRQs are
working (routing is correct ?) Thanks !
arch/powerpc/boot/dts/walnut.dts | 39 ++++++++++++++++++++++++++++++++++++
arch/powerpc/platforms/40x/walnut.c | 7 ++++++
2 files changed, 46 insertions(+)
Index: linux-work/arch/powerpc/boot/dts/walnut.dts
===================================================================
--- linux-work.orig/arch/powerpc/boot/dts/walnut.dts 2007-11-21 16:24:27.000000000 +1100
+++ linux-work/arch/powerpc/boot/dts/walnut.dts 2007-11-21 16:26:25.000000000 +1100
@@ -190,6 +190,45 @@
virtual-reg = <f0300005>;
};
};
+
+ PCI0: pci@ec000000 {
+ device_type = "pci";
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ compatible = "ibm,plb405gp-pci", "ibm,plb-pci";
+ primary;
+ reg = <eec00000 8 /* Config space access */
+ eed80000 4 /* IACK */
+ eed80000 4 /* Special cycle */
+ ef480000 40>; /* Internal registers */
+
+ /* Outbound ranges, one memory and one IO,
+ * later cannot be changed. Chip supports a second
+ * IO range but we don't use it for now
+ */
+ ranges = <02000000 0 80000000 80000000 0 20000000
+ 01000000 0 00000000 e8000000 0 00010000>;
+
+ /* Inbound 2GB range starting at 0 */
+ dma-window = <42000000 0 0 0 80000000>;
+
+ /* Walnut has all 4 IRQ pins tied together per slot */
+ interrupt-map-mask = <f800 0 0 0>;
+ interrupt-map = <
+ /* IDSEL 1 */
+ 0800 0 0 0 &UIC0 1c 8
+
+ /* IDSEL 2 */
+ 1000 0 0 0 &UIC0 1d 8
+
+ /* IDSEL 3 */
+ 1800 0 0 0 &UIC0 1e 8
+
+ /* IDSEL 4 */
+ 2000 0 0 0 &UIC0 1f 8
+ >;
+ };
};
chosen {
Index: linux-work/arch/powerpc/platforms/40x/walnut.c
===================================================================
--- linux-work.orig/arch/powerpc/platforms/40x/walnut.c 2007-11-21 16:23:28.000000000 +1100
+++ linux-work/arch/powerpc/platforms/40x/walnut.c 2007-11-21 16:24:01.000000000 +1100
@@ -43,6 +43,12 @@ static int __init walnut_device_probe(vo
}
device_initcall(walnut_device_probe);
+static void __init walnut_setup_arch(void)
+{
+ /* Create PCI bridges */
+ ppc4xx_pci_find_bridges();
+}
+
static int __init walnut_probe(void)
{
unsigned long root = of_get_flat_dt_root();
@@ -56,6 +62,7 @@ static int __init walnut_probe(void)
define_machine(walnut) {
.name = "Walnut",
.probe = walnut_probe,
+ .setup_arch = walnut_setup_arch,
.progress = udbg_progress,
.init_IRQ = uic_init_tree,
.get_irq = uic_get_irq,
^ permalink raw reply
* Re: [PATCH 13/14] powerpc: EP405 boards support for arch/powerpc
From: Stephen Rothwell @ 2007-11-21 6:34 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <20071121061556.7F527DDFE7@ozlabs.org>
[-- Attachment #1: Type: text/plain, Size: 370 bytes --]
On Wed, 21 Nov 2007 17:15:06 +1100 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> +++ linux-work/arch/powerpc/platforms/40x/ep405.c 2007-11-21 16:45:38.000000000 +1100
> +#include <asm/of_platform.h>
Please use linux/of_platform.h instead.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [RFC/PATCH 0/14] powerpc: 4xx PCI and PCI-X support
From: Benjamin Herrenschmidt @ 2007-11-21 6:35 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1195625777.579001.269266058699.qpush@grosgo>
Looks like I posted that whole serie twice :-(
Sorry, it's a mistake.
Ben.
^ permalink raw reply
* Re: [PATCH 8/8] ibm_newemac: Skip EMACs that are marked unused by the firmware
From: Stefan Roese @ 2007-11-21 7:13 UTC (permalink / raw)
To: linuxppc-dev; +Cc: jgarzik, netdev
In-Reply-To: <20071121060737.6AA72DDE0C@ozlabs.org>
On Wednesday 21 November 2007, Benjamin Herrenschmidt wrote:
> From: Hugh Blemings <hugh@blemings.org>
>
> Depending on how the 44x processors are wired, some EMAC cells
> might not be useable (and not connected to a PHY). However, some
> device-trees may choose to still expose them (since their registers
> are present in the MMIO space) but with an "unused" property in them.
>
> Signed-off-by: Hugh Blemings <hugh@blemings.org>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Stefan Roese <sr@denx.de>
Best regards,
Stefan
^ permalink raw reply
* Re: [PATCH 8/8] ibm_newemac: Skip EMACs that are marked unused by the firmware
From: Benjamin Herrenschmidt @ 2007-11-21 7:28 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev, jgarzik, netdev
In-Reply-To: <200711210813.51525.sr@denx.de>
On Wed, 2007-11-21 at 08:13 +0100, Stefan Roese wrote:
> On Wednesday 21 November 2007, Benjamin Herrenschmidt wrote:
> > From: Hugh Blemings <hugh@blemings.org>
> >
> > Depending on how the 44x processors are wired, some EMAC cells
> > might not be useable (and not connected to a PHY). However, some
> > device-trees may choose to still expose them (since their registers
> > are present in the MMIO space) but with an "unused" property in them.
> >
> > Signed-off-by: Hugh Blemings <hugh@blemings.org>
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> Acked-by: Stefan Roese <sr@denx.de>
I noticed that I forgot to add your Ack's to the patches. I'll do so
before I ask Paul to pull them.
Thanks !
Ben.
^ permalink raw reply
* Re: ML403 USB driver
From: Lorenz Kolb @ 2007-11-21 7:37 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <fa686aa40711200731n61d239fdw4ac1d64a95ad97ff@mail.gmail.com>
Grant Likely-2 wrote:
>
> On 11/20/07, Lorenz Kolb <linuxppcemb@lkmail.de> wrote:
>
>>
>> Anyway, only one of the two peripheral ports seems to be active.
>
> Yes, I've got that problem here too. I haven't yet solved it. Any
> help would be appreciated.
>
> Cheers,
> g.
>
>
Well that's what we have found out till now, maybe it helps, or at least
what we think to have found out:
- First of all to the non functioning peripheral port:
It is "USB Peripheral 1".
According to the schematics it should be powered using the OTGVBus-Port of
the Cypress-Controller (nevertheless it has currently no level)
- Secondly there is no configuration 1 Host + 2 Peripherals according to the
datasheet from Cypress
- Thirdly the initial configuration (at least that is what we are guessing)
seems to be done via some standalone program coming from an Eeprom.
- The three pins near the UART port are the serial console for the Cypress
chip (we have not yet done any tests with that).
- At least the peripherals are connected in a right way, as one SIE can only
have one peripheral
Some question aside the peripheral topic:
Has anyone any idea how to make the cypress chip to have a _normal_ Host not
an OTG one (as some USB-Hub might save us from our dilemma why we tried to
use gadgets in peripheral mode)?
Regards,
Lorenz Kolb
--
View this message in context: http://www.nabble.com/ML403-USB-driver-tf4844098.html#a13872475
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
^ permalink raw reply
* Re: 2.6.24-rc3-mm1- powerpc link failure
From: Kamalesh Babulal @ 2007-11-21 8:06 UTC (permalink / raw)
To: Andrew Morton; +Cc: sfr, Balbir Singh, linux-kernel, linuxppc-dev
In-Reply-To: <20071120204525.ff27ac98.akpm@linux-foundation.org>
Hi Andrew,
The kernel build fails on powerpc while linking,
AS .tmp_kallsyms3.o
LD vmlinux.o
ld: TOC section size exceeds 64k
make: *** [vmlinux.o] Error 1
The patch posted at http://lkml.org/lkml/2007/11/13/414, solves this
failure.
--
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.
^ permalink raw reply
* RE: [PATCH v7 3/9] add Freescale SerDes PHY support
From: Benjamin Herrenschmidt @ 2007-11-21 8:42 UTC (permalink / raw)
To: Li Yang; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <989B956029373F45A0B8AF029708189001A1C7DF@zch01exm26.fsl.freescale.net>
> I'm ok for it to be taken care of in u-boot for now. However, if we
> later plan to add power management support to this block. We probably
> have to do it in kernel.
In that case, can't it be just saving/restoring ? That's easier than
supporting full configuration of random user setups
Ben.
^ permalink raw reply
* Re: [PATCH] [POWERPC] Emulate isel (Integer Select) instruction
From: Benjamin Herrenschmidt @ 2007-11-21 9:12 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <B82E6C31-8BB7-4348-9426-B18A971172A9@kernel.crashing.org>
On Tue, 2007-11-20 at 15:01 -0600, Kumar Gala wrote:
> > Given that the instruction is meant to be a performance enhancement,
> > we should probably warn the first few times it's emulated, so the
> user
> > knows they should change their toolchain setup if possible.
>
> The same is true of mcrxr, popcntb, and possibly string ld/st.
>
> Feel free to submit a patch that warns about their usage.
At least we should keep counters... best would be per-task counters
in /proc but that sounds harder :-)
I remember in the early days of powerpc, it wasn't uncommon to have apps
with issues because they used 601 only bits on 603/4 that had to be
emulated (such as old POWER opcodes). On MacOS, we used to have a
system-wide counter of the number of emulated instructions we could use
to detect these things.
Ben.
^ permalink raw reply
* Re: linux2.6.19.2-> mpc8xx_wdt.c: timeout extended to reach several seconds... but I have a problem
From: Jochen Friedrich @ 2007-11-21 12:51 UTC (permalink / raw)
To: DI BACCO ANTONIO - technolabs; +Cc: linuxppc-embedded
In-Reply-To: <F1F6EC0C8B75034F9E3A79FC85122E8E2649FB@aquib01a>
Hi Antonio,
> I added a kernel timer (triggering every 500 ms) to reset the watchdog
> of mpc8xx. This timer starts when the driver is opened. The timer is
> rearmed till a counter reaches a zero value. A process can use the write
> method of the driver to set the counter to a preferred value. If the
> application misses to set the counter, it will decrease to zero and then
> the board will restart.
You might want to have a look at this patch:
http://patchwork.ozlabs.org/linuxppc-embedded/patch?id=14682
Please make sure to call pq_wdt_init() as early as possible to avoid a
reset during the initial log buffer flush to the serial console.
Thanks,
Jochen
^ permalink raw reply
* Re: [PATCH] [POWERPC] Emulate isel (Integer Select) instruction
From: Geert Uytterhoeven @ 2007-11-21 13:09 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <B82E6C31-8BB7-4348-9426-B18A971172A9@kernel.crashing.org>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 3610 bytes --]
On Tue, 20 Nov 2007, Kumar Gala wrote:
> On Nov 20, 2007, at 11:54 AM, Scott Wood wrote:
> > On Mon, Nov 19, 2007 at 09:36:57PM -0600, Kumar Gala wrote:
> >> isel (Integer Select) is a new user space instruction in the
> >> PowerISA 2.04 spec. Not all processors implement it so lets emulate
> >> to ensure code built with isel will run everywhere.
> >
> > Given that the instruction is meant to be a performance enhancement,
> > we should probably warn the first few times it's emulated, so the user
> > knows they should change their toolchain setup if possible.
>
> The same is true of mcrxr, popcntb, and possibly string ld/st.
>
> Feel free to submit a patch that warns about their usage.
Something like this?
Probably we also want it for:
- arch/powerpc/kernel/align.c
o emulate_dcbz()
o emulate_multiple()
o emulate_fp_pair()
o emulate_spe()
- arch/powerpc/kernel/softemu8xx.c
o Soft_emulate_8xx()
- arch/powerpc/kernel/traps.c
o SoftwareEmulation()
- arch/powerpc/kernel/vecemu.c
o emulate_altivec()
Question: do we want it for emulate_single_step(), too?
So far my Debian userland didn't trigger any of them on the PS3, I had to
write an explicit test ;-)
---
arch/powerpc/kernel/traps.c | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -707,6 +707,14 @@ static int emulate_popcntb_inst(struct p
return 0;
}
+#define WARN_EMULATE(type) \
+ do { \
+ static unsigned int count; \
+ if (count++ < 10) \
+ pr_warning("%s used emulated %s instruction\n", \
+ current->comm, type); \
+ } while (0)
+
static int emulate_instruction(struct pt_regs *regs)
{
u32 instword;
@@ -721,31 +729,38 @@ static int emulate_instruction(struct pt
/* Emulate the mfspr rD, PVR. */
if ((instword & INST_MFSPR_PVR_MASK) == INST_MFSPR_PVR) {
+ WARN_EMULATE("mfpvr");
rd = (instword >> 21) & 0x1f;
regs->gpr[rd] = mfspr(SPRN_PVR);
return 0;
}
/* Emulating the dcba insn is just a no-op. */
- if ((instword & INST_DCBA_MASK) == INST_DCBA)
+ if ((instword & INST_DCBA_MASK) == INST_DCBA) {
+ WARN_EMULATE("dcba");
return 0;
+ }
/* Emulate the mcrxr insn. */
if ((instword & INST_MCRXR_MASK) == INST_MCRXR) {
int shift = (instword >> 21) & 0x1c;
unsigned long msk = 0xf0000000UL >> shift;
+ WARN_EMULATE("mcrxr");
regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk);
regs->xer &= ~0xf0000000UL;
return 0;
}
/* Emulate load/store string insn. */
- if ((instword & INST_STRING_GEN_MASK) == INST_STRING)
+ if ((instword & INST_STRING_GEN_MASK) == INST_STRING) {
+ WARN_EMULATE("string");
return emulate_string_inst(regs, instword);
+ }
/* Emulate the popcntb (Population Count Bytes) instruction. */
if ((instword & INST_POPCNTB_MASK) == INST_POPCNTB) {
+ WARN_EMULATE("popcntb");
return emulate_popcntb_inst(regs, instword);
}
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
^ permalink raw reply
* Re: [RFC/PATCH 5/14] powerpc: Fix 440/440A machine check handling
From: Josh Boyer @ 2007-11-21 13:12 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <20071121061714.0AB82DEAF1@ozlabs.org>
On Wed, 21 Nov 2007 17:16:24 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> This removes CONFIG_440A which was a problem for multiplatform
> kernels and instead fixes up the IVOR at runtime from a setup_cpu
> function. The "A" version of the machine check also tweaks the
> regs->trap value to differenciate the 2 versions at the C level.
>
<snip>
> void machine_check_exception(struct pt_regs *regs)
> {
> @@ -463,8 +489,20 @@ void machine_check_exception(struct pt_r
> /* See if any machine dependent calls */
> if (ppc_md.machine_check_exception)
> recover = ppc_md.machine_check_exception(regs);
> - else
> - recover = generic_machine_check_exception(regs);
> + else {
> +#ifdef CONFIG_4xx
> + if (IS_MCHECK_EXC(regs))
> + recover = decode_machine_check_4xxA(regs);
> + else
> + recover = decode_machine_check_4xx(regs);
> +#elif defined (CONFIG_E500)
> + recover = decode_machine_check_e500(regs);
> +#elif defined (CONFIG_E200)
> + recover = decode_machine_check_e200(regs);
> +#else
> + recover = decode_machine_check_generic(regs);
> +#endif
Why didn't you just add a ppc_md.machine_check_exception to the
effected boards? Then you could have gotten rid of the ifdefs all
together.
josh
^ permalink raw reply
* Re: [RFC/PATCH 13/14] powerpc: EP405 boards support for arch/powerpc
From: Josh Boyer @ 2007-11-21 13:21 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <20071121061721.8497FDEBFC@ozlabs.org>
On Wed, 21 Nov 2007 17:16:31 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> Brings EP405 support to arch/powerpc. The IRQ routing for the CPLD
> comes from a device-tree property, PCI is working to the point where
> I can see the video card, USB device, and south bridge.
>
> This should work with both EP405 and EP405PC.
>
> I've not totally figured out how IRQs are wired on this hardware
> though, thus at this stage, expect only USB interrupts working,
> pretty much the same as what arch/ppc did.
>
> Also, the flash, nvram, rtc and temp control still have to be wired.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
<snip>
> Index: linux-work/arch/powerpc/boot/dts/ep405.dts
> ===================================================================
> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> +++ linux-work/arch/powerpc/boot/dts/ep405.dts 2007-11-21 16:23:03.000000000 +1100
> @@ -0,0 +1,221 @@
> +/*
> + * Device Tree Source for EP405
> + *
> + * Copyright 2007 IBM Corp.
> + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
Hm... odd. I don't remember writing this device tree ;)
josh
^ permalink raw reply
* Re: [RFC/PATCH 0/14] powerpc: 4xx PCI and PCI-X support
From: Josh Boyer @ 2007-11-21 13:23 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1195625777.579001.269266058699.qpush@grosgo>
On Wed, 21 Nov 2007 17:16:17 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> Here's a set of patches that bring PCI and PCI-X support for
> 4xx (PCIe still missing) in arch/powerpc.
>
> This is for review before I ask paulus to pull that into his
> for 2.6.25 tree. Some of the patches still need a bit more
> testing vs. regressions on other platforms such as the
> 64 bits resource fixup one.
I'm starting my 2.6.25 branch today. I'll probably throw these in
there after I've tested a bit, since I need them to make further
progress with 4xx anyway.
josh
^ permalink raw reply
* Re: [RFC/PATCH 14/14] powerpc: Add PCI to Walnut platform
From: Josh Boyer @ 2007-11-21 13:24 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <20071121061722.2FCB7DDE45@ozlabs.org>
On Wed, 21 Nov 2007 17:16:32 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> This wires up the 4xx PCI support & device-tree bits for the
> 405GP based Walnut platform.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>
> This one is untested, haven't had time to dig my walnut and put it
> back into working condition. Josh, can you verify that IRQs are
> working (routing is correct ?) Thanks !
Yep, I'll try it out early next week.
josh
^ permalink raw reply
* Firmware Support for USB Hub
From: Misbah khan @ 2007-11-21 13:45 UTC (permalink / raw)
To: linuxppc-embedded
Hi all,
I am using a 8248 processor which has a USB controller and i need to connect
a USB Hub to it, iam using Montavista Linux .I need to know that what are
the support i need form Montavista or Open source to have an interface with
Usb hub. ???
Is there any driver that we need to make if so what type ???
--misbah <><
--
View this message in context: http://www.nabble.com/Firmware-Support-for-USB-Hub-tf4850180.html#a13877282
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
^ permalink raw reply
* Re: [RFC/PATCH 0/14] powerpc: 4xx PCI and PCI-X support
From: Stefan Roese @ 2007-11-21 14:04 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071121072348.7fff79a9@weaponx>
On Wednesday 21 November 2007, Josh Boyer wrote:
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> > Here's a set of patches that bring PCI and PCI-X support for
> > 4xx (PCIe still missing) in arch/powerpc.
> >
> > This is for review before I ask paulus to pull that into his
> > for 2.6.25 tree. Some of the patches still need a bit more
> > testing vs. regressions on other platforms such as the
> > 64 bits resource fixup one.
>
> I'm starting my 2.6.25 branch today. I'll probably throw these in
> there after I've tested a bit, since I need them to make further
> progress with 4xx anyway.
Yes, it would be great to have an "official" repo with all the new 4xx stuff
(PCI, EMAC...) stuff.
Thanks.
Best regards,
Stefan
^ permalink raw reply
* Re: [PATCH] [POWERPC] Emulate isel (Integer Select) instruction
From: Kumar Gala @ 2007-11-21 14:19 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
In-Reply-To: <1195636347.6970.80.camel@pasglop>
On Nov 21, 2007, at 3:12 AM, Benjamin Herrenschmidt wrote:
>
> On Tue, 2007-11-20 at 15:01 -0600, Kumar Gala wrote:
>>> Given that the instruction is meant to be a performance enhancement,
>>> we should probably warn the first few times it's emulated, so the
>> user
>>> knows they should change their toolchain setup if possible.
>>
>> The same is true of mcrxr, popcntb, and possibly string ld/st.
>>
>> Feel free to submit a patch that warns about their usage.
>
> At least we should keep counters... best would be per-task counters
> in /proc but that sounds harder :-)
>
> I remember in the early days of powerpc, it wasn't uncommon to have
> apps
> with issues because they used 601 only bits on 603/4 that had to be
> emulated (such as old POWER opcodes). On MacOS, we used to have a
> system-wide counter of the number of emulated instructions we could
> use
> to detect these things.
I think having some form of per insn group counters would be useful as
well. I know it would be helpful to debug user problems if they are
doing a lot of FP emu or the like and don't know it.
- k
^ permalink raw reply
* Re: [PATCH] [POWERPC] Emulate isel (Integer Select) instruction
From: Kumar Gala @ 2007-11-21 14:22 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.62.0711211407260.12720@pademelon.sonytel.be>
On Nov 21, 2007, at 7:09 AM, Geert Uytterhoeven wrote:
> On Tue, 20 Nov 2007, Kumar Gala wrote:
>> On Nov 20, 2007, at 11:54 AM, Scott Wood wrote:
>>> On Mon, Nov 19, 2007 at 09:36:57PM -0600, Kumar Gala wrote:
>>>> isel (Integer Select) is a new user space instruction in the
>>>> PowerISA 2.04 spec. Not all processors implement it so lets
>>>> emulate
>>>> to ensure code built with isel will run everywhere.
>>>
>>> Given that the instruction is meant to be a performance enhancement,
>>> we should probably warn the first few times it's emulated, so the
>>> user
>>> knows they should change their toolchain setup if possible.
>>
>> The same is true of mcrxr, popcntb, and possibly string ld/st.
>>
>> Feel free to submit a patch that warns about their usage.
>
> Something like this?
>
> Probably we also want it for:
>
> - arch/powerpc/kernel/align.c
> o emulate_dcbz()
> o emulate_multiple()
> o emulate_fp_pair()
> o emulate_spe()
>
> - arch/powerpc/kernel/softemu8xx.c
> o Soft_emulate_8xx()
>
> - arch/powerpc/kernel/traps.c
> o SoftwareEmulation()
You missed math_emu.
> - arch/powerpc/kernel/vecemu.c
> o emulate_altivec()
I'm not sure I would concern this one emulation, there isn't much you
can do about the denorm fixup.
How about some per processor counters in sysfs under the processor.
> Question: do we want it for emulate_single_step(), too?
What do you mean, we should could the emulation, the emulate single
step just is for handling if you are doing debug while hitting an
emulated insn.
> So far my Debian userland didn't trigger any of them on the PS3, I
> had to
> write an explicit test ;-)
> ---
> arch/powerpc/kernel/traps.c | 19 +++++++++++++++++--
> 1 files changed, 17 insertions(+), 2 deletions(-)
>
> --- a/arch/powerpc/kernel/traps.c
> +++ b/arch/powerpc/kernel/traps.c
> @@ -707,6 +707,14 @@ static int emulate_popcntb_inst(struct p
> return 0;
> }
>
> +#define WARN_EMULATE(type) \
> + do { \
> + static unsigned int count; \
> + if (count++ < 10) \
> + pr_warning("%s used emulated %s instruction\n", \
> + current->comm, type); \
> + } while (0)
> +
> static int emulate_instruction(struct pt_regs *regs)
> {
> u32 instword;
> @@ -721,31 +729,38 @@ static int emulate_instruction(struct pt
>
> /* Emulate the mfspr rD, PVR. */
> if ((instword & INST_MFSPR_PVR_MASK) == INST_MFSPR_PVR) {
> + WARN_EMULATE("mfpvr");
> rd = (instword >> 21) & 0x1f;
> regs->gpr[rd] = mfspr(SPRN_PVR);
> return 0;
> }
>
> /* Emulating the dcba insn is just a no-op. */
> - if ((instword & INST_DCBA_MASK) == INST_DCBA)
> + if ((instword & INST_DCBA_MASK) == INST_DCBA) {
> + WARN_EMULATE("dcba");
> return 0;
> + }
>
> /* Emulate the mcrxr insn. */
> if ((instword & INST_MCRXR_MASK) == INST_MCRXR) {
> int shift = (instword >> 21) & 0x1c;
> unsigned long msk = 0xf0000000UL >> shift;
>
> + WARN_EMULATE("mcrxr");
> regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk);
> regs->xer &= ~0xf0000000UL;
> return 0;
> }
>
> /* Emulate load/store string insn. */
> - if ((instword & INST_STRING_GEN_MASK) == INST_STRING)
> + if ((instword & INST_STRING_GEN_MASK) == INST_STRING) {
> + WARN_EMULATE("string");
> return emulate_string_inst(regs, instword);
> + }
>
> /* Emulate the popcntb (Population Count Bytes) instruction. */
> if ((instword & INST_POPCNTB_MASK) == INST_POPCNTB) {
> + WARN_EMULATE("popcntb");
> return emulate_popcntb_inst(regs, instword);
> }
>
This looks good as a start.
- k
^ permalink raw reply
* Re: [PATCH] [POWERPC] Emulate isel (Integer Select) instruction
From: Geert Uytterhoeven @ 2007-11-21 14:33 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <7D40FA9E-A972-4995-85AE-3CE2551BB195@kernel.crashing.org>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2359 bytes --]
On Wed, 21 Nov 2007, Kumar Gala wrote:
> On Nov 21, 2007, at 7:09 AM, Geert Uytterhoeven wrote:
> > On Tue, 20 Nov 2007, Kumar Gala wrote:
> > > On Nov 20, 2007, at 11:54 AM, Scott Wood wrote:
> > > > On Mon, Nov 19, 2007 at 09:36:57PM -0600, Kumar Gala wrote:
> > > > > isel (Integer Select) is a new user space instruction in the
> > > > > PowerISA 2.04 spec. Not all processors implement it so lets emulate
> > > > > to ensure code built with isel will run everywhere.
> > > >
> > > > Given that the instruction is meant to be a performance enhancement,
> > > > we should probably warn the first few times it's emulated, so the user
> > > > knows they should change their toolchain setup if possible.
> > >
> > > The same is true of mcrxr, popcntb, and possibly string ld/st.
> > >
> > > Feel free to submit a patch that warns about their usage.
> >
> > Something like this?
> >
> > Probably we also want it for:
> >
> > - arch/powerpc/kernel/align.c
> > o emulate_dcbz()
> > o emulate_multiple()
> > o emulate_fp_pair()
> > o emulate_spe()
> >
> > - arch/powerpc/kernel/softemu8xx.c
> > o Soft_emulate_8xx()
> >
> > - arch/powerpc/kernel/traps.c
> > o SoftwareEmulation()
>
> You missed math_emu.
>
> > - arch/powerpc/kernel/vecemu.c
> > o emulate_altivec()
>
> I'm not sure I would concern this one emulation, there isn't much you can do
> about the denorm fixup.
>
> How about some per processor counters in sysfs under the processor.
Good idea!
> > Question: do we want it for emulate_single_step(), too?
>
> What do you mean, we should could the emulation, the emulate single step just
> is for handling if you are doing debug while hitting an emulated insn.
I mean: should these be counted?
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
^ permalink raw reply
* Re: [RFC/PATCH 0/14] powerpc: 4xx PCI and PCI-X support
From: Josh Boyer @ 2007-11-21 14:33 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev
In-Reply-To: <200711211504.13003.sr@denx.de>
On Wed, 21 Nov 2007 15:04:12 +0100
Stefan Roese <sr@denx.de> wrote:
> On Wednesday 21 November 2007, Josh Boyer wrote:
> > Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> > > Here's a set of patches that bring PCI and PCI-X support for
> > > 4xx (PCIe still missing) in arch/powerpc.
> > >
> > > This is for review before I ask paulus to pull that into his
> > > for 2.6.25 tree. Some of the patches still need a bit more
> > > testing vs. regressions on other platforms such as the
> > > 64 bits resource fixup one.
> >
> > I'm starting my 2.6.25 branch today. I'll probably throw these in
> > there after I've tested a bit, since I need them to make further
> > progress with 4xx anyway.
>
> Yes, it would be great to have an "official" repo with all the new 4xx stuff
> (PCI, EMAC...) stuff.
Sure, I can do that. I'll probably use my master branch for this
instead, and reserve for-2.6.25 for sending stuff to Paul. Reason
being that lots of useful things for 4xx don't actually go through my
tree (like EMAC, MTD stuff, etc).
I'll send out an email when I've queued up some stuff.
josh
^ permalink raw reply
* Re: [PATCH 3/3] [POWERPC] Add docs for Freescale DMA & DMA channel device tree nodes
From: Timur Tabi @ 2007-11-21 14:59 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0711202314030.24220@blarg.am.freescale.net>
Kumar Gala wrote:
> + * Freescale 83xx DMA Controller
> +
> + Freescale PowerPC 83xx have on chip general purpose DMA controllers.
> +
> + Required properties:
> +
> + - compatible : compatible list, contains 2 entries, first is
> + "fsl,CHIP-dma", where CHIP is the processor
> + (mpc8349, mpc8360, etc.) and the second is
> + "fsl,elo-dma"
Shouldn't we put some text somewhere that we're calling it the Elo controller
even though that word isn't used in the reference manual?
> + * Freescale 85xx DMA Controller
And 86xx.
> +
> + Freescale PowerPC 85xx have on chip general purpose DMA controllers.
> +
> + Required properties:
> +
> + - compatible : compatible list, contains 2 entries, first is
> + "fsl,CHIP-dma", where CHIP is the processor
> + (mpc8540, mpc8540, etc.) and the second is
> + "fsl,eloplus-dma"
> + - reg : <registers mapping for DMA general status reg>
> + - ranges : Should be defined as specified in 1) to describe the
> + DMA controller channels.
> +
> + - DMA channel nodes:
> + - compatible : compatible list, contains 2 entries, first is
> + "fsl,CHIP-dma-channel", where CHIP is the processor
> + (mpc8540, mpc8560, etc.) and the second is
> + "fsl,eloplus-dma-channel"
> + - reg : <registers mapping for channel>
> + - interrupts : <interrupt mapping for DMA channel IRQ>
> + - interrupt-parent : optional, if needed for interrupt mapping
> +
> + Example:
> + dma@21000 {
Shouldn't this be dma@21300?
> + #address-cells = <1>;
> + #size-cells = <1>;
> + compatible = "fsl,mpc8540-dma", "fsl,eloplus-dma";
> + reg = <21300 4>;
> + ranges = <0 21100 200>;
> + dma-channel@0 {
> + compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
> + reg = <0 80>;
> + interrupt-parent = <&mpic>;
> + interrupts = <14 2>;
> + };
The DMA controller and the DMA channels need a "device-id", so that they can
be identified by number. Some peripherals, like the SSI, can only use the
controller and channel number. This is what I have in my 8610 DTS:
dma@21300 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "fsl,mpc8610-dma", "fsl,mpc8540-dma";
--> device-id = <0>;
reg = <21300 4>; /* DMA general status register */
ranges = <0 21100 200>;
dma-channel@0 {
compatible = "fsl,mpc8610-dma-channel",
"fsl,mpc8540-dma-channel";
--> device-id = <0>;
reg = <0 80>;
interrupt-parent = <&mpic>;
interrupts = <14 2>;
};
--
Timur Tabi
Linux Kernel Developer @ Freescale
^ permalink raw reply
* Re: [PATCH 3/3] [POWERPC] Add docs for Freescale DMA & DMA channel device tree nodes
From: Kumar Gala @ 2007-11-21 15:33 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev
In-Reply-To: <474447EF.8080405@freescale.com>
On Nov 21, 2007, at 8:59 AM, Timur Tabi wrote:
> Kumar Gala wrote:
>
>> + * Freescale 83xx DMA Controller
>> +
>> + Freescale PowerPC 83xx have on chip general purpose DMA
>> controllers.
>> +
>> + Required properties:
>> +
>> + - compatible : compatible list, contains 2 entries,
>> first is
>> + "fsl,CHIP-dma", where CHIP is the processor
>> + (mpc8349, mpc8360, etc.) and the second is
>> + "fsl,elo-dma"
>
> Shouldn't we put some text somewhere that we're calling it the Elo
> controller even though that word isn't used in the reference manual?
we don't really have a place to put that. its effectively documented
right here.
>
>
>> + * Freescale 85xx DMA Controller
>
> And 86xx.
yes, true.
>> +
>> + Freescale PowerPC 85xx have on chip general purpose DMA
>> controllers.
>> +
>> + Required properties:
>> +
>> + - compatible : compatible list, contains 2 entries,
>> first is
>> + "fsl,CHIP-dma", where CHIP is the processor
>> + (mpc8540, mpc8540, etc.) and the second is
>> + "fsl,eloplus-dma"
>> + - reg : <registers mapping for DMA general
>> status reg>
>> + - ranges : Should be defined as specified in 1) to describe
>> the
>> + DMA controller channels.
>> +
>> + - DMA channel nodes:
>> + - compatible : compatible list, contains 2 entries,
>> first is
>> + "fsl,CHIP-dma-channel", where CHIP is the processor
>> + (mpc8540, mpc8560, etc.) and the second is
>> + "fsl,eloplus-dma-channel"
>> + - reg : <registers mapping for channel>
>> + - interrupts : <interrupt mapping for DMA channel IRQ>
>> + - interrupt-parent : optional, if needed for interrupt mapping
>> +
>> + Example:
>> + dma@21000 {
>
> Shouldn't this be dma@21300?
its an example that has not basis is reality :)
>> + #address-cells = <1>;
>> + #size-cells = <1>;
>> + compatible = "fsl,mpc8540-dma", "fsl,eloplus-dma";
>> + reg = <21300 4>;
>> + ranges = <0 21100 200>;
>> + dma-channel@0 {
>> + compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-
>> channel";
>> + reg = <0 80>;
>> + interrupt-parent = <&mpic>;
>> + interrupts = <14 2>;
>> + };
>
> The DMA controller and the DMA channels need a "device-id", so that
> they can be identified by number. Some peripherals, like the SSI,
> can only use the controller and channel number. This is what I have
> in my 8610 DTS:
Why not use reg for this? I don't see any reason to add another
"unique id" when there is already one.
> dma@21300 {
> #address-cells = <1>;
> #size-cells = <1>;
> compatible = "fsl,mpc8610-dma", "fsl,mpc8540-
> dma";
> --> device-id = <0>;
> reg = <21300 4>; /* DMA general status
> register */
> ranges = <0 21100 200>;
>
> dma-channel@0 {
> compatible = "fsl,mpc8610-dma-channel",
> "fsl,mpc8540-dma-channel";
> --> device-id = <0>;
> reg = <0 80>;
> interrupt-parent = <&mpic>;
> interrupts = <14 2>;
> };
>
- k
^ permalink raw reply
* Re: [PATCH] [POWERPC] Emulate isel (Integer Select) instruction
From: Kumar Gala @ 2007-11-21 15:34 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.62.0711211524370.12720@pademelon.sonytel.be>
On Nov 21, 2007, at 8:33 AM, Geert Uytterhoeven wrote:
> On Wed, 21 Nov 2007, Kumar Gala wrote:
>> On Nov 21, 2007, at 7:09 AM, Geert Uytterhoeven wrote:
>>> On Tue, 20 Nov 2007, Kumar Gala wrote:
>>>> On Nov 20, 2007, at 11:54 AM, Scott Wood wrote:
>>>>> On Mon, Nov 19, 2007 at 09:36:57PM -0600, Kumar Gala wrote:
>>>>>> isel (Integer Select) is a new user space instruction in the
>>>>>> PowerISA 2.04 spec. Not all processors implement it so lets
>>>>>> emulate
>>>>>> to ensure code built with isel will run everywhere.
>>>>>
>>>>> Given that the instruction is meant to be a performance
>>>>> enhancement,
>>>>> we should probably warn the first few times it's emulated, so
>>>>> the user
>>>>> knows they should change their toolchain setup if possible.
>>>>
>>>> The same is true of mcrxr, popcntb, and possibly string ld/st.
>>>>
>>>> Feel free to submit a patch that warns about their usage.
>>>
>>> Something like this?
>>>
>>> Probably we also want it for:
>>>
>>> - arch/powerpc/kernel/align.c
>>> o emulate_dcbz()
>>> o emulate_multiple()
>>> o emulate_fp_pair()
>>> o emulate_spe()
>>>
>>> - arch/powerpc/kernel/softemu8xx.c
>>> o Soft_emulate_8xx()
>>>
>>> - arch/powerpc/kernel/traps.c
>>> o SoftwareEmulation()
>>
>> You missed math_emu.
>>
>>> - arch/powerpc/kernel/vecemu.c
>>> o emulate_altivec()
>>
>> I'm not sure I would concern this one emulation, there isn't much
>> you can do
>> about the denorm fixup.
>>
>> How about some per processor counters in sysfs under the processor.
>
> Good idea!
>
>>> Question: do we want it for emulate_single_step(), too?
>>
>> What do you mean, we should could the emulation, the emulate single
>> step just
>> is for handling if you are doing debug while hitting an emulated
>> insn.
>
> I mean: should these be counted?
the number of emulated single steps insn? not sure I follow. I think
we should count regardless if we go through emulate_single_step().
- k
^ permalink raw reply
* annoying prinkts during vmemmap initialization
From: Christoph Hellwig @ 2007-11-21 15:35 UTC (permalink / raw)
To: apw; +Cc: linuxppc-dev
Hi Andi,
your patch 'ppc64: SPARSEMEM_VMEMMAP support' adds the following two lines:
+ printk(KERN_WARNING "vmemmap %08lx allocated at %p, "
+ "physical %p.\n", start, p, __pa(p));
in a loop around basically every page. That's a lot of flooding (with
the wrong printk level, btw) and really slows down booting my cell blade
a lot (these only have a very slow serial over lan console).
Any reason to keep this? And if yes can we please make it conditional
on some kind of vmemmap_debug boot option?
^ 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