LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* help needed:relocation truncated to fit: R_PPC_REL24 _init
From: zengshuai @ 2006-01-09 13:31 UTC (permalink / raw)
  To: ppc

detail:
ppc_6xx-gcc ../../../../lib/EmbedCLib/OBJ/link.x -Wall ../../../../lib/EmbedCLi
/OBJ/gcc_crt1.o -Wl,-Ttext -Wl,0x4000  -Wl,-defsym -Wl,STACK_START=0x400000 -Wl
-defsym -Wl,STACK_END=0x300000  -o aal25 ./OBJ_ATM/mm.o ./OBJ_ATM/mem_alloc.o .
OBJ_ATM/mem.o ./OBJ_ATM/cell.o ./OBJ_ATM/buffer.o ./OBJ_ATM/frame.o ./OBJ_ATM/s
f.o ./OBJ_ATM/ll.o ./OBJ_ATM/cq.o ./OBJ_ATM/Pq2Cpm_ci.o ./OBJ_ATM/Pq2Cpm.o ./OB
_ATM/PQII_ci.o ./OBJ_ATM/PQII.o ./OBJ_ATM/atm_bdm.o ./OBJ_ATM/fbp.o ./OBJ_ATM/r
.o ./OBJ_ATM/atm_fcc_ci.o ./OBJ_ATM/atm_chan_ci.o ./OBJ_ATM/atm_pm_ci.o ./OBJ_A
M/aal5_ci.o ./OBJ_ATM/rct.o ./OBJ_ATM/tct.o ./OBJ_ATM/vpt_vct.o ./OBJ_ATM/bd.o 
/OBJ_ATM/atm_fcc.o ./OBJ_ATM/atm_chan.o ./OBJ_ATM/atm_pm.o ./OBJ_ATM/atm_demo.o
./OBJ_ATM/xx.o ./OBJ_ATM/atm_phy.o  ./OBJ_ATM/intrPQII.o ./OBJ_ATM/aal0_ci.o ./
BJ_ATM/aal0.o ./OBJ_ATM/aal2_ci.o ./OBJ_ATM/aal2.o ./OBJ_ATM/aal5.o ./OBJ_ATM/A
L25.o -L../../../../lib/EmbedCLib/OBJ -lembc_gcc                               
../../../../lib/EmbedCLib/OBJ/gcc_crt1.o(.text+0x0): multiple definition of `_s
art'                                                                           
/opt/eldk3/usr/../ppc_6xx/usr/lib/crt1.o(.text+0x0): first defined here        
/opt/eldk3/usr/bin/../lib/gcc-lib/ppc-linux/3.3.3/../../../../ppc-linux/bin/ld:
Warning: type of symbol `_start' changed from 2 to 1 in ../../../../lib/EmbedCL
b/OBJ/gcc_crt1.o                                                               
../../../../lib/EmbedCLib/OBJ/libembc_gcc.a(init.o)(.text+0x0): In function `_i
it':                                                                           
: multiple definition of `_init'                                               
/opt/eldk3/usr/../ppc_6xx/usr/lib/crti.o(.init+0x0): first defined here        
../../../../lib/EmbedCLib/OBJ/libembc_gcc.a(init.o)(.text+0x56): In function `_
nit':                                                                          
: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead             
/opt/eldk3/usr/../ppc_6xx/usr/lib/crti.o(.init+0xc): In function `_init':      
: relocation truncated to fit: R_PPC_LOCAL24PC .text                           
/opt/eldk3/usr/bin/../lib/gcc-lib/ppc-linux/3.3.3/m603/crtbegin.o(.init+0x0): r
../../../../lib/EmbedCLib/OBJ/gcc_crt1.o(.text+0x1c): relocation truncated to f
t: R_PPC_REL24 _init                                                           
/opt/eldk3/usr/../ppc_6xx/usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x18): In
function `__libc_csu_init':                                                    
: relocation truncated to fit: R_PPC_REL24 _init                               
/opt/eldk3/usr/bin/../lib/gcc-lib/ppc-linux/3.3.3/m603/crtend.o(.init+0x0): rel
cation truncated to fit: R_PPC_REL24 .text                                     
collect2: ld returned 1 exit status                                            
gmake[1]: *** [aal25] Error 1                                                  
gmake[1]: Leaving directory `/home/test2-td/NetCommSw/PQII/demos/AtmDemos'     
gmake: *** [AAL25] Error 2                                                     

There was same errors,when I link another program,which was very sample.
Later,I replaced the ppc_6xx-gcc with ppc_6xx-ld to link,and succeed.
But that was a very sample program,which didn't need libc.a and so on.
What is "relocation truncated to fit: R_PPC_REL24 _init"? How to fix it? thanks                               

------------------------------
我现在使用Sogou.com的2G邮箱了,你也来试试吧! 
http://mail.sogou.com/recommend/sogoumail_invite_reg1.jsp?from=sogouinvitation&s_EMAIL=zengshuai%40sogou.com&username=linuxppc-embedded&FullName=linuxppc-embedded&Email=linuxppc-embedded%40ozlabs.org&verify=755eff4e640bdcfc57d93cbd8b0a9cb7

^ permalink raw reply

* Re: Badness in dma_alloc_init
From: Kalle Pokki @ 2006-01-09 13:35 UTC (permalink / raw)
  Cc: linuxppc-embedded
In-Reply-To: <20060109125339.GA12997@oops.ghostprotocols.net>

Aristeu Sergio Rozanski Filho wrote:

>Hi!
>  
>
>>I'm having some trouble with the DMA allocation using Linux 2.6.14-rc2 + 
>>some platform modifications. Namely, the dma_alloc_coherent() function 
>>returns bogus virtual addresses causing machine check exceptions. At 
>>boot, the kernel complains there is something wrong, but I cannot figure 
>>out how to fix it. CONFIG_CONSISTENT_START is at its default value, 
>>0xff100000. Any hints where to look further?
>>
>>Oh, this is a custom 8xx board. Has the support for DMA in 8xx been 
>>unstable at the time of pre-2.6.14?
>>    
>>
>probably your IMAP_ADDR is at 0xff000000, isn't it? if it is, please adjust
>CONFIG_CONSISTENT_START to an address like 0xe0000000.
>
>  
>
True, my IMAP_ADDR is at 0xff000000. But IMAP_SIZE is just 64 KB, so 
there should be no overlap, right? Or is the IMAP memory area mapped 
with an 8-MB TLB entry or something like that?

No badness in dma-mapping.c anymore with CONFIG_CONSISTENT_START being 
0xe0000000, however. Thanks.

^ permalink raw reply

* Re: Badness in dma_alloc_init
From: Aristeu Sergio Rozanski Filho @ 2006-01-09 12:53 UTC (permalink / raw)
  To: Kalle Pokki; +Cc: linuxppc-embedded
In-Reply-To: <43C25787.4010204@iki.fi>

Hi!
> I'm having some trouble with the DMA allocation using Linux 2.6.14-rc2 + 
> some platform modifications. Namely, the dma_alloc_coherent() function 
> returns bogus virtual addresses causing machine check exceptions. At 
> boot, the kernel complains there is something wrong, but I cannot figure 
> out how to fix it. CONFIG_CONSISTENT_START is at its default value, 
> 0xff100000. Any hints where to look further?
> 
> Oh, this is a custom 8xx board. Has the support for DMA in 8xx been 
> unstable at the time of pre-2.6.14?
probably your IMAP_ADDR is at 0xff000000, isn't it? if it is, please adjust
CONFIG_CONSISTENT_START to an address like 0xe0000000.

-- 
Aristeu

^ permalink raw reply

* Re: VFS: Cannot open root device "31:03" or unknown-block(31,3)
From: Wolfgang Denk @ 2006-01-09 13:05 UTC (permalink / raw)
  To: David Jander; +Cc: HappyPhot, linuxppc-embedded
In-Reply-To: <200601090945.22564.david.jander@protonic.nl>

In message <200601090945.22564.david.jander@protonic.nl> you wrote:
>
> ELDK-3.1.1 has a glibc compiled with support of a certain version of the 
> kernel (I guess it's 2.4.xx), so newer kernels might run (because they are 

They do run.

> obviously backwards compatible), but some features of 2.6 cannot be used 
> (e.g. support for the latest syscalls, different HZ, etc...)

You can also change HZ if you like.

> A second issue is the boot procedure. If you are a beginner with linux, you'd 
> probably start booting from NFS root as it gets installed in the ELDK/ppc_xxx 
> directory. That probably won't work very well with latest 2.6 kernels (device 
> files missing, sysfs not mounted, shmfs has different name, etc...)

You can (mis-) configre  a  2.4  kernel  too.  Using  a  sane  kernel
configuration  ther  ewill  be  no  problems. We have been using ELDK
3.1.1 for a long time ourself developing 2.6 kernel code.

> > C++  programs  and  with  any version of the kernel tree (at least in
> > theory; very recent version s of the Linux kernel [ > 2.6.14]  cannot
> > be compiled with ELDK 3.1.x any more, but this is a different issue).
> 
> See what I mean? HappyPhot did just that: compile 2.6.14.2 with ELDK 3.1.1!!!

I wrote "> 2.6.14"; 2.6.14.2 is just a branch off 2.6.14 and is  fine
AFAICT.

> > The ELDK supports *any* kernel version.
> 
> Ok, let's talk about "recommended" kernel then. I would never recommend 

There is no recommended kernel version. On contrary,  we  take  great
efforts  to keep the ELDK independent of speicfic kernelk versions as
far as possible.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Quantum particles: The dreams that stuff is made of.

^ permalink raw reply

* Badness in dma_alloc_init
From: Kalle Pokki @ 2006-01-09 12:31 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all,

I'm having some trouble with the DMA allocation using Linux 2.6.14-rc2 + 
some platform modifications. Namely, the dma_alloc_coherent() function 
returns bogus virtual addresses causing machine check exceptions. At 
boot, the kernel complains there is something wrong, but I cannot figure 
out how to fix it. CONFIG_CONSISTENT_START is at its default value, 
0xff100000. Any hints where to look further?

Oh, this is a custom 8xx board. Has the support for DMA in 8xx been 
unstable at the time of pre-2.6.14?

Linux version 2.6.14-rc2 (kp@host32.eke.fi) (gcc version 4.0.0 (DENX 
ELDK 4.0 4.
0.0)) #1 Mon Jan 9 12:53:41 EET 2006
Built 1 zonelists
Kernel command line: root=/dev/mtdblock1 ro console=ttyCPM0,115200
PID hash table entries: 256 (order: 8, 4096 bytes)
Decrementer Frequency = 247500000/60
Console: colour dummy device 80x25
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 30268k available (1608k kernel code, 376k data, 100k init, 0k 
highmem)
Mount-cache hash table entries: 512
Badness in dma_alloc_init at arch/ppc/kernel/dma-mapping.c:348
Call trace: [c0003670]  [c0003f24]  [c0003320]  [c01e2ad0]  [c000228c]  
[c000551
c]

... followed by otherwise good startup.

^ permalink raw reply

* Re: io.h question
From: Arnd Bergmann @ 2006-01-09 12:39 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <1CFEB358338412458B21FAA0D78FE86D042A2F4E@rennsmail02.eu.thmulti.com>

On Monday 09 January 2006 12:16, Fillod Stephane wrote:
> You may not include the file directly from a user-land application
> program, but you may copy/paste the in_*/out_* macros, with appropriate 
> care off course.

Yes, that happens to work on some architectures, but it makes your program
not portable. Also, on some architectures you need special privileges,
e.g. i386 requires you to call iopl() first.
 
> >The correct way to solve your problem (which you did not explain, so
> >I can only guess) would be to write a kernel device driver for
> >the peripherial you want to drive, at least if it does not exist yet.
> 
> Sometimes, user-land access can make things simpler. YMMV.

Yes, that's true. I that's why I said I was only guessing ;-).
But even if I want to do the access from user space, I would
normally write a small device driver that exposes the registers
as an mmappable character device.

> >For prototyping, you can play with mmap() on /dev/mem in a user
> >application, but that is often not very reliable.
> 
> For sake of curiosity, what is not reliable in mmap'ed access
> by user application?

- Depending on your device, you may not be able to guarantee the
  correct timing for accessing the device.
- Some devices require locking to ensure you are accessing the
  registers in the right order. This breaks if you accidentally
  run your user space program more than once at a time.
- If the hardware changes with a later revision, you need to change
  your user space programs. Such changes ought to be hidden in the
  kernel.
- If your program is buggy, you might end up writing to a different
  device or memory location, which is very hard to debug.

	Arnd <><

^ permalink raw reply

* RE: io.h question
From: Fillod Stephane @ 2006-01-09 12:16 UTC (permalink / raw)
  To: linuxppc-embedded, Arnd Bergmann

Arnd Bergmann wrote:
>On Thursday 05 January 2006 21:00, mcnernbm@notes.udayton.edu wrote:
>> I finally noticed out_8 and in_8 and what not are located in the
>> ppc io.h file in the kernel development download.=A0 But when I=20
>> tried to do a io.h with in my program I added #include <asm/io.h>=A0
>> and it seems to find it with not problems but it can not find the
>> functions with in that file.=A0 Am i missing a define I need to set
>> or something so I can see the right files with in io.h I am
>> compiling for a ppc405 on a xilinx virtex 4 board.     =20
>
>The definitions in that file are only usable from inside the kernel,
>you can not use them in a user space application.

You may not include the file directly from a user-land application
program, but you may copy/paste the in_*/out_* macros, with appropriate=20
care off course.

>The correct way to solve your problem (which you did not explain, so
>I can only guess) would be to write a kernel device driver for
>the peripherial you want to drive, at least if it does not exist yet.

Sometimes, user-land access can make things simpler. YMMV.

>For prototyping, you can play with mmap() on /dev/mem in a user
>application, but that is often not very reliable.

For sake of curiosity, what is not reliable in mmap'ed access
by user application?

Regards,
--=20
Stephane

^ permalink raw reply

* Re: RESEND:[RFC] Pico E12 (Xilinx V4) patches to 2.6.15
From: David H. Lynch Jr. @ 2006-01-07  6:55 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-embedded
In-Reply-To: <43BF0736.4050703@secretlab.ca>

	I have cut out most of the patch and embedded my responses to your
comments. I appreciate your input and will try to get things cleaned up.

	I solved what I believe was my last critical porting issue, and now
have Linux on the E12 booting into sash.

	Pico has what they need for the moment, and I have two other projects
to get to. But I would like to submit what I have that might be useful
to others.
	As I see this it breaks into several major items:

	Xilinx UartLite support compliant with the 2.6 serial driver model. I
can break that into a separate patch. I can disable the debugging -
though I would prefer not to remove the code yet.
	Should I divide out the early boot part - uartlite_dbg.c and
uartlite_tty.c from the final serial driver ? I see them as belonging
together. There are very few serial devices that have boot to bash
serial support. As soon as I can figure out how to create a selective
patch I can do that. Does the UartLite stuff get submitted here or is
the a preferred place for Serial drivers ? The Uartlite is exclusively a
Xilinx item, and almost exclusively a ppc item (you can put one on a
MicroBlaze).

	Minimal Virtex-IV support. I see this as less important, you as well as
other seem to be doing it. Pico has what they need and I will conform it
to whatever makes its way into the kernel later. I would be happy to
submit it, but there probably should be only one set of V4 code, and due
to the constraints of the E12 I have an extremely minimal V4
implimentation. Also this is my first Linux port. The rest of you know
more about what you are doing.

	E12 support. Both I an Pico are glad to hear that there is even minimal
interest in including the E12 in the distribution kernel. But at the
moment Pico's clients will likely get support directly. Aside from the
benefits to my ego, the immediate value is to people doing other ports.
Benefits to Pico are long term not short term. The E12 is the first (and
smallest) of a family of devices. Right now this port is E12 specific,
but it is my expectation that it will become a generic Pico port - they
all have keyhole ports, they all use Virtex IV's.



Grant Likely wrote:
> David H. Lynch Jr. wrote:

> Your right; git uses unified by default.  You'll need to start reading
> them.  If found *lots* of stuff in this patch that shouldn't be there.

	I sort of expected that. I am used to other version controll systems,
such as cvs, subversion, sourcesafe, vault, ... where you can commit
what you want when you want, add in lots of personal or temporary
debugging changes, and then clean the out and still eaisly go back and
get them when you want.

	The model for git and I suspect bitkeeper, and kernel development in
general is completely different. I think I understand basically how git
works, but that is not the same as completely trusting that I understand
how it works.

 >>There are basically 5 parts, and I have no idea how to easily separate
>>the pieces:
> 
> Commit to your git tree frequently and commit related files at the same
> time.  Then you can bring up a list of all your commits and coalate
> related changes into a single patch.

	I appreciate the need to separate the functionality into discrete
patches. The issue - besides learning how to do that is that it does not
correspond to the way things have developed. As an example, I have been
tracing down a problem executing /init (or any initial shell).
At first I thought it was a console output problem - attempting to
isolate that resulted in the addition of an enormous amount of debugging
to the serial driver(2). hen I decided the problem had to be elsewhere
so I started adding debugging into various sys_calls - more to figure
out where I was going than anything else. Then I found I could turn on
SHOW_SYSCALLS, that lead to more debugging in the functions closet to
the actual failure, The problem turned out to be overwriting the
temporary debug IO TLB entry, and not switching to using the virtual
address created by ioremap. So now I have all this debugging all over
the place - mostly turned off. I understand that nobody wants all that
in the kernel, but although I do not need it right now,  until I am
comfortable enough with git to know I can save it, blow it away and
retreive it again later, I am not ready to part with it.

	Regardless, the bottom line is that I need to get more proficient with
git - I think I learn fairly fast, but there is alot to digest.

	My apologies for having to digest that massive diff.

> 
> BTW, many of the long lines were word wrapped (making an unusable
> patch).  You should attach the diff instead of pasting it into thunderbird.
	I thought I did. But I have computer issues at the moment. My primary
development laptop died. My backup laptop started dying, and I am now
working on a desktop that I just built a week ago. I have re-installed
thunderbird and firefox, and linux, and windows (I have paying windows
clients) too many times over the past month. I thought I migrated my
thunderbird profile correctly, but I keep noticing that attachements end
up either inline or separate seemingly at random.
	It would be really nice if I could spend alot less time working on
equipemnt and more on programming. I have to get back to a laptop anyway
- or get bifocals, but I am trying to pretend I am not old enough to
need them yet.

>> 	prompt "Processor Type"
>>-	default 6xx
>>+	default 4xx
> 
> You don't want to do this... Your defconfig file should set it instead.

	I only just recently saw some info on utilizing defconfig files - I
beleive in another of your posts. One of the problems with not knowing
how others do things is that you re-invent the wheel.
	
	Regardles, I do understand.
		Figure out how to break the patches up into logical peices.
		Figure out how to exclude what are essentially private convenience or
debugging changes from submitted patches.




>>+#ifdef CONFIG_XILINX_UARTLITE_CONSOLE
>>+#LIBS				+= $(TOPDIR)/drivers/char/xilinx_uartlite/xuartlite_l.o
>>+#endif
>>+# ifeq ($(CONFIG_XILINX_ML300),y)
>>+# CFLAGS_xuartlite_tty.o		+= -I$(TOPDIR)/drivers/char/xilinx_uartlite
>>+# EXTRA_CFLAGS			+= -I$(TOPDIR)/arch/ppc/platforms/xilinx_ocp \
>>+# 					-I$(TOPDIR)/drivers/i2c/xilinx_iic
>>+# endif
> 
> 
> Wrong place for this; should be done in:
> drivers/char/xilinx_uartlite/Makefile

	Actually it is commented out and does not belong at all. I breifly
toyed with trying to port the xilinx 2.4 serial drivers to 2.6, and this
represents an early attempt at merging them into the 2.6 tree.
I am still learning proficiency with the configuration/makefile language
of kernel building, and this was an early attempt to migrate the 2.4 stuff.
	At present I am not using the Xilinx UartLite driver. I have a newer
one of my own that was in this patch, and as of a few days ago it
appears to be working.


>> start_:
>>+#if defined(CONFIG_XILINX_ML300) || defined(CONFIG_PICO_E12) /* PPC
>>errata 213: only for Virtex-4 */
>>+	mfccr0	0
>>+	oris	0,0,0x50000000@h
>>+	mtccr0	0
>>+#endif
> 
> 
> ML300 doesn't have this issue.

	I don't have an ML300 or any other Xilinx development board. I borrowed
this from somebody else's code for the ML300.
	I am assuming this should change to defined(CONFIG_VIRTEX_IV) ?

>>+static int MillisecTimeout=1000;
>>+void usleep(int t) {
>>+   int ii, waitTime=100;
>>+    while(t) {
>>+    	for (ii=0; ii < MillisecTimeout*1000/waitTime; ii++){};
>>+	t--;
>>+    }
>>+}
> 
> 
> umm, isn't udelay already defined in the kernel?

	Probably is, and I probably should be using it, but I started with
working code to write to the device standalone, and incorporated it into
the driver. The same code is repeated in the boot serial code - but
there I do not have access to kernel resources.




>>@@ -180,11 +192,16 @@ load_kernel(unsigned long load_addr, int
>> #ifdef CONFIG_CMDLINE_BOOL
>> 	memcpy (cmd_line, compiled_string, sizeof(compiled_string));
>> #else
>>+// INITRAMFS and initrd should be handled the same.
>>+#ifdef CONFIG_INITRAMFS_SOURCE
>>+	memcpy (cmd_line, ramroot_string, sizeof(ramroot_string));
>>+#else
>> 	if ( initrd_size )
>> 		memcpy (cmd_line, ramroot_string, sizeof(ramroot_string));
>> 	else
>> 		memcpy (cmd_line, netroot_string, sizeof(netroot_string));
>> #endif
>>+#endif
> 
> why?
	I think this is a fix for a 2.6/INITRAMFS bug.
	If you use initramfs
		but do not turn on CONFIG_INITRD
		and you do not provide a command line
			(either in the config file,
			or via a boot argument)
	then you get the netroot_string command line

	Which is NOT what you want for INITRAMFS.

	I am sure there is a better way of coding this.
	This was just a quick and dirty solution that got cut in
	when I turned off a config file command line and suddenly discovered I
was trying to boot off the net.








> 
> 
> 
> <--- snip --->
> 
>>diff --git a/arch/ppc/boot/simple/uartlite_tty.c
>>b/arch/ppc/boot/simple/uartlite_tty.c
> 
> 
> Russell King needs to be CC'd on serial stuff; but looks okay from a
> real-quick look
	The uartlite_dbg.c uartlite_tty.c, keyhole_dbg.c, keyhole_dbg.c code
and the CONFIG's controlling them, and the #ifdef's through the boot
code dealing with them are all working fine and have been for atleast
two months. The keyhole_early.c and uartlite_early.c code, once worked,
but when I dicoverd that I could switch pretty much directly from the
reall early stuff to the final serial driver without the _early stuff I
quit work on it, so I probably should discard it.
	I can not tell what use xxxx_early is if there is an xxxx_dbg and xxx_tty.




> This stuff all conflicts with my patches of course; but that's to be
> expected.  :)  Looks okay otherwise

	I will try to pull and apply your patches and see if I can rework things.


> this is just a copy of xilinx_ml300 and modified for the e12; I didn't
> look deep into it; but seems okay.
	Correct, it seems to be working, that is what I care about.
	There are obviously significant similarities. The most fundimental
issue, is that the only certain hardware with the E12 is the PPC405, the
MMU, and the Keyhole (and maybe not that) The PIC, the NIC, almost
everything else may or may not be there.
	Pico has just provided me with new firmware that includes a PIC, but
that is for a specific client application where it is required. I have
to have something that can build with or without it.


>>diff --git a/arch/ppc/syslib/keyhole.h b/arch/ppc/syslib/keyhole.h
>>new file mode 100644
>>index 0000000..4b7a374
>>--- /dev/null
>>+++ b/arch/ppc/syslib/keyhole.h
>>@@ -0,0 +1,17 @@
>>+/*
>>+ * arch/ppc/syslib/keyhole.h
>>+ *
>>+ * keyhole prototypes
>>+ *
>>+ * Matt Porter <mporter@kernel.crashing.org>
> 
> 
> You can add your name to the copyright list.
	The majority of my code started with something borrowed. I have done
very little with the headers yet to make sure credit and blame are
appropriately assigned.

	I found the references in Documentation, and have to make a pass
through to pic those things up.



> 
>>+++ b/arch/ppc/syslib/keyhole_dbg.c
>>@@ -0,0 +1,148 @@
>>+/*
>>+ * arch/ppc/syslib/keyhole_dbg.c
>>+ *
>>+ * Bootloader version of the embedded Xilinx/KEYHOLE driver.
>>+ *
>>+ * Author: David H. Lynch Jr. <dhlii@dlasys.net>
>>+ *
>>+ * 2005 (c) DLA Systems  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.
>>+ */
>>+
>>+#include <linux/config.h>
>>+#include <linux/serial_keyhole.h>
>>+#include <linux/serial.h>
>>+#include <linux/tty.h>		/* For linux/serial_core.h */
>>+#include <linux/serial_core.h>
>>+#include <linux/serialP.h>
>>+// #include <linux/serial_reg.h>
>>+#include <asm/serial.h>
>>+
>>+
>>+/* SERIAL_PORT_DFNS is defined in <asm/serial.h> */
>>+#ifndef SERIAL_PORT_DFNS
>>+#define SERIAL_PORT_DFNS
>>+#endif
>>+
>>+static struct serial_state rs_table[RS_TABLE_SIZE] = {
>>+	SERIAL_PORT_DFNS	/* defined in <asm/serial.h> */
>>+};
>>+static int MillisecTimeout=1000;
>>+void usleep(int t) {
>>+   int ii, waitTime=100;
>>+    while(t) {
>>+    	for (ii=0; ii < MillisecTimeout*1000/waitTime; ii++){};
>>+	t--;
>>+    }
>>+}
> 
> 
> again; what about udelay?
	I beleive this is either before there is a kernel, or certainly before
