Re: How to add platform specific data to a of_device

2007-07-16 Thread Robert Schwebel
On Sun, Jul 15, 2007 at 06:48:53AM +1000, Benjamin Herrenschmidt wrote:
 Your approach would work I suppose though it's a bit ugly.

Speaking of uggly, I'm still wondering why this oftree stuff for powerpc
must be s complicated. If you come from the ARM-linux world like we
do, the whole powerpc BSP stuff looks like a completely overengineered
piece of code, introducing complexity where it isn't necessary. But it
may be that it's just me not knowing powerpc kernel requirements deeply
enough :)

For most of the devices on for example the MPC5200B and MPC8260 I would
just model them as platform devices; there could be a simple

oftree - oftree-interpreter - bunch of platform devices

mapping. Is there a reason why there is sooo much interaction of the
platform code with the oftree? We usually have the situation that, if
something goes wrong, you have to change

- the driver
- the platform code
- the oftree

and they often contain redundant information (like names of oftree
nodes, which change more often than some people's panties).

Robert
-- 
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
 Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [Cbe-oss-dev] PS3 improved video mode autodetection for HDMI/DVI

2007-07-16 Thread Geert Uytterhoeven
On Fri, 13 Jul 2007, Ranulf Doswell wrote:
Since 720p is a broadcast mode, I can't make it default to fullscreen,
  as a
part of the image will fall off on most monitors.
  
   Do you have any info from the EDID block that would tell you whether the
   monitor displays the full picture (typical of flat panels) or not ?
  
 
 That's not always true anyway. My 1680x1050 panel, for instance, displays
 1080i/p and 720p as stretched images with the edges slightly off the screen.
 It's great for TV, but *really* irritating with the PS3!

So I guess you're interested in a feature called `configurable black borders'?

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:   [EMAIL PROTECTED] 
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___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH 1/1] libata: pata_pdc2027x PLL input clock fix

2007-07-16 Thread Albert Lee
Mikael Pettersson wrote:
 On Wed, 11 Jul 2007 10:45:35 +0800, Albert Lee wrote:
 
So, it seems both mdelay(37) and do_gettimeofday() are working properly on 
PowerMac G3.
Maybe the calculated wrong PLL input is due to wrong reading of the counter 
register?
Could you please try the attached debug patch for more clue, thanks.
 
 
 This, supposedly debug-only, patch gives me much better PLL calibration:
 
 pata_pdc2027x :00:0e.0: version 0.9
 bccrh [0] bccrl [0]
 bccrhv[0] bccrlv[0]
 bccrh [7FCF] bccrl [15ED]
 bccrhv[7FCF] bccrlv[15D4]
 start[0] end[1072141805] 
 usec_elapsed for mdelay(100) [105500]
 start time: [1184152411]s [689475]us 
 end   time: [1184152411]s [794975]us 
 PLL input clock[-1563248254]Hz
 usec_elapsed for mdelay(37) [35432]
 start time: [1184152411]s [818033]us 
 end   time: [1184152411]s [853465]us 
 bccrh [7FC9] bccrl [1A4B]
 bccrhv[7FC9] bccrlv[1A4B]
 bccrh [7F98] bccrl [3038]
 bccrhv[7F98] bccrlv[301F]
 start[1071946315] end[1070346296] 
 usec_elapsed for mdelay(100) [103571]
 start time: [1184152411]s [874717]us 
 end   time: [1184152411]s [978288]us 
 PLL input clock[1544]Hz
 usec_elapsed for mdelay(37) [35431]
 start time: [1184152411]s [997039]us 
 end   time: [1184152412]s [32470]us 
 pata_pdc2027x :00:0e.0: PLL input clock 15440 kHz
 
 and from then on things are fine.
 
 Weird. I'll try with an older gcc later (been using gcc-4.2.0 so far).
 

Is the problem reproducible with more reload loops? Maybe we could try
something like:

#!/bin/sh
while : ; do 
  rmmod pata_pdc2027x
  sleep 1
  modprobe pata_pdc2027x
done

and tail -f /var/log/messages|grep PLL  pll_test.log to check the
PLL clock.
--
albert

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: possible dead CONFIG-related content under arch/powerpc

2007-07-16 Thread Geert Uytterhoeven
On Sat, 14 Jul 2007, Robert P. J. Day wrote:
 == SPE_BASE ==
 arch/powerpc/mm/hash_utils_64.c:612:#ifdef CONFIG_SPE_BASE
 arch/powerpc/mm/hash_utils_64.c:747:#ifdef CONFIG_SPE_BASE

Interesting, should this one be CONFIG_SPU_BASE?

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:   [EMAIL PROTECTED] 
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___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [patch] use __attribute__ in asm-powerpc

2007-07-16 Thread Robert P. J. Day
On Mon, 16 Jul 2007, Geert Uytterhoeven wrote:

 On Sat, 14 Jul 2007, Mike Frysinger wrote:
  Pretty much everyone uses __attribute__ or attribute, no one
  uses __attribute.  This patch tweaks the three places in asm-powerpc where
  this comes up.  While only asm-powerpc/types.h is interesting (for 
  userspace),
  I did asm-powerpc/processor.h as well for consistency.
 
  Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
  ---
  diff --git a/include/asm-powerpc/processor.h 
  b/include/asm-powerpc/processor.h
  index d947b16..2ce6ea6 100644
  --- a/include/asm-powerpc/processor.h
  +++ b/include/asm-powerpc/processor.h
  @@ -153,9 +153,9 @@ struct thread_struct {
  unsigned long   dabr;   /* Data address breakpoint register */
   #ifdef CONFIG_ALTIVEC
  /* Complete AltiVec register set */
  -   vector128   vr[32] __attribute((aligned(16)));
  +   vector128   vr[32] __attribute__((aligned(16)));

 If the code is not exported to userspace (and thus not subject to
 different compilers), I think the preferred form is plain
 `attribute'.

compiler-gcc.h also defines the common form of the shortcut:

#define __aligned(x)__attribute__((aligned(x)))

rday
-- 

Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [patch 5/6] ps3: BD/DVD/CD-ROM Storage Driver

2007-07-16 Thread Geert Uytterhoeven
On Fri, 13 Jul 2007, Geert Uytterhoeven wrote:
 Ah, that explains it. flush_dcache_page() is used in some drivers.
 I'll update my patches. Thanks for the comments!

Does this look OK?
  - Replaced KM_USER0 by KM_IRQ0 (all routines are either called from an
interrupt handler, from .request_fn (ps3disk), or from .queuecommand
(ps3rom))
  - Add a call to flush_kernel_dcache_page() in routines that write to buffers

If this is OK, I'll fold it into my original patch series and will resend.

Thanks!

---
 drivers/block/ps3disk.c |5 +++--
 drivers/scsi/ps3rom.c   |9 +
 2 files changed, 8 insertions(+), 6 deletions(-)

--- a/drivers/block/ps3disk.c
+++ b/drivers/block/ps3disk.c
@@ -109,13 +109,14 @@ static void ps3disk_scatter_gather(struc
bio_sectors(bio), sector);
bio_for_each_segment(bvec, bio, j) {
size = bio_cur_sectors(bio)*KERNEL_SECTOR_SIZE;
-   buf = __bio_kmap_atomic(bio, j, KM_USER0);
+   buf = __bio_kmap_atomic(bio, j, KM_IRQ0);
if (gather)
memcpy(dev-bounce_buf+offset, buf, size);
else
memcpy(buf, dev-bounce_buf+offset, size);
offset += size;
-   __bio_kunmap_atomic(bio, KM_USER0);
+   flush_kernel_dcache_page(bio_iovec_idx(bio, 
j)-bv_page);
+   __bio_kunmap_atomic(bio, KM_IRQ0);
}
sectors += bio_sectors(bio);
i++;
--- a/drivers/scsi/ps3rom.c
+++ b/drivers/scsi/ps3rom.c
@@ -112,7 +112,7 @@ static int fill_from_dev_buffer(struct s
active = 1;
for (k = 0, req_len = 0, act_len = 0; k  cmd-use_sg; ++k, ++sgpnt) {
if (active) {
-   kaddr = kmap_atomic(sgpnt-page, KM_USER0);
+   kaddr = kmap_atomic(sgpnt-page, KM_IRQ0);
if (!kaddr)
return -1;
len = sgpnt-length;
@@ -121,7 +121,8 @@ static int fill_from_dev_buffer(struct s
len = buflen - req_len;
}
memcpy(kaddr + sgpnt-offset, buf + req_len, len);
-   kunmap_atomic(kaddr, KM_USER0);
+   flush_kernel_dcache_page(sgpnt-page);
+   kunmap_atomic(kaddr, KM_IRQ0);
act_len += len;
}
req_len += sgpnt-length;
@@ -149,7 +150,7 @@ static int fetch_to_dev_buffer(struct sc
 
sgpnt = cmd-request_buffer;
for (k = 0, req_len = 0, fin = 0; k  cmd-use_sg; ++k, ++sgpnt) {
-   kaddr = kmap_atomic(sgpnt-page, KM_USER0);
+   kaddr = kmap_atomic(sgpnt-page, KM_IRQ0);
if (!kaddr)
return -1;
len = sgpnt-length;
@@ -158,7 +159,7 @@ static int fetch_to_dev_buffer(struct sc
fin = 1;
}
memcpy(buf + req_len, kaddr + sgpnt-offset, len);
-   kunmap_atomic(kaddr, KM_USER0);
+   kunmap_atomic(kaddr, KM_IRQ0);
if (fin)
return req_len + len;
req_len += sgpnt-length;

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:   [EMAIL PROTECTED] 
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___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [patch 5/6] ps3: BD/DVD/CD-ROM Storage Driver

2007-07-16 Thread Segher Boessenkool
 I'm pretty sure that no ppc64 machine needs alias resolution in  
 the kernel,
 although some are VIPT. Last time we discussed this, Segher  
 explained it
 to me, but I don't remember which way Cell does it. IIRC, it  
 automatically
 flushes cache lines that are accessed through aliases.

 Ah yes, I remember reading about this automatic flushing thing. I  
 don't
 know how the caches actually work on most of our PPC's, but the  
 fact is,
 we don't have aliasing issues, so I can safely ignore it for a bit
 longer :-)

That is the very short version of the story, yes: some
PowerPC implementations are VIPT physically, but there
are no aliasing issues we have to worry about.

Anyone interested in how this works, can download the
PPC970 UM (or 970FX or 970MP); it has a very detailed
explanation of all this.  Cell might be slightly different
but the base idea is the same.


Segher

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [patch 5/6] ps3: BD/DVD/CD-ROM Storage Driver

2007-07-16 Thread Jens Axboe
On Mon, Jul 16 2007, Geert Uytterhoeven wrote:
 On Fri, 13 Jul 2007, Geert Uytterhoeven wrote:
  Ah, that explains it. flush_dcache_page() is used in some drivers.
  I'll update my patches. Thanks for the comments!
 
 Does this look OK?
   - Replaced KM_USER0 by KM_IRQ0 (all routines are either called from an
 interrupt handler, from .request_fn (ps3disk), or from .queuecommand
 (ps3rom))

That looks good.

   - Add a call to flush_kernel_dcache_page() in routines that write to buffers

Hmm, I would have thought a flush_dcache_page() would be more
appropriate, the backing could be page cache pages.

-- 
Jens Axboe

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Legacy ISA registers/interrupts in PCI device tree node

2007-07-16 Thread Segher Boessenkool
 I wonder, if there is a recommended way to specify ISA register  
 addresses
 and interrupts for a PCI device (unlike for a PCI2ISA bridge)?

The PCI binding describes the required way to do this.

 The device in question is the integrated IDE controller of the VIA686B
 southbridge, which works in compatible/legacy mode and thus uses  
 interrupts
 14 and 15 of the i8259 PIC. Should the fdt contain this information

Yes, it should, even if you don't use this in the Linux
kernel yet.

 or should I hardcode the values in the platform setup code?

No.


Segher

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v2] Allow exec on 32-bit from readable, non-exec pages, with a warning.

2007-07-16 Thread Segher Boessenkool
 Actually I see no good reason to enforce no-exec at all if we  
 can't do
 it consistently.  And if we're not going to enforce it then  
 there is
 no point whinging about it.


 I have a new patch with just this behaviour, Scott is
 testing it on old glibc (I think it succeeded, need
 confirmation though),

 It worked fine on glibc 2.2.5 and 2.3.3 (the former of which failed
 without the patch).

 It sounds like this is a candidate for stable 2.6.22.x as well

Yes, it replaces the previous patch and is a bugfix to it.

 once you release the patch.

The only reason I didn't send it out immediately was to not
confuse things further with a broken patch ;-)


Segher

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: possible dead CONFIG-related content under arch/powerpc

2007-07-16 Thread Michael Ellerman
On Mon, 2007-07-16 at 11:16 +0200, Geert Uytterhoeven wrote:
 On Sat, 14 Jul 2007, Robert P. J. Day wrote:
  == SPE_BASE ==
  arch/powerpc/mm/hash_utils_64.c:612:#ifdef CONFIG_SPE_BASE
  arch/powerpc/mm/hash_utils_64.c:747:#ifdef CONFIG_SPE_BASE
 
 Interesting, should this one be CONFIG_SPU_BASE?

Yes, ouch.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [patch 3/6] Add 8548 CDS PCI express controller node and PCI-X device node

2007-07-16 Thread Segher Boessenkool
 is this the only fix, I've already applied a version of this to my
 tree (with the irq sense fix) and just want to make sure there isn't
 anything else.
 I do not get more.
 I'd like to enroll Segher's suggestion together with VIA chip function
 in next step.
 We need to make basic pcie work on 8548 CDS board first.

If you can, please make the compatible properties correct
(pcie instead of pciex) before the patch goes in; it'll
be less work total and less confusing in the end.


Segher

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [patch 5/6] ps3: BD/DVD/CD-ROM Storage Driver

2007-07-16 Thread Geert Uytterhoeven
On Mon, 16 Jul 2007, Geert Uytterhoeven wrote:
 On Mon, 16 Jul 2007, Jens Axboe wrote:
  On Mon, Jul 16 2007, Geert Uytterhoeven wrote:
   On Fri, 13 Jul 2007, Geert Uytterhoeven wrote:
Ah, that explains it. flush_dcache_page() is used in some drivers.
I'll update my patches. Thanks for the comments!
   
   Does this look OK?
 - Replaced KM_USER0 by KM_IRQ0 (all routines are either called from an
   interrupt handler, from .request_fn (ps3disk), or from .queuecommand
   (ps3rom))
  
  That looks good.
  
 - Add a call to flush_kernel_dcache_page() in routines that write to 
   buffers
  
  Hmm, I would have thought a flush_dcache_page() would be more
  appropriate, the backing could be page cache pages.
 
 OK, I'll change it to flush_dcache_page().

Upon closer look, while flush_kernel_dcache_page() is a no-op on ppc64,
flush_dcache_page() isn't. So I'd prefer to not call it if not really needed.

And according to James, flush_kernel_dcache_page() should be sufficient...

So I'm getting puzzled again...

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:   [EMAIL PROTECTED] 
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___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [patch 5/6] ps3: BD/DVD/CD-ROM Storage Driver

2007-07-16 Thread Jens Axboe
On Mon, Jul 16 2007, Geert Uytterhoeven wrote:
 On Mon, 16 Jul 2007, Geert Uytterhoeven wrote:
  On Mon, 16 Jul 2007, Jens Axboe wrote:
   On Mon, Jul 16 2007, Geert Uytterhoeven wrote:
On Fri, 13 Jul 2007, Geert Uytterhoeven wrote:
 Ah, that explains it. flush_dcache_page() is used in some drivers.
 I'll update my patches. Thanks for the comments!

Does this look OK?
  - Replaced KM_USER0 by KM_IRQ0 (all routines are either called from an
interrupt handler, from .request_fn (ps3disk), or from .queuecommand
(ps3rom))
   
   That looks good.
   
  - Add a call to flush_kernel_dcache_page() in routines that write to 
buffers
   
   Hmm, I would have thought a flush_dcache_page() would be more
   appropriate, the backing could be page cache pages.
  
  OK, I'll change it to flush_dcache_page().
 
 Upon closer look, while flush_kernel_dcache_page() is a no-op on ppc64,
 flush_dcache_page() isn't. So I'd prefer to not call it if not really needed.
 
 And according to James, flush_kernel_dcache_page() should be sufficient...
 
 So I'm getting puzzled again...

I'll let James expand on why he thinks flush_kernel_dcache_page() should
be sufficient. If the backing is always user memory from
get_user_pages(), then the flush_kernel_dcache_page() looks sufficient.
For the normal IO paths, it could be that or page cache pages too for
instance.

-- 
Jens Axboe

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [patch 3/6] Add 8548 CDS PCI express controller node and PCI-X device node

2007-07-16 Thread Kumar Gala

On Jul 16, 2007, at 8:05 AM, Segher Boessenkool wrote:

 is this the only fix, I've already applied a version of this to my
 tree (with the irq sense fix) and just want to make sure there isn't
 anything else.
 I do not get more.
 I'd like to enroll Segher's suggestion together with VIA chip  
 function
 in next step.
 We need to make basic pcie work on 8548 CDS board first.

 If you can, please make the compatible properties correct
 (pcie instead of pciex) before the patch goes in; it'll
 be less work total and less confusing in the end.

I've taken care of that as well.

They are now 'fsl,mpc8548-pcie, and 'fsl,mpc8641-pcie'

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/4] Add DMA sector to Documentation/powerpc/booting-without-of.txt file.

2007-07-16 Thread Segher Boessenkool
 I thought the idea of the dts/of was for the hardware specific boot
 loader to tell the kernel about hardware that the kernel couldn't
 otherwise know about, because its not detectable by a bus probe  
 method,
 etc. Its not there to tell you how to use the device or arbitrate  
 which
 other devices get to use a device when there are resource conflicts,
 etc.

 If the dts/of/boot loader tells the kernel its a fsl soc then it knows
 how to work out which one and what level, and therefore knows what
 devices, such as the DMA device are present.

The device tree describes _all_ hardware in the system,
not just the things that are somewhat harder to probe
for.  Kernel drivers are free to not use all info provided
in the device tree and just hardcode some (correct or
incorrect) implicit knowledge about the device in question.
Whether this is a good idea or not is a different thing.

 I'm truly interested in understanding the correct interpretation  
 because
 we are developing a DMA based, rapidio distributed system on fsl 8641
 and from lurking on here and reading the archives etc, all I see is a
 constant butting of heads on what the dts/of is and how its  
 supposed to
 work.

Really, most of what you see is developing bindings for
specific devices, which takes a lot of discussion since
it needs to be made future-proof.

 Quite why we are using a 20 year old spec, which was never  
 finished, and
 ceased to be a formal spec 10 years ago as the new way forward is a
 puzzle to me as well.

You have some misconceptions about Open Firmware I'm afraid.

 Not flame bait,

Good, let's drop this then :-)

 but if someone could point me to
 background material it would be helpful for my education in getting up
 to speed (on the rationale for using it going forwards, not all the  
 old
 sites for the spec itself).

I'm afraid you'll have to get some experience using the OF
device tree to truly appreciate its power and flexibility,
and how many problems it solves.  Yeah this is a pretty weak
answer.


Segher

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: How to add platform specific data to a of_device

2007-07-16 Thread Segher Boessenkool
 Hmm, as I stated above: Handling the SPI slave devices is done in  
 the SPI
 framework. But including this data into the dts sounds better than  
 including
 it into the BSP. Is there some documentation around how to  
 describe such a
 SPI bus with its devices in the dts?

 I don't think so, I doubt there's an SPI OF binding.

That's correct.


Segher

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: How to add platform specific data to a of_device

2007-07-16 Thread Segher Boessenkool
 Is there a reason why there is sooo much interaction of the
 platform code with the oftree?

Yes.  Since the decision has been made to require a device
tree for every platform, arch/powerpc is in the luxury
position that we can actually exploit the benefits of _having_
a tree for every platform.


Segher

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 1/3] ps3: Disk Storage Driver

2007-07-16 Thread Geert Uytterhoeven
From: Geert Uytterhoeven [EMAIL PROTECTED]

Add a Disk Storage Driver for the PS3:
  - Implemented as a block device driver with a dynamic major
  - Disk names (and partitions) are of the format ps3d%c(%u)
  - Uses software scatter-gather with a 64 KiB bounce buffer as the hypervisor
doesn't support scatter-gather

CC: Geoff Levand [EMAIL PROTECTED]
Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED]
Acked-by: Jens Axboe [EMAIL PROTECTED]
---
v4:
  - Replace KM_USER0 by KM_IRQ0 (all kmap routines are either called from an
interrupt handler or from .request_fn())
  - Add a call to flush_kernel_dcache_page() before kunmap in routines that
write to buffers

v3:
  - Cleanup #includes
  - Kill PS3DISK_MAJOR, always use zero to obtain a dynamic major
  - Group LV1 API related stuff
  - Kill empty ps3disk_open
  - Reset ps3disk_priv(dev) to NULL during cleanup
  - Move call to put_disk() down
  - Pass the interrupt handler to ps3stor_setup(), so it doesn't have to be
overridden later
  - Fold ps3disk_read_write_sectors() into ps3disk_submit_request_sg()
  - Identify the hard drive capacity and model name during probing

v2:
  - Don't use `default y' in Kconfig
  - Remove the thread for handling requests
  - Set up sysfs links between block device and PS3 system device:
  o /sys/block/ps3da/device - ../../devices/ps3_system/sb_02
  o /sys/devices/ps3_system/sb_02/block:ps3da - ../../../block/ps3da
  - Fix all FIXMEs
  - Implement proper barrier support
  - Call add_disk_randomness()
  - Add a test to verify we are running on a PS3
  - Fix error path in ps3disk_init()
  - Fix cleanup order in ps3disk_exit()

 arch/powerpc/platforms/ps3/Kconfig |   10 
 drivers/block/Makefile |1 
 drivers/block/ps3disk.c|  624 +
 3 files changed, 635 insertions(+)

--- a/arch/powerpc/platforms/ps3/Kconfig
+++ b/arch/powerpc/platforms/ps3/Kconfig
@@ -102,4 +102,14 @@ config PS3_STORAGE
depends on PPC_PS3
tristate
 
+config PS3_DISK
+   tristate PS3 Disk Storage Driver
+   depends on PPC_PS3  BLOCK
+   select PS3_STORAGE
+   help
+ Include support for the PS3 Disk Storage.
+
+ This support is required to access the PS3 hard disk.
+ In general, all users will say Y or M.
+
 endmenu
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -28,3 +28,4 @@ obj-$(CONFIG_VIODASD) += viodasd.o
 obj-$(CONFIG_BLK_DEV_SX8)  += sx8.o
 obj-$(CONFIG_BLK_DEV_UB)   += ub.o
 
+obj-$(CONFIG_PS3_DISK) += ps3disk.o
--- /dev/null
+++ b/drivers/block/ps3disk.c
@@ -0,0 +1,624 @@
+/*
+ * PS3 Disk Storage Driver
+ *
+ * Copyright (C) 2007 Sony Computer Entertainment Inc.
+ * Copyright 2007 Sony Corp.
+ *
+ * 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; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include linux/ata.h
+#include linux/blkdev.h
+
+#include asm/lv1call.h
+#include asm/ps3stor.h
+#include asm/firmware.h
+
+
+#define DEVICE_NAMEps3disk
+
+#define BOUNCE_SIZE(64*1024)
+
+#define PS3DISK_MAX_DISKS  16
+#define PS3DISK_MINORS 16
+
+#define KERNEL_SECTOR_SIZE 512
+
+
+#define PS3DISK_NAME   ps3d%c
+
+
+struct ps3disk_private {
+   spinlock_t lock;/* Request queue spinlock */
+   struct request_queue *queue;
+   struct gendisk *gendisk;
+   unsigned int blocking_factor;
+   struct request *req;
+   u64 raw_capacity;
+   unsigned char model[ATA_ID_PROD_LEN+1];
+};
+#define ps3disk_priv(dev)  ((dev)-sbd.core.driver_data)
+
+
+#define LV1_STORAGE_SEND_ATA_COMMAND   (2)
+#define LV1_STORAGE_ATA_HDDOUT (0x23)
+
+struct lv1_ata_cmnd_block {
+   u16 features;
+   u16 sector_count;
+   u16 LBA_low;
+   u16 LBA_mid;
+   u16 LBA_high;
+   u8  device;
+   u8  command;
+   u32 is_ext;
+   u32 proto;
+   u32 in_out;
+   u32 size;
+   u64 buffer;
+   u32 arglen;
+};
+
+enum lv1_ata_proto {
+   NON_DATA_PROTO = 0,
+   PIO_DATA_IN_PROTO  = 1,
+   PIO_DATA_OUT_PROTO = 2,
+   DMA_PROTO = 3
+};
+
+enum lv1_ata_in_out {
+   DIR_WRITE = 0,  /* memory - device */
+   DIR_READ = 1/* device - memory */
+};
+
+static int ps3disk_major;
+
+
+static struct 

[patch 3/3] ps3: FLASH ROM Storage Driver

2007-07-16 Thread Geert Uytterhoeven
From: Geert Uytterhoeven [EMAIL PROTECTED]

Add a FLASH ROM Storage Driver for the PS3:
  - Implemented as a misc character device driver
  - Uses a fixed 256 KiB buffer allocated from boot memory as the hypervisor
requires the writing of aligned 256 KiB blocks

CC: Geoff Levand [EMAIL PROTECTED]
Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED]
---
v3:
  - Cleanup #includes
  - Allow to disable ps3flash (and the preallocated 256 KiB buffer) using
`ps3flash=off'
  - Move selection of write/read strings to error path
  - Rename and move ps3stor_interrupt() to ps3flash_interrupt()
  - Pass the interrupt handler to ps3stor_setup()
  - Reset ps3flash_priv(dev) to NULL during cleanup

v2:
  - Don't use `default y' in Kconfig
  - #include linux/uaccess.h instead of asm/uaccess.h
  - Set up sysfs links between misc character device and PS3 system device:
  o /sys/class/misc/ps3flash/device - ../../../devices/ps3_system/sb_01
  o /sys/devices/ps3_system/sb_01/misc:ps3flash - 
../../../class/misc/ps3flash

 arch/powerpc/platforms/ps3/Kconfig |   15 +
 drivers/char/Makefile  |2 
 drivers/char/ps3flash.c|  429 +
 3 files changed, 446 insertions(+)

--- a/arch/powerpc/platforms/ps3/Kconfig
+++ b/arch/powerpc/platforms/ps3/Kconfig
@@ -123,4 +123,19 @@ config PS3_ROM
  In general, all users will say Y or M.
  Also make sure to say Y or M to SCSI CDROM support later.
 
+config PS3_FLASH
+   tristate PS3 FLASH ROM Storage Driver
+   depends on PPC_PS3
+   select PS3_STORAGE
+   help
+ Include support for the PS3 FLASH ROM Storage.
+
+ This support is required to access the PS3 FLASH ROM, which
+ contains the boot loader and some boot options.
+ In general, all users will say Y or M.
+
+ As this driver needs a fixed buffer of 256 KiB of memory, it can
+ be disabled on the kernel command line using ps3flash=off, to
+ not allocate this fixed buffer.
+
 endmenu
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -104,6 +104,8 @@ obj-$(CONFIG_IPMI_HANDLER)  += ipmi/
 obj-$(CONFIG_HANGCHECK_TIMER)  += hangcheck-timer.o
 obj-$(CONFIG_TCG_TPM)  += tpm/
 
+obj-$(CONFIG_PS3_FLASH)+= ps3flash.o
+
 # Files generated that shall be removed upon make clean
 clean-files := consolemap_deftbl.c defkeymap.c
 
--- /dev/null
+++ b/drivers/char/ps3flash.c
@@ -0,0 +1,429 @@
+/*
+ * PS3 FLASH ROM Storage Driver
+ *
+ * Copyright (C) 2007 Sony Computer Entertainment Inc.
+ * Copyright 2007 Sony Corp.
+ *
+ * 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; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include linux/fs.h
+#include linux/miscdevice.h
+#include linux/uaccess.h
+
+#include asm/lv1call.h
+#include asm/ps3stor.h
+
+
+#define DEVICE_NAMEps3flash
+
+#define FLASH_BLOCK_SIZE   (256*1024)
+
+
+struct ps3flash_private {
+   struct mutex mutex; /* Bounce buffer mutex */
+};
+#define ps3flash_priv(dev) ((dev)-sbd.core.driver_data)
+
+static struct ps3_storage_device *ps3flash_dev;
+
+static ssize_t ps3flash_read_write_sectors(struct ps3_storage_device *dev,
+  u64 lpar, u64 start_sector,
+  u64 sectors, int write)
+{
+   u64 res = ps3stor_read_write_sectors(dev, lpar, start_sector, sectors,
+write);
+   if (res) {
+   dev_err(dev-sbd.core, %s:%u: %s failed 0x%lx\n, __func__,
+   __LINE__, write ? write : read, res);
+   return -EIO;
+   }
+   return sectors;
+}
+
+static ssize_t ps3flash_read_sectors(struct ps3_storage_device *dev,
+u64 start_sector, u64 sectors,
+unsigned int sector_offset)
+{
+   u64 max_sectors, lpar;
+
+   max_sectors = dev-bounce_size / dev-blk_size;
+   if (sectors  max_sectors) {
+   dev_dbg(dev-sbd.core, %s:%u Limiting sectors to %lu\n,
+   __func__, __LINE__, max_sectors);
+   sectors = max_sectors;
+   }
+
+   lpar = dev-bounce_lpar + sector_offset * dev-blk_size;
+   return ps3flash_read_write_sectors(dev, lpar, start_sector, sectors,
+  0);
+}
+
+static 

[PATCH] cell: CONFIG_SPE_BASE is a typo (was: Re: possible dead CONFIG-related content under arch/powerpc)

2007-07-16 Thread Geert Uytterhoeven
The config symbol for SPE support is called CONFIG_SPU_BASE, not
CONFIG_SPE_BASE.

Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED]

diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 4f2f453..0b25d42 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -609,7 +609,7 @@ static void demote_segment_4k(struct mm_struct *mm, 
unsigned long addr)
mm-context.sllp = SLB_VSID_USER | mmu_psize_defs[MMU_PAGE_4K].sllp;
 #endif /* CONFIG_PPC_MM_SLICES */
 
-#ifdef CONFIG_SPE_BASE
+#ifdef CONFIG_SPU_BASE
spu_flush_all_slbs(mm);
 #endif
 }
@@ -744,7 +744,7 @@ int hash_page(unsigned long ea, unsigned long access, 
unsigned long trap)
   to 4kB pages because of 
   non-cacheable mapping\n);
psize = mmu_vmalloc_psize = MMU_PAGE_4K;
-#ifdef CONFIG_SPE_BASE
+#ifdef CONFIG_SPU_BASE
spu_flush_all_slbs(mm);
 #endif
}

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:   [EMAIL PROTECTED] 
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___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [patch] use __attribute__ in asm-powerpc

