* Re: [PATCH 02/11] sdhci: Add support for bus-specific IO memory accessors
From: Anton Vorontsov @ 2009-02-13 14:40 UTC (permalink / raw)
To: Pierre Ossman
Cc: Ben Dooks, Arnd Bergmann, Liu Dave, linux-kernel, linuxppc-dev,
sdhci-devel
In-Reply-To: <20090208215020.46ca5724@mjolnir.drzeus.cx>
On Sun, Feb 08, 2009 at 09:50:20PM +0100, Pierre Ossman wrote:
> On Fri, 6 Feb 2009 21:06:45 +0300
> Anton Vorontsov <avorontsov@ru.mvista.com> wrote:
> > Currently the SDHCI driver works with PCI accessors (write{l,b,w} and
> > read{l,b,w}).
> >
> > With this patch drivers may change memory accessors, so that we can
> > support hosts with "weird" IO memory access requirments.
> >
> > For example, in "FSL eSDHC" SDHCI hardware all registers are 32 bit
> > width, with big-endian addressing. That is, readb(0x2f) should turn
> > into readb(0x2c), and readw(0x2c) should be translated to
> > le16_to_cpu(readw(0x2e)).
> >
> > Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> > ---
>
> I was hoping we wouldn't have to do a lot of magic in the accessors
> since the spec is rather clear on the register interface. :/
>
> Let's see if I've understood this correctly.
>
> 1. The CPU is big-endian but the register are little-endian (as the
> spec requires).
No, on eSDHC the registers are big-endian, 32-bit width, with, for
example, two 16-bit "logical" registers packed into it.
That is,
0x4 0x5 0x6 0x7
|~~~~~~~~:~~~~~~~~|
| BLKCNT : BLKSZ |
|________:________|
31 0
( The register looks wrong, right? BLKSZ should be at 0x4. But imagine
that you swapped bytes in this 32 bit register... then the registers
and their byte addresses will look normal. )
So if we try to issue readw(SDHCI_BLOCK_SIZE), i.e. readw(0x4):
- We'll read BLKCNT, while we wanted BLKSZ. This is because the
address bits should be translated before we try word or byte
reads/writes.
- On powerpc read{l,w}() convert the read value from little-endian
to big-endian byte order, which is wrong for our case (the
register is big-endian already).
That means that we have to convert address, but we don't want to
convert the result of read/write ops.
> I was under the impression that the read*/write*
> accessor handled any endian conversion between the bus and the cpu? How
> do e.g. PCI work on Sparc?
read{l,w} are guaranteed to return values in CPU byte order, so
if CPU is in big-endian mode, then the PCI IO accessors should
convert values. And just as on PowerPC, Sparc's read*() accessors
swap bytes of a result:
static inline u32 __readl(const volatile void __iomem *addr)
{
return flip_dword(*(__force volatile u32 *)addr);
}
#define readl(__addr) __readl(__addr)
> 2. Register access must be done 32 bits at a time. Now this is just
> broken and might cause big problems as some registers cannot just be
> read and written back to.
We must only take special care when working with "triggering"
registers, and that's handled by the "sdhci: Add support for hosts
with strict 32 bit addressing" patch.
> OTOH you refer to readw() in your example,
> not readl(). What's the deal here?
readw() was just an example (most complicated one).
> > +static inline void sdhci_writel(struct sdhci_host *host, u32 val, int reg)
> > +{
> > + host->writel(host, val, reg);
> > +}
>
> Having to override these are worst case scenario
Hm. It's not a worst case scenario, it's a normal scenario for
eSDHC. Why should we treat eSDHC as a second-class citizen?
> as far as I'm
> concerned, so I'd prefer something like:
>
> if (!host->ops->writel)
> writel(host->ioaddr + reg, val);
> else
> host->ops->writel(host, val, reg);
Hm.
-- What I purpose:
$ size drivers/mmc/host/sdhci.o
text data bss dec hex filename
15173 8 4 15185 3b51 drivers/mmc/host/sdhci.o
And there is a minimum run-time overhead (dereference + branch).
+ no first/second-class citizen separation.
-- What you purpose (inlined):
$ size drivers/mmc/host/sdhci.o
text data bss dec hex filename
17853 8 4 17865 45c9 drivers/mmc/host/sdhci.o
Runtime overhead: dereference + dereference + compare +
(maybe)branch + larger code.
-- What you purpose (uninlined):
$ size drivers/mmc/host/sdhci.o
text data bss dec hex filename
14692 8 4 14704 3970 drivers/mmc/host/sdhci.o
Better. But the runtime overhead: branch + dereference + dereference +
compare + (maybe)branch.
Surely the overhead isn't measurable... but why we purposely make
things worse?
Though, this is not something I'm going to argue about, I'll just
do it the way you prefer. ;-) For an updated patch set I took
the uninlined variant, hope this is OK.
Thanks for the review,
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* [PATCH] Configure PSC4 and PSC5 as UART.
From: Grzegorz Bernacki @ 2009-02-13 13:52 UTC (permalink / raw)
To: linuxppc-dev
On digsy MTC PSC4 and PSC5 should be configured as UART, not PSC3 and PSC4.
Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
---
arch/powerpc/boot/dts/digsy_mtc.dts | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/boot/dts/digsy_mtc.dts b/arch/powerpc/boot/dts/digsy_mtc.dts
index 9c76c38..ce33c7c 100644
--- a/arch/powerpc/boot/dts/digsy_mtc.dts
+++ b/arch/powerpc/boot/dts/digsy_mtc.dts
@@ -164,21 +164,21 @@
reg = <0x1f00 0x100>;
};
- serial@2400 { // PSC3
+ serial@2600 { // PSC4
device_type = "serial";
compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
- cell-index = <2>;
- reg = <0x2400 0x100>;
- interrupts = <2 3 0>;
+ cell-index = <3>;
+ reg = <0x2600 0x100>;
+ interrupts = <2 11 0>;
interrupt-parent = <&mpc5200_pic>;
};
- serial@2600 { // PSC4
+ serial@2800 { // PSC5
device_type = "serial";
compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
- cell-index = <3>;
- reg = <0x2600 0x100>;
- interrupts = <2 11 0>;
+ cell-index = <5>;
+ reg = <0x2800 0x100>;
+ interrupts = <2 12 0>;
interrupt-parent = <&mpc5200_pic>;
};
--
1.6.0.6
^ permalink raw reply related
* Gianfar ethernet MPC85xx driver not seen anymore when moving to 2.6.29 kernel
From: willy jacobs @ 2009-02-13 10:34 UTC (permalink / raw)
To: linuxppc-dev
When I moved (config file and device tree) from 2.6.28 (and earlier kernel releases) to 2.6.29-rc2 for some reason
the Gianfar driver is correctly compiled in, but not probed anymore during kernel booting.
I looked into the Changelogs, but did'nt see any change regarding this.
Do I need to change the device tree and/ir config file?
--
willy
Unclassified
------------------------------------------------------------------------------------------------------------
Disclaimer:
If you are not the intended recipient of this email, please notify the sender and delete it.
Any unauthorized copying, disclosure or distribution of this email or its attachment(s) is forbidden.
Thales Nederland BV will not accept liability for any damage caused by this email or its attachment(s).
Thales Nederland BV is seated in Hengelo and is registered at the Chamber of Commerce under number 06061578.
------------------------------------------------------------------------------------------------------------
^ permalink raw reply
* Re: Chipselect in SPI binding with mpc5200-psc-spi
From: Henk Stegeman @ 2009-02-13 10:40 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <fa686aa40810290745k5c34c5e1m835351837e39248e@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3952 bytes --]
I'm busy adding support for slave deviced behind mpc52xx-psc-spi.
One complication I have is that my SPI slave device has an interrupt output
to the CPU.
My idea is to add it as a gpios property in the slave device's
configuration:
spi@2400 { // PSC3 (SPI IF to the IO-controller )
device_type = "spi";
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,mpc5200-psc-spi","fsl,mpc5200b-psc-spi";
cell-index = <2>;
reg = <0x2400 0x100>;
interrupts = <2 3 0>;
interrupt-parent = <&mpc5200_pic>;
gpios = <&gpt4 0 0>;
io-controller@0 {
compatible = "microkey,smc4000io";
spi-max-frequency = <1000000>;
reg = <0>;
// gpios: first is IRQ to cpu
gpios = <&gpt6 0 0>;
};
};
Are there better/easier ways to do this?
How should I then register my spi slave driver? My smc4000io_probe function
gets called correctly by of_spi support but when I register as follows:
static struct spi_driver smc4000io_driver = {
.driver = {
.name = "smc4000io",
.bus = &spi_bus_type,
.owner = THIS_MODULE,
},
.probe = smc4000io_probe,
.remove = __devexit_p(smc4000io_remove),
};
static int __init smc4000io_init(void)
{
return spi_register_driver(&smc4000io_driver);
}
static void __exit smc4000io_exit(void)
{
spi_unregister_driver(&smc4000io_driver);
}
module_init(smc4000io_init);
But when I do:
static struct of_platform_driver smc4000_spi_of_driver = {
.name = "smc4000io",
.match_table = smc4000io_of_match,
.probe = smc4000io_of_probe,
.remove = __devexit_p(smc4000io_of_remove),
};
static int __init smc4000io_init(void)
{
return of_register_platform_driver(&smc4000_spi_of_driver);
}
module_init(smc4000io_init);
Then my smc4000io_of_probe function never gets called.
Thanks in advance,
Henk.
On Wed, Oct 29, 2008 at 3:45 PM, Grant Likely <grant.likely@secretlab.ca>wrote:
> On Wed, Oct 29, 2008 at 7:43 AM, Henk Stegeman <henk.stegeman@gmail.com>
> wrote:
> > ..
> > ..
> > In my dts
> >
> > I have my chipselect defined as follows:
> >
> > gpt4: timer@640 { // General Purpose Timer GPT4 in GPIO mode
> for
> > SMC4000IO chip select.
> > compatible = "fsl,mpc5200b-gpt-gpio","fsl,mpc5200-gpt-gpio";
> > cell-index = <4>;
> > reg = <0x640 0x10>;
> > interrupts = <1 13 0>;
> > interrupt-parent = <&mpc5200_pic>;
> > gpio-controller;
> > #gpio-cells = <2>;
> > };
> >
> > I found the gpio in
> > # cat /sys/class/gpio/gpiochip215/label
> > /soc5200@f0000000/timer@640
> >
> > The spi controller is defined like this:
> >
> > spi@2400 {
> > device_type = "spi";
> > #address-cells = <1>;
> > #size-cells = <0>;
> > compatible = "fsl,mpc5200-psc-spi","fsl,mpc5200b-psc-spi";
> > cell-index = <2>;
> > reg = <2400 100>;
> > interrupts = <2 3 0>;
> > interrupt-parent = <&mpc5200_pic>;
> > gpios = <&gpt4 0 0>;
> >
> > io-controller@0 {
> > compatible = "microkey,smc4000io";
> > spi-max-frequency = <1000000>;
> > reg = <0>;
> > };
> > };
> >
> > At bootup linux (2.6.27) reports:
> >
> > mpc52xx-psc-spi f0000960.spi: probe called without platform data, no
> > (de)activate_cs function will be called.
> >
> > Is my assumption wrong that the gpios property is the way to map
> chipselects
> > to the spi driver?
>
> Yes, that is the way you should work specify the chip selects, but the
> driver hasn't been updated to support it yet.
>
> g.
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
>
[-- Attachment #2: Type: text/html, Size: 7559 bytes --]
^ permalink raw reply
* Not able to see any output if kernel module loaded for the first time
From: Vijay Nikam @ 2009-02-13 10:37 UTC (permalink / raw)
To: linuxppc-dev
Hello All,
I am facing perhaps some strange kind of problem. I have mpc8313erdb
eval board and wrote the GPIO driver, the driver is just making the
assigned GPIO[3] pin high and low.
If I load this module first time after bootup or if I make some change
in the code and compile and load the module, then I am not able to see
any output on the scope but if I load it again then I will be able to
see the output on the scopt that GPIO[3] pin has became high and low.
Later if I removed the kernel module and load it again then also I am
able to see the output on the scope, till I do the reboot or power-off
and on.
Could anyone let me know why this happening ... thanks ...
Kindly please acknowledge ... thank you ...
Kind Regards,
Vijay Nikam
^ permalink raw reply
* Re: [PATCH] powerpc: Fix _PAGE_CHG_MASK
From: Philippe Gerum @ 2009-02-13 10:01 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1234504015.26036.43.camel@pasglop>
Benjamin Herrenschmidt wrote:
> On Fri, 2009-02-13 at 13:49 +1100, Benjamin Herrenschmidt wrote:
>
>>> diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h
>>> index 75dded6..8298afc 100644
>>> --- a/arch/powerpc/include/asm/pgtable-ppc32.h
>>> +++ b/arch/powerpc/include/asm/pgtable-ppc32.h
>>> @@ -428,8 +428,8 @@ extern int icache_44x_need_flush;
>>> #define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE()
>>> #endif
>>>
>>> -#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_SPECIAL)
>>> -
>>> +#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \
>>> + _PAGE_SPECIAL)
>>>
>>> #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
>>> _PAGE_WRITETHRU | _PAGE_ENDIAN | \
>>>
>
> BTW. That part of the patch looks bad (ie, the original line isn't what
> is upstream). I've fixed up locally.
>
Sorry for this. I forgot to rebase my patch on mainline.
> Cheers,
> Ben.
>
>
>
--
Philippe.
^ permalink raw reply
* Re: [MPC8272ADS]Problem adding flash partitions inside the device tree
From: Jean-Michel Hautbois @ 2009-02-13 9:25 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20090212222403.GA10344@ld0162-tx32.am.freescale.net>
2009/2/12 Scott Wood <scottwood@freescale.com>:
> On Thu, Feb 12, 2009 at 03:26:58PM +0100, Jean-Michel Hautbois wrote:
>> I think that the problem is in the reg part, but I can't understand why.
>> Isn't it the RAM mpping of my MTD that is the first address ?
>
> No, it's the offset into the chipselect.
>
> -Scott
>
OK.
What means the word #adress-cells BTW ?
When should I have 1, 2 or anything else ?
Regards,
JM
^ permalink raw reply
* Re: 2.6.28 radeon.ko oops, QS22 (Cell) blade.
From: Benjamin Herrenschmidt @ 2009-02-13 9:02 UTC (permalink / raw)
To: Wartan Hachaturow; +Cc: linuxppc-dev
In-Reply-To: <4aaa2e1c0902100318l376be033g26d67ed88450a6e8@mail.gmail.com>
On Tue, 2009-02-10 at 14:18 +0300, Wartan Hachaturow wrote:
> Hi there.
>
> While trying to bring up X.org on this beast, I've stumbled upon this
> oops in radeon.ko
> (right on the first write attempt):
You may want to get whatever latest patches are in Dave Airlie's
dri-next tree. I've fixed a number of bugs in the DRI relative to having
PCI physical addresses above 4G, which probably will help.
Also, try at first with a kernel compiled for 4K pages, I know that
works with an R5xx on the 440 setup I've been hacking that on, and I
also know that I've been having problems when trying to use 64K pages,
which I haven't had time to investigate and fix yet.
You may also want to look at the batch of patch that Dave Miller sent to
the DRM list yesterday or so, fixing a whole bunch of additional bugs in
the DRM, among other, the wrong direction being set in the iommu which
would have caused problems on Cell.
With all those patches together, the latest xf86-video-ati from X.org
git, and a libpciaccess-enabled X server, there are some chances that it
will work.
Cheers,
Ben.
> [drm] Initialized drm 1.1.0 20060810
> pci 0005:01:00.0: enabling device (0140 -> 0143)
> [drm] Initialized radeon 1.29.0 20080528 on minor 0
> [drm] Setting GART location based on new memory map
> [drm] GART aligned down from 0x04010000 to 0x04000000
> [drm] Loading R500 Microcode
> [drm] Num pipes: 1
> [drm] writeback test failed
> [drm] BEGIN_RING( 8 )
> [drm] OUT_RING( 0x000005c9 ) at 0x6402505
> Unable to handle kernel paging request for data at address 0xd00000001a04c414
> Faulting instruction address: 0xd000000000fd6d68
> Oops: Kernel access of bad area, sig: 11 [#1]
> SMP NR_CPUS=128 NUMA Cell
> Modules linked in: radeon drm sunrpc pmi tg3 mptsas mptscsih mptbase
> scsi_transport_sas
> NIP: d000000000fd6d68 LR: d000000000fd6d54 CTR: 0000000000000001
> REGS: c0000000fb4f38b0 TRAP: 0300 Not tainted (2.6.28-lks-wks-alt1)
> MSR: 9000000000009032 <EE,ME,IR,DR> CR: 24004424 XER: 20000000
> DAR: d00000001a04c414, DSISR: 0000000042000000
> TASK = c0000000fb4e4f50[4088] 'X' THREAD: c0000000fb4f0000 CPU: 2
> GPR00: 00000000000005c9 c0000000fb4f3b30 d000000001016c80 d000000000fff578
> GPR04: 0000000000000000 ffffffffffffffff c00000000097d6b0 c000000000805554
> GPR08: 000000000001ffff 0000000019009414 c00000000097d6b4 0000000000000001
> GPR12: d000000000ffab80 c000000000952800 0000000000000005 0000000000000000
> GPR16: 00000000100b3e50 0000000010090000 0000000010080000 0000000010090000
> GPR20: 00000000100b3e80 0000000000000000 0000000000000006 0000000000000000
> GPR24: ffffffffffffffea d000000001043000 c0000000fecba000 000000000003ffff
> GPR28: d000000000fff578 0000000006402506 d000000001015b38 c0000000fecbf000
> NIP [d000000000fd6d68] .radeon_cp_start+0x358/0x73c [radeon]
> LR [d000000000fd6d54] .radeon_cp_start+0x344/0x73c [radeon]
> Call Trace:
> [c0000000fb4f3b30] [d000000000fd6d54] .radeon_cp_start+0x344/0x73c [radeon]
> (unreliable)
> [c0000000fb4f3be0] [d000000000d9cbbc] .drm_ioctl+0x230/0x300 [drm]
> [c0000000fb4f3ca0] [d000000000ff8e98] .radeon_compat_ioctl+0xb4/0xfc [radeon]
> [c0000000fb4f3d40] [c000000000189944] .compat_sys_ioctl+0x140/0x488
> [c0000000fb4f3e30] [c000000000008570] syscall_exit+0x0/0x40
> Instruction dump:
> 388005c9 837a002c 3929ffe0 7fa5eb78 7f83e378 913a0030 48023e31 e8410028
> 7ba91764 380005c9 3bbd0001 7f83e378 <7c19492e> 38800033 7fbdd838 7fbd07b4
> ---[ end trace b46b031df5997cbf ]---
> [drm:drm_release] *ERROR* Device busy: 1 0
>
> Any quick ideas for me to check? The ring address seems to be quite strange.
>
^ permalink raw reply
* Re: writel hangs system
From: Tobias Knutsson @ 2009-02-13 6:30 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <fa686aa40902121318i65ec44edtf119a6ad2d4d1570@mail.gmail.com>
There seems to be some magic force linked to this mailing list.
Whenever I post a question, the matter seems to resolve itself. :)
In order to stay as consistent as possible with the old 2.4 kernel, I
used the same mapping that they had:
0x50000000 - 0x6000000000 for memory
0x60000000 - 0x6100000000 for I/O
When I changed it to the default that was in the lite5200b device tree
I could access the memory regions as well.
Thanks for your help!
On Thu, Feb 12, 2009 at 22:18, Grant Likely <grant.likely@secretlab.ca> wro=
te:
> On Tue, Feb 10, 2009 at 6:07 AM, Tobias Knutsson
> <tobias.knutsson@gmail.com> wrote:
>> Hello,
>>
>> I'm in the process of porting a PCI-driver for a dsp-board from 2.4 to
>> 2.6. The probing of the driver goes well, IRQs are setup, resources
>> are claimed and remapped without any problems. Reading from I/O
>> regions also works well. However, when i try to read or write to a
>> memory region using readl/writel, the system instantly hangs. No
>> stacktrace or anything, it just stops.
>
> Hmmm. Not good. Are you able to access the memory regions from the
> U-Boot console?
>
> g.
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
>
--=20
H=E4lsningar/Regards
Tobias Knutsson
^ permalink raw reply
* Re: [PATCH] powerpc: Fix _PAGE_CHG_MASK
From: Benjamin Herrenschmidt @ 2009-02-13 5:46 UTC (permalink / raw)
To: rpm; +Cc: linuxppc-dev
In-Reply-To: <1234493350.29851.80.camel@pasglop>
On Fri, 2009-02-13 at 13:49 +1100, Benjamin Herrenschmidt wrote:
> > diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h
> > index 75dded6..8298afc 100644
> > --- a/arch/powerpc/include/asm/pgtable-ppc32.h
> > +++ b/arch/powerpc/include/asm/pgtable-ppc32.h
> > @@ -428,8 +428,8 @@ extern int icache_44x_need_flush;
> > #define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE()
> > #endif
> >
> > -#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_SPECIAL)
> > -
> > +#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \
> > + _PAGE_SPECIAL)
> >
> > #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
> > _PAGE_WRITETHRU | _PAGE_ENDIAN | \
> >
BTW. That part of the patch looks bad (ie, the original line isn't what
is upstream). I've fixed up locally.
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH] powerpc: Add support for using doorbells for SMP IPI
From: Benjamin Herrenschmidt @ 2009-02-13 5:25 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <10CBF092-BD35-4A99-B4E7-44AA43B731AA@kernel.crashing.org>
> crit doorbell for xmon IPI sounds interesting. However, I don't
> following about use of external CRITs for IPIs.
Just a finger not following the brain :-) I meant for NMI's
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 3/7][RFC] powerpc64, tracing: add function graph tracer with dynamic tracing
From: Steven Rostedt @ 2009-02-13 5:22 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Frederic Weisbecker, linux-kernel, linuxppc-dev, Steven Rostedt,
Paul Mackerras, Ingo Molnar, Andrew Morton
In-Reply-To: <1234498509.26036.35.camel@pasglop>
On Fri, 13 Feb 2009, Benjamin Herrenschmidt wrote:
>
> > @@ -55,8 +56,9 @@ static unsigned char *ftrace_call_replace(unsigned
> > long ip, unsigned long addr)
> > */
> > addr = GET_ADDR(addr);
> >
> > - /* Set to "bl addr" */
> > - op = 0x48000001 | (ftrace_calc_offset(ip, addr) & 0x03fffffc);
> > + /* if (link) set op to 'bl' else 'b' */
> > + op = 0x48000000 | (link ? 1 : 0);
> > + op |= (ftrace_calc_offset(ip, addr) & 0x03fffffc);
>
> Any reason why you aren't using the code in
> arch/powerpc/lib/code-patching.c here ?
Yes, because I did not know about it ;-)
I'll write up a patch to change this. But I'll post this series as is for
now.
Thanks,
-- Steve
^ permalink raw reply
* Re: [PATCH] powerpc: Add support for using doorbells for SMP IPI
From: Kumar Gala @ 2009-02-13 5:10 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1234493200.29851.79.camel@pasglop>
On Feb 12, 2009, at 8:46 PM, Benjamin Herrenschmidt wrote:
> On Thu, 2009-02-12 at 17:54 -0600, Kumar Gala wrote:
>> The e500mc supports the new msgsnd/doorbell mechanisms that were
>> added in
>> the Power ISA 2.05 architecture. We use the normal level doorbell
>> for
>> doing SMP IPIs at this point.
>>
>
> Cool stuff. Haven't reviewed in details yet tho :-) But I was
> thinking...
>
> We should introduce a special xmon variant of local_irq_save/restore
> for
> use by xmon that masks MSR:CE and use a crit doorbell for xmon IPI,
> that
> would increase significantly the ability of xmon to catch deadlocked
> CPUs, and we could use external CRITs as a more generic way of doing
> IPIs, no ?
crit doorbell for xmon IPI sounds interesting. However, I don't
following about use of external CRITs for IPIs.
> In fact, we should expose a local_crit_irq_save/restore (disable/
> enable)
> too for things like watchdog drivers etc... which may want to use
> these.
Yeah, probably a good thing for us to add.
- k
^ permalink raw reply
* [PATCH] powerpc: fix VSX alignment handler for regs 32-63
From: Michael Neuling @ 2009-02-13 5:08 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
Fix the VSX alignment handler for VSX registers > 32. 32-63 are stored
in the VMX part of the thread_struct not the FPR part.
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
arch/powerpc/kernel/align.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Index: linux-2.6-ozlabs/arch/powerpc/kernel/align.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/align.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/align.c
@@ -646,11 +646,16 @@ static int emulate_vsx(unsigned char __u
unsigned int areg, struct pt_regs *regs,
unsigned int flags, unsigned int length)
{
- char *ptr = (char *) ¤t->thread.TS_FPR(reg);
+ char *ptr;
int ret = 0;
flush_vsx_to_thread(current);
+ if (reg < 32)
+ ptr = (char *) ¤t->thread.TS_FPR(reg);
+ else
+ ptr = (char *) ¤t->thread.vr[reg - 32];
+
if (flags & ST)
ret = __copy_to_user(addr, ptr, length);
else {
^ permalink raw reply
* Re: [PATCH 3/7][RFC] powerpc64, tracing: add function graph tracer with dynamic tracing
From: Steven Rostedt @ 2009-02-13 4:20 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Frederic Weisbecker, linux-kernel, linuxppc-dev, Steven Rostedt,
Paul Mackerras, Ingo Molnar, Andrew Morton
In-Reply-To: <1234498509.26036.35.camel@pasglop>
On Fri, 13 Feb 2009, Benjamin Herrenschmidt wrote:
>
> > @@ -55,8 +56,9 @@ static unsigned char *ftrace_call_replace(unsigned
> > long ip, unsigned long addr)
> > */
> > addr = GET_ADDR(addr);
> >
> > - /* Set to "bl addr" */
> > - op = 0x48000001 | (ftrace_calc_offset(ip, addr) & 0x03fffffc);
> > + /* if (link) set op to 'bl' else 'b' */
> > + op = 0x48000000 | (link ? 1 : 0);
> > + op |= (ftrace_calc_offset(ip, addr) & 0x03fffffc);
>
> Any reason why you aren't using the code in
> arch/powerpc/lib/code-patching.c here ?
>
> > new = ftrace_call_replace(ip, stub, 0);
> > + memcpy(old, new, MCOUNT_INSN_SIZE);
> > + new = ftrace_call_replace(ip, addr, 0);
> > +
> > + return ftrace_modify_code(ip, old, new);
> > +}
>
> Heh, memcpy of 4 bytes :-) I hope gcc is smart enough to turn that into
> a simple load/store ..
hehe, I hated writing that. I just did not want to touch the (already
working code) of the dynamic ftrace. I guess I could still use longs and
then typecast them to char pointers for the ftrace_modify_code.
Thanks,
-- Steve
^ permalink raw reply
* Re: [PATCH 0/7][RFC] function graph tracer port to PowerPC
From: Benjamin Herrenschmidt @ 2009-02-13 4:18 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: linux-kernel, Steven Rostedt, linuxppc-dev, Paul Mackerras,
Andrew Morton, Ingo Molnar
In-Reply-To: <20090212015503.GA4697@nowhere>
For some reason I didn't get 7/7 ...
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 2/7][RFC] powerpc64: port of the function graph tracer
From: Steven Rostedt @ 2009-02-13 4:18 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Frederic Weisbecker, linux-kernel, linuxppc-dev, Steven Rostedt,
Paul Mackerras, Ingo Molnar, Andrew Morton
In-Reply-To: <1234498320.26036.33.camel@pasglop>
On Fri, 13 Feb 2009, Benjamin Herrenschmidt wrote:
> > On Wed, 2009-02-11 at 20:10 -0500, Steven Rostedt wrote:
> >
> > +# timers used by tracing
> > +CFLAGS_REMOVE_time.o = -pg -mno-sched-epilog
> > endif
>
> That means no tracing of the timer interrupts etc... maybe we should
> just move the specific function that we don't want traced out to a
> separate file ?
The function graph tracer calls cpu_clock, which calls sched_clock,
to get the times. There's no protection against recursion here, since
we want to let interrupts still be recorded, and we do not need to disable
interrupts.
But if the cpu_clock calls something that is traced, it will recurse, and
cause a lockup. What ever functions those are, we could annotate with
notrace. I just used the x86 blind method of 'dont trace this file'.
>
> Appart from that, it looks ok, though I might have missed something :-)
Thanks,
-- Steve
^ permalink raw reply
* Re: [PATCH 3/7][RFC] powerpc64, tracing: add function graph tracer with dynamic tracing
From: Benjamin Herrenschmidt @ 2009-02-13 4:15 UTC (permalink / raw)
To: Steven Rostedt
Cc: Frederic Weisbecker, linux-kernel, linuxppc-dev, Steven Rostedt,
Paul Mackerras, Ingo Molnar, Andrew Morton
In-Reply-To: <20090212011343.074329920@goodmis.org>
> @@ -55,8 +56,9 @@ static unsigned char *ftrace_call_replace(unsigned
> long ip, unsigned long addr)
> */
> addr = GET_ADDR(addr);
>
> - /* Set to "bl addr" */
> - op = 0x48000001 | (ftrace_calc_offset(ip, addr) & 0x03fffffc);
> + /* if (link) set op to 'bl' else 'b' */
> + op = 0x48000000 | (link ? 1 : 0);
> + op |= (ftrace_calc_offset(ip, addr) & 0x03fffffc);
Any reason why you aren't using the code in
arch/powerpc/lib/code-patching.c here ?
> new = ftrace_call_replace(ip, stub, 0);
> + memcpy(old, new, MCOUNT_INSN_SIZE);
> + new = ftrace_call_replace(ip, addr, 0);
> +
> + return ftrace_modify_code(ip, old, new);
> +}
Heh, memcpy of 4 bytes :-) I hope gcc is smart enough to turn that into
a simple load/store ..
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 2/7][RFC] powerpc64: port of the function graph tracer
From: Benjamin Herrenschmidt @ 2009-02-13 4:12 UTC (permalink / raw)
To: Steven Rostedt
Cc: Frederic Weisbecker, linux-kernel, linuxppc-dev, Steven Rostedt,
Paul Mackerras, Ingo Molnar, Andrew Morton
In-Reply-To: <20090212011342.880486000@goodmis.org>
> On Wed, 2009-02-11 at 20:10 -0500, Steven Rostedt wrote:
>
> +# timers used by tracing
> +CFLAGS_REMOVE_time.o = -pg -mno-sched-epilog
> endif
That means no tracing of the timer interrupts etc... maybe we should
just move the specific function that we don't want traced out to a
separate file ?
Appart from that, it looks ok, though I might have missed something :-)
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 002/002] de2104x: support for systems lacking cache coherence
From: Benjamin Herrenschmidt @ 2009-02-13 3:26 UTC (permalink / raw)
To: Risto Suominen; +Cc: LinuxPPC-dev
In-Reply-To: <46e1c7760902120322r11cffbdcgff330a242ca586fb@mail.gmail.com>
On Thu, 2009-02-12 at 13:22 +0200, Risto Suominen wrote:
> Here is a patch that helped me to get my de2104x NIC working on my
> PowerMac 5500. As an interesting side effect, it also made my mesh
> module crash.
Can you tell me more about the mesh crash ? Do you have a log ?
Ben.
^ permalink raw reply
* Re: [PATCH 002/002] de2104x: support for systems lacking cache coherence
From: Benjamin Herrenschmidt @ 2009-02-13 3:25 UTC (permalink / raw)
To: Risto Suominen; +Cc: LinuxPPC-dev
In-Reply-To: <46e1c7760902120322r11cffbdcgff330a242ca586fb@mail.gmail.com>
On Thu, 2009-02-12 at 13:22 +0200, Risto Suominen wrote:
> Here is a patch that helped me to get my de2104x NIC working on my
> PowerMac 5500. As an interesting side effect, it also made my mesh
> module crash.
>
> Background can be found here: http://www.spinics.net/lists/netdev/msg88488.html
I'll catch up with the discussion in netdev, I think the workaround
should be in the driver... Or if not, we can do special dma-ops just for
that device.
Just to make sure I didn't miss something, please send me a tarball
of /proc/device-tree of your machine.
Cheers,
Ben.
> Risto
>
> Allow setting NOT_COHERENT_CACHE explicitly.
>
> Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
> ---
> The testing is done on kernel version 2.6.24.
>
> --- a/arch/powerpc/platforms/powermac/Kconfig.org 2008-01-25
> 00:58:37.000000000 +0200
> +++ b/arch/powerpc/platforms/powermac/Kconfig 2009-02-10
> 17:44:24.000000000 +0200
> @@ -18,4 +18,10 @@ config PPC_PMAC64
> select PPC_970_NAP
> default y
>
> -
> +config NOT_COHERENT_CACHE
> + bool "Incoherent cache"
> + default n
> + help
> + Setting this option may be necessary for avoiding cache-related
> + problems with some network cards on some platforms. An example is
> + 2104x and PowerMac 5500.
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH] powerpc: Fix _PAGE_CHG_MASK
From: Benjamin Herrenschmidt @ 2009-02-13 2:49 UTC (permalink / raw)
To: rpm; +Cc: linuxppc-dev
In-Reply-To: <4994A046.2080806@xenomai.org>
On Thu, 2009-02-12 at 23:18 +0100, Philippe Gerum wrote:
> Fix _PAGE_CHG_MASK so that pte_modify() does not affect the _PAGE_SPECIAL bit.
>
> Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Good catch ! Thanks !
Ben.
> --
>
> arch/powerpc/include/asm/pgtable-4k.h | 2 +-
> arch/powerpc/include/asm/pgtable-64k.h | 2 +-
> arch/powerpc/include/asm/pgtable-ppc32.h | 4 ++--
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/pgtable-4k.h b/arch/powerpc/include/asm/pgtable-4k.h
> index 6b18ba9..1dbca4e 100644
> --- a/arch/powerpc/include/asm/pgtable-4k.h
> +++ b/arch/powerpc/include/asm/pgtable-4k.h
> @@ -60,7 +60,7 @@
> /* It should be preserving the high 48 bits and then specifically */
> /* preserving _PAGE_SECONDARY | _PAGE_GROUP_IX */
> #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \
> - _PAGE_HPTEFLAGS)
> + _PAGE_HPTEFLAGS | _PAGE_SPECIAL)
>
> /* Bits to mask out from a PMD to get to the PTE page */
> #define PMD_MASKED_BITS 0
> diff --git a/arch/powerpc/include/asm/pgtable-64k.h b/arch/powerpc/include/asm/pgtable-64k.h
> index 07b0d8f..7389003 100644
> --- a/arch/powerpc/include/asm/pgtable-64k.h
> +++ b/arch/powerpc/include/asm/pgtable-64k.h
> @@ -114,7 +114,7 @@ static inline struct subpage_prot_table *pgd_subpage_prot(pgd_t *pgd)
> * pgprot changes
> */
> #define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \
> - _PAGE_ACCESSED)
> + _PAGE_ACCESSED | _PAGE_SPECIAL)
>
> /* Bits to mask out from a PMD to get to the PTE page */
> #define PMD_MASKED_BITS 0x1ff
> diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h
> index 75dded6..8298afc 100644
> --- a/arch/powerpc/include/asm/pgtable-ppc32.h
> +++ b/arch/powerpc/include/asm/pgtable-ppc32.h
> @@ -428,8 +428,8 @@ extern int icache_44x_need_flush;
> #define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE()
> #endif
>
> -#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_SPECIAL)
> -
> +#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \
> + _PAGE_SPECIAL)
>
> #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
> _PAGE_WRITETHRU | _PAGE_ENDIAN | \
>
^ permalink raw reply
* Re: [PATCH] powerpc: Add support for using doorbells for SMP IPI
From: Benjamin Herrenschmidt @ 2009-02-13 2:46 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <1234482893-17712-1-git-send-email-galak@kernel.crashing.org>
On Thu, 2009-02-12 at 17:54 -0600, Kumar Gala wrote:
> The e500mc supports the new msgsnd/doorbell mechanisms that were added in
> the Power ISA 2.05 architecture. We use the normal level doorbell for
> doing SMP IPIs at this point.
>
Cool stuff. Haven't reviewed in details yet tho :-) But I was
thinking...
We should introduce a special xmon variant of local_irq_save/restore for
use by xmon that masks MSR:CE and use a crit doorbell for xmon IPI, that
would increase significantly the ability of xmon to catch deadlocked
CPUs, and we could use external CRITs as a more generic way of doing
IPIs, no ?
In fact, we should expose a local_crit_irq_save/restore (disable/enable)
too for things like watchdog drivers etc... which may want to use these.
Cheers,
Ben.
^ permalink raw reply
* RE: [PATCH] powerpc/83xx: Revive Marvell PHY option onMPC8313E-RDB rev. C boards
From: Li Yang-R58472 @ 2009-02-13 2:24 UTC (permalink / raw)
To: avorontsov, Kumar Gala; +Cc: linuxppc-dev list
In-Reply-To: <20090213011801.GA28509@oksana.dev.rtsoft.ru>
> -----Original Message-----
> From: Anton Vorontsov [mailto:avorontsov@ru.mvista.com]=20
> Sent: Friday, February 13, 2009 9:18 AM
> To: Kumar Gala
> Cc: linuxppc-dev list; Li Yang-R58472
> Subject: Re: [PATCH] powerpc/83xx: Revive Marvell PHY option=20
> onMPC8313E-RDB rev. C boards
>=20
> On Thu, Feb 12, 2009 at 05:51:57PM -0600, Kumar Gala wrote:
> > On Feb 11, 2009, at 11:40 PM, Li Yang-R58472 wrote:
> >>>> Li, thanks for heads-up!
> >>>>
> >>>> One thing though: documentation says that Marvell PHY
> >>> address is 0x3,
> >>>> while old device tree and this patch:
> >>>>
> >>>>
> >>> http://www.bitshrine.org/gpp/linux-fsl-2.6.23-MPC8313ERDB-add-
> >>> default-
> >>>> dts.patch
> >>>>
> >>>> says "0x1"... I don't have any rev. C boards, so it would
> >>> be great if
> >>>> somebody could confirm that 0x1 is the actual address.
> >>
> >> The correct address is 0x3. The previous patch in revB BSP used a=20
> >> guess value before the revC documentation is available. =20
> The latest=20
> >> BSP has been updated to use the correct address.
> >
> > Anton, will you spin a new patch with this change?
>=20
> Since the correct address is 0x3, that means that the old=20
> device tree never worked on rev. C boards, thus there is no=20
> regression.
> And furthermore, it appears that U-Boot doesn't support=20
> Marvell PHY option either.
No regression but to be more updated. RevC boards are newly introduced.
>=20
> So, I don't think that adding the new device tree makes any sense now.
>=20
> I think the better option would be to implement Marvell PHY=20
> support in U-Boot, and at the same time teach U-Boot to fixup=20
> 8313rdb's device tree depending on the environment variable=20
> (something like setenv marvell_phy_option yes/no), i.e. like=20
> I did for MPC8315E-RDB's ULPI/TSEC1 options:
>=20
> http://lists.denx.de/pipermail/u-boot/2008-July/036553.html
This approach is surely more user friendly.
- Leo
^ permalink raw reply
* Re: [PATCH] powerpc/83xx: Revive Marvell PHY option on MPC8313E-RDB rev. C boards
From: Anton Vorontsov @ 2009-02-13 1:18 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev list
In-Reply-To: <F0245D03-4191-4482-B007-603C3DAC8A1A@kernel.crashing.org>
On Thu, Feb 12, 2009 at 05:51:57PM -0600, Kumar Gala wrote:
> On Feb 11, 2009, at 11:40 PM, Li Yang-R58472 wrote:
>>>> Li, thanks for heads-up!
>>>>
>>>> One thing though: documentation says that Marvell PHY
>>> address is 0x3,
>>>> while old device tree and this patch:
>>>>
>>>>
>>> http://www.bitshrine.org/gpp/linux-fsl-2.6.23-MPC8313ERDB-add-
>>> default-
>>>> dts.patch
>>>>
>>>> says "0x1"... I don't have any rev. C boards, so it would
>>> be great if
>>>> somebody could confirm that 0x1 is the actual address.
>>
>> The correct address is 0x3. The previous patch in revB BSP used a
>> guess
>> value before the revC documentation is available. The latest BSP has
>> been updated to use the correct address.
>
> Anton, will you spin a new patch with this change?
Since the correct address is 0x3, that means that the old device
tree never worked on rev. C boards, thus there is no regression.
And furthermore, it appears that U-Boot doesn't support Marvell
PHY option either.
So, I don't think that adding the new device tree makes any sense
now.
I think the better option would be to implement Marvell PHY support
in U-Boot, and at the same time teach U-Boot to fixup 8313rdb's
device tree depending on the environment variable (something like
setenv marvell_phy_option yes/no), i.e. like I did for
MPC8315E-RDB's ULPI/TSEC1 options:
http://lists.denx.de/pipermail/u-boot/2008-July/036553.html
Makes sense? If not, I'll readily respin this patch with the PHY
address change.
Thanks,
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ 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