the kernel is initialized.

>>+#if defined(CONFIG_PICO_DEBUG)
>>+#define DEBUG_PRINTK(fmt...)	_printk(fmt)
>>+#else
>>+#define DEBUG_PRINTK(fmt...)	do { } while (0)
>>+#endif
>>+#define _printk printk
> 
> 
> The code cleanliness police will probably have something to say about
> you defining your own debug macros.  :)

	I sort of stole these from elsewhere. Further, they do not appear to
always work - but the style guide suguested macros were preferred to
#ifdef's.
	 I guess if you do not like this you are really going to appreciate my
private copy of _printk.
	It is time for it to go away, but it was really useful having a
different and working output device while debugging the serial driver.
	It is unnescacry now.



>>+pico/cross
>>\ No newline at end of file
> 
> 
> ???
	I noticed that too. I have no idea what git diff was talking about.

>>diff --git a/drivers/serial/keyhole.c b/drivers/serial/keyhole.c
>>diff --git a/drivers/serial/keyhole.h b/drivers/serial/keyhole.h
> 
> 
> I didn't review these; sorry
	It does not matter they were close but did not work in the version I
sent to you. They are fixed now.

	The E12 uses its unique KEYHOLE fifo (that eventually will support
multiple ttyS's as well as other communications channels to the
Linux/Windows development host.
	For the moment the only thing that works is using that fifo as a
pseudo serial device for a console or debugging. But it does work.

	The UartLite drivers and the Keyhole drivers are deliberately as nearly
identical as possible. They in turn borrowed heavily from the m32r_sio
driver (for simple answers) and the 8250 driver - because as complex as
it is I assumed it is likely to be the most heavily tested serial driver
in Linux.

>>diff --git a/drivers/serial/printk.c b/drivers/serial/printk.c
>>new file mode 100644
>>index 0000000..5e87489
>>--- /dev/null
>>+++ b/drivers/serial/printk.c
>>@@ -0,0 +1,267 @@
>>+/*
>>+ * arch/ppc/kernel/printf.c
>>+ *
>>+ * early printk code code (almost) all platforms can use
>>+ *
>>+ * Author: David H. Lynch Jr. <dhlii@dlasys.net>
>>+ *
>>+ * Derived heavily from arch/ppc/boot/common/misc-common1.c
>>+ *
>>+ * 20050 (c) DLA Systems 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.
>>+ */
> 
> You'll need to run this stuff by Tom Rini.

	It was solely for debugging. It works well, but it does not need to be
in the kernel.

	Speaking of which. At this point the Keyhole and Uartlite drivers
actually work and are at what I would call an early beta/late alpha
stage. I have debugging disabled but not removed. I am not likely to
remove it until they have had a lot more testing.

	Probably the most broadly useful part of this massive patch it the
UartLite driver - it should work on any Xilinx FPGA implementing the
UartLite. (including uCLinux on the MicroBlaze) I think it is a perfect
candidate for a separate patch.

	I can submit it now - with all the debugging in (but disabled), or
after it has had a month or so of testing at Pico, without debugging.

	The same thing is true of the Keyhole - but it is not broadly useful.
	The E12 stuff is also just about ready for early beta testing, but Pico
already knows who has their board and wants Linux. So except as it might
be useful to others porting to the Virtex IV, I am not sure that needs
pushed.








>> #ifdef CONFIG_40x
>>diff --git a/include/asm-ppc/ocp_ids.h b/include/asm-ppc/ocp_ids.h
>>index 8ae4b31..5a09b94 100644
>>--- a/include/asm-ppc/ocp_ids.h
>>+++ b/include/asm-ppc/ocp_ids.h
>>@@ -27,6 +27,7 @@
>> #define OCP_VENDOR_IBM		0x1014
>> #define OCP_VENDOR_MOTOROLA	OCP_VENDOR_FREESCALE
>> #define	OCP_VENDOR_XILINX	0x10ee
>>+#define	OCP_VENDOR_PICO 	0x10ef				// pseudo ID
>> #define	OCP_VENDOR_UNKNOWN	0xFFFF
	I was hoping for some feedback on OCP_VENDOR_PICO ?

	Is there an official place to register/assign these ?


>>
>> /* device identification */
>>diff --git a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h
>>index 00ad9c7..5221970 100644
>>--- a/include/asm-ppc/reg_booke.h
>>+++ b/include/asm-ppc/reg_booke.h
>>@@ -120,6 +120,11 @@ do {						\
>> #elif defined(CONFIG_BOOKE)
>> #define MSR_KERNEL	(MSR_ME|MSR_RI|MSR_CE)
>> #endif
>>+#if defined (CONFIG_PICO_E12)
>>+// The E12 seems to generate spurious Machine Checks - disable them.
>>+#undef MSR_KERNEL
>>+#define MSR_KERNEL	(MSR_RI|MSR_IR|MSR_DR|MSR_CE)
>>+#endif
> 
> 
> Ugh; this worries me.

	Most of the work of porting Linux to the E12 took about 1 week.
	Tracking this down took three weeks all by itself.
	
	Pico swears that the Machine Check line is not just dangling in space.
But if I turn on Machine Check Exceptions, I never get from Real to
virtual mode. There is an enormous amount of code you tripped over in
head_4xx.S that was primarily to find this problem.

	I do not know what to say here. I do not like this either.
The original E12 firmware had the flash at 0x0 and the ram at 0x8000000
or something like that. My personal suspicion is that when they
re-arranged the memory map to org 0 the ram, they did not get something
right and even though everything else is working, it is causing machine
checks- but that is just a guess. I am not part of Pico. I am a
consultant for them. I have a very close relationship and the respect of
the owner, but he is both brilliant and stubborn and if there is an
actual hardware problem it is not going to get fixed until something
else reveals it. In the meantime disabling Machine Checks allowed me to
finish the port.


>
> 
> 
> Ugh! I'm not doing that again.  Make sure your next patch set is broken
> up into bite size emails.  That was far too long.
> 
> g.
> 

	Thank You.

^ permalink raw reply

* Re: VFS: Cannot open root device "31:03" or unknown-block(31,3)
From: David Jander @ 2006-01-09  8:45 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: HappyPhot, linuxppc-embedded
In-Reply-To: <20060106150854.918FF353A43@atlas.denx.de>

On Friday 06 January 2006 16:08, Wolfgang Denk wrote:
> This is a serious misunderstanding. There is no  such  thing  like  a
> specific kernel version which is supported by the ELDK.

True, but not entirely.
ELDK-3.1.1 has a glibc compiled with support of a certain version of the 
kernel (I guess it's 2.4.xx), so newer kernels might run (because they are 
obviously backwards compatible), but some features of 2.6 cannot be used 
(e.g. support for the latest syscalls, different HZ, etc...)

A second issue is the boot procedure. If you are a beginner with linux, you'd 
probably start booting from NFS root as it gets installed in the ELDK/ppc_xxx 
directory. That probably won't work very well with latest 2.6 kernels (device 
files missing, sysfs not mounted, shmfs has different name, etc...)

A third issue is the compiler issue. Some newer kernels might not compile 
correctly anymore with older compilers.

These three things are what I meant with "supported" or "not supported".

> The ELDK is primarily a *toolkit* which works with  arbitrary  C  and
> C++  programs  and  with  any version of the kernel tree (at least in
> theory; very recent version s of the Linux kernel [ > 2.6.14]  cannot
> be compiled with ELDK 3.1.x any more, but this is a different issue).

See what I mean? HappyPhot did just that: compile 2.6.14.2 with ELDK 3.1.1!!!

> > >   Do you know where to get the infomation about which kernel version it
> > > supports?
>
> The ELDK supports *any* kernel version.

Ok, let's talk about "recommended" kernel then. I would never recommend 
someone unexperienced to start with a combination of ELDK-3.1.1 and kernel 
2.6.xx.

> > The one that comes with that version of ELDK? Just a guess ;-)
>
> Wrong guess.

But it'd still be the one with most chances of success unless there are known 
problems with that kernel on a Sandpoint board.

Greetings,

-- 
David Jander
Protonic Holland.

^ permalink raw reply

* [PATCH 00/10] Xilinx Virtex-* updates
From: grant.likely @ 2006-01-09  8:32 UTC (permalink / raw)
  To: glikely, mporter, linuxppc-embedded, gnathita, dhlii

Here's a repost of my Xilinx ML300 and ML403 patches with a few
cleanups, a bit of patch reordering, and rebased to 2.6.15.

Changes:
 - Remove xparameters.h as a dependancy to most of the kernel tree
 - Rework Virtex-II Pro support to be generic for Virtex-4 also
 - Move serial drivers from the OCP bus to the platform bus
 - Modify ML300 to use platform bus
 - Add support for ML403
 - Add ML300 & ML403 defconfigs

I've tested on an ML403
Can someone test on an ML300?  (I no longer have one)

Cheers,
g.

^ permalink raw reply

* [PATCH 07/10] Add support for Xilinx ML403 reference design
From: grant.likely @ 2006-01-09  8:33 UTC (permalink / raw)
  To: glikely, mporter, linuxppc-embedded, gnathita, dhlii
In-Reply-To: <11367955793438-git-send-email-grant.likely@secretlab.ca>

Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>

---

 arch/ppc/boot/simple/embed_config.c              |   43 +++++
 arch/ppc/platforms/4xx/Kconfig                   |    8 +
 arch/ppc/platforms/4xx/Makefile                  |    2 
 arch/ppc/platforms/4xx/xilinx_ml403.c            |  177 ++++++++++++++++++++++
 arch/ppc/platforms/4xx/xilinx_ml403.h            |   49 ++++++
 arch/ppc/platforms/4xx/xparameters/xparameters.h |   13 ++
 include/asm-ppc/ibm4xx.h                         |    4 
 7 files changed, 293 insertions(+), 3 deletions(-)
 create mode 100644 arch/ppc/platforms/4xx/xilinx_ml403.c
 create mode 100644 arch/ppc/platforms/4xx/xilinx_ml403.h

d8ec1973726dba317a7212ddbd0299fe459270e0
diff --git a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
index df24202..32c7132 100644
--- a/arch/ppc/boot/simple/embed_config.c
+++ b/arch/ppc/boot/simple/embed_config.c
@@ -745,7 +745,7 @@ embed_config(bd_t **bdp)
 }
 #endif /* WILLOW */
 
-#ifdef CONFIG_XILINX_ML300
+#if defined(CONFIG_XILINX_ML300)
 void
 embed_config(bd_t ** bdp)
 {
@@ -784,6 +784,47 @@ embed_config(bd_t ** bdp)
 }
 #endif /* CONFIG_XILINX_ML300 */
 
+#if defined(CONFIG_XILINX_ML403)
+void
+embed_config(bd_t ** bdp)
+{
+	static const unsigned long line_size = 32;
+	static const unsigned long congruence_classes = 256;
+	unsigned long addr;
+	unsigned long dccr;
+	bd_t *bd;
+
+	/*
+	 * Invalidate the data cache if the data cache is turned off.
+	 * - The 405 core does not invalidate the data cache on power-up
+	 *   or reset but does turn off the data cache. We cannot assume
+	 *   that the cache contents are valid.
+	 * - If the data cache is turned on this must have been done by
+	 *   a bootloader and we assume that the cache contents are
+	 *   valid.
+	 */
+	__asm__("mfdccr %0": "=r" (dccr));
+	if (dccr == 0) {
+		for (addr = 0;
+		     addr < (congruence_classes * line_size);
+		     addr += line_size) {
+			__asm__("dccci 0,%0": :"b"(addr));
+		}
+	}
+
+	bd = &bdinfo;
+	*bdp = bd;
+	bd->bi_memsize = 64 * 1024 * 1024; /* ML403 has 64 MB of RAM */
+            /* Note, memsize does NOT == XPAR_PLB_DDR_0_MEM0_HIGHADDR+1,
+             * memory controller window is larger than actual mem size */
+	bd->bi_intfreq = XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ;
+	bd->bi_busfreq = XPAR_XUARTNS550_CLOCK_HZ;
+	bd->bi_pci_busfreq = 0;
+	timebase_period_ns = 1000000000 / bd->bi_tbfreq;
+	/* see bi_tbfreq definition in arch/ppc/platforms/4xx/xilinx_ml300.h */
+}
+#endif /* CONFIG_XILINX_ML403 */
+
 #ifdef CONFIG_IBM_OPENBIOS
 /* This could possibly work for all treeboot roms.
 */
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index cbb90fc..48def71 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -57,6 +57,10 @@ config XILINX_ML300
 	help
 	  This option enables support for the Xilinx ML300 evaluation board.
 
+config XILINX_ML403
+	bool "Xilinx-ML403"
+	help
+	  This option enables support for the Xilinx ML403 evaluation board.
 endchoice
 
 choice
@@ -205,7 +209,7 @@ config 405GPR
 
 config XILINX_VIRTEX
 	bool
-	depends on XILINX_ML300
+	depends on XILINX_ML300 || XILINX_ML403
 	default y
 
 config STB03xxx
@@ -215,7 +219,7 @@ config STB03xxx
 
 config EMBEDDEDBOOT
 	bool
-	depends on EP405 || XILINX_ML300
+	depends on EP405 || XILINX_ML300 || XILINX_ML403
 	default y
 
 config IBM_OPENBIOS
diff --git a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile
index be4163c..a04a0d0 100644
--- a/arch/ppc/platforms/4xx/Makefile
+++ b/arch/ppc/platforms/4xx/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_REDWOOD_6)		+= redwood6.o
 obj-$(CONFIG_SYCAMORE)		+= sycamore.o
 obj-$(CONFIG_WALNUT)		+= walnut.o
 obj-$(CONFIG_XILINX_ML300)	+= xilinx_ml300.o
+obj-$(CONFIG_XILINX_ML403)	+= xilinx_ml403.o
 
 obj-$(CONFIG_405GP)		+= ibm405gp.o
 obj-$(CONFIG_REDWOOD_5)		+= ibmstb4.o
@@ -27,3 +28,4 @@ obj-$(CONFIG_440SPE)		+= ppc440spe.o
 obj-$(CONFIG_405EP)		+= ibm405ep.o
 obj-$(CONFIG_405GPR)		+= ibm405gpr.o
 obj-$(CONFIG_XILINX_VIRTEX)	+= virtex.o
+
diff --git a/arch/ppc/platforms/4xx/xilinx_ml403.c b/arch/ppc/platforms/4xx/xilinx_ml403.c
new file mode 100644
index 0000000..4c0c7e4
--- /dev/null
+++ b/arch/ppc/platforms/4xx/xilinx_ml403.c
@@ -0,0 +1,177 @@
+/*
+ * arch/ppc/platforms/4xx/xilinx_ml403.c
+ *
+ * Xilinx ML403 evaluation board initialization
+ *
+ * Author: Grant Likely <grant.likely@secretlab.ca>
+ *
+ * 2005 (c) Secret Lab Technologies Ltd.
+ * 2002-2004 (c) MontaVista Software, Inc.
+ *
+ * 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.
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/tty.h>
+#include <linux/serial.h>
+#include <linux/serial_core.h>
+#include <linux/serial_8250.h>
+#include <linux/serialP.h>
+#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/ppc_sys.h>
+
+#include <syslib/gen550.h>
+#include <platforms/4xx/xparameters/xparameters.h>
+
+/*
+ * As an overview of how the following functions (platform_init,
+ * ml403_map_io, ml403_setup_arch and ml403_init_IRQ) fit into the
+ * kernel startup procedure, here's a call tree:
+ *
+ * start_here					arch/ppc/kernel/head_4xx.S
+ *  early_init					arch/ppc/kernel/setup.c
+ *  machine_init				arch/ppc/kernel/setup.c
+ *    platform_init				this file
+ *      ppc4xx_init				arch/ppc/syslib/ppc4xx_setup.c
+ *        parse_bootinfo
+ *          find_bootinfo
+ *        "setup some default ppc_md pointers"
+ *  MMU_init					arch/ppc/mm/init.c
+ *    *ppc_md.setup_io_mappings == ml403_map_io	this file
+ *      ppc4xx_map_io				arch/ppc/syslib/ppc4xx_setup.c
+ *  start_kernel				init/main.c
+ *    setup_arch				arch/ppc/kernel/setup.c
+ * #if defined(CONFIG_KGDB)
+ *      *ppc_md.kgdb_map_scc() == gen550_kgdb_map_scc
+ * #endif
+ *      *ppc_md.setup_arch == ml403_setup_arch	this file
+ *        ppc4xx_setup_arch			arch/ppc/syslib/ppc4xx_setup.c
+ *          ppc4xx_find_bridges			arch/ppc/syslib/ppc405_pci.c
+ *    init_IRQ					arch/ppc/kernel/irq.c
+ *      *ppc_md.init_IRQ == ml403_init_IRQ	this file
+ *        ppc4xx_init_IRQ			arch/ppc/syslib/ppc4xx_setup.c
+ *          ppc4xx_pic_init			arch/ppc/syslib/xilinx_pic.c
+ */
+
+/* Board specifications structures */
+struct ppc_sys_spec *cur_ppc_sys_spec;
+struct ppc_sys_spec ppc_sys_specs[] = {
+	{
+		/* Only one entry, always assume the same design */
+		.ppc_sys_name	= "Xilinx ML403 Reference Design",
+		.mask 		= 0x00000000,
+		.value 		= 0x00000000,
+		.num_devices	= 1,
+		.device_list	= (enum ppc_sys_devices[])
+		{
+			VIRTEX_UART,
+		},
+	},
+};
+
+#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
+
+static volatile unsigned *powerdown_base =
+    (volatile unsigned *) XPAR_POWER_0_POWERDOWN_BASEADDR;
+
+static void
+xilinx_power_off(void)
+{
+	local_irq_disable();
+	out_be32(powerdown_base, XPAR_POWER_0_POWERDOWN_VALUE);
+	while (1) ;
+}
+#endif
+
+void __init
+ml403_map_io(void)
+{
+	ppc4xx_map_io();
+
+#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
+	powerdown_base = ioremap((unsigned long) powerdown_base,
+				 XPAR_POWER_0_POWERDOWN_HIGHADDR -
+				 XPAR_POWER_0_POWERDOWN_BASEADDR + 1);
+#endif
+}
+
+/* Early serial support functions */
+static void __init
+ml403_early_serial_init(int num, struct plat_serial8250_port *pdata)
+{
+#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
+	struct uart_port serial_req;
+
+	memset(&serial_req, 0, sizeof(serial_req));
+	serial_req.mapbase	= pdata->mapbase;
+	serial_req.membase	= pdata->membase;
+	serial_req.irq		= pdata->irq;
+	serial_req.uartclk	= pdata->uartclk;
+	serial_req.regshift	= pdata->regshift;
+	serial_req.iotype	= pdata->iotype;
+	serial_req.flags	= pdata->flags;
+	gen550_init(num, &serial_req);
+#endif
+}
+
+void __init
+ml403_early_serial_map(void)
+{
+#ifdef CONFIG_SERIAL_8250
+	struct plat_serial8250_port *pdata;
+	int i = 0;
+
+	pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(VIRTEX_UART);
+	while(pdata && pdata->flags)
+	{
+		pdata->membase = ioremap(pdata->mapbase, 0x100);
+		ml403_early_serial_init(i, pdata);
+		pdata++;
+		i++;
+	}
+#endif /* CONFIG_SERIAL_8250 */
+}
+
+void __init
+ml403_setup_arch(void)
+{
+	ml403_early_serial_map();
+	ppc4xx_setup_arch();	/* calls ppc4xx_find_bridges() */
+
+	/* Identify the system */
+	printk(KERN_INFO "Xilinx ML403 Reference System (Virtex-4 FX)\n");
+}
+
+/* Called after board_setup_irq from ppc4xx_init_IRQ(). */
+void __init
+ml403_init_irq(void)
+{
+	ppc4xx_init_IRQ();
+}
+
+void __init
+platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+	      unsigned long r6, unsigned long r7)
+{
+	ppc4xx_init(r3, r4, r5, r6, r7);
+
+	identify_ppc_sys_by_id(mfspr(SPRN_PVR));
+
+	ppc_md.setup_arch = ml403_setup_arch;
+	ppc_md.setup_io_mappings = ml403_map_io;
+	ppc_md.init_IRQ = ml403_init_irq;
+
+#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
+	ppc_md.power_off = xilinx_power_off;
+#endif
+
+#ifdef CONFIG_KGDB
+	ppc_md.early_serial_map = ml403_early_serial_map;
+#endif
+}
+
diff --git a/arch/ppc/platforms/4xx/xilinx_ml403.h b/arch/ppc/platforms/4xx/xilinx_ml403.h
new file mode 100644
index 0000000..4735969
--- /dev/null
+++ b/arch/ppc/platforms/4xx/xilinx_ml403.h
@@ -0,0 +1,49 @@
+/*
+ * arch/ppc/platforms/4xx/xilinx_ml403.h
+ *
+ * Include file that defines the Xilinx ML403 reference design
+ *
+ * Author: Grant Likely <grant.likely@secretlab.ca>
+ *
+ * 2005 (c) Secret Lab Technologies Ltd.
+ * 2002-2004 (c) MontaVista Software, Inc.
+ *
+ * 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.
+ */
+
+#ifdef __KERNEL__
+#ifndef __ASM_XILINX_ML403_H__
+#define __ASM_XILINX_ML403_H__
+
+/* ML403 has a Xilinx Virtex-4 FPGA with a PPC405 hard core */
+#include <platforms/4xx/virtex.h>
+
+#ifndef __ASSEMBLY__
+
+#include <linux/types.h>
+
+typedef struct board_info {
+	unsigned int	 bi_memsize;		/* DRAM installed, in bytes */
+	unsigned char	 bi_enetaddr[6];	/* Local Ethernet MAC address */
+	unsigned int	 bi_intfreq;		/* Processor speed, in Hz */
+	unsigned int	 bi_busfreq;		/* PLB Bus speed, in Hz */
+	unsigned int	 bi_pci_busfreq;	/* PCI Bus speed, in Hz */
+} bd_t;
+
+/* Some 4xx parts use a different timebase frequency from the internal clock.
+*/
+#define bi_tbfreq bi_intfreq
+
+#endif /* !__ASSEMBLY__ */
+
+/* We don't need anything mapped.  Size of zero will accomplish that. */
+#define PPC4xx_ONB_IO_PADDR	0u
+#define PPC4xx_ONB_IO_VADDR	0u
+#define PPC4xx_ONB_IO_SIZE	0u
+
+#define PPC4xx_MACHINE_NAME "Xilinx ML403 Reference Design"
+
+#endif /* __ASM_XILINX_ML403_H__ */
+#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/xparameters/xparameters.h b/arch/ppc/platforms/4xx/xparameters/xparameters.h
index 26ee822..22b0088 100644
--- a/arch/ppc/platforms/4xx/xparameters/xparameters.h
+++ b/arch/ppc/platforms/4xx/xparameters/xparameters.h
@@ -32,6 +32,19 @@
   #define VIRTEX_INTC_BASEADDR           XPAR_DCR_INTC_0_BASEADDR
   #define VIRTEX_INTC_KIND_OF_INTR       XPAR_DCR_INTC_0_KIND_OF_INTR
 
+#elif defined(CONFIG_XILINX_ML403)
+  #include "xparameters_ml403.h"
+
+  /* Serial ports */
+  #define VIRTEX_UART_0_BASEADDR  (XPAR_OPB_UART16550_0_BASEADDR + 0x1000)
+  #define VIRTEX_UART_0_IRQ  XPAR_OPB_INTC_0_OPB_UART16550_0_IP2INTC_IRPT_INTR
+  #define VIRTEX_UART_0_CLK  XPAR_XUARTNS550_CLOCK_HZ
+
+  /* Values for setting up interrupt controller */
+  #define VIRTEX_XINTC_USE_DCR           XPAR_XINTC_USE_DCR
+  #define VIRTEX_INTC_BASEADDR           XPAR_OPB_INTC_0_BASEADDR
+  #define VIRTEX_INTC_KIND_OF_INTR       XPAR_OPB_INTC_0_KIND_OF_INTR
+
 #else
   /* Add other board xparameter includes here before the #else */
   #error No *_xparameters.h file included
diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h
index 6c28ae7..38f9971 100644
--- a/include/asm-ppc/ibm4xx.h
+++ b/include/asm-ppc/ibm4xx.h
@@ -51,6 +51,10 @@
 #include <platforms/4xx/xilinx_ml300.h>
 #endif
 
+#if defined(CONFIG_XILINX_ML403)
+#include <platforms/4xx/xilinx_ml403.h>
+#endif
+
 #ifndef __ASSEMBLY__
 
 #ifdef CONFIG_40x
-- 
1.0.6-g58e3

^ permalink raw reply related

* [PATCH 05/10] Add Virtex-4 FX to cpu table
From: grant.likely @ 2006-01-09  8:33 UTC (permalink / raw)
  To: glikely, mporter, linuxppc-embedded, gnathita, dhlii
In-Reply-To: <11367955793438-git-send-email-grant.likely@secretlab.ca>

Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>

---

 arch/powerpc/kernel/cputable.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

d088bba0280dacb277ec257287a83fec30b6be28
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 1d85ced..3992c42 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -829,7 +829,7 @@ struct cpu_spec	cpu_specs[] = {
 		.dcache_bsize		= 32,
 	},
 	{	/* Xilinx Virtex-II Pro  */
-		.pvr_mask		= 0xffff0000,
+		.pvr_mask		= 0xfffff000,
 		.pvr_value		= 0x20010000,
 		.cpu_name		= "Virtex-II Pro",
 		.cpu_features		= CPU_FTRS_40X,
@@ -838,6 +838,16 @@ struct cpu_spec	cpu_specs[] = {
 		.icache_bsize		= 32,
 		.dcache_bsize		= 32,
 	},
+	{	/* Xilinx Virtex-4 FX */
+		.pvr_mask		= 0xfffff000,
+		.pvr_value		= 0x20011000,
+		.cpu_name		= "Virtex-4 FX",
+		.cpu_features		= CPU_FTRS_40X,
+		.cpu_user_features	= PPC_FEATURE_32 |
+			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
+		.icache_bsize		= 32,
+		.dcache_bsize		= 32,
+	},
 	{	/* 405EP */
 		.pvr_mask		= 0xffff0000,
 		.pvr_value		= 0x51210000,
-- 
1.0.6-g58e3

^ permalink raw reply related

* [PATCH 04/10] Migrate ML300 reference design to the platform bus
From: grant.likely @ 2006-01-09  8:33 UTC (permalink / raw)
  To: glikely, mporter, linuxppc-embedded, gnathita, dhlii
In-Reply-To: <11367955793438-git-send-email-grant.likely@secretlab.ca>

Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>

---

 arch/ppc/Kconfig.debug                |    2 -
 arch/ppc/platforms/4xx/xilinx_ml300.c |   74 +++++++++++++++++++++++----------
 arch/ppc/platforms/4xx/xilinx_ml300.h |    2 -
 arch/ppc/syslib/Makefile              |    2 -
 arch/ppc/syslib/xilinx_pic.c          |   10 ++--
 5 files changed, 60 insertions(+), 30 deletions(-)

bce11184ffbbcf099d49b6f3764afd842cf891ab
diff --git a/arch/ppc/Kconfig.debug b/arch/ppc/Kconfig.debug
index 61653cb..8cc75ab 100644
--- a/arch/ppc/Kconfig.debug
+++ b/arch/ppc/Kconfig.debug
@@ -67,7 +67,7 @@ config SERIAL_TEXT_DEBUG
 
 config PPC_OCP
 	bool
-	depends on IBM_OCP || XILINX_OCP
+	depends on IBM_OCP
 	default y
 
 endmenu
diff --git a/arch/ppc/platforms/4xx/xilinx_ml300.c b/arch/ppc/platforms/4xx/xilinx_ml300.c
index b0de0a2..267afb5 100644
--- a/arch/ppc/platforms/4xx/xilinx_ml300.c
+++ b/arch/ppc/platforms/4xx/xilinx_ml300.c
@@ -17,12 +17,14 @@
 #include <linux/tty.h>
 #include <linux/serial.h>
 #include <linux/serial_core.h>
+#include <linux/serial_8250.h>
 #include <linux/serialP.h>
 #include <asm/io.h>
 #include <asm/machdep.h>
-#include <asm/ocp.h>
+#include <asm/ppc_sys.h>
 
-#include <platforms/4xx/virtex.h>	/* for NR_SER_PORTS */
+#include <syslib/gen550.h>
+#include <platforms/4xx/xparameters/xparameters.h>
 
 /*
  * As an overview of how the following functions (platform_init,
@@ -54,6 +56,22 @@
  *          ppc4xx_pic_init			arch/ppc/syslib/xilinx_pic.c
  */
 
+/* Board specifications structures */
+struct ppc_sys_spec *cur_ppc_sys_spec;
+struct ppc_sys_spec ppc_sys_specs[] = {
+	{
+		/* Only one entry, always assume the same design */
+		.ppc_sys_name	= "Xilinx ML300 Reference Design",
+		.mask 		= 0x00000000,
+		.value 		= 0x00000000,
+		.num_devices	= 1,
+		.device_list	= (enum ppc_sys_devices[])
+		{
+			VIRTEX_UART,
+		},
+	},
+};
+
 #if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
 
 static volatile unsigned *powerdown_base =
@@ -80,28 +98,39 @@ ml300_map_io(void)
 #endif
 }
 
+/* Early serial support functions */
 static void __init
+ml300_early_serial_init(int num, struct plat_serial8250_port *pdata)
+{
+#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
+	struct uart_port serial_req;
+
+	memset(&serial_req, 0, sizeof(serial_req));
+	serial_req.mapbase	= pdata->mapbase;
+	serial_req.membase	= pdata->membase;
+	serial_req.irq		= pdata->irq;
+	serial_req.uartclk	= pdata->uartclk;
+	serial_req.regshift	= pdata->regshift;
+	serial_req.iotype	= pdata->iotype;
+	serial_req.flags	= pdata->flags;
+	gen550_init(num, &serial_req);
+#endif
+}
+
+void __init
 ml300_early_serial_map(void)
 {
 #ifdef CONFIG_SERIAL_8250
-	struct serial_state old_ports[] = { SERIAL_PORT_DFNS };
-	struct uart_port port;
-	int i;
-
-	/* Setup ioremapped serial port access */
-	for (i = 0; i < ARRAY_SIZE(old_ports); i++ ) {
-		memset(&port, 0, sizeof(port));
-		port.membase = ioremap((phys_addr_t)(old_ports[i].iomem_base), 16);
-		port.irq = old_ports[i].irq;
-		port.uartclk = old_ports[i].baud_base * 16;
-		port.regshift = old_ports[i].iomem_reg_shift;
-		port.iotype = SERIAL_IO_MEM;
-		port.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
-		port.line = i;
-
-		if (early_serial_setup(&port) != 0) {
-			printk("Early serial init of port %d failed\n", i);
-		}
+	struct plat_serial8250_port *pdata;
+	int i = 0;
+
+	pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(VIRTEX_UART);
+	while(pdata && pdata->flags)
+	{
+		pdata->membase = ioremap(pdata->mapbase, 0x100);
+		ml300_early_serial_init(i, pdata);
+		pdata++;
+		i++;
 	}
 #endif /* CONFIG_SERIAL_8250 */
 }
@@ -109,9 +138,8 @@ ml300_early_serial_map(void)
 void __init
 ml300_setup_arch(void)
 {
-	ppc4xx_setup_arch();	/* calls ppc4xx_find_bridges() */
-
 	ml300_early_serial_map();
+	ppc4xx_setup_arch();	/* calls ppc4xx_find_bridges() */
 
 	/* Identify the system */
 	printk(KERN_INFO "Xilinx Virtex-II Pro port\n");
@@ -131,6 +159,8 @@ platform_init(unsigned long r3, unsigned
 {
 	ppc4xx_init(r3, r4, r5, r6, r7);
 
+	identify_ppc_sys_by_id(mfspr(SPRN_PVR));
+
 	ppc_md.setup_arch = ml300_setup_arch;
 	ppc_md.setup_io_mappings = ml300_map_io;
 	ppc_md.init_IRQ = ml300_init_irq;
diff --git a/arch/ppc/platforms/4xx/xilinx_ml300.h b/arch/ppc/platforms/4xx/xilinx_ml300.h
index 8993981..ae8bf13 100644
--- a/arch/ppc/platforms/4xx/xilinx_ml300.h
+++ b/arch/ppc/platforms/4xx/xilinx_ml300.h
@@ -41,7 +41,7 @@ typedef struct board_info {
 #define PPC4xx_ONB_IO_VADDR	0u
 #define PPC4xx_ONB_IO_SIZE	0u
 
-#define PPC4xx_MACHINE_NAME "Xilinx ML300"
+#define PPC4xx_MACHINE_NAME "Xilinx ML300 Reference System"
 
 #endif /* __ASM_XILINX_ML300_H__ */
 #endif /* __KERNEL__ */
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index 0c9e79b..10d73ba 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -18,7 +18,7 @@ obj-$(CONFIG_440SP)		+= ibm440gx_common.
 obj-$(CONFIG_440SPE)		+= ibm440gx_common.o ibm440sp_common.o ppc440spe_pcie.o
 ifeq ($(CONFIG_4xx),y)
 ifeq ($(CONFIG_XILINX_VIRTEX),y)
-obj-$(CONFIG_40x)		+= xilinx_pic.o
+obj-$(CONFIG_40x)		+= xilinx_pic.o ppc_sys.o
 else
 ifeq ($(CONFIG_403),y)
 obj-$(CONFIG_40x)		+= ppc403_pic.o
diff --git a/arch/ppc/syslib/xilinx_pic.c b/arch/ppc/syslib/xilinx_pic.c
index 848fb51..206872c 100644
--- a/arch/ppc/syslib/xilinx_pic.c
+++ b/arch/ppc/syslib/xilinx_pic.c
@@ -120,14 +120,14 @@ ppc4xx_pic_init(void)
 #error NR_IRQS > 32 not supported
 #endif
 
-#if XPAR_XINTC_USE_DCR == 0
-	intc = ioremap(XPAR_INTC_0_BASEADDR, 32);
+#if VIRTEX_XINTC_USE_DCR == 0
+	intc = ioremap(VIRTEX_INTC_BASEADDR, 32);
 
 	printk(KERN_INFO "Xilinx INTC #0 at 0x%08lX mapped to 0x%08lX\n",
-	       (unsigned long) XPAR_INTC_0_BASEADDR, (unsigned long) intc);
+	       (unsigned long) VIRTEX_INTC_BASEADDR, (unsigned long) intc);
 #else
 	printk(KERN_INFO "Xilinx INTC #0 at 0x%08lX (DCR)\n",
-	       (unsigned long) XPAR_INTC_0_BASEADDR);
+	       (unsigned long) VIRTEX_INTC_BASEADDR);
 #endif
 
 	/*
@@ -147,7 +147,7 @@ ppc4xx_pic_init(void)
 	for (i = 0; i < NR_IRQS; ++i) {
 		irq_desc[i].handler = &xilinx_intc;
 
-		if (XPAR_INTC_0_KIND_OF_INTR & (0x00000001 << i))
+		if (VIRTEX_INTC_KIND_OF_INTR & (0x00000001 << i))
 			irq_desc[i].status &= ~IRQ_LEVEL;
 		else
 			irq_desc[i].status |= IRQ_LEVEL;
-- 
1.0.6-g58e3

^ permalink raw reply related

* [PATCH 02/10] Make Virtex-II Pro support generic for all Virtex devices
From: grant.likely @ 2006-01-09  8:32 UTC (permalink / raw)
  To: glikely, mporter, linuxppc-embedded, gnathita, dhlii
In-Reply-To: <11367955793438-git-send-email-grant.likely@secretlab.ca>

The PPC405 hard core is used in both the Virtex-II Pro and Virtex 4 FX
FPGAs.  This patch cleans up the Virtex naming convention to reflect more
than just the Virtex-II Pro.

Rename files virtex-ii_pro.[ch] to virtex.[ch]
Rename config value VIRTEX_II_PRO to XILINX_VIRTEX

Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>

---

 arch/ppc/platforms/4xx/Kconfig         |    2 -
 arch/ppc/platforms/4xx/Makefile        |    2 -
 arch/ppc/platforms/4xx/virtex-ii_pro.c |   60 -------------------
 arch/ppc/platforms/4xx/virtex-ii_pro.h |   99 --------------------------------
 arch/ppc/platforms/4xx/virtex.c        |   60 +++++++++++++++++++
 arch/ppc/platforms/4xx/virtex.h        |   99 ++++++++++++++++++++++++++++++++
 arch/ppc/platforms/4xx/xilinx_ml300.c  |    2 -
 arch/ppc/platforms/4xx/xilinx_ml300.h  |    2 -
 arch/ppc/syslib/Makefile               |    2 -
 9 files changed, 164 insertions(+), 164 deletions(-)
 delete mode 100644 arch/ppc/platforms/4xx/virtex-ii_pro.c
 delete mode 100644 arch/ppc/platforms/4xx/virtex-ii_pro.h
 create mode 100644 arch/ppc/platforms/4xx/virtex.c
 create mode 100644 arch/ppc/platforms/4xx/virtex.h

35c3b44dc49519e5e47e8d7e52da2b8f31652043
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index d883791..73d9bef 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -208,7 +208,7 @@ config 405GPR
 	depends on SYCAMORE
 	default y
 
-config VIRTEX_II_PRO
+config XILINX_VIRTEX
 	bool
 	depends on XILINX_ML300
 	default y
diff --git a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile
index c9bb611..be4163c 100644
--- a/arch/ppc/platforms/4xx/Makefile
+++ b/arch/ppc/platforms/4xx/Makefile
@@ -26,4 +26,4 @@ obj-$(CONFIG_440SP)		+= ibm440sp.o
 obj-$(CONFIG_440SPE)		+= ppc440spe.o
 obj-$(CONFIG_405EP)		+= ibm405ep.o
 obj-$(CONFIG_405GPR)		+= ibm405gpr.o
-obj-$(CONFIG_VIRTEX_II_PRO)	+= virtex-ii_pro.o
+obj-$(CONFIG_XILINX_VIRTEX)	+= virtex.o
diff --git a/arch/ppc/platforms/4xx/virtex-ii_pro.c b/arch/ppc/platforms/4xx/virtex-ii_pro.c
deleted file mode 100644
index 097cc9d..0000000
--- a/arch/ppc/platforms/4xx/virtex-ii_pro.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * arch/ppc/platforms/4xx/virtex-ii_pro.c
- *
- * Author: MontaVista Software, Inc.
- *         source@mvista.com
- *
- * 2002-2004 (c) MontaVista Software, Inc.  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.
- */
-
-#include <linux/config.h>
-#include <linux/init.h>
-#include <asm/ocp.h>
-#include "virtex-ii_pro.h"
-
-/* Have OCP take care of the serial ports. */
-struct ocp_def core_ocp[] = {
-#ifdef XPAR_UARTNS550_0_BASEADDR
-	{ .vendor	= OCP_VENDOR_XILINX,
-	  .function	= OCP_FUNC_16550,
-	  .index	= 0,
-	  .paddr	= XPAR_UARTNS550_0_BASEADDR,
-	  .irq		= XPAR_INTC_0_UARTNS550_0_VEC_ID,
-	  .pm		= OCP_CPM_NA
-	},
-#ifdef XPAR_UARTNS550_1_BASEADDR
-	{ .vendor	= OCP_VENDOR_XILINX,
-	  .function	= OCP_FUNC_16550,
-	  .index	= 1,
-	  .paddr	= XPAR_UARTNS550_1_BASEADDR,
-	  .irq		= XPAR_INTC_0_UARTNS550_1_VEC_ID,
-	  .pm		= OCP_CPM_NA
-	},
-#ifdef XPAR_UARTNS550_2_BASEADDR
-	{ .vendor	= OCP_VENDOR_XILINX,
-	  .function	= OCP_FUNC_16550,
-	  .index	= 2,
-	  .paddr	= XPAR_UARTNS550_2_BASEADDR,
-	  .irq		= XPAR_INTC_0_UARTNS550_2_VEC_ID,
-	  .pm		= OCP_CPM_NA
-	},
-#ifdef XPAR_UARTNS550_3_BASEADDR
-	{ .vendor	= OCP_VENDOR_XILINX,
-	  .function	= OCP_FUNC_16550,
-	  .index	= 3,
-	  .paddr	= XPAR_UARTNS550_3_BASEADDR,
-	  .irq		= XPAR_INTC_0_UARTNS550_3_VEC_ID,
-	  .pm		= OCP_CPM_NA
-	},
-#ifdef XPAR_UARTNS550_4_BASEADDR
-#error Edit this file to add more devices.
-#endif			/* 4 */
-#endif			/* 3 */
-#endif			/* 2 */
-#endif			/* 1 */
-#endif			/* 0 */
-	{ .vendor	= OCP_VENDOR_INVALID
-	}
-};
diff --git a/arch/ppc/platforms/4xx/virtex-ii_pro.h b/arch/ppc/platforms/4xx/virtex-ii_pro.h
deleted file mode 100644
index 026130c..0000000
--- a/arch/ppc/platforms/4xx/virtex-ii_pro.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * arch/ppc/platforms/4xx/virtex-ii_pro.h
- *
- * Include file that defines the Xilinx Virtex-II Pro processor
- *
- * Author: MontaVista Software, Inc.
- *         source@mvista.com
- *
- * 2002-2004 (c) MontaVista Software, Inc.  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.
- */
-
-#ifdef __KERNEL__
-#ifndef __ASM_VIRTEXIIPRO_H__
-#define __ASM_VIRTEXIIPRO_H__
-
-#include <linux/config.h>
-#include <platforms/4xx/xparameters/xparameters.h>
-
-/* serial defines */
-
-#define RS_TABLE_SIZE  4	/* change this and add more devices below
-				   if you have more then 4 16x50 UARTs */
-
-#define BASE_BAUD		(XPAR_UARTNS550_0_CLOCK_FREQ_HZ/16)
-
-/* The serial ports in the Virtex-II Pro have each I/O byte in the
- * LSByte of a word.  This means that iomem_reg_shift needs to be 2 to
- * change the byte offsets into word offsets.  In addition the base
- * addresses need to have 3 added to them to get to the LSByte.
- */
-#define STD_UART_OP(num)						 \
-	{ 0, BASE_BAUD, 0, XPAR_INTC_0_UARTNS550_##num##_VEC_ID,	 \
-		ASYNC_BOOT_AUTOCONF,		 			 \
-		.iomem_base = (u8 *)XPAR_UARTNS550_##num##_BASEADDR + 3, \
-		.iomem_reg_shift = 2,					 \
-		.io_type = SERIAL_IO_MEM},
-
-#if defined(XPAR_INTC_0_UARTNS550_0_VEC_ID)
-#define ML300_UART0 STD_UART_OP(0)
-#else
-#define ML300_UART0
-#endif
-
-#if defined(XPAR_INTC_0_UARTNS550_1_VEC_ID)
-#define ML300_UART1 STD_UART_OP(1)
-#else
-#define ML300_UART1
-#endif
-
-#if defined(XPAR_INTC_0_UARTNS550_2_VEC_ID)
-#define ML300_UART2 STD_UART_OP(2)
-#else
-#define ML300_UART2
-#endif
-
-#if defined(XPAR_INTC_0_UARTNS550_3_VEC_ID)
-#define ML300_UART3 STD_UART_OP(3)
-#else
-#define ML300_UART3
-#endif
-
-#if defined(XPAR_INTC_0_UARTNS550_4_VEC_ID)
-#error Edit this file to add more devices.
-#elif defined(XPAR_INTC_0_UARTNS550_3_VEC_ID)
-#define NR_SER_PORTS	4
-#elif defined(XPAR_INTC_0_UARTNS550_2_VEC_ID)
-#define NR_SER_PORTS	3
-#elif defined(XPAR_INTC_0_UARTNS550_1_VEC_ID)
-#define NR_SER_PORTS	2
-#elif defined(XPAR_INTC_0_UARTNS550_0_VEC_ID)
-#define NR_SER_PORTS	1
-#else
-#define NR_SER_PORTS	0
-#endif
-
-#if defined(CONFIG_UART0_TTYS0)
-#define SERIAL_PORT_DFNS	\
-	ML300_UART0		\
-	ML300_UART1		\
-	ML300_UART2		\
-	ML300_UART3
-#endif
-
-#if defined(CONFIG_UART0_TTYS1)
-#define SERIAL_PORT_DFNS	\
-	ML300_UART1		\
-	ML300_UART0		\
-	ML300_UART2		\
-	ML300_UART3
-#endif
-
-#define DCRN_CPMFR_BASE	0
-
-#include <asm/ibm405.h>
-
-#endif				/* __ASM_VIRTEXIIPRO_H__ */
-#endif				/* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/virtex.c b/arch/ppc/platforms/4xx/virtex.c
new file mode 100644
index 0000000..1de7a27
--- /dev/null
+++ b/arch/ppc/platforms/4xx/virtex.c
@@ -0,0 +1,60 @@
+/*
+ * arch/ppc/platforms/4xx/virtex.c
+ *
+ * Author: MontaVista Software, Inc.
+ *         source@mvista.com
+ *
+ * 2002-2004 (c) MontaVista Software, Inc.  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.
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <asm/ocp.h>
+#include <platform/4xx/virtex.h>
+
+/* Have OCP take care of the serial ports. */
+struct ocp_def core_ocp[] = {
+#ifdef XPAR_UARTNS550_0_BASEADDR
+	{ .vendor	= OCP_VENDOR_XILINX,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 0,
+	  .paddr	= XPAR_UARTNS550_0_BASEADDR,
+	  .irq		= XPAR_INTC_0_UARTNS550_0_VEC_ID,
+	  .pm		= OCP_CPM_NA
+	},
+#ifdef XPAR_UARTNS550_1_BASEADDR
+	{ .vendor	= OCP_VENDOR_XILINX,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 1,
+	  .paddr	= XPAR_UARTNS550_1_BASEADDR,
+	  .irq		= XPAR_INTC_0_UARTNS550_1_VEC_ID,
+	  .pm		= OCP_CPM_NA
+	},
+#ifdef XPAR_UARTNS550_2_BASEADDR
+	{ .vendor	= OCP_VENDOR_XILINX,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 2,
+	  .paddr	= XPAR_UARTNS550_2_BASEADDR,
+	  .irq		= XPAR_INTC_0_UARTNS550_2_VEC_ID,
+	  .pm		= OCP_CPM_NA
+	},
+#ifdef XPAR_UARTNS550_3_BASEADDR
+	{ .vendor	= OCP_VENDOR_XILINX,
+	  .function	= OCP_FUNC_16550,
+	  .index	= 3,
+	  .paddr	= XPAR_UARTNS550_3_BASEADDR,
+	  .irq		= XPAR_INTC_0_UARTNS550_3_VEC_ID,
+	  .pm		= OCP_CPM_NA
+	},
+#ifdef XPAR_UARTNS550_4_BASEADDR
+#error Edit this file to add more devices.
+#endif			/* 4 */
+#endif			/* 3 */
+#endif			/* 2 */
+#endif			/* 1 */
+#endif			/* 0 */
+	{ .vendor	= OCP_VENDOR_INVALID
+	}
+};
diff --git a/arch/ppc/platforms/4xx/virtex.h b/arch/ppc/platforms/4xx/virtex.h
new file mode 100644
index 0000000..049c767
--- /dev/null
+++ b/arch/ppc/platforms/4xx/virtex.h
@@ -0,0 +1,99 @@
+/*
+ * arch/ppc/platforms/4xx/virtex.h
+ *
+ * Include file that defines the Xilinx Virtex-II Pro processor
+ *
+ * Author: MontaVista Software, Inc.
+ *         source@mvista.com
+ *
+ * 2002-2004 (c) MontaVista Software, Inc.  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.
+ */
+
+#ifdef __KERNEL__
+#ifndef __ASM_VIRTEX_H__
+#define __ASM_VIRTEX_H__
+
+#include <linux/config.h>
+#include <platforms/4xx/xparameters/xparameters.h>
+
+/* serial defines */
+
+#define RS_TABLE_SIZE  4	/* change this and add more devices below
+				   if you have more then 4 16x50 UARTs */
+
+#define BASE_BAUD		(XPAR_UARTNS550_0_CLOCK_FREQ_HZ/16)
+
+/* The serial ports in the Virtex-II Pro have each I/O byte in the
+ * LSByte of a word.  This means that iomem_reg_shift needs to be 2 to
+ * change the byte offsets into word offsets.  In addition the base
+ * addresses need to have 3 added to them to get to the LSByte.
+ */
+#define STD_UART_OP(num)						 \
+	{ 0, BASE_BAUD, 0, XPAR_INTC_0_UARTNS550_##num##_VEC_ID,	 \
+		ASYNC_BOOT_AUTOCONF,		 			 \
+		.iomem_base = (u8 *)XPAR_UARTNS550_##num##_BASEADDR + 3, \
+		.iomem_reg_shift = 2,					 \
+		.io_type = SERIAL_IO_MEM},
+
+#if defined(XPAR_INTC_0_UARTNS550_0_VEC_ID)
+#define ML300_UART0 STD_UART_OP(0)
+#else
+#define ML300_UART0
+#endif
+
+#if defined(XPAR_INTC_0_UARTNS550_1_VEC_ID)
+#define ML300_UART1 STD_UART_OP(1)
+#else
+#define ML300_UART1
+#endif
+
+#if defined(XPAR_INTC_0_UARTNS550_2_VEC_ID)
+#define ML300_UART2 STD_UART_OP(2)
+#else
+#define ML300_UART2
+#endif
+
+#if defined(XPAR_INTC_0_UARTNS550_3_VEC_ID)
+#define ML300_UART3 STD_UART_OP(3)
+#else
+#define ML300_UART3
+#endif
+
+#if defined(XPAR_INTC_0_UARTNS550_4_VEC_ID)
+#error Edit this file to add more devices.
+#elif defined(XPAR_INTC_0_UARTNS550_3_VEC_ID)
+#define NR_SER_PORTS	4
+#elif defined(XPAR_INTC_0_UARTNS550_2_VEC_ID)
+#define NR_SER_PORTS	3
+#elif defined(XPAR_INTC_0_UARTNS550_1_VEC_ID)
+#define NR_SER_PORTS	2
+#elif defined(XPAR_INTC_0_UARTNS550_0_VEC_ID)
+#define NR_SER_PORTS	1
+#else
+#define NR_SER_PORTS	0
+#endif
+
+#if defined(CONFIG_UART0_TTYS0)
+#define SERIAL_PORT_DFNS	\
+	ML300_UART0		\
+	ML300_UART1		\
+	ML300_UART2		\
+	ML300_UART3
+#endif
+
+#if defined(CONFIG_UART0_TTYS1)
+#define SERIAL_PORT_DFNS	\
+	ML300_UART1		\
+	ML300_UART0		\
+	ML300_UART2		\
+	ML300_UART3
+#endif
+
+#define DCRN_CPMFR_BASE	0
+
+#include <asm/ibm405.h>
+
+#endif				/* __ASM_VIRTEX_H__ */
+#endif				/* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/xilinx_ml300.c b/arch/ppc/platforms/4xx/xilinx_ml300.c
index 0b1b77d..b0de0a2 100644
--- a/arch/ppc/platforms/4xx/xilinx_ml300.c
+++ b/arch/ppc/platforms/4xx/xilinx_ml300.c
@@ -22,7 +22,7 @@
 #include <asm/machdep.h>
 #include <asm/ocp.h>
 
-#include <platforms/4xx/virtex-ii_pro.h>	/* for NR_SER_PORTS */
+#include <platforms/4xx/virtex.h>	/* for NR_SER_PORTS */
 
 /*
  * As an overview of how the following functions (platform_init,
diff --git a/arch/ppc/platforms/4xx/xilinx_ml300.h b/arch/ppc/platforms/4xx/xilinx_ml300.h
index f8c5884..8993981 100644
--- a/arch/ppc/platforms/4xx/xilinx_ml300.h
+++ b/arch/ppc/platforms/4xx/xilinx_ml300.h
@@ -16,7 +16,7 @@
 #define __ASM_XILINX_ML300_H__
 
 /* ML300 has a Xilinx Virtex-II Pro processor */
-#include <platforms/4xx/virtex-ii_pro.h>
+#include <platforms/4xx/virtex.h>
 
 #ifndef __ASSEMBLY__
 
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index 5b7f2b8..0c9e79b 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -17,7 +17,7 @@ obj-$(CONFIG_440GX)		+= ibm440gx_common.
 obj-$(CONFIG_440SP)		+= ibm440gx_common.o ibm440sp_common.o
 obj-$(CONFIG_440SPE)		+= ibm440gx_common.o ibm440sp_common.o ppc440spe_pcie.o
 ifeq ($(CONFIG_4xx),y)
-ifeq ($(CONFIG_VIRTEX_II_PRO),y)
+ifeq ($(CONFIG_XILINX_VIRTEX),y)
 obj-$(CONFIG_40x)		+= xilinx_pic.o
 else
 ifeq ($(CONFIG_403),y)
-- 
1.0.6-g58e3

^ permalink raw reply related

* [PATCH 09/10] defconfigs for Xilinx ML300 and ML403 reference designs
From: grant.likely @ 2006-01-09  8:33 UTC (permalink / raw)
  To: glikely, mporter, linuxppc-embedded, gnathita, dhlii
In-Reply-To: <11367955793438-git-send-email-grant.likely@secretlab.ca>

Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>

---

 arch/ppc/configs/ml300_defconfig |  538 ++++++++++++++++++++++++++++++++++++++
 arch/ppc/configs/ml403_defconfig |  538 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 1076 insertions(+), 0 deletions(-)
 create mode 100644 arch/ppc/configs/ml300_defconfig
 create mode 100644 arch/ppc/configs/ml403_defconfig

2fccfe215aef90c8ac01627a9a1cf3ce74ae176f
diff --git a/arch/ppc/configs/ml300_defconfig b/arch/ppc/configs/ml300_defconfig
new file mode 100644
index 0000000..83d2f87
--- /dev/null
+++ b/arch/ppc/configs/ml300_defconfig
@@ -0,0 +1,538 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.14
+# Fri Dec 30 00:12:17 2005
+#
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_PPC=y
+CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_SYSCTL=y
+CONFIG_HOTPLUG=y
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_KMOD=y
+
+#
+# Processor
+#
+# CONFIG_6xx is not set
+CONFIG_40x=y
+# CONFIG_44x is not set
+# CONFIG_POWER3 is not set
+# CONFIG_POWER4 is not set
+# CONFIG_8xx is not set
+# CONFIG_E200 is not set
+# CONFIG_E500 is not set
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_KEXEC is not set
+# CONFIG_CPU_FREQ is not set
+CONFIG_4xx=y
+# CONFIG_WANT_EARLY_SERIAL is not set
+
+#
+# IBM 4xx options
+#
+# CONFIG_BUBINGA is not set
+# CONFIG_CPCI405 is not set
+# CONFIG_EP405 is not set
+# CONFIG_REDWOOD_5 is not set
+# CONFIG_REDWOOD_6 is not set
+# CONFIG_SYCAMORE is not set
+# CONFIG_WALNUT is not set
+CONFIG_XILINX_ML300=y
+# CONFIG_XILINX_ML403 is not set
+CONFIG_IBM405_ERR77=y
+CONFIG_IBM405_ERR51=y
+CONFIG_XILINX_VIRTEX=y
+CONFIG_EMBEDDEDBOOT=y
+# CONFIG_PPC4xx_DMA is not set
+CONFIG_PPC_GEN550=y
+CONFIG_UART0_TTYS0=y
+# CONFIG_UART0_TTYS1 is not set
+CONFIG_NOT_COHERENT_CACHE=y
+
+#
+# Platform options
+#
+# CONFIG_PC_KEYBOARD is not set
+# 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_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_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="console=ttyS0,9600"
+# CONFIG_PM is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
+CONFIG_SECCOMP=y
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+# CONFIG_PCI is not set
+# CONFIG_PCI_DOMAINS is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD 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_CONSISTENT_START=0xff100000
+CONFIG_CONSISTENT_SIZE=0x00200000
+CONFIG_BOOT_LOAD=0x00400000
+
+#
+# Networking
+#
+# CONFIG_NET 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
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+
+#
+# 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_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=65536
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_LBD=y
+# CONFIG_CDROM_PKTCDVD is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+
+#
+# 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
+#
+
+#
+# I2O device support
+#
+
+#
+# Macintosh device drivers
+#
+
+#
+# Network device support
+#
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# 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=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+# CONFIG_HWMON is not set
+# CONFIG_HWMON_VID is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia Capabilities Port drivers
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+
+#
+# SN Devices
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# 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_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=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_RELAYFS_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
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
+# IBM 40x options
+#
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_KGDB is not set
+CONFIG_XMON=y
+CONFIG_BDI_SWITCH=y
+# CONFIG_SERIAL_TEXT_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/ppc/configs/ml403_defconfig b/arch/ppc/configs/ml403_defconfig
new file mode 100644
index 0000000..989b87b
--- /dev/null
+++ b/arch/ppc/configs/ml403_defconfig
@@ -0,0 +1,538 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.14
+# Thu Dec 29 23:51:48 2005
+#
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_PPC=y
+CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_SYSCTL=y
+CONFIG_HOTPLUG=y
+# CONFIG_IKCONFIG is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_KMOD=y
+
+#
+# Processor
+#
+# CONFIG_6xx is not set
+CONFIG_40x=y
+# CONFIG_44x is not set
+# CONFIG_POWER3 is not set
+# CONFIG_POWER4 is not set
+# CONFIG_8xx is not set
+# CONFIG_E200 is not set
+# CONFIG_E500 is not set
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_KEXEC is not set
+# CONFIG_CPU_FREQ is not set
+CONFIG_4xx=y
+# CONFIG_WANT_EARLY_SERIAL is not set
+
+#
+# IBM 4xx options
+#
+# CONFIG_BUBINGA is not set
+# CONFIG_CPCI405 is not set
+# CONFIG_EP405 is not set
+# CONFIG_REDWOOD_5 is not set
+# CONFIG_REDWOOD_6 is not set
+# CONFIG_SYCAMORE is not set
+# CONFIG_WALNUT is not set
+# CONFIG_XILINX_ML300 is not set
+CONFIG_XILINX_ML403=y
+CONFIG_IBM405_ERR77=y
+CONFIG_IBM405_ERR51=y
+CONFIG_XILINX_VIRTEX=y
+CONFIG_EMBEDDEDBOOT=y
+# CONFIG_PPC4xx_DMA is not set
+CONFIG_PPC_GEN550=y
+CONFIG_UART0_TTYS0=y
+# CONFIG_UART0_TTYS1 is not set
+CONFIG_NOT_COHERENT_CACHE=y
+
+#
+# Platform options
+#
+# CONFIG_PC_KEYBOARD is not set
+# 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_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_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="console=ttyS0,9600"
+# CONFIG_PM is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
+CONFIG_SECCOMP=y
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+# CONFIG_PCI is not set
+# CONFIG_PCI_DOMAINS is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD 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_CONSISTENT_START=0xff100000
+CONFIG_CONSISTENT_SIZE=0x00200000
+CONFIG_BOOT_LOAD=0x00400000
+
+#
+# Networking
+#
+# CONFIG_NET 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
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+
+#
+# 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_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=65536
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_LBD=y
+# CONFIG_CDROM_PKTCDVD is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+
+#
+# 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
+#
+
+#
+# I2O device support
+#
+
+#
+# Macintosh device drivers
+#
+
+#
+# Network device support
+#
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# 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=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+# CONFIG_HWMON is not set
+# CONFIG_HWMON_VID is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia Capabilities Port drivers
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+
+#
+# SN Devices
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
+# 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_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=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_RELAYFS_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
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
+# IBM 40x options
+#
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_KGDB is not set
+CONFIG_XMON=y
+CONFIG_BDI_SWITCH=y
+# CONFIG_SERIAL_TEXT_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
+#
-- 
1.0.6-g58e3

^ permalink raw reply related

* [PATCH 06/10] Add xparameters file for Xilinx ML403 reference design
From: grant.likely @ 2006-01-09  8:33 UTC (permalink / raw)
  To: glikely, mporter, linuxppc-embedded, gnathita, dhlii
In-Reply-To: <11367955793438-git-send-email-grant.likely@secretlab.ca>

Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>

---

 .../platforms/4xx/xparameters/xparameters_ml403.h  |  153 +++++++++++++++++++++++
 1 files changed, 153 insertions(+), 0 deletions(-)
 create mode 100644 arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h

eb36da1d3ac7f931342c95ad753220ed2aec1a8e
diff --git a/arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h b/arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h
new file mode 100644
index 0000000..9c2e0e8
--- /dev/null
+++ b/arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h
@@ -0,0 +1,153 @@
+
+/*******************************************************************
+*
+* CAUTION: This file is automatically generated by libgen.
+* Version: Xilinx EDK 7.1.2 EDK_H.12.5.1
+* DO NOT EDIT.
+*
+* Copyright (c) 2005 Xilinx, Inc.  All rights reserved. 
+* 
+* Description: Driver parameters
+*
+*******************************************************************/
+
+#define STDIN_BASEADDRESS 0xA0000000
+#define STDOUT_BASEADDRESS 0xA0000000
+
+/******************************************************************/
+
+#define XPAR_PLB_BRAM_IF_CNTLR_0_BASEADDR 0xFFFF0000
+#define XPAR_PLB_BRAM_IF_CNTLR_0_HIGHADDR 0xFFFFFFFF
+
+/******************************************************************/
+
+#define XPAR_OPB_EMC_0_MEM0_BASEADDR 0x20000000
+#define XPAR_OPB_EMC_0_MEM0_HIGHADDR 0x200FFFFF
+#define XPAR_OPB_EMC_0_MEM1_BASEADDR 0x28000000
+#define XPAR_OPB_EMC_0_MEM1_HIGHADDR 0x287FFFFF
+#define XPAR_OPB_AC97_CONTROLLER_REF_0_BASEADDR 0xA6000000
+#define XPAR_OPB_AC97_CONTROLLER_REF_0_HIGHADDR 0xA60000FF
+#define XPAR_OPB_EMC_USB_0_MEM0_BASEADDR 0xA5000000
+#define XPAR_OPB_EMC_USB_0_MEM0_HIGHADDR 0xA50000FF
+#define XPAR_PLB_DDR_0_MEM0_BASEADDR 0x00000000
+#define XPAR_PLB_DDR_0_MEM0_HIGHADDR 0x0FFFFFFF
+
+/******************************************************************/
+
+#define XPAR_XEMAC_NUM_INSTANCES 1
+#define XPAR_OPB_ETHERNET_0_BASEADDR 0x60000000
+#define XPAR_OPB_ETHERNET_0_HIGHADDR 0x60003FFF
+#define XPAR_OPB_ETHERNET_0_DEVICE_ID 0
+#define XPAR_OPB_ETHERNET_0_ERR_COUNT_EXIST 1
+#define XPAR_OPB_ETHERNET_0_DMA_PRESENT 1
+#define XPAR_OPB_ETHERNET_0_MII_EXIST 1
+#define XPAR_OPB_ETHERNET_0_CAM_EXIST 0
+#define XPAR_OPB_ETHERNET_0_JUMBO_EXIST 0
+
+/******************************************************************/
+
+#define XPAR_XUARTNS550_NUM_INSTANCES 1
+#define XPAR_XUARTNS550_CLOCK_HZ 100000000
+#define XPAR_OPB_UART16550_0_BASEADDR 0xA0000000
+#define XPAR_OPB_UART16550_0_HIGHADDR 0xA0001FFF
+#define XPAR_OPB_UART16550_0_DEVICE_ID 0
+
+/******************************************************************/
+
+#define XPAR_XGPIO_NUM_INSTANCES 3
+#define XPAR_OPB_GPIO_0_BASEADDR 0x90000000
+#define XPAR_OPB_GPIO_0_HIGHADDR 0x900001FF
+#define XPAR_OPB_GPIO_0_DEVICE_ID 0
+#define XPAR_OPB_GPIO_0_INTERRUPT_PRESENT 0
+#define XPAR_OPB_GPIO_0_IS_DUAL 1
+#define XPAR_OPB_GPIO_EXP_HDR_0_BASEADDR 0x90001000
+#define XPAR_OPB_GPIO_EXP_HDR_0_HIGHADDR 0x900011FF
+#define XPAR_OPB_GPIO_EXP_HDR_0_DEVICE_ID 1
+#define XPAR_OPB_GPIO_EXP_HDR_0_INTERRUPT_PRESENT 0
+#define XPAR_OPB_GPIO_EXP_HDR_0_IS_DUAL 1
+#define XPAR_OPB_GPIO_CHAR_LCD_0_BASEADDR 0x90002000
+#define XPAR_OPB_GPIO_CHAR_LCD_0_HIGHADDR 0x900021FF
+#define XPAR_OPB_GPIO_CHAR_LCD_0_DEVICE_ID 2
+#define XPAR_OPB_GPIO_CHAR_LCD_0_INTERRUPT_PRESENT 0
+#define XPAR_OPB_GPIO_CHAR_LCD_0_IS_DUAL 0
+
+/******************************************************************/
+
+#define XPAR_XPS2_NUM_INSTANCES 2
+#define XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_0 0
+#define XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_0 0xA9000000
+#define XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_0 (0xA9000000+0x3F)
+#define XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_1 1
+#define XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_1 (0xA9000000+0x1000)
+#define XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_1 (0xA9000000+0x103F)
+
+/******************************************************************/
+
+#define XPAR_XIIC_NUM_INSTANCES 1
+#define XPAR_OPB_IIC_0_BASEADDR 0xA8000000
+#define XPAR_OPB_IIC_0_HIGHADDR 0xA80001FF
+#define XPAR_OPB_IIC_0_DEVICE_ID 0
+#define XPAR_OPB_IIC_0_TEN_BIT_ADR 0
+#define XPAR_OPB_IIC_0_GPO_WIDTH 1
+
+/******************************************************************/
+
+#define XPAR_INTC_MAX_NUM_INTR_INPUTS 10
+#define XPAR_XINTC_HAS_IPR 1
+#define XPAR_XINTC_USE_DCR 0
+#define XPAR_XINTC_NUM_INSTANCES 1
+#define XPAR_OPB_INTC_0_BASEADDR 0xD1000FC0
+#define XPAR_OPB_INTC_0_HIGHADDR 0xD1000FDF
+#define XPAR_OPB_INTC_0_DEVICE_ID 0
+#define XPAR_OPB_INTC_0_KIND_OF_INTR 0x00000000
+
+/******************************************************************/
+
+#define XPAR_INTC_SINGLE_BASEADDR 0xD1000FC0
+#define XPAR_INTC_SINGLE_HIGHADDR 0xD1000FDF
+#define XPAR_INTC_SINGLE_DEVICE_ID XPAR_OPB_INTC_0_DEVICE_ID
+#define XPAR_OPB_ETHERNET_0_IP2INTC_IRPT_MASK 0X000001
+#define XPAR_OPB_INTC_0_OPB_ETHERNET_0_IP2INTC_IRPT_INTR 0
+#define XPAR_SYSTEM_USB_HPI_INT_MASK 0X000002
+#define XPAR_OPB_INTC_0_SYSTEM_USB_HPI_INT_INTR 1
+#define XPAR_MISC_LOGIC_0_PHY_MII_INT_MASK 0X000004
+#define XPAR_OPB_INTC_0_MISC_LOGIC_0_PHY_MII_INT_INTR 2
+#define XPAR_OPB_SYSACE_0_SYSACE_IRQ_MASK 0X000008
+#define XPAR_OPB_INTC_0_OPB_SYSACE_0_SYSACE_IRQ_INTR 3
+#define XPAR_OPB_AC97_CONTROLLER_REF_0_RECORD_INTERRUPT_MASK 0X000010
+#define XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_0_RECORD_INTERRUPT_INTR 4
+#define XPAR_OPB_AC97_CONTROLLER_REF_0_PLAYBACK_INTERRUPT_MASK 0X000020
+#define XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_0_PLAYBACK_INTERRUPT_INTR 5
+#define XPAR_OPB_IIC_0_IP2INTC_IRPT_MASK 0X000040
+#define XPAR_OPB_INTC_0_OPB_IIC_0_IP2INTC_IRPT_INTR 6
+#define XPAR_OPB_PS2_DUAL_REF_0_SYS_INTR2_MASK 0X000080
+#define XPAR_OPB_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR2_INTR 7
+#define XPAR_OPB_PS2_DUAL_REF_0_SYS_INTR1_MASK 0X000100
+#define XPAR_OPB_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR1_INTR 8
+#define XPAR_OPB_UART16550_0_IP2INTC_IRPT_MASK 0X000200
+#define XPAR_OPB_INTC_0_OPB_UART16550_0_IP2INTC_IRPT_INTR 9
+
+/******************************************************************/
+
+#define XPAR_XTFT_NUM_INSTANCES 1
+#define XPAR_PLB_TFT_CNTLR_REF_0_DCR_BASEADDR 0xD0000200
+#define XPAR_PLB_TFT_CNTLR_REF_0_DCR_HIGHADDR 0xD0000207
+#define XPAR_PLB_TFT_CNTLR_REF_0_DEVICE_ID 0
+
+/******************************************************************/
+
+#define XPAR_XSYSACE_MEM_WIDTH 16
+#define XPAR_XSYSACE_NUM_INSTANCES 1
+#define XPAR_OPB_SYSACE_0_BASEADDR 0xCF000000
+#define XPAR_OPB_SYSACE_0_HIGHADDR 0xCF0001FF
+#define XPAR_OPB_SYSACE_0_DEVICE_ID 0
+#define XPAR_OPB_SYSACE_0_MEM_WIDTH 16
+
+/******************************************************************/
+
+#define XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ 300000000
+
+/******************************************************************/
+
+#define XILFATFS_MAXFILES 5
+#define XILFATFS_BUFCACHE_SIZE 10240
-- 
1.0.6-g58e3

^ permalink raw reply related

* [PATCH 03/10] Migrate Xilinx Vertex support from the OCP bus to the platfom bus.
From: grant.likely @ 2006-01-09  8:33 UTC (permalink / raw)
  To: glikely, mporter, linuxppc-embedded, gnathita, dhlii
In-Reply-To: <11367955793438-git-send-email-grant.likely@secretlab.ca>

This patch only deals with the serial port definitions as there is no
support for any other xilinx IP cores in the kernel tree at the moment.

Board specific configuration moved out of virtex.[ch] and into the
xparameters.h wrapper.

Board specific XPAR values now get bound to common defines with a 'VIRTEX_'
prefix.  That way, xparameters_*.h files may be vastly different, but they
can be wired up to use the same infrastructure.

This also prepares for the transition to the flattened device tree model.
When the bootloader provides a device tree generated from an xparameters.h
files, the kernel will no longer need xparameters/*.  The platform bus will
get populated with data from the device tree, and the device drivers will
be automatically connected to the devices.  Only the bootloader (or
ppcboot) will need xparameters directly.

Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>

---

 arch/ppc/boot/common/ns16550.c                   |    3 +
 arch/ppc/boot/simple/embed_config.c              |    3 +
 arch/ppc/platforms/4xx/Kconfig                   |    5 -
 arch/ppc/platforms/4xx/virtex.c                  |   98 +++++++++++-----------
 arch/ppc/platforms/4xx/virtex.h                  |   88 +++-----------------
 arch/ppc/platforms/4xx/xparameters/xparameters.h |   37 ++++++++
 include/asm-ppc/ppc_sys.h                        |    2 
 7 files changed, 103 insertions(+), 133 deletions(-)

8b2afec870997aa04027fefab80819b058891195
diff --git a/arch/ppc/boot/common/ns16550.c b/arch/ppc/boot/common/ns16550.c
index 26818bb..4f00c93 100644
--- a/arch/ppc/boot/common/ns16550.c
+++ b/arch/ppc/boot/common/ns16550.c
@@ -8,6 +8,9 @@
 #include <linux/serial_reg.h>
 #include <asm/serial.h>
 
+#if defined(CONFIG_XILINX_VIRTEX)
+#include <platforms/4xx/xparameters/xparameters.h>
+#endif
 #include "nonstdio.h"
 #include "serial.h"
 
diff --git a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
index 491a691..df24202 100644
--- a/arch/ppc/boot/simple/embed_config.c
+++ b/arch/ppc/boot/simple/embed_config.c
@@ -21,6 +21,9 @@
 #ifdef CONFIG_40x
 #include <asm/io.h>
 #endif
+#ifdef CONFIG_XILINX_VIRTEX
+#include <platforms/4xx/xparameters/xparameters.h>
+#endif
 extern unsigned long timebase_period_ns;
 
 /* For those boards that don't provide one.
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index 73d9bef..cbb90fc 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -172,11 +172,6 @@ config IBM_OCP
 	depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || YUCCA || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
 	default y
 
-config XILINX_OCP
-	bool
-	depends on XILINX_ML300
-	default y
-
 config IBM_EMAC4
 	bool
 	depends on 440GX || 440SP || 440SPE
diff --git a/arch/ppc/platforms/4xx/virtex.c b/arch/ppc/platforms/4xx/virtex.c
index 1de7a27..27685f3 100644
--- a/arch/ppc/platforms/4xx/virtex.c
+++ b/arch/ppc/platforms/4xx/virtex.c
@@ -1,60 +1,58 @@
 /*
  * arch/ppc/platforms/4xx/virtex.c
  *
- * Author: MontaVista Software, Inc.
- *         source@mvista.com
+ * Virtex-II Pro & Virtex-4 FX common infrastructure
  *
- * 2002-2004 (c) MontaVista Software, Inc.  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.
+ * Maintainer: Grant Likely <grant.likely@secretlab.ca>
+ *
+ * Copyright 2005 Secret Lab Technologies Ltd.
+ * Copyright 2005 General Dynamics Canada Ltd.
+ * Copyright 2005 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.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
-#include <asm/ocp.h>
-#include <platform/4xx/virtex.h>
+#include <linux/module.h>
+#include <linux/device.h>
+#include <linux/serial_8250.h>
+#include <asm/ppc_sys.h>
+#include <platforms/4xx/virtex.h>
+#include <platforms/4xx/xparameters/xparameters.h>
 
-/* Have OCP take care of the serial ports. */
-struct ocp_def core_ocp[] = {
-#ifdef XPAR_UARTNS550_0_BASEADDR
-	{ .vendor	= OCP_VENDOR_XILINX,
-	  .function	= OCP_FUNC_16550,
-	  .index	= 0,
-	  .paddr	= XPAR_UARTNS550_0_BASEADDR,
-	  .irq		= XPAR_INTC_0_UARTNS550_0_VEC_ID,
-	  .pm		= OCP_CPM_NA
-	},
-#ifdef XPAR_UARTNS550_1_BASEADDR
-	{ .vendor	= OCP_VENDOR_XILINX,
-	  .function	= OCP_FUNC_16550,
-	  .index	= 1,
-	  .paddr	= XPAR_UARTNS550_1_BASEADDR,
-	  .irq		= XPAR_INTC_0_UARTNS550_1_VEC_ID,
-	  .pm		= OCP_CPM_NA
-	},
-#ifdef XPAR_UARTNS550_2_BASEADDR
-	{ .vendor	= OCP_VENDOR_XILINX,
-	  .function	= OCP_FUNC_16550,
-	  .index	= 2,
-	  .paddr	= XPAR_UARTNS550_2_BASEADDR,
-	  .irq		= XPAR_INTC_0_UARTNS550_2_VEC_ID,
-	  .pm		= OCP_CPM_NA
-	},
-#ifdef XPAR_UARTNS550_3_BASEADDR
-	{ .vendor	= OCP_VENDOR_XILINX,
-	  .function	= OCP_FUNC_16550,
-	  .index	= 3,
-	  .paddr	= XPAR_UARTNS550_3_BASEADDR,
-	  .irq		= XPAR_INTC_0_UARTNS550_3_VEC_ID,
-	  .pm		= OCP_CPM_NA
-	},
-#ifdef XPAR_UARTNS550_4_BASEADDR
-#error Edit this file to add more devices.
-#endif			/* 4 */
-#endif			/* 3 */
-#endif			/* 2 */
-#endif			/* 1 */
-#endif			/* 0 */
-	{ .vendor	= OCP_VENDOR_INVALID
+#define VIRTEX_UART(num) { \
+		.mapbase  = VIRTEX_UART_##num##_BASEADDR + 3, \
+		.irq	  = VIRTEX_UART_##num##_IRQ, \
+		.iotype	  = UPIO_MEM, \
+		.uartclk  = VIRTEX_UART_##num##_CLK, \
+		.flags	  = UPF_BOOT_AUTOCONF, \
+		.regshift = 2, \
 	}
+
+struct plat_serial8250_port serial_platform_data[] = {
+#ifdef VIRTEX_UART_0_BASEADDR
+	VIRTEX_UART(0),
+#endif
+#ifdef VIRTEX_UART_1_BASEADDR
+	VIRTEX_UART(1),
+#endif
+#ifdef VIRTEX_UART_2_BASEADDR
+	VIRTEX_UART(2),
+#endif
+#ifdef VIRTEX_UART_3_BASEADDR
+	VIRTEX_UART(3),
+#endif
+	{ }, /* terminated by empty record */
 };
+
+struct platform_device ppc_sys_platform_devices[] = {
+	[VIRTEX_UART] = {
+		.name		= "serial8250",
+		.id		= 0,
+		.dev.platform_data = serial_platform_data,
+	},
+};
+
diff --git a/arch/ppc/platforms/4xx/virtex.h b/arch/ppc/platforms/4xx/virtex.h
index 049c767..1a01b81 100644
--- a/arch/ppc/platforms/4xx/virtex.h
+++ b/arch/ppc/platforms/4xx/virtex.h
@@ -15,85 +15,21 @@
 #ifndef __ASM_VIRTEX_H__
 #define __ASM_VIRTEX_H__
 
-#include <linux/config.h>
-#include <platforms/4xx/xparameters/xparameters.h>
-
 /* serial defines */
 
-#define RS_TABLE_SIZE  4	/* change this and add more devices below
-				   if you have more then 4 16x50 UARTs */
-
-#define BASE_BAUD		(XPAR_UARTNS550_0_CLOCK_FREQ_HZ/16)
-
-/* The serial ports in the Virtex-II Pro have each I/O byte in the
- * LSByte of a word.  This means that iomem_reg_shift needs to be 2 to
- * change the byte offsets into word offsets.  In addition the base
- * addresses need to have 3 added to them to get to the LSByte.
- */
-#define STD_UART_OP(num)						 \
-	{ 0, BASE_BAUD, 0, XPAR_INTC_0_UARTNS550_##num##_VEC_ID,	 \
-		ASYNC_BOOT_AUTOCONF,		 			 \
-		.iomem_base = (u8 *)XPAR_UARTNS550_##num##_BASEADDR + 3, \
-		.iomem_reg_shift = 2,					 \
-		.io_type = SERIAL_IO_MEM},
-
-#if defined(XPAR_INTC_0_UARTNS550_0_VEC_ID)
-#define ML300_UART0 STD_UART_OP(0)
-#else
-#define ML300_UART0
-#endif
-
-#if defined(XPAR_INTC_0_UARTNS550_1_VEC_ID)
-#define ML300_UART1 STD_UART_OP(1)
-#else
-#define ML300_UART1
-#endif
-
-#if defined(XPAR_INTC_0_UARTNS550_2_VEC_ID)
-#define ML300_UART2 STD_UART_OP(2)
-#else
-#define ML300_UART2
-#endif
-
-#if defined(XPAR_INTC_0_UARTNS550_3_VEC_ID)
-#define ML300_UART3 STD_UART_OP(3)
-#else
-#define ML300_UART3
-#endif
-
-#if defined(XPAR_INTC_0_UARTNS550_4_VEC_ID)
-#error Edit this file to add more devices.
-#elif defined(XPAR_INTC_0_UARTNS550_3_VEC_ID)
-#define NR_SER_PORTS	4
-#elif defined(XPAR_INTC_0_UARTNS550_2_VEC_ID)
-#define NR_SER_PORTS	3
-#elif defined(XPAR_INTC_0_UARTNS550_1_VEC_ID)
-#define NR_SER_PORTS	2
-#elif defined(XPAR_INTC_0_UARTNS550_0_VEC_ID)
-#define NR_SER_PORTS	1
-#else
-#define NR_SER_PORTS	0
-#endif
-
-#if defined(CONFIG_UART0_TTYS0)
-#define SERIAL_PORT_DFNS	\
-	ML300_UART0		\
-	ML300_UART1		\
-	ML300_UART2		\
-	ML300_UART3
-#endif
-
-#if defined(CONFIG_UART0_TTYS1)
-#define SERIAL_PORT_DFNS	\
-	ML300_UART1		\
-	ML300_UART0		\
-	ML300_UART2		\
-	ML300_UART3
-#endif
-
-#define DCRN_CPMFR_BASE	0
-
 #include <asm/ibm405.h>
 
+/* Ugly, ugly, ugly! BASE_BAUD defined here to keep 8250.c happy. */
+#if !defined(BASE_BAUD)
+ #define BASE_BAUD		(0) /* dummy value; not used */
+#endif
+  
+/* Device type enumeration for platform bus definitions */
+#ifndef __ASSEMBLY__
+enum ppc_sys_devices {
+	VIRTEX_UART,
+};
+#endif
+  
 #endif				/* __ASM_VIRTEX_H__ */
 #endif				/* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/xparameters/xparameters.h b/arch/ppc/platforms/4xx/xparameters/xparameters.h
index fe4eac6..26ee822 100644
--- a/arch/ppc/platforms/4xx/xparameters/xparameters.h
+++ b/arch/ppc/platforms/4xx/xparameters/xparameters.h
@@ -1,7 +1,8 @@
 /*
  * include/asm-ppc/xparameters.h
  *
- * This file includes the correct xparameters.h for the CONFIG'ed board
+ * This file includes the correct xparameters.h for the CONFIG'ed board plus
+ * fixups to translate board specific XPAR values to a common set of names
  *
  * Author: MontaVista Software, Inc.
  *         source@mvista.com
@@ -14,5 +15,37 @@
 #include <linux/config.h>
 
 #if defined(CONFIG_XILINX_ML300)
-#include <platforms/4xx/xparameters/xparameters_ml300.h>
+  #include "xparameters_ml300.h"
+
+  /* Serial ports; 0x1000 is added to base addr because 16550 IP core has
+   * an offset between base address and the standard registers. */
+  #define VIRTEX_UART_0_BASEADDR  (XPAR_OPB_UART16550_0_BASEADDR + 0x1000)
+  #define VIRTEX_UART_0_IRQ  XPAR_DCR_INTC_0_OPB_UART16550_0_IP2INTC_IRPT_INTR
+  #define VIRTEX_UART_0_CLK  XPAR_XUARTNS550_CLOCK_HZ
+
+  #define VIRTEX_UART_1_BASEADDR  (XPAR_OPB_UART16550_1_BASEADDR + 0x1000)
+  #define VIRTEX_UART_1_IRQ  XPAR_DCR_INTC_0_OPB_UART16550_1_IP2INTC_IRPT_INTR
+  #define VIRTEX_UART_1_CLK  XPAR_XUARTNS550_CLOCK_HZ
+
+  /* Values for setting up interrupt controller */
+  #define VIRTEX_XINTC_USE_DCR           XPAR_XINTC_USE_DCR
+  #define VIRTEX_INTC_BASEADDR           XPAR_DCR_INTC_0_BASEADDR
+  #define VIRTEX_INTC_KIND_OF_INTR       XPAR_DCR_INTC_0_KIND_OF_INTR
+
+#else
+  /* Add other board xparameter includes here before the #else */
+  #error No *_xparameters.h file included
+#endif
+
+#ifndef SERIAL_PORT_DFNS
+  /* zImage serial port definitions */
+  #define RS_TABLE_SIZE        1
+  #define SERIAL_PORT_DFNS {                                 \
+        .baud_base       = VIRTEX_UART_0_CLK/16,             \
+        .irq             = VIRTEX_UART_0_IRQ,                \
+        .flags           = ASYNC_BOOT_AUTOCONF,              \
+        .iomem_base      = (u8 *)VIRTEX_UART_0_BASEADDR + 3, \
+        .iomem_reg_shift = 2,                                \
+        .io_type         = SERIAL_IO_MEM,                    \
+  },
 #endif
diff --git a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h
index 83d8c77..bdc4dde 100644
--- a/include/asm-ppc/ppc_sys.h
+++ b/include/asm-ppc/ppc_sys.h
@@ -33,6 +33,8 @@
 #include <asm/mpc52xx.h>
 #elif defined(CONFIG_MPC10X_BRIDGE)
 #include <asm/mpc10x.h>
+#elif defined(CONFIG_XILINX_VIRTEX)
+#include <platforms/4xx/virtex.h>
 #else
 #error "need definition of ppc_sys_devices"
 #endif
-- 
1.0.6-g58e3

^ permalink raw reply related

* [PATCH 10/10] Bug fix for Xilinx silicon errata 213.
From: grant.likely @ 2006-01-09  8:33 UTC (permalink / raw)
  To: glikely, mporter, linuxppc-embedded, gnathita, dhlii
In-Reply-To: <11367955793438-git-send-email-grant.likely@secretlab.ca>

Pulled from Xilinx's Linux source code.  Also adds CONFIG entries to
differentiate between the VIRTEX_4_FX and VIRTEX_II_PRO where appropriate.

Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>

---

 arch/ppc/boot/simple/head.S    |    7 +++++++
 arch/ppc/platforms/4xx/Kconfig |   12 +++++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)

5fc2a191f262984434640c01599a439a7650b6e6
diff --git a/arch/ppc/boot/simple/head.S b/arch/ppc/boot/simple/head.S
index 5e4adc2..119b9dc 100644
--- a/arch/ppc/boot/simple/head.S
+++ b/arch/ppc/boot/simple/head.S
@@ -65,6 +65,13 @@ start_:
 			 */
 #endif
 
+#if defined(CONFIG_XILINX_VIRTEX_4_FX)
+	/* PPC errata 213: only for Virtex-4 FX */
+	mfccr0  0
+	oris    0,0,0x50000000@h
+	mtccr0  0
+#endif
+
 	mflr	r3	/* Save our actual starting address. */
 
 	/* The following functions we call must not modify r3 or r4.....
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index 48def71..174ddbc 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -207,9 +207,19 @@ config 405GPR
 	depends on SYCAMORE
 	default y
 
+config XILINX_VIRTEX_II_PRO
+	bool
+	depends on XILINX_ML300
+	default y
+
+config XILINX_VIRTEX_4_FX
+	bool
+	depends on XILINX_ML403
+	default y
+
 config XILINX_VIRTEX
 	bool
-	depends on XILINX_ML300 || XILINX_ML403
+	depends on XILINX_VIRTEX_II_PRO || XILINX_VIRTEX_4_FX
 	default y
 
 config STB03xxx
-- 
1.0.6-g58e3

^ permalink raw reply related

* [PATCH 08/10] ML300 & ML403 need embed_config.o linked in
From: grant.likely @ 2006-01-09  8:33 UTC (permalink / raw)
  To: glikely, mporter, linuxppc-embedded, gnathita, dhlii
In-Reply-To: <11367955793438-git-send-email-grant.likely@secretlab.ca>

Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>

---

 arch/ppc/boot/simple/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

a39144d5708c207f58964000baf56fa9cfb18628
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index f3e9c53..7abd772 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -188,6 +188,8 @@ OBJCOPY_ARGS			:= -O elf32-powerpc
 boot-y				:= head.o relocate.o $(extra.o-y) $(misc-y)
 boot-$(CONFIG_REDWOOD_5)	+= embed_config.o
 boot-$(CONFIG_REDWOOD_6)	+= embed_config.o
+boot-$(CONFIG_XILINX_ML300)	+= embed_config.o
+boot-$(CONFIG_XILINX_ML403)	+= embed_config.o
 boot-$(CONFIG_8xx)		+= embed_config.o
 boot-$(CONFIG_8260)		+= embed_config.o
 boot-$(CONFIG_BSEIP)		+= iic.o
-- 
1.0.6-g58e3

^ permalink raw reply related

* [PATCH 01/10] Move xparameters.h into xilinx virtex device specific path
From: grant.likely @ 2006-01-09  8:32 UTC (permalink / raw)
  To: glikely, mporter, linuxppc-embedded, gnathita, dhlii
In-Reply-To: <11367955793438-git-send-email-grant.likely@secretlab.ca>

xparameters should not be needed by anything but virtex platform code.
Move it from include/asm-ppc/ to platforms/4xx/xparameters/

This is preparing for work to remove xparameters from the dependancy tree
for most c files.  xparam changes should not cause a recompile of the world.
Instead, drivers should get device info from the platform bus (populated
by the boot code)

Signed-off-by: Grant C. Likely <grant.likely@secretlab.ca>

---

 arch/ppc/platforms/4xx/virtex-ii_pro.h           |    2 +-
 arch/ppc/platforms/4xx/xparameters/xparameters.h |   18 ++++++++++++++++++
 arch/ppc/syslib/xilinx_pic.c                     |    2 +-
 include/asm-ppc/xparameters.h                    |   18 ------------------
 4 files changed, 20 insertions(+), 20 deletions(-)
 create mode 100644 arch/ppc/platforms/4xx/xparameters/xparameters.h
 delete mode 100644 include/asm-ppc/xparameters.h

b1415bdd1572c849313b4cb67b38ab725ca31c4e
diff --git a/arch/ppc/platforms/4xx/virtex-ii_pro.h b/arch/ppc/platforms/4xx/virtex-ii_pro.h
index 9014c48..026130c 100644
--- a/arch/ppc/platforms/4xx/virtex-ii_pro.h
+++ b/arch/ppc/platforms/4xx/virtex-ii_pro.h
@@ -16,7 +16,7 @@
 #define __ASM_VIRTEXIIPRO_H__
 
 #include <linux/config.h>
-#include <asm/xparameters.h>
+#include <platforms/4xx/xparameters/xparameters.h>
 
 /* serial defines */
 
diff --git a/arch/ppc/platforms/4xx/xparameters/xparameters.h b/arch/ppc/platforms/4xx/xparameters/xparameters.h
new file mode 100644
index 0000000..fe4eac6
--- /dev/null
+++ b/arch/ppc/platforms/4xx/xparameters/xparameters.h
@@ -0,0 +1,18 @@
+/*
+ * include/asm-ppc/xparameters.h
+ *
+ * This file includes the correct xparameters.h for the CONFIG'ed board
+ *
+ * Author: MontaVista Software, Inc.
+ *         source@mvista.com
+ *
+ * 2004 (c) MontaVista Software, Inc.  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.
+ */
+
+#include <linux/config.h>
+
+#if defined(CONFIG_XILINX_ML300)
+#include <platforms/4xx/xparameters/xparameters_ml300.h>
+#endif
diff --git a/arch/ppc/syslib/xilinx_pic.c b/arch/ppc/syslib/xilinx_pic.c
index 47f04c7..848fb51 100644
--- a/arch/ppc/syslib/xilinx_pic.c
+++ b/arch/ppc/syslib/xilinx_pic.c
@@ -15,7 +15,7 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <asm/io.h>
-#include <asm/xparameters.h>
+#include <platforms/4xx/xparameters/xparameters.h>
 #include <asm/ibm4xx.h>
 #include <asm/machdep.h>
 
diff --git a/include/asm-ppc/xparameters.h b/include/asm-ppc/xparameters.h
deleted file mode 100644
index fe4eac6..0000000
--- a/include/asm-ppc/xparameters.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * include/asm-ppc/xparameters.h
- *
- * This file includes the correct xparameters.h for the CONFIG'ed board
- *
- * Author: MontaVista Software, Inc.
- *         source@mvista.com
- *
- * 2004 (c) MontaVista Software, Inc.  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.
- */
-
-#include <linux/config.h>
-
-#if defined(CONFIG_XILINX_ML300)
-#include <platforms/4xx/xparameters/xparameters_ml300.h>
-#endif
-- 
1.0.6-g58e3

^ permalink raw reply related

* FEC       CONFIG_FEC_PACKETHOOK
From: feng @ 2006-01-09  4:34 UTC (permalink / raw)
  To: linuxppc-embedded


DQpIZWxsbyxldmVyeWJvYnkNCg0KICAgICAgICAganVzdCBsb29rZWQgaW50byB0aGUgOHh4IGZl
Yy5jIHNvdXJjZXMgb2YgMi40LjE4IHRyZWUgYW5kIGRpc2NvdmVyZWQgdGhlcmUNCiAgICAgIGlz
IGEgQ09ORklHX0ZFQ19QQUNLRVRIT09LIG9wdGlvbi4gQ291bGRudCBmaW5kIGFueSBmdXJ0aGVy
IGluZm9ybWF0aW9uDQogICAgICBhYm91dCBpdCwgbm90IGV2ZW4gdGhlIGluY2x1ZGVkIGxpbnV4
L3BrdGhvb2suaCBmaWxlLiBIYXMgYW55b25lIG1vcmUNCiAgICAgIGluZm9ybWF0aW9uIHdoYXQg
dGhpcyBpcyBmb3I/IA0KDQogICAgICBUaGFua3MgZm9yIGFueSBpbmZvcm1hdGlvbiwNCiAgICAg
IEJlc3QgcmVncmFkcw0KDQqhoaGhoaGhoaGhoaGhoaGhIFJpY2hhcmQNCqGhoaGhoaGhoaGhoaGh
oaEgY2hpbmFmZW5nMjAwOEAxNjMuY29tDQqhoaGhoaGhoaGhoaGhoaGhoaGhoTIwMDYtMDEtMDcN
Cg==

^ permalink raw reply

* Re: [PATCH] powerpc: Fix PowerMac sound i2c
From: Benjamin Herrenschmidt @ 2006-01-08 23:37 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: linuxppc64-dev, linuxppc-dev list
In-Reply-To: <1136701380.30123.46.camel@localhost.localdomain>

Ok, here's another version that uses the proper wrapper in the i2c
layer, that was removed but is coming back...

Index: linux-work/sound/ppc/tumbler.c
===================================================================
--- linux-work.orig/sound/ppc/tumbler.c	2006-01-09 10:29:54.000000000 +1100
+++ linux-work/sound/ppc/tumbler.c	2006-01-09 10:30:14.000000000 +1100
@@ -137,7 +137,6 @@ static int send_init_client(pmac_keywest
 	return 0;
 }
 
-
 static int tumbler_init_client(pmac_keywest_t *i2c)
 {
 	static unsigned int regs[] = {
@@ -239,8 +238,8 @@ static int tumbler_set_master_volume(pma
 	block[4] = (right_vol >> 8)  & 0xff;
 	block[5] = (right_vol >> 0)  & 0xff;
   
-	if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_VOL,
-				       6, block) < 0) {
+	if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_VOL, 6,
+					   block) < 0) {
 		snd_printk("failed to set volume \n");
 		return -EINVAL;
 	}
@@ -340,8 +339,8 @@ static int tumbler_set_drc(pmac_tumbler_
 		val[1] = 0;
 	}
 
-	if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_DRC,
-				       2, val) < 0) {
+	if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_DRC,
+					   2, val) < 0) {
 		snd_printk("failed to set DRC\n");
 		return -EINVAL;
 	}
@@ -376,8 +375,8 @@ static int snapper_set_drc(pmac_tumbler_
 	val[4] = 0x60;
 	val[5] = 0xa0;
 
-	if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_DRC,
-				       6, val) < 0) {
+	if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_DRC,
+					   6, val) < 0) {
 		snd_printk("failed to set DRC\n");
 		return -EINVAL;
 	}
@@ -481,8 +480,8 @@ static int tumbler_set_mono_volume(pmac_
 	vol = info->table[vol];
 	for (i = 0; i < info->bytes; i++)
 		block[i] = (vol >> ((info->bytes - i - 1) * 8)) & 0xff;
-	if (i2c_smbus_write_block_data(mix->i2c.client, info->reg,
-				       info->bytes, block) < 0) {
+	if (i2c_smbus_write_i2c_block_data(mix->i2c.client, info->reg,
+					   info->bytes, block) < 0) {
 		snd_printk("failed to set mono volume %d\n", info->index);
 		return -EINVAL;
 	}
@@ -611,7 +610,8 @@ static int snapper_set_mix_vol1(pmac_tum
 		for (j = 0; j < 3; j++)
 			block[i * 3 + j] = (vol >> ((2 - j) * 8)) & 0xff;
 	}
-	if (i2c_smbus_write_block_data(mix->i2c.client, reg, 9, block) < 0) {
+	if (i2c_smbus_write_i2c_block_data(mix->i2c.client, reg,
+					   9, block) < 0) {
 		snd_printk("failed to set mono volume %d\n", reg);
 		return -EINVAL;
 	}
Index: linux-work/sound/ppc/pmac.c
===================================================================
--- linux-work.orig/sound/ppc/pmac.c	2006-01-09 10:29:54.000000000 +1100
+++ linux-work/sound/ppc/pmac.c	2006-01-09 10:30:14.000000000 +1100
@@ -74,7 +74,7 @@ static int snd_pmac_dbdma_alloc(pmac_t *
 
 static void snd_pmac_dbdma_free(pmac_t *chip, pmac_dbdma_t *rec)
 {
-	if (rec) {
+	if (rec->space) {
 		unsigned int rsize = sizeof(struct dbdma_cmd) * (rec->size + 1);
 
 		dma_free_coherent(&chip->pdev->dev, rsize, rec->space, rec->dma_base);
@@ -895,6 +895,7 @@ static int __init snd_pmac_detect(pmac_t
 	chip->can_capture = 1;
 	chip->num_freqs = ARRAY_SIZE(awacs_freqs);
 	chip->freq_table = awacs_freqs;
+	chip->pdev = NULL;
 
 	chip->control_mask = MASK_IEPC | MASK_IEE | 0x11; /* default */
 
Index: linux-work/sound/oss/dmasound/tas_common.h
===================================================================
--- linux-work.orig/sound/oss/dmasound/tas_common.h	2006-01-09 10:29:54.000000000 +1100
+++ linux-work/sound/oss/dmasound/tas_common.h	2006-01-09 10:31:09.000000000 +1100
@@ -178,10 +178,10 @@ tas_write_register(	struct tas_data_t *s
 	if (write_mode & WRITE_SHADOW)
 		memcpy(self->shadow[reg_num],data,reg_width);
 	if (write_mode & WRITE_HW) {
-		rc=i2c_smbus_write_block_data(self->client,
-					      reg_num,
-					      reg_width,
-					      data);
+		rc=i2c_smbus_write_i2c_block_data(self->client,
+						  reg_num,
+						  reg_width,
+						  data);
 		if (rc < 0) {
 			printk("tas: I2C block write failed \n");  
 			return rc; 
@@ -199,10 +199,10 @@ tas_sync_register(	struct tas_data_t *se
 
 	if (reg_width==0 || self==NULL)
 		return -EINVAL;
-	rc=i2c_smbus_write_block_data(self->client,
-				      reg_num,
-				      reg_width,
-				      self->shadow[reg_num]);
+	rc=i2c_smbus_write_i2c_block_data(self->client,
+					  reg_num,
+					  reg_width,
+					  self->shadow[reg_num]);
 	if (rc < 0) {
 		printk("tas: I2C block write failed \n");
 		return rc;

^ permalink raw reply

* [RFC] Patches for Xilinx UartLite to 2.6.15
From: David H. Lynch Jr. @ 2006-01-08 21:40 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <43B95448.3040407@secretlab.ca>

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

This is against
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

Signed-off-by: David H. Lynch Jr. <dhlii@dlasystems.net>


	Status/Overview:

	This is separated out from a more substantial effort to port Linux to
the Pico E12 - a Xilinx Virtex-4 based PPC405 on a compact flash card.
In that environment the UartLite support code is tested from  boot
support through to a working beta serial/console driver.
	There was a Xilinx UartLite driver done by others (Xilinx or
MontaVista) for Linux 2.4. This is not based on that. This is based
primarily on the 8250 support throughout the kernel - on the assumption
that it is the heaviest used and therefore most likely well tested and
debugged code. However the 8250 is also about the most complex serial
driver with the largest set of special cases, features and work arrounds
- almost none of which are relevant to the Xilinx UartLite. I separately
relied on the m32r_sio driver as an example of a driver that had all the
features I needed for the UartLite without the excess of the 8250. The
relationship of this driver to those two should deliberately be very
obvious on inspection. Where possible defines, registers, functions, ...
were all named to match those of the 8250.
	This driver is only currently tested in the Pico E12, with a single
UartLite without interrupts. I do not currently have access to other
systems with multiple Xilinx UartLites. It is intended to work anywhere
the Xilinux UartLite can be implemented in whatever numbers are desired
- as such it should work interrupt driven for 4 UartLites in uCLinux for
the MicroBlaze, but I have no way to test that. The know working
environment is a single polled UartLite on a PPC405 in a Pico E12.

	Further I am new to Linux porting, and the whole Kernel developers tool
suite and culture. I have tried to make this as conforming to those
norms as possible, but there are certainly ways I have failed. I have
extracted the UartLite driver from the rest of the Pico E12 effort and I
am preparing to submit it as a separate patch. I have verified that it
builds outside of the constraints of a Pico E12. But I have no way of
testing it outside that environment. I hope to be submitting additional
patches for the Virtex-4, the Pico E-12 and the E-12 unique hardware, as
I have them ready.


# Updated but not checked in:
#   (will commit)
#
#	modified: arch/ppc/boot/common/misc-common.c
#	modified: arch/ppc/boot/simple/Makefile
#	modified: arch/ppc/boot/simple/misc-embedded.c
#	modified: arch/ppc/boot/simple/misc.c
#	new file: arch/ppc/boot/simple/uartlite_tty.c
#	modified: arch/ppc/syslib/Makefile
#	modified: arch/ppc/syslib/ppc4xx_setup.c
#	new file: arch/ppc/syslib/uartlite.h
#	new file: arch/ppc/syslib/uartlite_dbg.c
#	modified: drivers/serial/Kconfig
#	modified: drivers/serial/Makefile
#	new file: drivers/serial/uartlite.c
#	new file: drivers/serial/uartlite_early.c
#	modified: include/linux/serial.h
#	modified: include/linux/serial_core.h
#	new file: include/linux/serial_uartlite.h
#
#


[-- Attachment #2: uartlite.diff --]
[-- Type: text/plain, Size: 60764 bytes --]

diff --git a/arch/ppc/boot/common/misc-common.c b/arch/ppc/boot/common/misc-common.c
index e79e6b3..883bbc7 100644
--- a/arch/ppc/boot/common/misc-common.c
+++ b/arch/ppc/boot/common/misc-common.c
@@ -60,7 +60,8 @@ unsigned char *ISA_io = NULL;
 
 #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
 	|| defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
-	|| defined(CONFIG_SERIAL_MPSC_CONSOLE)
+	|| defined(CONFIG_SERIAL_MPSC_CONSOLE) \
+	|| defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
 extern unsigned long com_port;
 
 extern int serial_tstc(unsigned long com_port);
@@ -83,7 +84,8 @@ int tstc(void)
 {
 #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
 	|| defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
-	|| defined(CONFIG_SERIAL_MPSC_CONSOLE)
+	|| defined(CONFIG_SERIAL_MPSC_CONSOLE) \
+	|| defined(CONFIG_SERIAL_UARTLITE_CONSOLE) 
 	if(keyb_present)
 		return (CRT_tstc() || serial_tstc(com_port));
 	else
@@ -98,7 +100,8 @@ int getc(void)
 	while (1) {
 #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
 	|| defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
-	|| defined(CONFIG_SERIAL_MPSC_CONSOLE)
+	|| defined(CONFIG_SERIAL_MPSC_CONSOLE) \
+	|| defined(CONFIG_SERIAL_UARTLITE_CONSOLE) 
 		if (serial_tstc(com_port))
 			return (serial_getc(com_port));
 #endif /* serial console */
@@ -115,7 +118,8 @@ putc(const char c)
 
 #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
 	|| defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
-	|| defined(CONFIG_SERIAL_MPSC_CONSOLE)
+	|| defined(CONFIG_SERIAL_MPSC_CONSOLE) \
+	|| defined(CONFIG_SERIAL_UARTLITE_CONSOLE) 
 	serial_putc(com_port, c);
 	if ( c == '\n' )
 		serial_putc(com_port, '\r');
@@ -164,7 +168,8 @@ void puts(const char *s)
 	while ( ( c = *s++ ) != '\0' ) {
 #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
 	|| defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
-	|| defined(CONFIG_SERIAL_MPSC_CONSOLE)
+	|| defined(CONFIG_SERIAL_MPSC_CONSOLE) \
+	|| defined(CONFIG_SERIAL_UARTLITE_CONSOLE) 
 	        serial_putc(com_port, c);
 	        if ( c == '\n' ) serial_putc(com_port, '\r');
 #endif /* serial console */
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index 9533f8d..917f3fd 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -204,6 +204,7 @@ boot-$(CONFIG_8260)		+= m8260_tty.o
 endif
 boot-$(CONFIG_SERIAL_MPC52xx_CONSOLE)	+= mpc52xx_tty.o
 boot-$(CONFIG_SERIAL_MPSC_CONSOLE)	+= mv64x60_tty.o
+boot-$(CONFIG_SERIAL_UARTLITE_CONSOLE)	+= uartlite_tty.o
 
 LIBS				:= $(common)/lib.a $(bootlib)/lib.a
 ifeq ($(CONFIG_PPC_PREP),y)
diff --git a/arch/ppc/boot/simple/misc-embedded.c b/arch/ppc/boot/simple/misc-embedded.c
index 3865f3f..c0e7b54 100644
--- a/arch/ppc/boot/simple/misc-embedded.c
+++ b/arch/ppc/boot/simple/misc-embedded.c
@@ -90,7 +90,7 @@ load_kernel(unsigned long load_addr, int
 	 * initialize the serial console port.
 	 */
 	embed_config(&bp);
-#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE)
+#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) || defined(CONFIG_SERIAL_UARTLITE_CONSOLE) 
 	com_port = serial_init(0, bp);
 #endif
 
@@ -267,7 +267,7 @@ load_kernel(unsigned long load_addr, int
 		rec = (struct bi_record *)((unsigned long)rec + rec->size);
 	}
 	puts("Now booting the kernel\n");
-#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE)
+#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) || defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
 	serial_close(com_port);
 #endif
 
diff --git a/arch/ppc/boot/simple/misc.c b/arch/ppc/boot/simple/misc.c
index f415d6c..26666c7 100644
--- a/arch/ppc/boot/simple/misc.c
+++ b/arch/ppc/boot/simple/misc.c
@@ -51,7 +51,8 @@
 #if (defined(CONFIG_SERIAL_8250_CONSOLE) \
 	|| defined(CONFIG_VGA_CONSOLE) \
 	|| defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
-	|| defined(CONFIG_SERIAL_MPSC_CONSOLE)) \
+	|| defined(CONFIG_SERIAL_MPSC_CONSOLE) \
+	|| defined(CONFIG_SERIAL_UARTLITE_CONSOLE)) \
 	&& !defined(CONFIG_GEMINI)
 #define INTERACTIVE_CONSOLE	1
 #endif
diff --git a/arch/ppc/boot/simple/uartlite_tty.c b/arch/ppc/boot/simple/uartlite_tty.c
new file mode 100644
index 0000000..d08e0f8
--- /dev/null
+++ b/arch/ppc/boot/simple/uartlite_tty.c
@@ -0,0 +1,104 @@
+/*
+ * arch/ppc/boot/simple/uartlite_tty.c
+ *
+ * Bootloader version of the embedded Xilinx/UARTLITE driver.
+ *
+ *  Author: David H. Lynch Jr. <dhlii@dlasys.net>
+ *  Copyright (C) 2005 DLA Systems
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ *  $Id: uartlite.c,v 0.10 2005/12/14 10:03:27 dhlii Exp $
+ *
+ * heavily based on the equivalent 8250 code.
+ * serial_getc is untested
+ *  
+ */
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/serial.h>
+#include <asm/serial.h>
+#include "nonstdio.h"
+#include "serial.h"
+
+#include <linux/serial_uartlite.h>
+
+
+static struct serial_state rs_table[RS_TABLE_SIZE] = {
+	SERIAL_PORT_DFNS	/* Defined in <asm/serial.h> */
+};
+
+static int shift;
+
+unsigned long
+serial_init(int chan, void *ignored)
+{
+	unsigned long com_port;
+
+	/* We need to find out which type io we're expecting.  If it's
+	 * 'SERIAL_IO_PORT', we get an offset from the isa_io_base.
+	 * If it's 'SERIAL_IO_MEM', we can the exact location.  -- Tom */
+	switch (rs_table[chan].io_type) {
+		case SERIAL_IO_PORT:
+			com_port = rs_table[chan].port;
+			break;
+		case SERIAL_IO_MEM:
+			com_port = (unsigned long)rs_table[chan].iomem_base;
+			break;
+		default:
+			/* We can't deal with it. */
+			return -1;
+	}
+
+	/* How far apart the registers are. */
+	shift = rs_table[chan].iomem_reg_shift;
+	return (com_port);
+}
+
+void
+serial_putc(unsigned long com_port, unsigned char c)
+{
+    unsigned int status ;
+    do {
+	    status =  serial_in32(com_port, UART_LSR);
+    } while ( status & UART_LSR_TXF);
+    serial_out32(com_port, UART_TX, c);
+}
+
+unsigned char
+serial_getc(unsigned long com_port)
+{
+	unsigned int status ;
+	return 0;
+	do {
+		status = serial_in32(com_port, UART_LSR);
+	}	while ((status  & UART_LSR_DR) == 0) ;
+	return serial_in32(com_port, UART_RX);
+}
+
+int
+serial_tstc(unsigned long com_port)
+{
+	unsigned int status ;
+	return 0;
+	status = serial_in32(com_port, UART_LSR);
+	return (status & UART_LSR_DR);
+}
+
+void
+serial_close(unsigned long com_port)
+{
+}
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index 5b7f2b8..004b0ec 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -86,6 +86,9 @@ endif
 ifeq ($(CONFIG_SERIAL_MPSC_CONSOLE),y)
 obj-$(CONFIG_SERIAL_TEXT_DEBUG)	+= mv64x60_dbg.o
 endif
+ifeq ($(CONFIG_SERIAL_UARTLITE_CONSOLE),y)
+obj-$(CONFIG_SERIAL_TEXT_DEBUG)	+= uartlite_dbg.o
+endif
 obj-$(CONFIG_BOOTX_TEXT)	+= btext.o
 obj-$(CONFIG_MPC10X_BRIDGE)	+= mpc10x_common.o ppc_sys.o
 obj-$(CONFIG_MPC10X_OPENPIC)	+= open_pic.o
diff --git a/arch/ppc/syslib/ppc4xx_setup.c b/arch/ppc/syslib/ppc4xx_setup.c
index e83a83f..815bac3 100644
--- a/arch/ppc/syslib/ppc4xx_setup.c
+++ b/arch/ppc/syslib/ppc4xx_setup.c
@@ -41,7 +41,11 @@
 #include <asm/pci-bridge.h>
 #include <asm/bootinfo.h>
 
+#if defined(CONFIG_SERIAL_8250)
 #include <syslib/gen550.h>
+#elif defined(CONFIG_SERIAL_UARTLITE)
+#include <syslib/uartlite.h>
+#endif
 
 /* Function Prototypes */
 extern void abort(void);
@@ -270,7 +274,11 @@ ppc4xx_init(unsigned long r3, unsigned l
 	ppc_md.setup_io_mappings = ppc4xx_map_io;
 
 #ifdef CONFIG_SERIAL_TEXT_DEBUG
+#if defined(CONFIG_SERIAL_8250)
 	ppc_md.progress = gen550_progress;
+#elif defined(CONFIG_SERIAL_UARTLITE)
+	ppc_md.progress = uartlite_progress;
+#endif
 #endif
 
 #if defined(CONFIG_PCI) && defined(CONFIG_IDE)
diff --git a/arch/ppc/syslib/uartlite.h b/arch/ppc/syslib/uartlite.h
new file mode 100644
index 0000000..4c5f379
--- /dev/null
+++ b/arch/ppc/syslib/uartlite.h
@@ -0,0 +1,18 @@
+/*
+ * arch/ppc/syslib/uartlite.h
+ *
+ * uartlite prototypes
+ *
+ * Matt Porter <mporter@kernel.crashing.org>
+ *
+ * 2004 (c) MontaVista Software, Inc.  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.
+ */
+
+extern void uartlite_progress(char *, unsigned short);
+extern void uartlite_puts(char *);
+// extern void uartlite_putc(char);
+extern void uartlite_init(int, struct uart_port *);
+extern void uartlite_kgdb_map_scc(void);
diff --git a/arch/ppc/syslib/uartlite_dbg.c b/arch/ppc/syslib/uartlite_dbg.c
new file mode 100644
index 0000000..d666122
--- /dev/null
+++ b/arch/ppc/syslib/uartlite_dbg.c
@@ -0,0 +1,162 @@
+/*
+ * arch/ppc/syslib/uartlite_dbg.c
+ *
+ * Bootloader version of the embedded Xilinx/UARTLITE driver.
+ *
+ *  Author: David H. Lynch Jr. <dhlii@dlasys.net>
+ *  Copyright (C) 2005 DLA Systems
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ *  $Id: uartlite.c,v 0.10 2005/12/14 10:03:27 dhlii Exp $
+ *
+ *  Heavily based on equivalent 8250 code.
+ *  uartlite_getc() is untested.
+ */
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/serial.h>
+#include <linux/tty.h>		/* For linux/serial_core.h */
+#include <linux/serial_core.h>
+#include <linux/serialP.h>
+#include <asm/serial.h>
+
+void uartlite_puts(char *s);
+
+/* SERIAL_PORT_DFNS is defined in <asm/serial.h> */
+#ifndef SERIAL_PORT_DFNS
+#define SERIAL_PORT_DFNS
+#endif
+
+#include <linux/serial_uartlite.h>
+
+
+static struct serial_state rs_table[RS_TABLE_SIZE] = {
+	SERIAL_PORT_DFNS	/* Defined in <asm/serial.h> */
+};
+
+static int shift;
+
+unsigned long
+serial_init(int chan, void *ignored)
+{
+	unsigned long com_port;
+
+	/* We need to find out which type io we're expecting.  If it's
+	 * 'SERIAL_IO_PORT', we get an offset from the isa_io_base.
+	 * If it's 'SERIAL_IO_MEM', we can the exact location.  -- Tom */
+	switch (rs_table[chan].io_type) {
+		case SERIAL_IO_PORT:
+			com_port = rs_table[chan].port;
+			break;
+		case SERIAL_IO_MEM:
+			com_port = (unsigned long)rs_table[chan].iomem_base;
+			break;
+		default:
+			/* We can't deal with it. */
+			uartlite_puts("serial_init - oops");
+			return -1;
+	}
+
+	/* How far apart the registers are. */
+	shift = rs_table[chan].iomem_reg_shift;
+	return (com_port);
+}
+
+void
+serial_putc(unsigned long com_port, unsigned char c)
+{
+    unsigned int status ;
+    do {
+	    status =  serial_in32(com_port, UART_LSR);
+    } while ( status & UART_LSR_TXF);
+    serial_out32(com_port, UART_TX, c);
+}
+
+void
+uartlite_puts(char *s)
+{
+	volatile unsigned int progress_debugport;
+	volatile char c;
+
+	progress_debugport = XPAR_OPB_UARTLITE_0_BASEADDR;
+	while ((c = *s++) != 0)
+		serial_putc(progress_debugport, c);
+
+	serial_putc(progress_debugport, '\n');
+	serial_putc(progress_debugport, '\r');
+}
+
+unsigned char
+serial_getc(unsigned long com_port)
+{
+	unsigned int status ;
+	return 0;
+	do {
+		status = serial_in32(com_port, UART_LSR) ;
+	} while (!( status & UART_LSR_DR)) ;
+	return serial_in32(com_port, UART_RX);
+}
+
+int
+serial_tstc(unsigned long com_port)
+{
+	unsigned int status ;
+	return 0;
+	status = serial_in32(com_port, UART_LSR);
+	return (status & UART_LSR_DR);
+}
+
+void
+serial_close(unsigned long com_port)
+{
+}
+void
+uartlite_init(int i, struct uart_port *serial_req)
+{
+	rs_table[i].io_type = serial_req->iotype;
+	rs_table[i].port = serial_req->iobase;
+	rs_table[i].iomem_base = serial_req->membase;
+	rs_table[i].iomem_reg_shift = serial_req->regshift;
+	rs_table[i].baud_base =  BASE_BAUD;
+}
+
+#ifdef CONFIG_SERIAL_TEXT_DEBUG
+void
+uartlite_progress(char *s, unsigned short hex)
+{
+	volatile unsigned int progress_debugport;
+	volatile char c;
+
+	progress_debugport = serial_init(0, NULL);
+
+	serial_putc(progress_debugport, '\r');
+
+	while ((c = *s++) != 0)
+		serial_putc(progress_debugport, c);
+
+	serial_putc(progress_debugport, '\n');
+	serial_putc(progress_debugport, '\r');
+}
+void
+ul_putc(char c)
+{
+	volatile unsigned int progress_debugport;
+	progress_debugport = serial_init(0, NULL);
+
+	serial_putc(progress_debugport, c);
+}
+#endif /* CONFIG_SERIAL_TEXT_DEBUG */
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 812bae6..eb8b60a 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -396,6 +396,28 @@ config SERIAL_MPSC_CONSOLE
 	help
 	  Say Y here if you want to support a serial console on a Marvell MPSC.
 
+config SERIAL_UARTLITE
+	bool "Xilinx UARTLITE serial port support"
+	depends on PPC32
+	select SERIAL_CORE
+	help
+	  Say Y here if you want to use the Xilinx UARTLITE serial controller.
+
+config SERIAL_UARTLITE_CONSOLE
+	bool "Support for console on Xilinx UARTLITE serial port"
+	depends on SERIAL_UARTLITE
+	select SERIAL_CORE_CONSOLE
+	help
+	  Say Y here if you want to support a serial console on a Xilinx UARTLITE.
+
+config SERIAL_UARTLITE_NR_UARTS
+	int "Maximum number of Xilinx UARTLITE serial ports"
+	depends on SERIAL_UARTLITE
+	default "1"
+	help
+	  Set this to the number of serial ports you want the driver
+	  to support.  
+
 config SERIAL_PXA
 	bool "PXA serial port support"
 	depends on ARM && ARCH_PXA
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index d7c7c71..54c5343 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -14,9 +14,11 @@ serial-8250-$(CONFIG_HP300) += 8250_hp30
 obj-$(CONFIG_SERIAL_CORE) += serial_core.o
 obj-$(CONFIG_SERIAL_21285) += 21285.o
 obj-$(CONFIG_SERIAL_8250) += 8250.o $(serial-8250-y)
+obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o 
 obj-$(CONFIG_SERIAL_8250_CS) += serial_cs.o
 obj-$(CONFIG_SERIAL_8250_ACORN) += 8250_acorn.o
 obj-$(CONFIG_SERIAL_8250_CONSOLE) += 8250_early.o
+#obj-$(CONFIG_SERIAL_UARTLITE_CONSOLE) += uartlite_early.o
 obj-$(CONFIG_SERIAL_8250_FOURPORT) += 8250_fourport.o
 obj-$(CONFIG_SERIAL_8250_ACCENT) += 8250_accent.o
 obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_boca.o
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
new file mode 100644
index 0000000..7efe233
--- /dev/null
+++ b/drivers/serial/uartlite.c
@@ -0,0 +1,1333 @@
+/*
+ *  linux/drivers/serial/uartlite.c
+ *
+ *  Driver for uartlite ports
+ *
+ *  Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
+ *  Based on drivers/serial/8250.c.
+ *  Based on drivers/serial/m32r_sio.c.
+ *
+ *  Author: David H. Lynch Jr. <dhlii@dlasys.net>
+ *  Copyright (C) 2005 DLA Systems
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ *  $Id: uartlite.c,v 0.10 2005/12/14 10:03:27 dhlii Exp $
+ *
+ * A note about mapbase / membase
+ *
+ *  mapbase is the physical address of the IO port.  Currently, we don't
+ *  support this very well, and it may well be dropped from this driver
+ *  in future.  As such, mapbase should be NULL.
+ *
+ *  membase is an 'ioremapped' cookie.  This is compatible with the old
+ *  serial.c driver, and is currently the preferred form.
+ *
+ * The Xilinx UartLite is a fairly simple fixed Baud Rate Uart with a 16 byte Fifo
+ * This driver borrows very heavily from drivers/serial/8250.c on the 
+ * assumption that the 8250 driver is likely to be very heavily tested.
+ * As there is significant complexity to the 8250 driver that has no meaning for the 
+ * Xilinx UartLite I have relied on drivers/serial/m32r_sio.c to work out simplifications.
+ * as much as possible functions, UART registers and bits where named to match the 8250.
+ * 
+ */
+
+
+#define tx_enabled(port)	((port)->unused[0])
+#define rx_enabled(port)	((port)->unused[1])
+
+#include <linux/config.h>
+
+#if defined(CONFIG_SERIAL_UARTLITE_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+#define SUPPORT_SYSRQ
+#endif
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/console.h>
+#include <linux/delay.h>
+#include <linux/tty.h>
+#include <linux/serial_core.h>
+#include <linux/serial.h>
+#include <linux/serial_uartlite.h>
+#include <asm/io.h>
+#include <linux/sysrq.h>
+#include <asm/irq.h>
+
+#define IS_INT 0			// enable interupt driven - untested
+#define IS_TXI 0			// interupt driven sends
+
+/*
+ * Debugging.
+ */
+#if 0
+#define DEBUG_AUTOCONF(fmt...)	printk(fmt)
+#else
+#define DEBUG_AUTOCONF(fmt...)	do { } while (0)
+#endif
+
+#if 0
+#define DEBUG_INTR(fmt...)	printk(fmt)
+#else
+#define DEBUG_INTR(fmt...)	do { } while (0)
+#endif
+
+#define UARTLITE_ISR_PASS_LIMIT	256
+#define PORT_UARTLITE_BASE	PORT_UARTLITE
+#define PORT_INDEX(x)	(x - PORT_UARTLITE_BASE + 1)
+
+/*
+ * We default to -1 (0 is actually used) for the "no irq" hack.   Some
+ * machine types want others as well - they're free
+ * to redefine this in their header file.
+ */
+#define is_real_interrupt(irq)	((irq) >= 0)
+
+/*
+ * SERIAL_PORT_DFNS tells us about built-in ports that have no
+ * standard enumeration mechanism.   Platforms that can find all
+ * serial ports via mechanisms like ACPI or PCI need not supply it.
+ */
+#ifndef SERIAL_PORT_DFNS
+#define SERIAL_PORT_DFNS
+#endif
+
+static struct old_serial_port old_serial_port[] = {
+	SERIAL_PORT_DFNS /* defined in asm/serial.h */
+};
+
+#define UART_NR	CONFIG_SERIAL_UARTLITE_NR_UARTS
+
+struct uartlite_port {
+	struct uart_port	port;
+	struct timer_list	timer;		/* "no irq" timer */
+	struct list_head	list;		/* ports on this IRQ */
+	unsigned short		capabilities;	/* port capabilities */
+	unsigned char		ier;
+	unsigned char		lcr;
+	unsigned char		mcr;
+	unsigned char		lsr_break_flag;
+	unsigned int		count;	
+
+	/*
+	 * We provide a per-port pm hook.
+	 */
+	void			(*pm)(struct uart_port *port,
+				      unsigned int state, unsigned int old);
+};
+
+struct irq_info {
+	spinlock_t		lock;
+	struct list_head	*head;
+};
+
+static struct irq_info irq_lists[NR_IRQS];
+
+/*
+ * Here we define the default xmit fifo size used for each type of UART.
+ */
+static const struct serial_uartlite_config uart_config[] = {
+	[PORT_UNKNOWN] = {
+		.name		= "unknown",
+		.fifo_size	= 1,
+		.flags		= 0,
+	},
+	[PORT_INDEX(PORT_UARTLITE)] = {
+		.name		= "uartlite",
+		.fifo_size	= 16,
+		.flags		= UART_CAP_FIFO,
+	},
+};
+
+static _INLINE_ unsigned int serial_in(struct uartlite_port *up, int offset)
+{
+	unsigned int value;
+	offset <<= up->port.regshift;
+
+	switch (up->port.iotype) {
+	default:
+		value = (*(volatile unsigned int *) ( up->port.membase + offset)); 
+		__asm__ __volatile__("eieio");
+		return value;
+	}
+}
+
+static _INLINE_ void
+serial_out(struct uartlite_port *up, int offset, int value)
+{
+	offset <<= up->port.regshift;
+
+	switch (up->port.iotype) {
+	default:
+ 		(*(volatile unsigned int *)( up->port.membase + offset) =value); 
+ 		__asm__ __volatile__("eieio");
+		break;
+
+	}
+}
+
+static struct uartlite_port uartlite_ports[UART_NR];
+
+/*
+ *	Wait for transmitter & holding register to empty
+ */
+static inline void 
+uartlite_wait_for_xmitr_empty(struct uartlite_port *up)
+{
+	unsigned int status, tmout = 10000;
+
+	/* Wait up to 10ms for the character(s) to be sent. */
+	do {
+		status = serial_in(up, UART_LSR);
+
+		if (status & UART_LSR_BI)
+			up->lsr_break_flag = UART_LSR_BI;
+
+		if (--tmout == 0)
+			break;
+		udelay(1);
+	} while (status & UART_LSR_TXF);
+
+	/* Wait up to 1s for flow control if necessary */
+	if (up->port.flags & UPF_CONS_FLOW) {
+		tmout = 1000000;
+		while (--tmout)
+			udelay(1);
+	}
+}
+
+void
+uartlite_putc(struct uartlite_port *up, unsigned char c)
+{
+	serial_out(up, UART_TX, c);
+	if (c == '\r') 
+		up->count = 0;
+	if (up->count >= 85) 
+		uartlite_putc(up, '\r');
+}
+void
+uartlite_putchar(struct uartlite_port *up, unsigned char c)
+{
+	uartlite_wait_for_xmitr_empty(up);
+	uartlite_putc(up,c);
+}
+
+unsigned char
+uartlite_getc(struct uartlite_port *up)
+{
+		return serial_in(up, UART_RX);
+}
+
+void
+uartlite_set_ier(struct uartlite_port *up, unsigned int ier)
+{
+	serial_out(up, UART_IER, ier);
+}
+
+
+static void serial_reset( struct uartlite_port *up)
+{
+	(void) serial_in(up, UART_LSR);
+	(void) serial_in(up, UART_RX);
+}
+
+static void serial_init( struct uartlite_port *up)
+{
+
+	up->capabilities = uart_config[up->port.type].flags;
+	up->mcr = 0;
+	up->ier = 0;
+
+
+	/*
+	 * Clear the FIFO buffers and disable them.
+	 * (they will be reeanbled in set_termios())
+	 */
+	up->ier &= ~(UART_LCR_RXF | UART_LCR_TXF);
+	uartlite_set_ier(up, up->ier);
+
+	/*
+	 * Clear the interrupt registers.
+	 */
+	(void) serial_in(up, UART_LSR);
+	(void) serial_in(up, UART_RX);
+	if (up->capabilities & UART_CAP_FIFO) {
+		// there is no FIFO enable/disable for the Uart Lite
+	}
+}
+/*
+	Stop transmitting characters.  This might be due to the CTS
+	line becoming inactive or the tty layer indicating we want
+	to stop transmission due to an XOFF character.
+
+	Locking: up->lock taken.
+	Interrupts: locally disabled.
+	This call must not sleep
+*/
+static void uartlite_stop_tx(struct uart_port *port)
+{
+	// struct uartlite_port *up = (struct uartlite_port *)port;
+
+	if (tx_enabled(port)) {
+		// disable_irq(IRQ_XXX);	
+		tx_enabled(port) = 0;
+	}
+}
+static _INLINE_ void transmit_chars(struct uartlite_port *up)
+{
+	struct circ_buf *xmit = &up->port.info->xmit;
+	int count;
+
+	if (up->port.x_char) {
+		uartlite_putc(up, up->port.x_char);
+		up->port.icount.tx++;
+		up->port.x_char = 0;
+		return;
+	}
+	if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
+		uartlite_stop_tx(&up->port);
+		return;
+	}
+
+	count = up->port.fifosize;
+	do {
+		uartlite_putc(up, xmit->buf[xmit->tail]);
+		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
+		up->port.icount.tx++;
+		if (uart_circ_empty(xmit))
+			break;
+		// while (!serial_in(up, UART_LSR) & UART_LSR_THRE);
+
+	} while (--count > 0);
+	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
+		uart_write_wakeup(&up->port);
+
+	DEBUG_INTR("THRE...");
+
+	if (uart_circ_empty(xmit))
+		uartlite_stop_tx(&up->port);
+}
+/*
+	start transmitting characters.
+
+	Locking: up->lock taken.
+	Interrupts: locally disabled.
+	This call must not sleep
+*/
+
+static void uartlite_start_tx(struct uart_port *port)
+{
+	struct uartlite_port *up = (struct uartlite_port *)port;
+#if IS_TXI
+	struct circ_buf *xmit = &up->port.info->xmit;
+#endif
+	unsigned long flags;
+	
+
+	if (!tx_enabled(port)) {
+		// enable_irq(IRQ_XXX);
+		tx_enabled(port) = 1;
+	}
+#if IS_TXI
+	if (!(up->ier & UART_IER_THRI)) {				// are TX interupts enabled ?
+	
+		up->ier |= UART_IER_THRI;				// enable them
+		uartlite_set_ier(up, up->ier);
+
+		uartlite_putc(up, xmit->buf[xmit->tail]);		// send 1 character to kick things
+		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
+		up->port.icount.tx++;
+	}
+	//while((serial_in(up, UART_LSR) & UART_EMPTY) != UART_EMPTY);
+#else
+	if (port) {
+		//disable_irq(up->irqs[SCIx_TXI_IRQ]);
+		spin_lock_irqsave(&up->port.lock, flags);
+		transmit_chars(up);
+		spin_unlock_irqrestore(&up->port.lock, flags);
+		//enable_irq(up->irqs[SCIx_TXI_IRQ]);
+	}
+#endif
+}
+
+static void uartlite_stop_rx(struct uart_port *port)
+{
+	struct uartlite_port *up = (struct uartlite_port *)port;
+
+	up->ier &= ~UART_IER_RLSI;					// disable receive interrupts
+	up->port.read_status_mask &= ~UART_LSR_DR;
+	uartlite_set_ier(up, up->ier);
+}
+/*
+	Enable the modem status interrupts.
+
+	Locking: up->lock taken.
+	Interrupts: locally disabled.
+	This call must not sleep
+*/
+static void uartlite_enable_ms(struct uart_port *port)
+{
+}
+
+static _INLINE_ void
+receive_chars(struct uartlite_port *up, int *status, struct pt_regs *regs)
+{
+	struct tty_struct *tty = up->port.info->tty;
+	unsigned char ch, lsr = *status;
+	int max_count = 256;
+	char flag;
+
+	do {
+		/* The following is not allowed by the tty layer and
+		   unsafe. It should be fixed ASAP */
+		if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) {
+			if (tty->low_latency) {
+				spin_unlock(&up->port.lock);
+				tty_flip_buffer_push(tty);
+				spin_lock(&up->port.lock);
+			}
+			/*
+			 * If this failed then we will throw away the
+			 * bytes but must do so to clear interrupts
+			 */
+		}
+		ch = uartlite_getc(up);
+		flag = TTY_NORMAL;
+		up->port.icount.rx++;
+
+#ifdef CONFIG_SERIAL_UARTLITE_CONSOLE
+		/*
+		 * Recover the break flag from console xmit
+		 */
+		if (up->port.line == up->port.cons->index) {
+			lsr |= up->lsr_break_flag;
+			up->lsr_break_flag = 0;
+		}
+#endif
+
+		if (unlikely(lsr & (UART_LSR_BI | UART_LSR_PE |
+				    UART_LSR_FE | UART_LSR_OE))) {
+			/*
+			 * For statistics only
+			 */
+			if (lsr & UART_LSR_BI) {
+				lsr &= ~(UART_LSR_FE | UART_LSR_PE);
+				up->port.icount.brk++;
+				/*
+				 * We do the SysRQ and SAK checking
+				 * here because otherwise the break
+				 * may get masked by ignore_status_mask
+				 * or read_status_mask.
+				 */
+				if (uart_handle_break(&up->port))
+					goto ignore_char;
+			} else if (lsr & UART_LSR_PE)
+				up->port.icount.parity++;
+			else if (lsr & UART_LSR_FE)
+				up->port.icount.frame++;
+			if (lsr & UART_LSR_OE)
+				up->port.icount.overrun++;
+
+			/*
+			 * Mask off conditions which should be ignored.
+			 */
+			lsr &= up->port.read_status_mask;
+
+			if (lsr & UART_LSR_BI) {
+				DEBUG_INTR("handling break....");
+				flag = TTY_BREAK;
+			} else if (lsr & UART_LSR_PE)
+				flag = TTY_PARITY;
+			else if (lsr & UART_LSR_FE)
+				flag = TTY_FRAME;
+		}
+		if (uart_handle_sysrq_char(&up->port, ch, regs))
+			goto ignore_char;
+
+		uart_insert_char(&up->port, lsr, UART_LSR_OE, ch, flag);
+
+	ignore_char:
+		lsr = serial_in(up, UART_LSR);
+	} while ((lsr & UART_LSR_DR) && (max_count-- > 0));
+	spin_unlock(&up->port.lock);
+	tty_flip_buffer_push(tty);
+	spin_lock(&up->port.lock);
+	*status = lsr;
+}
+
+
+/*
+ * This handles the interrupt from one port.
+ */
+static inline void
+uartlite_handle_port(struct uartlite_port *up, struct pt_regs *regs)
+{
+	unsigned int status = serial_in(up, UART_LSR);
+
+	DEBUG_INTR("status = %x...", status);
+	if (status & UART_LSR_DR)
+		receive_chars(up, &status, regs);
+#if IS_TXI
+	if (!(status & UART_LSR_TXF))
+		transmit_chars(up);
+#endif
+}
+
+#if IS_INT
+/*
+ * This is the serial driver's interrupt routine.
+ *
+ * Arjan thinks the old way was overly complex, so it got simplified.
+ * Alan disagrees, saying that need the complexity to handle the weird
+ * nature of ISA shared interrupts.  (This is a special exception.)
+ *
+ * In order to handle ISA shared interrupts properly, we need to check
+ * that all ports have been serviced, and therefore the ISA interrupt
+ * line has been de-asserted.
+ *
+ * This means we need to loop through all ports. checking that they
+ * don't have an interrupt pending.
+ */
+static irqreturn_t uartlite_interrupt(int irq, void *dev_id,
+	struct pt_regs *regs)
+{
+	struct irq_info *i = dev_id;
+	struct list_head *l, *end = NULL;
+	int pass_counter = 0, handled = 0;
+
+	DEBUG_INTR("uartlite_interrupt(%d)...", irq);
+
+	spin_lock(&i->lock);
+
+	l = i->head;
+	do {
+		struct uartlite_port *up;
+		unsigned int iir;
+
+		up = list_entry(l, struct uartlite_port, list);
+
+		iir = serial_in(up, UART_IIR);
+		if (!(iir & UART_IIR_NO_INT)) {
+			spin_lock(&up->port.lock);
+			uartlite_handle_port(up, regs);
+			spin_unlock(&up->port.lock);
+
+			handled = 1;
+
+			end = NULL;
+		} else if (end == NULL)
+			end = l;
+
+		l = l->next;
+
+		if (l == i->head && pass_counter++ > UARTLITE_ISR_PASS_LIMIT) {
+			/* If we hit this, we're dead. */
+			printk(KERN_ERR "uartlite: too much work for "
+				"irq%d\n", irq);
+			break;
+		}
+	} while (l != end);
+
+	spin_unlock(&i->lock);
+
+	DEBUG_INTR("end.\n");
+
+	return IRQ_RETVAL(handled);
+}
+
+/*
+ * To support ISA shared interrupts, we need to have one interrupt
+ * handler that ensures that the IRQ line has been deasserted
+ * before returning.  Failing to do this will result in the IRQ
+ * line being stuck active, and, since ISA irqs are edge triggered,
+ * no more IRQs will be seen.
+ */
+static void serial_do_unlink(struct irq_info *i, struct uartlite_port *up)
+{
+	spin_lock_irq(&i->lock);
+
+	if (!list_empty(i->head)) {
+		if (i->head == &up->list)
+			i->head = i->head->next;
+		list_del(&up->list);
+	} else {
+		BUG_ON(i->head != &up->list);
+		i->head = NULL;
+	}
+
+	spin_unlock_irq(&i->lock);
+}
+
+static int serial_link_irq_chain(struct uartlite_port *up)
+{
+	struct irq_info *i = irq_lists + up->port.irq;
+	int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? SA_SHIRQ : 0;
+
+	spin_lock_irq(&i->lock);
+
+	if (i->head) {
+		list_add(&up->list, i->head);
+		spin_unlock_irq(&i->lock);
+
+		ret = 0;
+	} else {
+		INIT_LIST_HEAD(&up->list);
+		i->head = &up->list;
+		spin_unlock_irq(&i->lock);
+
+		ret = request_irq(up->port.irq, uartlite_interrupt,
+				  irq_flags, "serial", i);
+		if (ret < 0)
+			serial_do_unlink(i, up);
+	}
+
+	return ret;
+}
+
+static void serial_unlink_irq_chain(struct uartlite_port *up)
+{
+	struct irq_info *i = irq_lists + up->port.irq;
+
+	BUG_ON(i->head == NULL);
+
+	if (list_empty(i->head))
+		free_irq(up->port.irq, i);
+
+	serial_do_unlink(i, up);
+}
+#endif
+/*
+ * This function is used to handle ports that do not have an interrupt.
+ */
+static void uartlite_timeout(unsigned long data)
+{
+	struct uartlite_port *up = (struct uartlite_port *)data;
+	unsigned int timeout;
+	unsigned int iir;
+
+	iir = serial_in(up, UART_IIR);
+	if (!(iir & UART_IIR_NO_INT)) {
+		spin_lock(&up->port.lock);
+		uartlite_handle_port(up, NULL);
+		spin_unlock(&up->port.lock);
+	}
+
+	timeout = up->port.timeout;
+	timeout = timeout > 6 ? (timeout / 2 - 2) : 1;
+	mod_timer(&up->timer, jiffies + timeout);
+}
+/*
+	This function tests whether the transmitter fifo and shifter
+	for the port described by 'port' is empty.  If it is empty,
+	this function should return TIOCSER_TEMT, otherwise return 0.
+	If the port does not support this operation, then it should
+	return TIOCSER_TEMT.
+
+	Locking: none.
+	Interrupts: caller dependent.
+	This call must not sleep
+*/
+static unsigned int uartlite_tx_empty(struct uart_port *port)
+{
+	struct uartlite_port *up = (struct uartlite_port *)port;
+	unsigned long flags;
+	unsigned int ret;
+
+	spin_lock_irqsave(&up->port.lock, flags);
+	ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
+	spin_unlock_irqrestore(&up->port.lock, flags);
+	return ret;
+}
+/*
+	Returns the current state of modem control inputs.  The state
+	of the outputs should not be returned, since the core keeps
+	track of their state.  The state information should include:
+		- TIOCM_DCD	state of DCD signal
+		- TIOCM_CTS	state of CTS signal
+		- TIOCM_DSR	state of DSR signal
+		- TIOCM_RI	state of RI signal
+	The bit is set if the signal is currently driven active.  If
+	the port does not support CTS, DCD or DSR, the driver should
+	indicate that the signal is permanently active.  If RI is
+	not available, the signal should not be indicated as active.
+
+	Locking: up->lock taken.
+	Interrupts: locally disabled.
+	This call must not sleep
+*/
+static unsigned int uartlite_get_mctrl(struct uart_port *port)
+{
+	return 0;
+}
+/*
+	This function sets the modem control lines for port described
+	by 'port' to the state described by mctrl.  The relevant bits
+	of mctrl are:
+		- TIOCM_RTS	RTS signal.
+		- TIOCM_DTR	DTR signal.
+		- TIOCM_OUT1	OUT1 signal.
+		- TIOCM_OUT2	OUT2 signal.
+	If the appropriate bit is set, the signal should be driven
+	active.  If the bit is clear, the signal should be driven
+	inactive.
+
+	Locking: up->lock taken.
+	Interrupts: locally disabled.
+	This call must not sleep
+*/
+static void uartlite_set_mctrl(struct uart_port *port, unsigned int mctrl)
+{
+}
+/*
+	Control the transmission of a break signal.  If ctl is
+	nonzero, the break signal should be transmitted.  The signal
+	should be terminated when another call is made with a zero
+	ctl.
+
+	Locking: none.
+	Interrupts: caller dependent.
+	This call must not sleep
+*/
+static void uartlite_break_ctl(struct uart_port *port, int break_state)
+{
+}
+/*
+	Grab any interrupt resources and initialise any low level driver
+	state.  Enable the port for reception.  It should not activate
+	RTS nor DTR; this will be done via a separate call to set_mctrl.
+
+	Locking: port_sem taken.
+	Interrupts: globally disabled.
+*/
+static int uartlite_startup(struct uart_port *port)
+{
+	struct uartlite_port *up = (struct uartlite_port *)port;
+	int retval = 0;
+
+	// serial_init(up);
+
+	tx_enabled(port) = 1;
+	rx_enabled(port) = 1;
+
+#if IS_INT
+	/*
+	 * If the "interrupt" for this port doesn't correspond with any
+	 * hardware interrupt, we use a timer-based system.  The original
+	 * driver used to do this with IRQ0.
+	 */
+	if (!is_real_interrupt(up->port.irq)) {
+		unsigned int timeout = up->port.timeout;
+
+		timeout = timeout > 6 ? (timeout / 2 - 2) : 1;
+
+		up->timer.data = (unsigned long)up;
+		mod_timer(&up->timer, jiffies + timeout);
+	} else {
+		retval = serial_link_irq_chain(up);
+		if (retval)
+			return retval;
+	}
+#else
+	{
+		unsigned int timeout = up->port.timeout;
+
+		timeout = timeout > 6 ? (timeout / 2 - 2) : 1;
+
+		up->timer.data = (unsigned long)up;
+		mod_timer(&up->timer, jiffies + timeout);
+	}
+#endif
+	/*
+	 * Finally, enable interrupts.  Note: Modem status interrupts
+	 * are set via set_termios(), which will be occurring imminently
+	 * anyway, so we don't enable them here.
+	 */
+	up->ier = UART_IER_RLSI | UART_IER_RDI;
+	uartlite_set_ier(up, up->ier);
+
+	/*
+	 * And clear the interrupt registers again for luck.
+	 */
+	serial_reset(up);
+	return retval;
+}
+/*
+	Disable the port, disable any break condition that may be in
+	effect, and free any interrupt resources.  It should not disable
+	RTS nor DTR; this will have already been done via a separate
+	call to set_mctrl.
+
+	Locking: port_sem taken.
+	Interrupts: caller dependent.
+*/
+static void uartlite_shutdown(struct uart_port *port)
+{
+	struct uartlite_port *up = (struct uartlite_port *)port;
+
+	/*
+	 * Disable interrupts from this port
+	 */
+	up->ier = 0;
+	uartlite_set_ier(up, up->ier);
+
+	/*
+	 * Disable break condition and FIFOs
+	 */
+
+	serial_init(up);
+
+#if IS_INT
+	if (!is_real_interrupt(up->port.irq))
+		del_timer_sync(&up->timer);
+	else
+		serial_unlink_irq_chain(up);
+#else
+		del_timer_sync(&up->timer);
+#endif
+}
+/*
+	Change the port parameters, including word length, parity, stop
+	bits.  Update read_status_mask and ignore_status_mask to indicate
+	the types of events we are interested in receiving.  Relevant
+	termios->c_cflag bits are:
+		CSIZE	- word size
+		CSTOPB	- 2 stop bits
+		PARENB	- parity enable
+		PARODD	- odd parity (when PARENB is in force)
+		CREAD	- enable reception of characters (if not set,
+			  still receive characters from the port, but
+			  throw them away.
+		CRTSCTS	- if set, enable CTS status change reporting
+		CLOCAL	- if not set, enable modem status change
+			  reporting.
+	Relevant termios->c_iflag bits are:
+		INPCK	- enable frame and parity error events to be
+			  passed to the TTY layer.
+		BRKINT
+		PARMRK	- both of these enable break events to be
+			  passed to the TTY layer.
+
+		IGNPAR	- ignore parity and framing errors
+		IGNBRK	- ignore break errors,  If IGNPAR is also
+			  set, ignore overrun errors as well.
+	The interaction of the iflag bits is as follows (parity error
+	given as an example):
+	Parity error	INPCK	IGNPAR
+	None		n/a	n/a	character received
+	Yes		n/a	0	character discarded
+	Yes		0	1	character received, marked as
+					TTY_NORMAL
+	Yes		1	1	character received, marked as
+					TTY_PARITY
+
+	Other flags may be used (eg, xon/xoff characters) if your
+	hardware supports hardware "soft" flow control.
+
+	Locking: none.
+	Interrupts: caller dependent.
+	This call must not sleep
+*/
+static void
+uartlite_set_termios(struct uart_port *port, struct termios *termios,
+		       struct termios *old)
+{
+	struct uartlite_port *up = (struct uartlite_port *)port;
+	unsigned char cval ;
+	unsigned long flags;
+
+	switch (termios->c_cflag & CSIZE) {
+	case CS5:
+		cval = UART_LCR_WLEN5;
+		break;
+	case CS6:
+		cval = UART_LCR_WLEN6;
+		break;
+	case CS7:
+		cval = UART_LCR_WLEN7;
+		break;
+	default:
+	case CS8:
+		cval = UART_LCR_WLEN8;
+		break;
+	}
+
+	if (termios->c_cflag & CSTOPB)
+		cval |= UART_LCR_STOP;
+	if (termios->c_cflag & PARENB)
+		cval |= UART_LCR_PARITY;
+	if (!(termios->c_cflag & PARODD))
+		cval |= UART_LCR_EPAR;
+
+	/*
+	 * Ok, we're now changing the port state.  Do it with
+	 * interrupts disabled.
+	 */
+	spin_lock_irqsave(&up->port.lock, flags);
+
+	/*
+	 * Update the per-port timeout.
+	 */
+	// uart_update_timeout(uport, termios->c_cflag, 57600);
+
+	up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
+	if (termios->c_iflag & INPCK)
+		up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
+	if (termios->c_iflag & (BRKINT | PARMRK))
+		up->port.read_status_mask |= UART_LSR_BI;
+
+	/*
+	 * Characteres to ignore
+	 */
+	up->port.ignore_status_mask = 0;
+	if (termios->c_iflag & IGNPAR)
+		up->port.ignore_status_mask |= UART_LSR_PE | UART_LSR_FE;
+	if (termios->c_iflag & IGNBRK) {
+		up->port.ignore_status_mask |= UART_LSR_BI;
+		/*
+		 * If we're ignoring parity and break indicators,
+		 * ignore overruns too (for real raw support).
+		 */
+		if (termios->c_iflag & IGNPAR)
+			up->port.ignore_status_mask |= UART_LSR_OE;
+	}
+
+	/*
+	 * ignore all characters if CREAD is not set
+	 */
+	if ((termios->c_cflag & CREAD) == 0)
+		up->port.ignore_status_mask |= UART_LSR_DR;
+
+	/*
+	 * CTS flow control flag and modem status interrupts
+	 */
+	up->ier &= ~UART_IER_MSI;
+	if (UART_ENABLE_MS(&up->port, termios->c_cflag))
+		up->ier |= UART_IER_MSI;
+
+	uartlite_set_ier(up, up->ier);
+
+	uartlite_set_mctrl(&up->port, up->port.mctrl);
+	spin_unlock_irqrestore(&up->port.lock, flags);
+}
+/*
+	Perform any power management related activities on the specified
+	port.  State indicates the new state (defined by ACPI D0-D3),
+	oldstate indicates the previous state.  Essentially, D0 means
+	fully on, D3 means powered down.
+
+	This function should not be used to grab any resources.
+
+	This will be called when the port is initially opened and finally
+	closed, except when the port is also the system console.  This
+	will occur even if CONFIG_PM is not set.
+
+	Locking: none.
+	Interrupts: caller dependent.
+*/
+static void
+uartlite_pm(struct uart_port *port, unsigned int state,
+	      unsigned int oldstate)
+{
+	struct uartlite_port *up = (struct uartlite_port *)port;
+
+	// 8250
+	// uartlite_set_sleep(p, state != 0);
+
+	if (up->pm)
+		up->pm(port, state, oldstate);
+}
+
+/*
+ * Resource handling.
+ */
+static int
+uartlite_request_std_resource(struct uartlite_port *up)
+{
+	unsigned int size = 8 << up->port.regshift;
+	int ret = 0;
+
+	switch (up->port.iotype) {
+	case UPIO_MEM:
+		if (!up->port.mapbase)
+			break;
+
+		if (!request_mem_region(up->port.mapbase, size, "serial")) {
+			ret = -EBUSY;
+			break;
+		}
+
+		if (up->port.flags & UPF_IOREMAP) {
+			up->port.membase = ioremap(up->port.mapbase, size);
+			if (!up->port.membase) {
+				release_mem_region(up->port.mapbase, size);
+				ret = -ENOMEM;
+			}
+		}
+		break;
+
+	case UPIO_PORT:
+		if (!request_region(up->port.iobase, size, "serial"))
+			ret = -EBUSY;
+		break;
+	}
+	return ret;
+}
+/*
+	Release any memory and IO region resources currently in use by
+	the port.
+
+	Locking: none.
+	Interrupts: caller dependent.
+*/
+static void uartlite_release_port(struct uart_port *port)
+{
+	struct uartlite_port *up = (struct uartlite_port *)port;
+	unsigned int size = 8 << up->port.regshift;
+
+	switch (up->port.iotype) {
+	case UPIO_MEM:
+		if (!up->port.mapbase)
+			break;
+
+		if (up->port.flags & UPF_IOREMAP) {
+			iounmap(up->port.membase);
+			up->port.membase = NULL;
+		}
+
+		release_mem_region(up->port.mapbase, size);
+		break;
+
+	case UPIO_PORT:
+		release_region(up->port.iobase, size);
+		break;
+	}
+}
+/*
+	Request any memory and IO region resources required by the port.
+	If any fail, no resources should be registered when this function
+	returns, and it should return -EBUSY on failure.
+
+	Locking: none.
+	Interrupts: caller dependent.
+*/
+static int uartlite_request_port(struct uart_port *port)
+{
+	struct uartlite_port *up = (struct uartlite_port *)port;
+	return uartlite_request_std_resource(up);
+}
+/*
+	Perform any autoconfiguration steps required for the port.  `type`
+	contains a bit mask of the required configuration.  UART_CONFIG_TYPE
+	indicates that the port requires detection and identification.
+	up->type should be set to the type found, or PORT_UNKNOWN if
+	no port was detected.
+
+	UART_CONFIG_IRQ indicates autoconfiguration of the interrupt signal,
+	which should be probed using standard kernel autoprobing techniques.
+	This is not necessary on platforms where ports have interrupts
+	internally hard wired (eg, system on a chip implementations).
+
+	Locking: none.
+	Interrupts: caller dependent.
+*/
+static void uartlite_config_port(struct uart_port *port, int flags)
+{
+	struct uartlite_port *up = (struct uartlite_port *)port;
+
+	spin_lock_irqsave(&up->port.lock, flags);
+
+	up->port.type = (PORT_UARTLITE - PORT_UARTLITE_BASE + 1);
+	up->port.fifosize = uart_config[up->port.type].fifo_size;
+
+	spin_unlock_irqrestore(&up->port.lock, flags);
+
+	/* 8250
+	 * Find the region that we can probe for.  This in turn
+	 * tells us whether we can probe for the type of port.
+	 */
+	uartlite_request_std_resource(up);
+}
+/*
+	Verify the new serial port information contained within serinfo is
+	suitable for this port type.
+
+	Locking: none.
+	Interrupts: caller dependent.
+*/
+static int
+uartlite_verify_port(struct uart_port *port, struct serial_struct *ser)
+{
+	if (ser->irq >= NR_IRQS || ser->irq < 0 ||
+	    ser->baud_base < 9600 || ser->type < PORT_UNKNOWN ||
+	    ser->type >= ARRAY_SIZE(uart_config))
+		return -EINVAL;
+	return 0;
+}
+/*
+	Return a pointer to a string constant describing the specified
+	port, or return NULL, in which case the string 'unknown' is
+	substituted.
+
+	Locking: none.
+	Interrupts: caller dependent.
+*/
+static const char *
+uartlite_type(struct uart_port *port)
+{
+	int type = port->type;
+
+	if (type >= ARRAY_SIZE(uart_config))
+		type = 0;
+	return uart_config[type].name;
+}
+
+static struct uart_ops uartlite_pops = {
+	.tx_empty	= uartlite_tx_empty,
+	.set_mctrl	= uartlite_set_mctrl,
+	.get_mctrl	= uartlite_get_mctrl,
+	.stop_tx	= uartlite_stop_tx,
+	.start_tx	= uartlite_start_tx,
+	.stop_rx	= uartlite_stop_rx,
+	.enable_ms	= uartlite_enable_ms,
+	.break_ctl	= uartlite_break_ctl,
+	.startup	= uartlite_startup,
+	.shutdown	= uartlite_shutdown,
+	.set_termios	= uartlite_set_termios,
+	.pm		= uartlite_pm,
+	.type		= uartlite_type,
+	.release_port	= uartlite_release_port,
+	.request_port	= uartlite_request_port,
+	.config_port	= uartlite_config_port,
+	.verify_port	= uartlite_verify_port,
+};
+
+
+static void __init uartlite_init_ports(void)
+{
+	static int first = 1;
+	int i;
+
+	if (!first)
+		return;
+	first = 0;
+
+	for (i = 0; i < UART_NR; i++) {
+		if (old_serial_port[i].type == PORT_UARTLITE) {
+			struct uartlite_port *up = &uartlite_ports[i];
+			up->port.line = i;
+			up->port.iobase   = old_serial_port[i].port;
+			up->port.irq      = irq_canonicalize(old_serial_port[i].irq);
+			up->port.uartclk  = old_serial_port[i].baud_base;
+			up->port.flags    = old_serial_port[i].flags;
+			up->port.membase  = old_serial_port[i].iomem_base;
+			up->port.iotype   = old_serial_port[i].io_type;
+			up->port.regshift = old_serial_port[i].iomem_reg_shift;
+			up->port.type   = old_serial_port[i].type;
+			up->port.ops = &uartlite_pops;
+			spin_lock_init(&up->port.lock);
+			init_timer(&up->timer);
+			up->timer.function = uartlite_timeout;
+			// dump_port(&up->port);
+		}
+	}
+}
+
+static void __init
+uartlite_register_ports(struct uart_driver *drv)
+{
+	int i;
+
+	uartlite_init_ports();
+
+	for (i = 0; i < UART_NR; i++) {
+		struct uartlite_port *up = &uartlite_ports[i];
+
+#if 1 // ~8250
+		up->port.line = i;
+		up->port.ops = &uartlite_pops;
+		init_timer(&up->timer);
+		up->timer.function = uartlite_timeout;
+#endif
+		uart_add_one_port(drv, &up->port);
+	}
+}
+
+/*
+ *	Print a string to the serial port trying not to disturb
+ *	any possible real use of the port...
+ *
+ *	The console_lock must be held when we get here.
+ */
+static void
+uartlite_console_write(struct console *co, const char *s, unsigned int count)
+{
+	struct uartlite_port *up = &uartlite_ports[co->index];
+
+	uartlite_set_ier(up, 0);	// disable interrupts
+	while (*s && count-- > 0) {
+		uartlite_putchar(up, *s);
+		if (*s == '\n')
+			uartlite_putchar(up, '\r');
+		s++;
+	}
+
+	/*
+	 *	Finally, wait for transmitter to become empty
+	 *	and restore the IER
+	 */
+	//uartlite_wait_for_xmitr_empty(up);
+	uartlite_set_ier(up, up->ier);	// restore interrupts
+}
+
+static int uartlite_console_setup(struct console *co, char *options)
+{
+	struct uart_port *port;
+	int baud = 9600;
+	int bits = 8;
+	int parity = 'n';
+	int flow = 'n';
+
+	/*
+	 * Check whether an invalid uart number has been specified, and
+	 * if so, search for the first available port that does have
+	 * console support.
+	 */
+	if (co->index >= UART_NR)
+		co->index = 0;
+	port = &uartlite_ports[co->index].port;
+	if (!port->iobase && !port->membase)
+		return -ENODEV;
+	if (options)
+		uart_parse_options(options, &baud, &parity, &bits, &flow);
+
+	return uart_set_options(port, co, baud, parity, bits, flow);
+}
+
+static struct uart_driver uartlite_reg;
+static struct console uartlite_console = {
+	.name		= "ttyS",
+	.write		= uartlite_console_write,
+	.device		= uart_console_device,
+	.setup		= uartlite_console_setup,
+	.flags		= CON_PRINTBUFFER,
+	.index		= -1,
+	.data		= &uartlite_reg,
+};
+
+static int __init uartlite_console_init(void)
+{
+	struct uartlite_port *port = &uartlite_ports[0];
+
+	serial_reset(port);
+	serial_init(port);
+
+	uartlite_init_ports();
+	register_console(&uartlite_console);
+	return 0;
+}
+console_initcall(uartlite_console_init);
+
+#ifdef CONFIG_SERIAL_UARTLITE_CONSOLE
+#define SERIALUARTLITE_CONSOLE	&uartlite_console
+#else
+#define SERIALUARTLITE_CONSOLE	NULL
+#endif
+
+static struct uart_driver uartlite_reg = {
+	.owner			= THIS_MODULE,
+	.driver_name		= "uartlite",
+	.devfs_name		= "tts/",
+	.dev_name		= "ttyS",
+	.major			= TTY_MAJOR,
+	.minor			= 64,
+	.nr			= UART_NR,
+	.cons			= SERIALUARTLITE_CONSOLE,
+};
+
+int __init early_serial_setup(struct uart_port *port)
+{
+	// dump_port(port);
+	if (port->line >= ARRAY_SIZE(uartlite_ports))
+		return -ENODEV;
+
+	uartlite_init_ports();
+	uartlite_ports[port->line].port	= *port;
+	uartlite_ports[port->line].port.ops	= &uartlite_pops;
+	return 0;
+}
+
+/**
+ *	uartlite_suspend_port - suspend one serial port
+ *	@line:  serial line number
+ *      @level: the level of port suspension, as per uart_suspend_port
+ *
+ *	Suspend one serial port.
+ */
+void uartlite_suspend_port(int line)
+{
+	uart_suspend_port(&uartlite_reg, &uartlite_ports[line].port);
+}
+
+/**
+ *	uartlite_resume_port - resume one serial port
+ *	@line:  serial line number
+ *      @level: the level of port resumption, as per uart_resume_port
+ *
+ *	Resume one serial port.
+ */
+void uartlite_resume_port(int line)
+{
+	uart_resume_port(&uartlite_reg, &uartlite_ports[line].port);
+}
+
+static int __init uartlite_init(void)
+{
+	int ret, i;
+
+	printk(KERN_INFO "Serial: uartlite driver $Revision: 0.10 $ " "%d ports\n", (int) UART_NR);
+
+	for (i = 0; i < NR_IRQS; i++)
+		spin_lock_init(&irq_lists[i].lock);
+
+	ret = uart_register_driver(&uartlite_reg);
+#if 1 // ~8250
+	if (ret >= 0)
+		uartlite_register_ports(&uartlite_reg);
+#endif
+
+	return ret;
+}
+
+static void __exit uartlite_exit(void)
+{
+	int i;
+
+	for (i = 0; i < UART_NR; i++)
+		uart_remove_one_port(&uartlite_reg, &uartlite_ports[i].port);
+
+	uart_unregister_driver(&uartlite_reg);
+}
+
+module_init(uartlite_init);
+module_exit(uartlite_exit);
+
+EXPORT_SYMBOL(uartlite_suspend_port);
+EXPORT_SYMBOL(uartlite_resume_port);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Generic uartlite serial driver $Revision: 0.10 $");
+MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);
+
+
diff --git a/drivers/serial/uartlite_early.c b/drivers/serial/uartlite_early.c
new file mode 100644
index 0000000..1e3696b
--- /dev/null
+++ b/drivers/serial/uartlite_early.c
@@ -0,0 +1,233 @@
+/*
+ * Early serial console for Xilinx UartLite devices
+ *
+ * (c) Copyright 2005 DLA Systems
+ *	David H. Lynch Jr. <dhlii@dlasys.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Based on the 8250_early.c driver 
+ *
+ * This is for use before the serial driver has initialized, in
+ * particular, before the UARTs have been discovered and named.
+ * Instead of specifying the console device as, e.g., "ttyS0",
+ * we locate the device directly by its MMIO or I/O port address.
+ *
+ * The user can specify the device directly, e.g.,
+ *	console=uart,io,0x3f8,9600n8
+ *	console=uart,mmio,0xff5e0000,115200n8
+ * or platform code can call early_uart_console_init() to set
+ * the early UART device.
+ *
+ * After the normal serial driver starts, we try to locate the
+ * matching ttyS device and start a console there.
+ */
+
+#include <linux/tty.h>
+#include <linux/init.h>
+#include <linux/console.h>
+#include <linux/serial_core.h>
+#include <linux/serial_reg.h>
+#include <linux/serial.h>
+#include <asm/io.h>
+#include <asm/serial.h>
+#include <linux/serial_uartlite.h>
+
+struct early_uart_device {
+	struct uart_port port;
+	char options[16];		/* e.g., 115200n8 */
+	unsigned int baud;
+};
+
+static struct early_uart_device early_device __initdata;
+static int early_uart_registered __initdata;
+
+static _INLINE_ unsigned int __init serial_in(struct uart_port *up, int offset)
+{
+	unsigned int value;
+	offset <<= up->port.regshift;
+	switch (up->port.iotype) {
+	default:
+		value = (*(volatile unsigned int *) ( up->port.membase + offset)); 
+		__asm__ __volatile__("eieio");
+		return value;
+	}
+}
+
+static _INLINE_ void
+__init serial_out(struct uart_port *port, int offset, int value)
+{
+	offset <<= up->port.regshift;
+	switch (up->port.iotype) {
+	default:
+ 		(*(volatile unsigned int *)( up->port.membase + offset) =value); 
+ 		__asm__ __volatile__("eieio");
+		break;
+
+	}
+}
+
+static void __init wait_for_xmitr(struct uart_port *port)
+{
+	unsigned int status;
+
+	for (;;) {
+		status = serial_in(port, UART_LSR);
+		if ((status & UART_LSR_TXF) == UART_LSR_TXF)
+			return;
+		cpu_relax();
+	}
+}
+
+static void __init putc(struct uart_port *port, unsigned char c)
+{
+	wait_for_xmitr(port);
+	serial_out(port, UART_TX, c);
+}
+
+static void __init early_uart_write(struct console *console, const char *s, unsigned int count)
+{
+	struct uart_port *port = &early_device.port;
+	while (*s && count-- > 0) {
+		putc(port, *s);
+		if (*s == '\n')
+			putc(port, '\r');
+		s++;
+	}
+
+	/* Wait for transmitter to become empty and restore the IER */
+	wait_for_xmitr(port);
+}
+
+static unsigned int __init probe_baud(struct uart_port *port)
+{
+	return 56700;
+}
+
+static void __init init_port(struct early_uart_device *device)
+{
+}
+
+static int __init parse_options(struct early_uart_device *device, char *options)
+{
+	struct uart_port *port = &device->port;
+	int mapsize = 64;
+	int mmio, length;
+
+	if (!options)
+		return -ENODEV;
+
+	port->uartclk = BASE_BAUD ;
+	if (!strncmp(options, "mmio,", 5)) {
+		port->iotype = UPIO_MEM;
+		port->mapbase = simple_strtoul(options + 5, &options, 0);
+		port->membase = ioremap(port->mapbase, mapsize);
+		if (!port->membase) {
+			printk(KERN_ERR "%s: Couldn't ioremap 0x%lx\n",
+				__FUNCTION__, port->mapbase);
+			return -ENOMEM;
+		}
+		mmio = 1;
+	} else if (!strncmp(options, "io,", 3)) {
+		port->iotype = UPIO_PORT;
+		port->iobase = simple_strtoul(options + 3, &options, 0);
+		mmio = 0;
+	} else
+		return -EINVAL;
+
+	if ((options = strchr(options, ','))) {
+		options++;
+		device->baud = simple_strtoul(options, 0, 0);
+		length = min(strcspn(options, " "), sizeof(device->options));
+		strncpy(device->options, options, length);
+	} else {
+		device->baud = probe_baud(port);
+		snprintf(device->options, sizeof(device->options), "%u",
+			device->baud);
+	}
+
+	printk(KERN_INFO "Early serial console at %s 0x%lx (options '%s')\n",
+		mmio ? "MMIO" : "I/O port",
+		mmio ? port->mapbase : (unsigned long) port->iobase,
+		device->options);
+	return 0;
+}
+
+static int __init early_uart_setup(struct console *console, char *options)
+{
+	struct early_uart_device *device = &early_device;
+	int err;
+
+	if (device->port.membase || device->port.iobase)
+		return 0;
+
+	if ((err = parse_options(device, options)) < 0)
+		return err;
+
+	init_port(device);
+	return 0;
+}
+
+static struct console early_uart_console __initdata = {
+	.name	= "uart",
+	.write	= early_uart_write,
+	.setup	= early_uart_setup,
+	.flags	= CON_PRINTBUFFER,
+	.index	= -1,
+};
+
+static int __init early_uart_console_init(void)
+{
+	if (!early_uart_registered) {
+		register_console(&early_uart_console);
+		early_uart_registered = 1;
+	}
+	return 0;
+}
+console_initcall(early_uart_console_init);
+
+int __init early_serial_console_init(char *cmdline)
+{
+	char *options;
+	int err;
+
+	options = strstr(cmdline, "console=uart,");
+	if (!options)
+		return -ENODEV;
+
+	options = strchr(cmdline, ',') + 1;
+	if ((err = early_uart_setup(NULL, options)) < 0)
+		return err;
+	return early_uart_console_init();
+}
+
+static int __init early_uart_console_switch(void)
+{
+	struct early_uart_device *device = &early_device;
+	struct uart_port *port = &device->port;
+	int mmio, line = -1;
+
+	if (!(early_uart_console.flags & CON_ENABLED))
+		return 0;
+
+	/* Try to start the normal driver on a matching line.  */
+	mmio = (port->iotype == UPIO_MEM);
+#if 0
+	line = uartlite_start_console(port, device->options);
+#endif
+	if (line < 0)
+		printk("No ttyS device at %s 0x%lx for console\n",
+			mmio ? "MMIO" : "I/O port",
+			mmio ? port->mapbase :
+			    (unsigned long) port->iobase);
+
+	unregister_console(&early_uart_console);
+	if (mmio)
+		iounmap(port->membase);
+
+	return 0;
+}
+late_initcall(early_uart_console_switch);
+
diff --git a/include/linux/serial.h b/include/linux/serial.h
index 33fc8cb..99b8263 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -182,6 +182,7 @@ struct uart_port;	/* forward declaration
 extern int early_serial_setup(struct uart_port *port);
 extern int early_serial_console_init(char *options);
 extern int serial8250_start_console(struct uart_port *port, char *options);
+extern int uartlite_start_console(struct uart_port *port, char *options);
 
 #endif /* __KERNEL__ */
 #endif /* _LINUX_SERIAL_H */
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index e3710d7..053dba4 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -124,6 +124,9 @@
 /* Hilscher netx */
 #define PORT_NETX	71
 
+/*Xilinx UartLite */
+#define PORT_UARTLITE   72
+
 #ifdef __KERNEL__
 
 #include <linux/config.h>
diff --git a/include/linux/serial_uartlite.h b/include/linux/serial_uartlite.h
new file mode 100644
index 0000000..28f92e6
--- /dev/null
+++ b/include/linux/serial_uartlite.h
@@ -0,0 +1,112 @@
+/*
+ *  linux/include/linux/serial_uartlite.h
+ *
+ *  Driver definitions for Xilinx uartlite serial ports
+ *
+ *  Author: David H. Lynch Jr. <dhlii@dlasys.net>
+ *  Copyright (C) 2005 DLA Systems
+ *
+ * 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.
+ *  $Id: uartlite.h,v 0.8 2005/12/15 21:32:30 dhlii Exp $
+ *
+ * Register names bit definititions etc are deliberately named 
+ * the same as the 8250
+ *  
+ */
+#ifndef _LINUX_SERIAL_UARTLITE_H
+#define _LINUX_SERIAL_UARTLITE_H
+
+#include <linux/serial_core.h>
+#include <linux/device.h>
+#include <linux/config.h>
+
+struct old_serial_port {
+	unsigned int uart;
+	unsigned int baud_base;
+	unsigned int port;
+	unsigned int irq;
+	unsigned int flags;
+	unsigned char hub6;
+	unsigned char io_type;
+	unsigned char *iomem_base;
+	unsigned short iomem_reg_shift;
+	unsigned int type;
+};
+
+
+struct plat_serialuartlite_port {
+	unsigned long	iobase;		/* io base address */
+	void __iomem	*membase;	/* ioremap cookie or NULL */
+	unsigned long	mapbase;	/* resource base */
+	unsigned int	irq;		/* interrupt number */
+	unsigned int	uartclk;	/* UART clock rate */
+	unsigned char	regshift;	/* register shift */
+	unsigned char	iotype;		/* UPIO_* */
+	unsigned char	hub6;
+	unsigned int	flags;		/* UPF_* flags */
+};
+
+/*
+ * This replaces serial_uart_config in include/linux/serial.h
+ */
+struct serial_uartlite_config {
+	const char	*name;
+	unsigned short	fifo_size;
+	unsigned short	tx_loadsz;
+	unsigned int	flags;
+};
+
+#define UART_RX			0
+#define UART_TX			1
+#define UART_LSR		2
+#define UART_LSR_DR		(1 << (31-31))
+#define UART_LSR_RXF		(1 << (31-30))
+#define UART_LSR_THRE		(1 << (31-29))
+#define UART_LSR_TEMT		(1 << (31-29))
+#define UART_LSR_TXF		(1 << (31-28))
+#define UART_LSR_OE		(1 << (31-26))
+#define UART_LSR_FE		(1 << (31-25))
+#define UART_LSR_PE		(1 << (31-24))
+#define UART_LSR_BI		0				// UartLite has no Break Indicator
+
+#define UART_IIR		2
+#define UART_IIR_NO_INT		(1 << (31-27))
+#undef  UART_IIR_NO_INT
+#define UART_IIR_NO_INT		0				// Not present on UartLite
+#define UART_MSR		2
+
+#define UART_FCR		3
+#define UART_LCR		3
+#define UART_LCR_TXF    	(1 << (31-30))
+#define UART_LCR_RXF    	(1 << (31-30))
+#define UART_LCR_WLEN5		0				// UartLite serial parameters are fixed
+#define UART_LCR_WLEN6		0
+#define UART_LCR_WLEN7		0
+#define UART_LCR_WLEN8		0
+#define UART_LCR_STOP		0
+#define UART_LCR_PARITY 	0
+#define UART_LCR_EPAR   	0
+#define UART_IER		3
+#define UART_IER_THRI		(1 << (31-27))
+#define UART_IER_RLSI		(1 << (31-27))
+#define UART_IER_MSI		0				// UartLite has no Modem Status
+#define UART_IER_RDI		(1 << (31-27))
+
+#define UART_CAP_FIFO		(1 << 8)			/* UART has FIFO */
+
+#if defined(__i386__) && (defined(CONFIG_M386) || defined(CONFIG_M486))
+#define _INLINE_ inline
+#else
+#define _INLINE_
+#endif
+
+// #define XPAR_UARTLITE 0x40600000
+
+#define serial_in32(port, offset) (*(volatile unsigned long *)(port + (offset << 2))); __asm__ __volatile__ ("eieio");
+#define serial_out32(port, offset, value) { (*(volatile unsigned long *)(port + (offset << 2)) = value); __asm__ __volatile__ ("eieio"); }
+
+#endif // _LINUX_SERIAL_UARTLITE_H
+

^ permalink raw reply related

* Re: [PATCH] powerpc: Fix PowerMac sound i2c
From: Benjamin Herrenschmidt @ 2006-01-08 21:03 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: linuxppc-dev list, linuxppc64-dev
In-Reply-To: <jefynz0zvr.fsf@sykes.suse.de>

On Sun, 2006-01-08 at 11:37 +0100, Andreas Schwab wrote:
> Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> 
> > My patch reworking the PowerMac i2c code break the sound drivers as they
> > used to rely on some broken behaviour of i2c-keywest that is gone now.
> 
> I'm not sure, but from looking at the other i2c drivers I'd rather think
> that the old behaviour of i2c-keywest was correct.  There are only a few
> that implement both I2C_SMBUS_BLOCK_DATA and I2C_SMBUS_I2C_BLOCK_DATA, but
> none of them write the length byte together with the data.  The commands
> are ony different in behaviour when reading: with I2C_SMBUS_I2C_BLOCK_DATA
> a fixed sized block is read from the bus, whereas with
> I2C_SMBUS_BLOCK_DATA the size of the block is variable.  At least that's
> how i2c-nforce2, i2c-viapro and i2c-amd8111 implement the commands.

They are probably all wrong :) Look at the fallback implementation of
smbus using base i2c in i2c-core.c .. I also checked the smbus spec and
indeed, an smbus block transfer has the lenght on the wire.

Ben

^ permalink raw reply

* Re: io.h question
From: Andrei Konovalov @ 2006-01-05 23:54 UTC (permalink / raw)
  To: mcnernbm; +Cc: linuxppc-embedded
In-Reply-To: <OF4583615F.8ED595CE-ON852570ED.00736A17-852570ED.00736A1D@notes.udayton.edu>

Brett,

Is your program a kernel module?
asm/io.h is for kernel only (everything is inside #ifdef __KERNEL__ ... #endif)
Probably you build the module incorrectly so that __KERNEL__ is not defined.
If this is the case you may want to check the LDD book, chapter 2 "Building and
Running Modules".

Thanks,
Andrei

mcnernbm@notes.udayton.edu wrote:
> I finally noticed out_8 and in_8 and what not are located in the ppc 
> io.h file in the kernel development download.  But when I tried to do a 
> io.h with in my program I added #include <asm/io.h>  and it seems to 
> find it with not problems but it can not find the functions with in that 
> file.  Am i missing a define I need to set or something so I can see the 
> right files with in io.h I am compiling for a ppc405 on a xilinx virtex 
> 4 board.
> Thanks
> Brett
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply


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