2007-07-16 Thread Mike Frysinger
On Monday 16 July 2007, Geert Uytterhoeven wrote:
 On Sat, 14 Jul 2007, Mike Frysinger wrote:
  Pretty much everyone uses __attribute__ or attribute, no one
  uses __attribute.  This patch tweaks the three places in asm-powerpc
  where this comes up.  While only asm-powerpc/types.h is interesting (for
  userspace), I did asm-powerpc/processor.h as well for consistency.
 
  Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
  ---
  diff --git a/include/asm-powerpc/processor.h
  b/include/asm-powerpc/processor.h index d947b16..2ce6ea6 100644
  --- a/include/asm-powerpc/processor.h
  +++ b/include/asm-powerpc/processor.h
  @@ -153,9 +153,9 @@ struct thread_struct {
  unsigned long   dabr;   /* Data address breakpoint register */
   #ifdef CONFIG_ALTIVEC
  /* Complete AltiVec register set */
  -   vector128   vr[32] __attribute((aligned(16)));
  +   vector128   vr[32] __attribute__((aligned(16)));

 If the code is not exported to userspace (and thus not subject to different
 compilers), I think the preferred form is plain `attribute'.

i never said asm-powerpc/processor.h was exported to userspace ... i did say 
that i changed the file to be consistent with all other files.
-mike


signature.asc
Description: This is a digitally signed message part.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH 2/2] Add PCI/PCI Express node for 8544DS board]

2007-07-16 Thread Segher Boessenkool
It looks real good now :-)

One tiny comment...

 + [EMAIL PROTECTED] {
 + compatible = fsl,mpc8548-pcie;

I would name the node [EMAIL PROTECTED] instead; generic names
aren't for machine consumption anyway, and most humans
want to know which buses are plain PCI vs. PCI-X vs.
PCI Express.

This could be changed with a follow-up patch of course.


Segher

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 04/10] IB/ehca: use common error code mapping instead of specific ones

2007-07-16 Thread Roland Dreier
  @@ -161,8 +161,11 @@ static inline int ehca2ib_return_code(u64 ehca_rc)

applied, but as a further cleanup it seems that ehca2ib_return_code()
should be moved into a .c file and moved out of line -- I think it
would probably shrink the compiled code quite a bit, and as far as I
can see it is never used in the data path where the function call
overhead would matter at all.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] crash in 2.6.22-git2 sysctl_set_parent()

2007-07-16 Thread Linas Vepstas
On Fri, Jul 13, 2007 at 07:06:56PM -0600, Eric W. Biederman wrote:
  .data   = ipv4_devconf.loop,
  .maxlen = sizeof(int),
  .mode   = 0644,
  +   .child  = 0x0,
  .proc_handler   = proc_dointvec,
  },
 Where did this entry above in devinet_sysctl come from?

My bad.
I habitually apply the send-to-self patch, since some of the 
network testing that I do is easiest if I load up the all of the 
adapters in the same box. (If you're not familiar with this patch ... 
its great, and I wish it was integratedd into mainline. It allows
one to drive network traffic through the physical devices, even
if they are in the same box.  Without it, the network stack is
too clever, and won't allow you to do this.)

  +   {
  +   .ctl_name   = 0,
  +   .procname   = 0,
  +   },
 I probably would have just done:
 + {},

Yes, in retrospect, this would have been the simplest solution.

 What added the additional entry to devinet_root_dir?  I don't see that
 in Linus' tree?
 
 The result may be fine but if it isn't named in a per network device
 manner we are adding duplicate entries to the root /proc/sys directory
 which is wrong.
 
 Actually come to think of it I am concerned that someone added a
 settable entry into /proc/sys/ it should at least be in /proc/sys/net/
 where it won't conflict with other uses of that directory.  Especially
 as things like network devices have user controlled names.

Sigh. Silly me. Haste makes waste.

--linas

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] Fix Tsi108 ethernet driver performance

2007-07-16 Thread Alexandre Bounine
From: Alexandre Bounine [EMAIL PROTECTED]

This patch improves performance of the Tsi108 Ethernet driver by
changing interrupt handling for frame receive path. It reduces number of
interrupts generated for received frames and therefore lowers CPU
utilization by the device driver.
   
Signed-off-by: Alexandre Bounine [EMAIL PROTECTED]

---

diff -Nurp linux-2.6.22-hpc2/drivers/net/tsi108_eth.c
linux-2.6.22-tun/drivers/net/tsi108_eth.c
--- linux-2.6.22-hpc2/drivers/net/tsi108_eth.c  2007-07-08
19:32:17.0 -0400
+++ linux-2.6.22-tun/drivers/net/tsi108_eth.c   2007-07-12
16:55:50.0 -0400
@@ -58,6 +58,7 @@
 #define MII_READ_DELAY 1   /* max link wait time in msec */
 
 #define TSI108_RXRING_LEN 256
+#define TSI108_RX_INT_FREQ32
 
 /* NOTE: The driver currently does not support receiving packets
  * larger than the buffer size, so don't decrease this (unless you
@@ -69,8 +70,10 @@
 
 #define TSI108_TX_INT_FREQ64
 
-/* Check the phy status every half a second. */
-#define CHECK_PHY_INTERVAL (HZ/2)
+/* Timer interval to check the RX queue status */
+#define CHECK_RX_INTERVAL  (HZ/50)
+/* Timer interval to check the PHY status */
+#define CHECK_PHY_INTERVAL (CHECK_RX_INTERVAL * 10)
 
 static int tsi108_init_one(struct platform_device *pdev);
 static int tsi108_ether_remove(struct platform_device *pdev);
@@ -104,6 +107,7 @@ struct tsi108_prv_data {
unsigned int txfree;
 
unsigned int phy_ok;/* The PHY is currently powered
on. */
+   unsigned int phy_chk_count;
 
/* PHY status (duplex is 1 for half, 2 for full,
 * so that the default 0 indicates that neither has
@@ -823,7 +827,10 @@ static int tsi108_refill_rx(struct net_d
 */
 
data-rxring[rx].blen = TSI108_RX_SKB_SIZE;
-   data-rxring[rx].misc = TSI108_RX_OWN | TSI108_RX_INT;
+   if (rx % TSI108_RX_INT_FREQ)
+   data-rxring[rx].misc = TSI108_RX_OWN;
+   else
+   data-rxring[rx].misc = TSI108_RX_OWN |
TSI108_RX_INT;
 
data-rxhead = (data-rxhead + 1) % TSI108_RXRING_LEN;
data-rxfree++;
@@ -973,24 +980,22 @@ static void tsi108_rx_int(struct net_dev
}
 }
 
-/* If the RX ring has run out of memory, try periodically
- * to allocate some more, as otherwise poll would never
- * get called (apart from the initial end-of-queue condition).
- *
- * This is called once per second (by default) from the thread.
+/* tsi108_check_rxring() is used to periodically check if the RX ring
has
+ * pending frames that have not been reported by RX interrupt (due to
interrupt
+ * moderation). It is called with CHECK_RX_INTERVAL timer interval.
  */
 
 static void tsi108_check_rxring(struct net_device *dev)
 {
struct tsi108_prv_data *data = netdev_priv(dev);
+   unsigned int rx = data-rxtail;
 
-   /* A poll is scheduled, as opposed to caling tsi108_refill_rx
-* directly, so as to keep the receive path single-threaded
-* (and thus not needing a lock).
-*/
-
-   if (netif_running(dev)  data-rxfree  TSI108_RXRING_LEN / 4)
+   /* Schedule a poll (if required) */
+   if (netif_running(dev) 
+   0 == (data-rxring[rx].misc  TSI108_RX_OWN)) {
+   data-rxpending = 1;
tsi108_rx_int(dev);
+   }
 }
 
 static void tsi108_tx_int(struct net_device *dev)
@@ -1295,6 +1300,7 @@ static void tsi108_init_phy(struct net_d
 
printk(KERN_DEBUG PHY_STAT reg contains %08x\n, phyval);
data-phy_ok = 1;
+   data-phy_chk_count = 0;
data-init_media = 1;
spin_unlock_irqrestore(phy_lock, flags);
 }
@@ -1664,9 +1670,12 @@ static void tsi108_timed_checker(unsigne
struct net_device *dev = (struct net_device *)dev_ptr;
struct tsi108_prv_data *data = netdev_priv(dev);
 
-   tsi108_check_phy(dev);
+   /* We assume that RX queue is checked more often than PHY status
*/
+   if (data-phy_chk_count++ == 0)
+   tsi108_check_phy(dev);
tsi108_check_rxring(dev);
-   mod_timer(data-timer, jiffies + CHECK_PHY_INTERVAL);
+   data-phy_chk_count %= (CHECK_PHY_INTERVAL/CHECK_RX_INTERVAL);
+   mod_timer(data-timer, jiffies + CHECK_RX_INTERVAL);
 }
 
 static int tsi108_ether_init(void)



---

Important Notice: This message is intended for the use of the individual to 
whom it is addressed and may contain information which is privileged, 
confidential and/or exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, or is not the employee or agent 
responsible for delivering the message to the intended recipient, you are 
hereby notified that any dissemination, distribution, or copying of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify the sender immediately by telephone or return e-mail 
and delete the original message 

Re: [PATCH 10/10] IB/ehca: Support large page MRs

2007-07-16 Thread Roland Dreier
  Add support for MR pages larger than 4K on eHCA2. This reduces firmware
  memory consumption. If enabled via the mr_largepage module parameter, the MR
  page size will be determined based on the MR length and the hardware
  capabilities - if the MR is = 16M, 16M pages are used, for example.

Why the module parameter?  Is there any reason a user would want to
turn this off?  Or conversely, why is it off by default?

Also this patch seems to depend heavily on the multiple EQ patch,
which I am holding off on now.  So you may want to rebase to my
current tree, which has all the ehca patches except the EQ one.

   static ssize_t ehca_show_nr_eqs(struct device *dev,
   struct device_attribute *attr,
   char *buf)
   {
   return sprintf(buf, %d\n, ehca_nr_eqs);
   }
  -
   static DEVICE_ATTR(nr_eqs, S_IRUGO, ehca_show_nr_eqs, NULL);

Although trivial, this chunk doesn't really belong in this patch --
just fix it up in the multiple EQ patch (which I haven't merged yet).

 - R.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] Update mpc7448hpc2 device tree to be compatible for tsi109 chip

2007-07-16 Thread Segher Boessenkool
 Update mpc7448hpc2 device tree to be compatible for tsi109 chip.

 Signed-off-by: Roy Zang [EMAIL PROTECTED]

Looks good, thanks!


Segher

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 2/3] 82xx: Parse SMC serial device node in DTS

2007-07-16 Thread Mark Zhan
This patch makes 'cpm_uart_of_init' be able to parses SMC serial device node in 
DTS

Signed-off-by: Mark Zhan [EMAIL PROTECTED]
---
  arch/powerpc/sysdev/fsl_soc.c |   37 -
  1 file changed, 20 insertions(+), 17 deletions(-)

Index: linux-powerpc-2.6.x/arch/powerpc/sysdev/fsl_soc.c
===
--- linux-powerpc-2.6.x.orig/arch/powerpc/sysdev/fsl_soc.c  2007-07-16 
15:52:17.0 +0800
+++ linux-powerpc-2.6.x/arch/powerpc/sysdev/fsl_soc.c   2007-07-16 
16:59:31.0 +0800
@@ -757,8 +757,8 @@

  arch_initcall(fs_enet_of_init);

-static const char scc_regs[] = regs;
-static const char scc_pram[] = pram;
+static const char cpm_uart_regs[] = regs;
+static const char cpm_uart_pram[] = pram;

  static int __init cpm_uart_of_init(void)
  {
@@ -775,6 +775,7 @@
const int *id;
const char *model;

+   cpm_uart_dev = NULL;
memset(r, 0, sizeof(r));
memset(cpm_uart_data, 0, sizeof(cpm_uart_data));

@@ -782,31 +783,35 @@
if (ret)
goto err;

-   r[0].name = scc_regs;
+   r[0].name = cpm_uart_regs;

ret = of_address_to_resource(np, 1, r[1]);
if (ret)
goto err;
-   r[1].name = scc_pram;
+   r[1].name = cpm_uart_pram;

of_irq_to_resource(np, 0, r[2]);

-   cpm_uart_dev =
-   platform_device_register_simple(fsl-cpm-scc:uart, i, 
r[0], 3);
-
-   if (IS_ERR(cpm_uart_dev)) {
-   ret = PTR_ERR(cpm_uart_dev);
-   goto err;
-   }
-
id = of_get_property(np, device-id, NULL);
cpm_uart_data.fs_no = *id;

model = of_get_property(np, model, NULL);
strcpy(cpm_uart_data.fs_type, model);

-   cpm_uart_data.uart_clk = ppc_proc_freq;
+   if (strstr(model, SMC)) {
+   cpm_uart_dev = 
platform_device_register_simple(fsl-cpm-smc:uart,
+   i, r[0], 3);
+   } else if (strstr(model, SCC)) {
+   cpm_uart_dev = 
platform_device_register_simple(fsl-cpm-scc:uart,
+   i, r[0], 3);
+   }

+   if (IS_ERR(cpm_uart_dev)) {
+   ret = PTR_ERR(cpm_uart_dev);
+   goto err;
+   }
+
+   cpm_uart_data.uart_clk = ppc_proc_freq;
cpm_uart_data.tx_num_fifo = 4;
cpm_uart_data.tx_buf_size = 32;
cpm_uart_data.rx_num_fifo = 4;
@@ -816,10 +821,8 @@
cpm_uart_data.clk_tx = *((u32 *)of_get_property(np,
tx-clock, NULL));

-   ret =
-   platform_device_add_data(cpm_uart_dev, cpm_uart_data,
-sizeof(struct
-   fs_uart_platform_info));
+   ret = platform_device_add_data(cpm_uart_dev, cpm_uart_data,
+   sizeof(struct fs_uart_platform_info));
if (ret)
goto unreg;
}
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/3] 82xx: SBCPQ2 board platform support

2007-07-16 Thread Mark Zhan
This patch addes the powerpc support to Wind River SBC PowerQUICCII 82xx board.

Signed-off-by: Mark Zhan [EMAIL PROTECTED]
---
  arch/powerpc/boot/dts/sbcpq2.dts  |  191 +++
  arch/powerpc/configs/sbcpq2_defconfig |  917 
++
  arch/powerpc/platforms/82xx/Kconfig   |   10
  arch/powerpc/platforms/82xx/Makefile  |5
  arch/powerpc/platforms/82xx/sbcpq2.c  |  306 +++
  arch/powerpc/platforms/82xx/sbcpq2.h  |  118 
  include/asm-powerpc/mpc8260.h |4
  7 files changed, 1549 insertions(+), 2 deletions(-)

Index: linux-powerpc-2.6.x/arch/powerpc/platforms/82xx/Kconfig
===
--- linux-powerpc-2.6.x.orig/arch/powerpc/platforms/82xx/Kconfig
2007-07-16 16:25:11.0 +0800
+++ linux-powerpc-2.6.x/arch/powerpc/platforms/82xx/Kconfig 2007-07-16 
16:25:16.0 +0800
@@ -13,6 +13,16 @@
help
This option enables support for the MPC8272 ADS board

+config SBCPQ2
+   bool Wind River SBC PowerQUICCII 82xx
+   select DEFAULT_UIMAGE
+   select 8260
+   select CPM2
+   select FSL_SOC
+   help
+ This option enables support for Wind River SBC PowerQUICCII 82xx,
+ which is a single-board computer with MPC82xx CPU.
+
  endchoice

  config PQ2ADS
Index: linux-powerpc-2.6.x/arch/powerpc/platforms/82xx/Makefile
===
--- linux-powerpc-2.6.x.orig/arch/powerpc/platforms/82xx/Makefile   
2007-07-16 16:25:11.0 +0800
+++ linux-powerpc-2.6.x/arch/powerpc/platforms/82xx/Makefile2007-07-16 
16:25:16.0 +0800
@@ -1,5 +1,6 @@
  #
  # Makefile for the PowerPC 82xx linux kernel.
  #
-obj-$(CONFIG_PPC_82xx) += mpc82xx.o
-obj-$(CONFIG_MPC82xx_ADS) += mpc82xx_ads.o
+obj-$(CONFIG_PPC_82xx) += mpc82xx.o
+obj-$(CONFIG_MPC82xx_ADS)  += mpc82xx_ads.o
+obj-$(CONFIG_SBCPQ2)   += sbcpq2.o
Index: linux-powerpc-2.6.x/arch/powerpc/platforms/82xx/sbcpq2.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-powerpc-2.6.x/arch/powerpc/platforms/82xx/sbcpq2.c2007-07-16 
16:29:55.0 +0800
@@ -0,0 +1,306 @@
+/*
+ * sbcpq2.c: The platform support for Wind River SBC PowerQUICCII 82xx
+ *
+ * Copyright 2007, Wind River Systems, Inc.
+ *
+ * Author: Mark Zhan [EMAIL PROTECTED]
+ *
+ * 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/kernel.h
+#include linux/module.h
+#include linux/init.h
+#include linux/errno.h
+#include linux/reboot.h
+#include linux/pci.h
+#include linux/irq.h
+#include linux/interrupt.h
+#include linux/io.h
+#include linux/rtc.h
+#include linux/console.h
+#include linux/delay.h
+#include linux/seq_file.h
+#include linux/fsl_devices.h
+#include linux/fs_uart_pd.h
+#include linux/fs_enet_pd.h
+
+#include asm/prom.h
+#include asm/machdep.h
+#include asm/pci-bridge.h
+#include asm/mpc8260.h
+#include asm/cpm2.h
+#include sysdev/cpm2_pic.h
+#include asm/udbg.h
+#include asm/i8259.h
+#include asm/fs_pd.h
+
+static struct resource m48t59_resources[] = {
+   {
+   .start  = SBCPQ2_RTC_BASE,
+   .end= SBCPQ2_RTC_BASE + SBCPQ2_RTC_SIZE - 1,
+   .flags  = IORESOURCE_MEM,
+   }, {
+   .start  = SBCPQ2_M48T59_IRQ,
+   .end= SBCPQ2_M48T59_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   { },
+};
+
+static struct platform_device m48t59_rtc = {
+   .name   = rtc-m48t59,
+   .id = 0,
+   .num_resources  = 2,
+   .resource   = m48t59_resources,
+};
+
+static struct platform_device *sbcpq2_devices[] __initdata = {
+   m48t59_rtc,
+};
+
+/**
+ * sbcpq2_pdev_init - Register the platform device for sbcpq2 board
+ */
+static int __init sbcpq2_platdev_init(void)
+{
+   struct irq_desc *desc = irq_desc + SBCPQ2_M48T59_IRQ;
+
+   /* Install a dummy irq chip for M48T59 RTC irq */
+   if (desc-chip == no_irq_chip)
+   set_irq_handler(SBCPQ2_M48T59_IRQ, desc-handle_irq);
+
+   /* Register all platform devices for sbcpq2 */
+   platform_add_devices(sbcpq2_devices, ARRAY_SIZE(sbcpq2_devices));
+   return 0;
+}
+arch_initcall(sbcpq2_platdev_init);
+
+/*
+ * For SBCPQ2 board, the interrupt of M48T59 RTC chip
+ * will generate a machine check exception. We use a
+ * fake irq to give the platform machine_check_exception() hook
+ * a chance to call the driver ISR. If IRQ_HANDLED is returned,
+ * then we will survive from the machine check exception.
+ */
+static int sbcpq2_mach_check(struct pt_regs *regs)
+{
+   int recover = 0;
+   struct irq_desc *desc = irq_desc + SBCPQ2_M48T59_IRQ;

[PATCH 1/2] adb: create class devices for each adb device

2007-07-16 Thread Aristeu Rozanski
This patch adds a class device for each adb device that has a handler.
The class device contents will be accessible by /sys/class/adb/handlerN
directory. This patch is needed in order to add an class device
attribute to all keyboards that will determine the sysrq key for each
keyboard.

Signed-of-by: Aristeu Rozanski [EMAIL PROTECTED]

--- linus-2.6.orig/drivers/macintosh/adb.c  2007-05-11 10:09:13.0 
-0400
+++ linus-2.6/drivers/macintosh/adb.c   2007-05-11 10:09:36.0 -0400
@@ -102,11 +102,21 @@
 static void adbdev_init(void);
 static int try_handler_change(int, int);
 
+static char *adb_device_id_string[] = {
+   [ADB_DONGLE] = dongle,
+   [ADB_KEYBOARD] = keyboard,
+   [ADB_MOUSE] = mouse,
+   [ADB_TABLET] = tablet,
+   [ADB_MODEM] = modem,
+   [ADB_MISC] = misc,
+};
+
 static struct adb_handler {
void (*handler)(unsigned char *, int, int);
int original_address;
int handler_id;
int busy;
+   char name[16];
 } adb_handler[16];
 
 /*
@@ -508,6 +518,9 @@
if ((adb_handler[i].original_address == default_id) 
(!handler_id || (handler_id == adb_handler[i].handler_id) 
|| 
try_handler_change(i, handler_id))) {
+   int rc;
+   struct class_device *cdev;
+
if (adb_handler[i].handler != 0) {
printk(KERN_ERR
   Two handlers for ADB device %d\n,
@@ -517,7 +530,26 @@
write_lock_irq(adb_handler_lock);
adb_handler[i].handler = handler;
write_unlock_irq(adb_handler_lock);
-   ids-id[ids-nids++] = i;
+
+   snprintf(adb_handler[i].name,
+   sizeof(adb_handler[i].name), %s%i,
+   adb_device_id_string[default_id], ids-nids);
+
+   cdev = ids-id[ids-nids].cdev;
+   cdev-class = adb_dev_class;
+   class_device_initialize(cdev);
+   snprintf(cdev-class_id, sizeof(cdev-class_id), %s,
+adb_handler[i].name);
+   rc = class_device_add(cdev);
+   if (rc) {
+   printk(KERN_WARNING adb: unable to add class 
+  device\n);
+   for (i = ids-nids - 1; i = 0; i--)
+   class_device_del(ids-id[i].cdev);
+   ids-nids = 0;
+   return 0;
+   }
+   ids-id[ids-nids++].id = i;
}
}
up(adb_handler_sem);
@@ -525,9 +557,9 @@
 }
 
 int
-adb_unregister(int index)
+adb_unregister(int index, struct adb_ids *ids)
 {
-   int ret = -ENODEV;
+   int i, ret = -ENODEV;
 
down(adb_handler_sem);
write_lock_irq(adb_handler_lock);
@@ -539,6 +571,8 @@
}
ret = 0;
adb_handler[index].handler = NULL;
+   for (i = 0; i  ids-nids; i++)
+   class_device_del(ids-id[i].cdev);
}
write_unlock_irq(adb_handler_lock);
up(adb_handler_sem);
--- linus-2.6.orig/include/linux/adb.h  2007-05-11 10:09:13.0 -0400
+++ linus-2.6/include/linux/adb.h   2007-05-11 10:09:36.0 -0400
@@ -3,6 +3,7 @@
  */
 #ifndef __ADB_H
 #define __ADB_H
+#include linux/device.h
 
 /* ADB commands */
 #define ADB_BUSRESET   0
@@ -57,7 +58,11 @@
 
 struct adb_ids {
int nids;
-   unsigned char id[16];
+   struct adb_id {
+   unsigned char id;
+   struct class_device cdev;
+   void *priv;
+   } id[16];
 };
 
 /* Structure which encapsulates a low-level ADB driver */
@@ -91,7 +96,7 @@
int flags, int nbytes, ...);
 int adb_register(int default_id,int handler_id,struct adb_ids *ids,
 void (*handler)(unsigned char *, int, int));
-int adb_unregister(int index);
+int adb_unregister(int index, struct adb_ids *ids);
 void adb_poll(void);
 void adb_input(unsigned char *, int, int);
 int adb_reset_bus(void);
--- linus-2.6.orig/drivers/macintosh/adbhid.c   2007-05-11 10:09:19.0 
-0400
+++ linus-2.6/drivers/macintosh/adbhid.c2007-05-11 10:10:15.0 
-0400
@@ -875,7 +875,7 @@
adb_register(ADB_MISC, 0, buttons_ids, adbhid_buttons_input);
 
for (i = 0; i  keyboard_ids.nids; i++) {
-   int id = keyboard_ids.id[i];
+   int id = keyboard_ids.id[i].id;
 
adb_get_infos(id, default_id, org_handler_id);
 
@@ -902,7 +902,7 @@
}
 
for (i = 0; i  buttons_ids.nids; i++) {
-   int id = buttons_ids.id[i];
+   int id = buttons_ids.id[i].id;
 

Re: [PATCH 10/10] IB/ehca: Support large page MRs

2007-07-16 Thread Joachim Fenkes
Roland Dreier [EMAIL PROTECTED] wrote on 16.07.2007 19:37:09:

   If enabled via the mr_largepage module parameter, 
 
 Why the module parameter?  Is there any reason a user would want to
 turn this off?  Or conversely, why is it off by default?

We're pretty confident this new feature works, but as with all new and 
possibly experimental features, there are chances it might explode your 
machine when activated. So, like with the scaling code, we want the user 
to make the conscious decision of using this code instead of activating it 
by default.
 
static ssize_t ehca_show_nr_eqs(struct device *dev,
struct device_attribute *attr,
char *buf)
{
   return sprintf(buf, %d\n, ehca_nr_eqs);
}
   -
static DEVICE_ATTR(nr_eqs, S_IRUGO, ehca_show_nr_eqs, NULL);
 
 Although trivial, this chunk doesn't really belong in this patch --
 just fix it up in the multiple EQ patch (which I haven't merged yet).

Sure thing.

Regards,
  Joachim
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [RFC][PATCH 6/8] Walnut DTS

2007-07-16 Thread Benjamin Herrenschmidt
On Mon, 2007-07-16 at 17:18 -0500, Scott Wood wrote:
 
 OK...  but if you're doing a pure IRQ number conversion, the only useful 
 #address-cells would be zero, which makes it a reasonable default IMHO 
 (unlike the arbitrary 2 for regular traversal).

It does make a reasonable default. The thing, as I exlained, is I
dislike the whole idea of default values in the first place.

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/2] adb: create class devices for each adb device

2007-07-16 Thread Benjamin Herrenschmidt
On Mon, 2007-07-16 at 16:53 -0400, Aristeu Rozanski wrote:
 This patch adds a class device for each adb device that has a handler.
 The class device contents will be accessible by /sys/class/adb/handlerN
 directory. This patch is needed in order to add an class device
 attribute to all keyboards that will determine the sysrq key for each
 keyboard.

I don't think class device is the right approach. Classes are supposed
to be a functional binding, ie, in this case, input devices. ADB is a
bus, and as such, you should create an adb bus type and and adb_device
that is an extension of struct device, not struct class device.

There's also the question of what to do on ADB resets (such as when
doing a sleep/wakeup cycle). Should we wipe out all devices and
re-created them, thus loosing any settings ? Or should we have some way
to attempt at re-matching existing ones ?

Cheers,
Ben.

 Signed-of-by: Aristeu Rozanski [EMAIL PROTECTED]
 
 --- linus-2.6.orig/drivers/macintosh/adb.c2007-05-11 10:09:13.0 
 -0400
 +++ linus-2.6/drivers/macintosh/adb.c 2007-05-11 10:09:36.0 -0400
 @@ -102,11 +102,21 @@
  static void adbdev_init(void);
  static int try_handler_change(int, int);
  
 +static char *adb_device_id_string[] = {
 + [ADB_DONGLE] = dongle,
 + [ADB_KEYBOARD] = keyboard,
 + [ADB_MOUSE] = mouse,
 + [ADB_TABLET] = tablet,
 + [ADB_MODEM] = modem,
 + [ADB_MISC] = misc,
 +};
 +
  static struct adb_handler {
   void (*handler)(unsigned char *, int, int);
   int original_address;
   int handler_id;
   int busy;
 + char name[16];
  } adb_handler[16];
  
  /*
 @@ -508,6 +518,9 @@
   if ((adb_handler[i].original_address == default_id) 
   (!handler_id || (handler_id == adb_handler[i].handler_id) 
 || 
   try_handler_change(i, handler_id))) {
 + int rc;
 + struct class_device *cdev;
 +
   if (adb_handler[i].handler != 0) {
   printk(KERN_ERR
  Two handlers for ADB device %d\n,
 @@ -517,7 +530,26 @@
   write_lock_irq(adb_handler_lock);
   adb_handler[i].handler = handler;
   write_unlock_irq(adb_handler_lock);
 - ids-id[ids-nids++] = i;
 +
 + snprintf(adb_handler[i].name,
 + sizeof(adb_handler[i].name), %s%i,
 + adb_device_id_string[default_id], ids-nids);
 +
 + cdev = ids-id[ids-nids].cdev;
 + cdev-class = adb_dev_class;
 + class_device_initialize(cdev);
 + snprintf(cdev-class_id, sizeof(cdev-class_id), %s,
 +  adb_handler[i].name);
 + rc = class_device_add(cdev);
 + if (rc) {
 + printk(KERN_WARNING adb: unable to add class 
 +device\n);
 + for (i = ids-nids - 1; i = 0; i--)
 + class_device_del(ids-id[i].cdev);
 + ids-nids = 0;
 + return 0;
 + }
 + ids-id[ids-nids++].id = i;
   }
   }
   up(adb_handler_sem);
 @@ -525,9 +557,9 @@
  }
  
  int
 -adb_unregister(int index)
 +adb_unregister(int index, struct adb_ids *ids)
  {
 - int ret = -ENODEV;
 + int i, ret = -ENODEV;
  
   down(adb_handler_sem);
   write_lock_irq(adb_handler_lock);
 @@ -539,6 +571,8 @@
   }
   ret = 0;
   adb_handler[index].handler = NULL;
 + for (i = 0; i  ids-nids; i++)
 + class_device_del(ids-id[i].cdev);
   }
   write_unlock_irq(adb_handler_lock);
   up(adb_handler_sem);
 --- linus-2.6.orig/include/linux/adb.h2007-05-11 10:09:13.0 
 -0400
 +++ linus-2.6/include/linux/adb.h 2007-05-11 10:09:36.0 -0400
 @@ -3,6 +3,7 @@
   */
  #ifndef __ADB_H
  #define __ADB_H
 +#include linux/device.h
  
  /* ADB commands */
  #define ADB_BUSRESET 0
 @@ -57,7 +58,11 @@
  
  struct adb_ids {
   int nids;
 - unsigned char id[16];
 + struct adb_id {
 + unsigned char id;
 + struct class_device cdev;
 + void *priv;
 + } id[16];
  };
  
  /* Structure which encapsulates a low-level ADB driver */
 @@ -91,7 +96,7 @@
   int flags, int nbytes, ...);
  int adb_register(int default_id,int handler_id,struct adb_ids *ids,
void (*handler)(unsigned char *, int, int));
 -int adb_unregister(int index);
 +int adb_unregister(int index, struct adb_ids *ids);
  void adb_poll(void);
  void adb_input(unsigned char *, int, int);
  int adb_reset_bus(void);
 --- linus-2.6.orig/drivers/macintosh/adbhid.c 2007-05-11 

[PATCH] PHY fixed driver: rework release path and update phy_id notation

2007-07-16 Thread Vitaly Bordug

device_bind_driver() error code returning has been fixed.  
release() function has been written, so that to free resources 
in correct way; the release path is now clean. 
 
Before the rework, it used to cause 
 Device '[EMAIL PROTECTED]:1' does not have a release() function, it is broken 
 and must be fixed. 
 BUG: at drivers/base/core.c:104 device_release() 
  
 Call Trace:   
  [802ec380] kobject_cleanup+0x53/0x7e 
  [802ec3ab] kobject_release+0x0/0x9 
  [802ecf3f] kref_put+0x74/0x81 
  [8035493b] fixed_mdio_register_device+0x230/0x265 
  [80564d31] fixed_init+0x1f/0x35 
  [802071a4] init+0x147/0x2fb 
  [80223b6e] schedule_tail+0x36/0x92 
  [8020a678] child_rip+0xa/0x12 
  [80311714] acpi_ds_init_one_object+0x0/0x83 
  [8020705d] init+0x0/0x2fb 
  [8020a66e] child_rip+0x0/0x12   
 
 
Also changed the notation of the fixed phy definition on 
mdio bus to the form of speed+duplex to make it able to be used by 
gianfar and ucc_geth that define phy_id strictly as %d:%d and cleaned up 
the whitespace issues.
 
Signed-off-by: Vitaly Bordug [EMAIL PROTECTED]

---

 drivers/net/phy/Kconfig |   14 ++
 drivers/net/phy/fixed.c |  310 ---
 2 files changed, 169 insertions(+), 155 deletions(-)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index dd09011..432c210 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -76,4 +76,18 @@ config FIXED_MII_100_FDX
bool Emulation for 100M Fdx fixed PHY behavior
depends on FIXED_PHY
 
+config FIXED_MII_1000_FDX
+   bool Emulation for 1000M Fdx fixed PHY behavior
+   depends on FIXED_PHY
+
+config FIXED_MII_AMNT
+int Number of emulated PHYs to allocate 
+depends on FIXED_PHY
+default 1
+---help---
+Sometimes it is required to have several independent emulated
+PHYs on the bus (in case of multi-eth but phy-less HW for instance).
+This control will have specified number allocated for each fixed
+PHY type enabled.
+
 endif # PHYLIB
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index bb96691..5619182 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -30,53 +30,31 @@
 #include linux/mii.h
 #include linux/ethtool.h
 #include linux/phy.h
+#include linux/phy_fixed.h
 
 #include asm/io.h
 #include asm/irq.h
 #include asm/uaccess.h
 
-#define MII_REGS_NUM   7
-
-/*
-The idea is to emulate normal phy behavior by responding with
-pre-defined values to mii BMCR read, so that read_status hook could
-take all the needed info.
-*/
-
-struct fixed_phy_status {
-   u8  link;
-   u16 speed;
-   u8  duplex;
-};
-
-/*-
- *  Private information hoder for mii_bus
- 
*-*/
-struct fixed_info {
-   u16 *regs;
-   u8 regs_num;
-   struct fixed_phy_status phy_status;
-   struct phy_device *phydev; /* pointer to the container */
-   /* link  speed cb */
-   int(*link_update)(struct net_device*, struct fixed_phy_status*);
-
-};
+/* we need to track the allocated pointers in order to free them on exit */
+static struct fixed_info *fixed_phy_ptrs[CONFIG_FIXED_MII_AMNT*MAX_PHY_AMNT];
 
 /*-
  *  If something weird is required to be done with link/speed,
  * network driver is able to assign a function to implement this.
  * May be useful for PHY's that need to be software-driven.
  
*-*/
-int fixed_mdio_set_link_update(struct phy_device* phydev,
-   int(*link_update)(struct net_device*, struct fixed_phy_status*))
+int fixed_mdio_set_link_update(struct phy_device *phydev,
+  int (*link_update) (struct net_device *,
+  struct fixed_phy_status *))
 {
struct fixed_info *fixed;
 
-   if(link_update == NULL)
+   if (link_update == NULL)
return -EINVAL;
 
-   if(phydev) {
-   if(phydev-bus) {
+   if (phydev) {
+   if (phydev-bus) {
fixed = phydev-bus-priv;
fixed-link_update = link_update;
return 0;
@@ -84,54 +62,64 @@ int fixed_mdio_set_link_update(struct phy_device* phydev,
}
return -EINVAL;
 }
+
 EXPORT_SYMBOL(fixed_mdio_set_link_update);
 
+struct fixed_info *fixed_mdio_get_phydev (int phydev_ind)
+{
+   if (phydev_ind = MAX_PHY_AMNT)
+   return NULL;
+   return fixed_phy_ptrs[phydev_ind];
+}
+
+EXPORT_SYMBOL(fixed_mdio_get_phydev);
+
 /*-
  *  

[PATCH] USB_DR host support for FSL MPC831x

2007-07-16 Thread Vitaly Bordug

Modifies fsl_ehci code so that to get USB host working on
mpc831x platform. Verified with MPC8313RDB reference board.

Signed-off-by: Vitaly Bordug [EMAIL PROTECTED]

---

 arch/powerpc/boot/dts/mpc8313erdb.dts |1 +
 drivers/usb/host/ehci-fsl.c   |4 +++-
 drivers/usb/host/ehci-hcd.c   |2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts 
b/arch/powerpc/boot/dts/mpc8313erdb.dts
index 1b351dc..c330e79 100644
--- a/arch/powerpc/boot/dts/mpc8313erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
@@ -90,6 +90,7 @@
interrupt-parent =  ipic ;
interrupts = 26 8;
phy_type = utmi_wide;
+   control_init  = 0280; // UTMI ext 48 MHz clk
};
 
[EMAIL PROTECTED] {
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index c7a7c59..3e3187b 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -185,12 +185,14 @@ static void mpc83xx_usb_setup(struct usb_hcd *hcd)
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
struct fsl_usb2_platform_data *pdata;
void __iomem *non_ehci = hcd-regs;
+   u32 temp;
 
pdata =
(struct fsl_usb2_platform_data *)hcd-self.controller-
platform_data;
/* Enable PHY interface in the control reg. */
-   out_be32(non_ehci + FSL_SOC_USB_CTRL, 0x0004);
+   temp = in_be32(non_ehci + FSL_SOC_USB_CTRL);
+   out_be32(non_ehci + FSL_SOC_USB_CTRL, temp | 0x0004);
out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x001b);
 
 #if defined(CONFIG_PPC32)  !defined(CONFIG_NOT_COHERENT_CACHE)
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 099aff6..994a127 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -925,7 +925,7 @@ MODULE_LICENSE (GPL);
 #definePCI_DRIVER  ehci_pci_driver
 #endif
 
-#ifdef CONFIG_MPC834x
+#if defined(CONFIG_MPC834x) || defined(CONFIG_PPC_MPC831x)
 #include ehci-fsl.c
 #definePLATFORM_DRIVER ehci_fsl_driver
 #endif

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] USB_DR device support for FSL MPC831x

2007-07-16 Thread Vitaly Bordug

This adds support for USB device mode on mpc831x series. 
Devicetree node modification is required to make it work - 

dr_mode =peripheral;

which should be commented out if host mode is desired onboot.

Signed-off-by: Vitaly Bordug [EMAIL PROTECTED]

---

 arch/powerpc/sysdev/fsl_soc.c |1 +
 include/linux/fsl_devices.h   |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index c0ddc80..27a1510 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -514,6 +514,7 @@ static int __init fsl_usb_of_init(void)
}
} else if (prop  !strcmp(prop, peripheral)) {
usb_data.operating_mode = FSL_USB2_DR_DEVICE;
+   usb_data.max_ep_nr = *(unsigned 
int*)of_get_property(np, max_ep_nr,NULL);
usb_dev_dr_client = platform_device_register_simple(
fsl-usb2-udc, i, r, 2);
if (IS_ERR(usb_dev_dr_client)) {
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 12e631f..a3feb34 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -103,6 +103,7 @@ struct fsl_usb2_platform_data {
enum fsl_usb2_operating_modes   operating_mode;
enum fsl_usb2_phy_modes phy_mode;
unsigned intport_enables;
+   unsigned intmax_ep_nr;
 };
 
 /* Flags in fsl_usb2_mph_platform_data */

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/3] 82xx: Parse SMC serial device node in DTS

2007-07-16 Thread Arnd Bergmann
On Monday 16 July 2007, Mark Zhan wrote:
 -   cpm_uart_data.uart_clk = ppc_proc_freq;
 +   if (strstr(model, SMC)) {
 +   cpm_uart_dev = 
 platform_device_register_simple(fsl-cpm-smc:uart,
 +   i, r[0], 3);
 +   } else if (strstr(model, SCC)) {
 +   cpm_uart_dev = 
 platform_device_register_simple(fsl-cpm-scc:uart,
 +   i, r[0], 3);
 +   }
 

You should probably use of_device_is_compatible() to check
if a given device can be used by a particular driver.

Arnd 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] POWERPC 8xx: bump up initial memory limit for 8xx

2007-07-16 Thread Vitaly Bordug

From: John Traill [EMAIL PROTECTED]

The 8xx can only support a max of 8M during early boot ( it seems a lot of
8xx boards only have 8M so the bug was never triggered ). The following
change makes it able to run with 128M.

Signed-off-by: Vitaly Bordug [EMAIL PROTECTED]

---

 arch/powerpc/mm/init_32.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index e1f5ded..7cee86d 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -133,6 +133,9 @@ void __init MMU_init(void)
/* 601 can only access 16MB at the moment */
if (PVR_VER(mfspr(SPRN_PVR)) == 1)
__initial_memory_limit = 0x0100;
+   /* 852 can only access 8MB at the moment */
+   if (PVR_VER(mfspr(SPRN_PVR)) == 0x50)
+   __initial_memory_limit = 0x0080;
 
/* parse args from command line */
MMU_setup();

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 2.6.22-rc7 0/4] phy/gianfar: Fixes for gianfar and vitesse RGMII-ID support

2007-07-16 Thread Andy Fleming
A few bugs in the Vitesse PHY driver were found on the 8641D HPCN board.
Originally, they were masked by a bug in the PHY Lib which was fixed by patch 
5f708dd91d15876e26d7a57f97a255cedffca463 (Fix phy_id for Vitesse 824x PHY).
That patch allowed the Vitesse PHY to bind on the 8641D HPCN board, thereby
exposing a bug in the interrupt handling and a bug in the configuration of
the PHY.  This sequence of patches fixes the irq handling bug, then fixes 
the configuration bug in 3 places:

1) The Vitesse PHY driver
2) The gianfar driver (needs to pass in the mode correctly for internal delay)
3) The OF device tree for arch/powerpc boards

You can apply the following patches, or pull them directly:

The following changes since commit c5e3ae8823693b260ce1f217adca8add1bc0b3de:
  Ayaz Abdulla (1):
forcedeth bug fix: realtek phy

are found in the git repository at:

  http://opensource.freescale.com/pub/scm/linux-2.6-85xx.git netdev

Andy Fleming (4):
  Fix Vitesse 824x PHY interrupt acking
  Add phy-connection-type to gianfar nodes
  Fix Vitesse RGMII-ID support
  Fix RGMII-ID handling in gianfar

 Documentation/powerpc/booting-without-of.txt |6 +++
 arch/powerpc/boot/dts/mpc8641_hpcn.dts   |4 ++
 arch/powerpc/sysdev/fsl_soc.c|9 +
 drivers/net/gianfar.c|   12 ++-
 drivers/net/phy/vitesse.c|   46 +++---
 include/linux/fsl_devices.h  |1 +
 6 files changed, 72 insertions(+), 6 deletions(-)


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/4] phy: Fix Vitesse 824x PHY interrupt acking

2007-07-16 Thread Andy Fleming
The Vitesse 824x PHY doesn't allow an interrupt to be cleared if
the mask bit for that interrupt isn't set.  This means that the PHY
Lib's order of handling interrupts (disable, then clear) breaks on this
PHY.  However, clearing then disabling the interrupt opens up the code
for a silly race condition.  So rather than change the PHY Lib, we change
the Vitesse driver so it always clears interrupts before disabling them.
Further, the ack function only clears the interrupt if interrupts are
enabled.

Signed-off-by: Andy Fleming [EMAIL PROTECTED]
Signed-off-by: York Sun [EMAIL PROTECTED]
Acked-by: Haiying Wang [EMAIL PROTECTED]
---
 drivers/net/phy/vitesse.c |   23 +--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
index 596222b..f39ab76 100644
--- a/drivers/net/phy/vitesse.c
+++ b/drivers/net/phy/vitesse.c
@@ -65,7 +65,15 @@ static int vsc824x_config_init(struct phy_device *phydev)
 
 static int vsc824x_ack_interrupt(struct phy_device *phydev)
 {
-   int err = phy_read(phydev, MII_VSC8244_ISTAT);
+   int err = 0;
+   
+   /*
+* Don't bother to ACK the interrupts if interrupts
+* are disabled.  The 824x cannot clear the interrupts
+* if they are disabled.
+*/
+   if (phydev-interrupts == PHY_INTERRUPT_ENABLED)
+   err = phy_read(phydev, MII_VSC8244_ISTAT);
 
return (err  0) ? err : 0;
 }
@@ -77,8 +85,19 @@ static int vsc824x_config_intr(struct phy_device *phydev)
if (phydev-interrupts == PHY_INTERRUPT_ENABLED)
err = phy_write(phydev, MII_VSC8244_IMASK,
MII_VSC8244_IMASK_MASK);
-   else
+   else {
+   /*
+* The Vitesse PHY cannot clear the interrupt
+* once it has disabled them, so we clear them first
+*/
+   err = phy_read(phydev, MII_VSC8244_ISTAT);
+
+   if (err)
+   return err;
+
err = phy_write(phydev, MII_VSC8244_IMASK, 0);
+   }
+
return err;
 }
 
-- 
1.5.0.2.230.gfbe3d-dirty

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 2/4] gianfar: Add phy-connection-type to gianfar nodes

2007-07-16 Thread Andy Fleming
The TSEC/eTSEC automatically detect their PHY interface type, unless
the type is RGMII-ID (RGMII with internal delay).  In that situation,
it just detects RGMII.  In order to fix this, we need to pass in rgmii-id
if that is the connection type.

Signed-off-by: Andy Fleming [EMAIL PROTECTED]
---
 Documentation/powerpc/booting-without-of.txt |6 ++
 arch/powerpc/boot/dts/mpc8641_hpcn.dts   |4 
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/Documentation/powerpc/booting-without-of.txt 
b/Documentation/powerpc/booting-without-of.txt
index d42d981..a41b6b1 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1241,6 +1241,12 @@ platforms are moved over to use the 
flattened-device-tree model.
   network device.  This is used by the bootwrapper to interpret
   MAC addresses passed by the firmware when no information other
   than indices is available to associate an address with a device.
+- phy-connection-type : a string naming the controller/PHY interface type,
+  i.e., mii (default), rmii, gmii, rgmii, rgmii-id, sgmii,
+  tbi, or rtbi.  This property is only really needed if the connection
+  is of type rgmii-id, as all other connection types are detected by
+  hardware.
+
 
   Example:
 
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts 
b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
index 260b264..9849073 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -121,6 +121,7 @@
interrupts = 1d 2 1e 2 22 2;
interrupt-parent = mpic;
phy-handle = phy0;
+   phy-connection-type = rgmii-id;
};
 
[EMAIL PROTECTED] {
@@ -134,6 +135,7 @@
interrupts = 23 2 24 2 28 2;
interrupt-parent = mpic;
phy-handle = phy1;
+   phy-connection-type = rgmii-id;
};

[EMAIL PROTECTED] {
@@ -147,6 +149,7 @@
interrupts = 1F 2 20 2 21 2;
interrupt-parent = mpic;
phy-handle = phy2;
+   phy-connection-type = rgmii-id;
};
 
[EMAIL PROTECTED] {
@@ -160,6 +163,7 @@
interrupts = 25 2 26 2 27 2;
interrupt-parent = mpic;
phy-handle = phy3;
+   phy-connection-type = rgmii-id;
};
[EMAIL PROTECTED] {
device_type = serial;
-- 
1.5.0.2.230.gfbe3d-dirty

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/4] phy: Fix Vitesse RGMII-ID support

2007-07-16 Thread Andy Fleming
The Vitesse PHY on the 8641D needs to be set up with internal delay to
work in RGMII mode.  So we add skew when it is set to RGMII_ID mode.

Signed-off-by: Andy Fleming [EMAIL PROTECTED]
Signed-off-by: Haruki Dai [EMAIL PROTECTED]
Signed-off-by: Haiying Wang [EMAIL PROTECTED]
---
 drivers/net/phy/vitesse.c |   23 ---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
index f39ab76..6a53856 100644
--- a/drivers/net/phy/vitesse.c
+++ b/drivers/net/phy/vitesse.c
@@ -21,6 +21,10 @@
 /* Vitesse Extended Control Register 1 */
 #define MII_VSC8244_EXT_CON1   0x17
 #define MII_VSC8244_EXTCON1_INIT   0x
+#define MII_VSC8244_EXTCON1_TX_SKEW_MASK   0x0c00
+#define MII_VSC8244_EXTCON1_RX_SKEW_MASK   0x0300
+#define MII_VSC8244_EXTCON1_TX_SKEW0x0800
+#define MII_VSC8244_EXTCON1_RX_SKEW0x0200
 
 /* Vitesse Interrupt Mask Register */
 #define MII_VSC8244_IMASK  0x19
@@ -39,7 +43,7 @@
 
 /* Vitesse Auxiliary Control/Status Register */
 #define MII_VSC8244_AUX_CONSTAT0x1c
-#define MII_VSC8244_AUXCONSTAT_INIT0x0004
+#define MII_VSC8244_AUXCONSTAT_INIT0x
 #define MII_VSC8244_AUXCONSTAT_DUPLEX  0x0020
 #define MII_VSC8244_AUXCONSTAT_SPEED   0x0018
 #define MII_VSC8244_AUXCONSTAT_GBIT0x0010
@@ -51,6 +55,7 @@ MODULE_LICENSE(GPL);
 
 static int vsc824x_config_init(struct phy_device *phydev)
 {
+   int extcon;
int err;
 
err = phy_write(phydev, MII_VSC8244_AUX_CONSTAT,
@@ -58,8 +63,20 @@ static int vsc824x_config_init(struct phy_device *phydev)
if (err  0)
return err;
 
-   err = phy_write(phydev, MII_VSC8244_EXT_CON1,
-   MII_VSC8244_EXTCON1_INIT);
+   extcon = phy_read(phydev, MII_VSC8244_EXT_CON1);
+
+   if (extcon  0)
+   return err;
+
+   extcon = ~(MII_VSC8244_EXTCON1_TX_SKEW_MASK |
+   MII_VSC8244_EXTCON1_RX_SKEW_MASK);
+
+   if (phydev-interface == PHY_INTERFACE_MODE_RGMII_ID)
+   extcon |= (MII_VSC8244_EXTCON1_TX_SKEW |
+   MII_VSC8244_EXTCON1_RX_SKEW);
+
+   err = phy_write(phydev, MII_VSC8244_EXT_CON1, extcon);
+
return err;
 }
 
-- 
1.5.0.2.230.gfbe3d-dirty

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/3] 82xx: SBCPQ2 board platform support

2007-07-16 Thread Arnd Bergmann
On Monday 16 July 2007, Mark Zhan wrote:
 This patch addes the powerpc support to Wind River SBC PowerQUICCII 82xx 
 board.

Hi Mark!

I've got lots of small comments about your code, but mostly it comes
down to one problem: your new platform code is not able to coexist
with other platforms because you hardcode information.

 +static struct resource m48t59_resources[] = {
 + {
 + .start  = SBCPQ2_RTC_BASE,
 + .end= SBCPQ2_RTC_BASE + SBCPQ2_RTC_SIZE - 1,
 + .flags  = IORESOURCE_MEM,
 + }, {
 + .start  = SBCPQ2_M48T59_IRQ,
 + .end= SBCPQ2_M48T59_IRQ,
 + .flags  = IORESOURCE_IRQ,
 + },
 + { },
 +};

This is the kind of information that belongs into the device tree,
not hardcoded into the board code.

 +/**
 + * sbcpq2_pdev_init - Register the platform device for sbcpq2 board
 + */
 +static int __init sbcpq2_platdev_init(void)
 +{
 + struct irq_desc *desc = irq_desc + SBCPQ2_M48T59_IRQ;

same for the interrupt number. Worse, this looks broken
because the descriptor array describes virtual interrupt
numbers, while SBCPQ2_M48T59_IRQ must be a physical number.
These are often the same, but there is no guarantee.

In order to get a virtual interrupt number for a given device,
you need to call irq_of_parse_and_map().

 + /* Install a dummy irq chip for M48T59 RTC irq */
 + if (desc-chip == no_irq_chip)
 + set_irq_handler(SBCPQ2_M48T59_IRQ, desc-handle_irq);
 +
 + /* Register all platform devices for sbcpq2 */
 + platform_add_devices(sbcpq2_devices, ARRAY_SIZE(sbcpq2_devices));
 + return 0;
 +}
 +arch_initcall(sbcpq2_platdev_init);


 +/*
 + * For SBCPQ2 board, the interrupt of M48T59 RTC chip
 + * will generate a machine check exception. We use a
 + * fake irq to give the platform machine_check_exception() hook
 + * a chance to call the driver ISR. If IRQ_HANDLED is returned,
 + * then we will survive from the machine check exception.
 + */
 +static int sbcpq2_mach_check(struct pt_regs *regs)
 +{
 + int recover = 0;
 + struct irq_desc *desc = irq_desc + SBCPQ2_M48T59_IRQ;
 +
 + struct irqaction *action = desc-action;
 +
 + while (action  (action-dev_id != m48t59_rtc))
 + action = action-next;
 +
 + /* Try to call m48t59 RTC driver ISR */
 + if (action  action-handler)
 + recover = action-handler(SBCPQ2_M48T59_IRQ, m48t59_rtc);
 +
 + return recover;
 +}

What you do here looks really scary, but maybe I'm just misunderstanding
it completely. Why don't you just register your rtc handler function
as the machine check handler instead of going through various indirections?

 +static void __init sbcpq2_init_IRQ(void)
 +{
 + struct device_node *np;
 + struct resource res;
 +
 + np = of_find_compatible_node(NULL, cpm-pic, CPM2);
 + if (np == NULL) {
 + printk(KERN_ERR PIC init: can not find cpm-pic node\n);
 + return;
 + }

This looks like your device tree is wrong. Shouldn't the interrupt
controller have device_type=interrupt-controller and a specific
compatible property instead of having the name in the device_type?

 +static void __init sbcpq2_setup_arch(void)
 +{
 + struct device_node *np;
 + volatile memctl_cpm2_t *mc;

not volatile, but __iomem!

 + unsigned char * eeprom_base;
 + int i = 0;
 +
 +#ifdef CONFIG_CPM2
 + cpm2_reset();
 +#endif
 +
 + /*
 +  * Make sure that we have the right CS# setting
 +  */
 + mc = cpm2_immr-im_memctl;
 +
 + /* Boot Flash is the on-board flash */
 + mc-memc_br0 = (SBCPQ2_BOOT_FLASH_BASE  0x8000) | 0x0801;
 + mc-memc_or0 = 0xFFE00896;

consequently, this needs to use out_be32 or similar.
Where does SBCPQ2_BOOT_FLASH_BASE come from? Shouldn't that be set
up by the boot loader to match the device tree?

 + model = (char *)of_get_property(np, model, NULL);
 + if (!model)
 + continue;

The cast is not needed here.
 +
 + id = of_get_property(np, device-id, NULL);
 + if (!id)
 + continue;
 +
 + macaddr = (unsigned char *)of_get_mac_address(np);
 + if (!macaddr)
 + continue;

or here.

 + if (strstr(model, FCC))
 + eeprom_ofs = SBCPQ2_FCC1_MACADDR_OFS;
 + else if (strstr(model, SCC))
 + eeprom_ofs = SBCPQ2_SCC1_MACADDR_OFS;
 + eeprom_ofs += ((*id) - 1) * 6;

of_device_is_compatible()


 + for (j = 0; j  6; j++)
 + *(macaddr + j) = *(eeprom_base + eeprom_ofs + j);

in_8().

 + }
 + iounmap(eeprom_base);
 +}
 +
 +/*
 + * Called very early, device-tree isn't unflattened
 + */
 +static int __init sbcpq2_probe(void)
 +{
 + /* We always match for now, eventually we should look at
 +  * the flat dev tree to ensure this is the board we are
 +  * supposed to run on
 + 

Re: [PATCH 1/2] adb: create class devices for each adb device

2007-07-16 Thread Aristeu Rozanski
Hi Benjamin,
 I don't think class device is the right approach. Classes are supposed
 to be a functional binding, ie, in this case, input devices. ADB is a
 bus, and as such, you should create an adb bus type and and adb_device
 that is an extension of struct device, not struct class device.
ok, I'll work on that.

 There's also the question of what to do on ADB resets (such as when
 doing a sleep/wakeup cycle). Should we wipe out all devices and
 re-created them, thus loosing any settings ? Or should we have some way
 to attempt at re-matching existing ones ?
or maybe generate disconnect/connect events so udev rules can reconfigure
each keyboard?

-- 
Aristeu

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [patch 3/6] Add 8548 CDS PCI express controller node and PCI-X device node

2007-07-16 Thread Zang Roy-r61911
On Mon, 2007-07-16 at 23:00, Segher Boessenkool wrote:
  is this the only fix, I've already applied a version of this to
 my
  tree (with the irq sense fix) and just want to make sure there  
  isn't
  anything else.
  I do not get more.
  I'd like to enroll Segher's suggestion together with VIA chip  
  function
  in next step.
  We need to make basic pcie work on 8548 CDS board first.
 
  If you can, please make the compatible properties correct
  (pcie instead of pciex) before the patch goes in; it'll
  be less work total and less confusing in the end.
 
  I've taken care of that as well.
 
  They are now 'fsl,mpc8548-pcie, and 'fsl,mpc8641-pcie'
 
 Perfect, thanks!
I noticed Kumar made some modifications according to the feedback, when
he applied the patch.
Thanks!
Roy


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] Allow exec on 32-bit from readable, non-exec pages, with a warning.

2007-07-16 Thread David Gibson
On Wed, Jul 11, 2007 at 02:03:24AM +0200, Segher Boessenkool wrote:
  Yeah.  Giving the warning is a good thing though.
 
  No, it isn't; it's just noise, if we're not ever going to do anything
  to prevent the behaviour - and we can't.
 
 The same userland code will not run correctly on PPC64 or BookE
 systems.  Is that not a reason to warn?

Way back when, I distinctly recall aborting my plans to implement
per-page exec on 40x, precisely because of executables like this.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] Change the pci express controller node name from pci to pcie

2007-07-16 Thread Zang Roy-r61911
From: Roy Zang [EMAIL PROTECTED]

Change the pci express controller node name from pci
to pcie in device tree.

Signed-off-by: Roy Zang [EMAIL PROTECTED]
---
Based on Kumar tree and my previous patch for 8544DS
board.

 arch/powerpc/boot/dts/mpc8544ds.dts|6 +++---
 arch/powerpc/boot/dts/mpc8548cds.dts   |2 +-
 arch/powerpc/boot/dts/mpc8641_hpcn.dts |4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts 
b/arch/powerpc/boot/dts/mpc8544ds.dts
index aab0bc6..3f33af6 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -174,7 +174,7 @@
reg = 8000 1000;
};
 
-   [EMAIL PROTECTED] {
+   [EMAIL PROTECTED] {
compatible = fsl,mpc8548-pcie;
device_type = pci;
#interrupt-cells = 1;
@@ -197,7 +197,7 @@
;
};
 
-   [EMAIL PROTECTED] {
+   [EMAIL PROTECTED] {
compatible = fsl,mpc8548-pcie;
device_type = pci;
#interrupt-cells = 1;
@@ -220,7 +220,7 @@
;
};
 
-   [EMAIL PROTECTED] {
+   [EMAIL PROTECTED] {
compatible = fsl,mpc8548-pcie;
device_type = pci;
#interrupt-cells = 1;
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts 
b/arch/powerpc/boot/dts/mpc8548cds.dts
index c241e4f..4770a5b 100644
--- a/arch/powerpc/boot/dts/mpc8548cds.dts
+++ b/arch/powerpc/boot/dts/mpc8548cds.dts
@@ -310,7 +310,7 @@
device_type = pci;
};
/* PCI Express */
-   [EMAIL PROTECTED] {
+   [EMAIL PROTECTED] {
interrupt-map-mask = f800 0 0 7;
interrupt-map = 
 
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts 
b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
index e3cc97a..d1a8e0b 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -207,7 +207,7 @@
interrupt-parent = mpic;
};
 
-   [EMAIL PROTECTED] {
+   [EMAIL PROTECTED] {
compatible = fsl,mpc8641-pcie;
device_type = pci;
#interrupt-cells = 1;
@@ -395,7 +395,7 @@
 
};
 
-   [EMAIL PROTECTED] {
+   [EMAIL PROTECTED] {
compatible = fsl,mpc8641-pcie;
device_type = pci;
#interrupt-cells = 1;
-- 
1.5.1




___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 01/10] IB/ehca: Support for multiple event queues

2007-07-16 Thread Roland Dreier
  No, I've no figures to provide here. The background of this dist_eqs
  option is actually to allow us testing across all event queues
  without to change the testcases resp consumers to use certain
  event queue number. Thus, I should comment it as EXPERIMENTAL?

Seems like it's just development/testing code that shouldn't escape
into the wild?

   I think I would rather hold off on multiple EQs for this merge window
   and plan on having something really solid and thought-out for 2.6.24.

  Fair enough. However why don't let us gather experience with this
  feature now? Should we remove dist_eqs option for more consistency?

As I said I definitely think the dist_eqs switch doesn't sound like
something we want to expose to people.

With that said I still am not sure about putting the multiple EQs
feature in this release.  All the infrastructure is there to make
experimenting with it fairly painless (just the low-level driver needs
to change), and I still haven't seen much code using the feature or
even any anecdotal information about the performance impact.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 10/10] IB/ehca: Support large page MRs

2007-07-16 Thread Roland Dreier
   Why the module parameter?  Is there any reason a user would want to
   turn this off?  Or conversely, why is it off by default?
  
  We're pretty confident this new feature works, but as with all new and 
  possibly experimental features, there are chances it might explode your 
  machine when activated. So, like with the scaling code, we want the user 
  to make the conscious decision of using this code instead of activating it 
  by default.

OK, I guess.  So can we expect to, say, change the default to turning
it on for 2.6.24 and remove the option entirely (so it's always on) in
2.6.25?

 - R.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 01/10] IB/ehca: Support for multiple event queues

2007-07-16 Thread Michael S. Tsirkin
 I still haven't seen much code using the feature or
 even any anecdotal information about the performance impact.

Here's some anecdotal evidence :)
http://lists.openfabrics.org/pipermail/general/2007-May/035758.html

-- 
MST
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/3] 82xx: Parse SMC serial device node in DTS

2007-07-16 Thread Mark Zhan
Hello Arnd,

I think, the function of_find_compatible_node(), which is called in the
for loop, has already done that. So definitely, no need to call
of_device_is_compatible() any more.

Thanks
Mark Zhan
On Tue, 2007-07-17 at 03:02 +0200, Arnd Bergmann wrote:
 On Monday 16 July 2007, Mark Zhan wrote:
  -   cpm_uart_data.uart_clk = ppc_proc_freq;
  +   if (strstr(model, SMC)) {
  +   cpm_uart_dev = 
  platform_device_register_simple(fsl-cpm-smc:uart,
  +   i, r[0], 3);
  +   } else if (strstr(model, SCC)) {
  +   cpm_uart_dev = 
  platform_device_register_simple(fsl-cpm-scc:uart,
  +   i, r[0], 3);
  +   }
  
 
 You should probably use of_device_is_compatible() to check
 if a given device can be used by a particular driver.
 
   Arnd 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2.6.22-rc7 0/4] phy/gianfar: Fixes for gianfar and vitesse RGMII-ID support

2007-07-16 Thread Jeff Garzik
Andy Fleming wrote:
 A few bugs in the Vitesse PHY driver were found on the 8641D HPCN board.
 Originally, they were masked by a bug in the PHY Lib which was fixed by patch 
 5f708dd91d15876e26d7a57f97a255cedffca463 (Fix phy_id for Vitesse 824x PHY).
 That patch allowed the Vitesse PHY to bind on the 8641D HPCN board, thereby
 exposing a bug in the interrupt handling and a bug in the configuration of
 the PHY.  This sequence of patches fixes the irq handling bug, then fixes 
 the configuration bug in 3 places:
 
 1) The Vitesse PHY driver
 2) The gianfar driver (needs to pass in the mode correctly for internal delay)
 3) The OF device tree for arch/powerpc boards
 
 You can apply the following patches, or pull them directly:
 
 The following changes since commit c5e3ae8823693b260ce1f217adca8add1bc0b3de:
   Ayaz Abdulla (1):
 forcedeth bug fix: realtek phy
 
 are found in the git repository at:
 
   http://opensource.freescale.com/pub/scm/linux-2.6-85xx.git netdev
 
 Andy Fleming (4):
   Fix Vitesse 824x PHY interrupt acking
   Add phy-connection-type to gianfar nodes
   Fix Vitesse RGMII-ID support
   Fix RGMII-ID handling in gianfar
 
  Documentation/powerpc/booting-without-of.txt |6 +++
  arch/powerpc/boot/dts/mpc8641_hpcn.dts   |4 ++
  arch/powerpc/sysdev/fsl_soc.c|9 +
  drivers/net/gianfar.c|   12 ++-
  drivers/net/phy/vitesse.c|   46 
 +++---
  include/linux/fsl_devices.h  |1 +
  6 files changed, 72 insertions(+), 6 deletions(-)

pulled


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2.6.22-rc7 0/4] phy/gianfar: Fixes for gianfar and vitesse RGMII-ID support

2007-07-16 Thread Kumar Gala
Greg,

Can you look at pulling these fixes for the next 2.6.22.x stable  
release.

- k

On Jul 17, 2007, at 12:07 AM, Jeff Garzik wrote:

 Andy Fleming wrote:
 A few bugs in the Vitesse PHY driver were found on the 8641D HPCN  
 board.
 Originally, they were masked by a bug in the PHY Lib which was  
 fixed by patch 5f708dd91d15876e26d7a57f97a255cedffca463 (Fix  
 phy_id for Vitesse 824x PHY).
 That patch allowed the Vitesse PHY to bind on the 8641D HPCN  
 board, thereby
 exposing a bug in the interrupt handling and a bug in the  
 configuration of
 the PHY.  This sequence of patches fixes the irq handling bug,  
 then fixes the configuration bug in 3 places:
 1) The Vitesse PHY driver
 2) The gianfar driver (needs to pass in the mode correctly for  
 internal delay)
 3) The OF device tree for arch/powerpc boards
 You can apply the following patches, or pull them directly:
 The following changes since commit  
 c5e3ae8823693b260ce1f217adca8add1bc0b3de:
   Ayaz Abdulla (1):
 forcedeth bug fix: realtek phy
 are found in the git repository at:
   http://opensource.freescale.com/pub/scm/linux-2.6-85xx.git netdev
 Andy Fleming (4):
   Fix Vitesse 824x PHY interrupt acking
   Add phy-connection-type to gianfar nodes
   Fix Vitesse RGMII-ID support
   Fix RGMII-ID handling in gianfar
  Documentation/powerpc/booting-without-of.txt |6 +++
  arch/powerpc/boot/dts/mpc8641_hpcn.dts   |4 ++
  arch/powerpc/sysdev/fsl_soc.c|9 +
  drivers/net/gianfar.c|   12 ++-
  drivers/net/phy/vitesse.c|   46 ++ 
 +---
  include/linux/fsl_devices.h  |1 +
  6 files changed, 72 insertions(+), 6 deletions(-)

 pulled


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2.6.22-rc7 0/4] phy/gianfar: Fixes for gianfar and vitesse RGMII-ID support

2007-07-16 Thread Greg KH
On Tue, Jul 17, 2007 at 12:16:27AM -0500, Kumar Gala wrote:
  Greg,
 
  Can you look at pulling these fixes for the next 2.6.22.x stable release.

Can you send them as patches, to the [EMAIL PROTECTED] address, after
they go into Linus's tree?

thanks,

greg k-h
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 0/3] 82xx: Add the support for Wind River SBC PowerQUICCII

2007-07-16 Thread Mark Zhan
Hi Vitaly,

When you will send out your 8xx/82xx series patches?

Thanks
Mark Zhan
On Tue, 2007-07-17 at 04:44 +0400, Vitaly Bordug wrote:
 On Mon, 16 Jul 2007 17:01:28 +0800
 Mark Zhan wrote:
 
  These 3 patches add the powerpc support of Wind River SBC
  PowerQUICCII.
  
 I am sorry, but this would intercept with big 8xx/82xx series from 
 Scott Wood I am reviewing now. it makes the initial merged code
 more maintainable and powerpc-friendly, but would have some rework
 required in upcoming patches for new BSPs.
 
 OTOH, it would make all the changes below very short and apparent.
 Of course, if something would block those series this one can be considered 
 to merge.
 
 
  1) Currently, some mpc82xx platform hooks in mpc82xx_ads.c are
  actually not specific to ads board. So the 1st patch makes them be
  shared by different 82xx boards.
  
  2) The 2nd patch make 'cpm_uart_of_init' be able to parse SMC uart in
  DTS
  
  3) The 3rd patch is the platform codes, defconfig and dts for Wind
  River SBC PowerQUICCII 82xx board.
  
  Any comment is welcome.
  
  Thanks
  Mark Zhan
  
  ___
  Linuxppc-dev mailing list
  Linuxppc-dev@ozlabs.org
  https://ozlabs.org/mailman/listinfo/linuxppc-dev
 
 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev