LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: Ethernet driver for Linux kernel 2.6 running on ML403
From: Grant Likely @ 2006-09-14 22:49 UTC (permalink / raw)
  To: John Bonesio; +Cc: linuxppc-embedded
In-Reply-To: <2FE3DBF1797A1443AAB3FA0EF6BF4EEC021EA645@XSJ-EXCHVS1.xlnx.xilinx.com>

On 9/14/06, John Bonesio <john.bonesio@xilinx.com> wrote:

<snip>

> << Same complaints apply for Xilinx drivers in the U-Boot bootloader.
> It is proving very difficult to get Xilinx code into U-Boot which means
> BSPs that use the code are hard to get submitted as well.>>
>
> I've only touched on U-Boot a little bit. Have any thoughts on how to
> make this easier?

U-Boot has the same issues as Linux
- Xilinx drivers don't match the coding style
- The license boilerplate is not GPL compatible
- The IP can change rapidly, so do the drivers belong in the u-boot
mainline tree?
- Current code is not set up to support multiple drivers in the code
base.  (I know it's possible, but it's not being done at the moment)

(and see my comments on Linux below)

>
> << The Xilinx approach of overwriting the source tree just feels wrong,
> and no one seems to want to do it that way.>>
>
> I am in the group that has control over how this is done. What would you
> propose be done different? Keep in mind that we are trying to support a
> process where someone builds a hardware design and the later changes it
> with new peripherals or perhaps makes minor tweaks. We want to make the
> updating of the Linux kernel to reflect these hardware changes easy for
> people.

Simply generating code and inserting it into the kernel tree itself is
okay on the surface, but the current scheme is distasteful.  I would
make the following recommendations to make it more palatable:
- Keep generated code in a single sub-directory.  Don't scatter it all
over the kernel source.  ie. generate all code into /xilinx-bsp
instead of bits into /arch/ppc and /drivers.
- Don't overwrite *anything* that from the mainline tree.  (Hence the
/xilinx-bsp suggestion above).  If you need to modify files in the
tree, like in /arch/ppc, then submit patches for the needed changes
and *don't* try to modify them from within EDK.
- If you want something in mainline; make sure it can coexist with
drivers for other versions of the same IP, or make it support multiple
versions.
- Corollary to the above two points; once a Xilinx provided
patch/driver is accepted into mainline, treat it like the rest of
mainline and don't let EDK overwrite it.
- Regardless of Xilinx's intentions, 3rd party drivers will probably
be written and accepted into mainline.  Be prepared to coexist with
them also.
- Stop requiring xparameters.h to be mangled!  Generate it correctly
the first time!  I think I'll scream if I get handed another xparams
file from an FPGA engineer which was generated as a no-os target.  The
Linux redefines are useful, why aren't they in xparameters.h for all
targets?

Unfortunately, generating the drivers ends up being a one way street.
If the code is not in mainline, it will not keep up with changes to
the kernel API, and it is more difficult to get bug fixes into the
driver code from 3rd parties (ie. users need to wait for the next EDK
release cycle before the changes appear in generated code).  This is
probably the major reason why writing new 3rd party drivers for
inclusion in mainline is attractive to me.

>
> Having the ability to make rapid hardware changes, I think, is a bit
> different from what most folks are used to.

Different, but manageable.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: Please pull powerpc.git 'merge' branch
From: Paul Mackerras @ 2006-09-14 22:55 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0609141208510.4388@g5.osdl.org>

Linus Torvalds writes:

> Hmm. I'm not at all sure this pull caused the problem, and it may have 
> started long before, but right now I have problems printing on my G5 
> machine. 
> 
> I'll get around to trying to bisect it at some point, but before I even 
> start, I should probably check if anybody recognizes this immediately.

Curious.  It doesn't look familiar.  I have had problems printing from
my G5 in the past few weeks, but I attributed it to something being
broken in debian unstable, and right now, running current git,
printing is working again for me.

> which actually looks like something is broken (it says timeout in 5 
> microseconds, even though the timeout structure is shown as being one 
> second).
> 
> Now, it's entirely possible that the _broken_ thing is actually strrace 
> itself (that return value from "time()" looks a bit strange too), and that 
> it's some tracing problem with rinning 32-bit programs on a 64-bit kernel.

I just tried stracing the X server (I don't have a cupsd running) and
the selects look reasonable, e.g.:

select(256, [1 3 4 5 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
26 27 28 29 30 32 33], NULL, NULL, {0, 484000}) = 1 (in [33], left {0,
460000}) <0.026111>

Is your cupsd a 32-bit or a 64-bit binary?

Paul.

^ permalink raw reply

* Re: Ethernet driver for Linux kernel 2.6 running on ML403
From: Grant Likely @ 2006-09-14 22:57 UTC (permalink / raw)
  To: Keith J Outwater; +Cc: linuxppc-embedded
In-Reply-To: <OF4E2E74F4.771A25A6-ON072571E9.00554898-072571E9.0056BF13@mck.us.ray.com>

On 9/14/06, Keith J Outwater <kjoutwater@raytheon.com> wrote:
> >
> > So what direction do we (as the community) want to go for supporting
> > Xilinx IP in the Linux kernel?
>
> I don't know about anyone else, but running Linux on Virtex FPGAs is
> something I simply have to be able to do.  With or without Xilinx
> drivers, I think the kernel needs to support Xilinx hardware.

ditto

>
> >
> > If we reject the Xilinx driver code, then we either have to do without
> > Xilinx support in mainline, or we need to write new drivers that
> > address the above issues (support multiple IP versions, etc).  The
> > Xilinx support in mainline right now does not use any Xilinx code.
> > (Xilinx PIC and UART).
> >
> > Thoughts?
>
> As painful as it may be, maybe we just write drivers from scratch and
> try to track changes in the IP.

That's kind of the direction I'm leaning too.


-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: Ethernet driver for Linux kernel 2.6 running on ML403
From: David H. Lynch Jr. @ 2006-09-14 23:02 UTC (permalink / raw)
  To: Michael Galassi; +Cc: linuxppc-embedded
In-Reply-To: <200609141353.k8EDrkPN065101@penguin.ncube.com>

[-- Attachment #1: Type: text/plain, Size: 2354 bytes --]

Michael Galassi wrote:
>
> It is also worth noting that as released in MVL pro 4.0.1 it only
> supports hard_temac 1.00.a and plb_temac 2.00.a, both of which are
> tagged as deprecated in the current version (8.2.01i) of Xilinx's
> EDK. The current version of {plb,hard}_temac (3.00.a) goes to great
> lengths to break compatibility with older versions.  This will
> presumably be fixed next month when it is rumored that wonderful new
> things will come from Xilinx.  In the mean-time it is possible, though
> neither simple, nor fun, to create Virtex4 designs with the older IP.
>   
    Fortunately, I have little to do with the firmware.
    Unfortunately, after the firmware is in the product, I am the guy 
who has to make the drivers work.

    I am also not straight - though I am somewhat clearer, on exactly 
what any given flavor of TEMAC is.

    As best as I can tell, the V4 FX chipsets contain some dedicated 
hardware that forms the basis for the TEMAC.
    (or possibly several TEMAC's depending on how it is built).
   
    Separately Xilinx provides a plethora of wrapper logic, that allows 
you to implement  a slew of different incarnations.
    All similar yet different at the same time. Ranging from the Local 
Link TEMAC which is the simplest to the
    PLB SG DMA driven TEMAC which is probably the most complex.

    Then there is an assortment of PDF's from Xilinx, none of which 
quite match whatever you might have.

    And at the risk of Goring somebodies Ox, the MV/EDK based drivers 
may/may not have the attribute of
    being portable accross multiple OS's, but they seem to pretty much 
deliberately violate almost every style
    quideline for Linux drivers. Linux is written in C, not preprocessor 
Macros.

    For anyone at MV I have ticked off - Sorry, I am sure it is 
brilliantly written preprocessor Macros.
   
   
   




> -michael
>   


-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein


[-- Attachment #2: Type: text/html, Size: 3339 bytes --]

^ permalink raw reply

* RE: Ethernet driver for Linux kernel 2.6 running on ML403
From: Keith J Outwater @ 2006-09-14 23:08 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <2FE3DBF1797A1443AAB3FA0EF6BF4EEC021EA6FA@XSJ-EXCHVS1.xlnx.xilinx.com>

"John Bonesio" <john.bonesio@xilinx.com> wrote on 09/14/2006 10:52:16 AM:
<snip>
> 
> I don't think that there are any "version" registers in the Xilinx 
> IP cores that a driver could check to determine compatibility.  That
> would be very cheap to implement in hardware and you could then
> develop more universal drivers.
> 
> [John]
> We've examined doing this in the past, and gotten some push back due to
> the use of bram or other resources. Conceptually, it's a great idea, I
> just don't know if this is likely to happen any time soon.
> 

John,
I thinking in terms of something like a 32 bit register
(i.e. like a processor's PVR register) that has a hard-coded magic number
which a driver can read and decode to determine driver compatibility.
That does not sound resource-intensive given the size FPGAs we are talking
about.  Probably don't even need 32 bits.

Keith

^ permalink raw reply

* Re: Ethernet driver for Linux kernel 2.6 running on ML403
From: David H. Lynch Jr. @ 2006-09-14 23:16 UTC (permalink / raw)
  To: Keith J Outwater; +Cc: linuxppc-embedded
In-Reply-To: <OF1385C39A.BEB9B9E6-ON072571E9.005DAC98-072571E9.0060ABAE@mck.us.ray.com>

Keith J Outwater wrote:
>> Hi,
>
> I don't think that there are any "version" registers in the Xilinx 
> IP cores that a driver could check to determine compatibility.  That
> would be very cheap to implement in hardware and you could then
> develop more universal drivers.
>
>   
    Some of the IP's do, some don't - and then some might.
    Some of the documentation isn't too bad, some is almost un-uasable.
   
 
   




-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein

^ permalink raw reply

* Re: Please pull powerpc.git 'merge' branch
From: Linus Torvalds @ 2006-09-14 23:36 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17673.56806.552948.748504@cargo.ozlabs.ibm.com>



On Fri, 15 Sep 2006, Paul Mackerras wrote:
> 
> Curious.  It doesn't look familiar.  I have had problems printing from
> my G5 in the past few weeks, but I attributed it to something being
> broken in debian unstable, and right now, running current git,
> printing is working again for me.

Ok, maybe the debian brokenness exists in FC5 too, and a "yum upgrade" 
broke it for me rather than any kernel work. I guess I'll just have to try 
different kernels and see if the kernel matters at all. The strace output 
just made me assume that maybe the kernel _does_ do something wrong.

> I just tried stracing the X server (I don't have a cupsd running) and
> the selects look reasonable, e.g.:
> 
> select(256, [1 3 4 5 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
> 26 27 28 29 30 32 33], NULL, NULL, {0, 484000}) = 1 (in [33], left {0,
> 460000}) <0.026111>
> 
> Is your cupsd a 32-bit or a 64-bit binary?

My cupsd is 32-bit (but so is my X server, so I'd assuge strace has the 
same breakage). Strace looks ok when I trace "firefox", though (which is 
using "poll()", not select). So..

		Linus

^ permalink raw reply

* Re: Ethernet driver for Linux kernel 2.6 running on ML403
From: David H. Lynch Jr. @ 2006-09-15  0:08 UTC (permalink / raw)
  To: John Bonesio; +Cc: linuxppc-embedded
In-Reply-To: <2FE3DBF1797A1443AAB3FA0EF6BF4EEC021EA6FA@XSJ-EXCHVS1.xlnx.xilinx.com>

John;

    My guess would be that as the whole xilinx drivers/edk stand, even 
with the virulent support of this list I would not bet on their being 
accepted upstream.

    Nothing in the Linux Kernel that I am aware of resembles them.
    There has been on ongoing holy war in LKML over getting reiser4 
accepted as experimental, one of the major issues being coding style. 
The style of reiser4
    is alot closer to Linux norms than the Xilinx EDK code.

    The current Xilinx approach is supposed to easily give us board 
support for varying IP's accross several platforms. I have been 
providing board support for
Pico Computing's Xilinx V4 based offerings for about a year, and I have 
been unable to take advantage of any of that. I have done board bringup 
for two OS's.
While I have been able to benefit from the work of other's on this list, 
and I have been able to occasionally use some code coming from Xilinx - 
mostly as  a reference,
I have two products supporting two operating systems, with a small 
collection of variable peripherals. None of this uses the Xilinx EDK. I 
deliberately postponed
work on the ethernet drivers in the hope they would be finished by the 
time I finished everything else. In the end I had to write my own.

I am not trying to bash Xilinx or Monta Vista. What I am questioning is 
whether the approach that Xilinx is currently using, aside from other 
problems, may actually run
counter to its goal.

If the Xilinx EDK could give us the support we need for the IP's we use. 
If it adapted easily between OS's, and IP versions. And if the code was 
as current as the IP's themselves.
Maybe the Xilinx EDK would be vindicated.

Certainly many of us would use it. While I happen to personally adhere 
to 98% of the Linux Style guidelines - I here many of my own views 
express ed in them, I am not a fanatic.
I am happy if my work improves Linux. But in the end I pay my mortgage 
and feed my family. I will use the resources that get the job done. 
Style is secondary.

But my honest expectation is that MV/Xilinx EDK support will always lag 
way behind what I am trying to do, and/or be incompatible with the goals 
and objectives of my clients.
For me the code coming from Xilinx/MV is most useful as a reference. I 
have ranted about mismatches between documentation and hardware - but 
that is not something new or specific
to Xilinx. What code has leaked out has proven useful - often after 
several days work turning it into something actually readable, as a 
reference - "Oh, that is how that bit really works"

I would be happy to be proven wrong - but I do not expect to be.






-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein

^ permalink raw reply

* Re: [PATCH] powerpc: minor fix of numa message
From: Michael Ellerman @ 2006-09-15  1:04 UTC (permalink / raw)
  To: Geoff Levand; +Cc: linuxppc-dev, paulus, anton
In-Reply-To: <45097273.8070103@am.sony.com>

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

On Thu, 2006-09-14 at 08:17 -0700, Geoff Levand wrote:
> This is a very minor fix that effects no current system.  The NUMA startup
> message values for 'Top of RAM' and 'Memory hole size' were reported
> incorrectly if more than one lmb region was added.
> 
> A comment in the lmb code states that lmb_analyze() must be called before
> lmb_phys_mem_size().

But we've already called it in early_init_devtree()?

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply

* Montavista Linux v3.1 Ethernet issue
From: Chun Chung Lo @ 2006-09-15  1:06 UTC (permalink / raw)
  To: linuxppc-embedded


Hi all,

I anm currently working a STB project with a PPC405EP system. Our board
has 2 ethernet ports. But I just found some interesting issue:

http://ozlabs.org/pipermail/linuxppc-embedded/2003-December/012790.html

This may be a old issue, but I would like to ask is this bug fixed in
Montavista Linux v3.1?=0D

(the output of `uname -r` under the linux console is "Linux STB405EP_1
2.4.20_mvl31-405ep_eval #1 Wed Sep 6 11:54:22 HKT 2006 ppc unknown")

Thanks all.

Best regards,
Lo Chun Chung

This message (including any attachments) is for the named addressee(s)'s=
 use only. It may contain
sensitive, confidential, private proprietary or legally privileged=
 information intended for a
specific individual and purpose, and is protected by law. If you are not=
 the intended recipient,
please immediately delete it and all copies of it from your system, destroy=
 any hard copies of it
and notify the sender. Any use, disclosure, copying, or distribution of=
 this message and/or any
attachments is strictly prohibited.

^ permalink raw reply

* Re: Ethernet driver for Linux kernel 2.6 running on ML403
From: David H. Lynch Jr. @ 2006-09-15  1:14 UTC (permalink / raw)
  To: John Bonesio; +Cc: linuxppc-embedded
In-Reply-To: <2FE3DBF1797A1443AAB3FA0EF6BF4EEC021EA6FA@XSJ-EXCHVS1.xlnx.xilinx.com>

John;

    In a related rant. Why is it that there is so much meaningless 
variation in the IP's.

    I accept that there are reasons for sometimes mapping registers via 
dcr and in other IP's making them available directly.
    But why do the assorted bits in what is virtually the same register 
have to keep jumping all over the place ?

    As an example there are enormous similarities between the GEMAC that 
has a driver provided by GHS Integrity, and the
PLB FIFO TEMAC. It is almost possible to build the driver as either with 
just a different set of deffinitions - I spent two weeks
trying unsuccessfully to do just that.



-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein

^ permalink raw reply

* Re: Uncompressing Linux failure
From: David H. Lynch Jr. @ 2006-09-15  1:16 UTC (permalink / raw)
  To: wei.li4; +Cc: linuxppc-embedded
In-Reply-To: <20060914141550.b4x2d2aqck48osk4@webmail.mcgill.ca>

    This looks like the ppc bug with new version of zlib.
But I thought it was fixed by 2.6.18-rc2.

MY recomendation would be to either move newer or older.
Alternatively back out the zlib patch.

wei.li4@elf.mcgill.ca wrote:
> Hi All,
>
> I got the following error when I ported linux 2.6.18-rc2-g73a589b5 to 
> my board(MPC875), my bootloader is working fine with linux 2.6.13, and 
> I am using same cross-tools from ELDK 4.0:
>
> loaded at:     00400000 00529124
> board data at: 00FFFEA8 00FFFF2C
> relocated to:  00404068 004040EC
> zimage at:     00404EE1 00526337
> avail ram:     0052A000 01000000
>                                                                         
>          Uncompressing Linux...inflate returned FFFFFFFE
> exit
>
> Can you advise me? thanks.
>
> Wei
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>   


-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein

^ permalink raw reply

* ethernet patch for kernel 2.6 for ml403
From: Aleck Lin @ 2006-09-15  3:24 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <mailman.270.1158283233.2423.linuxppc-embedded@ozlabs.org>

Hello,

I found this patch that was posted back in January
(http://ozlabs.org/pipermail/linuxppc-embedded/2006-January/021574.html).

As I was trying it, there were some warnings and errors. When I fixed them
as much as I could to the point of a successful compilation, I tried to boot
this kernel image on ml403. However, it still complains that no network
devices available. 

TWO questions.
1. Has anyone ever tried with the patch and been successful with it?
2. Why does it still complain no network devices found even though I thot I
added the correct ethernet driver? 

Thanks for any help as I'm still relatively new to this.

Aleck


Here's my booting message.

---------------------------------------------------
## Booting image at 00800000 ...
   Image Name:   Linux-2.6.17.8
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    854118 Bytes = 834.1 kB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
## cmdline at 0x007FFF00 ... 0x007FFF37
memstart    = 0x00000000
memsize     = 0x04000000
flashstart  = 0xFF800000
flashsize   = 0x00800000
flashoffset = 0x00000000
sramstart   = 0x00000000
sramsize    = 0x00000000
bootflags   = 0x0000012A
procfreq    =    300 MHz
plb_busfreq =    100 MHz
ethaddr     = 00:11:22:33:44:55
IP addr     = 192.168.200.230
baudrate    =   9600 bps
## Loading RAMDisk Image at 01000000 ...
   Image Name:   Simple Embedded Linux Framework
   Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
   Data Size:    1437217 Bytes =  1.4 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Ramdisk to 03d03000, end 03e61e21 ... OK
[    0.000000] Linux version 2.6.17.8 (aleck@sac.gdatech.com) (gcc version
4.0.0 (DENX ELDK 4.0 4.0.0)) #87 Thu Sep 14 20:06:23 PDT 2006
[    0.000000] Xilinx ML403 Reference System (Virtex-4 FX)
[    0.000000] Built 1 zonelists
[    0.000000] Kernel command line: console=ttyS0,9600 ip=192.168.200.230
root=/dev/ram0 rw
[    0.000000] Xilinx INTC #0 at 0x41200000 mapped to 0xFDFFE000
[    0.000000] PID hash table entries: 512 (order: 9, 2048 bytes)
[    0.000151] Console: colour dummy device 80x25
[    0.000567] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.001213] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.013282] Memory: 61632k available (1308k kernel code, 476k data, 84k
init, 0k highmem)
[    0.200420] Mount-cache hash table entries: 512
[    0.202863] checking if image is initramfs...it isn't (no cpio magic);
looks like an initrd
[    0.863139] Freeing initrd memory: 1403k freed
[    0.866364] NET: Registered protocol family 16
[    0.869487] Generic PHY: Registered new driver
[    0.874412] NET: Registered protocol family 2
[    0.912357] IP route cache hash table entries: 512 (order: -1, 2048
bytes)
[    0.913062] TCP established hash table entries: 2048 (order: 1, 8192
bytes)
[    0.913241] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.913339] TCP: Hash tables configured (established 2048 bind 1024)
[    0.913368] TCP reno registered
[    0.920012] io scheduler noop registered
[    0.920111] io scheduler anticipatory registered (default)
[    0.920187] io scheduler deadline registered
[    0.920346] io scheduler cfq registered
[    0.958113] Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ
sharing disabled
[    0.962450] serial8250.0: ttyS0 at MMIO 0x40401003 (irq = 3) is a 16550A
[    2.871187] RAMDISK driver initialized: 16 RAM disks of 65536K size 1024
blocksize
[    2.961972] allocating ethernet device...
[    3.010204] eth%d: using fifo mode.
[    3.052064] eth%d: Xilinx EMAC #0 at 0x80400000 mapped to 0xC5000000,
irq=31
[    3.136606] eth%d: id 2.0a; block id 0, type 8
[    3.190431] Marvell 88E1101: Registered new driver
[    3.250101] tun: Universal TUN/TAP device driver, 1.6
[    3.310712] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[    3.385845] mice: PS/2 mouse device common for all mice
[    3.448583] TCP bic registered
[    3.485307] NET: Registered protocol family 1
[    3.537610] NET: Registered protocol family 17
[    4.096219] IP-Config: No network devices available.
[    4.156871] RAMDISK: Compressed image found at block 0
[    5.002841] VFS: Mounted root (ext2 filesystem).
[    5.058432] Freeing unused kernel memory: 84k init
### Application running ...


BusyBox v(null) ((null)) Built-in shell (msh)
#
------------------------------------------------------------------

^ permalink raw reply

* IDE DMA Issue PPC4xx
From: Akhilesh Soni @ 2006-09-15  5:07 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 25751 bytes --]

Hi All,


I'm using IBM redwood6 stb025xx(ppc405gp) platform with 2.6.14 kernel. I'm trying to get DMA working for IDE interface (PIO is working). The problem I'm facing is that my DMA is completing and I'm getting a error in DMA status register that "A DMA  request from an external device is pending"

I'm attaching (inline) the console message(in red color) along with the sample code of the driver(in blue color). Please help me to resolve this issue. What I feel is that DMA is completing and IDE is not getting anything. ( IDE status register is giving 0x58). 

Any pointers to same will be highly appreciated.


Regards,
Akhilesh



IBM Set-Top-Box BIOS 1.50 (Feb-16-2004)

Platform support <Redwood6/STBx25xx 1.03 (Jun/24/2002)>


Initializing devices, please wait.....
                                         

 ------- System Info --------

 Processor speed = 252 MHz

 EBIU speed      = 63 MHz

 Amount of RAM   = 64 MBytes

DM9000 : dmfe_probe() : Checking DM9000 chip 

DM9000 : Chip Found ID : 90000a46 


 --- Device Configuration ---

 Power-On Test Devices:

   000  Disabled  System Memory [RAM]

 ----------------------------

 Boot Sources:

   001  Disabled  Application in Flash [FLASH]

   002  Enabled   Ethernet [ENET]

                  local=192.168.18.28  remote=192.168.18.101  hwaddr=bad0add00000

   003  Disabled  Serial Port 1 [S1]

                  Baud = 9600

 ----------------------------

Update Flash  : Disabled 

Automatic Boot: Disabled

 ----------------------------

  1 - Toggle Power-On Tests

  2 - Change a Boot Device

  3 - Change IP Addresses

  4 - Ping test

  5 - Change Baud Rate for S1 Boot

  6 - Toggle Update Flash

  7 - Toggle Automatic Boot

  B - Bootlogo Management

  D - Display Configuration

  S - Save Changes

  Z - Set Ethernet HW Address

  0 - Exit Menu and Boot Application

  C - Enable CHOIS Debug 

->0

DM900 : dmfe_init_dm9000 : initialising dm9000

Booting from [ENET] Ethernet...

Sending bootp request ...

 bootp packets sent = 1
DM900 : dmfe_send : hold frame collision, outbound frame.


Got bootp response from : 192.168.18.101

       My ip address is : 192.168.18.28


Loading file "zImage.treeboot" by TFTP for net boot ...

 block  268
 block 1440
Transfer completed, 897568 bytes received

Loaded successfully ...

Entry point at 0x500000 ...


loaded at:     00500000 005DC164

relocated to:  00400000 004DC164

board data at: 004DA124 004DA164

relocated to:  0040515C 0040519C

zimage at:     0040591D 004D9A6C

avail ram:     004DD000 02000000


Linux/PPC load: ip=on

Uncompressing Linux...done.

Now booting the kernel

Linux version 2.6.14 (root@localhost.localdomain) (gcc version 4.0.0 (DENX ELDK 4.0 4.0.0)) #258 Wed Sep 13 16:12:58 IST 2006

ocp: ocp_early_init()...

ocp: ocp_add_one_device()...

ocp: ocp_add_one_device()...done

ocp: ocp_add_one_device()...

ocp: ocp_add_one_device()...done

ocp: ocp_add_one_device()...

ocp: ocp_add_one_device()...done

ocp: ocp_add_one_device()...

ocp: ocp_add_one_device()...done

ocp: ocp_add_one_device()...

ocp: ocp_add_one_device()...done

ocp: ocp_add_one_device()...

ocp: ocp_add_one_device()...done

ocp: ocp_early_init()... done.

IBM Redwood6 (STBx25XX) Platform

Port by MontaVista Software, Inc. (source@mvista.com)

Built 1 zonelists

Kernel command line: ip=on

PID hash table entries: 256 (order: 8, 4096 bytes)

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory: 30488k available (1452k kernel code, 344k data, 96k init, 0k highmem)

Mount-cache hash table entries: 512

NET: Registered protocol family 16

ocp: ocp_driver_init()...

ocp: ocp_driver_init()... done.

Adding platform devices 

Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled

ttyS0 at MMIO 0x0 (irq = 22) is a 16550A

ttyS1 at MMIO 0x0 (irq = 20) is a 16550A

ttyS2 at MMIO 0x0 (irq = 21) is a 16550A

io scheduler noop registered

io scheduler anticipatory registered

io scheduler deadline registered

io scheduler cfq registered

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize

loop: loaded (max 8 devices)

dm9000 Ethernet Driver

dm9000_set_io : byte_width 2

eth0: dm9000 at c3000000,c3000004 IRQ 26 MAC: ba:d0:ad:d0:00:00

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx

NET: Registered protocol family 2

IP route cache hash table entries: 512 (order: -1, 2048 bytes)

TCP established hash table entries: 2048 (order: 1, 8192 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

TCP bic registered

NET: Registered protocol family 1

inside stb04xxx_ide_init 

IBM STB025xx OCP IDE driver version 1.0 f2100000 

ide_redwood: waiting for drive ready......Drive spun up 

ocp_ide_setup_dma 

probing for hda: present=0, media=32, probetype=ATA

hda: probing with STATUS(0x51) instead of ALTSTATUS(0x00)

hda: WDC WD400EB-00CPF0, ATA DISK drive

probing for hdb: present=0, media=32, probetype=ATA

probing for hdb: present=0, media=32, probetype=ATAPI

hdb: probing with STATUS(0x01) instead of ALTSTATUS(0x00)

ocp_ide_tune_drive pio 4

got ocp_ide_dma_off_quietly

got ocp_ide_dma_check

redwood_config_drive_for_dma 22

ocp_ide_tune_drive pio 4

got ocp_ide_dma_on

ide0 at 0xc3004000-0xc3004007,0xc3006000 on irq 27

hda: max request size: 128KiB

ide_execute_command : 0x91

ide_execute_command : 0x10

ide_execute_command : 0xf8

hda: 78165360 sectors (40020 MB) w/2048KiB Cache, CHS=65535/16/63, (U)DMA

hda: cache flushes not supported

 hda:__ide_do_rw_disk : dma 1 lba48 0 LBA=0

got ocp_ide_dma_setup 

ide_execute_command : 0xc8

got ocp_ide_dma_begin 0x1000

DMA addr c0340000 340000 count 8 dmastat 0

got ocp_ide_dma_test_irq

got ocp_ide_dma_end 0 20000000

ide_dma_intr : stat 50

DMA complete stat 0 500000

 hda1

IDE probe finished 

eth0: link up, 100Mbps, full-duplex, lpa 0x41E1

Sending BOOTP and RARP requests . OK

IP-Config: Got BOOTP answer from 192.168.18.101, my address is 192.168.18.28

IP-Config: Complete:

      device=eth0, addr=192.168.18.28, mask=255.255.255.0, gw=192.168.18.1,

     host=192.168.18.28, domain=, nis-domain=(none),

     bootserver=192.168.18.101, rootserver=192.168.18.101, rootpath=/opt/eldk/ppc_4xx

Looking up port of RPC 100003/2 on 192.168.18.101

Looking up port of RPC 100005/1 on 192.168.18.101

VFS: Mounted root (nfs filesystem) readonly.

Freeing unused kernel memory: 96k init

modprobe: FATAL: Could not load /lib/modules/2.6.14/modules.dep: No such file or directory

modprobe: FATAL: Could not load /lib/modules/2.6.14/modules.dep: No such file or directory


INIT: version 2.85 booting
 Came here in rc.sysinit creating var\n
mounting 
ln: `/proc/mounts': File exists
  Welcome to DENX Embedded Linux Environment
  Press 'I' to enter interactive startup.
Building the cache [  OK  ]
 storage network audio done[  OK  ]
modprobe: FATAL: Could not load /lib/modules/2.6.14/modules.dep: No such file or directory

Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
Setting clock : Thu Jan  1 01:00:12 MET 1970 [  OK  ]
Setting hostname CHOISpad-110:  [  OK  ]
Mounting local filesystems:  [  OK  ]
Enabling swap space:  [  OK  ]

INIT: Entering runlevel: 3
Entering non-interactive startup
Bringing up loopback interface:  modprobe: FATAL: Could not load /lib/modules/2.6.14/modules.dep: No such file or directory

arping: socket: Address family not supported by protocol
Error, some other host already uses address 127.0.0.1.
[FAILED]
Starting system logger: [  OK  ]
Starting kernel logger: [  OK  ]
Starting portmap: [  OK  ]
Mounting NFS filesystems:  [  OK  ]
Mounting other filesystems:  [  OK  ]
Starting xinetd: [  OK  ]

DENX ELDK version 4.0 build 2006-01-11
Linux 2.6.14 on a ppc

CHOISpad-110 login: root
Last login: Thu Jan  1 01:00:19 on console
bash-3.00# 
bash-3.00# 
bash-3.00# 
bash-3.00# 
bash-3.00# 
bash-3.00# hdparm -t\b \b\b \b/dev/hda

/dev/hda:
 multcount    =  0 (off)
 I/O support  =  0 (default 16-bit)
 unmaskirq    =  1 (on)
 using_dma    =  1 (on)
 keepsettings =  0 (off)
 nowerr       =  0 (off)
 readonly     =  0 (off)
 readahead    = 256 (on)
 geometry     = 65535/16/63, sectors = 78165360, start = 0
bash-3.00# 
bash-3.00# 
bash-3.00# 
bash-3.00# 
bash-3.00# hdparm -t /dev/hda

/dev/hda:
 Timing buffered__ide_do_rw_disk : dma 1 lba48 0 LBA=0

 disk reads:  got ocp_ide_dma_setup 

ide_execute_command : 0xc8

got ocp_ide_dma_begin 0x1000

DMA addr c1238000 1238000 count 8 dmastat 0

DMA complete stat 20001000 0

hda: lost interrupt

got ocp_ide_dma_end 0 20000000

ide_dma_intr : stat 58

hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }

ide: failed opcode was: unknown

__ide_do_rw_disk : dma 1 lba48 0 LBA=0

got ocp_ide_dma_setup 

ide_execute_command : 0xc8

got ocp_ide_dma_begin 0x1000

DMA addr c1238000 1238000 count 8 dmastat 0

DMA complete stat 20001000 0

hda: lost interrupt

got ocp_ide_dma_end 0 20000000

ide_dma_intr : stat 58

hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }

ide: failed opcode was: unknown

ide_execute_command : 0x10

__ide_do_rw_disk : dma 1 lba48 0 LBA=0

got ocp_ide_dma_setup 

ide_execute_command : 0xc8

got ocp_ide_dma_begin 0x1000

DMA addr c1238000 1238000 count 8 dmastat 0

DMA complete stat 20001000 0

hda: lost interrupt

got ocp_ide_dma_end 0 20000000

ide_dma_intr : stat 58

hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }

ide: failed opcode was: unknown

__ide_do_rw_disk : dma 1 lba48 0 LBA=0

got ocp_ide_dma_setup 

ide_execute_command : 0xc8

got ocp_ide_dma_begin 0x1000

DMA addr c1238000 1238000 count 8 dmastat 0

DMA complete stat 20001000 0

hda: lost interrupt

got ocp_ide_dma_end 0 20000000

ide_dma_intr : stat 58

hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }

ide: failed opcode was: unknown

got ocp_ide_dma_off_quietly

ide0: reset: master: error (0x00?)

ide_execute_command : 0x91

ide_execute_command : 0x10

__ide_do_rw_disk : dma 1 lba48 0 LBA=0

got ocp_ide_dma_setup 

ide_execute_command : 0xc8

got ocp_ide_dma_begin 0x1000

DMA addr c1238000 1238000 count 8 dmastat 0

DMA complete stat 20001000 0

hda: lost interrupt

got ocp_ide_dma_end 0 20000000

ide_dma_intr : stat 58

hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }

ide: failed opcode was: unknown

__ide_do_rw_disk : dma 1 lba48 0 LBA=0

got ocp_ide_dma_setup 

ide_execute_command : 0xc8

got ocp_ide_dma_begin 0x1000

DMA addr c1238000 1238000 count 8 dmastat 0

DMA complete stat 20001000 0

hda: lost interrupt

got ocp_ide_dma_end 0 20000000

ide_dma_intr : stat 58

hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }

ide: failed opcode was: unknown

ide_execute_command : 0x10

__ide_do_rw_disk : dma 1 lba48 0 LBA=0

got ocp_ide_dma_setup 

ide_execute_command : 0xc8

got ocp_ide_dma_begin 0x1000

DMA addr c1238000 1238000 count 8 dmastat 0

DMA complete stat 20001000 0

hda: lost interrupt

got ocp_ide_dma_end 0 20000000

ide_dma_intr : stat 58

hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }

ide: failed opcode was: unknown

__ide_do_rw_disk : dma 1 lba48 0 LBA=0

got ocp_ide_dma_setup 

ide_execute_command : 0xc8

got ocp_ide_dma_begin 0x1000

DMA addr c1238000 1238000 count 8 dmastat 0

DMA complete stat 20001000 0

hda: lost interrupt

got ocp_ide_dma_end 0 20000000

ide_dma_intr : stat 58

hda: dma_intr: status=0x58 { DriveReady SeekComplete DataRequest }

ide: failed opcode was: unknown

got ocp_ide_dma_off_quietly

ide0: reset: master: error (0x00?)

end_request: I/O error, dev hda, sector 0

Buffer I/O error on device hda, logical block 0

end_request: I/O error, dev hda, sector 8

Buffer I/O error on device hda, logical block 1

end_request: I/O error, dev hda, sector 16

Buffer I/O error on device hda, logical block 2

end_request: I/O error, dev hda, sector 24

Buffer I/O error on device hda, logical block 3

end_request: I/O error, dev hda, sector 32

Buffer I/O error on device hda, logical block 4

end_request: I/O error, dev hda, sector 40

Buffer I/O error on device hda, logical block 5

end_request: I/O error, dev hda, sector 48

Buffer I/O error on device hda, logical block 6

end_request: I/O error, dev hda, sector 56

Buffer I/O error on device hda, logical block 7

end_request: I/O error, dev hda, sector 64

Buffer I/O error on device hda, logical block 8

end_request: I/O error, dev hda, sector 72

Buffer I/O error on device hda, logical block 9

end_request: I/O error, dev hda, sector 80

end_request: I/O error, dev hda, sector 88

end_request: I/O error, dev hda, sector 96

end_request: I/O error, dev hda, sector 104

end_request: I/O error, dev hda, sector 112

end_request: I/O error, dev hda, sector 120

end_request: I/O error, dev hda, sector 128

end_request: I/O error, dev hda, sector 136

end_request: I/O error, dev hda, sector 144

end_request: I/O error, dev hda, sector 152

end_request: I/O error, dev hda, sector 160

end_request: I/O error, dev hda, sector 168

end_request: I/O error, dev hda, sector 176

end_request: I/O error, dev hda, sector 184

end_request: I/O error, dev hda, sector 192

end_request: I/O error, dev hda, sector 200

end_request: I/O error, dev hda, sector 208

end_request: I/O error, dev hda, sector 216

end_request: I/O error, dev hda, sector 224

end_request: I/O error, dev hda, sector 232

end_request: I/O error, dev hda, sector 240

end_request: I/O error, dev hda, sector 248

end_request: I/O error, dev hda, sector 256

end_request: I/O error, dev hda, sector 264

end_request: I/O error, dev hda, sector 272

end_request: I/O error, dev hda, sector 280

end_request: I/O error, dev hda, sector 288

end_request: I/O error, dev hda, sector 296

end_request: I/O error, dev hda, sector 304

end_request: I/O error, dev hda, sector 312

end_request: I/O error, dev hda, sector 320

end_request: I/O error, dev hda, sector 328

end_request: I/O error, dev hda, sector 336

end_request: I/O error, dev hda, sector 344

end_request: I/O error, dev hda, sector 352

end_request: I/O error, dev hda, sector 360

end_request: I/O error, dev hda, sector 368

end_request: I/O error, dev hda, sector 376

end_request: I/O error, dev hda, sector 384

end_request: I/O error, dev hda, sector 392

end_request: I/O error, dev hda, sector 400

end_request: I/O error, dev hda, sector 408

end_request: I/O error, dev hda, sector 416

end_request: I/O error, dev hda, sector 424

end_request: I/O error, dev hda, sector 432

end_request: I/O error, dev hda, sector 440

end_request: I/O error, dev hda, sector 448

end_request: I/O error, dev hda, sector 456

end_request: I/O error, dev hda, sector 464

end_request: I/O error, dev hda, sector 472

end_request: I/O error, dev hda, sector 480

end_request: I/O error, dev hda, sector 488

end_request: I/O error, dev hda, sector 496

end_request: I/O error, dev hda, sector 504

end_request: I/O error, dev hda, sector 0

read() failed: Input/output error
bash-3.00# 






static void ocp_ide_dma_begin(ide_drive_t *drive){
int i,reading=0,length;
struct request * const rq = HWGROUP(drive)->rq;
unsigned long control;

 if(rq_data_dir (rq) == READ) reading = 1;

 printk("got ocp_ide_dma_begin 0x%x\n",mfdcr(DCRN_DMASR));
 /* enable DMA */
 ppc4xx_enable_dma_interrupt(IDE_DMACH);
 /*dmastat = mfdcr(DCRN_DMASR);
 mtdcr(DCRN_DMASR,((u32)DMA_CH2_ERR | (u32)DMA_CS2 | (u32)DMA_TS2));
 */
 mtdcr(DCRN_DMASR,0x22200120);
 /*Configure CIC reg for line mode DMA*/
#ifdef WMODE
 mtdcr(DCRN_CICCR,(mfdcr(DCRN_CICCR) | 0x00000400));
#else
 mtdcr(DCRN_CICCR,(mfdcr(DCRN_CICCR) & ~0x00000400));

#endif

 if(drive->media != ide_disk) {
  printk("ocp_ide_dma_begin : Invalid media \n");
  return;
 }
 if(ppc4xx_get_channel_config(IDE_DMACH,&dma_ch) & DMA_CHANNEL_BUSY){
   printk("DMA channel busy \n");
   return;
 }
 memset(rq->buffer,0,rq->current_nr_sectors*512);
 if(reading){
  
  dma_cache_inv((unsigned long) rq->buffer, rq->current_nr_sectors * 512);
#ifdef WMODE
  mtdcr(DCRN_DMASA2,(u32)0x00000000);// set src address for DMA channel 2
  mtdcr(DCRN_DMADA2,(u32)virt_to_bus(rq->buffer));//set dst address for DMA channel 2
  mtdcr(DCRN_DCRXBCR,0x00000000);
  control = 0xE600CB02;
#else
  mtdcr(DCRN_DMASA2,(u32)0xfce00000);// set src address for DMA channel 2
  mtdcr(DCRN_DMADA2,(u32)virt_to_bus(rq->buffer));//set dst address for DMA channel 2
  mtdcr(DCRN_DCRXBCR,0x90000000);
  control = 0xEE602b02;
#endif
 }
 else {
  dma_cache_wback_inv((unsigned long) rq->buffer, rq->current_nr_sectors * 512);

#ifdef WMODE
  mtdcr(DCRN_DMASA2,(u32)0x00000000);// set dst address for DMA channel 2
  mtdcr(DCRN_DMADA2,(u32)virt_to_bus(rq->buffer));// set src address for DMA channel 2
  mtdcr(DCRN_DCRXBCR,0x00000000);
  control = 0xC600CB02;
#else
  mtdcr(DCRN_DMADA2,(u32)0xfce00000);// set dst address for DMA channel 2
  mtdcr(DCRN_DMASA2,(u32)virt_to_bus(rq->buffer));// set src address for DMA channel 2
  mtdcr(DCRN_DCRXBCR,0xB0000000);
  control = 0xcd602b02;
#endif

 }

#ifdef WMODE
 length = (rq->current_nr_sectors *512)/2;
#else
 length = (rq->current_nr_sectors *512)/16;
#endif
 mtdcr(DCRN_DMACT2,length);

 /*control = mfdcr(DCRN_DMACR2);
 control |= DMA_CIE_ENABLE;  Channel Interrupt Enable 
 */
 control &= ~DMA_CIE_ENABLE;
 mtdcr(DCRN_DMACR2, control);
 //ppc4xx_enable_dma_interrupt(IDE_DMACH);
 
 printk("DMA addr %x %x count %d dmastat %x\n",rq->buffer,virt_to_bus(rq->buffer),rq->current_nr_sectors,dmastat);
 /* wait for dma to complete (channel 2 terminal count) */
 for (i = 0; i < 500000; i++) {
  if(i%1000 == 0)
   dmastat = mfdcr(DCRN_DMASR);
  if (dmastat & DMA_CS2)
   break;
 }
 printk("DMA complete stat %x %d\n",dmastat,i);
 mtdcr(DCRN_DCRXBCR,0x00000000);
 mtdcr(DCRN_DMACR2, 0x00000000);
 drive->waiting_for_dma = 0;
 //dmastat = 0;
}
static int ocp_ide_dma_end(ide_drive_t *drive){
unsigned int tmp = mfdcr(DCRN_DMASR);

 mtdcr (DCRN_UIC_SR(UIC0),(0x80000000ul >> IDE_DMA_INT));
 mtdcr(DCRN_DMASR,0x22200120);
 dmastat = mfdcr(DCRN_DMASR);
 printk("got ocp_ide_dma_end %x %x\n",dmastat,tmp);
 drive->waiting_for_dma = 0;
 /* disable DMA */
 //ppc4xx_disable_dma_interrupt(IDE_DMACH);

 return 0;
}

static void
ocp_ide_setup_dma (ide_hwif_t * const hwif)
{
 printk("ocp_ide_setup_dma \n");


 hwif->dma = IDE_DMACH;
#ifdef WMODE
   /*Word Mode psc(11-12)=00,pwc(13-18)=000110, phc(19-21)=010, 22=1, 30=1  ----  0xCB02*/

 dma_ch.mode =TM_S_MM;   /* xfer from peripheral to mem */
 dma_ch.td = DMA_TD;
 dma_ch.buffer_enable = FALSE;
 dma_ch.tce_enable = FALSE;
 dma_ch.etd_output = FALSE;
 dma_ch.pce = FALSE;
 dma_ch.pl = EXTERNAL_PERIPHERAL;    /* no op */
 dma_ch.pwidth = PW_16;
 dma_ch.dai = TRUE;
 dma_ch.sai = FALSE;
 dma_ch.psc = 0;                      /* set the max setup cycles */
 dma_ch.pwc = 6;                     /* set the max wait cycles  */
 dma_ch.phc = 2;                      /* set the max hold cycles  */
 dma_ch.cp = PRIORITY_LOW;
 dma_ch.int_enable = FALSE;
 dma_ch.ch_enable = FALSE;  /* No chaining */
 dma_ch.tcd_disable = TRUE;  /* No chaining */
#else
/*Line Mode psc(11-12)=00,pwc(13-18)=000001, phc(19-21)=010, 22=1, 30=1  ----  0x2B02*/

 dma_ch.mode =DMA_MODE_MM_DEVATSRC;   /* xfer from peripheral to mem */
 dma_ch.td = DMA_TD;
 dma_ch.buffer_enable = FALSE;
 dma_ch.tce_enable = FALSE;
 dma_ch.etd_output = FALSE;
 dma_ch.pce = FALSE;
 dma_ch.pl = EXTERNAL_PERIPHERAL;    /* no op */
 dma_ch.pwidth = PW_64;  /* Line mode on stbs */
 dma_ch.dai = TRUE;
 dma_ch.sai = FALSE;
 dma_ch.psc = 0;                      /* set the max setup cycles */
 dma_ch.pwc = 1;                     /* set the max wait cycles  */
 dma_ch.phc = 2;                      /* set the max hold cycles  */
 dma_ch.cp = PRIORITY_LOW;
 dma_ch.int_enable = FALSE;
 dma_ch.ch_enable = FALSE;  /* No chaining */
 dma_ch.tcd_disable = TRUE;  /* No chaining */

#endif
 if (ppc4xx_init_dma_channel(IDE_DMACH, &dma_ch) != DMA_STATUS_GOOD){
  printk("ppc4xx_init_dma_channel failed\n");
         return -EBUSY;
 }
 //ppc4xx_disable_dma_interrupt(IDE_DMACH);

 /*init CIC control register to enable IDE interface PIO mode*/
 mtdcr(DCRN_CICCR,(mfdcr(DCRN_CICCR) & 0xffff7bff) | 0x00000003);
 mtdcr(DCRN_DMACR2, 0);
 ppc4xx_clr_dma_status(IDE_DMACH);
 /* init CIC select2 reg to connect external DMA port 3 to internal
  * DMA channel 2

  */
 mtdcr(DCRN_DMAS2,(mfdcr(DCRN_DMAS2) & 0xfffffff0) | 0x00000002);


 hwif->autodma = 1;hwif->udma_four=0;
 hwif->drives[0].autotune = hwif->drives[1].autotune = IDE_TUNE_AUTO;
 hwif->drives[0].autodma  = hwif->drives[1].autodma  = hwif->autodma;

 hwif->atapi_dma  = 0;
 hwif->ultra_mask = hwif->udma_four ? 0x1f : 0x07;
 hwif->mwdma_mask = 0x07;
 hwif->swdma_mask = 0x00;

 /* set everything to something != NULL */
 hwif->ide_dma_host_off   = &ocp_ide_dma_off_quietly;
 hwif->ide_dma_host_on     = &ocp_ide_dma_on;

 hwif->ide_dma_check   = &ocp_ide_dma_check;
 hwif->ide_dma_off_quietly   = &ocp_ide_dma_off_quietly;
 hwif->ide_dma_on            = &ocp_ide_dma_on;

 hwif->dma_setup      = &ocp_ide_dma_setup;
 hwif->dma_exec_cmd    = &ocp_dma_exec_cmd;
 hwif->dma_start       = &ocp_ide_dma_begin;
 hwif->ide_dma_end    = &ocp_ide_dma_end;

 hwif->ide_dma_test_irq   = &ocp_ide_dma_test_irq;

 hwif->ide_dma_lostirq    = &ocp_ide_dma_lostirq;
 hwif->ide_dma_timeout    = &ocp_ide_dma_timeout;
}
  
static int __init
stb025xx_ide_probe (struct ocp_device * const ocp)
{
 int                     err;
 unsigned int            uicdcr;
 volatile unsigned long ide_regs;
 unsigned long           flags,ioaddr;
 ide_hwif_t             * const hwif = &ide_hwifs[0];
 unsigned char          * ip;
 int                     i;

 printk ("IBM STB025xx OCP IDE driver version %s %x \n", IDEVR,ocp->def->paddr);
 if (!request_region(REDWOOD_IDE_CMD, 0x10, "IDE"))
  return -EBUSY;

 if (!request_region(REDWOOD_IDE_CTRL, 2, "IDE")) {
  release_region(REDWOOD_IDE_CMD, 0x10);
  return -EBUSY;
 }

 ide_regs = ioaddr = (unsigned long) ioremap(REDWOOD_IDE_CMD, 0x10);

 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
  hwif->io_ports[i] = ioaddr;
  ioaddr += 2;
 }
 hwif->io_ports[IDE_CONTROL_OFFSET] =
     (unsigned long) ioremap(REDWOOD_IDE_CTRL, 2);

 ocp_force_power_on (ocp);
 
 /* initialize */
 hwif->gendev.parent = &ocp->dev;
 ocp_set_drvdata (ocp, hwif);

 /* setup MMIO ops */
 default_hwif_mmiops (hwif);

 /* tell common code _not_ to mess with resources */
 hwif->mmio = 2;
 ide_set_hwifdata (hwif, (void *) ide_regs);
 
 hwif->chipset = ide_generic;
 hwif->irq     = IDE0_IRQ;
 hwif->noprobe = 0;
 hwif->hold    = 1;
 hwif->udma_four = 0;
 hwif->tuneproc  = &ocp_ide_tune_drive;
 hwif->speedproc = &ocp_ide_tune_chipset;
 hwif->drives[0].io_32bit = hwif->drives[1].io_32bit = 0;
 hwif->drives[0].unmask   = hwif->drives[1].unmask   = 1;
 pio_mode[0] = pio_mode[1] = -1;
 
 ibm25xx_ide_spinup(0);
 ocp_ide_setup_dma (hwif);
 probe_hwif_init (hwif);

 create_proc_ide_interfaces ();
 printk("IDE probe finished \n");
 return 0;
}
static int ocp_ide_dma_end(ide_drive_t *drive){
unsigned int tmp = mfdcr(DCRN_DMASR);

 mtdcr (DCRN_UIC_SR(UIC0),(0x80000000ul >> IDE_DMA_INT));
 mtdcr(DCRN_DMASR,0x22200120);
 dmastat = mfdcr(DCRN_DMASR);
 printk("got ocp_ide_dma_end %x %x\n",dmastat,tmp);
 drive->waiting_for_dma = 0;
 /* disable DMA */
 //ppc4xx_disable_dma_interrupt(IDE_DMACH);

 return 0;
}
static int ocp_ide_dma_test_irq(ide_drive_t *drive){

 printk("got ocp_ide_dma_test_irq\n");
 return 1; /* returns 1 if dma irq issued, 0 otherwise */
}
static int ocp_ide_dma_verbose(ide_drive_t *drive){

 printk("got ocp_ide_dma_verbose\n");
 return 1;
}
static int ocp_ide_dma_lostirq(ide_drive_t *drive){


 printk("got ocp_ide_dma_lostirq\n");
 return 1;
}
static int ocp_ide_dma_timeout(ide_drive_t *drive){

 printk("got ocp_ide_dma_timeout\n");
 return 1;
}
static void
ocp_dma_exec_cmd (ide_drive_t * const drive, u8 command){
ide_hwif_t *hwif = HWIF(drive);

 //hwif->OUTBSYNC(drive,command, IDE_COMMAND_REG);
 //printk("ide_dma_exec_cmd %x\n",command);
 ide_execute_command (drive, command,&ide_dma_intr, 2*WAIT_CMD, NULL);
}
static int ocp_ide_dma_setup(ide_drive_t * const drive){
 ide_hwif_t  * const hwif = HWIF(drive);
 struct request * const rq = HWGROUP(drive)->rq;

 printk("got ocp_ide_dma_setup \n");
 /*if(rq->current_nr_sectors < 2){
  printk("request for less no of sectors %d\n",rq->current_nr_sectors);
  ide_map_sg(drive,rq);drive->waiting_for_dma=0; 
  return 1;
 }*/
 drive->waiting_for_dma = 1;
 return 0;
} 


[-- Attachment #2: Type: text/html, Size: 63435 bytes --]

^ permalink raw reply

* Re: [PATCH 1/6] bootwrapper: arch/powerpc/boot code reorg
From: Paul Mackerras @ 2006-09-15 10:19 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: linuxppc-dev
In-Reply-To: <20060908033508.GA5203@mag.az.mvista.com>

Mark A. Greer writes:

> Abstract the operations used in the bootwrapper.  The operations
> have been divided up into platform operations (platform_ops),
> device tree operations (dt_ops), and console operations (console_ops).

Is there any particular reason why the call_kernel() method is in the
dt_ops?  That doesn't seem like a very natural place for it.  Is it
just so the dt_ops can say whether to pass NULL or the prom entry
point in r5?

Paul.

^ permalink raw reply

* Re: ethernet patch for kernel 2.6 for ml403
From: David H. Lynch Jr. @ 2006-09-15 11:17 UTC (permalink / raw)
  To: Aleck Lin; +Cc: linuxppc-embedded
In-Reply-To: <003101c6d876$79f99c60$800101df@monstertop>

    I have used a later version of what I beleive is the same patch.
            http://source.mvista.com/~ank/paulus-powerpc/20060309/

    This is for the PLB TEMAC. My guess based on your capture below is 
that you are using that IP.
  
    Did you try ifconfig eth0 xxx.xxx.xxx.xxx ?
    I do not know what is in the rest of your init setup but something 
must asign the IP and bring up the interface.
   


   


Aleck Lin wrote:
> Hello,
>
> I found this patch that was posted back in January
> (http://ozlabs.org/pipermail/linuxppc-embedded/2006-January/021574.html).
>
> As I was trying it, there were some warnings and errors. When I fixed them
> as much as I could to the point of a successful compilation, I tried to boot
> this kernel image on ml403. However, it still complains that no network
> devices available. 
>
> TWO questions.
> 1. Has anyone ever tried with the patch and been successful with it?
> 2. Why does it still complain no network devices found even though I thot I
> added the correct ethernet driver? 
>
> Thanks for any help as I'm still relatively new to this.
>
> Aleck
>
>
> Here's my booting message.
>
> ---------------------------------------------------
> ## Booting image at 00800000 ...
>    Image Name:   Linux-2.6.17.8
>    Image Type:   PowerPC Linux Kernel Image (gzip compressed)
>    Data Size:    854118 Bytes = 834.1 kB
>    Load Address: 00000000
>    Entry Point:  00000000
>    Verifying Checksum ... OK
>    Uncompressing Kernel Image ... OK
> ## cmdline at 0x007FFF00 ... 0x007FFF37
> memstart    = 0x00000000
> memsize     = 0x04000000
> flashstart  = 0xFF800000
> flashsize   = 0x00800000
> flashoffset = 0x00000000
> sramstart   = 0x00000000
> sramsize    = 0x00000000
> bootflags   = 0x0000012A
> procfreq    =    300 MHz
> plb_busfreq =    100 MHz
> ethaddr     = 00:11:22:33:44:55
> IP addr     = 192.168.200.230
> baudrate    =   9600 bps
> ## Loading RAMDisk Image at 01000000 ...
>    Image Name:   Simple Embedded Linux Framework
>    Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
>    Data Size:    1437217 Bytes =  1.4 MB
>    Load Address: 00000000
>    Entry Point:  00000000
>    Verifying Checksum ... OK
>    Loading Ramdisk to 03d03000, end 03e61e21 ... OK
> [    0.000000] Linux version 2.6.17.8 (aleck@sac.gdatech.com) (gcc version
> 4.0.0 (DENX ELDK 4.0 4.0.0)) #87 Thu Sep 14 20:06:23 PDT 2006
> [    0.000000] Xilinx ML403 Reference System (Virtex-4 FX)
> [    0.000000] Built 1 zonelists
> [    0.000000] Kernel command line: console=ttyS0,9600 ip=192.168.200.230
> root=/dev/ram0 rw
> [    0.000000] Xilinx INTC #0 at 0x41200000 mapped to 0xFDFFE000
> [    0.000000] PID hash table entries: 512 (order: 9, 2048 bytes)
> [    0.000151] Console: colour dummy device 80x25
> [    0.000567] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
> [    0.001213] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
> [    0.013282] Memory: 61632k available (1308k kernel code, 476k data, 84k
> init, 0k highmem)
> [    0.200420] Mount-cache hash table entries: 512
> [    0.202863] checking if image is initramfs...it isn't (no cpio magic);
> looks like an initrd
> [    0.863139] Freeing initrd memory: 1403k freed
> [    0.866364] NET: Registered protocol family 16
> [    0.869487] Generic PHY: Registered new driver
> [    0.874412] NET: Registered protocol family 2
> [    0.912357] IP route cache hash table entries: 512 (order: -1, 2048
> bytes)
> [    0.913062] TCP established hash table entries: 2048 (order: 1, 8192
> bytes)
> [    0.913241] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
> [    0.913339] TCP: Hash tables configured (established 2048 bind 1024)
> [    0.913368] TCP reno registered
> [    0.920012] io scheduler noop registered
> [    0.920111] io scheduler anticipatory registered (default)
> [    0.920187] io scheduler deadline registered
> [    0.920346] io scheduler cfq registered
> [    0.958113] Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ
> sharing disabled
> [    0.962450] serial8250.0: ttyS0 at MMIO 0x40401003 (irq = 3) is a 16550A
> [    2.871187] RAMDISK driver initialized: 16 RAM disks of 65536K size 1024
> blocksize
> [    2.961972] allocating ethernet device...
> [    3.010204] eth%d: using fifo mode.
> [    3.052064] eth%d: Xilinx EMAC #0 at 0x80400000 mapped to 0xC5000000,
> irq=31
> [    3.136606] eth%d: id 2.0a; block id 0, type 8
> [    3.190431] Marvell 88E1101: Registered new driver
> [    3.250101] tun: Universal TUN/TAP device driver, 1.6
> [    3.310712] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
> [    3.385845] mice: PS/2 mouse device common for all mice
> [    3.448583] TCP bic registered
> [    3.485307] NET: Registered protocol family 1
> [    3.537610] NET: Registered protocol family 17
> [    4.096219] IP-Config: No network devices available.
> [    4.156871] RAMDISK: Compressed image found at block 0
> [    5.002841] VFS: Mounted root (ext2 filesystem).
> [    5.058432] Freeing unused kernel memory: 84k init
> ### Application running ...
>
>
> BusyBox v(null) ((null)) Built-in shell (msh)
> #
> ------------------------------------------------------------------
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>   


-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein

^ permalink raw reply

* Linux 2.6.x  :  useless IO mappings behing PCI bridge
From: Laurent Lagrange @ 2006-09-15 14:26 UTC (permalink / raw)
  To: linuxppc-embedded


Hello,

I use a custom 82xx PMC board as a PCI monarch board
on a carrier and another PCI agent board with a bridge.

The PCI agent board requests prefetchable and non
prefetchable memories behind its bridge but no IO region.
The IO flag is not set in the header space.

When probing PCI, Linux warns :
PCI: Probing PCI hardware
PCI: Cannot allocate resource region 0 of PCI bridge 1
--> the default address is not a valid pci address !!!
PCI: bridge 1 resource 0 moved to f8fff000..f8ffffff
--> This size is the default io region size.

So the kernel allocates and ioremaps 4096B for no requested IO.
The problem is not that it consumes address space but
that the kernel warns as if it is a mistake :-(

It can be checked by lspci command.
# lspci -vvx
00:13.0 Class 0604: 3388:0026 (rev 04)
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
        Status: Cap+ 66Mhz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 248, cache line size 08
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
-->     I/O behind bridge: f8fff000-f8ffffff
        Memory behind bridge: a0100000-a01fffff
        Prefetchable memory behind bridge: 0000000080000000-0000000081f00000
        BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
        Capabilities: [dc] Power Management version 1
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0+,D1+,D2+,D3hot+,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [e4] #06 [0094]
        Capabilities: [e8] Vital Product Data
00: 88 33 26 00 06 00 b0 02 04 00 04 06 08 f8 01 00
10: 00 00 00 00 00 00 00 00 00 01 01 00 f1 f1 a0 02
20: 10 a0 10 a0 01 80 f1 81 00 00 00 00 00 00 00 00
30: ff f8 ff f8 dc 00 00 00 00 00 00 00 00 00 00 00

I think it would be right to check if IO is requested before
allocating some region.

Any opinion ?
Thanks all
Laurent

^ permalink raw reply

* how to boot Redhat Linux 2.6 kernel onto PowerPC?? ( Memec Board)
From: Ujwal @ 2006-09-15 14:41 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]

hi all,

can some one tell me how to boot Redhat Linux onto PowerPC .
Im using Memec Board.

I'm using Xilinx EDK 6.3i and have created a BSP for linux . I dont knw how
to incorporate the BSP into the linux kernel package
and what are the things i should do to make sure that the linux OS boots on
the PowerPC


Plssss Help , Im a newbee

[-- Attachment #2: Type: text/html, Size: 372 bytes --]

^ permalink raw reply

* Re: Ethernet driver for Linux kernel 2.6 running on ML403
From: T Ziomek @ 2006-09-15 16:11 UTC (permalink / raw)
  To: Grant Likely; +Cc: John Bonesio, linuxppc-embedded
In-Reply-To: <528646bc0609141549p319f01dfwb0d2897bb0bdc41f@mail.gmail.com>

On Thu, 14 Sep 2006, Grant Likely wrote:
  . . .
> - Stop requiring xparameters.h to be mangled!

Here, here!

>Generate it correctly
> the first time!  I think I'll scream if I get handed another xparams
> file from an FPGA engineer which was generated as a no-os target.  The
> Linux redefines are useful, why aren't they in xparameters.h for all
> targets?

I think that would be okay.  To offer an alternative, the way I handle
it now is to separate the two.  See
<http://ozlabs.org/pipermail/linuxppc-embedded/2005-August/019945.html>

Tom
-- 
   /"\  ASCII Ribbon Campaign   |
   \ /                          |   Email to user 'CTZ001'
    X        Against HTML       |             at 'email.mot.com'
   / \     in e-mail & news     |

^ permalink raw reply

* [PATCH 0/7]Add support for CPM2 peripherals and 8560 eval board
From: Vitaly Bordug @ 2006-09-15 17:37 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev@ozlabs.org


The following series implements the generic cpm2 infrastructure port,
mpc8560 board-specific bits, and an attempt to overhaul and get rid
of some stuff moved along from the 2.4 times.

This version has refined devtree, and all the received with the initial submission 
comments addressed.

Paul: This is for the next merge window...

--
Sincerely, Vitaly

^ permalink raw reply

* RE: ethernet patch for kernel 2.6 for ml403
From: Aleck Lin @ 2006-09-15 17:38 UTC (permalink / raw)
  To: 'David H. Lynch Jr.'; +Cc: linuxppc-embedded
In-Reply-To: <450A8BC7.6040604@dlasys.net>

David,

I believe I'm using plb_emac. Is it correct that I'm looking for the
Xilinx_enet driver patch?? 

I tried ifconfig, but no luck.

------------------------------------------
#ifconfig eth0 address 192.168.200.230
SIOCSIFADDR: No such device
#
-------------------------------------------

Thanks

Aleck


-----Original Message-----
From: David H. Lynch Jr. [mailto:dhlii@dlasys.net] 
Sent: Friday, September 15, 2006 4:17 AM
To: Aleck Lin
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: ethernet patch for kernel 2.6 for ml403

    I have used a later version of what I beleive is the same patch.
            http://source.mvista.com/~ank/paulus-powerpc/20060309/

    This is for the PLB TEMAC. My guess based on your capture below is 
that you are using that IP.
  
    Did you try ifconfig eth0 xxx.xxx.xxx.xxx ?
    I do not know what is in the rest of your init setup but something 
must asign the IP and bring up the interface.
   


   


Aleck Lin wrote:
> Hello,
>
> I found this patch that was posted back in January
> (http://ozlabs.org/pipermail/linuxppc-embedded/2006-January/021574.html).
>
> As I was trying it, there were some warnings and errors. When I fixed them
> as much as I could to the point of a successful compilation, I tried to
boot
> this kernel image on ml403. However, it still complains that no network
> devices available. 
>
> TWO questions.
> 1. Has anyone ever tried with the patch and been successful with it?
> 2. Why does it still complain no network devices found even though I thot
I
> added the correct ethernet driver? 
>
> Thanks for any help as I'm still relatively new to this.
>
> Aleck
>
>
> Here's my booting message.
>
> ---------------------------------------------------
> ## Booting image at 00800000 ...
>    Image Name:   Linux-2.6.17.8
>    Image Type:   PowerPC Linux Kernel Image (gzip compressed)
>    Data Size:    854118 Bytes = 834.1 kB
>    Load Address: 00000000
>    Entry Point:  00000000
>    Verifying Checksum ... OK
>    Uncompressing Kernel Image ... OK
> ## cmdline at 0x007FFF00 ... 0x007FFF37
> memstart    = 0x00000000
> memsize     = 0x04000000
> flashstart  = 0xFF800000
> flashsize   = 0x00800000
> flashoffset = 0x00000000
> sramstart   = 0x00000000
> sramsize    = 0x00000000
> bootflags   = 0x0000012A
> procfreq    =    300 MHz
> plb_busfreq =    100 MHz
> ethaddr     = 00:11:22:33:44:55
> IP addr     = 192.168.200.230
> baudrate    =   9600 bps
> ## Loading RAMDisk Image at 01000000 ...
>    Image Name:   Simple Embedded Linux Framework
>    Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
>    Data Size:    1437217 Bytes =  1.4 MB
>    Load Address: 00000000
>    Entry Point:  00000000
>    Verifying Checksum ... OK
>    Loading Ramdisk to 03d03000, end 03e61e21 ... OK
> [    0.000000] Linux version 2.6.17.8 (aleck@sac.gdatech.com) (gcc version
> 4.0.0 (DENX ELDK 4.0 4.0.0)) #87 Thu Sep 14 20:06:23 PDT 2006
> [    0.000000] Xilinx ML403 Reference System (Virtex-4 FX)
> [    0.000000] Built 1 zonelists
> [    0.000000] Kernel command line: console=ttyS0,9600 ip=192.168.200.230
> root=/dev/ram0 rw
> [    0.000000] Xilinx INTC #0 at 0x41200000 mapped to 0xFDFFE000
> [    0.000000] PID hash table entries: 512 (order: 9, 2048 bytes)
> [    0.000151] Console: colour dummy device 80x25
> [    0.000567] Dentry cache hash table entries: 8192 (order: 3, 32768
bytes)
> [    0.001213] Inode-cache hash table entries: 4096 (order: 2, 16384
bytes)
> [    0.013282] Memory: 61632k available (1308k kernel code, 476k data, 84k
> init, 0k highmem)
> [    0.200420] Mount-cache hash table entries: 512
> [    0.202863] checking if image is initramfs...it isn't (no cpio magic);
> looks like an initrd
> [    0.863139] Freeing initrd memory: 1403k freed
> [    0.866364] NET: Registered protocol family 16
> [    0.869487] Generic PHY: Registered new driver
> [    0.874412] NET: Registered protocol family 2
> [    0.912357] IP route cache hash table entries: 512 (order: -1, 2048
> bytes)
> [    0.913062] TCP established hash table entries: 2048 (order: 1, 8192
> bytes)
> [    0.913241] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
> [    0.913339] TCP: Hash tables configured (established 2048 bind 1024)
> [    0.913368] TCP reno registered
> [    0.920012] io scheduler noop registered
> [    0.920111] io scheduler anticipatory registered (default)
> [    0.920187] io scheduler deadline registered
> [    0.920346] io scheduler cfq registered
> [    0.958113] Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ
> sharing disabled
> [    0.962450] serial8250.0: ttyS0 at MMIO 0x40401003 (irq = 3) is a
16550A
> [    2.871187] RAMDISK driver initialized: 16 RAM disks of 65536K size
1024
> blocksize
> [    2.961972] allocating ethernet device...
> [    3.010204] eth%d: using fifo mode.
> [    3.052064] eth%d: Xilinx EMAC #0 at 0x80400000 mapped to 0xC5000000,
> irq=31
> [    3.136606] eth%d: id 2.0a; block id 0, type 8
> [    3.190431] Marvell 88E1101: Registered new driver
> [    3.250101] tun: Universal TUN/TAP device driver, 1.6
> [    3.310712] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
> [    3.385845] mice: PS/2 mouse device common for all mice
> [    3.448583] TCP bic registered
> [    3.485307] NET: Registered protocol family 1
> [    3.537610] NET: Registered protocol family 17
> [    4.096219] IP-Config: No network devices available.
> [    4.156871] RAMDISK: Compressed image found at block 0
> [    5.002841] VFS: Mounted root (ext2 filesystem).
> [    5.058432] Freeing unused kernel memory: 84k init
> ### Application running ...
>
>
> BusyBox v(null) ((null)) Built-in shell (msh)
> #
> ------------------------------------------------------------------
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>   


-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too
numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein

^ permalink raw reply

* [PATCH 1/7] POWERPC: Add cpm2 stuff support to the fsl_soc.c
From: Vitaly Bordug @ 2006-09-15 17:38 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <20060915213751.128e85f3@localhost.localdomain>


This patch contains necessary modifications to support the CPM2 SoC peripherals.
For the time being, those are fs_enet Ethernet driver and cpm_uart serial.
Written initially to support mpc8560, it also suites to the part of the large PQ2
(more specifically, mpc8260) family.

Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
---

 arch/powerpc/sysdev/fsl_soc.c |  268 ++++++++++++++++++++++++++++++++++++++++-
 arch/powerpc/sysdev/fsl_soc.h |    2 
 2 files changed, 265 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 92ba378..c722685 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -3,6 +3,9 @@
  *
  * Maintained by Kumar Gala (see MAINTAINERS for contact information)
  *
+ * 2006 (c) MontaVista Software, Inc.
+ * Vitaly Bordug <vbordug@ru.mvista.com>
+ *
  * 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
@@ -20,14 +23,20 @@ #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/platform_device.h>
 #include <linux/fsl_devices.h>
+#include <linux/fs_enet_pd.h>
+#include <linux/fs_uart_pd.h>
 
 #include <asm/system.h>
 #include <asm/atomic.h>
 #include <asm/io.h>
 #include <asm/irq.h>
+#include <asm/time.h>
 #include <asm/prom.h>
 #include <sysdev/fsl_soc.h>
 #include <mm/mmu_decl.h>
+#ifdef CONFIG_CPM2
+#include <asm/cpm2.h>
+#endif
 
 static phys_addr_t immrbase = -1;
 
@@ -42,7 +51,9 @@ phys_addr_t get_immrbase(void)
 	if (soc) {
 		unsigned int size;
 		const void *prop = get_property(soc, "reg", &size);
-		immrbase = of_translate_address(soc, prop);
+
+		if (prop)
+			immrbase = of_translate_address(soc, prop);
 		of_node_put(soc);
 	};
 
@@ -51,6 +62,57 @@ phys_addr_t get_immrbase(void)
 
 EXPORT_SYMBOL(get_immrbase);
 
+#ifdef CONFIG_CPM2
+
+static u32 brgfreq = -1;
+
+u32 get_brgfreq(void)
+{
+	struct device_node *node;
+
+	if (brgfreq != -1)
+		return brgfreq;
+
+	node = of_find_node_by_type(NULL, "cpm");
+	if (node) {
+		unsigned int size;
+		unsigned int *prop = (unsigned int*)get_property(node, "brg-frequency", &size);
+
+		if (prop)
+			brgfreq = *prop;
+		of_node_put(node);
+	};
+
+	return brgfreq;
+}
+
+EXPORT_SYMBOL(get_brgfreq);
+
+static u32 fs_baudrate = -1;
+
+u32 get_baudrate(void)
+{
+	struct device_node *node;
+
+	if (fs_baudrate != -1)
+		return fs_baudrate;
+
+	node = of_find_node_by_type(NULL, "serial");
+	if (node) {
+		unsigned int size;
+		unsigned int *prop = (unsigned int*)get_property(node, "current-speed", &size);
+
+		if (prop)
+			fs_baudrate = *prop;
+		of_node_put(node);
+	};
+
+	return fs_baudrate;
+}
+
+EXPORT_SYMBOL(get_baudrate);
+#endif /* CONFIG_CPM2 */
+
 static int __init gfar_mdio_of_init(void)
 {
 	struct device_node *np;
@@ -85,8 +147,11 @@ static int __init gfar_mdio_of_init(void
 			mdio_data.irq[k] = -1;
 
 		while ((child = of_get_next_child(np, child)) != NULL) {
-			const u32 *id = get_property(child, "reg", NULL);
-			mdio_data.irq[*id] = irq_of_parse_and_map(child, 0);
+			int irq = irq_of_parse_and_map(child, 0);
+			if (irq != NO_IRQ) {
+				const u32 *id = get_property(child, "reg", NULL);
+				mdio_data.irq[*id] = irq;
+			}
 		}
 
 		ret =
@@ -128,7 +193,7 @@ static int __init gfar_of_init(void)
 		const char *model;
 		const void *mac_addr;
 		const phandle *ph;
-		int n_res = 1;
+		int n_res = 2;
 
 		memset(r, 0, sizeof(r));
 		memset(&gfar_data, 0, sizeof(gfar_data));
@@ -159,7 +224,7 @@ static int __init gfar_of_init(void)
 
 		gfar_dev =
 		    platform_device_register_simple("fsl-gianfar", i, &r[0],
-						    n_res + 1);
+						    n_res);
 
 		if (IS_ERR(gfar_dev)) {
 			ret = PTR_ERR(gfar_dev);
@@ -478,3 +543,196 @@ err:
 }
 
 arch_initcall(fsl_usb_of_init);
+
+#ifdef CONFIG_CPM2
+
+static const char *fcc_regs = "fcc_regs";
+static const char *fcc_regs_c = "fcc_regs_c";
+static const char *fcc_pram = "fcc_pram";
+static char bus_id[9][BUS_ID_SIZE];
+
+static int __init fs_enet_of_init(void)
+{
+	struct device_node *np;
+	unsigned int i;
+	struct platform_device *fs_enet_dev;
+	struct resource res;
+	int ret;
+
+	for (np = NULL, i = 0;
+	     (np = of_find_compatible_node(np, "network", "fs_enet")) != NULL;
+	     i++) {
+		struct resource r[4];
+		struct device_node *phy, *mdio;
+		struct fs_platform_info fs_enet_data;
+		unsigned int *id, *phy_addr;
+		void *mac_addr;
+		phandle *ph;
+		char *model;
+
+		memset(r, 0, sizeof(r));
+		memset(&fs_enet_data, 0, sizeof(fs_enet_data));
+
+		ret = of_address_to_resource(np, 0, &r[0]);
+		if (ret)
+			goto err;
+		r[0].name = fcc_regs;
+
+		ret = of_address_to_resource(np, 1, &r[1]);
+		if (ret)
+			goto err;
+		r[1].name = fcc_pram;
+
+		ret = of_address_to_resource(np, 2, &r[2]);
+		if (ret)
+			goto err;
+		r[2].name = fcc_regs_c;
+
+		r[3].start = r[3].end = irq_of_parse_and_map(np, 0);
+		r[3].flags = IORESOURCE_IRQ;
+
+		fs_enet_dev =
+		    platform_device_register_simple("fsl-cpm-fcc", i, &r[0], 4);
+
+		if (IS_ERR(fs_enet_dev)) {
+			ret = PTR_ERR(fs_enet_dev);
+			goto err;
+		}
+
+		model = (char *)get_property(np, "model", NULL);
+		if (model == NULL) {
+			ret = -ENODEV;
+			goto unreg;
+		}
+
+		mac_addr = (void *)get_property(np, "mac-address", NULL);
+		memcpy(fs_enet_data.macaddr, mac_addr, 6);
+
+		ph = (phandle *) get_property(np, "phy-handle", NULL);
+		phy = of_find_node_by_phandle(*ph);
+
+		if (phy == NULL) {
+			ret = -ENODEV;
+			goto unreg;
+		}
+
+		phy_addr = (u32 *) get_property(phy, "reg", NULL);
+		fs_enet_data.phy_addr = *phy_addr;
+
+		id = (u32 *) get_property(np, "device-id", NULL);
+		fs_enet_data.fs_no = *id;
+
+		mdio = of_get_parent(phy);
+                ret = of_address_to_resource(mdio, 0, &res);
+                if (ret) {
+                        of_node_put(phy);
+                        of_node_put(mdio);
+                        goto unreg;
+                }
+
+		if (strstr(model, "FCC")) {
+			int fcc_index = fs_get_fcc_index(*id);
+
+			fs_enet_data.dpram_offset = (u32)cpm2_immr->im_dprambase;
+			fs_enet_data.rx_ring = 32;
+			fs_enet_data.tx_ring = 32;
+			fs_enet_data.rx_copybreak = 240;
+			fs_enet_data.use_napi = 0;
+			fs_enet_data.napi_weight = 17;
+			fs_enet_data.mem_offset = FCC_MEM_OFFSET(fcc_index);
+			fs_enet_data.cp_page = CPM_CR_FCC_PAGE(fcc_index);
+			fs_enet_data.cp_block = CPM_CR_FCC_SBLOCK(fcc_index);
+
+			snprintf((char*)&bus_id[(*id)], BUS_ID_SIZE, "%x:%02x",
+							(u32)res.start, fs_enet_data.phy_addr);
+			fs_enet_data.bus_id = (char*)&bus_id[(*id)];
+		}
+
+		of_node_put(phy);
+		of_node_put(mdio);
+
+		ret = platform_device_add_data(fs_enet_dev, &fs_enet_data,
+					     sizeof(struct
+						    fs_platform_info));
+		if (ret)
+			goto unreg;
+	}
+	return 0;
+
+unreg:
+	platform_device_unregister(fs_enet_dev);
+err:
+	return ret;
+}
+
+arch_initcall(fs_enet_of_init);
+
+static const char *scc_regs = "regs";
+static const char *scc_pram = "pram";
+
+static int __init cpm_uart_of_init(void)
+{
+	struct device_node *np;
+	unsigned int i;
+	struct platform_device *cpm_uart_dev;
+	int ret;
+
+	for (np = NULL, i = 0;
+	     (np = of_find_compatible_node(np, "serial", "cpm_uart")) != NULL;
+	     i++) {
+		struct resource r[3];
+		struct fs_uart_platform_info cpm_uart_data;
+		int *id;
+
+		memset(r, 0, sizeof(r));
+		memset(&cpm_uart_data, 0, sizeof(cpm_uart_data));
+
+		ret = of_address_to_resource(np, 0, &r[0]);
+		if (ret)
+			goto err;
+
+		r[0].name = scc_regs;
+
+		ret = of_address_to_resource(np, 1, &r[1]);
+		if (ret)
+			goto err;
+		r[1].name = scc_pram;
+
+		r[2].start = r[2].end = irq_of_parse_and_map(np, 0);
+		r[2].flags = IORESOURCE_IRQ;
+
+		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 = (int*)get_property(np, "device-id", NULL);
+		cpm_uart_data.fs_no = *id;
+		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;
+		cpm_uart_data.rx_buf_size = 32;
+
+		ret =
+		    platform_device_add_data(cpm_uart_dev, &cpm_uart_data,
+					     sizeof(struct
+						    fs_uart_platform_info));
+		if (ret)
+			goto unreg;
+	}
+
+	return 0;
+
+unreg:
+	platform_device_unregister(cpm_uart_dev);
+err:
+	return ret;
+}
+
+arch_initcall(cpm_uart_of_init);
+#endif /* CONFIG_CPM2 */
diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h
index c433d3f..25230ce 100644
--- a/arch/powerpc/sysdev/fsl_soc.h
+++ b/arch/powerpc/sysdev/fsl_soc.h
@@ -3,6 +3,8 @@ #define __PPC_FSL_SOC_H
 #ifdef __KERNEL__
 
 extern phys_addr_t get_immrbase(void);
+extern u32 get_brgfreq(void);
+extern u32 get_baudrate(void);
 
 #endif
 #endif

^ permalink raw reply related

* [PATCH 2/7] cpm_uart: make it possible to utilize from powerpc
From: Vitaly Bordug @ 2006-09-15 17:39 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <20060915213751.128e85f3@localhost.localdomain>


Driver core has been updated to make use of the new powerpc OF-inspired
platform devices, yet keeping compatibility to the vast board list from
ppc.

Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
---

 drivers/serial/cpm_uart/cpm_uart_core.c |   11 ++++-------
 drivers/serial/cpm_uart/cpm_uart_cpm2.c |   13 +++++++------
 include/asm-powerpc/fs_pd.h             |   27 ++++++++++++++++++++++++++
 include/asm-ppc/fs_pd.h                 |   32 +++++++++++++++++++++++++++++++
 4 files changed, 70 insertions(+), 13 deletions(-)

diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index 90ff96e..dfa06b6 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -46,6 +46,7 @@ #include <linux/fs_uart_pd.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/delay.h>
+#include <asm/fs_pd.h>
 
 #if defined(CONFIG_SERIAL_CPM_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -1044,11 +1045,11 @@ int cpm_uart_drv_get_platform_data(struc
 
 	if (!(r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs")))
 		return -EINVAL;
-	mem = r->start;
+	mem = (u32)ioremap(r->start, r->end - r->start + 1);
 
 	if (!(r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pram")))
 		return -EINVAL;
-	pram = r->start;
+	pram = (u32)ioremap(r->start, r->end - r->start + 1);
 
 	if(idx > fsid_smc2_uart) {
 		pinfo->sccp = (scc_t *)mem;
@@ -1189,11 +1190,7 @@ static int __init cpm_uart_console_setup
 	if (options) {
 		uart_parse_options(options, &baud, &parity, &bits, &flow);
 	} else {
-		bd_t *bd = (bd_t *) __res;
-
-		if (bd->bi_baudrate)
-			baud = bd->bi_baudrate;
-		else
+		if ((baud = uart_baudrate()) == -1)
 			baud = 9600;
 	}
 
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index ef3bb47..02b9ef9 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -40,6 +40,7 @@ #include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
+#include <asm/fs_pd.h>
 
 #include <linux/serial_core.h>
 #include <linux/kernel.h>
@@ -266,7 +267,7 @@ #ifdef CONFIG_SERIAL_CPM_SMC1
 	    (unsigned long)&cpm2_immr->im_smc[0];
 	cpm_uart_ports[UART_SMC1].smcp->smc_smcm |= (SMCM_RX | SMCM_TX);
 	cpm_uart_ports[UART_SMC1].smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
-	cpm_uart_ports[UART_SMC1].port.uartclk = (((bd_t *) __res)->bi_intfreq);
+	cpm_uart_ports[UART_SMC1].port.uartclk = uart_clock();
 	cpm_uart_port_map[cpm_uart_nr++] = UART_SMC1;
 #endif
 
@@ -279,7 +280,7 @@ #ifdef CONFIG_SERIAL_CPM_SMC2
 	    (unsigned long)&cpm2_immr->im_smc[1];
 	cpm_uart_ports[UART_SMC2].smcp->smc_smcm |= (SMCM_RX | SMCM_TX);
 	cpm_uart_ports[UART_SMC2].smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
-	cpm_uart_ports[UART_SMC2].port.uartclk = (((bd_t *) __res)->bi_intfreq);
+	cpm_uart_ports[UART_SMC2].port.uartclk = uart_clock();
 	cpm_uart_port_map[cpm_uart_nr++] = UART_SMC2;
 #endif
 
@@ -293,7 +294,7 @@ #ifdef CONFIG_SERIAL_CPM_SCC1
 	    ~(UART_SCCM_TX | UART_SCCM_RX);
 	cpm_uart_ports[UART_SCC1].sccp->scc_gsmrl &=
 	    ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
-	cpm_uart_ports[UART_SCC1].port.uartclk = (((bd_t *) __res)->bi_intfreq);
+	cpm_uart_ports[UART_SCC1].port.uartclk = uart_clock();
 	cpm_uart_port_map[cpm_uart_nr++] = UART_SCC1;
 #endif
 
@@ -307,7 +308,7 @@ #ifdef CONFIG_SERIAL_CPM_SCC2
 	    ~(UART_SCCM_TX | UART_SCCM_RX);
 	cpm_uart_ports[UART_SCC2].sccp->scc_gsmrl &=
 	    ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
-	cpm_uart_ports[UART_SCC2].port.uartclk = (((bd_t *) __res)->bi_intfreq);
+	cpm_uart_ports[UART_SCC2].port.uartclk = uart_clock();
 	cpm_uart_port_map[cpm_uart_nr++] = UART_SCC2;
 #endif
 
@@ -321,7 +322,7 @@ #ifdef CONFIG_SERIAL_CPM_SCC3
 	    ~(UART_SCCM_TX | UART_SCCM_RX);
 	cpm_uart_ports[UART_SCC3].sccp->scc_gsmrl &=
 	    ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
-	cpm_uart_ports[UART_SCC3].port.uartclk = (((bd_t *) __res)->bi_intfreq);
+	cpm_uart_ports[UART_SCC3].port.uartclk = uart_clock();
 	cpm_uart_port_map[cpm_uart_nr++] = UART_SCC3;
 #endif
 
@@ -335,7 +336,7 @@ #ifdef CONFIG_SERIAL_CPM_SCC4
 	    ~(UART_SCCM_TX | UART_SCCM_RX);
 	cpm_uart_ports[UART_SCC4].sccp->scc_gsmrl &=
 	    ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
-	cpm_uart_ports[UART_SCC4].port.uartclk = (((bd_t *) __res)->bi_intfreq);
+	cpm_uart_ports[UART_SCC4].port.uartclk = uart_clock();
 	cpm_uart_port_map[cpm_uart_nr++] = UART_SCC4;
 #endif
 
diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h
new file mode 100644
index 0000000..d530f68
--- /dev/null
+++ b/include/asm-powerpc/fs_pd.h
@@ -0,0 +1,27 @@
+/*
+ * Platform information definitions.
+ *
+ * 2006 (c) MontaVista Software, Inc.
+ * Vitaly Bordug <vbordug@ru.mvista.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef FS_PD_H
+#define FS_PD_H
+#include <sysdev/fsl_soc.h>
+#include <asm/time.h>
+
+static inline int uart_baudrate(void)
+{
+        return get_baudrate();
+}
+
+static inline int uart_clock(void)
+{
+        return ppc_proc_freq;
+}
+
+#endif
diff --git a/include/asm-ppc/fs_pd.h b/include/asm-ppc/fs_pd.h
new file mode 100644
index 0000000..eed7778
--- /dev/null
+++ b/include/asm-ppc/fs_pd.h
@@ -0,0 +1,32 @@
+/*
+ * Platform information definitions.
+ *
+ * 2006 (c) MontaVista Software, Inc.
+ * Vitaly Bordug <vbordug@ru.mvista.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef FS_PD_H
+#define FS_PD_H
+
+static inline int uart_baudrate(void)
+{
+	int baud;
+	bd_t *bd = (bd_t *) __res;
+
+	if (bd->bi_baudrate)
+		baud = bd->bi_baudrate;
+	else
+		baud = -1;
+	return baud;
+}
+
+static inline int uart_clock(void)
+{
+	return (((bd_t *) __res)->bi_intfreq);
+}
+
+#endif

^ permalink raw reply related

* [PATCH 3/7] POWERPC: Move generic cpm2 stuff to powerpc
From: Vitaly Bordug @ 2006-09-15 17:39 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <20060915213751.128e85f3@localhost.localdomain>


This moves the cpm2 common code and PIC stuff to the powerpc. Most of the files
were just copied from ppc/, with minor tuning to make it compile, and, subsequently, work.

Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
---

 arch/powerpc/lib/Makefile         |    5 +
 arch/powerpc/sysdev/Makefile      |    5 +
 arch/powerpc/sysdev/cpm2_common.c |  204 +++++++++++++++++++++++++++++
 arch/powerpc/sysdev/cpm2_pic.c    |  256 +++++++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/cpm2_pic.h    |    8 +
 include/asm-ppc/cpm2.h            |    6 +
 6 files changed, 483 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 336dd19..460cea0 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -20,3 +20,8 @@ ifeq ($(CONFIG_PPC64),y)
 obj-$(CONFIG_SMP)	+= locks.o
 obj-$(CONFIG_DEBUG_KERNEL) += sstep.o
 endif
+
+# Temporary hack until we have migrated to asm-powerpc
+ifeq ($(ARCH),powerpc)
+obj-$(CONFIG_CPM2)	+= rheap.o
+endif
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index e5e999e..f15f4d7 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -17,3 +17,8 @@ ifeq ($(CONFIG_PPC_MERGE),y)
 obj-$(CONFIG_PPC_I8259)		+= i8259.o
 obj-$(CONFIG_PPC_83xx)		+= ipic.o
 endif
+
+# Temporary hack until we have migrated to asm-powerpc
+ifeq ($(ARCH),powerpc)
+obj-$(CONFIG_CPM2)		+= cpm2_common.o cpm2_pic.o
+endif
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
new file mode 100644
index 0000000..e3bc6f2
--- /dev/null
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -0,0 +1,204 @@
+/*
+ * General Purpose functions for the global management of the
+ * 8260 Communication Processor Module.
+ * Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
+ * Copyright (c) 2000 MontaVista Software, Inc (source@mvista.com)
+ *	2.3.99 Updates
+ *
+ * 2006 (c) MontaVista Software, Inc.
+ * Vitaly Bordug <vbordug@ru.mvista.com>
+ * 	Merged to arch/powerpc from arch/ppc/syslib/cpm2_common.c
+ *
+ * In addition to the individual control of the communication
+ * channels, there are a few functions that globally affect the
+ * communication processor.
+ *
+ * Buffer descriptors must be allocated from the dual ported memory
+ * space.  The allocator for that is here.  When the communication
+ * process is reset, we reclaim the memory available.  There is
+ * currently no deallocator for this memory.
+ */
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/param.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/interrupt.h>
+#include <linux/module.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mpc8260.h>
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/cpm2.h>
+#include <asm/rheap.h>
+#include <asm/fs_pd.h>
+
+#include <sysdev/fsl_soc.h>
+
+static void cpm2_dpinit(void);
+cpm_cpm2_t	*cpmp;		/* Pointer to comm processor space */
+
+/* We allocate this here because it is used almost exclusively for
+ * the communication processor devices.
+ */
+cpm2_map_t *cpm2_immr;
+
+#define CPM_MAP_SIZE	(0x40000)	/* 256k - the PQ3 reserve this amount
+					   of space for CPM as it is larger
+					   than on PQ2 */
+
+void
+cpm2_reset(void)
+{
+	cpm2_immr = (cpm2_map_t *)ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE);
+
+	/* Reclaim the DP memory for our use.
+	 */
+	cpm2_dpinit();
+
+	/* Tell everyone where the comm processor resides.
+	 */
+	cpmp = &cpm2_immr->im_cpm;
+}
+
+/* Set a baud rate generator.  This needs lots of work.  There are
+ * eight BRGs, which can be connected to the CPM channels or output
+ * as clocks.  The BRGs are in two different block of internal
+ * memory mapped space.
+ * The baud rate clock is the system clock divided by something.
+ * It was set up long ago during the initial boot phase and is
+ * is given to us.
+ * Baud rate clocks are zero-based in the driver code (as that maps
+ * to port numbers).  Documentation uses 1-based numbering.
+ */
+#define BRG_INT_CLK	(get_brgfreq())
+#define BRG_UART_CLK	(BRG_INT_CLK/16)
+
+/* This function is used by UARTS, or anything else that uses a 16x
+ * oversampled clock.
+ */
+void
+cpm_setbrg(uint brg, uint rate)
+{
+	volatile uint	*bp;
+
+	/* This is good enough to get SMCs running.....
+	*/
+	if (brg < 4) {
+		bp = (uint *)&cpm2_immr->im_brgc1;
+	}
+	else {
+		bp = (uint *)&cpm2_immr->im_brgc5;
+		brg -= 4;
+	}
+	bp += brg;
+	*bp = ((BRG_UART_CLK / rate) << 1) | CPM_BRG_EN;
+}
+
+/* This function is used to set high speed synchronous baud rate
+ * clocks.
+ */
+void
+cpm2_fastbrg(uint brg, uint rate, int div16)
+{
+	volatile uint	*bp;
+
+	if (brg < 4) {
+		bp = (uint *)&cpm2_immr->im_brgc1;
+	}
+	else {
+		bp = (uint *)&cpm2_immr->im_brgc5;
+		brg -= 4;
+	}
+	bp += brg;
+	*bp = ((BRG_INT_CLK / rate) << 1) | CPM_BRG_EN;
+	if (div16)
+		*bp |= CPM_BRG_DIV16;
+}
+
+/*
+ * dpalloc / dpfree bits.
+ */
+static spinlock_t cpm_dpmem_lock;
+/* 16 blocks should be enough to satisfy all requests
+ * until the memory subsystem goes up... */
+static rh_block_t cpm_boot_dpmem_rh_block[16];
+static rh_info_t cpm_dpmem_info;
+
+static void cpm2_dpinit(void)
+{
+	spin_lock_init(&cpm_dpmem_lock);
+
+	/* initialize the info header */
+	rh_init(&cpm_dpmem_info, 1,
+			sizeof(cpm_boot_dpmem_rh_block) /
+			sizeof(cpm_boot_dpmem_rh_block[0]),
+			cpm_boot_dpmem_rh_block);
+
+	/* Attach the usable dpmem area */
+	/* XXX: This is actually crap. CPM_DATAONLY_BASE and
+	 * CPM_DATAONLY_SIZE is only a subset of the available dpram. It
+	 * varies with the processor and the microcode patches activated.
+	 * But the following should be at least safe.
+	 */
+	rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE,
+			CPM_DATAONLY_SIZE);
+}
+
+/* This function returns an index into the DPRAM area.
+ */
+uint cpm_dpalloc(uint size, uint align)
+{
+	void *start;
+	unsigned long flags;
+
+	spin_lock_irqsave(&cpm_dpmem_lock, flags);
+	cpm_dpmem_info.alignment = align;
+	start = rh_alloc(&cpm_dpmem_info, size, "commproc");
+	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
+
+	return (uint)start;
+}
+EXPORT_SYMBOL(cpm_dpalloc);
+
+int cpm_dpfree(uint offset)
+{
+	int ret;
+	unsigned long flags;
+
+	spin_lock_irqsave(&cpm_dpmem_lock, flags);
+	ret = rh_free(&cpm_dpmem_info, (void *)offset);
+	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
+
+	return ret;
+}
+EXPORT_SYMBOL(cpm_dpfree);
+
+/* not sure if this is ever needed */
+uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
+{
+	void *start;
+	unsigned long flags;
+
+	spin_lock_irqsave(&cpm_dpmem_lock, flags);
+	cpm_dpmem_info.alignment = align;
+	start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc");
+	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
+
+	return (uint)start;
+}
+EXPORT_SYMBOL(cpm_dpalloc_fixed);
+
+void cpm_dpdump(void)
+{
+	rh_dump(&cpm_dpmem_info);
+}
+EXPORT_SYMBOL(cpm_dpdump);
+
+void *cpm_dpram_addr(uint offset)
+{
+	return (void *)&cpm2_immr->im_dprambase[offset];
+}
+EXPORT_SYMBOL(cpm_dpram_addr);
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c
new file mode 100644
index 0000000..0cfa46a
--- /dev/null
+++ b/arch/powerpc/sysdev/cpm2_pic.c
@@ -0,0 +1,256 @@
+/*
+ * Platform information definitions.
+ *
+ * Copied from arch/ppc/syslib/cpm2_pic.c with minor subsequent updates
+ * to make in work in arch/powerpc/. Original (c) belongs to Dan Malek AFAIK.
+ *
+ * 2006 (c) MontaVista Software, Inc.
+ * Vitaly Bordug <vbordug@ru.mvista.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/* The CPM2 internal interrupt controller.  It is usually
+ * the only interrupt controller.
+ * There are two 32-bit registers (high/low) for up to 64
+ * possible interrupts.
+ *
+ * Now, the fun starts.....Interrupt Numbers DO NOT MAP
+ * in a simple arithmetic fashion to mask or pending registers.
+ * That is, interrupt 4 does not map to bit position 4.
+ * We create two tables, indexed by vector number, to indicate
+ * which register to use and which bit in the register to use.
+ */
+
+#include <linux/stddef.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/signal.h>
+#include <linux/irq.h>
+
+#include <asm/immap_cpm2.h>
+#include <asm/mpc8260.h>
+#include <asm/io.h>
+#include <asm/prom.h>
+
+#include "cpm2_pic.h"
+
+static struct device_node *cpm2_pic_node;
+static struct irq_host *cpm2_pic_host;
+#define NR_MASK_WORDS   ((NR_IRQS + 31) / 32)
+static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
+
+static	u_char	irq_to_siureg[] = {
+	1, 1, 1, 1, 1, 1, 1, 1,
+	1, 1, 1, 1, 1, 1, 1, 1,
+	0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0,
+	1, 1, 1, 1, 1, 1, 1, 1,
+	1, 1, 1, 1, 1, 1, 1, 1,
+	0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/* bit numbers do not match the docs, these are precomputed so the bit for
+ * a given irq is (1 << irq_to_siubit[irq]) */
+static	u_char	irq_to_siubit[] = {
+	 0, 15, 14, 13, 12, 11, 10,  9,
+	 8,  7,  6,  5,  4,  3,  2,  1,
+	 2,  1,  0, 14, 13, 12, 11, 10,
+	 9,  8,  7,  6,  5,  4,  3,  0,
+	31, 30, 29, 28, 27, 26, 25, 24,
+	23, 22, 21, 20, 19, 18, 17, 16,
+	16, 17, 18, 19, 20, 21, 22, 23,
+	24, 25, 26, 27, 28, 29, 30, 31,
+};
+
+static void cpm2_mask_irq(unsigned int irq_nr)
+{
+	int	bit, word;
+	volatile uint	*simr;
+
+	irq_nr -= CPM_IRQ_OFFSET;
+
+	bit = irq_to_siubit[irq_nr];
+	word = irq_to_siureg[irq_nr];
+
+	simr = &(cpm2_immr->im_intctl.ic_simrh);
+	ppc_cached_irq_mask[word] &= ~(1 << bit);
+	simr[word] = ppc_cached_irq_mask[word];
+}
+
+static void cpm2_unmask_irq(unsigned int irq_nr)
+{
+	int	bit, word;
+	volatile uint	*simr;
+
+	irq_nr -= CPM_IRQ_OFFSET;
+
+	bit = irq_to_siubit[irq_nr];
+	word = irq_to_siureg[irq_nr];
+
+	simr = &(cpm2_immr->im_intctl.ic_simrh);
+	ppc_cached_irq_mask[word] |= 1 << bit;
+	simr[word] = ppc_cached_irq_mask[word];
+}
+
+static void cpm2_mask_and_ack(unsigned int irq_nr)
+{
+	int	bit, word;
+	volatile uint	*simr, *sipnr;
+
+	irq_nr -= CPM_IRQ_OFFSET;
+
+	bit = irq_to_siubit[irq_nr];
+	word = irq_to_siureg[irq_nr];
+
+	simr = &(cpm2_immr->im_intctl.ic_simrh);
+	sipnr = &(cpm2_immr->im_intctl.ic_sipnrh);
+	ppc_cached_irq_mask[word] &= ~(1 << bit);
+	simr[word] = ppc_cached_irq_mask[word];
+	sipnr[word] = 1 << bit;
+}
+
+static void cpm2_end_irq(unsigned int irq_nr)
+{
+	int	bit, word;
+	volatile uint	*simr;
+
+	if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
+			&& irq_desc[irq_nr].action) {
+
+		irq_nr -= CPM_IRQ_OFFSET;
+		bit = irq_to_siubit[irq_nr];
+		word = irq_to_siureg[irq_nr];
+
+		simr = &(cpm2_immr->im_intctl.ic_simrh);
+		ppc_cached_irq_mask[word] |= 1 << bit;
+		simr[word] = ppc_cached_irq_mask[word];
+		/*
+		 * Work around large numbers of spurious IRQs on PowerPC 82xx
+		 * systems.
+		 */
+		mb();
+	}
+}
+
+static struct irq_chip cpm2_pic = {
+	.typename = " CPM2 SIU ",
+	.enable = cpm2_unmask_irq,
+	.disable = cpm2_mask_irq,
+	.unmask = cpm2_unmask_irq,
+	.mask_ack = cpm2_mask_and_ack,
+	.end = cpm2_end_irq,
+};
+
+int cpm2_get_irq(struct pt_regs *regs)
+{
+	int irq;
+        unsigned long bits;
+
+        /* For CPM2, read the SIVEC register and shift the bits down
+         * to get the irq number.         */
+        bits = cpm2_immr->im_intctl.ic_sivec;
+        irq = bits >> 26;
+
+	if (irq == 0)
+		return(-1);
+	return irq+CPM_IRQ_OFFSET;
+}
+
+static int cpm2_pic_host_match(struct irq_host *h, struct device_node *node)
+{
+	return cpm2_pic_node == NULL || cpm2_pic_node == node;
+}
+
+static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq,
+			  irq_hw_number_t hw)
+{
+	pr_debug("cpm2_pic_host_map(%d, 0x%lx)\n", virq, hw);
+
+	get_irq_desc(virq)->status |= IRQ_LEVEL;
+	set_irq_chip_and_handler(virq, &cpm2_pic, handle_level_irq);
+	return 0;
+}
+
+static void cpm2_host_unmap(struct irq_host *h, unsigned int virq)
+{
+	/* Make sure irq is masked in hardware */
+	cpm2_mask_irq(virq);
+
+	/* remove chip and handler */
+	set_irq_chip_and_handler(virq, NULL, NULL);
+}
+
+static int cpm2_pic_host_xlate(struct irq_host *h, struct device_node *ct,
+			    u32 *intspec, unsigned int intsize,
+			    irq_hw_number_t *out_hwirq, unsigned int *out_flags)
+{
+	static unsigned char map_cpm2_senses[4] = {
+		IRQ_TYPE_LEVEL_LOW,
+		IRQ_TYPE_LEVEL_HIGH,
+		IRQ_TYPE_EDGE_FALLING,
+		IRQ_TYPE_EDGE_RISING,
+	};
+
+	*out_hwirq = intspec[0];
+	if (intsize > 1 && intspec[1] < 4)
+		*out_flags = map_cpm2_senses[intspec[1]];
+	else
+		*out_flags = IRQ_TYPE_NONE;
+
+	return 0;
+}
+
+
+static struct irq_host_ops cpm2_pic_host_ops = {
+	.match = cpm2_pic_host_match,
+	.map = cpm2_pic_host_map,
+	.unmap = cpm2_host_unmap,
+	.xlate = cpm2_pic_host_xlate,
+};
+
+
+void cpm2_pic_init(struct device_node *node)
+{
+	int i;
+
+	/* Clear the CPM IRQ controller, in case it has any bits set
+	 * from the bootloader
+	 */
+
+	/* Mask out everything */
+
+	cpm2_immr->im_intctl.ic_simrh = 0x00000000;
+	cpm2_immr->im_intctl.ic_simrl = 0x00000000;
+
+	wmb();
+
+	/* Ack everything */
+	cpm2_immr->im_intctl.ic_sipnrh = 0xffffffff;
+	cpm2_immr->im_intctl.ic_sipnrl = 0xffffffff;
+	wmb();
+
+	/* Dummy read of the vector */
+	i = cpm2_immr->im_intctl.ic_sivec;
+	rmb();
+
+	/* Initialize the default interrupt mapping priorities,
+	 * in case the boot rom changed something on us.
+	 */
+	cpm2_immr->im_intctl.ic_sicr = 0;
+	cpm2_immr->im_intctl.ic_scprrh = 0x05309770;
+	cpm2_immr->im_intctl.ic_scprrl = 0x05309770;
+
+	/* create a legacy host */
+	if (node)
+		cpm2_pic_node = of_node_get(node);
+
+	cpm2_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 64, &cpm2_pic_host_ops, 64);
+	if (cpm2_pic_host == NULL) {
+		printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n");
+		return;
+	}
+}
diff --git a/arch/powerpc/sysdev/cpm2_pic.h b/arch/powerpc/sysdev/cpm2_pic.h
new file mode 100644
index 0000000..436cca7
--- /dev/null
+++ b/arch/powerpc/sysdev/cpm2_pic.h
@@ -0,0 +1,8 @@
+#ifndef _PPC_KERNEL_CPM2_H
+#define _PPC_KERNEL_CPM2_H
+
+extern int cpm2_get_irq(struct pt_regs *regs);
+
+extern void cpm2_pic_init(struct device_node*);
+
+#endif /* _PPC_KERNEL_CPM2_H */
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h
index f6a7ff0..876974e 100644
--- a/include/asm-ppc/cpm2.h
+++ b/include/asm-ppc/cpm2.h
@@ -42,6 +42,8 @@ #define CPM_CR_IDMA3_SBLOCK	(0x16)
 #define CPM_CR_IDMA4_SBLOCK	(0x17)
 #define CPM_CR_MCC1_SBLOCK	(0x1c)
 
+#define CPM_CR_FCC_SBLOCK(x)	(x + 0x10)
+
 #define CPM_CR_SCC1_PAGE	(0x00)
 #define CPM_CR_SCC2_PAGE	(0x01)
 #define CPM_CR_SCC3_PAGE	(0x02)
@@ -62,6 +64,8 @@ #define CPM_CR_IDMA4_PAGE	(0x0a)
 #define CPM_CR_MCC1_PAGE	(0x07)
 #define CPM_CR_MCC2_PAGE	(0x08)
 
+#define CPM_CR_FCC_PAGE(x)	(x + 0x04)
+
 /* Some opcodes (there are more...later)
 */
 #define CPM_CR_INIT_TRX		((ushort)0x0000)
@@ -1186,7 +1190,7 @@ #define PC3_DIRC1	(PC3_TXDAT)
 #define FCC_MEM_OFFSET(x) (CPM_FCC_SPECIAL_BASE + (x*128))
 #define FCC1_MEM_OFFSET FCC_MEM_OFFSET(0)
 #define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1)
-#define FCC2_MEM_OFFSET FCC_MEM_OFFSET(2)
+#define FCC3_MEM_OFFSET FCC_MEM_OFFSET(2)
 
 #endif /* __CPM2__ */
 #endif /* __KERNEL__ */

^ permalink raw reply related

* [PATCH 4/7] POWERPC: Add support for the mpc8560 eval board
From: Vitaly Bordug @ 2006-09-15 17:39 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <20060915213751.128e85f3@localhost.localdomain>


This makes the 8560 evaluation board fully supported under arch/powerpc,
as the first board with CPM2 SoC peripherals. The brand new devicetree
nodes are introduced (intending to be a subset of the QuiccEngine-equipped
models, with dts sources placed into the kernel according to the new convention.

Assuming all the preceding stuff applied (PAL+fs_enet related+ CPM_UART
update), the both TSEC eth ,FCC Eths, and both SCC UARTs are
working. The relevant drivers are still capable to drive users in ppc,
which was verified with 8272ADS (SCC uart+FCC eth).

This is also verified on mpc8540 and actually make it work (PCI stuff
working as well)

Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
---

 arch/powerpc/boot/dts/mpc8560ads.dts       |  302 ++++++++++
 arch/powerpc/configs/mpc8560_ads_defconfig |  854 ++++++++++++++++++++++++++++
 arch/powerpc/platforms/85xx/Kconfig        |   21 +
 arch/powerpc/platforms/85xx/Makefile       |    1 
 arch/powerpc/platforms/85xx/mpc85xx_ads.c  |  109 ++++
 arch/powerpc/platforms/85xx/mpc85xx_ads.h  |   61 ++
 include/asm-powerpc/mpc85xx.h              |   53 ++
 7 files changed, 1401 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts
new file mode 100644
index 0000000..ba5c943
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8560ads.dts
@@ -0,0 +1,302 @@
+/*
+ * MPC8560 ADS Device Tree Source
+ *
+ * Copyright 2006 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+
+/ {
+	model = "MPC8560ADS";
+	compatible = "MPC85xxADS";
+	#address-cells = <1>;
+	#size-cells = <1>;
+	linux,phandle = <100>;
+
+	cpus {
+		#cpus = <1>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		linux,phandle = <200>;
+
+		PowerPC,8560@0 {
+			device_type = "cpu";
+			reg = <0>;
+			d-cache-line-size = <20>;	// 32 bytes
+			i-cache-line-size = <20>;	// 32 bytes
+			d-cache-size = <8000>;		// L1, 32K
+			i-cache-size = <8000>;		// L1, 32K
+			timebase-frequency = <04ead9a0>;
+			bus-frequency = <13ab6680>;
+			clock-frequency = <312c8040>;
+			32-bit;
+			linux,phandle = <201>;
+			linux,boot-cpu;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		linux,phandle = <300>;
+		reg = <00000000 10000000>;
+	};
+
+	soc8560@e0000000 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		#interrupt-cells = <2>;
+		device_type = "soc";
+		ranges = <0 e0000000 00100000>;
+		reg = <e0000000 00000200>;
+		bus-frequency = <13ab6680>;
+
+		mdio@24520 {
+			device_type = "mdio";
+			compatible = "gianfar";
+			reg = <24520 20>;
+			linux,phandle = <24520>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			ethernet-phy@0 {
+				linux,phandle = <2452000>;
+				interrupt-parent = <40000>;
+				interrupts = <35 1>;
+				reg = <0>;
+				device_type = "ethernet-phy";
+			};
+			ethernet-phy@1 {
+				linux,phandle = <2452001>;
+				interrupt-parent = <40000>;
+				interrupts = <35 1>;
+				reg = <1>;
+				device_type = "ethernet-phy";
+			};
+			ethernet-phy@2 {
+				linux,phandle = <2452002>;
+				interrupt-parent = <40000>;
+				interrupts = <37 1>;
+				reg = <2>;
+				device_type = "ethernet-phy";
+			};
+			ethernet-phy@3 {
+				linux,phandle = <2452003>;
+				interrupt-parent = <40000>;
+				interrupts = <37 1>;
+				reg = <3>;
+				device_type = "ethernet-phy";
+			};
+		};
+
+		ethernet@24000 {
+			device_type = "network";
+			model = "TSEC";
+			compatible = "gianfar";
+			reg = <24000 1000>;
+			address = [ 00 00 0C 00 00 FD ];
+			interrupts = <d 2 e 2 12 2>;
+			interrupt-parent = <40000>;
+			phy-handle = <2452000>;
+		};
+
+		ethernet@25000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			device_type = "network";
+			model = "TSEC";
+			compatible = "gianfar";
+			reg = <25000 1000>;
+			address = [ 00 00 0C 00 01 FD ];
+			interrupts = <13 2 14 2 18 2>;
+			interrupt-parent = <40000>;
+			phy-handle = <2452001>;
+		};
+
+		pci@8000 {
+			linux,phandle = <8000>;
+			#interrupt-cells = <1>;
+			#size-cells = <2>;
+			#address-cells = <3>;
+			compatible = "85xx";
+			device_type = "pci";
+			reg = <8000 400>;
+			clock-frequency = <3f940aa>;
+			interrupt-map-mask = <f800 0 0 7>;
+			interrupt-map = <
+
+					/* IDSEL 0x2 */
+					 1000 0 0 1 40000 31 1
+					 1000 0 0 2 40000 32 1
+					 1000 0 0 3 40000 33 1
+					 1000 0 0 4 40000 34 1
+
+					/* IDSEL 0x3 */
+					 1800 0 0 1 40000 34 1
+					 1800 0 0 2 40000 31 1
+					 1800 0 0 3 40000 32 1
+					 1800 0 0 4 40000 33 1
+
+					/* IDSEL 0x4 */
+					 2000 0 0 1 40000 33 1
+					 2000 0 0 2 40000 34 1
+					 2000 0 0 3 40000 31 1
+					 2000 0 0 4 40000 32 1
+
+					/* IDSEL 0x5  */
+					 2800 0 0 1 40000 32 1
+					 2800 0 0 2 40000 33 1
+					 2800 0 0 3 40000 34 1
+					 2800 0 0 4 40000 31 1
+
+					/* IDSEL 12 */
+					 6000 0 0 1 40000 31 1
+					 6000 0 0 2 40000 32 1
+					 6000 0 0 3 40000 33 1
+					 6000 0 0 4 40000 34 1
+
+					/* IDSEL 13 */
+					 6800 0 0 1 40000 34 1
+					 6800 0 0 2 40000 31 1
+					 6800 0 0 3 40000 32 1
+					 6800 0 0 4 40000 33 1
+
+					/* IDSEL 14*/
+					 7000 0 0 1 40000 33 1
+					 7000 0 0 2 40000 34 1
+					 7000 0 0 3 40000 31 1
+					 7000 0 0 4 40000 32 1
+
+					/* IDSEL 15 */
+					 7800 0 0 1 40000 32 1
+					 7800 0 0 2 40000 33 1
+					 7800 0 0 3 40000 34 1
+					 7800 0 0 4 40000 31 1
+
+					/* IDSEL 18 */
+					 9000 0 0 1 40000 31 1
+					 9000 0 0 2 40000 32 1
+					 9000 0 0 3 40000 33 1
+					 9000 0 0 4 40000 34 1
+
+					/* IDSEL 19 */
+					 9800 0 0 1 40000 34 1
+					 9800 0 0 2 40000 31 1
+					 9800 0 0 3 40000 32 1
+					 9800 0 0 4 40000 33 1
+
+					/* IDSEL 20 */
+					 a000 0 0 1 40000 33 1
+					 a000 0 0 2 40000 34 1
+					 a000 0 0 3 40000 31 1
+					 a000 0 0 4 40000 32 1
+
+					/* IDSEL 21 */
+					 a800 0 0 1 40000 32 1
+					 a800 0 0 2 40000 33 1
+					 a800 0 0 3 40000 34 1
+					 a800 0 0 4 40000 31 1>;
+
+			interrupt-parent = <40000>;
+			interrupts = <42 0>;
+			bus-range = <0 0>;
+			ranges = <02000000 0 80000000 80000000 0 20000000
+				  01000000 0 00000000 e2000000 0 01000000>;
+		};
+
+		pic@40000 {
+			linux,phandle = <40000>;
+			interrupt-controller;
+			#address-cells = <0>;
+			#interrupt-cells = <2>;
+			reg = <40000 20100>;
+			built-in;
+			device_type = "open-pic";
+		};
+
+		cpm@e0000000 {
+			linux,phandle = <e0000000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			#interrupt-cells = <2>;
+			device_type = "cpm";
+			model = "CPM2";
+			ranges = <0 0 c0000>;
+			reg = <80000 40000>;
+			command-proc = <919c0>;
+			brg-frequency = <9d5b340>;
+
+			pic@90c00 {
+				linux,phandle = <90c00>;
+				interrupt-controller;
+				#address-cells = <0>;
+				#interrupt-cells = <2>;
+				interrupts = <1e 0>;
+				interrupt-parent = <40000>;
+				reg = <90c00 80>;
+				built-in;
+				device_type = "cpm-pic";
+			};
+
+			scc@91a00 {
+				device_type = "serial";
+				compatible = "cpm_uart";
+				model = "SCC";
+				device-id = <2>;
+				reg = <91a00 20 88000 100>;
+				clock-setup = <00ffffff 0>;
+				rx-clock = <1>;
+				tx-clock = <1>;
+				current-speed = <1c200>;
+				interrupts = <64 1>;
+				interrupt-parent = <90c00>;
+			};
+
+			scc@91a20 {
+				device_type = "serial";
+				compatible = "cpm_uart";
+				model = "SCC";
+				device-id = <3>;
+				reg = <91a20 20 88100 100>;
+				clock-setup = <ff00ffff 90000>;
+				rx-clock = <2>;
+				tx-clock = <2>;
+				current-speed = <1c200>;
+				interrupts = <65 1>;
+				interrupt-parent = <90c00>;
+			};
+
+			fcc@91320 {
+				device_type = "network";
+				compatible = "fs_enet";
+				model = "FCC";
+				device-id = <3>;
+				reg = <91320 20 88500 100 913a0 30>;
+				mac-address = [ 00 00 0C 00 02 FD ];
+				clock-setup = <ff00ffff 250000>;
+				rx-clock = <15>;
+				tx-clock = <16>;
+				interrupts = <5d 1>;
+				interrupt-parent = <90c00>;
+				phy-handle = <2452002>;
+			};
+
+			fcc@91340 {
+				device_type = "network";
+				compatible = "fs_enet";
+				model = "FCC";
+				device-id = <4>;
+				reg = <91340 20 88600 100 913d0 30>;
+				mac-address = [ 00 00 0C 00 03 FD ];
+				clock-setup = <ffff00ff 3700>;
+				rx-clock = <17>;
+				tx-clock = <18>;
+				interrupts = <5e 1>;
+				interrupt-parent = <90c00>;
+				phy-handle = <2452003>;
+			};
+		};
+	};
+};
diff --git a/arch/powerpc/configs/mpc8560_ads_defconfig b/arch/powerpc/configs/mpc8560_ads_defconfig
new file mode 100644
index 0000000..ddc2a7b
--- /dev/null
+++ b/arch/powerpc/configs/mpc8560_ads_defconfig
@@ -0,0 +1,854 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.18-rc4
+# Fri Aug 11 16:45:05 2006
+#
+# CONFIG_PPC64 is not set
+CONFIG_PPC32=y
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+# CONFIG_PPC_UDBG_16550 is not set
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_DEFAULT_UIMAGE=y
+
+#
+# Processor support
+#
+# CONFIG_CLASSIC32 is not set
+# CONFIG_PPC_52xx is not set
+# CONFIG_PPC_82xx is not set
+# CONFIG_PPC_83xx is not set
+CONFIG_PPC_85xx=y
+# CONFIG_PPC_86xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_8xx is not set
+# CONFIG_E200 is not set
+CONFIG_85xx=y
+CONFIG_E500=y
+CONFIG_BOOKE=y
+CONFIG_FSL_BOOKE=y
+# CONFIG_PHYS_64BIT is not set
+CONFIG_SPE=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+# CONFIG_RELAY is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_RT_MUTEXES=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
+# Block layer
+#
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_MPIC=y
+CONFIG_CPM2=y
+# CONFIG_WANT_EARLY_SERIAL is not set
+
+#
+# Platform support
+#
+# CONFIG_MPC8540_ADS is not set
+CONFIG_MPC8560_ADS=y
+# CONFIG_MPC85xx_CDS is not set
+CONFIG_MPC8560=y
+CONFIG_PPC_INDIRECT_PCI_BE=y
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=y
+# CONFIG_MATH_EMULATION is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+# CONFIG_PC_KEYBOARD is not set
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PROC_DEVICETREE is not set
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
+# CONFIG_SECCOMP is not set
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+# CONFIG_PPC_I8259 is not set
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_FSL_SOC=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
+CONFIG_PCI_DEBUG=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_BIC=y
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=32768
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Macintosh device drivers
+#
+# CONFIG_WINDFARM is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=y
+CONFIG_DAVICOM_PHY=y
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_FIXED_PHY is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_PCI is not set
+CONFIG_FS_ENET=y
+# CONFIG_FS_ENET_HAS_SCC is not set
+CONFIG_FS_ENET_HAS_FCC=y
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+CONFIG_E1000=y
+CONFIG_E1000_NAPI=y
+# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+CONFIG_GIANFAR=y
+CONFIG_GFAR_NAPI=y
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_CPM=y
+CONFIG_SERIAL_CPM_CONSOLE=y
+CONFIG_SERIAL_CPM_SCC1=y
+CONFIG_SERIAL_CPM_SCC2=y
+# CONFIG_SERIAL_CPM_SCC3 is not set
+# CONFIG_SERIAL_CPM_SCC4 is not set
+# CONFIG_SERIAL_CPM_SMC1 is not set
+# CONFIG_SERIAL_CPM_SMC2 is not set
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_BRIQ_PANEL is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_NVRAM is not set
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+CONFIG_VIDEO_V4L2=y
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+CONFIG_FIRMWARE_EDID=y
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
+#
+# Real Time Clock
+#
+# CONFIG_RTC_CLASS is not set
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+# CONFIG_MSDOS_PARTITION is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+
+#
+# Instrumentation Support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_RWSEMS is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_UNWIND_INFO is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_DEBUGGER is not set
+# CONFIG_KGDB_CONSOLE is not set
+# CONFIG_BDI_SWITCH is not set
+# CONFIG_BOOTX_TEXT is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Hardware crypto devices
+#
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index c3268d9..0584f3c 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -11,6 +11,12 @@ config MPC8540_ADS
 	help
 	  This option enables support for the MPC 8540 ADS board
 
+config MPC8560_ADS
+	bool "Freescale MPC8560 ADS"
+	select DEFAULT_UIMAGE
+	help
+	  This option enables support for the MPC 8560 ADS board
+
 config MPC85xx_CDS
 	bool "Freescale MPC85xx CDS"
 	select DEFAULT_UIMAGE
@@ -25,6 +31,11 @@ config MPC8540
 	select PPC_INDIRECT_PCI
 	default y if MPC8540_ADS || MPC85xx_CDS
 
+config MPC8560
+	bool
+	select PPC_INDIRECT_PCI
+	default y if MPC8560_ADS
+
 config PPC_INDIRECT_PCI_BE
 	bool
 	depends on PPC_85xx
@@ -34,4 +45,14 @@ config MPIC
 	bool
 	default y
 
+config CPM2
+	bool
+	depends on MPC8560
+	default y
+	help
+	  The CPM2 (Communications Processor Module) is a coprocessor on
+	  embedded CPUs made by Motorola.  Selecting this option means that
+	  you wish to build a kernel for a machine with a CPM2 coprocessor
+	  on it.
+
 endmenu
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index 7615aa5..282f5d0 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -3,4 +3,5 @@ # Makefile for the PowerPC 85xx linux ke
 #
 obj-$(CONFIG_PPC_85xx)	+= misc.o pci.o
 obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
+obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index cae6b73..7ebfe74 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -32,6 +32,12 @@ #include <asm/udbg.h>
 #include <sysdev/fsl_soc.h>
 #include "mpc85xx.h"
 
+#ifdef CONFIG_CPM2
+#include <asm/cpm2.h>
+#include <sysdev/cpm2_pic.h>
+#include <asm/fs_pd.h>
+#endif
+
 #ifndef CONFIG_PCI
 unsigned long isa_io_base = 0;
 unsigned long isa_mem_base = 0;
@@ -57,12 +63,29 @@ mpc85xx_pcibios_fixup(void)
 }
 #endif /* CONFIG_PCI */
 
+#ifdef CONFIG_CPM2
+
+static void cpm2_cascade(unsigned int irq, struct irq_desc *desc,
+			 struct pt_regs *regs)
+{
+	int cascade_irq;
+
+	while ((cascade_irq = cpm2_get_irq(regs)) >= 0) {
+		generic_handle_irq(cascade_irq, regs);
+	}
+	desc->chip->eoi(irq);
+}
+
+#endif /* CONFIG_CPM2 */
 
 void __init mpc85xx_ads_pic_init(void)
 {
 	struct mpic *mpic;
 	struct resource r;
 	struct device_node *np = NULL;
+#ifdef CONFIG_CPM2
+	int irq;
+#endif
 
 	np = of_find_node_by_type(np, "open-pic");
 
@@ -104,11 +127,92 @@ void __init mpc85xx_ads_pic_init(void)
 	mpic_assign_isu(mpic, 14, r.start + 0x10100);
 
 	mpic_init(mpic);
+
+#ifdef CONFIG_CPM2
+	/* Setup CPM2 PIC */
+	np = of_find_node_by_type(NULL, "cpm-pic");
+	if (np == NULL) {
+		printk(KERN_ERR "PIC init: can not find cpm-pic node\n");
+                return;
+	}
+	irq = irq_of_parse_and_map(np, 0);
+
+	cpm2_pic_init(np);
+	set_irq_chained_handler(irq, cpm2_cascade);
+#endif
 }
 
 /*
  * Setup the architecture
  */
+#ifdef CONFIG_CPM2
+static void init_fcc_ioports(void)
+{
+	struct immap *immap;
+	struct io_port *io;
+	u32 tempval;
+
+	immap = cpm2_immr;
+
+	io = &immap->im_ioport;
+	/* FCC2/3 are on the ports B/C. */
+	tempval = in_be32(&io->iop_pdirb);
+	tempval &= ~PB2_DIRB0;
+	tempval |= PB2_DIRB1;
+	out_be32(&io->iop_pdirb, tempval);
+
+	tempval = in_be32(&io->iop_psorb);
+	tempval &= ~PB2_PSORB0;
+	tempval |= PB2_PSORB1;
+	out_be32(&io->iop_psorb, tempval);
+
+	tempval = in_be32(&io->iop_pparb);
+	tempval |= (PB2_DIRB0 | PB2_DIRB1);
+	out_be32(&io->iop_pparb, tempval);
+
+	tempval = in_be32(&io->iop_pdirb);
+	tempval &= ~PB3_DIRB0;
+	tempval |= PB3_DIRB1;
+	out_be32(&io->iop_pdirb, tempval);
+
+	tempval = in_be32(&io->iop_psorb);
+	tempval &= ~PB3_PSORB0;
+	tempval |= PB3_PSORB1;
+	out_be32(&io->iop_psorb, tempval);
+
+	tempval = in_be32(&io->iop_pparb);
+	tempval |= (PB3_DIRB0 | PB3_DIRB1);
+	out_be32(&io->iop_pparb, tempval);
+
+	tempval = in_be32(&io->iop_pdirc);
+	tempval |= PC3_DIRC1;
+	out_be32(&io->iop_pdirc, tempval);
+
+	tempval = in_be32(&io->iop_pparc);
+	tempval |= PC3_DIRC1;
+	out_be32(&io->iop_pparc, tempval);
+
+	/* Port C has clocks......  */
+	tempval = in_be32(&io->iop_psorc);
+	tempval &= ~(CLK_TRX);
+	out_be32(&io->iop_psorc, tempval);
+
+	tempval = in_be32(&io->iop_pdirc);
+	tempval &= ~(CLK_TRX);
+	out_be32(&io->iop_pdirc, tempval);
+	tempval = in_be32(&io->iop_pparc);
+	tempval |= (CLK_TRX);
+	out_be32(&io->iop_pparc, tempval);
+
+	/* Configure Serial Interface clock routing.
+	 * First,  clear all FCC bits to zero,
+	 * then set the ones we want.
+	 */
+	immap->im_cpmux.cmx_fcr &= ~(CPMUX_CLK_MASK);
+	immap->im_cpmux.cmx_fcr |= CPMUX_CLK_ROUTE;
+}
+#endif
+
 static void __init mpc85xx_ads_setup_arch(void)
 {
 	struct device_node *cpu;
@@ -131,6 +235,11 @@ #endif
 		of_node_put(cpu);
 	}
 
+#ifdef CONFIG_CPM2
+	cpm2_reset();
+	init_fcc_ioports();
+#endif
+
 #ifdef CONFIG_PCI
 	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
 		add_bridge(np);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.h b/arch/powerpc/platforms/85xx/mpc85xx_ads.h
new file mode 100644
index 0000000..effcbf7
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.h
@@ -0,0 +1,61 @@
+/*
+ * MPC85xx ADS board definitions
+ *
+ * Maintainer: Kumar Gala <galak@kernel.crashing.org>
+ *
+ * Copyright 2004 Freescale Semiconductor Inc.
+ *
+ * 2006 (c) MontaVista Software, Inc.
+ * Vitaly Bordug <vbordug@ru.mvista.com>
+ *
+ * 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.
+ *
+ */
+
+#ifndef __MACH_MPC85XXADS_H
+#define __MACH_MPC85XXADS_H
+
+#include <linux/config.h>
+#include <linux/initrd.h>
+#include <sysdev/fsl_soc.h>
+
+#define BCSR_ADDR		((uint)0xf8000000)
+#define BCSR_SIZE		((uint)(32 * 1024))
+
+#ifdef CONFIG_CPM2
+
+#define MPC85xx_CPM_OFFSET	(0x80000)
+
+#define CPM_MAP_ADDR		(get_immrbase() + MPC85xx_CPM_OFFSET)
+#define CPM_IRQ_OFFSET		60
+
+#define SIU_INT_SMC1		((uint)0x04+CPM_IRQ_OFFSET)
+#define SIU_INT_SMC2		((uint)0x05+CPM_IRQ_OFFSET)
+#define SIU_INT_SCC1		((uint)0x28+CPM_IRQ_OFFSET)
+#define SIU_INT_SCC2		((uint)0x29+CPM_IRQ_OFFSET)
+#define SIU_INT_SCC3		((uint)0x2a+CPM_IRQ_OFFSET)
+#define SIU_INT_SCC4		((uint)0x2b+CPM_IRQ_OFFSET)
+
+/* FCC1 Clock Source Configuration.  These can be
+ * redefined in the board specific file.
+ *    Can only choose from CLK9-12 */
+#define F1_RXCLK       12
+#define F1_TXCLK       11
+
+/* FCC2 Clock Source Configuration.  These can be
+ * redefined in the board specific file.
+ *    Can only choose from CLK13-16 */
+#define F2_RXCLK       13
+#define F2_TXCLK       14
+
+/* FCC3 Clock Source Configuration.  These can be
+ * redefined in the board specific file.
+ *    Can only choose from CLK13-16 */
+#define F3_RXCLK       15
+#define F3_TXCLK       16
+
+#endif	/* CONFIG_CPM2 */
+#endif	/* __MACH_MPC85XXADS_H */
diff --git a/include/asm-powerpc/mpc85xx.h b/include/asm-powerpc/mpc85xx.h
new file mode 100644
index 0000000..ccdb8a2
--- /dev/null
+++ b/include/asm-powerpc/mpc85xx.h
@@ -0,0 +1,53 @@
+/*
+ * include/asm-powerpc/mpc85xx.h
+ *
+ * MPC85xx definitions
+ *
+ * Maintainer: Kumar Gala <galak@kernel.crashing.org>
+ *
+ * Copyright 2004 Freescale Semiconductor, Inc
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#ifdef __KERNEL__
+#ifndef __ASM_MPC85xx_H__
+#define __ASM_MPC85xx_H__
+
+#include <asm/mmu.h>
+
+#ifdef CONFIG_85xx
+
+#if defined(CONFIG_MPC8540_ADS) || defined(CONFIG_MPC8560_ADS)
+#include <platforms/85xx/mpc85xx_ads.h>
+#endif
+#if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS)
+#include <platforms/85xx/mpc8555_cds.h>
+#endif
+#ifdef CONFIG_MPC85xx_CDS
+#include <platforms/85xx/mpc85xx_cds.h>
+#endif
+
+#define _IO_BASE        isa_io_base
+#define _ISA_MEM_BASE   isa_mem_base
+#ifdef CONFIG_PCI
+#define PCI_DRAM_OFFSET pci_dram_offset
+#else
+#define PCI_DRAM_OFFSET 0
+#endif
+
+/* Let modules/drivers get at CCSRBAR */
+extern phys_addr_t get_ccsrbar(void);
+
+#ifdef MODULE
+#define CCSRBAR get_ccsrbar()
+#else
+#define CCSRBAR BOARD_CCSRBAR
+#endif
+
+#endif /* CONFIG_85xx */
+#endif /* __ASM_MPC85xx_H__ */
+#endif /* __KERNEL__ */

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox